increaseAllowance
increaseAllowance
is a method that helps developers to increase allowance from payment method token for the multiSend contract if the paymentToken
of multiSend contract is an erc20 token. It is commonly used before any methods except BatchTransferNative
in the Batch Transfer section pages. See more details about its usage in the section for batchTransfer method
Parameter
Argument | Type | Description |
---|---|---|
tokenAddress | string | one of the payment method token of the presale contract |
allowanceAmount | string | amount of increased allowance |
signer | Signer | the instance to represent wallet address. |
Example
const paymentToken = await multiSendSdk.getPaymentToken()
await multiSendSdk.increaseAllowance(paymentToken, "20", signer)
getAllowance
getAllowance
is a method that helps get the allowance amount of a given erc20 contract for multiSend contract to spend. It is commonly used to check allowance of payment contract before increaseAllowance
Parameter
Argument | Type | Desciption |
---|---|---|
spender | string | the address of the erc20 token |
owner | string | the address of the owner |
Response
Returns a BigNumber type value that indicates the amount of allowance
Property | Type | Description |
---|---|---|
Promise | BigNumber | the amount of allowance |
Example
const allowance = await multiSendSdk.getAllowance(paymentToken, await signer.getAddress())
approve
Approve
is a method that helps developers to set approval from any ERC721 contract for the multiSend contract. It is commonly used before BatchTransferERC721
with increaseAllowance
See more details about its usage in the section for BatchTransferERC721
method
Parameter
Argument | Type | Description |
---|---|---|
tokenAddress | string | contract address of an ERC721 contract |
tokenId | string | the token id under the erc721 contract |
signer | Signer | the instance to represent wallet address. |
Example
const erc721Address = <ERC721_CONTRACT_ADDRESS>
await multiSendSdk.approve(erc721Address, "1", signer)
getApproved
getApproved
is a method that helps get the approved status of a given erc721 contract for multiSend contract to spend. It is commonly used to check approval of nft contract before approve
Parameter
Argument | Type | Description |
---|---|---|
contractAddress | string | the token address of the ERC721 contract |
tokenId | string | the nftId of the nft under the contractAddress |
Response
Property | Type | Description |
---|---|---|
Promise | boolean | the approved status of the nft which indicates whether the multiSend contract is allowed to transfer this nft |
Example
const erc721Address = <ERC721_CONTRACT_ADDRESS>
**const approved = await multiSendSdk.getApproved(erc721Address, "1")**
setApproveForAll
setApproveForAll
is a method that helps developers to set approval from ERC1155 contract for multiSend contract. It is commonly used before batchTransferERC1155
with increaseAllowance
See more details about its usage in the section for BatchTransferERC1155
method
Parameter
Argument | Type | Description |
---|---|---|
tokenAddress | string | contract address of erc1155 contract |
approve | boolean | boolean indication approval for erc1155 transfer, if true, transfer is allowed |
signer | Signer | the instance to represent wallet address. |
Example
const erc1155Address = <ERC1155_CONTRACT_ADDRESS>
await multiSendSdk.setApproveForAll(erc1155Address, true, signer)
getApprovalForAll
getApprovalForAll
is a method that helps get the approved status of a given erc1155 contract for multiSend contract to spend. It is commonly used to check approval of nft token before setApproveForAll
Parameter
Argument | Type | Description |
---|---|---|
contractAddress | string | the token address of the ERC1155 contract |
ownerAddress | string | the wallet address of the owner of the ERC1155 token |
Response
Property | Type | Description |
---|---|---|
Promise | boolean | appoved status of ERC1155 contract which indicates whether the multiSend contract is allowed to transfer all of the ERC1155 tokens under the contract address |
Example
const erc1155Address = <ERC1155_CONTRACT_ADDRESS>
const approved = await multiSendSdk.getApproved(erc1155Address, await signer.getAddress())