@axonfi/sdk 0.3.6 → 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.
Files changed (97) hide show
  1. package/README.md +40 -0
  2. package/dist/abis/AxonRegistry.d.ts +294 -0
  3. package/dist/abis/AxonRegistry.d.ts.map +1 -0
  4. package/dist/abis/AxonRegistry.js +381 -0
  5. package/dist/abis/AxonRegistry.js.map +1 -0
  6. package/dist/abis/AxonVault.d.ts +1577 -0
  7. package/dist/abis/AxonVault.d.ts.map +1 -0
  8. package/dist/abis/AxonVault.js +2026 -0
  9. package/dist/abis/AxonVault.js.map +1 -0
  10. package/dist/abis/AxonVaultFactory.d.ts +207 -0
  11. package/dist/abis/AxonVaultFactory.d.ts.map +1 -0
  12. package/dist/abis/AxonVaultFactory.js +269 -0
  13. package/dist/abis/AxonVaultFactory.js.map +1 -0
  14. package/dist/amounts.d.ts +37 -0
  15. package/dist/amounts.d.ts.map +1 -0
  16. package/dist/amounts.js +72 -0
  17. package/dist/amounts.js.map +1 -0
  18. package/dist/amounts.spec.d.ts +2 -0
  19. package/dist/amounts.spec.d.ts.map +1 -0
  20. package/dist/amounts.spec.js +92 -0
  21. package/dist/amounts.spec.js.map +1 -0
  22. package/dist/client.d.ts +196 -0
  23. package/dist/client.d.ts.map +1 -0
  24. package/dist/client.js +621 -0
  25. package/dist/client.js.map +1 -0
  26. package/dist/client.spec.d.ts +2 -0
  27. package/dist/client.spec.d.ts.map +1 -0
  28. package/dist/client.spec.js +437 -0
  29. package/dist/client.spec.js.map +1 -0
  30. package/dist/constants.d.ts +110 -0
  31. package/dist/constants.d.ts.map +1 -0
  32. package/dist/constants.js +172 -0
  33. package/dist/constants.js.map +1 -0
  34. package/dist/constants.spec.d.ts +2 -0
  35. package/dist/constants.spec.d.ts.map +1 -0
  36. package/dist/constants.spec.js +95 -0
  37. package/dist/constants.spec.js.map +1 -0
  38. package/dist/eip3009.d.ts +45 -0
  39. package/dist/eip3009.d.ts.map +1 -0
  40. package/dist/eip3009.js +85 -0
  41. package/dist/eip3009.js.map +1 -0
  42. package/dist/index.d.ts +21 -3020
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +27 -3903
  45. package/dist/index.js.map +1 -1
  46. package/dist/keystore.d.ts +60 -0
  47. package/dist/keystore.d.ts.map +1 -0
  48. package/dist/keystore.js +182 -0
  49. package/dist/keystore.js.map +1 -0
  50. package/dist/keystore.spec.d.ts +2 -0
  51. package/dist/keystore.spec.d.ts.map +1 -0
  52. package/dist/keystore.spec.js +71 -0
  53. package/dist/keystore.spec.js.map +1 -0
  54. package/dist/permit2.d.ts +45 -0
  55. package/dist/permit2.d.ts.map +1 -0
  56. package/dist/permit2.js +81 -0
  57. package/dist/permit2.js.map +1 -0
  58. package/dist/signer.d.ts +35 -0
  59. package/dist/signer.d.ts.map +1 -0
  60. package/dist/signer.js +132 -0
  61. package/dist/signer.js.map +1 -0
  62. package/dist/signer.spec.d.ts +2 -0
  63. package/dist/signer.spec.d.ts.map +1 -0
  64. package/dist/signer.spec.js +94 -0
  65. package/dist/signer.spec.js.map +1 -0
  66. package/dist/tokens.d.ts +215 -0
  67. package/dist/tokens.d.ts.map +1 -0
  68. package/dist/tokens.js +247 -0
  69. package/dist/tokens.js.map +1 -0
  70. package/dist/types.d.ts +302 -0
  71. package/dist/types.d.ts.map +1 -0
  72. package/dist/types.js +2 -0
  73. package/dist/types.js.map +1 -0
  74. package/dist/utils.d.ts +8 -0
  75. package/dist/utils.d.ts.map +1 -0
  76. package/dist/utils.js +29 -0
  77. package/dist/utils.js.map +1 -0
  78. package/dist/vault.d.ts +60 -0
  79. package/dist/vault.d.ts.map +1 -0
  80. package/dist/vault.js +267 -0
  81. package/dist/vault.js.map +1 -0
  82. package/dist/vault.spec.d.ts +2 -0
  83. package/dist/vault.spec.d.ts.map +1 -0
  84. package/dist/vault.spec.js +162 -0
  85. package/dist/vault.spec.js.map +1 -0
  86. package/dist/x402.d.ts +88 -0
  87. package/dist/x402.d.ts.map +1 -0
  88. package/dist/x402.js +124 -0
  89. package/dist/x402.js.map +1 -0
  90. package/dist/x402.spec.d.ts +2 -0
  91. package/dist/x402.spec.d.ts.map +1 -0
  92. package/dist/x402.spec.js +411 -0
  93. package/dist/x402.spec.js.map +1 -0
  94. package/package.json +1 -1
  95. package/dist/index.cjs +0 -3954
  96. package/dist/index.cjs.map +0 -1
  97. package/dist/index.d.cts +0 -3020
