Generate Approve Transaction
Generate the transaction data needed to approve the AKKA Router to spend a token on your behalf. Returns encoded calldata that must be signed and submitted to the blockchain. If no amount is specified, unlimited approval is granted.
Unlimited vs. specific approval
- Omit
amount: Grants unlimited approval. The AKKA Router can spend any amount of this token. Recommended for frequent swapping — you only need to approve once. - Set
amount: Grants approval for exactly this many tokens (in wei). More secure, but requires a new approval transaction each time the allowance is consumed.
Using the response
Sign and submit the returned transaction object to the blockchain:Authorizations
API key for authentication. Contact AKKA on Telegram to obtain your key.
Path Parameters
Blockchain chain ID
999 999
Query Parameters
Contract address of the token to approve.
^0x[a-fA-F0-9]{40}$"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"
Number of tokens to approve (in wei). If omitted, unlimited approval is granted (type(uint256).max).
"1000000000000000000"
Response
Approve transaction data generated successfully
Encoded ERC-20 approve() calldata
"0x095ea7b3..."
Gas price in wei
"100000000"
Token contract address (send the approval tx to this address)
"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"
Always "0" for approve transactions
"0"
