메인 콘텐츠로 건너뛰기
POST
/
token
/
approve
Approve ERC20 allowance (EVM)
curl --request POST \
  --url https://api.afkcrypto.com/v1/token/approve \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "chain": "<string>",
  "token": "<string>",
  "spender": "<string>",
  "amount": "<string>",
  "from": "<string>"
}
'
{ "id": "tx_...", "status": "SUBMITTED", "hash": "0x...", "explorerUrl": "https://basescan.org/tx/0x...", "chainName": "Base" }
EVM 전용. Idempotency-Key 헤더가 필요합니다.
{ "id": "tx_...", "status": "SUBMITTED", "hash": "0x...", "explorerUrl": "https://basescan.org/tx/0x...", "chainName": "Base" }

인증

x-api-key
string
header
필수

헤더

Idempotency-Key
string<uuid>
필수

Provide a unique Idempotency-Key per user to ensure single submission.

본문

application/json
chain
string
필수

EVM chain slug.

token
string
필수

ERC20 token address to approve.

spender
string
필수

Spender (router) address to approve.

amount
string
필수

Allowance amount in token units (uint256 string).

from
string | null

Optional sender wallet; defaults to user's default wallet for the chain.

응답

Submission accepted

id
string
필수

AFK transaction id for the submitted action.

status
enum<string>
필수

Submission status.

사용 가능한 옵션:
SUBMITTED
hash
string | null
필수

On-chain transaction hash/signature (may be null at submission time).

explorerUrl
string | null
필수

Direct link to the transaction on a chain explorer. Null until a hash/signature exists.

chainName
string
필수

Human-readable chain name for display (e.g., Base, Ethereum, Solana).