跳转到主要内容
POST
/
contracts
/
send
Send contract transaction (EVM)
curl --request POST \
  --url https://api.afkcrypto.com/v1/contracts/send \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "chain": "<string>",
  "to": "<string>",
  "data": "<string>",
  "from": "<string>",
  "value": "<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.

to
string
必填

Target contract address.

data
string
必填

Calldata hex string (0x-prefixed).

from
string | null

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

value
string | null

Optional native value in wei as a string.

响应

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).