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"
}
'import requests
url = "https://api.agentwallex.com/api/v1/transactions"
payload = {
"agent_id": "agent_abc123",
"direction": "outbound",
"type": "transfer",
"to_address": "0xabcdef1234567890abcdef1234567890abcdef12",
"amount": "10.5",
"token": "USDC",
"chain": "eip155:84532",
"memo": "service payment"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: 'agent_abc123',
direction: 'outbound',
type: 'transfer',
to_address: '0xabcdef1234567890abcdef1234567890abcdef12',
amount: '10.5',
token: 'USDC',
chain: 'eip155:84532',
memo: 'service payment'
})
};
fetch('https://api.agentwallex.com/api/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agentwallex.com/api/v1/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => 'agent_abc123',
'direction' => 'outbound',
'type' => 'transfer',
'to_address' => '0xabcdef1234567890abcdef1234567890abcdef12',
'amount' => '10.5',
'token' => 'USDC',
'chain' => 'eip155:84532',
'memo' => 'service payment'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agentwallex.com/api/v1/transactions"
payload := strings.NewReader("{\n \"agent_id\": \"agent_abc123\",\n \"direction\": \"outbound\",\n \"type\": \"transfer\",\n \"to_address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n \"amount\": \"10.5\",\n \"token\": \"USDC\",\n \"chain\": \"eip155:84532\",\n \"memo\": \"service payment\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agentwallex.com/api/v1/transactions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"agent_abc123\",\n \"direction\": \"outbound\",\n \"type\": \"transfer\",\n \"to_address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n \"amount\": \"10.5\",\n \"token\": \"USDC\",\n \"chain\": \"eip155:84532\",\n \"memo\": \"service payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentwallex.com/api/v1/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"agent_abc123\",\n \"direction\": \"outbound\",\n \"type\": \"transfer\",\n \"to_address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n \"amount\": \"10.5\",\n \"token\": \"USDC\",\n \"chain\": \"eip155:84532\",\n \"memo\": \"service payment\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tx_xyz789",
"hash": "0xabc123def456...",
"status": "confirmed",
"amount": "10.5",
"token": "USDC",
"fee": "0.001",
"created_at": "2025-06-15T14:30:00Z"
}{
"code": "invalid_request",
"type": "invalid_request_error",
"message": "The request body is missing required fields."
}{
"code": "authentication_failed",
"type": "authentication_error",
"message": "The provided API key is invalid or expired."
}{
"code": "insufficient_permissions",
"type": "authorization_error",
"message": "You do not have permission to perform this action."
}{
"code": "rate_limit_exceeded",
"type": "rate_limit_error",
"message": "Too many requests. Please retry after a short delay."
}{
"code": "server_error",
"type": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}创建交易
通过代理的 MPC 安全钱包提交链上支付。
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"
}
'import requests
url = "https://api.agentwallex.com/api/v1/transactions"
payload = {
"agent_id": "agent_abc123",
"direction": "outbound",
"type": "transfer",
"to_address": "0xabcdef1234567890abcdef1234567890abcdef12",
"amount": "10.5",
"token": "USDC",
"chain": "eip155:84532",
"memo": "service payment"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: 'agent_abc123',
direction: 'outbound',
type: 'transfer',
to_address: '0xabcdef1234567890abcdef1234567890abcdef12',
amount: '10.5',
token: 'USDC',
chain: 'eip155:84532',
memo: 'service payment'
})
};
fetch('https://api.agentwallex.com/api/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agentwallex.com/api/v1/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => 'agent_abc123',
'direction' => 'outbound',
'type' => 'transfer',
'to_address' => '0xabcdef1234567890abcdef1234567890abcdef12',
'amount' => '10.5',
'token' => 'USDC',
'chain' => 'eip155:84532',
'memo' => 'service payment'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agentwallex.com/api/v1/transactions"
payload := strings.NewReader("{\n \"agent_id\": \"agent_abc123\",\n \"direction\": \"outbound\",\n \"type\": \"transfer\",\n \"to_address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n \"amount\": \"10.5\",\n \"token\": \"USDC\",\n \"chain\": \"eip155:84532\",\n \"memo\": \"service payment\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agentwallex.com/api/v1/transactions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"agent_abc123\",\n \"direction\": \"outbound\",\n \"type\": \"transfer\",\n \"to_address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n \"amount\": \"10.5\",\n \"token\": \"USDC\",\n \"chain\": \"eip155:84532\",\n \"memo\": \"service payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentwallex.com/api/v1/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"agent_abc123\",\n \"direction\": \"outbound\",\n \"type\": \"transfer\",\n \"to_address\": \"0xabcdef1234567890abcdef1234567890abcdef12\",\n \"amount\": \"10.5\",\n \"token\": \"USDC\",\n \"chain\": \"eip155:84532\",\n \"memo\": \"service payment\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tx_xyz789",
"hash": "0xabc123def456...",
"status": "confirmed",
"amount": "10.5",
"token": "USDC",
"fee": "0.001",
"created_at": "2025-06-15T14:30:00Z"
}{
"code": "invalid_request",
"type": "invalid_request_error",
"message": "The request body is missing required fields."
}{
"code": "authentication_failed",
"type": "authentication_error",
"message": "The provided API key is invalid or expired."
}{
"code": "insufficient_permissions",
"type": "authorization_error",
"message": "You do not have permission to perform this action."
}{
"code": "rate_limit_exceeded",
"type": "rate_limit_error",
"message": "Too many requests. Please retry after a short delay."
}{
"code": "server_error",
"type": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}请求体
outbound。transfer。"10.5")。USDC、USDT、ETH)。eip155:84532)。响应
显示 响应字段
显示 响应字段
示例
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"
}'
const tx = await aw.payments.send({
agentId: "agent_abc123",
to: "0xabcdef1234567890abcdef1234567890abcdef12",
amount: "10.50",
token: "USDC",
memo: "service payment",
});
tx = await aw.payments.send(
agent_id="agent_abc123",
to="0xabcdef1234567890abcdef1234567890abcdef12",
amount="10.50",
token="USDC",
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"
}
授权
API key authentication. Keys are prefixed with awx_.
请求体
The agent whose wallet will send the transaction.
Transaction direction. Currently only outbound is supported.
outbound Transaction type.
transfer Recipient on-chain address.
Amount to send as a decimal string (e.g., "10.5").
Token symbol (e.g., USDC, USDT, ETH).
CAIP-2 chain identifier (e.g., eip155:84532).
Sender address. If omitted, the agent's wallet address is used.
Optional memo or reference string.
响应
Transaction created and submitted.
An on-chain transaction submitted through an agent's wallet.
Unique transaction identifier.
On-chain transaction hash (available after broadcast).
Agent that initiated the transaction.
Transaction direction.
outbound Transaction type.
transfer Sender address.
Recipient address.
Amount sent as a decimal string.
Token symbol (e.g., USDC, USDT, ETH).
CAIP-2 chain identifier.
Network gas fee paid.
Transaction status.
pending, confirmed, failed Optional memo string.
ISO 8601 creation timestamp.