/api/v1/call-contractPerform a token action
Performs any action on a token, from transfer, mint, and burn to pausing, whitelist changes, and ownership transfer, checking the permission and spending limits the action requires and returning a proposal for the vault's signers to approve.
MANAGE_WORKSPACEPAYMENT_INITA single endpoint performs every token action. function_name selects the
action and args carries its arguments, in order. The permission you need
depends on the action you ask for, and so do the limits that apply: a transfer
must be within both the member's role spending limit and the vault's
spending limit, while mint and burn must be within the vault's spending
limit.
Every action here is anchored to a Bitcoin transaction, so the response returns
a psbt_id and a psbt_base64 for the vault's signers to approve through
POST /api/v1/sign-psbt. Nothing reaches the network until the
vault's threshold is met.
#Actions and permissions
| Action | What it does | Who can use it |
|---|---|---|
transfer | Send tokens to another address. | Initiate Payment. The amount must be within both the member's role spending limit and the vault's spending limit. |
mint | Create new tokens. | Manage Workspace. The amount must be within the vault's spending limit. |
burn | Destroy tokens. | Manage Workspace. The amount must be within the vault's spending limit. |
pause, unpause | Halt or resume all token activity. | Manage Workspace |
transfer_ownership | Hand the token's ownership to another party. | Manage Workspace |
enable_whitelist, disable_whitelist | Turn the token's destination whitelist on or off. | Manage Workspace |
add_to_whitelist, remove_from_whitelist | Edit the token's approved-destination list. | Manage Workspace |
init | First-time initialisation after deployment. Allowed only once the deployment has at least one Bitcoin confirmation. | Manage Workspace |
When the last required approval arrives, the transaction is finalised and submitted to the Bitcoin network automatically. There is no separate confirmation step, and a transaction that has been broadcast cannot be reversed. Check the arguments, in particular the destination address and the raw-unit amount, before you collect approvals.
contract_uidnumberrequiredwallet_idstringrequiredfunction_namestringrequiredargsobject[]requiredtypestringrequiredvaluestringrequiredrecipientsstring[]optionalworkspace_idnumberrequiredprioritystringoptional#What happens next
The vault's signers approve the returned proposal with
POST /api/v1/sign-psbt, and the action is finalised and
submitted once the threshold is met. Follow it on
GET /api/v1/contract-calls, where the call_uid above
appears as UID, and use
POST /api/v1/contract-calls/resubmit if the
action stalls before it reaches the network.