跳转到主要内容
POST
/
api
/
v1
/
transactions
Create Transaction
curl --request POST \
  --url https://api.agentwallex.com/api/v1/transactions \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "agent_id": "agent_abc123",
  "direction": "outbound",
  "type": "transfer",
  "to_address": "0xabcdef1234567890abcdef1234567890abcdef12",
  "amount": "10.5",
  "token": "USDC",
  "chain": "eip155:84532",
  "memo": "service payment"
}
'
{
  "id": "tx_xyz789",
  "hash": "0xabc123def456...",
  "status": "confirmed",
  "amount": "10.5",
  "token": "USDC",
  "fee": "0.001",
  "created_at": "2025-06-15T14:30:00Z"
}
通过代理钱包提交新交易。交易经过策略引擎验证后,通过 MPC 签名并广播到区块链。

请求体

agent_id
string
必填
将发送交易的代理。
direction
string
必填
交易方向。目前仅支持 outbound
type
string
必填
交易类型。值:transfer
from_address
string
发送方地址。如果省略,则使用代理的钱包地址。
to_address
string
必填
收款方链上地址。
amount
string
必填
发送金额,以十进制字符串表示(例如 "10.5")。
token
string
必填
代币符号(例如 USDCUSDTETH)。
chain
string
必填
CAIP-2 链标识符(例如 eip155:84532)。
memo
string
可选的备注或参考字符串。

响应

示例

curl -X POST https://api.agentwallex.com/api/v1/transactions \
  -H "X-API-Key: awx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agent_abc123",
    "direction": "outbound",
    "type": "transfer",
    "to_address": "0xabcdef1234567890abcdef1234567890abcdef12",
    "amount": "10.5",
    "token": "USDC",
    "chain": "eip155:84532",
    "memo": "service payment"
  }'
Response
{
  "id": "tx_xyz789",
  "hash": "0xabc123def456...",
  "status": "confirmed",
  "amount": "10.5",
  "token": "USDC",
  "fee": "0.001",
  "created_at": "2025-06-15T14:30:00Z"
}

授权

X-API-Key
string
header
必填

API key authentication. Keys are prefixed with awx_.

请求体

application/json
agent_id
string
必填

The agent whose wallet will send the transaction.

direction
enum<string>
必填

Transaction direction. Currently only outbound is supported.

可用选项:
outbound
type
enum<string>
必填

Transaction type.

可用选项:
transfer
to_address
string
必填

Recipient on-chain address.

amount
string
必填

Amount to send as a decimal string (e.g., "10.5").

token
string
必填

Token symbol (e.g., USDC, USDT, ETH).

chain
string
必填

CAIP-2 chain identifier (e.g., eip155:84532).

from_address
string

Sender address. If omitted, the agent's wallet address is used.

memo
string

Optional memo or reference string.

响应

Transaction created and submitted.

An on-chain transaction submitted through an agent's wallet.

id
string

Unique transaction identifier.

hash
string

On-chain transaction hash (available after broadcast).

agent_id
string

Agent that initiated the transaction.

direction
enum<string>

Transaction direction.

可用选项:
outbound
type
enum<string>

Transaction type.

可用选项:
transfer
from_address
string

Sender address.

to_address
string

Recipient address.

amount
string

Amount sent as a decimal string.

token
string

Token symbol (e.g., USDC, USDT, ETH).

chain
string

CAIP-2 chain identifier.

fee
string

Network gas fee paid.

status
enum<string>

Transaction status.

可用选项:
pending,
confirmed,
failed
memo
string

Optional memo string.

created_at
string<date-time>

ISO 8601 creation timestamp.