Overview
When the sender creates a transfer, the Registry App picks the kind of transfer in this order:Prerequisites
For all transfers:- The registrar must have created the
AllocationFactorycontract, see Token Standard APIs. - The input holdings must be unlocked, belong to the sender, and cover the transfer amount.
- The sender and receiver accounts must be registry accounts.
requestedAtmust be in the past, and the transfer must complete beforeexecuteBefore.
- The registrar must have created the
TransferRulecontract for the instrument. - The sender and the receiver must satisfy the instrument’s holder credential requirements. If no holder credential requirements are defined, the credential check passes for any party. See How Requirements Are Evaluated.
- The instrument must not be paused. While it’s paused, only the registrar can create transfer offers as the sender, and direct transfers and offer acceptances only succeed if the registrar is the receiver.
- If the blocklist check is enabled for the instrument, neither the sender nor the receiver may be on the registrar’s blocklist.
API integration
The Registry App implements both versions of the Token Standard transfer API:
Use V2 if the registrar supports it, and fall back to V1 otherwise. To check which versions a
registrar supports, call the
GET /api/token-standard/v0/registrars/{registrarParty}/registry/metadata/v1/info endpoint, as outlined in
Token Standard APIs.
Every API step follows the same pattern:
- Call the Token Standard off-ledger API to get the factory or choice context and the contracts that must be disclosed.
- Exercise the interface choice through the JSON Ledger API, passing the choice context in
extraArgs.contextand the contracts indisclosedContracts.
{registrarParty} with the
party ID of the instrument admin.
For offers and self-transfers, the factory is the registrar’s
AllocationFactory contract.
Despite its name, it implements the Token Standard TransferFactory interfaces as well as the
allocation interfaces, and it is also used for mints and burns. The name is kept for backwards
compatibility. For direct transfers, the factory is the receiver’s TransferPreapproval contract.Set up a transfer pre-approval
A receiver can pre-approve incoming transfers so they complete directly, without accepting each transfer offer. A pre-approval only covers transfers to the receiver’s basic account, that is, transfers with an empty receiver account ID (""). Transfers to any other account of the receiver
always create a transfer offer.
A pre-approval covers one instrument admin and either up to 10 specific instruments, or all
instruments of that admin if no instruments are listed.
Transfer pre-approvals are specific to the Registry App and are not part of the Token Standard.
Wallet providers must integrate the
TransferPreapproval template directly.- dApp UI
- API
- Go to Preapprovals and click Create Preapproval.
- Select the instrument admin.
- Optionally, enter up to 10 instrument IDs. Leave this empty to pre-approve all instruments of the admin.
- Submit the pre-approval.
Transfer
The sender creates the transfer. For transfer offers, the receiver then accepts or rejects it.1
Sender creates the transfer
- dApp UI
- API V2 (CIP-112)
- API V1 (CIP-56)
- Go to Transfers and click Create Transfer. The Offer a Transfer dialog opens.
- Select the instrument.
- Select the sender holding label, which is the account ID to send from. The transfer is sent from holdings with this label, and the amount is capped to their balance.
- Enter the receiver and the amount to transfer.
- Optionally, enter a receiver label, which is the receiver’s account ID. Leave it empty to transfer to the receiver’s basic account.
- Set Execute before: 3 days, 7 days, or a custom date.
- Optionally, enter a reference.
- Submit the transfer.
2
Receiver accepts or rejects the transfer offer
Only needed if the transfer kind is
offer.- dApp UI
- API V2 (CIP-112)
- API V1 (CIP-56)
- Go to Transfers and select the transfer offer.
- Click Accept or Reject.
3
Optional: Sender withdraws the transfer offer
The sender can withdraw a transfer offer until the receiver accepts it. The sender’s holdings
are unlocked.
- dApp UI
- API V2 (CIP-112)
- API V1 (CIP-56)
Go to Transfers, select the transfer offer, and click Withdraw.
Labels
A label is the account ID of a holding. It is theid of the sender or receiver Account in the
V2 API, and the label of the resulting Holding contract. Labels let a party keep holdings of the
same instrument in separate accounts. The basic account of a holding is the account with the
holding’s owner as the owner, the account ID "", and no provider. See
Accounts and Labels.
- The sender sets both the sender label and the receiver label when creating the transfer. They are
part of the transfer, and
TransferInstruction_Acceptdoesn’t take a label, so the receiver can’t change the receiver label when accepting a transfer offer. - If no label is set, the basic account with account ID
""is used. - Through the API, input holdings may have any label. Holdings with a different label are faded in to the sender account before the transfer, see Input Holdings and Fade-in. The dApp UI only selects input holdings that match the sender label.
- Transfer pre-approvals only apply to transfers to the receiver’s basic account. A transfer only
completes directly through a pre-approval if the receiver label is
"". Otherwise, a transfer offer is created. - The sender and receiver accounts must be registry accounts.
- V1 wallets are unaware of accounts. See V1 wallet compatibility for how mixed input labels are handled.
Troubleshooting
Next steps
- To create or remove supply, see Mint and Burn.
- To detect executed transfers in the transaction history, see Transaction history parsing.
- For the full endpoint reference, see the Token Standard off-ledger API.