get-decast-user-config
read-onlyReturns charity settings, interface-fee-max, last-token-id and the contract owner.
(get-decast-user-config)Returns (ok { charity-principal, charity-amount-ustx, interface-fee-max, last-token-id, contract-owner })
ecastdocstestnetUser scope
decast-post token that can be traded for sBTC.set-interface-fee-max.Settings the owner controls on their own contract.
Returns charity settings, interface-fee-max, last-token-id and the contract owner.
(get-decast-user-config)Returns (ok { charity-principal, charity-amount-ustx, interface-fee-max, last-token-id, contract-owner })
The user's backup storage root URL.
(get-storage-uri)Returns (ok (string-utf8 256))
Set the backup storage root URL.
(set-storage-uri (uri (string-utf8 256)))Choose an address that receives a donation on each post.
(set-charity-principal (address principal))Donation amount in micro-STX sent to the charity on each post.
(set-charity-amount-ustx (amount-ustx uint))Highest app fee you accept. Posts and boosts through an app charging more fail. Default 1 STX.
(set-interface-fee-max (amount-ustx uint))A post is a stacking action: the owner deposits STX that are stacked through PoX, mints a post NFT and logs the post at all three scopes.
Publish a post through an app.
(decast-postx
(message (string-utf8 256))
(via-url (string-utf8 256))
(amount-to-stack uint)
(content-uri (optional (string-utf8 224)))
(content-hash (optional (buff 32)))
(thumbnail-uri (optional (string-utf8 224)))
(thumbnail-hash (optional (buff 32)))
(metadata-uri (string-ascii 256))
(interface-contract <decast-interface-trait>)
(referral-principal (optional principal))
(signer <signer-manager-trait>))| message | string-utf8 256 | Post text. |
| via-url | string-utf8 256 | URL of the app page the post was made from. |
| amount-to-stack | uint | uSTX deposited and stacked. Must be 0 in the prepare phase, above 0 otherwise. |
| content-uri / content-hash | optional | Attached media and its hash. |
| thumbnail-uri / thumbnail-hash | optional | Preview image and its hash. |
| metadata-uri | string-ascii 256 | Link to the post's SIP-016 JSON with the Decast schema (see Post metadata). Returned by get-token-uri. |
| interface-contract | <decast-interface-trait> | The app the post is made through. Receives its fee and an interface-scope event. |
| referral-principal | optional principal | Gets the app's referral share of the app fee. |
| signer | <signer-manager-trait> | Must be the fastpool-max500-signer-manager. |
Boost someone else's post with STX, any SIP-010 token or an NFT.
Send value to a post's author and current owner, and log the boost.
(decast-boostx
amount-or-id is-stx is-nft
ft-contract-id nft-contract-id
author-contract content-nft-id
interface-contract referral-principal)Every post mints a SIP-009 NFT (decast-post) owned by the author. It can be listed and sold for sBTC from the user's own contract.
Standard SIP-009 reads.
(get-owner (token-id uint))
(get-token-uri (token-id uint))Transfer a post NFT you hold. Listed tokens can't be transferred.
(transfer (token-id uint) (sender principal) (recipient principal))List a post you own for sale, priced in sats of sBTC.
(list-in-usbtc (token-id uint) (price-usbtc uint))Remove your listing.
(unlist-in-usbtc (token-id uint))Buy a listed post. The listing id and max price protect against the listing changing under you.
(buy-in-usbtc (token-id uint) (expected-listing-id uint) (max-price-usbtc uint))Current listing { seller, price-usbtc, listing-id }.
(get-listing-in-usbtc (token-id uint))Principal from posts is stacked via PoX-5 and earns sBTC.
Locked/unlocked balance and the reward cycles this contract took part in.
(get-staking-status)
(get-staked-cycles (offset uint) (limit uint))Settle cycles, collect pending sBTC rewards and distribute them.
(withdraw-yield (reward-cycles (list 95 uint)) (interface-contract <decast-interface-trait>))Withdraw unlocked STX back to your wallet. Omit the amount to withdraw everything.
(withdraw-principal (amount-ustx (optional uint)))Stop stacking. Only allowed once the cycle guard from your latest post has passed.
(revoke-staked-principal)Fetch this scope's print events directly. See Events & Hiro API for decoding.
Social graph
Follows are stored on both sides: your contract records who you follow, the target's contract records you as a follower.
follow-user
owner onlyFollow another user contract. Calls the target's new-follower so both lists stay in sync.
unfollow-user
owner onlyStop following. Calls the target's remove-follower.
new-follower
contract hookHook called by another approved user contract during follow-user. Not called directly.
remove-follower
contract hookHook called by another approved user contract during unfollow-user.
get-follow-counts
read-onlyFollowing and followers totals.
get-follow-lists
read-onlyPaginated following and followers lists (pages of up to 50).
is-following / is-follower
read-onlyCheck a relationship with a specific user.