Approve/Revoke Token Transfer

Grants approval to a third party to send tokens from a certain smart contract. To revoke the approval, set "approved" to false in the body.

From

The account that sends the transactions.

You can omit the KRN if the owner address is managed by KIP-37 or Wallet Service account-pool.
Otherwise you have to provide the KRN object in the header (x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}).

Request
Security:
path Parameters
contract-address-or-alias
required
string

Contract address (in hex.) or alias.

header Parameters
x-chain-id
required
string

Kaia Network Chain ID (1001 or 8217)

Request Body schema: application/json
from
required
string

The Kaia account address of the owner

to
required
string

The Kaia account address to be authrorized for token transfer

approved
boolean

Authorization granted/cancelled. The default value is true.

Responses
200

Your request was successful.

400

The request is not valid.

401

The credential you provided is invalid.

404

The resource you requested does not exist.

409

There was a conflict with the current state of the server.

post/v2/contract/{contract-address-or-alias}/approveall
Request samples
application/json

Your request was successful.

null
Response samples
application/json

Your request was successful.

{
  • "status": "Submitted",
  • "transactionHash": "0xb5a0618be3508b3fe22e35aa96063005dd4c557cf040348cc542b0726cc30f7b"
}