Installation
Client Initialization
Agents
aw.agents.create(params)
Create a new agent with an MPC-secured wallet.
aw.agents.get(agentId)
Retrieve an agent by ID.
aw.agents.list(params?)
List all agents for your account.
aw.agents.freeze(agentId)
Immediately freeze an agent’s wallet, preventing all transactions.
aw.agents.unfreeze(agentId)
Re-enable an agent’s wallet after a freeze (subject to 10-minute cool-down).
Payments
aw.payments.send(params)
Send a direct on-chain payment.
aw.payments.get(transactionId)
Get transaction details and status.
aw.payments.list(params)
List transactions for an agent.
x402 Micropayments
aw.x402.createSession(params)
Create an x402 payment session with a spending budget.
aw.x402.check(params)
Check whether a target URL supports x402 payment negotiation.
aw.x402.pay(params)
Negotiate and complete one x402 payment.
aw.x402.sessionPay(sessionId, params)
Pay using an existing session budget.
aw.x402.httpInterceptor(params)
Create an HTTP fetch wrapper that automatically handles x402 v2 challenges:
- Reads the
PAYMENT-REQUIREDheader from a 402 response - Submits payment via AgentWallex
- Retries the request with the
PAYMENT-SIGNATUREheader