Approve the transfer of an asset from a gas pump address

/v3/blockchain/sc/custodial/approve

2 credits per API call

Allow another blockchain address (the spender parameter in the request body) to transfer the asset from a gas pump address on behalf of the master address.

Use this API when the customer using the gas pump address sells assets on a marketplace or auction. After the customer creates a listing of the asset, they have to allow the marketplace/auction smart contract to transfer the asset to the buyer after the asset has been bought.

The asset can be one of the following types:

  • Fungible token (ERC-20 or equivalent)
  • NFT (ERC-721 or equivalent)
  • Multi Token (ERC-1155 or equivalent)

This API is supported for the following blockchains:

  • BNB Smart Chain
  • Celo
  • Ethereum
  • Harmony
  • Klaytn
  • Polygon
  • XinFin

Signing a transaction
When approving the transfer of an asset, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.

Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.

For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
enum
required

The blockchain to work with

Allowed:
string
required
length between 42 and 42

The gas pump address that holds the asset

string
required
length between 42 and 42

The blockchain address to allow the transfer of the asset from the gas pump address

number
enum
required

The type of the asset to transfer. Set 0 for fungible tokens (ERC-20 or equivalent), 1 for NFTs (ERC-721 or equivalent), or 2 for Multi Tokens (ERC-1155 or equivalent).

Allowed:
string
required
length between 42 and 42

The address of the asset to transfer

string

(Only if the asset is a fungible token or Multi Token) The amount of the asset to transfer. Do not use if the asset is an NFT.

string
length ≤ 256

(Only if the asset is a Multi Token or NFT) The ID of the token to transfer. Do not use if the asset is a fungible token.

string
required
length between 66 and 66

The private key of the blockchain address that owns the gas pump address ("master address")

number

The nonce to be set to the transfer transaction; if not present, the last known nonce will be used

fee
object

The custom defined fee; if not present, will be calculated automatically

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json