package/dist/index.cjs DELETED
@@ -1,3954 +0,0 @@
1
- 'use strict';
2
-
3
- var viem = require('viem');
4
- var accounts = require('viem/accounts');
5
- var chains = require('viem/chains');
6
- var scrypt = require('@noble/hashes/scrypt');
7
- var sha3 = require('@noble/hashes/sha3');
8
- var aes = require('@noble/ciphers/aes');
9
-
10
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
- }) : x)(function(x) {
13
- if (typeof require !== "undefined") return require.apply(this, arguments);
14
- throw Error('Dynamic require of "' + x + '" is not supported');
15
- });
16
- var PAYMENT_INTENT_TYPEHASH = viem.keccak256(
17
- viem.stringToBytes("PaymentIntent(address bot,address to,address token,uint256 amount,uint256 deadline,bytes32 ref)")
18
- );
19
- var EXECUTE_INTENT_TYPEHASH = viem.keccak256(
20
- viem.stringToBytes(
21
- "ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 deadline,bytes32 ref)"
22
- )
23
- );
24
- var SWAP_INTENT_TYPEHASH = viem.keccak256(
25
- viem.stringToBytes("SwapIntent(address bot,address toToken,uint256 minToAmount,uint256 deadline,bytes32 ref)")
26
- );
27
- var EIP712_DOMAIN_NAME = "AxonVault";
28
- var EIP712_DOMAIN_VERSION = "1";
29
- var NATIVE_ETH = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
30
- var USDC = {
31
- // Base mainnet
32
- 8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
33
- // Base Sepolia
34
- 84532: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
35
- // Arbitrum One
36
- 42161: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
37
- // Arbitrum Sepolia
38
- 421614: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"
39
- };
40
- var Chain = /* @__PURE__ */ ((Chain2) => {
41
- Chain2[Chain2["Base"] = 8453] = "Base";
42
- Chain2[Chain2["BaseSepolia"] = 84532] = "BaseSepolia";
43
- Chain2[Chain2["Arbitrum"] = 42161] = "Arbitrum";
44
- Chain2[Chain2["ArbitrumSepolia"] = 421614] = "ArbitrumSepolia";
45
- return Chain2;
46
- })(Chain || {});
47
- var SUPPORTED_CHAIN_IDS = [8453, 84532, 42161, 421614];
48
- var CHAIN_NAMES = {
49
- [8453 /* Base */]: "Base",
50
- [84532 /* BaseSepolia */]: "Base Sepolia",
51
- [42161 /* Arbitrum */]: "Arbitrum One",
52
- [421614 /* ArbitrumSepolia */]: "Arbitrum Sepolia",
53
- // Future v1 chains (metadata only — not in SUPPORTED_CHAIN_IDS yet)
54
- 10: "Optimism",
55
- 11155420: "OP Sepolia",
56
- 137: "Polygon",
57
- 80002: "Polygon Amoy"
58
- };
59
- var EXPLORER_TX = {
60
- [8453 /* Base */]: "https://basescan.org/tx/",
61
- [84532 /* BaseSepolia */]: "https://sepolia.basescan.org/tx/",
62
- [42161 /* Arbitrum */]: "https://arbiscan.io/tx/",
63
- [421614 /* ArbitrumSepolia */]: "https://sepolia.arbiscan.io/tx/",
64
- 10: "https://optimistic.etherscan.io/tx/",
65
- 11155420: "https://sepolia-optimism.etherscan.io/tx/",
66
- 137: "https://polygonscan.com/tx/",
67
- 80002: "https://amoy.polygonscan.com/tx/"
68
- };
69
- var EXPLORER_ADDR = {
70
- [8453 /* Base */]: "https://basescan.org/address/",
71
- [84532 /* BaseSepolia */]: "https://sepolia.basescan.org/address/",
72
- [42161 /* Arbitrum */]: "https://arbiscan.io/address/",
73
- [421614 /* ArbitrumSepolia */]: "https://sepolia.arbiscan.io/address/",
74
- 10: "https://optimistic.etherscan.io/address/",
75
- 11155420: "https://sepolia-optimism.etherscan.io/address/",
76
- 137: "https://polygonscan.com/address/",
77
- 80002: "https://amoy.polygonscan.com/address/"
78
- };
79
- var DEFAULT_DEADLINE_SECONDS = 300;
80
- var WINDOW = {
81
- ONE_HOUR: 3600n,
82
- ONE_DAY: 86400n,
83
- ONE_WEEK: 604800n,
84
- THIRTY_DAYS: 2592000n
85
- };
86
- var PaymentErrorCode = {
87
- /** Payment destination is the vault itself */
88
- SELF_PAYMENT: "SELF_PAYMENT",
89
- /** Payment destination is the zero address */
90
- ZERO_ADDRESS: "ZERO_ADDRESS",
91
- /** Payment amount is zero */
92
- ZERO_AMOUNT: "ZERO_AMOUNT",
93
- /** Vault does not hold enough of the requested token */
94
- INSUFFICIENT_BALANCE: "INSUFFICIENT_BALANCE",
95
- /** EIP-712 signature verification failed */
96
- INVALID_SIGNATURE: "INVALID_SIGNATURE",
97
- /** Payment intent deadline has passed */
98
- DEADLINE_EXPIRED: "DEADLINE_EXPIRED",
99
- /** Bot is temporarily paused by the operator */
100
- BOT_PAUSED: "BOT_PAUSED",
101
- /** Bot address is not registered/active in the vault */
102
- BOT_NOT_ACTIVE: "BOT_NOT_ACTIVE",
103
- /** Destination address is on the global or vault blacklist */
104
- BLACKLISTED: "BLACKLISTED",
105
- /** Rolling-window spending limit (USD amount) exceeded */
106
- SPENDING_LIMIT_EXCEEDED: "SPENDING_LIMIT_EXCEEDED",
107
- /** Rolling-window transaction count limit exceeded */
108
- TX_COUNT_EXCEEDED: "TX_COUNT_EXCEEDED",
109
- /** Single transaction exceeds the bot's on-chain maxPerTxAmount */
110
- MAX_PER_TX_EXCEEDED: "MAX_PER_TX_EXCEEDED",
111
- /** Vault-level daily aggregate spending limit exceeded */
112
- VAULT_AGGREGATE_EXCEEDED: "VAULT_AGGREGATE_EXCEEDED",
113
- /** eth_call simulation of the on-chain transaction reverted */
114
- SIMULATION_FAILED: "SIMULATION_FAILED",
115
- /** Routed to human review (AI scan flagged or no consensus) */
116
- PENDING_REVIEW: "PENDING_REVIEW",
117
- /** Relayer wallet has insufficient gas to submit the transaction */
118
- RELAYER_OUT_OF_GAS: "RELAYER_OUT_OF_GAS",
119
- /** On-chain transaction submission failed */
120
- SUBMISSION_FAILED: "SUBMISSION_FAILED",
121
- /** Destination not in the vault/bot whitelist */
122
- DESTINATION_NOT_WHITELISTED: "DESTINATION_NOT_WHITELISTED",
123
- /** Vault address is not a valid AxonVault or was not deployed by a known factory */
124
- INVALID_VAULT: "INVALID_VAULT",
125
- /** Rebalance output token is not in the whitelist (on-chain or relayer default) */
126
- REBALANCE_TOKEN_NOT_ALLOWED: "REBALANCE_TOKEN_NOT_ALLOWED",
127
- /** Rebalance input amount exceeds the bot's maxRebalanceAmount cap */
128
- MAX_REBALANCE_AMOUNT_EXCEEDED: "MAX_REBALANCE_AMOUNT_EXCEEDED",
129
- /** Unknown or internal error */
130
- INTERNAL_ERROR: "INTERNAL_ERROR"
131
- };
132
- var RELAYER_API = {
133
- PAYMENTS: "/v1/payments",
134
- payment: (requestId) => `/v1/payments/${requestId}`,
135
- EXECUTE: "/v1/execute",
136
- execute: (requestId) => `/v1/execute/${requestId}`,
137
- SWAP: "/v1/swap",
138
- swap: (requestId) => `/v1/swap/${requestId}`,
139
- // Vault read endpoints (relayer reads chain on behalf of bots)
140
- vaultBalance: (vault, token, chainId) => `/v1/vault/${vault}/balance/${token}?chainId=${chainId}`,
141
- vaultBalances: (vault, chainId) => `/v1/vault/${vault}/balances`,
142
- vaultInfo: (vault, chainId) => `/v1/vault/${vault}/info?chainId=${chainId}`,
143
- botStatus: (vault, bot, chainId) => `/v1/vault/${vault}/bot/${bot}/status?chainId=${chainId}`,
144
- destinationCheck: (vault, bot, destination, chainId) => `/v1/vault/${vault}/bot/${bot}/destination/${destination}?chainId=${chainId}`,
145
- protocolCheck: (vault, protocol, chainId) => `/v1/vault/${vault}/protocol/${protocol}?chainId=${chainId}`,
146
- rebalanceTokens: (vault, chainId) => `/v1/vault/${vault}/rebalance-tokens?chainId=${chainId}`,
147
- rebalanceTokenCheck: (vault, token, chainId) => `/v1/vault/${vault}/rebalance-token/${token}?chainId=${chainId}`,
148
- // TOS endpoints
149
- tosStatus: (wallet) => `/v1/tos/status?wallet=${wallet}`,
150
- TOS_ACCEPT: "/v1/tos/accept"
151
- };
152
-
153
- // src/signer.ts
154
- var PAYMENT_INTENT_TYPES = {
155
- PaymentIntent: [
156
- { name: "bot", type: "address" },
157
- { name: "to", type: "address" },
158
- { name: "token", type: "address" },
159
- { name: "amount", type: "uint256" },
160
- { name: "deadline", type: "uint256" },
161
- { name: "ref", type: "bytes32" }
162
- ]
163
- };
164
- var EXECUTE_INTENT_TYPES = {
165
- ExecuteIntent: [
166
- { name: "bot", type: "address" },
167
- { name: "protocol", type: "address" },
168
- { name: "calldataHash", type: "bytes32" },
169
- { name: "token", type: "address" },
170
- { name: "amount", type: "uint256" },
171
- { name: "deadline", type: "uint256" },
172
- { name: "ref", type: "bytes32" }
173
- ]
174
- };
175
- var SWAP_INTENT_TYPES = {
176
- SwapIntent: [
177
- { name: "bot", type: "address" },
178
- { name: "toToken", type: "address" },
179
- { name: "minToAmount", type: "uint256" },
180
- { name: "deadline", type: "uint256" },
181
- { name: "ref", type: "bytes32" }
182
- ]
183
- };
184
- function makeDomain(vaultAddress, chainId) {
185
- return {
186
- name: EIP712_DOMAIN_NAME,
187
- version: EIP712_DOMAIN_VERSION,
188
- chainId,
189
- verifyingContract: vaultAddress
190
- };
191
- }
192
- async function signPayment(walletClient, vaultAddress, chainId, intent) {
193
- if (!walletClient.account) {
194
- throw new Error("walletClient has no account attached");
195
- }
196
- return walletClient.signTypedData({
197
- account: walletClient.account,
198
- domain: makeDomain(vaultAddress, chainId),
199
- types: PAYMENT_INTENT_TYPES,
200
- primaryType: "PaymentIntent",
201
- message: {
202
- bot: intent.bot,
203
- to: intent.to,
204
- token: intent.token,
205
- amount: intent.amount,
206
- deadline: intent.deadline,
207
- ref: intent.ref
208
- }
209
- });
210
- }
211
- async function signExecuteIntent(walletClient, vaultAddress, chainId, intent) {
212
- if (!walletClient.account) {
213
- throw new Error("walletClient has no account attached");
214
- }
215
- return walletClient.signTypedData({
216
- account: walletClient.account,
217
- domain: makeDomain(vaultAddress, chainId),
218
- types: EXECUTE_INTENT_TYPES,
219
- primaryType: "ExecuteIntent",
220
- message: {
221
- bot: intent.bot,
222
- protocol: intent.protocol,
223
- calldataHash: intent.calldataHash,
224
- token: intent.token,
225
- amount: intent.amount,
226
- deadline: intent.deadline,
227
- ref: intent.ref
228
- }
229
- });
230
- }
231
- async function signSwapIntent(walletClient, vaultAddress, chainId, intent) {
232
- if (!walletClient.account) {
233
- throw new Error("walletClient has no account attached");
234
- }
235
- return walletClient.signTypedData({
236
- account: walletClient.account,
237
- domain: makeDomain(vaultAddress, chainId),
238
- types: SWAP_INTENT_TYPES,
239
- primaryType: "SwapIntent",
240
- message: {
241
- bot: intent.bot,
242
- toToken: intent.toToken,
243
- minToAmount: intent.minToAmount,
244
- deadline: intent.deadline,
245
- ref: intent.ref
246
- }
247
- });
248
- }
249
- function encodeRef(memo) {
250
- return viem.keccak256(viem.stringToBytes(memo));
251
- }
252
-
253
- // src/abis/AxonVault.ts
254
- var AxonVaultAbi = [
255
- {
256
- "type": "constructor",
257
- "inputs": [
258
- {
259
- "name": "_owner",
260
- "type": "address",
261
- "internalType": "address"
262
- },
263
- {
264
- "name": "_axonRegistry",
265
- "type": "address",
266
- "internalType": "address"
267
- }
268
- ],
269
- "stateMutability": "nonpayable"
270
- },
271
- {
272
- "type": "receive",
273
- "stateMutability": "payable"
274
- },
275
- {
276
- "type": "function",
277
- "name": "DOMAIN_SEPARATOR",
278
- "inputs": [],
279
- "outputs": [
280
- {
281
- "name": "",
282
- "type": "bytes32",
283
- "internalType": "bytes32"
284
- }
285
- ],
286
- "stateMutability": "view"
287
- },
288
- {
289
- "type": "function",
290
- "name": "MAX_SPENDING_LIMITS",
291
- "inputs": [],
292
- "outputs": [
293
- {
294
- "name": "",
295
- "type": "uint8",
296
- "internalType": "uint8"
297
- }
298
- ],
299
- "stateMutability": "view"
300
- },
301
- {
302
- "type": "function",
303
- "name": "NATIVE_ETH",
304
- "inputs": [],
305
- "outputs": [
306
- {
307
- "name": "",
308
- "type": "address",
309
- "internalType": "address"
310
- }
311
- ],
312
- "stateMutability": "view"
313
- },
314
- {
315
- "type": "function",
316
- "name": "VERSION",
317
- "inputs": [],
318
- "outputs": [
319
- {
320
- "name": "",
321
- "type": "uint16",
322
- "internalType": "uint16"
323
- }
324
- ],
325
- "stateMutability": "view"
326
- },
327
- {
328
- "type": "function",
329
- "name": "acceptOwnership",
330
- "inputs": [],
331
- "outputs": [],
332
- "stateMutability": "nonpayable"
333
- },
334
- {
335
- "type": "function",
336
- "name": "addBot",
337
- "inputs": [
338
- {
339
- "name": "bot",
340
- "type": "address",
341
- "internalType": "address"
342
- },
343
- {
344
- "name": "params",
345
- "type": "tuple",
346
- "internalType": "struct AxonVault.BotConfigParams",
347
- "components": [
348
- {
349
- "name": "maxPerTxAmount",
350
- "type": "uint256",
351
- "internalType": "uint256"
352
- },
353
- {
354
- "name": "maxRebalanceAmount",
355
- "type": "uint256",
356
- "internalType": "uint256"
357
- },
358
- {
359
- "name": "spendingLimits",
360
- "type": "tuple[]",
361
- "internalType": "struct AxonVault.SpendingLimit[]",
362
- "components": [
363
- {
364
- "name": "amount",
365
- "type": "uint256",
366
- "internalType": "uint256"
367
- },
368
- {
369
- "name": "maxCount",
370
- "type": "uint256",
371
- "internalType": "uint256"
372
- },
373
- {
374
- "name": "windowSeconds",
375
- "type": "uint256",
376
- "internalType": "uint256"
377
- }
378
- ]
379
- },
380
- {
381
- "name": "aiTriggerThreshold",
382
- "type": "uint256",
383
- "internalType": "uint256"
384
- },
385
- {
386
- "name": "requireAiVerification",
387
- "type": "bool",
388
- "internalType": "bool"
389
- }
390
- ]
391
- }
392
- ],
393
- "outputs": [],
394
- "stateMutability": "nonpayable"
395
- },
396
- {
397
- "type": "function",
398
- "name": "addBotDestination",
399
- "inputs": [
400
- {
401
- "name": "bot",
402
- "type": "address",
403
- "internalType": "address"
404
- },
405
- {
406
- "name": "destination",
407
- "type": "address",
408
- "internalType": "address"
409
- }
410
- ],
411
- "outputs": [],
412
- "stateMutability": "nonpayable"
413
- },
414
- {
415
- "type": "function",
416
- "name": "addGlobalBlacklist",
417
- "inputs": [
418
- {
419
- "name": "destination",
420
- "type": "address",
421
- "internalType": "address"
422
- }
423
- ],
424
- "outputs": [],
425
- "stateMutability": "nonpayable"
426
- },
427
- {
428
- "type": "function",
429
- "name": "addGlobalDestination",
430
- "inputs": [
431
- {
432
- "name": "destination",
433
- "type": "address",
434
- "internalType": "address"
435
- }
436
- ],
437
- "outputs": [],
438
- "stateMutability": "nonpayable"
439
- },
440
- {
441
- "type": "function",
442
- "name": "addProtocol",
443
- "inputs": [
444
- {
445
- "name": "protocol",
446
- "type": "address",
447
- "internalType": "address"
448
- }
449
- ],
450
- "outputs": [],
451
- "stateMutability": "nonpayable"
452
- },
453
- {
454
- "type": "function",
455
- "name": "addRebalanceTokens",
456
- "inputs": [
457
- {
458
- "name": "tokens",
459
- "type": "address[]",
460
- "internalType": "address[]"
461
- }
462
- ],
463
- "outputs": [],
464
- "stateMutability": "nonpayable"
465
- },
466
- {
467
- "type": "function",
468
- "name": "approvedProtocolCount",
469
- "inputs": [],
470
- "outputs": [
471
- {
472
- "name": "",
473
- "type": "uint256",
474
- "internalType": "uint256"
475
- }
476
- ],
477
- "stateMutability": "view"
478
- },
479
- {
480
- "type": "function",
481
- "name": "approvedProtocols",
482
- "inputs": [
483
- {
484
- "name": "",
485
- "type": "address",
486
- "internalType": "address"
487
- }
488
- ],
489
- "outputs": [
490
- {
491
- "name": "",
492
- "type": "bool",
493
- "internalType": "bool"
494
- }
495
- ],
496
- "stateMutability": "view"
497
- },
498
- {
499
- "type": "function",
500
- "name": "axonRegistry",
501
- "inputs": [],
502
- "outputs": [
503
- {
504
- "name": "",
505
- "type": "address",
506
- "internalType": "address"
507
- }
508
- ],
509
- "stateMutability": "view"
510
- },
511
- {
512
- "type": "function",
513
- "name": "botAddedByOperator",
514
- "inputs": [
515
- {
516
- "name": "",
517
- "type": "address",
518
- "internalType": "address"
519
- }
520
- ],
521
- "outputs": [
522
- {
523
- "name": "",
524
- "type": "bool",
525
- "internalType": "bool"
526
- }
527
- ],
528
- "stateMutability": "view"
529
- },
530
- {
531
- "type": "function",
532
- "name": "botDestinationCount",
533
- "inputs": [
534
- {
535
- "name": "",
536
- "type": "address",
537
- "internalType": "address"
538
- }
539
- ],
540
- "outputs": [
541
- {
542
- "name": "",
543
- "type": "uint256",
544
- "internalType": "uint256"
545
- }
546
- ],
547
- "stateMutability": "view"
548
- },
549
- {
550
- "type": "function",
551
- "name": "botDestinationWhitelist",
552
- "inputs": [
553
- {
554
- "name": "",
555
- "type": "address",
556
- "internalType": "address"
557
- },
558
- {
559
- "name": "",
560
- "type": "address",
561
- "internalType": "address"
562
- }
563
- ],
564
- "outputs": [
565
- {
566
- "name": "",
567
- "type": "bool",
568
- "internalType": "bool"
569
- }
570
- ],
571
- "stateMutability": "view"
572
- },
573
- {
574
- "type": "function",
575
- "name": "deposit",
576
- "inputs": [
577
- {
578
- "name": "token",
579
- "type": "address",
580
- "internalType": "address"
581
- },
582
- {
583
- "name": "amount",
584
- "type": "uint256",
585
- "internalType": "uint256"
586
- },
587
- {
588
- "name": "ref",
589
- "type": "bytes32",
590
- "internalType": "bytes32"
591
- }
592
- ],
593
- "outputs": [],
594
- "stateMutability": "payable"
595
- },
596
- {
597
- "type": "function",
598
- "name": "eip712Domain",
599
- "inputs": [],
600
- "outputs": [
601
- {
602
- "name": "fields",
603
- "type": "bytes1",
604
- "internalType": "bytes1"
605
- },
606
- {
607
- "name": "name",
608
- "type": "string",
609
- "internalType": "string"
610
- },
611
- {
612
- "name": "version",
613
- "type": "string",
614
- "internalType": "string"
615
- },
616
- {
617
- "name": "chainId",
618
- "type": "uint256",
619
- "internalType": "uint256"
620
- },
621
- {
622
- "name": "verifyingContract",
623
- "type": "address",
624
- "internalType": "address"
625
- },
626
- {
627
- "name": "salt",
628
- "type": "bytes32",
629
- "internalType": "bytes32"
630
- },
631
- {
632
- "name": "extensions",
633
- "type": "uint256[]",
634
- "internalType": "uint256[]"
635
- }
636
- ],
637
- "stateMutability": "view"
638
- },
639
- {
640
- "type": "function",
641
- "name": "executePayment",
642
- "inputs": [
643
- {
644
- "name": "intent",
645
- "type": "tuple",
646
- "internalType": "struct AxonVault.PaymentIntent",
647
- "components": [
648
- {
649
- "name": "bot",
650
- "type": "address",
651
- "internalType": "address"
652
- },
653
- {
654
- "name": "to",
655
- "type": "address",
656
- "internalType": "address"
657
- },
658
- {
659
- "name": "token",
660
- "type": "address",
661
- "internalType": "address"
662
- },
663
- {
664
- "name": "amount",
665
- "type": "uint256",
666
- "internalType": "uint256"
667
- },
668
- {
669
- "name": "deadline",
670
- "type": "uint256",
671
- "internalType": "uint256"
672
- },
673
- {
674
- "name": "ref",
675
- "type": "bytes32",
676
- "internalType": "bytes32"
677
- }
678
- ]
679
- },
680
- {
681
- "name": "signature",
682
- "type": "bytes",
683
- "internalType": "bytes"
684
- },
685
- {
686
- "name": "fromToken",
687
- "type": "address",
688
- "internalType": "address"
689
- },
690
- {
691
- "name": "maxFromAmount",
692
- "type": "uint256",
693
- "internalType": "uint256"
694
- },
695
- {
696
- "name": "swapRouter",
697
- "type": "address",
698
- "internalType": "address"
699
- },
700
- {
701
- "name": "swapCalldata",
702
- "type": "bytes",
703
- "internalType": "bytes"
704
- }
705
- ],
706
- "outputs": [],
707
- "stateMutability": "nonpayable"
708
- },
709
- {
710
- "type": "function",
711
- "name": "executeProtocol",
712
- "inputs": [
713
- {
714
- "name": "intent",
715
- "type": "tuple",
716
- "internalType": "struct AxonVault.ExecuteIntent",
717
- "components": [
718
- {
719
- "name": "bot",
720
- "type": "address",
721
- "internalType": "address"
722
- },
723
- {
724
- "name": "protocol",
725
- "type": "address",
726
- "internalType": "address"
727
- },
728
- {
729
- "name": "calldataHash",
730
- "type": "bytes32",
731
- "internalType": "bytes32"
732
- },
733
- {
734
- "name": "token",
735
- "type": "address",
736
- "internalType": "address"
737
- },
738
- {
739
- "name": "amount",
740
- "type": "uint256",
741
- "internalType": "uint256"
742
- },
743
- {
744
- "name": "deadline",
745
- "type": "uint256",
746
- "internalType": "uint256"
747
- },
748
- {
749
- "name": "ref",
750
- "type": "bytes32",
751
- "internalType": "bytes32"
752
- }
753
- ]
754
- },
755
- {
756
- "name": "signature",
757
- "type": "bytes",
758
- "internalType": "bytes"
759
- },
760
- {
761
- "name": "callData",
762
- "type": "bytes",
763
- "internalType": "bytes"
764
- },
765
- {
766
- "name": "fromToken",
767
- "type": "address",
768
- "internalType": "address"
769
- },
770
- {
771
- "name": "maxFromAmount",
772
- "type": "uint256",
773
- "internalType": "uint256"
774
- },
775
- {
776
- "name": "swapRouter",
777
- "type": "address",
778
- "internalType": "address"
779
- },
780
- {
781
- "name": "swapCalldata",
782
- "type": "bytes",
783
- "internalType": "bytes"
784
- }
785
- ],
786
- "outputs": [
787
- {
788
- "name": "",
789
- "type": "bytes",
790
- "internalType": "bytes"
791
- }
792
- ],
793
- "stateMutability": "nonpayable"
794
- },
795
- {
796
- "type": "function",
797
- "name": "executeSwap",
798
- "inputs": [
799
- {
800
- "name": "intent",
801
- "type": "tuple",
802
- "internalType": "struct AxonVault.SwapIntent",
803
- "components": [
804
- {
805
- "name": "bot",
806
- "type": "address",
807
- "internalType": "address"
808
- },
809
- {
810
- "name": "toToken",
811
- "type": "address",
812
- "internalType": "address"
813
- },
814
- {
815
- "name": "minToAmount",
816
- "type": "uint256",
817
- "internalType": "uint256"
818
- },
819
- {
820
- "name": "deadline",
821
- "type": "uint256",
822
- "internalType": "uint256"
823
- },
824
- {
825
- "name": "ref",
826
- "type": "bytes32",
827
- "internalType": "bytes32"
828
- }
829
- ]
830
- },
831
- {
832
- "name": "signature",
833
- "type": "bytes",
834
- "internalType": "bytes"
835
- },
836
- {
837
- "name": "fromToken",
838
- "type": "address",
839
- "internalType": "address"
840
- },
841
- {
842
- "name": "maxFromAmount",
843
- "type": "uint256",
844
- "internalType": "uint256"
845
- },
846
- {
847
- "name": "swapRouter",
848
- "type": "address",
849
- "internalType": "address"
850
- },
851
- {
852
- "name": "swapCalldata",
853
- "type": "bytes",
854
- "internalType": "bytes"
855
- }
856
- ],
857
- "outputs": [],
858
- "stateMutability": "nonpayable"
859
- },
860
- {
861
- "type": "function",
862
- "name": "getBotConfig",
863
- "inputs": [
864
- {
865
- "name": "bot",
866
- "type": "address",
867
- "internalType": "address"
868
- }
869
- ],
870
- "outputs": [
871
- {
872
- "name": "",
873
- "type": "tuple",
874
- "internalType": "struct AxonVault.BotConfig",
875
- "components": [
876
- {
877
- "name": "isActive",
878
- "type": "bool",
879
- "internalType": "bool"
880
- },
881
- {
882
- "name": "registeredAt",
883
- "type": "uint256",
884
- "internalType": "uint256"
885
- },
886
- {
887
- "name": "maxPerTxAmount",
888
- "type": "uint256",
889
- "internalType": "uint256"
890
- },
891
- {
892
- "name": "maxRebalanceAmount",
893
- "type": "uint256",
894
- "internalType": "uint256"
895
- },
896
- {
897
- "name": "spendingLimits",
898
- "type": "tuple[]",
899
- "internalType": "struct AxonVault.SpendingLimit[]",
900
- "components": [
901
- {
902
- "name": "amount",
903
- "type": "uint256",
904
- "internalType": "uint256"
905
- },
906
- {
907
- "name": "maxCount",
908
- "type": "uint256",
909
- "internalType": "uint256"
910
- },
911
- {
912
- "name": "windowSeconds",
913
- "type": "uint256",
914
- "internalType": "uint256"
915
- }
916
- ]
917
- },
918
- {
919
- "name": "aiTriggerThreshold",
920
- "type": "uint256",
921
- "internalType": "uint256"
922
- },
923
- {
924
- "name": "requireAiVerification",
925
- "type": "bool",
926
- "internalType": "bool"
927
- }
928
- ]
929
- }
930
- ],
931
- "stateMutability": "view"
932
- },
933
- {
934
- "type": "function",
935
- "name": "globalBlacklistCount",
936
- "inputs": [],
937
- "outputs": [
938
- {
939
- "name": "",
940
- "type": "uint256",
941
- "internalType": "uint256"
942
- }
943
- ],
944
- "stateMutability": "view"
945
- },
946
- {
947
- "type": "function",
948
- "name": "globalDestinationBlacklist",
949
- "inputs": [
950
- {
951
- "name": "",
952
- "type": "address",
953
- "internalType": "address"
954
- }
955
- ],
956
- "outputs": [
957
- {
958
- "name": "",
959
- "type": "bool",
960
- "internalType": "bool"
961
- }
962
- ],
963
- "stateMutability": "view"
964
- },
965
- {
966
- "type": "function",
967
- "name": "globalDestinationCount",
968
- "inputs": [],
969
- "outputs": [
970
- {
971
- "name": "",
972
- "type": "uint256",
973
- "internalType": "uint256"
974
- }
975
- ],
976
- "stateMutability": "view"
977
- },
978
- {
979
- "type": "function",
980
- "name": "globalDestinationWhitelist",
981
- "inputs": [
982
- {
983
- "name": "",
984
- "type": "address",
985
- "internalType": "address"
986
- }
987
- ],
988
- "outputs": [
989
- {
990
- "name": "",
991
- "type": "bool",
992
- "internalType": "bool"
993
- }
994
- ],
995
- "stateMutability": "view"
996
- },
997
- {
998
- "type": "function",
999
- "name": "isBotActive",
1000
- "inputs": [
1001
- {
1002
- "name": "bot",
1003
- "type": "address",
1004
- "internalType": "address"
1005
- }
1006
- ],
1007
- "outputs": [
1008
- {
1009
- "name": "",
1010
- "type": "bool",
1011
- "internalType": "bool"
1012
- }
1013
- ],
1014
- "stateMutability": "view"
1015
- },
1016
- {
1017
- "type": "function",
1018
- "name": "isProtocolApproved",
1019
- "inputs": [
1020
- {
1021
- "name": "protocol",
1022
- "type": "address",
1023
- "internalType": "address"
1024
- }
1025
- ],
1026
- "outputs": [
1027
- {
1028
- "name": "",
1029
- "type": "bool",
1030
- "internalType": "bool"
1031
- }
1032
- ],
1033
- "stateMutability": "view"
1034
- },
1035
- {
1036
- "type": "function",
1037
- "name": "operator",
1038
- "inputs": [],
1039
- "outputs": [
1040
- {
1041
- "name": "",
1042
- "type": "address",
1043
- "internalType": "address"
1044
- }
1045
- ],
1046
- "stateMutability": "view"
1047
- },
1048
- {
1049
- "type": "function",
1050
- "name": "operatorBotCount",
1051
- "inputs": [],
1052
- "outputs": [
1053
- {
1054
- "name": "",
1055
- "type": "uint256",
1056
- "internalType": "uint256"
1057
- }
1058
- ],
1059
- "stateMutability": "view"
1060
- },
1061
- {
1062
- "type": "function",
1063
- "name": "operatorCeilings",
1064
- "inputs": [],
1065
- "outputs": [
1066
- {
1067
- "name": "maxPerTxAmount",
1068
- "type": "uint256",
1069
- "internalType": "uint256"
1070
- },
1071
- {
1072
- "name": "maxBotDailyLimit",
1073
- "type": "uint256",
1074
- "internalType": "uint256"
1075
- },
1076
- {
1077
- "name": "maxOperatorBots",
1078
- "type": "uint256",
1079
- "internalType": "uint256"
1080
- },
1081
- {
1082
- "name": "vaultDailyAggregate",
1083
- "type": "uint256",
1084
- "internalType": "uint256"
1085
- },
1086
- {
1087
- "name": "minAiTriggerFloor",
1088
- "type": "uint256",
1089
- "internalType": "uint256"
1090
- }
1091
- ],
1092
- "stateMutability": "view"
1093
- },
1094
- {
1095
- "type": "function",
1096
- "name": "operatorMaxDrainPerDay",
1097
- "inputs": [],
1098
- "outputs": [
1099
- {
1100
- "name": "",
1101
- "type": "uint256",
1102
- "internalType": "uint256"
1103
- }
1104
- ],
1105
- "stateMutability": "view"
1106
- },
1107
- {
1108
- "type": "function",
1109
- "name": "owner",
1110
- "inputs": [],
1111
- "outputs": [
1112
- {
1113
- "name": "",
1114
- "type": "address",
1115
- "internalType": "address"
1116
- }
1117
- ],
1118
- "stateMutability": "view"
1119
- },
1120
- {
1121
- "type": "function",
1122
- "name": "pause",
1123
- "inputs": [],
1124
- "outputs": [],
1125
- "stateMutability": "nonpayable"
1126
- },
1127
- {
1128
- "type": "function",
1129
- "name": "paused",
1130
- "inputs": [],
1131
- "outputs": [
1132
- {
1133
- "name": "",
1134
- "type": "bool",
1135
- "internalType": "bool"
1136
- }
1137
- ],
1138
- "stateMutability": "view"
1139
- },
1140
- {
1141
- "type": "function",
1142
- "name": "pendingOwner",
1143
- "inputs": [],
1144
- "outputs": [
1145
- {
1146
- "name": "",
1147
- "type": "address",
1148
- "internalType": "address"
1149
- }
1150
- ],
1151
- "stateMutability": "view"
1152
- },
1153
- {
1154
- "type": "function",
1155
- "name": "rebalanceTokenCount",
1156
- "inputs": [],
1157
- "outputs": [
1158
- {
1159
- "name": "",
1160
- "type": "uint256",
1161
- "internalType": "uint256"
1162
- }
1163
- ],
1164
- "stateMutability": "view"
1165
- },
1166
- {
1167
- "type": "function",
1168
- "name": "rebalanceTokenWhitelist",
1169
- "inputs": [
1170
- {
1171
- "name": "",
1172
- "type": "address",
1173
- "internalType": "address"
1174
- }
1175
- ],
1176
- "outputs": [
1177
- {
1178
- "name": "",
1179
- "type": "bool",
1180
- "internalType": "bool"
1181
- }
1182
- ],
1183
- "stateMutability": "view"
1184
- },
1185
- {
1186
- "type": "function",
1187
- "name": "removeBot",
1188
- "inputs": [
1189
- {
1190
- "name": "bot",
1191
- "type": "address",
1192
- "internalType": "address"
1193
- }
1194
- ],
1195
- "outputs": [],
1196
- "stateMutability": "nonpayable"
1197
- },
1198
- {
1199
- "type": "function",
1200
- "name": "removeBotDestination",
1201
- "inputs": [
1202
- {
1203
- "name": "bot",
1204
- "type": "address",
1205
- "internalType": "address"
1206
- },
1207
- {
1208
- "name": "destination",
1209
- "type": "address",
1210
- "internalType": "address"
1211
- }
1212
- ],
1213
- "outputs": [],
1214
- "stateMutability": "nonpayable"
1215
- },
1216
- {
1217
- "type": "function",
1218
- "name": "removeGlobalBlacklist",
1219
- "inputs": [
1220
- {
1221
- "name": "destination",
1222
- "type": "address",
1223
- "internalType": "address"
1224
- }
1225
- ],
1226
- "outputs": [],
1227
- "stateMutability": "nonpayable"
1228
- },
1229
- {
1230
- "type": "function",
1231
- "name": "removeGlobalDestination",
1232
- "inputs": [
1233
- {
1234
- "name": "destination",
1235
- "type": "address",
1236
- "internalType": "address"
1237
- }
1238
- ],
1239
- "outputs": [],
1240
- "stateMutability": "nonpayable"
1241
- },
1242
- {
1243
- "type": "function",
1244
- "name": "removeProtocol",
1245
- "inputs": [
1246
- {
1247
- "name": "protocol",
1248
- "type": "address",
1249
- "internalType": "address"
1250
- }
1251
- ],
1252
- "outputs": [],
1253
- "stateMutability": "nonpayable"
1254
- },
1255
- {
1256
- "type": "function",
1257
- "name": "removeRebalanceTokens",
1258
- "inputs": [
1259
- {
1260
- "name": "tokens",
1261
- "type": "address[]",
1262
- "internalType": "address[]"
1263
- }
1264
- ],
1265
- "outputs": [],
1266
- "stateMutability": "nonpayable"
1267
- },
1268
- {
1269
- "type": "function",
1270
- "name": "renounceOwnership",
1271
- "inputs": [],
1272
- "outputs": [],
1273
- "stateMutability": "nonpayable"
1274
- },
1275
- {
1276
- "type": "function",
1277
- "name": "setOperator",
1278
- "inputs": [
1279
- {
1280
- "name": "_operator",
1281
- "type": "address",
1282
- "internalType": "address"
1283
- }
1284
- ],
1285
- "outputs": [],
1286
- "stateMutability": "nonpayable"
1287
- },
1288
- {
1289
- "type": "function",
1290
- "name": "setOperatorCeilings",
1291
- "inputs": [
1292
- {
1293
- "name": "ceilings",
1294
- "type": "tuple",
1295
- "internalType": "struct AxonVault.OperatorCeilings",
1296
- "components": [
1297
- {
1298
- "name": "maxPerTxAmount",
1299
- "type": "uint256",
1300
- "internalType": "uint256"
1301
- },
1302
- {
1303
- "name": "maxBotDailyLimit",
1304
- "type": "uint256",
1305
- "internalType": "uint256"
1306
- },
1307
- {
1308
- "name": "maxOperatorBots",
1309
- "type": "uint256",
1310
- "internalType": "uint256"
1311
- },
1312
- {
1313
- "name": "vaultDailyAggregate",
1314
- "type": "uint256",
1315
- "internalType": "uint256"
1316
- },
1317
- {
1318
- "name": "minAiTriggerFloor",
1319
- "type": "uint256",
1320
- "internalType": "uint256"
1321
- }
1322
- ]
1323
- }
1324
- ],
1325
- "outputs": [],
1326
- "stateMutability": "nonpayable"
1327
- },
1328
- {
1329
- "type": "function",
1330
- "name": "transferOwnership",
1331
- "inputs": [
1332
- {
1333
- "name": "newOwner",
1334
- "type": "address",
1335
- "internalType": "address"
1336
- }
1337
- ],
1338
- "outputs": [],
1339
- "stateMutability": "nonpayable"
1340
- },
1341
- {
1342
- "type": "function",
1343
- "name": "unpause",
1344
- "inputs": [],
1345
- "outputs": [],
1346
- "stateMutability": "nonpayable"
1347
- },
1348
- {
1349
- "type": "function",
1350
- "name": "updateBotConfig",
1351
- "inputs": [
1352
- {
1353
- "name": "bot",
1354
- "type": "address",
1355
- "internalType": "address"
1356
- },
1357
- {
1358
- "name": "params",
1359
- "type": "tuple",
1360
- "internalType": "struct AxonVault.BotConfigParams",
1361
- "components": [
1362
- {
1363
- "name": "maxPerTxAmount",
1364
- "type": "uint256",
1365
- "internalType": "uint256"
1366
- },
1367
- {
1368
- "name": "maxRebalanceAmount",
1369
- "type": "uint256",
1370
- "internalType": "uint256"
1371
- },
1372
- {
1373
- "name": "spendingLimits",
1374
- "type": "tuple[]",
1375
- "internalType": "struct AxonVault.SpendingLimit[]",
1376
- "components": [
1377
- {
1378
- "name": "amount",
1379
- "type": "uint256",
1380
- "internalType": "uint256"
1381
- },
1382
- {
1383
- "name": "maxCount",
1384
- "type": "uint256",
1385
- "internalType": "uint256"
1386
- },
1387
- {
1388
- "name": "windowSeconds",
1389
- "type": "uint256",
1390
- "internalType": "uint256"
1391
- }
1392
- ]
1393
- },
1394
- {
1395
- "name": "aiTriggerThreshold",
1396
- "type": "uint256",
1397
- "internalType": "uint256"
1398
- },
1399
- {
1400
- "name": "requireAiVerification",
1401
- "type": "bool",
1402
- "internalType": "bool"
1403
- }
1404
- ]
1405
- }
1406
- ],
1407
- "outputs": [],
1408
- "stateMutability": "nonpayable"
1409
- },
1410
- {
1411
- "type": "function",
1412
- "name": "usedIntents",
1413
- "inputs": [
1414
- {
1415
- "name": "",
1416
- "type": "bytes32",
1417
- "internalType": "bytes32"
1418
- }
1419
- ],
1420
- "outputs": [
1421
- {
1422
- "name": "",
1423
- "type": "bool",
1424
- "internalType": "bool"
1425
- }
1426
- ],
1427
- "stateMutability": "view"
1428
- },
1429
- {
1430
- "type": "function",
1431
- "name": "withdraw",
1432
- "inputs": [
1433
- {
1434
- "name": "token",
1435
- "type": "address",
1436
- "internalType": "address"
1437
- },
1438
- {
1439
- "name": "amount",
1440
- "type": "uint256",
1441
- "internalType": "uint256"
1442
- },
1443
- {
1444
- "name": "to",
1445
- "type": "address",
1446
- "internalType": "address"
1447
- }
1448
- ],
1449
- "outputs": [],
1450
- "stateMutability": "nonpayable"
1451
- },
1452
- {
1453
- "type": "event",
1454
- "name": "BotAdded",
1455
- "inputs": [
1456
- {
1457
- "name": "bot",
1458
- "type": "address",
1459
- "indexed": true,
1460
- "internalType": "address"
1461
- },
1462
- {
1463
- "name": "addedBy",
1464
- "type": "address",
1465
- "indexed": true,
1466
- "internalType": "address"
1467
- }
1468
- ],
1469
- "anonymous": false
1470
- },
1471
- {
1472
- "type": "event",
1473
- "name": "BotConfigUpdated",
1474
- "inputs": [
1475
- {
1476
- "name": "bot",
1477
- "type": "address",
1478
- "indexed": true,
1479
- "internalType": "address"
1480
- },
1481
- {
1482
- "name": "updatedBy",
1483
- "type": "address",
1484
- "indexed": true,
1485
- "internalType": "address"
1486
- }
1487
- ],
1488
- "anonymous": false
1489
- },
1490
- {
1491
- "type": "event",
1492
- "name": "BotDestinationAdded",
1493
- "inputs": [
1494
- {
1495
- "name": "bot",
1496
- "type": "address",
1497
- "indexed": true,
1498
- "internalType": "address"
1499
- },
1500
- {
1501
- "name": "destination",
1502
- "type": "address",
1503
- "indexed": true,
1504
- "internalType": "address"
1505
- }
1506
- ],
1507
- "anonymous": false
1508
- },
1509
- {
1510
- "type": "event",
1511
- "name": "BotDestinationRemoved",
1512
- "inputs": [
1513
- {
1514
- "name": "bot",
1515
- "type": "address",
1516
- "indexed": true,
1517
- "internalType": "address"
1518
- },
1519
- {
1520
- "name": "destination",
1521
- "type": "address",
1522
- "indexed": true,
1523
- "internalType": "address"
1524
- }
1525
- ],
1526
- "anonymous": false
1527
- },
1528
- {
1529
- "type": "event",
1530
- "name": "BotRemoved",
1531
- "inputs": [
1532
- {
1533
- "name": "bot",
1534
- "type": "address",
1535
- "indexed": true,
1536
- "internalType": "address"
1537
- },
1538
- {
1539
- "name": "removedBy",
1540
- "type": "address",
1541
- "indexed": true,
1542
- "internalType": "address"
1543
- }
1544
- ],
1545
- "anonymous": false
1546
- },
1547
- {
1548
- "type": "event",
1549
- "name": "Deposited",
1550
- "inputs": [
1551
- {
1552
- "name": "from",
1553
- "type": "address",
1554
- "indexed": true,
1555
- "internalType": "address"
1556
- },
1557
- {
1558
- "name": "token",
1559
- "type": "address",
1560
- "indexed": true,
1561
- "internalType": "address"
1562
- },
1563
- {
1564
- "name": "amount",
1565
- "type": "uint256",
1566
- "indexed": false,
1567
- "internalType": "uint256"
1568
- },
1569
- {
1570
- "name": "ref",
1571
- "type": "bytes32",
1572
- "indexed": false,
1573
- "internalType": "bytes32"
1574
- }
1575
- ],
1576
- "anonymous": false
1577
- },
1578
- {
1579
- "type": "event",
1580
- "name": "EIP712DomainChanged",
1581
- "inputs": [],
1582
- "anonymous": false
1583
- },
1584
- {
1585
- "type": "event",
1586
- "name": "GlobalBlacklistAdded",
1587
- "inputs": [
1588
- {
1589
- "name": "destination",
1590
- "type": "address",
1591
- "indexed": true,
1592
- "internalType": "address"
1593
- }
1594
- ],
1595
- "anonymous": false
1596
- },
1597
- {
1598
- "type": "event",
1599
- "name": "GlobalBlacklistRemoved",
1600
- "inputs": [
1601
- {
1602
- "name": "destination",
1603
- "type": "address",
1604
- "indexed": true,
1605
- "internalType": "address"
1606
- }
1607
- ],
1608
- "anonymous": false
1609
- },
1610
- {
1611
- "type": "event",
1612
- "name": "GlobalDestinationAdded",
1613
- "inputs": [
1614
- {
1615
- "name": "destination",
1616
- "type": "address",
1617
- "indexed": true,
1618
- "internalType": "address"
1619
- }
1620
- ],
1621
- "anonymous": false
1622
- },
1623
- {
1624
- "type": "event",
1625
- "name": "GlobalDestinationRemoved",
1626
- "inputs": [
1627
- {
1628
- "name": "destination",
1629
- "type": "address",
1630
- "indexed": true,
1631
- "internalType": "address"
1632
- }
1633
- ],
1634
- "anonymous": false
1635
- },
1636
- {
1637
- "type": "event",
1638
- "name": "OperatorCeilingsUpdated",
1639
- "inputs": [
1640
- {
1641
- "name": "ceilings",
1642
- "type": "tuple",
1643
- "indexed": false,
1644
- "internalType": "struct AxonVault.OperatorCeilings",
1645
- "components": [
1646
- {
1647
- "name": "maxPerTxAmount",
1648
- "type": "uint256",
1649
- "internalType": "uint256"
1650
- },
1651
- {
1652
- "name": "maxBotDailyLimit",
1653
- "type": "uint256",
1654
- "internalType": "uint256"
1655
- },
1656
- {
1657
- "name": "maxOperatorBots",
1658
- "type": "uint256",
1659
- "internalType": "uint256"
1660
- },
1661
- {
1662
- "name": "vaultDailyAggregate",
1663
- "type": "uint256",
1664
- "internalType": "uint256"
1665
- },
1666
- {
1667
- "name": "minAiTriggerFloor",
1668
- "type": "uint256",
1669
- "internalType": "uint256"
1670
- }
1671
- ]
1672
- }
1673
- ],
1674
- "anonymous": false
1675
- },
1676
- {
1677
- "type": "event",
1678
- "name": "OperatorSet",
1679
- "inputs": [
1680
- {
1681
- "name": "oldOperator",
1682
- "type": "address",
1683
- "indexed": true,
1684
- "internalType": "address"
1685
- },
1686
- {
1687
- "name": "newOperator",
1688
- "type": "address",
1689
- "indexed": true,
1690
- "internalType": "address"
1691
- }
1692
- ],
1693
- "anonymous": false
1694
- },
1695
- {
1696
- "type": "event",
1697
- "name": "OwnershipTransferStarted",
1698
- "inputs": [
1699
- {
1700
- "name": "previousOwner",
1701
- "type": "address",
1702
- "indexed": true,
1703
- "internalType": "address"
1704
- },
1705
- {
1706
- "name": "newOwner",
1707
- "type": "address",
1708
- "indexed": true,
1709
- "internalType": "address"
1710
- }
1711
- ],
1712
- "anonymous": false
1713
- },
1714
- {
1715
- "type": "event",
1716
- "name": "OwnershipTransferred",
1717
- "inputs": [
1718
- {
1719
- "name": "previousOwner",
1720
- "type": "address",
1721
- "indexed": true,
1722
- "internalType": "address"
1723
- },
1724
- {
1725
- "name": "newOwner",
1726
- "type": "address",
1727
- "indexed": true,
1728
- "internalType": "address"
1729
- }
1730
- ],
1731
- "anonymous": false
1732
- },
1733
- {
1734
- "type": "event",
1735
- "name": "Paused",
1736
- "inputs": [
1737
- {
1738
- "name": "account",
1739
- "type": "address",
1740
- "indexed": false,
1741
- "internalType": "address"
1742
- }
1743
- ],
1744
- "anonymous": false
1745
- },
1746
- {
1747
- "type": "event",
1748
- "name": "PaymentExecuted",
1749
- "inputs": [
1750
- {
1751
- "name": "bot",
1752
- "type": "address",
1753
- "indexed": true,
1754
- "internalType": "address"
1755
- },
1756
- {
1757
- "name": "to",
1758
- "type": "address",
1759
- "indexed": true,
1760
- "internalType": "address"
1761
- },
1762
- {
1763
- "name": "token",
1764
- "type": "address",
1765
- "indexed": true,
1766
- "internalType": "address"
1767
- },
1768
- {
1769
- "name": "amount",
1770
- "type": "uint256",
1771
- "indexed": false,
1772
- "internalType": "uint256"
1773
- },
1774
- {
1775
- "name": "ref",
1776
- "type": "bytes32",
1777
- "indexed": false,
1778
- "internalType": "bytes32"
1779
- }
1780
- ],
1781
- "anonymous": false
1782
- },
1783
- {
1784
- "type": "event",
1785
- "name": "ProtocolAdded",
1786
- "inputs": [
1787
- {
1788
- "name": "protocol",
1789
- "type": "address",
1790
- "indexed": true,
1791
- "internalType": "address"
1792
- }
1793
- ],
1794
- "anonymous": false
1795
- },
1796
- {
1797
- "type": "event",
1798
- "name": "ProtocolExecuted",
1799
- "inputs": [
1800
- {
1801
- "name": "bot",
1802
- "type": "address",
1803
- "indexed": true,
1804
- "internalType": "address"
1805
- },
1806
- {
1807
- "name": "protocol",
1808
- "type": "address",
1809
- "indexed": true,
1810
- "internalType": "address"
1811
- },
1812
- {
1813
- "name": "token",
1814
- "type": "address",
1815
- "indexed": false,
1816
- "internalType": "address"
1817
- },
1818
- {
1819
- "name": "amount",
1820
- "type": "uint256",
1821
- "indexed": false,
1822
- "internalType": "uint256"
1823
- },
1824
- {
1825
- "name": "ref",
1826
- "type": "bytes32",
1827
- "indexed": false,
1828
- "internalType": "bytes32"
1829
- }
1830
- ],
1831
- "anonymous": false
1832
- },
1833
- {
1834
- "type": "event",
1835
- "name": "ProtocolRemoved",
1836
- "inputs": [
1837
- {
1838
- "name": "protocol",
1839
- "type": "address",
1840
- "indexed": true,
1841
- "internalType": "address"
1842
- }
1843
- ],
1844
- "anonymous": false
1845
- },
1846
- {
1847
- "type": "event",
1848
- "name": "RebalanceTokenAdded",
1849
- "inputs": [
1850
- {
1851
- "name": "token",
1852
- "type": "address",
1853
- "indexed": true,
1854
- "internalType": "address"
1855
- }
1856
- ],
1857
- "anonymous": false
1858
- },
1859
- {
1860
- "type": "event",
1861
- "name": "RebalanceTokenRemoved",
1862
- "inputs": [
1863
- {
1864
- "name": "token",
1865
- "type": "address",
1866
- "indexed": true,
1867
- "internalType": "address"
1868
- }
1869
- ],
1870
- "anonymous": false
1871
- },
1872
- {
1873
- "type": "event",
1874
- "name": "SwapExecuted",
1875
- "inputs": [
1876
- {
1877
- "name": "bot",
1878
- "type": "address",
1879
- "indexed": true,
1880
- "internalType": "address"
1881
- },
1882
- {
1883
- "name": "fromToken",
1884
- "type": "address",
1885
- "indexed": false,
1886
- "internalType": "address"
1887
- },
1888
- {
1889
- "name": "toToken",
1890
- "type": "address",
1891
- "indexed": false,
1892
- "internalType": "address"
1893
- },
1894
- {
1895
- "name": "fromAmount",
1896
- "type": "uint256",
1897
- "indexed": false,
1898
- "internalType": "uint256"
1899
- },
1900
- {
1901
- "name": "toAmount",
1902
- "type": "uint256",
1903
- "indexed": false,
1904
- "internalType": "uint256"
1905
- },
1906
- {
1907
- "name": "ref",
1908
- "type": "bytes32",
1909
- "indexed": false,
1910
- "internalType": "bytes32"
1911
- }
1912
- ],
1913
- "anonymous": false
1914
- },
1915
- {
1916
- "type": "event",
1917
- "name": "SwapPaymentExecuted",
1918
- "inputs": [
1919
- {
1920
- "name": "bot",
1921
- "type": "address",
1922
- "indexed": true,
1923
- "internalType": "address"
1924
- },
1925
- {
1926
- "name": "to",
1927
- "type": "address",
1928
- "indexed": true,
1929
- "internalType": "address"
1930
- },
1931
- {
1932
- "name": "fromToken",
1933
- "type": "address",
1934
- "indexed": false,
1935
- "internalType": "address"
1936
- },
1937
- {
1938
- "name": "toToken",
1939
- "type": "address",
1940
- "indexed": false,
1941
- "internalType": "address"
1942
- },
1943
- {
1944
- "name": "fromAmount",
1945
- "type": "uint256",
1946
- "indexed": false,
1947
- "internalType": "uint256"
1948
- },
1949
- {
1950
- "name": "toAmount",
1951
- "type": "uint256",
1952
- "indexed": false,
1953
- "internalType": "uint256"
1954
- },
1955
- {
1956
- "name": "ref",
1957
- "type": "bytes32",
1958
- "indexed": false,
1959
- "internalType": "bytes32"
1960
- }
1961
- ],
1962
- "anonymous": false
1963
- },
1964
- {
1965
- "type": "event",
1966
- "name": "Unpaused",
1967
- "inputs": [
1968
- {
1969
- "name": "account",
1970
- "type": "address",
1971
- "indexed": false,
1972
- "internalType": "address"
1973
- }
1974
- ],
1975
- "anonymous": false
1976
- },
1977
- {
1978
- "type": "event",
1979
- "name": "Withdrawn",
1980
- "inputs": [
1981
- {
1982
- "name": "token",
1983
- "type": "address",
1984
- "indexed": true,
1985
- "internalType": "address"
1986
- },
1987
- {
1988
- "name": "amount",
1989
- "type": "uint256",
1990
- "indexed": false,
1991
- "internalType": "uint256"
1992
- },
1993
- {
1994
- "name": "to",
1995
- "type": "address",
1996
- "indexed": true,
1997
- "internalType": "address"
1998
- }
1999
- ],
2000
- "anonymous": false
2001
- },
2002
- {
2003
- "type": "error",
2004
- "name": "AlreadyApprovedProtocol",
2005
- "inputs": []
2006
- },
2007
- {
2008
- "type": "error",
2009
- "name": "AmountMismatch",
2010
- "inputs": []
2011
- },
2012
- {
2013
- "type": "error",
2014
- "name": "BotAlreadyExists",
2015
- "inputs": []
2016
- },
2017
- {
2018
- "type": "error",
2019
- "name": "BotDoesNotExist",
2020
- "inputs": []
2021
- },
2022
- {
2023
- "type": "error",
2024
- "name": "BotNotActive",
2025
- "inputs": []
2026
- },
2027
- {
2028
- "type": "error",
2029
- "name": "CalldataHashMismatch",
2030
- "inputs": []
2031
- },
2032
- {
2033
- "type": "error",
2034
- "name": "DeadlineExpired",
2035
- "inputs": []
2036
- },
2037
- {
2038
- "type": "error",
2039
- "name": "DestinationBlacklisted",
2040
- "inputs": []
2041
- },
2042
- {
2043
- "type": "error",
2044
- "name": "DestinationNotWhitelisted",
2045
- "inputs": []
2046
- },
2047
- {
2048
- "type": "error",
2049
- "name": "ECDSAInvalidSignature",
2050
- "inputs": []
2051
- },
2052
- {
2053
- "type": "error",
2054
- "name": "ECDSAInvalidSignatureLength",
2055
- "inputs": [
2056
- {
2057
- "name": "length",
2058
- "type": "uint256",
2059
- "internalType": "uint256"
2060
- }
2061
- ]
2062
- },
2063
- {
2064
- "type": "error",
2065
- "name": "ECDSAInvalidSignatureS",
2066
- "inputs": [
2067
- {
2068
- "name": "s",
2069
- "type": "bytes32",
2070
- "internalType": "bytes32"
2071
- }
2072
- ]
2073
- },
2074
- {
2075
- "type": "error",
2076
- "name": "EnforcedPause",
2077
- "inputs": []
2078
- },
2079
- {
2080
- "type": "error",
2081
- "name": "ExceedsOperatorCeiling",
2082
- "inputs": []
2083
- },
2084
- {
2085
- "type": "error",
2086
- "name": "ExpectedPause",
2087
- "inputs": []
2088
- },
2089
- {
2090
- "type": "error",
2091
- "name": "InsufficientBalance",
2092
- "inputs": []
2093
- },
2094
- {
2095
- "type": "error",
2096
- "name": "IntentAlreadyUsed",
2097
- "inputs": []
2098
- },
2099
- {
2100
- "type": "error",
2101
- "name": "InvalidShortString",
2102
- "inputs": []
2103
- },
2104
- {
2105
- "type": "error",
2106
- "name": "InvalidSignature",
2107
- "inputs": []
2108
- },
2109
- {
2110
- "type": "error",
2111
- "name": "MaxPerTxExceeded",
2112
- "inputs": []
2113
- },
2114
- {
2115
- "type": "error",
2116
- "name": "MaxRebalanceAmountExceeded",
2117
- "inputs": []
2118
- },
2119
- {
2120
- "type": "error",
2121
- "name": "NativeTransferFailed",
2122
- "inputs": []
2123
- },
2124
- {
2125
- "type": "error",
2126
- "name": "NotAuthorized",
2127
- "inputs": []
2128
- },
2129
- {
2130
- "type": "error",
2131
- "name": "NotAuthorizedRelayer",
2132
- "inputs": []
2133
- },
2134
- {
2135
- "type": "error",
2136
- "name": "OperatorBotLimitReached",
2137
- "inputs": []
2138
- },
2139
- {
2140
- "type": "error",
2141
- "name": "OperatorCannotBeOwner",
2142
- "inputs": []
2143
- },
2144
- {
2145
- "type": "error",
2146
- "name": "OracleNotConfigured",
2147
- "inputs": []
2148
- },
2149
- {
2150
- "type": "error",
2151
- "name": "OracleUnavailable",
2152
- "inputs": []
2153
- },
2154
- {
2155
- "type": "error",
2156
- "name": "OwnableInvalidOwner",
2157
- "inputs": [
2158
- {
2159
- "name": "owner",
2160
- "type": "address",
2161
- "internalType": "address"
2162
- }
2163
- ]
2164
- },
2165
- {
2166
- "type": "error",
2167
- "name": "OwnableUnauthorizedAccount",
2168
- "inputs": [
2169
- {
2170
- "name": "account",
2171
- "type": "address",
2172
- "internalType": "address"
2173
- }
2174
- ]
2175
- },
2176
- {
2177
- "type": "error",
2178
- "name": "OwnerCannotBeBot",
2179
- "inputs": []
2180
- },
2181
- {
2182
- "type": "error",
2183
- "name": "PaymentToZeroAddress",
2184
- "inputs": []
2185
- },
2186
- {
2187
- "type": "error",
2188
- "name": "ProtocolCallFailed",
2189
- "inputs": []
2190
- },
2191
- {
2192
- "type": "error",
2193
- "name": "ProtocolNotApproved",
2194
- "inputs": []
2195
- },
2196
- {
2197
- "type": "error",
2198
- "name": "ProtocolNotInList",
2199
- "inputs": []
2200
- },
2201
- {
2202
- "type": "error",
2203
- "name": "RebalanceTokenNotAllowed",
2204
- "inputs": []
2205
- },
2206
- {
2207
- "type": "error",
2208
- "name": "ReentrancyGuardReentrantCall",
2209
- "inputs": []
2210
- },
2211
- {
2212
- "type": "error",
2213
- "name": "RouterNotApproved",
2214
- "inputs": []
2215
- },
2216
- {
2217
- "type": "error",
2218
- "name": "SafeERC20FailedOperation",
2219
- "inputs": [
2220
- {
2221
- "name": "token",
2222
- "type": "address",
2223
- "internalType": "address"
2224
- }
2225
- ]
2226
- },
2227
- {
2228
- "type": "error",
2229
- "name": "SameTokenSwap",
2230
- "inputs": []
2231
- },
2232
- {
2233
- "type": "error",
2234
- "name": "SelfPayment",
2235
- "inputs": []
2236
- },
2237
- {
2238
- "type": "error",
2239
- "name": "StringTooLong",
2240
- "inputs": [
2241
- {
2242
- "name": "str",
2243
- "type": "string",
2244
- "internalType": "string"
2245
- }
2246
- ]
2247
- },
2248
- {
2249
- "type": "error",
2250
- "name": "SwapFailed",
2251
- "inputs": []
2252
- },
2253
- {
2254
- "type": "error",
2255
- "name": "SwapOutputInsufficient",
2256
- "inputs": []
2257
- },
2258
- {
2259
- "type": "error",
2260
- "name": "TooManySpendingLimits",
2261
- "inputs": []
2262
- },
2263
- {
2264
- "type": "error",
2265
- "name": "UnexpectedETH",
2266
- "inputs": []
2267
- },
2268
- {
2269
- "type": "error",
2270
- "name": "ZeroAddress",
2271
- "inputs": []
2272
- },
2273
- {
2274
- "type": "error",
2275
- "name": "ZeroAmount",
2276
- "inputs": []
2277
- }
2278
- ];
2279
-
2280
- // src/abis/AxonVaultFactory.ts
2281
- var AxonVaultFactoryAbi = [
2282
- {
2283
- "type": "constructor",
2284
- "inputs": [
2285
- {
2286
- "name": "_axonRegistry",
2287
- "type": "address",
2288
- "internalType": "address"
2289
- },
2290
- {
2291
- "name": "factoryOwner",
2292
- "type": "address",
2293
- "internalType": "address"
2294
- }
2295
- ],
2296
- "stateMutability": "nonpayable"
2297
- },
2298
- {
2299
- "type": "function",
2300
- "name": "acceptOwnership",
2301
- "inputs": [],
2302
- "outputs": [],
2303
- "stateMutability": "nonpayable"
2304
- },
2305
- {
2306
- "type": "function",
2307
- "name": "allVaults",
2308
- "inputs": [
2309
- {
2310
- "name": "",
2311
- "type": "uint256",
2312
- "internalType": "uint256"
2313
- }
2314
- ],
2315
- "outputs": [
2316
- {
2317
- "name": "",
2318
- "type": "address",
2319
- "internalType": "address"
2320
- }
2321
- ],
2322
- "stateMutability": "view"
2323
- },
2324
- {
2325
- "type": "function",
2326
- "name": "axonRegistry",
2327
- "inputs": [],
2328
- "outputs": [
2329
- {
2330
- "name": "",
2331
- "type": "address",
2332
- "internalType": "address"
2333
- }
2334
- ],
2335
- "stateMutability": "view"
2336
- },
2337
- {
2338
- "type": "function",
2339
- "name": "deployVault",
2340
- "inputs": [],
2341
- "outputs": [
2342
- {
2343
- "name": "vault",
2344
- "type": "address",
2345
- "internalType": "address"
2346
- }
2347
- ],
2348
- "stateMutability": "nonpayable"
2349
- },
2350
- {
2351
- "type": "function",
2352
- "name": "owner",
2353
- "inputs": [],
2354
- "outputs": [
2355
- {
2356
- "name": "",
2357
- "type": "address",
2358
- "internalType": "address"
2359
- }
2360
- ],
2361
- "stateMutability": "view"
2362
- },
2363
- {
2364
- "type": "function",
2365
- "name": "ownerVaultCount",
2366
- "inputs": [
2367
- {
2368
- "name": "owner",
2369
- "type": "address",
2370
- "internalType": "address"
2371
- }
2372
- ],
2373
- "outputs": [
2374
- {
2375
- "name": "",
2376
- "type": "uint256",
2377
- "internalType": "uint256"
2378
- }
2379
- ],
2380
- "stateMutability": "view"
2381
- },
2382
- {
2383
- "type": "function",
2384
- "name": "ownerVaults",
2385
- "inputs": [
2386
- {
2387
- "name": "",
2388
- "type": "address",
2389
- "internalType": "address"
2390
- },
2391
- {
2392
- "name": "",
2393
- "type": "uint256",
2394
- "internalType": "uint256"
2395
- }
2396
- ],
2397
- "outputs": [
2398
- {
2399
- "name": "",
2400
- "type": "address",
2401
- "internalType": "address"
2402
- }
2403
- ],
2404
- "stateMutability": "view"
2405
- },
2406
- {
2407
- "type": "function",
2408
- "name": "pendingOwner",
2409
- "inputs": [],
2410
- "outputs": [
2411
- {
2412
- "name": "",
2413
- "type": "address",
2414
- "internalType": "address"
2415
- }
2416
- ],
2417
- "stateMutability": "view"
2418
- },
2419
- {
2420
- "type": "function",
2421
- "name": "renounceOwnership",
2422
- "inputs": [],
2423
- "outputs": [],
2424
- "stateMutability": "nonpayable"
2425
- },
2426
- {
2427
- "type": "function",
2428
- "name": "transferOwnership",
2429
- "inputs": [
2430
- {
2431
- "name": "newOwner",
2432
- "type": "address",
2433
- "internalType": "address"
2434
- }
2435
- ],
2436
- "outputs": [],
2437
- "stateMutability": "nonpayable"
2438
- },
2439
- {
2440
- "type": "function",
2441
- "name": "vaultCount",
2442
- "inputs": [],
2443
- "outputs": [
2444
- {
2445
- "name": "",
2446
- "type": "uint256",
2447
- "internalType": "uint256"
2448
- }
2449
- ],
2450
- "stateMutability": "view"
2451
- },
2452
- {
2453
- "type": "event",
2454
- "name": "OwnershipTransferStarted",
2455
- "inputs": [
2456
- {
2457
- "name": "previousOwner",
2458
- "type": "address",
2459
- "indexed": true,
2460
- "internalType": "address"
2461
- },
2462
- {
2463
- "name": "newOwner",
2464
- "type": "address",
2465
- "indexed": true,
2466
- "internalType": "address"
2467
- }
2468
- ],
2469
- "anonymous": false
2470
- },
2471
- {
2472
- "type": "event",
2473
- "name": "OwnershipTransferred",
2474
- "inputs": [
2475
- {
2476
- "name": "previousOwner",
2477
- "type": "address",
2478
- "indexed": true,
2479
- "internalType": "address"
2480
- },
2481
- {
2482
- "name": "newOwner",
2483
- "type": "address",
2484
- "indexed": true,
2485
- "internalType": "address"
2486
- }
2487
- ],
2488
- "anonymous": false
2489
- },
2490
- {
2491
- "type": "event",
2492
- "name": "VaultDeployed",
2493
- "inputs": [
2494
- {
2495
- "name": "owner",
2496
- "type": "address",
2497
- "indexed": true,
2498
- "internalType": "address"
2499
- },
2500
- {
2501
- "name": "vault",
2502
- "type": "address",
2503
- "indexed": true,
2504
- "internalType": "address"
2505
- },
2506
- {
2507
- "name": "version",
2508
- "type": "uint16",
2509
- "indexed": false,
2510
- "internalType": "uint16"
2511
- },
2512
- {
2513
- "name": "axonRegistry",
2514
- "type": "address",
2515
- "indexed": false,
2516
- "internalType": "address"
2517
- }
2518
- ],
2519
- "anonymous": false
2520
- },
2521
- {
2522
- "type": "error",
2523
- "name": "OwnableInvalidOwner",
2524
- "inputs": [
2525
- {
2526
- "name": "owner",
2527
- "type": "address",
2528
- "internalType": "address"
2529
- }
2530
- ]
2531
- },
2532
- {
2533
- "type": "error",
2534
- "name": "OwnableUnauthorizedAccount",
2535
- "inputs": [
2536
- {
2537
- "name": "account",
2538
- "type": "address",
2539
- "internalType": "address"
2540
- }
2541
- ]
2542
- },
2543
- {
2544
- "type": "error",
2545
- "name": "ZeroAddress",
2546
- "inputs": []
2547
- }
2548
- ];
2549
-
2550
- // src/vault.ts
2551
- function getChain(chainId) {
2552
- switch (chainId) {
2553
- case 8453:
2554
- return chains.base;
2555
- case 84532:
2556
- return chains.baseSepolia;
2557
- case 42161:
2558
- return chains.arbitrum;
2559
- case 421614:
2560
- return chains.arbitrumSepolia;
2561
- default:
2562
- throw new Error(
2563
- `Unsupported chainId: ${chainId}. Supported: 8453 (Base), 84532 (Base Sepolia), 42161 (Arbitrum), 421614 (Arbitrum Sepolia)`
2564
- );
2565
- }
2566
- }
2567
- function createAxonPublicClient(chainId, rpcUrl) {
2568
- return viem.createPublicClient({
2569
- chain: getChain(chainId),
2570
- transport: viem.http(rpcUrl)
2571
- });
2572
- }
2573
- function createAxonWalletClient(privateKey, chainId) {
2574
- const account = accounts.privateKeyToAccount(privateKey);
2575
- return viem.createWalletClient({
2576
- account,
2577
- chain: getChain(chainId),
2578
- transport: viem.http()
2579
- // signing is local — transport is unused but required by viem
2580
- });
2581
- }
2582
- async function getBotConfig(publicClient, vaultAddress, botAddress) {
2583
- const result = await publicClient.readContract({
2584
- address: vaultAddress,
2585
- abi: AxonVaultAbi,
2586
- functionName: "getBotConfig",
2587
- args: [botAddress]
2588
- });
2589
- return {
2590
- isActive: result.isActive,
2591
- registeredAt: result.registeredAt,
2592
- maxPerTxAmount: result.maxPerTxAmount,
2593
- maxRebalanceAmount: result.maxRebalanceAmount,
2594
- spendingLimits: result.spendingLimits.map((sl) => ({
2595
- amount: sl.amount,
2596
- maxCount: sl.maxCount,
2597
- windowSeconds: sl.windowSeconds
2598
- })),
2599
- aiTriggerThreshold: result.aiTriggerThreshold,
2600
- requireAiVerification: result.requireAiVerification
2601
- };
2602
- }
2603
- async function isBotActive(publicClient, vaultAddress, botAddress) {
2604
- return publicClient.readContract({
2605
- address: vaultAddress,
2606
- abi: AxonVaultAbi,
2607
- functionName: "isBotActive",
2608
- args: [botAddress]
2609
- });
2610
- }
2611
- async function getOperatorCeilings(publicClient, vaultAddress) {
2612
- const result = await publicClient.readContract({
2613
- address: vaultAddress,
2614
- abi: AxonVaultAbi,
2615
- functionName: "operatorCeilings"
2616
- });
2617
- const [maxPerTxAmount, maxBotDailyLimit, maxOperatorBots, vaultDailyAggregate, minAiTriggerFloor] = result;
2618
- return {
2619
- maxPerTxAmount,
2620
- maxBotDailyLimit,
2621
- maxOperatorBots,
2622
- vaultDailyAggregate,
2623
- minAiTriggerFloor
2624
- };
2625
- }
2626
- async function operatorMaxDrainPerDay(publicClient, vaultAddress) {
2627
- return publicClient.readContract({
2628
- address: vaultAddress,
2629
- abi: AxonVaultAbi,
2630
- functionName: "operatorMaxDrainPerDay"
2631
- });
2632
- }
2633
- async function isVaultPaused(publicClient, vaultAddress) {
2634
- return publicClient.readContract({
2635
- address: vaultAddress,
2636
- abi: AxonVaultAbi,
2637
- functionName: "paused"
2638
- });
2639
- }
2640
- async function getDomainSeparator(publicClient, vaultAddress) {
2641
- return publicClient.readContract({
2642
- address: vaultAddress,
2643
- abi: AxonVaultAbi,
2644
- functionName: "DOMAIN_SEPARATOR"
2645
- });
2646
- }
2647
- async function getVaultVersion(publicClient, vaultAddress) {
2648
- const version = await publicClient.readContract({
2649
- address: vaultAddress,
2650
- abi: AxonVaultAbi,
2651
- functionName: "VERSION"
2652
- });
2653
- return Number(version);
2654
- }
2655
- async function getVaultOwner(publicClient, vaultAddress) {
2656
- return publicClient.readContract({
2657
- address: vaultAddress,
2658
- abi: AxonVaultAbi,
2659
- functionName: "owner"
2660
- });
2661
- }
2662
- async function getVaultOperator(publicClient, vaultAddress) {
2663
- return publicClient.readContract({
2664
- address: vaultAddress,
2665
- abi: AxonVaultAbi,
2666
- functionName: "operator"
2667
- });
2668
- }
2669
- async function isDestinationAllowed(publicClient, vaultAddress, botAddress, destination) {
2670
- const isBlacklisted = await publicClient.readContract({
2671
- address: vaultAddress,
2672
- abi: AxonVaultAbi,
2673
- functionName: "globalDestinationBlacklist",
2674
- args: [destination]
2675
- });
2676
- if (isBlacklisted) {
2677
- return { allowed: false, reason: "Destination is on the global blacklist" };
2678
- }
2679
- const globalCount = await publicClient.readContract({
2680
- address: vaultAddress,
2681
- abi: AxonVaultAbi,
2682
- functionName: "globalDestinationCount"
2683
- });
2684
- if (globalCount > 0n) {
2685
- const isGlobalWhitelisted = await publicClient.readContract({
2686
- address: vaultAddress,
2687
- abi: AxonVaultAbi,
2688
- functionName: "globalDestinationWhitelist",
2689
- args: [destination]
2690
- });
2691
- if (!isGlobalWhitelisted) {
2692
- return { allowed: false, reason: "Destination is not on the global whitelist" };
2693
- }
2694
- }
2695
- const botCount = await publicClient.readContract({
2696
- address: vaultAddress,
2697
- abi: AxonVaultAbi,
2698
- functionName: "botDestinationCount",
2699
- args: [botAddress]
2700
- });
2701
- if (botCount > 0n) {
2702
- const isBotWhitelisted = await publicClient.readContract({
2703
- address: vaultAddress,
2704
- abi: AxonVaultAbi,
2705
- functionName: "botDestinationWhitelist",
2706
- args: [botAddress, destination]
2707
- });
2708
- if (!isBotWhitelisted) {
2709
- return { allowed: false, reason: "Destination is not on the bot whitelist" };
2710
- }
2711
- }
2712
- return { allowed: true };
2713
- }
2714
- async function getRebalanceTokenCount(publicClient, vaultAddress) {
2715
- const count = await publicClient.readContract({
2716
- address: vaultAddress,
2717
- abi: AxonVaultAbi,
2718
- functionName: "rebalanceTokenCount"
2719
- });
2720
- return Number(count);
2721
- }
2722
- async function isRebalanceTokenWhitelisted(publicClient, vaultAddress, token) {
2723
- return publicClient.readContract({
2724
- address: vaultAddress,
2725
- abi: AxonVaultAbi,
2726
- functionName: "rebalanceTokenWhitelist",
2727
- args: [token]
2728
- });
2729
- }
2730
- async function deployVault(walletClient, publicClient, factoryAddress) {
2731
- if (!walletClient.account) {
2732
- throw new Error("walletClient has no account attached");
2733
- }
2734
- const hash = await walletClient.writeContract({
2735
- address: factoryAddress,
2736
- abi: AxonVaultFactoryAbi,
2737
- functionName: "deployVault",
2738
- args: [],
2739
- account: walletClient.account,
2740
- chain: walletClient.chain ?? null
2741
- });
2742
- const receipt = await publicClient.waitForTransactionReceipt({ hash });
2743
- for (const log of receipt.logs) {
2744
- try {
2745
- if (log.topics.length >= 3 && log.topics[2]) {
2746
- const vaultAddress = `0x${log.topics[2].slice(26)}`;
2747
- return vaultAddress;
2748
- }
2749
- } catch {
2750
- }
2751
- }
2752
- throw new Error("VaultDeployed event not found in transaction receipt");
2753
- }
2754
-
2755
- // src/tokens.ts
2756
- var Token = /* @__PURE__ */ ((Token2) => {
2757
- Token2["USDC"] = "USDC";
2758
- Token2["USDT"] = "USDT";
2759
- Token2["DAI"] = "DAI";
2760
- Token2["WETH"] = "WETH";
2761
- Token2["WBTC"] = "WBTC";
2762
- Token2["cbBTC"] = "cbBTC";
2763
- Token2["cbETH"] = "cbETH";
2764
- Token2["wstETH"] = "wstETH";
2765
- Token2["rETH"] = "rETH";
2766
- Token2["LINK"] = "LINK";
2767
- Token2["UNI"] = "UNI";
2768
- Token2["AAVE"] = "AAVE";
2769
- Token2["COMP"] = "COMP";
2770
- Token2["CRV"] = "CRV";
2771
- Token2["SNX"] = "SNX";
2772
- Token2["ARB"] = "ARB";
2773
- Token2["AERO"] = "AERO";
2774
- Token2["GMX"] = "GMX";
2775
- return Token2;
2776
- })(Token || {});
2777
- var KNOWN_TOKENS = {
2778
- // ── Core stables + wrapped ──────────────────────────────
2779
- USDC: {
2780
- symbol: "USDC",
2781
- name: "USD Coin",
2782
- decimals: 6,
2783
- addresses: {
2784
- 8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
2785
- 84532: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
2786
- 42161: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
2787
- 421614: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"
2788
- }
2789
- },
2790
- USDT: {
2791
- symbol: "USDT",
2792
- name: "Tether USD",
2793
- decimals: 6,
2794
- addresses: {
2795
- 8453: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
2796
- 84532: "0x323e78f944A9a1FcF3a10efcC5319DBb0bB6e673",
2797
- 42161: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"
2798
- }
2799
- },
2800
- DAI: {
2801
- symbol: "DAI",
2802
- name: "Dai Stablecoin",
2803
- decimals: 18,
2804
- addresses: {
2805
- 8453: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
2806
- 84532: "0x819ffecd4e64f193e959944bcd57eedc7755e17a",
2807
- 42161: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"
2808
- }
2809
- },
2810
- WETH: {
2811
- symbol: "WETH",
2812
- name: "Wrapped Ether",
2813
- decimals: 18,
2814
- addresses: {
2815
- 8453: "0x4200000000000000000000000000000000000006",
2816
- 84532: "0x4200000000000000000000000000000000000006",
2817
- 42161: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
2818
- 421614: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73"
2819
- }
2820
- },
2821
- WBTC: {
2822
- symbol: "WBTC",
2823
- name: "Wrapped BTC",
2824
- decimals: 8,
2825
- addresses: {
2826
- 8453: "0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",
2827
- 42161: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"
2828
- }
2829
- },
2830
- cbBTC: {
2831
- symbol: "cbBTC",
2832
- name: "Coinbase Wrapped BTC",
2833
- decimals: 8,
2834
- addresses: {
2835
- 8453: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
2836
- 42161: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"
2837
- }
2838
- },
2839
- // ── Liquid staking ──────────────────────────────────────
2840
- cbETH: {
2841
- symbol: "cbETH",
2842
- name: "Coinbase Staked ETH",
2843
- decimals: 18,
2844
- addresses: {
2845
- 8453: "0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22",
2846
- 42161: "0x1DEBd73E752bEaF79865Fd6446b0c970EaE7732f"
2847
- }
2848
- },
2849
- wstETH: {
2850
- symbol: "wstETH",
2851
- name: "Lido Wrapped stETH",
2852
- decimals: 18,
2853
- addresses: {
2854
- 8453: "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452",
2855
- 42161: "0x5979D7b546E38E414F7E9822514be443A4800529"
2856
- }
2857
- },
2858
- rETH: {
2859
- symbol: "rETH",
2860
- name: "Rocket Pool ETH",
2861
- decimals: 18,
2862
- addresses: {
2863
- 42161: "0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8"
2864
- }
2865
- },
2866
- // ── DeFi blue-chips ─────────────────────────────────────
2867
- LINK: {
2868
- symbol: "LINK",
2869
- name: "Chainlink",
2870
- decimals: 18,
2871
- addresses: {
2872
- 8453: "0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196",
2873
- 84532: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
2874
- 42161: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4"
2875
- }
2876
- },
2877
- UNI: {
2878
- symbol: "UNI",
2879
- name: "Uniswap",
2880
- decimals: 18,
2881
- addresses: {
2882
- 8453: "0xc3De830EA07524a0761646a6a4e4be0e114a3C83",
2883
- 42161: "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0"
2884
- }
2885
- },
2886
- AAVE: {
2887
- symbol: "AAVE",
2888
- name: "Aave",
2889
- decimals: 18,
2890
- addresses: {
2891
- 8453: "0x63706e401c06ac8513145b7687A14804d17f814b",
2892
- 42161: "0xba5DdD1f9d7F570dc94a51479a000E3BCE967196"
2893
- }
2894
- },
2895
- COMP: {
2896
- symbol: "COMP",
2897
- name: "Compound",
2898
- decimals: 18,
2899
- addresses: {
2900
- 8453: "0x9e1028F5F1D5eDE59748FFceE5532509976840E0",
2901
- 42161: "0x354A6dA3fcde098F8389cad84b0182725c6C91dE"
2902
- }
2903
- },
2904
- CRV: {
2905
- symbol: "CRV",
2906
- name: "Curve DAO",
2907
- decimals: 18,
2908
- addresses: {
2909
- 8453: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415",
2910
- 42161: "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978"
2911
- }
2912
- },
2913
- SNX: {
2914
- symbol: "SNX",
2915
- name: "Synthetix",
2916
- decimals: 18,
2917
- addresses: {
2918
- 8453: "0x22e6966B799c4D5B13BE962E1D117b56327FDa66"
2919
- }
2920
- },
2921
- // ── Chain-native governance ─────────────────────────────
2922
- ARB: {
2923
- symbol: "ARB",
2924
- name: "Arbitrum",
2925
- decimals: 18,
2926
- addresses: {
2927
- 42161: "0x912CE59144191C1204E64559FE8253a0e49E6548"
2928
- }
2929
- },
2930
- AERO: {
2931
- symbol: "AERO",
2932
- name: "Aerodrome",
2933
- decimals: 18,
2934
- addresses: {
2935
- 8453: "0x940181a94A35A4569E4529A3CDfB74e38FD98631"
2936
- }
2937
- },
2938
- GMX: {
2939
- symbol: "GMX",
2940
- name: "GMX",
2941
- decimals: 18,
2942
- addresses: {
2943
- 42161: "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a"
2944
- }
2945
- }
2946
- };
2947
- var addressToSymbol = /* @__PURE__ */ new Map();
2948
- for (const token of Object.values(KNOWN_TOKENS)) {
2949
- for (const addr of Object.values(token.addresses)) {
2950
- addressToSymbol.set(addr.toLowerCase(), token.symbol);
2951
- }
2952
- }
2953
- function getKnownTokensForChain(chainId) {
2954
- const result = [];
2955
- for (const token of Object.values(KNOWN_TOKENS)) {
2956
- const addr = token.addresses[chainId];
2957
- if (addr) {
2958
- result.push({ ...token, address: addr });
2959
- }
2960
- }
2961
- return result;
2962
- }
2963
- function getTokenSymbolByAddress(address) {
2964
- return addressToSymbol.get(address.toLowerCase()) ?? null;
2965
- }
2966
- function resolveToken(token, chainId) {
2967
- if (typeof token === "string" && token.startsWith("0x")) {
2968
- if (token === "0x0000000000000000000000000000000000000000") {
2969
- throw new Error("Token address cannot be the zero address");
2970
- }
2971
- return token;
2972
- }
2973
- const entry = KNOWN_TOKENS[token];
2974
- if (!entry) {
2975
- throw new Error(`Unknown token symbol: ${token}`);
2976
- }
2977
- const addr = entry.addresses[chainId];
2978
- if (!addr) {
2979
- throw new Error(`Token ${token} is not available on chain ${chainId}`);
2980
- }
2981
- return addr;
2982
- }
2983
- function resolveTokenDecimals(token, chainId) {
2984
- if (typeof token === "string" && token.startsWith("0x")) {
2985
- const symbol = getTokenSymbolByAddress(token);
2986
- if (!symbol) {
2987
- throw new Error(
2988
- `Unknown token address ${token} \u2014 cannot determine decimals. Use a bigint amount instead, or pass a known token symbol.`
2989
- );
2990
- }
2991
- const entry2 = KNOWN_TOKENS[symbol];
2992
- return entry2.decimals;
2993
- }
2994
- const entry = KNOWN_TOKENS[token];
2995
- if (!entry) {
2996
- throw new Error(
2997
- `Unknown token symbol "${token}" \u2014 cannot determine decimals. Use a bigint amount instead, or use a known symbol (${Object.keys(KNOWN_TOKENS).join(", ")}).`
2998
- );
2999
- }
3000
- return entry.decimals;
3001
- }
3002
- function parseAmount(amount, token, chainId) {
3003
- if (typeof amount === "bigint") {
3004
- return amount;
3005
- }
3006
- const decimals = resolveTokenDecimals(token);
3007
- const str = typeof amount === "number" ? amount.toString() : amount;
3008
- const dotIndex = str.indexOf(".");
3009
- if (dotIndex !== -1) {
3010
- const decimalPlaces = str.length - dotIndex - 1;
3011
- if (decimalPlaces > decimals) {
3012
- throw new Error(
3013
- `Amount "${str}" has ${decimalPlaces} decimal places, but ${typeof token === "string" && token.startsWith("0x") ? "this token" : token} only supports ${decimals}. Truncate or round your amount.`
3014
- );
3015
- }
3016
- }
3017
- return viem.parseUnits(str, decimals);
3018
- }
3019
-
3020
- // src/utils.ts
3021
- function generateUuid() {
3022
- const bytes = new Uint8Array(16);
3023
- if (typeof crypto !== "undefined" && crypto.getRandomValues) {
3024
- crypto.getRandomValues(bytes);
3025
- } else {
3026
- const { randomBytes } = __require("crypto");
3027
- const buf = randomBytes(16);
3028
- for (let i = 0; i < 16; i++) bytes[i] = buf[i] ?? 0;
3029
- }
3030
- bytes[6] = bytes[6] & 15 | 64;
3031
- bytes[8] = bytes[8] & 63 | 128;
3032
- const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
3033
- return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
3034
- }
3035
- var AxonClient = class {
3036
- constructor(config) {
3037
- this.vaultAddress = config.vaultAddress;
3038
- this.chainId = config.chainId;
3039
- this.relayerUrl = "https://relay.axonfi.xyz";
3040
- if (!config.botPrivateKey) {
3041
- throw new Error("botPrivateKey is required in AxonClientConfig");
3042
- }
3043
- this.walletClient = createAxonWalletClient(config.botPrivateKey, config.chainId);
3044
- }
3045
- // ============================================================================
3046
- // Bot address
3047
- // ============================================================================
3048
- /** Returns the bot's address derived from the configured private key. */
3049
- get botAddress() {
3050
- const account = this.walletClient.account;
3051
- if (!account) throw new Error("No account on walletClient");
3052
- return account.address;
3053
- }
3054
- // ============================================================================
3055
- // pay()
3056
- // ============================================================================
3057
- /**
3058
- * Create, sign, and submit a payment intent to the Axon relayer.
3059
- *
3060
- * Three possible outcomes (all included in PaymentResult.status):
3061
- * - `"approved"`: fast path — txHash available immediately
3062
- * - `"pending_review"`: AI scan or human review in progress — poll for status
3063
- * - `"rejected"`: payment was rejected — reason field explains why
3064
- */
3065
- async pay(input) {
3066
- const intent = this._buildPaymentIntent(input);
3067
- const signature = await signPayment(this.walletClient, this.vaultAddress, this.chainId, intent);
3068
- return this._submitPayment(intent, signature, input);
3069
- }
3070
- // ============================================================================
3071
- // execute()
3072
- // ============================================================================
3073
- /**
3074
- * Sign and submit a DeFi protocol execution to the Axon relayer.
3075
- *
3076
- * The vault approves `token` to `protocol`, calls it with `callData`,
3077
- * then revokes the approval. Tokens stay in the vault or go to the protocol
3078
- * as specified by the calldata.
3079
- */
3080
- async execute(input) {
3081
- const intent = this._buildExecuteIntent(input);
3082
- const signature = await signExecuteIntent(this.walletClient, this.vaultAddress, this.chainId, intent);
3083
- return this._submitExecute(intent, signature, input);
3084
- }
3085
- // ============================================================================
3086
- // swap()
3087
- // ============================================================================
3088
- /**
3089
- * Sign and submit an in-vault token swap to the Axon relayer.
3090
- *
3091
- * Swaps tokens within the vault (no external recipient). Useful for
3092
- * rebalancing vault holdings.
3093
- */
3094
- async swap(input) {
3095
- const intent = this._buildSwapIntent(input);
3096
- const signature = await signSwapIntent(this.walletClient, this.vaultAddress, this.chainId, intent);
3097
- return this._submitSwap(intent, signature, input);
3098
- }
3099
- // ============================================================================
3100
- // getBalance() — via relayer
3101
- // ============================================================================
3102
- /** Read the vault's ERC-20 balance for a given token (via relayer). */
3103
- async getBalance(token) {
3104
- const path = RELAYER_API.vaultBalance(this.vaultAddress, token, this.chainId);
3105
- const data = await this._get(path);
3106
- return BigInt(data.balance);
3107
- }
3108
- // ============================================================================
3109
- // getBalances() — via relayer
3110
- // ============================================================================
3111
- /**
3112
- * Read the vault's ERC-20 balances for multiple tokens in a single call (via relayer).
3113
- * Returns a record mapping token address → balance.
3114
- */
3115
- async getBalances(tokens) {
3116
- const path = RELAYER_API.vaultBalances(this.vaultAddress, this.chainId);
3117
- const url = `${this.relayerUrl}${path}?chainId=${this.chainId}&tokens=${tokens.join(",")}`;
3118
- const response = await fetch(url, {
3119
- method: "GET",
3120
- headers: { "Content-Type": "application/json" }
3121
- });
3122
- if (!response.ok) {
3123
- const body = await response.text();
3124
- throw new Error(`Relayer request failed [${response.status}]: ${body}`);
3125
- }
3126
- const data = await response.json();
3127
- const result = {};
3128
- for (const [addr, val] of Object.entries(data.balances)) {
3129
- result[addr] = BigInt(val);
3130
- }
3131
- return result;
3132
- }
3133
- // ============================================================================
3134
- // isActive() — via relayer
3135
- // ============================================================================
3136
- /** Returns whether this bot is registered and active in the vault (via relayer). */
3137
- async isActive() {
3138
- const path = RELAYER_API.botStatus(this.vaultAddress, this.botAddress, this.chainId);
3139
- const data = await this._get(path);
3140
- return data.isActive;
3141
- }
3142
- // ============================================================================
3143
- // isPaused() — via relayer
3144
- // ============================================================================
3145
- /** Returns whether the vault is currently paused (via relayer). */
3146
- async isPaused() {
3147
- const path = RELAYER_API.vaultInfo(this.vaultAddress, this.chainId);
3148
- const data = await this._get(path);
3149
- return data.paused;
3150
- }
3151
- // ============================================================================
3152
- // getVaultInfo() — via relayer
3153
- // ============================================================================
3154
- /** Returns high-level vault info (owner, operator, paused, version) via relayer. */
3155
- async getVaultInfo() {
3156
- const path = RELAYER_API.vaultInfo(this.vaultAddress, this.chainId);
3157
- return this._get(path);
3158
- }
3159
- // ============================================================================
3160
- // canPayTo() — via relayer
3161
- // ============================================================================
3162
- /**
3163
- * Check whether this bot can pay to a given destination address (via relayer).
3164
- * Checks blacklist → global whitelist → bot whitelist, matching on-chain logic.
3165
- */
3166
- async canPayTo(destination) {
3167
- const path = RELAYER_API.destinationCheck(this.vaultAddress, this.botAddress, destination, this.chainId);
3168
- return this._get(path);
3169
- }
3170
- // ============================================================================
3171
- // isProtocolApproved() — via relayer
3172
- // ============================================================================
3173
- /** Returns whether a protocol address is approved for executeProtocol() calls (via relayer). */
3174
- async isProtocolApproved(protocol) {
3175
- const path = RELAYER_API.protocolCheck(this.vaultAddress, protocol, this.chainId);
3176
- const data = await this._get(path);
3177
- return data.approved;
3178
- }
3179
- // ============================================================================
3180
- // getRebalanceTokens() — via relayer
3181
- // ============================================================================
3182
- /**
3183
- * Returns the effective rebalance token whitelist for this vault.
3184
- *
3185
- * If the owner set tokens on-chain, those override entirely.
3186
- * If no on-chain whitelist, returns relayer defaults (USDC, WETH, USDT).
3187
- * Use this before calling swap() to check which output tokens are allowed.
3188
- */
3189
- async getRebalanceTokens() {
3190
- const path = RELAYER_API.rebalanceTokens(this.vaultAddress, this.chainId);
3191
- return this._get(path);
3192
- }
3193
- // ============================================================================
3194
- // isRebalanceTokenAllowed() — via relayer
3195
- // ============================================================================
3196
- /** Check if a specific token is allowed for rebalancing (executeSwap output) on this vault. */
3197
- async isRebalanceTokenAllowed(token) {
3198
- const path = RELAYER_API.rebalanceTokenCheck(this.vaultAddress, token, this.chainId);
3199
- return this._get(path);
3200
- }
3201
- // ============================================================================
3202
- // TOS (Terms of Service)
3203
- // ============================================================================
3204
- /** Check if a wallet has accepted the current TOS version. */
3205
- async getTosStatus(wallet) {
3206
- return this._get(RELAYER_API.tosStatus(wallet));
3207
- }
3208
- /**
3209
- * Sign and submit TOS acceptance. Uses the owner's wallet (not the bot key).
3210
- *
3211
- * @param signer - Object with a `signMessage` method (e.g. a viem WalletClient
3212
- * or ethers Signer). This should be the vault owner's wallet, not the bot key.
3213
- * @param wallet - The owner's wallet address (must match the signer).
3214
- */
3215
- async acceptTos(signer, wallet) {
3216
- const { tosVersion } = await this.getTosStatus(wallet);
3217
- const timestamp = Math.floor(Date.now() / 1e3);
3218
- const message = `I accept the Axon Terms of Service (${tosVersion}).
3219
- Wallet: ${wallet}
3220
- Timestamp: ${timestamp}`;
3221
- const signature = await signer.signMessage({ message });
3222
- const url = `${this.relayerUrl}${RELAYER_API.TOS_ACCEPT}`;
3223
- const response = await fetch(url, {
3224
- method: "POST",
3225
- headers: { "Content-Type": "application/json" },
3226
- body: JSON.stringify({ wallet, signature, tosVersion, timestamp })
3227
- });
3228
- if (!response.ok) {
3229
- const body = await response.text();
3230
- throw new Error(`TOS acceptance failed [${response.status}]: ${body}`);
3231
- }
3232
- return response.json();
3233
- }
3234
- // ============================================================================
3235
- // poll() / pollExecute() / pollSwap()
3236
- // ============================================================================
3237
- /**
3238
- * Poll the relayer for the status of an async payment.
3239
- *
3240
- * Use this when pay() returns `status: "pending_review"`. Poll until
3241
- * status is `"approved"` or `"rejected"`.
3242
- *
3243
- * Recommended polling interval: 5–10 seconds.
3244
- */
3245
- async poll(requestId) {
3246
- return this._get(RELAYER_API.payment(requestId));
3247
- }
3248
- /** Poll the relayer for the status of an async protocol execution. */
3249
- async pollExecute(requestId) {
3250
- return this._get(RELAYER_API.execute(requestId));
3251
- }
3252
- /** Poll the relayer for the status of an async swap. */
3253
- async pollSwap(requestId) {
3254
- return this._get(RELAYER_API.swap(requestId));
3255
- }
3256
- // ============================================================================
3257
- // signPayment() — low-level access
3258
- // ============================================================================
3259
- /**
3260
- * Sign a PaymentIntent directly without submitting to the relayer.
3261
- *
3262
- * Use this if you want to build the intent yourself and pass the signature
3263
- * to another system (e.g. a custom relayer integration).
3264
- */
3265
- async signPayment(intent) {
3266
- return signPayment(this.walletClient, this.vaultAddress, this.chainId, intent);
3267
- }
3268
- // ============================================================================
3269
- // Internal helpers
3270
- // ============================================================================
3271
- async _get(path) {
3272
- const url = `${this.relayerUrl}${path}`;
3273
- const response = await fetch(url, {
3274
- method: "GET",
3275
- headers: { "Content-Type": "application/json" }
3276
- });
3277
- if (!response.ok) {
3278
- const body = await response.text();
3279
- throw new Error(`Relayer request failed [${response.status}]: ${body}`);
3280
- }
3281
- return response.json();
3282
- }
3283
- _defaultDeadline() {
3284
- return BigInt(Math.floor(Date.now() / 1e3) + DEFAULT_DEADLINE_SECONDS);
3285
- }
3286
- _resolveRef(memo, ref) {
3287
- if (ref) return ref;
3288
- if (memo) return encodeRef(memo);
3289
- return "0x0000000000000000000000000000000000000000000000000000000000000000";
3290
- }
3291
- _buildPaymentIntent(input) {
3292
- if (input.to === "0x0000000000000000000000000000000000000000") {
3293
- throw new Error("Payment recipient cannot be the zero address");
3294
- }
3295
- return {
3296
- bot: this.botAddress,
3297
- to: input.to,
3298
- token: resolveToken(input.token, this.chainId),
3299
- amount: parseAmount(input.amount, input.token, this.chainId),
3300
- deadline: input.deadline ?? this._defaultDeadline(),
3301
- ref: this._resolveRef(input.memo, input.ref)
3302
- };
3303
- }
3304
- _buildExecuteIntent(input) {
3305
- return {
3306
- bot: this.botAddress,
3307
- protocol: input.protocol,
3308
- calldataHash: viem.keccak256(input.callData),
3309
- token: resolveToken(input.token, this.chainId),
3310
- amount: parseAmount(input.amount, input.token, this.chainId),
3311
- deadline: input.deadline ?? this._defaultDeadline(),
3312
- ref: this._resolveRef(input.memo, input.ref)
3313
- };
3314
- }
3315
- _buildSwapIntent(input) {
3316
- return {
3317
- bot: this.botAddress,
3318
- toToken: resolveToken(input.toToken, this.chainId),
3319
- minToAmount: parseAmount(input.minToAmount, input.toToken, this.chainId),
3320
- deadline: input.deadline ?? this._defaultDeadline(),
3321
- ref: this._resolveRef(input.memo, input.ref)
3322
- };
3323
- }
3324
- async _submitPayment(intent, signature, input) {
3325
- const idempotencyKey = input.idempotencyKey ?? generateUuid();
3326
- const body = {
3327
- // Routing
3328
- chainId: this.chainId,
3329
- vaultAddress: this.vaultAddress,
3330
- // Flat intent fields (matches relayer DTO)
3331
- bot: intent.bot,
3332
- to: intent.to,
3333
- token: intent.token,
3334
- amount: intent.amount.toString(),
3335
- deadline: intent.deadline.toString(),
3336
- ref: intent.ref,
3337
- signature,
3338
- // Off-chain metadata
3339
- idempotencyKey,
3340
- ...input.memo !== void 0 && { memo: input.memo },
3341
- ...input.resourceUrl !== void 0 && { resourceUrl: input.resourceUrl },
3342
- ...input.invoiceId !== void 0 && { invoiceId: input.invoiceId },
3343
- ...input.orderId !== void 0 && { orderId: input.orderId },
3344
- ...input.recipientLabel !== void 0 && { recipientLabel: input.recipientLabel },
3345
- ...input.metadata !== void 0 && { metadata: input.metadata }
3346
- };
3347
- return this._post(RELAYER_API.PAYMENTS, idempotencyKey, body);
3348
- }
3349
- async _submitExecute(intent, signature, input) {
3350
- const idempotencyKey = input.idempotencyKey ?? generateUuid();
3351
- const fromToken = input.fromToken !== void 0 ? resolveToken(input.fromToken, this.chainId) : void 0;
3352
- const maxFromAmount = input.maxFromAmount !== void 0 ? parseAmount(input.maxFromAmount, input.fromToken ?? input.token, this.chainId) : void 0;
3353
- const body = {
3354
- chainId: this.chainId,
3355
- vaultAddress: this.vaultAddress,
3356
- // Flat intent fields
3357
- bot: intent.bot,
3358
- protocol: intent.protocol,
3359
- calldataHash: intent.calldataHash,
3360
- token: intent.token,
3361
- amount: intent.amount.toString(),
3362
- deadline: intent.deadline.toString(),
3363
- ref: intent.ref,
3364
- signature,
3365
- // Protocol calldata
3366
- callData: input.callData,
3367
- // Optional pre-swap
3368
- ...fromToken !== void 0 && { fromToken },
3369
- ...maxFromAmount !== void 0 && { maxFromAmount: maxFromAmount.toString() },
3370
- // Off-chain metadata
3371
- idempotencyKey,
3372
- ...input.memo !== void 0 && { memo: input.memo },
3373
- ...input.protocolName !== void 0 && { protocolName: input.protocolName },
3374
- ...input.metadata !== void 0 && { metadata: input.metadata }
3375
- };
3376
- return this._post(RELAYER_API.EXECUTE, idempotencyKey, body);
3377
- }
3378
- async _submitSwap(intent, signature, input) {
3379
- const idempotencyKey = input.idempotencyKey ?? generateUuid();
3380
- const fromToken = input.fromToken !== void 0 ? resolveToken(input.fromToken, this.chainId) : void 0;
3381
- const maxFromAmount = input.maxFromAmount !== void 0 ? parseAmount(input.maxFromAmount, input.fromToken ?? input.toToken, this.chainId) : void 0;
3382
- const body = {
3383
- chainId: this.chainId,
3384
- vaultAddress: this.vaultAddress,
3385
- // Flat intent fields
3386
- bot: intent.bot,
3387
- toToken: intent.toToken,
3388
- minToAmount: intent.minToAmount.toString(),
3389
- deadline: intent.deadline.toString(),
3390
- ref: intent.ref,
3391
- signature,
3392
- // Optional source token
3393
- ...fromToken !== void 0 && { fromToken },
3394
- ...maxFromAmount !== void 0 && { maxFromAmount: maxFromAmount.toString() },
3395
- // Off-chain metadata
3396
- idempotencyKey,
3397
- ...input.memo !== void 0 && { memo: input.memo }
3398
- };
3399
- return this._post(RELAYER_API.SWAP, idempotencyKey, body);
3400
- }
3401
- async _post(path, idempotencyKey, body) {
3402
- const url = `${this.relayerUrl}${path}`;
3403
- const response = await fetch(url, {
3404
- method: "POST",
3405
- headers: {
3406
- "Content-Type": "application/json",
3407
- "Idempotency-Key": idempotencyKey
3408
- },
3409
- body: JSON.stringify(body)
3410
- });
3411
- if (!response.ok) {
3412
- const responseBody = await response.text();
3413
- throw new Error(`Relayer request failed [${response.status}]: ${responseBody}`);
3414
- }
3415
- return response.json();
3416
- }
3417
- };
3418
- var SCRYPT_N = 262144;
3419
- var SCRYPT_R = 8;
3420
- var SCRYPT_P = 1;
3421
- var SCRYPT_DKLEN = 32;
3422
- function getRandomBytes(length) {
3423
- const bytes = new Uint8Array(length);
3424
- if (typeof crypto !== "undefined" && crypto.getRandomValues) {
3425
- crypto.getRandomValues(bytes);
3426
- } else {
3427
- const { randomBytes } = __require("crypto");
3428
- const buf = randomBytes(length);
3429
- for (let i = 0; i < length; i++) bytes[i] = buf[i] ?? 0;
3430
- }
3431
- return bytes;
3432
- }
3433
- function hexToBytes(hex) {
3434
- const clean = hex.startsWith("0x") ? hex.slice(2) : hex;
3435
- const bytes = new Uint8Array(clean.length / 2);
3436
- for (let i = 0; i < bytes.length; i++) {
3437
- bytes[i] = parseInt(clean.slice(i * 2, i * 2 + 2), 16);
3438
- }
3439
- return bytes;
3440
- }
3441
- function bytesToHex(bytes) {
3442
- return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
3443
- }
3444
- async function encryptKeystore(privateKey, passphrase) {
3445
- if (!passphrase) throw new Error("Passphrase must not be empty");
3446
- const keyBytes = hexToBytes(privateKey);
3447
- const account = accounts.privateKeyToAccount(privateKey);
3448
- const address = account.address.slice(2).toLowerCase();
3449
- const salt = getRandomBytes(32);
3450
- const iv = getRandomBytes(16);
3451
- const derivedKey = await scrypt.scryptAsync(new TextEncoder().encode(passphrase), salt, {
3452
- N: SCRYPT_N,
3453
- r: SCRYPT_R,
3454
- p: SCRYPT_P,
3455
- dkLen: SCRYPT_DKLEN
3456
- });
3457
- const encryptionKey = derivedKey.slice(0, 16);
3458
- const cipher = aes.ctr(encryptionKey, iv);
3459
- const ciphertext = cipher.encrypt(keyBytes);
3460
- const macInput = new Uint8Array(16 + ciphertext.length);
3461
- macInput.set(derivedKey.slice(16, 32), 0);
3462
- macInput.set(ciphertext, 16);
3463
- const mac = sha3.keccak_256(macInput);
3464
- return {
3465
- version: 3,
3466
- id: generateUuid(),
3467
- address,
3468
- crypto: {
3469
- ciphertext: bytesToHex(ciphertext),
3470
- cipherparams: { iv: bytesToHex(iv) },
3471
- cipher: "aes-128-ctr",
3472
- kdf: "scrypt",
3473
- kdfparams: {
3474
- dklen: SCRYPT_DKLEN,
3475
- salt: bytesToHex(salt),
3476
- n: SCRYPT_N,
3477
- r: SCRYPT_R,
3478
- p: SCRYPT_P
3479
- },
3480
- mac: bytesToHex(mac)
3481
- }
3482
- };
3483
- }
3484
- async function decryptKeystore(keystore, passphrase) {
3485
- let ks;
3486
- if (typeof keystore === "string") {
3487
- try {
3488
- ks = JSON.parse(keystore);
3489
- } catch {
3490
- throw new Error("Invalid keystore: could not parse JSON");
3491
- }
3492
- } else {
3493
- ks = keystore;
3494
- }
3495
- if (ks.version !== 3) throw new Error(`Unsupported keystore version: ${ks.version}`);
3496
- if (!ks.crypto) throw new Error("Invalid keystore: missing crypto field");
3497
- if (ks.crypto.kdf !== "scrypt") throw new Error(`Unsupported KDF: ${ks.crypto.kdf}`);
3498
- if (ks.crypto.cipher !== "aes-128-ctr") throw new Error(`Unsupported cipher: ${ks.crypto.cipher}`);
3499
- const { kdfparams, ciphertext: ctHex, cipherparams, mac: expectedMacHex } = ks.crypto;
3500
- const salt = hexToBytes(kdfparams.salt);
3501
- const derivedKey = await scrypt.scryptAsync(new TextEncoder().encode(passphrase), salt, {
3502
- N: kdfparams.n,
3503
- r: kdfparams.r,
3504
- p: kdfparams.p,
3505
- dkLen: kdfparams.dklen
3506
- });
3507
- const ciphertextBytes = hexToBytes(ctHex);
3508
- const macInput = new Uint8Array(16 + ciphertextBytes.length);
3509
- macInput.set(derivedKey.slice(16, 32), 0);
3510
- macInput.set(ciphertextBytes, 16);
3511
- const computedMac = bytesToHex(sha3.keccak_256(macInput));
3512
- if (computedMac !== expectedMacHex) {
3513
- throw new Error("Wrong passphrase: MAC mismatch");
3514
- }
3515
- const iv = hexToBytes(cipherparams.iv);
3516
- const encryptionKey = derivedKey.slice(0, 16);
3517
- const cipher = aes.ctr(encryptionKey, iv);
3518
- const plaintext = cipher.decrypt(ciphertextBytes);
3519
- return `0x${bytesToHex(plaintext)}`;
3520
- }
3521
-
3522
- // src/abis/AxonRegistry.ts
3523
- var AxonRegistryAbi = [
3524
- {
3525
- "type": "constructor",
3526
- "inputs": [
3527
- {
3528
- "name": "initialOwner",
3529
- "type": "address",
3530
- "internalType": "address"
3531
- }
3532
- ],
3533
- "stateMutability": "nonpayable"
3534
- },
3535
- {
3536
- "type": "function",
3537
- "name": "acceptOwnership",
3538
- "inputs": [],
3539
- "outputs": [],
3540
- "stateMutability": "nonpayable"
3541
- },
3542
- {
3543
- "type": "function",
3544
- "name": "addRelayer",
3545
- "inputs": [
3546
- {
3547
- "name": "relayer",
3548
- "type": "address",
3549
- "internalType": "address"
3550
- }
3551
- ],
3552
- "outputs": [],
3553
- "stateMutability": "nonpayable"
3554
- },
3555
- {
3556
- "type": "function",
3557
- "name": "addSwapRouter",
3558
- "inputs": [
3559
- {
3560
- "name": "router",
3561
- "type": "address",
3562
- "internalType": "address"
3563
- }
3564
- ],
3565
- "outputs": [],
3566
- "stateMutability": "nonpayable"
3567
- },
3568
- {
3569
- "type": "function",
3570
- "name": "isApprovedSwapRouter",
3571
- "inputs": [
3572
- {
3573
- "name": "router",
3574
- "type": "address",
3575
- "internalType": "address"
3576
- }
3577
- ],
3578
- "outputs": [
3579
- {
3580
- "name": "",
3581
- "type": "bool",
3582
- "internalType": "bool"
3583
- }
3584
- ],
3585
- "stateMutability": "view"
3586
- },
3587
- {
3588
- "type": "function",
3589
- "name": "isAuthorized",
3590
- "inputs": [
3591
- {
3592
- "name": "relayer",
3593
- "type": "address",
3594
- "internalType": "address"
3595
- }
3596
- ],
3597
- "outputs": [
3598
- {
3599
- "name": "",
3600
- "type": "bool",
3601
- "internalType": "bool"
3602
- }
3603
- ],
3604
- "stateMutability": "view"
3605
- },
3606
- {
3607
- "type": "function",
3608
- "name": "owner",
3609
- "inputs": [],
3610
- "outputs": [
3611
- {
3612
- "name": "",
3613
- "type": "address",
3614
- "internalType": "address"
3615
- }
3616
- ],
3617
- "stateMutability": "view"
3618
- },
3619
- {
3620
- "type": "function",
3621
- "name": "pendingOwner",
3622
- "inputs": [],
3623
- "outputs": [
3624
- {
3625
- "name": "",
3626
- "type": "address",
3627
- "internalType": "address"
3628
- }
3629
- ],
3630
- "stateMutability": "view"
3631
- },
3632
- {
3633
- "type": "function",
3634
- "name": "removeRelayer",
3635
- "inputs": [
3636
- {
3637
- "name": "relayer",
3638
- "type": "address",
3639
- "internalType": "address"
3640
- }
3641
- ],
3642
- "outputs": [],
3643
- "stateMutability": "nonpayable"
3644
- },
3645
- {
3646
- "type": "function",
3647
- "name": "removeSwapRouter",
3648
- "inputs": [
3649
- {
3650
- "name": "router",
3651
- "type": "address",
3652
- "internalType": "address"
3653
- }
3654
- ],
3655
- "outputs": [],
3656
- "stateMutability": "nonpayable"
3657
- },
3658
- {
3659
- "type": "function",
3660
- "name": "renounceOwnership",
3661
- "inputs": [],
3662
- "outputs": [],
3663
- "stateMutability": "nonpayable"
3664
- },
3665
- {
3666
- "type": "function",
3667
- "name": "setOracleConfig",
3668
- "inputs": [
3669
- {
3670
- "name": "uniV3Factory",
3671
- "type": "address",
3672
- "internalType": "address"
3673
- },
3674
- {
3675
- "name": "usdc",
3676
- "type": "address",
3677
- "internalType": "address"
3678
- },
3679
- {
3680
- "name": "weth",
3681
- "type": "address",
3682
- "internalType": "address"
3683
- }
3684
- ],
3685
- "outputs": [],
3686
- "stateMutability": "nonpayable"
3687
- },
3688
- {
3689
- "type": "function",
3690
- "name": "transferOwnership",
3691
- "inputs": [
3692
- {
3693
- "name": "newOwner",
3694
- "type": "address",
3695
- "internalType": "address"
3696
- }
3697
- ],
3698
- "outputs": [],
3699
- "stateMutability": "nonpayable"
3700
- },
3701
- {
3702
- "type": "function",
3703
- "name": "uniswapV3Factory",
3704
- "inputs": [],
3705
- "outputs": [
3706
- {
3707
- "name": "",
3708
- "type": "address",
3709
- "internalType": "address"
3710
- }
3711
- ],
3712
- "stateMutability": "view"
3713
- },
3714
- {
3715
- "type": "function",
3716
- "name": "usdcAddress",
3717
- "inputs": [],
3718
- "outputs": [
3719
- {
3720
- "name": "",
3721
- "type": "address",
3722
- "internalType": "address"
3723
- }
3724
- ],
3725
- "stateMutability": "view"
3726
- },
3727
- {
3728
- "type": "function",
3729
- "name": "wethAddress",
3730
- "inputs": [],
3731
- "outputs": [
3732
- {
3733
- "name": "",
3734
- "type": "address",
3735
- "internalType": "address"
3736
- }
3737
- ],
3738
- "stateMutability": "view"
3739
- },
3740
- {
3741
- "type": "event",
3742
- "name": "OracleConfigUpdated",
3743
- "inputs": [
3744
- {
3745
- "name": "uniswapV3Factory",
3746
- "type": "address",
3747
- "indexed": false,
3748
- "internalType": "address"
3749
- },
3750
- {
3751
- "name": "usdc",
3752
- "type": "address",
3753
- "indexed": false,
3754
- "internalType": "address"
3755
- },
3756
- {
3757
- "name": "weth",
3758
- "type": "address",
3759
- "indexed": false,
3760
- "internalType": "address"
3761
- }
3762
- ],
3763
- "anonymous": false
3764
- },
3765
- {
3766
- "type": "event",
3767
- "name": "OwnershipTransferStarted",
3768
- "inputs": [
3769
- {
3770
- "name": "previousOwner",
3771
- "type": "address",
3772
- "indexed": true,
3773
- "internalType": "address"
3774
- },
3775
- {
3776
- "name": "newOwner",
3777
- "type": "address",
3778
- "indexed": true,
3779
- "internalType": "address"
3780
- }
3781
- ],
3782
- "anonymous": false
3783
- },
3784
- {
3785
- "type": "event",
3786
- "name": "OwnershipTransferred",
3787
- "inputs": [
3788
- {
3789
- "name": "previousOwner",
3790
- "type": "address",
3791
- "indexed": true,
3792
- "internalType": "address"
3793
- },
3794
- {
3795
- "name": "newOwner",
3796
- "type": "address",
3797
- "indexed": true,
3798
- "internalType": "address"
3799
- }
3800
- ],
3801
- "anonymous": false
3802
- },
3803
- {
3804
- "type": "event",
3805
- "name": "RelayerAdded",
3806
- "inputs": [
3807
- {
3808
- "name": "relayer",
3809
- "type": "address",
3810
- "indexed": true,
3811
- "internalType": "address"
3812
- }
3813
- ],
3814
- "anonymous": false
3815
- },
3816
- {
3817
- "type": "event",
3818
- "name": "RelayerRemoved",
3819
- "inputs": [
3820
- {
3821
- "name": "relayer",
3822
- "type": "address",
3823
- "indexed": true,
3824
- "internalType": "address"
3825
- }
3826
- ],
3827
- "anonymous": false
3828
- },
3829
- {
3830
- "type": "event",
3831
- "name": "SwapRouterAdded",
3832
- "inputs": [
3833
- {
3834
- "name": "router",
3835
- "type": "address",
3836
- "indexed": true,
3837
- "internalType": "address"
3838
- }
3839
- ],
3840
- "anonymous": false
3841
- },
3842
- {
3843
- "type": "event",
3844
- "name": "SwapRouterRemoved",
3845
- "inputs": [
3846
- {
3847
- "name": "router",
3848
- "type": "address",
3849
- "indexed": true,
3850
- "internalType": "address"
3851
- }
3852
- ],
3853
- "anonymous": false
3854
- },
3855
- {
3856
- "type": "error",
3857
- "name": "AlreadyApproved",
3858
- "inputs": []
3859
- },
3860
- {
3861
- "type": "error",
3862
- "name": "AlreadyAuthorized",
3863
- "inputs": []
3864
- },
3865
- {
3866
- "type": "error",
3867
- "name": "NotApproved",
3868
- "inputs": []
3869
- },
3870
- {
3871
- "type": "error",
3872
- "name": "NotAuthorized",
3873
- "inputs": []
3874
- },
3875
- {
3876
- "type": "error",
3877
- "name": "OwnableInvalidOwner",
3878
- "inputs": [
3879
- {
3880
- "name": "owner",
3881
- "type": "address",
3882
- "internalType": "address"
3883
- }
3884
- ]
3885
- },
3886
- {
3887
- "type": "error",
3888
- "name": "OwnableUnauthorizedAccount",
3889
- "inputs": [
3890
- {
3891
- "name": "account",
3892
- "type": "address",
3893
- "internalType": "address"
3894
- }
3895
- ]
3896
- },
3897
- {
3898
- "type": "error",
3899
- "name": "ZeroAddress",
3900
- "inputs": []
3901
- }
3902
- ];
3903
-
3904
- exports.AxonClient = AxonClient;
3905
- exports.AxonRegistryAbi = AxonRegistryAbi;
3906
- exports.AxonVaultAbi = AxonVaultAbi;
3907
- exports.AxonVaultFactoryAbi = AxonVaultFactoryAbi;
3908
- exports.CHAIN_NAMES = CHAIN_NAMES;
3909
- exports.Chain = Chain;
3910
- exports.DEFAULT_DEADLINE_SECONDS = DEFAULT_DEADLINE_SECONDS;
3911
- exports.EIP712_DOMAIN_NAME = EIP712_DOMAIN_NAME;
3912
- exports.EIP712_DOMAIN_VERSION = EIP712_DOMAIN_VERSION;
3913
- exports.EXECUTE_INTENT_TYPEHASH = EXECUTE_INTENT_TYPEHASH;
3914
- exports.EXPLORER_ADDR = EXPLORER_ADDR;
3915
- exports.EXPLORER_TX = EXPLORER_TX;
3916
- exports.KNOWN_TOKENS = KNOWN_TOKENS;
3917
- exports.NATIVE_ETH = NATIVE_ETH;
3918
- exports.PAYMENT_INTENT_TYPEHASH = PAYMENT_INTENT_TYPEHASH;
3919
- exports.PaymentErrorCode = PaymentErrorCode;
3920
- exports.RELAYER_API = RELAYER_API;
3921
- exports.SUPPORTED_CHAIN_IDS = SUPPORTED_CHAIN_IDS;
3922
- exports.SWAP_INTENT_TYPEHASH = SWAP_INTENT_TYPEHASH;
3923
- exports.Token = Token;
3924
- exports.USDC = USDC;
3925
- exports.WINDOW = WINDOW;
3926
- exports.createAxonPublicClient = createAxonPublicClient;
3927
- exports.createAxonWalletClient = createAxonWalletClient;
3928
- exports.decryptKeystore = decryptKeystore;
3929
- exports.deployVault = deployVault;
3930
- exports.encodeRef = encodeRef;
3931
- exports.encryptKeystore = encryptKeystore;
3932
- exports.getBotConfig = getBotConfig;
3933
- exports.getChain = getChain;
3934
- exports.getDomainSeparator = getDomainSeparator;
3935
- exports.getKnownTokensForChain = getKnownTokensForChain;
3936
- exports.getOperatorCeilings = getOperatorCeilings;
3937
- exports.getRebalanceTokenCount = getRebalanceTokenCount;
3938
- exports.getTokenSymbolByAddress = getTokenSymbolByAddress;
3939
- exports.getVaultOperator = getVaultOperator;
3940
- exports.getVaultOwner = getVaultOwner;
3941
- exports.getVaultVersion = getVaultVersion;
3942
- exports.isBotActive = isBotActive;
3943
- exports.isDestinationAllowed = isDestinationAllowed;
3944
- exports.isRebalanceTokenWhitelisted = isRebalanceTokenWhitelisted;
3945
- exports.isVaultPaused = isVaultPaused;
3946
- exports.operatorMaxDrainPerDay = operatorMaxDrainPerDay;
3947
- exports.parseAmount = parseAmount;
3948
- exports.resolveToken = resolveToken;
3949
- exports.resolveTokenDecimals = resolveTokenDecimals;
3950
- exports.signExecuteIntent = signExecuteIntent;
3951
- exports.signPayment = signPayment;
3952
- exports.signSwapIntent = signSwapIntent;
3953
- //# sourceMappingURL=index.cjs.map
3954
- //# sourceMappingURL=index.cjs.map