@axonfi/sdk 0.3.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/abis/AxonRegistry.d.ts +294 -0
- package/dist/abis/AxonRegistry.d.ts.map +1 -0
- package/dist/abis/AxonRegistry.js +381 -0
- package/dist/abis/AxonRegistry.js.map +1 -0
- package/dist/abis/AxonVault.d.ts +1577 -0
- package/dist/abis/AxonVault.d.ts.map +1 -0
- package/dist/abis/AxonVault.js +2026 -0
- package/dist/abis/AxonVault.js.map +1 -0
- package/dist/abis/AxonVaultFactory.d.ts +207 -0
- package/dist/abis/AxonVaultFactory.d.ts.map +1 -0
- package/dist/abis/AxonVaultFactory.js +269 -0
- package/dist/abis/AxonVaultFactory.js.map +1 -0
- package/dist/amounts.d.ts +37 -0
- package/dist/amounts.d.ts.map +1 -0
- package/dist/amounts.js +72 -0
- package/dist/amounts.js.map +1 -0
- package/dist/amounts.spec.d.ts +2 -0
- package/dist/amounts.spec.d.ts.map +1 -0
- package/dist/amounts.spec.js +92 -0
- package/dist/amounts.spec.js.map +1 -0
- package/dist/client.d.ts +196 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +621 -0
- package/dist/client.js.map +1 -0
- package/dist/client.spec.d.ts +2 -0
- package/dist/client.spec.d.ts.map +1 -0
- package/dist/client.spec.js +437 -0
- package/dist/client.spec.js.map +1 -0
- package/dist/constants.d.ts +110 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +172 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.spec.d.ts +2 -0
- package/dist/constants.spec.d.ts.map +1 -0
- package/dist/constants.spec.js +95 -0
- package/dist/constants.spec.js.map +1 -0
- package/dist/eip3009.d.ts +45 -0
- package/dist/eip3009.d.ts.map +1 -0
- package/dist/eip3009.js +85 -0
- package/dist/eip3009.js.map +1 -0
- package/dist/index.d.ts +21 -3020
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -3903
- package/dist/index.js.map +1 -1
- package/dist/keystore.d.ts +60 -0
- package/dist/keystore.d.ts.map +1 -0
- package/dist/keystore.js +182 -0
- package/dist/keystore.js.map +1 -0
- package/dist/keystore.spec.d.ts +2 -0
- package/dist/keystore.spec.d.ts.map +1 -0
- package/dist/keystore.spec.js +71 -0
- package/dist/keystore.spec.js.map +1 -0
- package/dist/permit2.d.ts +45 -0
- package/dist/permit2.d.ts.map +1 -0
- package/dist/permit2.js +81 -0
- package/dist/permit2.js.map +1 -0
- package/dist/signer.d.ts +35 -0
- package/dist/signer.d.ts.map +1 -0
- package/dist/signer.js +132 -0
- package/dist/signer.js.map +1 -0
- package/dist/signer.spec.d.ts +2 -0
- package/dist/signer.spec.d.ts.map +1 -0
- package/dist/signer.spec.js +94 -0
- package/dist/signer.spec.js.map +1 -0
- package/dist/tokens.d.ts +215 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +247 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +302 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +29 -0
- package/dist/utils.js.map +1 -0
- package/dist/vault.d.ts +60 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/vault.js +267 -0
- package/dist/vault.js.map +1 -0
- package/dist/vault.spec.d.ts +2 -0
- package/dist/vault.spec.d.ts.map +1 -0
- package/dist/vault.spec.js +162 -0
- package/dist/vault.spec.js.map +1 -0
- package/dist/x402.d.ts +88 -0
- package/dist/x402.d.ts.map +1 -0
- package/dist/x402.js +124 -0
- package/dist/x402.js.map +1 -0
- package/dist/x402.spec.d.ts +2 -0
- package/dist/x402.spec.d.ts.map +1 -0
- package/dist/x402.spec.js +411 -0
- package/dist/x402.spec.js.map +1 -0
- package/package.json +1 -1
- package/dist/index.cjs +0 -3954
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3020
package/dist/client.js
ADDED
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import { signPayment, signExecuteIntent, signSwapIntent, encodeRef } from './signer.js';
|
|
2
|
+
import { createAxonWalletClient } from './vault.js';
|
|
3
|
+
import { DEFAULT_DEADLINE_SECONDS, RELAYER_API, USDC } from './constants.js';
|
|
4
|
+
import { resolveToken } from './tokens.js';
|
|
5
|
+
import { parseAmount } from './amounts.js';
|
|
6
|
+
import { generateUuid } from './utils.js';
|
|
7
|
+
import { keccak256 } from 'viem';
|
|
8
|
+
import { parsePaymentRequired, findMatchingOption, extractX402Metadata, formatPaymentSignature } from './x402.js';
|
|
9
|
+
import { signTransferWithAuthorization, randomNonce, USDC_EIP712_DOMAIN } from './eip3009.js';
|
|
10
|
+
import { signPermit2WitnessTransfer, randomPermit2Nonce, X402_PROXY_ADDRESS } from './permit2.js';
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// AxonClient
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Main entry point for bots interacting with Axon.
|
|
16
|
+
*
|
|
17
|
+
* Handles EIP-712 signing, relayer communication, and status polling.
|
|
18
|
+
* Bots never submit transactions directly — they sign intents and the relayer
|
|
19
|
+
* handles all on-chain execution.
|
|
20
|
+
*
|
|
21
|
+
* All chain reads (balances, bot status, vault info) go through the relayer
|
|
22
|
+
* API — bots never need an RPC endpoint.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { AxonClient, USDC } from '@axonfi/sdk'
|
|
27
|
+
*
|
|
28
|
+
* const client = new AxonClient({
|
|
29
|
+
* vaultAddress: '0x...',
|
|
30
|
+
* chainId: 84532, // Base Sepolia
|
|
31
|
+
* botPrivateKey: '0x...',
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* const result = await client.pay({
|
|
35
|
+
* to: '0x...recipient...',
|
|
36
|
+
* token: 'USDC',
|
|
37
|
+
* amount: 5, // 5 USDC — SDK handles decimals
|
|
38
|
+
* memo: 'API call #1234 — weather data',
|
|
39
|
+
* })
|
|
40
|
+
*
|
|
41
|
+
* console.log(result.status, result.txHash)
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export class AxonClient {
|
|
45
|
+
constructor(config) {
|
|
46
|
+
// ============================================================================
|
|
47
|
+
// x402 — HTTP 402 Payment Required
|
|
48
|
+
// ============================================================================
|
|
49
|
+
/**
|
|
50
|
+
* x402 utilities for handling HTTP 402 Payment Required responses.
|
|
51
|
+
*
|
|
52
|
+
* The x402 flow:
|
|
53
|
+
* 1. Bot hits an API that returns HTTP 402 + PAYMENT-REQUIRED header
|
|
54
|
+
* 2. SDK parses the header, finds a matching payment option
|
|
55
|
+
* 3. SDK funds the bot's EOA from the vault (full Axon pipeline applies)
|
|
56
|
+
* 4. Bot signs an EIP-3009 or Permit2 authorization
|
|
57
|
+
* 5. SDK returns a PAYMENT-SIGNATURE header for the bot to retry with
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const response = await fetch('https://api.example.com/data');
|
|
62
|
+
* if (response.status === 402) {
|
|
63
|
+
* const result = await client.x402.handlePaymentRequired(response.headers);
|
|
64
|
+
* const data = await fetch('https://api.example.com/data', {
|
|
65
|
+
* headers: { 'PAYMENT-SIGNATURE': result.paymentSignature },
|
|
66
|
+
* });
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
this.x402 = {
|
|
71
|
+
/**
|
|
72
|
+
* Fund the bot's EOA from the vault for x402 settlement.
|
|
73
|
+
*
|
|
74
|
+
* This is a regular Axon payment (to = bot's own address) that goes through
|
|
75
|
+
* the full pipeline: policy engine, AI scan, human review if needed.
|
|
76
|
+
*
|
|
77
|
+
* @param amount - Amount in token base units
|
|
78
|
+
* @param token - Token address (defaults to USDC on this chain)
|
|
79
|
+
* @param metadata - Optional metadata for the payment record
|
|
80
|
+
*/
|
|
81
|
+
fund: async (amount, token, metadata) => {
|
|
82
|
+
const tokenAddress = token ?? USDC[this.chainId];
|
|
83
|
+
if (!tokenAddress) {
|
|
84
|
+
throw new Error(`No default USDC address for chain ${this.chainId}`);
|
|
85
|
+
}
|
|
86
|
+
return this.pay({
|
|
87
|
+
to: this.botAddress,
|
|
88
|
+
token: tokenAddress,
|
|
89
|
+
amount,
|
|
90
|
+
x402Funding: true,
|
|
91
|
+
...metadata,
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Handle a full x402 flow: parse header, fund bot, sign authorization, return header.
|
|
96
|
+
*
|
|
97
|
+
* Supports both EIP-3009 (USDC) and Permit2 (any ERC-20) settlement.
|
|
98
|
+
* The bot's EOA is funded from the vault first (full Axon pipeline applies).
|
|
99
|
+
*
|
|
100
|
+
* @param headers - Response headers from the 402 response (must contain PAYMENT-REQUIRED)
|
|
101
|
+
* @param maxTimeoutMs - Maximum time to wait for pending_review resolution (default: 120s)
|
|
102
|
+
* @param pollIntervalMs - Polling interval for pending_review (default: 5s)
|
|
103
|
+
* @returns Payment signature header value + funding details
|
|
104
|
+
*/
|
|
105
|
+
handlePaymentRequired: async (headers, maxTimeoutMs = 120000, pollIntervalMs = 5000) => {
|
|
106
|
+
// 1. Parse the PAYMENT-REQUIRED header
|
|
107
|
+
const headerValue = headers instanceof Headers
|
|
108
|
+
? (headers.get('payment-required') ?? headers.get('PAYMENT-REQUIRED'))
|
|
109
|
+
: (headers['payment-required'] ?? headers['PAYMENT-REQUIRED']);
|
|
110
|
+
if (!headerValue) {
|
|
111
|
+
throw new Error('x402: no PAYMENT-REQUIRED header found');
|
|
112
|
+
}
|
|
113
|
+
const parsed = parsePaymentRequired(headerValue);
|
|
114
|
+
// 2. Find a matching payment option for this chain
|
|
115
|
+
const option = findMatchingOption(parsed.accepts, this.chainId);
|
|
116
|
+
if (!option) {
|
|
117
|
+
throw new Error(`x402: no payment option matches chain ${this.chainId}. ` +
|
|
118
|
+
`Available: ${parsed.accepts.map((a) => a.network).join(', ')}`);
|
|
119
|
+
}
|
|
120
|
+
// 3. Extract metadata for the payment record
|
|
121
|
+
const x402Meta = extractX402Metadata(parsed, option);
|
|
122
|
+
// 4. Fund the bot's EOA from the vault
|
|
123
|
+
const amount = BigInt(option.amount);
|
|
124
|
+
const tokenAddress = option.asset;
|
|
125
|
+
const payInput = {
|
|
126
|
+
to: this.botAddress,
|
|
127
|
+
token: tokenAddress,
|
|
128
|
+
amount,
|
|
129
|
+
x402Funding: true,
|
|
130
|
+
resourceUrl: x402Meta.resourceUrl,
|
|
131
|
+
metadata: x402Meta.metadata,
|
|
132
|
+
};
|
|
133
|
+
if (x402Meta.memo)
|
|
134
|
+
payInput.memo = x402Meta.memo;
|
|
135
|
+
if (x402Meta.recipientLabel)
|
|
136
|
+
payInput.recipientLabel = x402Meta.recipientLabel;
|
|
137
|
+
let fundingResult = await this.pay(payInput);
|
|
138
|
+
// 5. If pending_review, poll until resolved or timeout
|
|
139
|
+
if (fundingResult.status === 'pending_review') {
|
|
140
|
+
const deadline = Date.now() + maxTimeoutMs;
|
|
141
|
+
while (fundingResult.status === 'pending_review' && Date.now() < deadline) {
|
|
142
|
+
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
143
|
+
fundingResult = await this.poll(fundingResult.requestId);
|
|
144
|
+
}
|
|
145
|
+
if (fundingResult.status === 'pending_review') {
|
|
146
|
+
throw new Error(`x402: funding timed out after ${maxTimeoutMs}ms (still pending_review)`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (fundingResult.status === 'rejected') {
|
|
150
|
+
throw new Error(`x402: funding rejected — ${fundingResult.reason ?? 'unknown reason'}`);
|
|
151
|
+
}
|
|
152
|
+
// 6. Sign the appropriate authorization
|
|
153
|
+
const botPrivateKey = this.botPrivateKey;
|
|
154
|
+
const payTo = option.payTo;
|
|
155
|
+
const usdcAddress = USDC[this.chainId]?.toLowerCase();
|
|
156
|
+
const isUsdc = tokenAddress.toLowerCase() === usdcAddress;
|
|
157
|
+
let signaturePayload;
|
|
158
|
+
if (isUsdc && USDC_EIP712_DOMAIN[this.chainId]) {
|
|
159
|
+
// EIP-3009 path (USDC — gasless)
|
|
160
|
+
const nonce = randomNonce();
|
|
161
|
+
const validAfter = 0n;
|
|
162
|
+
const validBefore = BigInt(Math.floor(Date.now() / 1000) + 300); // 5 min
|
|
163
|
+
const sig = await signTransferWithAuthorization(botPrivateKey, this.chainId, {
|
|
164
|
+
from: this.botAddress,
|
|
165
|
+
to: payTo,
|
|
166
|
+
value: amount,
|
|
167
|
+
validAfter,
|
|
168
|
+
validBefore,
|
|
169
|
+
nonce,
|
|
170
|
+
});
|
|
171
|
+
signaturePayload = {
|
|
172
|
+
scheme: 'exact',
|
|
173
|
+
signature: sig,
|
|
174
|
+
authorization: {
|
|
175
|
+
from: this.botAddress,
|
|
176
|
+
to: payTo,
|
|
177
|
+
value: amount.toString(),
|
|
178
|
+
validAfter: validAfter.toString(),
|
|
179
|
+
validBefore: validBefore.toString(),
|
|
180
|
+
nonce,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
// Permit2 path (any ERC-20)
|
|
186
|
+
const nonce = randomPermit2Nonce();
|
|
187
|
+
const deadline = BigInt(Math.floor(Date.now() / 1000) + 300);
|
|
188
|
+
const sig = await signPermit2WitnessTransfer(botPrivateKey, this.chainId, {
|
|
189
|
+
token: tokenAddress,
|
|
190
|
+
amount,
|
|
191
|
+
spender: X402_PROXY_ADDRESS,
|
|
192
|
+
nonce,
|
|
193
|
+
deadline,
|
|
194
|
+
witnessTo: payTo,
|
|
195
|
+
witnessRequestedAmount: amount,
|
|
196
|
+
});
|
|
197
|
+
signaturePayload = {
|
|
198
|
+
scheme: 'permit2',
|
|
199
|
+
signature: sig,
|
|
200
|
+
permit: {
|
|
201
|
+
permitted: { token: tokenAddress, amount: amount.toString() },
|
|
202
|
+
spender: X402_PROXY_ADDRESS,
|
|
203
|
+
nonce: nonce.toString(),
|
|
204
|
+
deadline: deadline.toString(),
|
|
205
|
+
},
|
|
206
|
+
witness: {
|
|
207
|
+
to: payTo,
|
|
208
|
+
requestedAmount: amount.toString(),
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
// 7. Format the PAYMENT-SIGNATURE header
|
|
213
|
+
const paymentSignature = formatPaymentSignature(signaturePayload);
|
|
214
|
+
const handleResult = {
|
|
215
|
+
paymentSignature,
|
|
216
|
+
selectedOption: option,
|
|
217
|
+
fundingResult: {
|
|
218
|
+
requestId: fundingResult.requestId,
|
|
219
|
+
status: fundingResult.status,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
if (fundingResult.txHash) {
|
|
223
|
+
handleResult.fundingResult.txHash = fundingResult.txHash;
|
|
224
|
+
}
|
|
225
|
+
return handleResult;
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
this.vaultAddress = config.vaultAddress;
|
|
229
|
+
this.chainId = config.chainId;
|
|
230
|
+
this.relayerUrl = config.relayerUrl ?? 'https://relay.axonfi.xyz';
|
|
231
|
+
if (!config.botPrivateKey) {
|
|
232
|
+
throw new Error('botPrivateKey is required in AxonClientConfig');
|
|
233
|
+
}
|
|
234
|
+
this.botPrivateKey = config.botPrivateKey;
|
|
235
|
+
this.walletClient = createAxonWalletClient(config.botPrivateKey, config.chainId);
|
|
236
|
+
}
|
|
237
|
+
// ============================================================================
|
|
238
|
+
// Bot address
|
|
239
|
+
// ============================================================================
|
|
240
|
+
/** Returns the bot's address derived from the configured private key. */
|
|
241
|
+
get botAddress() {
|
|
242
|
+
const account = this.walletClient.account;
|
|
243
|
+
if (!account)
|
|
244
|
+
throw new Error('No account on walletClient');
|
|
245
|
+
return account.address;
|
|
246
|
+
}
|
|
247
|
+
// ============================================================================
|
|
248
|
+
// pay()
|
|
249
|
+
// ============================================================================
|
|
250
|
+
/**
|
|
251
|
+
* Create, sign, and submit a payment intent to the Axon relayer.
|
|
252
|
+
*
|
|
253
|
+
* Three possible outcomes (all included in PaymentResult.status):
|
|
254
|
+
* - `"approved"`: fast path — txHash available immediately
|
|
255
|
+
* - `"pending_review"`: AI scan or human review in progress — poll for status
|
|
256
|
+
* - `"rejected"`: payment was rejected — reason field explains why
|
|
257
|
+
*/
|
|
258
|
+
async pay(input) {
|
|
259
|
+
const intent = this._buildPaymentIntent(input);
|
|
260
|
+
const signature = await signPayment(this.walletClient, this.vaultAddress, this.chainId, intent);
|
|
261
|
+
return this._submitPayment(intent, signature, input);
|
|
262
|
+
}
|
|
263
|
+
// ============================================================================
|
|
264
|
+
// execute()
|
|
265
|
+
// ============================================================================
|
|
266
|
+
/**
|
|
267
|
+
* Sign and submit a DeFi protocol execution to the Axon relayer.
|
|
268
|
+
*
|
|
269
|
+
* The vault approves `token` to `protocol`, calls it with `callData`,
|
|
270
|
+
* then revokes the approval. Tokens stay in the vault or go to the protocol
|
|
271
|
+
* as specified by the calldata.
|
|
272
|
+
*/
|
|
273
|
+
async execute(input) {
|
|
274
|
+
const intent = this._buildExecuteIntent(input);
|
|
275
|
+
const signature = await signExecuteIntent(this.walletClient, this.vaultAddress, this.chainId, intent);
|
|
276
|
+
return this._submitExecute(intent, signature, input);
|
|
277
|
+
}
|
|
278
|
+
// ============================================================================
|
|
279
|
+
// swap()
|
|
280
|
+
// ============================================================================
|
|
281
|
+
/**
|
|
282
|
+
* Sign and submit an in-vault token swap to the Axon relayer.
|
|
283
|
+
*
|
|
284
|
+
* Swaps tokens within the vault (no external recipient). Useful for
|
|
285
|
+
* rebalancing vault holdings.
|
|
286
|
+
*/
|
|
287
|
+
async swap(input) {
|
|
288
|
+
const intent = this._buildSwapIntent(input);
|
|
289
|
+
const signature = await signSwapIntent(this.walletClient, this.vaultAddress, this.chainId, intent);
|
|
290
|
+
return this._submitSwap(intent, signature, input);
|
|
291
|
+
}
|
|
292
|
+
// ============================================================================
|
|
293
|
+
// getBalance() — via relayer
|
|
294
|
+
// ============================================================================
|
|
295
|
+
/** Read the vault's ERC-20 balance for a given token (via relayer). */
|
|
296
|
+
async getBalance(token) {
|
|
297
|
+
const path = RELAYER_API.vaultBalance(this.vaultAddress, token, this.chainId);
|
|
298
|
+
const data = await this._get(path);
|
|
299
|
+
return BigInt(data.balance);
|
|
300
|
+
}
|
|
301
|
+
// ============================================================================
|
|
302
|
+
// getBalances() — via relayer
|
|
303
|
+
// ============================================================================
|
|
304
|
+
/**
|
|
305
|
+
* Read the vault's ERC-20 balances for multiple tokens in a single call (via relayer).
|
|
306
|
+
* Returns a record mapping token address → balance.
|
|
307
|
+
*/
|
|
308
|
+
async getBalances(tokens) {
|
|
309
|
+
const path = RELAYER_API.vaultBalances(this.vaultAddress, this.chainId);
|
|
310
|
+
const url = `${this.relayerUrl}${path}?chainId=${this.chainId}&tokens=${tokens.join(',')}`;
|
|
311
|
+
const response = await fetch(url, {
|
|
312
|
+
method: 'GET',
|
|
313
|
+
headers: { 'Content-Type': 'application/json' },
|
|
314
|
+
});
|
|
315
|
+
if (!response.ok) {
|
|
316
|
+
const body = await response.text();
|
|
317
|
+
throw new Error(`Relayer request failed [${response.status}]: ${body}`);
|
|
318
|
+
}
|
|
319
|
+
const data = (await response.json());
|
|
320
|
+
const result = {};
|
|
321
|
+
for (const [addr, val] of Object.entries(data.balances)) {
|
|
322
|
+
result[addr] = BigInt(val);
|
|
323
|
+
}
|
|
324
|
+
return result;
|
|
325
|
+
}
|
|
326
|
+
// ============================================================================
|
|
327
|
+
// isActive() — via relayer
|
|
328
|
+
// ============================================================================
|
|
329
|
+
/** Returns whether this bot is registered and active in the vault (via relayer). */
|
|
330
|
+
async isActive() {
|
|
331
|
+
const path = RELAYER_API.botStatus(this.vaultAddress, this.botAddress, this.chainId);
|
|
332
|
+
const data = await this._get(path);
|
|
333
|
+
return data.isActive;
|
|
334
|
+
}
|
|
335
|
+
// ============================================================================
|
|
336
|
+
// isPaused() — via relayer
|
|
337
|
+
// ============================================================================
|
|
338
|
+
/** Returns whether the vault is currently paused (via relayer). */
|
|
339
|
+
async isPaused() {
|
|
340
|
+
const path = RELAYER_API.vaultInfo(this.vaultAddress, this.chainId);
|
|
341
|
+
const data = await this._get(path);
|
|
342
|
+
return data.paused;
|
|
343
|
+
}
|
|
344
|
+
// ============================================================================
|
|
345
|
+
// getVaultInfo() — via relayer
|
|
346
|
+
// ============================================================================
|
|
347
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
348
|
+
async getVaultInfo() {
|
|
349
|
+
const path = RELAYER_API.vaultInfo(this.vaultAddress, this.chainId);
|
|
350
|
+
return this._get(path);
|
|
351
|
+
}
|
|
352
|
+
// ============================================================================
|
|
353
|
+
// canPayTo() — via relayer
|
|
354
|
+
// ============================================================================
|
|
355
|
+
/**
|
|
356
|
+
* Check whether this bot can pay to a given destination address (via relayer).
|
|
357
|
+
* Checks blacklist → global whitelist → bot whitelist, matching on-chain logic.
|
|
358
|
+
*/
|
|
359
|
+
async canPayTo(destination) {
|
|
360
|
+
const path = RELAYER_API.destinationCheck(this.vaultAddress, this.botAddress, destination, this.chainId);
|
|
361
|
+
return this._get(path);
|
|
362
|
+
}
|
|
363
|
+
// ============================================================================
|
|
364
|
+
// isProtocolApproved() — via relayer
|
|
365
|
+
// ============================================================================
|
|
366
|
+
/** Returns whether a protocol address is approved for executeProtocol() calls (via relayer). */
|
|
367
|
+
async isProtocolApproved(protocol) {
|
|
368
|
+
const path = RELAYER_API.protocolCheck(this.vaultAddress, protocol, this.chainId);
|
|
369
|
+
const data = await this._get(path);
|
|
370
|
+
return data.approved;
|
|
371
|
+
}
|
|
372
|
+
// ============================================================================
|
|
373
|
+
// getRebalanceTokens() — via relayer
|
|
374
|
+
// ============================================================================
|
|
375
|
+
/**
|
|
376
|
+
* Returns the effective rebalance token whitelist for this vault.
|
|
377
|
+
*
|
|
378
|
+
* If the owner set tokens on-chain, those override entirely.
|
|
379
|
+
* If no on-chain whitelist, returns relayer defaults (USDC, WETH, USDT).
|
|
380
|
+
* Use this before calling swap() to check which output tokens are allowed.
|
|
381
|
+
*/
|
|
382
|
+
async getRebalanceTokens() {
|
|
383
|
+
const path = RELAYER_API.rebalanceTokens(this.vaultAddress, this.chainId);
|
|
384
|
+
return this._get(path);
|
|
385
|
+
}
|
|
386
|
+
// ============================================================================
|
|
387
|
+
// isRebalanceTokenAllowed() — via relayer
|
|
388
|
+
// ============================================================================
|
|
389
|
+
/** Check if a specific token is allowed for rebalancing (executeSwap output) on this vault. */
|
|
390
|
+
async isRebalanceTokenAllowed(token) {
|
|
391
|
+
const path = RELAYER_API.rebalanceTokenCheck(this.vaultAddress, token, this.chainId);
|
|
392
|
+
return this._get(path);
|
|
393
|
+
}
|
|
394
|
+
// ============================================================================
|
|
395
|
+
// TOS (Terms of Service)
|
|
396
|
+
// ============================================================================
|
|
397
|
+
/** Check if a wallet has accepted the current TOS version. */
|
|
398
|
+
async getTosStatus(wallet) {
|
|
399
|
+
return this._get(RELAYER_API.tosStatus(wallet));
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Sign and submit TOS acceptance. Uses the owner's wallet (not the bot key).
|
|
403
|
+
*
|
|
404
|
+
* @param signer - Object with a `signMessage` method (e.g. a viem WalletClient
|
|
405
|
+
* or ethers Signer). This should be the vault owner's wallet, not the bot key.
|
|
406
|
+
* @param wallet - The owner's wallet address (must match the signer).
|
|
407
|
+
*/
|
|
408
|
+
async acceptTos(signer, wallet) {
|
|
409
|
+
// 1. Get current TOS version from relayer
|
|
410
|
+
const { tosVersion } = await this.getTosStatus(wallet);
|
|
411
|
+
// 2. Construct and sign the acceptance message
|
|
412
|
+
const timestamp = Math.floor(Date.now() / 1000);
|
|
413
|
+
const message = `I accept the Axon Terms of Service (${tosVersion}).\nWallet: ${wallet}\nTimestamp: ${timestamp}`;
|
|
414
|
+
const signature = await signer.signMessage({ message });
|
|
415
|
+
// 3. Submit to relayer
|
|
416
|
+
const url = `${this.relayerUrl}${RELAYER_API.TOS_ACCEPT}`;
|
|
417
|
+
const response = await fetch(url, {
|
|
418
|
+
method: 'POST',
|
|
419
|
+
headers: { 'Content-Type': 'application/json' },
|
|
420
|
+
body: JSON.stringify({ wallet, signature, tosVersion, timestamp }),
|
|
421
|
+
});
|
|
422
|
+
if (!response.ok) {
|
|
423
|
+
const body = await response.text();
|
|
424
|
+
throw new Error(`TOS acceptance failed [${response.status}]: ${body}`);
|
|
425
|
+
}
|
|
426
|
+
return response.json();
|
|
427
|
+
}
|
|
428
|
+
// ============================================================================
|
|
429
|
+
// poll() / pollExecute() / pollSwap()
|
|
430
|
+
// ============================================================================
|
|
431
|
+
/**
|
|
432
|
+
* Poll the relayer for the status of an async payment.
|
|
433
|
+
*
|
|
434
|
+
* Use this when pay() returns `status: "pending_review"`. Poll until
|
|
435
|
+
* status is `"approved"` or `"rejected"`.
|
|
436
|
+
*
|
|
437
|
+
* Recommended polling interval: 5–10 seconds.
|
|
438
|
+
*/
|
|
439
|
+
async poll(requestId) {
|
|
440
|
+
return this._get(RELAYER_API.payment(requestId));
|
|
441
|
+
}
|
|
442
|
+
/** Poll the relayer for the status of an async protocol execution. */
|
|
443
|
+
async pollExecute(requestId) {
|
|
444
|
+
return this._get(RELAYER_API.execute(requestId));
|
|
445
|
+
}
|
|
446
|
+
/** Poll the relayer for the status of an async swap. */
|
|
447
|
+
async pollSwap(requestId) {
|
|
448
|
+
return this._get(RELAYER_API.swap(requestId));
|
|
449
|
+
}
|
|
450
|
+
// ============================================================================
|
|
451
|
+
// signPayment() — low-level access
|
|
452
|
+
// ============================================================================
|
|
453
|
+
/**
|
|
454
|
+
* Sign a PaymentIntent directly without submitting to the relayer.
|
|
455
|
+
*
|
|
456
|
+
* Use this if you want to build the intent yourself and pass the signature
|
|
457
|
+
* to another system (e.g. a custom relayer integration).
|
|
458
|
+
*/
|
|
459
|
+
async signPayment(intent) {
|
|
460
|
+
return signPayment(this.walletClient, this.vaultAddress, this.chainId, intent);
|
|
461
|
+
}
|
|
462
|
+
// ============================================================================
|
|
463
|
+
// Internal helpers
|
|
464
|
+
// ============================================================================
|
|
465
|
+
async _get(path) {
|
|
466
|
+
const url = `${this.relayerUrl}${path}`;
|
|
467
|
+
const response = await fetch(url, {
|
|
468
|
+
method: 'GET',
|
|
469
|
+
headers: { 'Content-Type': 'application/json' },
|
|
470
|
+
});
|
|
471
|
+
if (!response.ok) {
|
|
472
|
+
const body = await response.text();
|
|
473
|
+
throw new Error(`Relayer request failed [${response.status}]: ${body}`);
|
|
474
|
+
}
|
|
475
|
+
return response.json();
|
|
476
|
+
}
|
|
477
|
+
_defaultDeadline() {
|
|
478
|
+
return BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_SECONDS);
|
|
479
|
+
}
|
|
480
|
+
_resolveRef(memo, ref) {
|
|
481
|
+
if (ref)
|
|
482
|
+
return ref;
|
|
483
|
+
if (memo)
|
|
484
|
+
return encodeRef(memo);
|
|
485
|
+
return '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
486
|
+
}
|
|
487
|
+
_buildPaymentIntent(input) {
|
|
488
|
+
if (input.to === '0x0000000000000000000000000000000000000000') {
|
|
489
|
+
throw new Error('Payment recipient cannot be the zero address');
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
bot: this.botAddress,
|
|
493
|
+
to: input.to,
|
|
494
|
+
token: resolveToken(input.token, this.chainId),
|
|
495
|
+
amount: parseAmount(input.amount, input.token, this.chainId),
|
|
496
|
+
deadline: input.deadline ?? this._defaultDeadline(),
|
|
497
|
+
ref: this._resolveRef(input.memo, input.ref),
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
_buildExecuteIntent(input) {
|
|
501
|
+
return {
|
|
502
|
+
bot: this.botAddress,
|
|
503
|
+
protocol: input.protocol,
|
|
504
|
+
calldataHash: keccak256(input.callData),
|
|
505
|
+
token: resolveToken(input.token, this.chainId),
|
|
506
|
+
amount: parseAmount(input.amount, input.token, this.chainId),
|
|
507
|
+
deadline: input.deadline ?? this._defaultDeadline(),
|
|
508
|
+
ref: this._resolveRef(input.memo, input.ref),
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
_buildSwapIntent(input) {
|
|
512
|
+
return {
|
|
513
|
+
bot: this.botAddress,
|
|
514
|
+
toToken: resolveToken(input.toToken, this.chainId),
|
|
515
|
+
minToAmount: parseAmount(input.minToAmount, input.toToken, this.chainId),
|
|
516
|
+
deadline: input.deadline ?? this._defaultDeadline(),
|
|
517
|
+
ref: this._resolveRef(input.memo, input.ref),
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
async _submitPayment(intent, signature, input) {
|
|
521
|
+
const idempotencyKey = input.idempotencyKey ?? generateUuid();
|
|
522
|
+
const body = {
|
|
523
|
+
// Routing
|
|
524
|
+
chainId: this.chainId,
|
|
525
|
+
vaultAddress: this.vaultAddress,
|
|
526
|
+
// Flat intent fields (matches relayer DTO)
|
|
527
|
+
bot: intent.bot,
|
|
528
|
+
to: intent.to,
|
|
529
|
+
token: intent.token,
|
|
530
|
+
amount: intent.amount.toString(),
|
|
531
|
+
deadline: intent.deadline.toString(),
|
|
532
|
+
ref: intent.ref,
|
|
533
|
+
signature,
|
|
534
|
+
// Off-chain metadata
|
|
535
|
+
idempotencyKey,
|
|
536
|
+
...(input.memo !== undefined && { memo: input.memo }),
|
|
537
|
+
...(input.resourceUrl !== undefined && { resourceUrl: input.resourceUrl }),
|
|
538
|
+
...(input.invoiceId !== undefined && { invoiceId: input.invoiceId }),
|
|
539
|
+
...(input.orderId !== undefined && { orderId: input.orderId }),
|
|
540
|
+
...(input.recipientLabel !== undefined && { recipientLabel: input.recipientLabel }),
|
|
541
|
+
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
542
|
+
...(input.x402Funding !== undefined && { x402Funding: input.x402Funding }),
|
|
543
|
+
};
|
|
544
|
+
return this._post(RELAYER_API.PAYMENTS, idempotencyKey, body);
|
|
545
|
+
}
|
|
546
|
+
async _submitExecute(intent, signature, input) {
|
|
547
|
+
const idempotencyKey = input.idempotencyKey ?? generateUuid();
|
|
548
|
+
// Resolve optional pre-swap fields
|
|
549
|
+
const fromToken = input.fromToken !== undefined ? resolveToken(input.fromToken, this.chainId) : undefined;
|
|
550
|
+
const maxFromAmount = input.maxFromAmount !== undefined
|
|
551
|
+
? parseAmount(input.maxFromAmount, input.fromToken ?? input.token, this.chainId)
|
|
552
|
+
: undefined;
|
|
553
|
+
const body = {
|
|
554
|
+
chainId: this.chainId,
|
|
555
|
+
vaultAddress: this.vaultAddress,
|
|
556
|
+
// Flat intent fields
|
|
557
|
+
bot: intent.bot,
|
|
558
|
+
protocol: intent.protocol,
|
|
559
|
+
calldataHash: intent.calldataHash,
|
|
560
|
+
token: intent.token,
|
|
561
|
+
amount: intent.amount.toString(),
|
|
562
|
+
deadline: intent.deadline.toString(),
|
|
563
|
+
ref: intent.ref,
|
|
564
|
+
signature,
|
|
565
|
+
// Protocol calldata
|
|
566
|
+
callData: input.callData,
|
|
567
|
+
// Optional pre-swap
|
|
568
|
+
...(fromToken !== undefined && { fromToken }),
|
|
569
|
+
...(maxFromAmount !== undefined && { maxFromAmount: maxFromAmount.toString() }),
|
|
570
|
+
// Off-chain metadata
|
|
571
|
+
idempotencyKey,
|
|
572
|
+
...(input.memo !== undefined && { memo: input.memo }),
|
|
573
|
+
...(input.protocolName !== undefined && { protocolName: input.protocolName }),
|
|
574
|
+
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
575
|
+
};
|
|
576
|
+
return this._post(RELAYER_API.EXECUTE, idempotencyKey, body);
|
|
577
|
+
}
|
|
578
|
+
async _submitSwap(intent, signature, input) {
|
|
579
|
+
const idempotencyKey = input.idempotencyKey ?? generateUuid();
|
|
580
|
+
// Resolve optional source token fields
|
|
581
|
+
const fromToken = input.fromToken !== undefined ? resolveToken(input.fromToken, this.chainId) : undefined;
|
|
582
|
+
const maxFromAmount = input.maxFromAmount !== undefined
|
|
583
|
+
? parseAmount(input.maxFromAmount, input.fromToken ?? input.toToken, this.chainId)
|
|
584
|
+
: undefined;
|
|
585
|
+
const body = {
|
|
586
|
+
chainId: this.chainId,
|
|
587
|
+
vaultAddress: this.vaultAddress,
|
|
588
|
+
// Flat intent fields
|
|
589
|
+
bot: intent.bot,
|
|
590
|
+
toToken: intent.toToken,
|
|
591
|
+
minToAmount: intent.minToAmount.toString(),
|
|
592
|
+
deadline: intent.deadline.toString(),
|
|
593
|
+
ref: intent.ref,
|
|
594
|
+
signature,
|
|
595
|
+
// Optional source token
|
|
596
|
+
...(fromToken !== undefined && { fromToken }),
|
|
597
|
+
...(maxFromAmount !== undefined && { maxFromAmount: maxFromAmount.toString() }),
|
|
598
|
+
// Off-chain metadata
|
|
599
|
+
idempotencyKey,
|
|
600
|
+
...(input.memo !== undefined && { memo: input.memo }),
|
|
601
|
+
};
|
|
602
|
+
return this._post(RELAYER_API.SWAP, idempotencyKey, body);
|
|
603
|
+
}
|
|
604
|
+
async _post(path, idempotencyKey, body) {
|
|
605
|
+
const url = `${this.relayerUrl}${path}`;
|
|
606
|
+
const response = await fetch(url, {
|
|
607
|
+
method: 'POST',
|
|
608
|
+
headers: {
|
|
609
|
+
'Content-Type': 'application/json',
|
|
610
|
+
'Idempotency-Key': idempotencyKey,
|
|
611
|
+
},
|
|
612
|
+
body: JSON.stringify(body),
|
|
613
|
+
});
|
|
614
|
+
if (!response.ok) {
|
|
615
|
+
const responseBody = await response.text();
|
|
616
|
+
throw new Error(`Relayer request failed [${response.status}]: ${responseBody}`);
|
|
617
|
+
}
|
|
618
|
+
return response.json();
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,sBAAsB,E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