Skip to main content
GET
/
swap
/
v1
/
{chainId}
/
approve
/
transaction
Generate approve transaction data
curl --request GET \
  --url https://api.akka.finance/swap/v1/{chainId}/approve/transaction \
  --header 'apikey: <api-key>'
{
  "data": "0x095ea7b3000000000000000000000000cce7452db4392b40aa0e1592a7c486e13bf69654ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
  "gasPrice": "100000000",
  "to": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
  "value": "0"
}

Documentation Index

Fetch the complete documentation index at: https://akkafinance-4d5a30d3.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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:
const hash = await walletClient.sendTransaction({
  to: approveTx.to,     // Token contract address
  data: approveTx.data,  // Encoded approve() calldata
  value: BigInt(approveTx.value), // Always "0"
});

await publicClient.waitForTransactionReceipt({ hash });
Wait for the approval transaction to be confirmed before calling the swap endpoint.

Authorizations

apikey
string
header
required

API key for authentication. Contact AKKA on Telegram to obtain your key.

Path Parameters

chainId
enum<integer>
required

Blockchain chain ID

Available options:
999
Example:

999

Query Parameters

tokenAddress
string
required

Contract address of the token to approve.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"

amount
string

Number of tokens to approve (in wei). If omitted, unlimited approval is granted (type(uint256).max).

Example:

"1000000000000000000"

Response

Approve transaction data generated successfully

data
string
required

Encoded ERC-20 approve() calldata

Example:

"0x095ea7b3..."

gasPrice
string
required

Gas price in wei

Example:

"100000000"

to
string
required

Token contract address (send the approval tx to this address)

Example:

"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"

value
string
required

Always "0" for approve transactions

Example:

"0"