Chuyển đến nội dung chính
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"
}
Gửi giao dịch mới thông qua ví tác nhân. Giao dịch đi qua công cụ chính sách để xác thực, sau đó được ký qua MPC và phát sóng lên blockchain.

Nội dung Yêu cầu

agent_id
string
bắt buộc
Tác nhân có ví sẽ gửi giao dịch.
direction
string
bắt buộc
Hướng giao dịch. Hiện chỉ hỗ trợ outbound.
type
string
bắt buộc
Loại giao dịch. Giá trị: transfer.
from_address
string
Địa chỉ người gửi. Nếu bỏ qua, địa chỉ ví tác nhân được sử dụng.
to_address
string
bắt buộc
Địa chỉ on-chain người nhận.
amount
string
bắt buộc
Số tiền gửi dưới dạng chuỗi thập phân (ví dụ: "10.5").
token
string
bắt buộc
Ký hiệu token (ví dụ: USDC, USDT, ETH).
chain
string
bắt buộc
Định danh chuỗi CAIP-2 (ví dụ: eip155:84532).
memo
string
Ghi chú hoặc chuỗi tham chiếu tùy chọn.

Phản hồi

Ví dụ

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"
}

Ủy quyền

X-API-Key
string
header
bắt buộc

API key authentication. Keys are prefixed with awx_.

Nội dung

application/json
agent_id
string
bắt buộc

The agent whose wallet will send the transaction.

direction
enum<string>
bắt buộc

Transaction direction. Currently only outbound is supported.

Tùy chọn có sẵn:
outbound
type
enum<string>
bắt buộc

Transaction type.

Tùy chọn có sẵn:
transfer
to_address
string
bắt buộc

Recipient on-chain address.

amount
string
bắt buộc

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

token
string
bắt buộc

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

chain
string
bắt buộc

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.

Phản hồi

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.

Tùy chọn có sẵn:
outbound
type
enum<string>

Transaction type.

Tùy chọn có sẵn:
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.

Tùy chọn có sẵn:
pending,
confirmed,
failed
memo
string

Optional memo string.

created_at
string<date-time>

ISO 8601 creation timestamp.