Using Vaults (2.x+)
Overview
API
Send an amount of an asset [0 == ALGO] to another account FROM the NFD Vault. Only owner of NFD can send.
silvio.algoPattern: ^.+\.algo$Base amount (in base units of specified asset - so decimals must be considered) of asset to send. If multiple assets are specified, amount is should be 0 as ALL of each are sent and closed out
21430180502795Algorand ASA IDs to transfer FROM vault - use asset 0 to send ALGO. Specifying multiple assets means ALL of each are sent and amount is ignored. If destination is vault and needs to opt-in, then need MBR/opt-in pairs (5 pairs - 8 opt-ins each - 40 assets), then 6 send calls of 7 assets w/ 5 at end for total of 40. If destination is already opted-in, then 112 (7 per txn, 16 tnxs) is max.
[2566731755297186000,2229230266104031200]Optional note to include in asset send transaction
""Example: xqzAlgorand account or NFD Name (if vault destination) the asset(s) should be sent to
Ut et ea vitae.Specifies that the receiver account is something the caller can sign for. If specified, then opt-in transactions it signs may be included
falseExample: trueAccount or NFD Vault the asset should be sent to (if allowed)
accountExample: nfdVaultPossible values: Sender of transaction, must be NFD owner
3JZA6WOUH5HMFR4U7F66R74DB53DN5EA6F3FG2UOVSNZWZTFRU6JNNOBX2Pattern: ^[A-Z2-7]{58}$Returns array of paired values representing a transaction group to submit to an Algorand node. U or S for unsigned or signed, followed by the base64-encoded message-pack of an unsigned transaction (to be signed by sender/buyer) or a signed transaction to be submitted as-is.
Velit qui qui tenetur.invalidAddress: invalidAddress is returned for an Algorand address that doesn't appear to be valid
vaultLocked: the target vault is locked, doesn't already have this asset, and won't accept it
notFound: Not Found response.
rateLimited: Too Many Requests response.
Provide transaction to send an asset owned by sender account to an NFD vault. Call to have opt-in to vault will be included if necessary. Callable by NFD owner, or if Opt-in is UNLOCKED (or asset already opted-in), anyone can call
silvio.algoPattern: ^.+\.algo$Base amount (in base units of specified asset - so decimals must be considered) of asset to send. If multiple assets specified, amount is ignored and ALL of each are sent
82202057335358Algorand ASA IDs to transfer (and opt-in inside vault if necessary) - use asset 0 to send ALGO. Specifying multiple assets means ALL of each are sent and amount is ignored. 13 is max assets that can be specified if they're being sent (2 for MBR payments, 2 for opt-in txns (8+4 asset opt-ins), 12 asset transfers). If opt-in only then 64 is maximum (1 MBR per 8 assets, 8 assets per txn * 8 txns)
[10185069543127515000]Optional note to include in asset send transaction
""Example: 3msWhether to only opt-in to the asset, instead of including asset transfer txn
falseExample: trueFJHNELY2MXD45ETZIUHMVERKPYIYC7OTXJV4WMLSNTIZNXNPJFPIJTGIXFPattern: ^[A-Z2-7]{58}$Returns array of paired values representing a transaction group to submit to an Algorand node. U or S for unsigned or signed, followed by the base64-encoded message-pack of an unsigned transaction (to be signed by sender/buyer) or a signed transaction to be submitted as-is.
Laborum voluptatem quaerat.invalidAddress: invalidAddress is returned for an Algorand address that doesn't appear to be valid
vaultLocked: the vault is locked, doesn't already have this asset, and won't accept it
notFound: Not Found response.
tooManyTransactions: The number of transactions allowed in a single transaction group (16) have been exceeded.
rateLimited: Too Many Requests response.
TypeScript Example
Setup
Send To Vault
Send From Vault
Sequence diagram of calls

Resources
Last updated