Documentation Index Fetch the complete documentation index at: https://docs.agentwallex.com/llms.txt
Use this file to discover all available pages before exploring further.
前提条件
Node.js 18+ または Python 3.9+
AgentWallex APIキー(awx_...)— 早期アクセスに登録
ブロックチェーントランザクションの基本的な理解
インストール
npm install @agentwallex/sdk
ステップバイステップの統合
クライアントの初期化
APIキーを使用してAgentWallexクライアントを作成します。テストにはsandboxを、メインネットにはproductionを使用してください。 import { AgentWallex } from "@agentwallex/sdk" ;
const aw = new AgentWallex ({
apiKey: process . env . AGENTWALLEX_API_KEY ! ,
environment: "sandbox" , // use "production" for mainnet
});
エージェントウォレットの作成
各エージェントは、設定可能なポリシーを持つ独自のMPCセキュアなウォレットを取得します。 const agent = await aw . agents . create ({
name: "my-trading-agent" ,
chain: "eip155:84532" ,
policies: {
maxTransactionAmount: "100" , // USDC
dailyLimit: "1000" ,
allowedAddresses: [ "0x..." ],
},
});
console . log ( `Agent ID: ${ agent . id } ` );
console . log ( `Wallet: ${ agent . wallet . address } ` );
ウォレットへの入金
エージェントのウォレットアドレスにテストネットトークンを送信します。Base Sepoliaでは、フォーセット を使用してテストUSDCを取得できます。 サンドボックスモードでは、エージェントウォレットはテストネット上にあります。実際の資金のリスクはありません。
支払いの送信
エージェントを通じてオンチェーン決済を実行します。 const tx = await aw . payments . send ({
agentId: agent . id ,
to: "0xRecipientAddress" ,
amount: "10.00" ,
token: "USDC" ,
});
console . log ( `Transaction hash: ${ tx . hash } ` );
console . log ( `Status: ${ tx . status } ` ); // "confirmed"
内部で何が起こるか
ポリシーチェック — ポリシーエンジンがエージェントのルール(支出制限、アドレスホワイトリスト、速度制御)に対してトランザクションを検証します。
MPC署名 — トランザクションは2-of-3しきい値MPCを使用して署名されます。単一の当事者が完全な鍵を保持することはありません。
ブロードキャスト — 署名されたトランザクションがネットワークに送信されます。
確認 — AgentWallexがトランザクションを監視・確認し、Webhookイベントを配信します。
次のステップ
TypeScript SDK すべてのメソッドと型を含む完全なSDKリファレンス。
REST API カスタム統合用のHTTPエンドポイント。
x402マイクロペイメント エージェントのAPI呼び出しごとの支払いを有効にします。
ポリシーエンジン 支出制御とセキュリティルールを設定します。