Spending Authorization (Allowance) with the SDK
The transactions.createAllowance() function is used to set an allowance for a specific spender address on the blockchain.
Last updated
The transactions.createAllowance() function is used to set an allowance for a specific spender address on the blockchain.
Last updated
An allowance is a mechanism that allows an account (the owner) to authorize another account (the spender) to withdraw a limited amount of tokens on the owner's behalf. This is useful in scenarios where you want to delegate spending authorization to another account, such as authorizing a smart contract to transfer tokens for executing certain operations, you can learn more about spending authorization .
The transactions.createAllowance()
function is used to create this allowance. It's important to note that the owner has the power to specify the maximum number of tokens the spender can withdraw, providing control over how much of their tokens can be spent by the spender.
password
string
User's wallet password
ownerAddress
string
The address of the account granting permission to spend tokens on their behalf.
spenderAddress
string
the address of the account that is being granted permission to spend tokens on behalf of the ownerAddress
amount
string
The maximum number of tokens that the spenderAddress
is allowed to withdraw from the ownerAddress
's account.
assetId
string
The asset configuration ID
contractAddress
string
Only required if assetId
is not provided.
reference
string
A UUID that correlate to a transaction in your system.
memo
string
Any message or a memo you would like to store with the transaction.
transaction
Transaction
The transaction object which contains the transaction hash and status