@axonfi/sdk 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +16 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -33
- package/dist/index.d.ts +9 -33
- package/dist/index.js +17 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -51,6 +51,7 @@ declare const KNOWN_TOKENS: {
|
|
|
51
51
|
readonly decimals: 6;
|
|
52
52
|
readonly addresses: {
|
|
53
53
|
readonly 8453: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2";
|
|
54
|
+
readonly 84532: "0x323e78f944A9a1FcF3a10efcC5319DBb0bB6e673";
|
|
54
55
|
readonly 42161: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9";
|
|
55
56
|
};
|
|
56
57
|
};
|
|
@@ -578,7 +579,6 @@ interface VaultInfo {
|
|
|
578
579
|
operator: Address;
|
|
579
580
|
paused: boolean;
|
|
580
581
|
version: number;
|
|
581
|
-
trackUsedIntents: boolean;
|
|
582
582
|
}
|
|
583
583
|
/** Result of a destination check (canPayTo / isDestinationAllowed). */
|
|
584
584
|
interface DestinationCheckResult {
|
|
@@ -686,7 +686,7 @@ declare class AxonClient {
|
|
|
686
686
|
isActive(): Promise<boolean>;
|
|
687
687
|
/** Returns whether the vault is currently paused (via relayer). */
|
|
688
688
|
isPaused(): Promise<boolean>;
|
|
689
|
-
/** Returns high-level vault info (owner, operator, paused, version
|
|
689
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
690
690
|
getVaultInfo(): Promise<VaultInfo>;
|
|
691
691
|
/**
|
|
692
692
|
* Check whether this bot can pay to a given destination address (via relayer).
|
|
@@ -819,8 +819,6 @@ declare function getVaultVersion(publicClient: PublicClient, vaultAddress: Addre
|
|
|
819
819
|
declare function getVaultOwner(publicClient: PublicClient, vaultAddress: Address): Promise<Address>;
|
|
820
820
|
/** Returns the vault operator address (address(0) if no operator set). */
|
|
821
821
|
declare function getVaultOperator(publicClient: PublicClient, vaultAddress: Address): Promise<Address>;
|
|
822
|
-
/** Returns whether the vault tracks used intent hashes on-chain. */
|
|
823
|
-
declare function getTrackUsedIntents(publicClient: PublicClient, vaultAddress: Address): Promise<boolean>;
|
|
824
822
|
/**
|
|
825
823
|
* Check whether a destination address is allowed for a given bot.
|
|
826
824
|
*
|
|
@@ -843,12 +841,9 @@ declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAd
|
|
|
843
841
|
*
|
|
844
842
|
* @param walletClient Wallet that will own the deployed vault.
|
|
845
843
|
* @param factoryAddress Address of the deployed AxonVaultFactory.
|
|
846
|
-
* @param trackUsedIntents If true, executed intent hashes are stored on-chain
|
|
847
|
-
* to prevent exact replay. Default true — only disable
|
|
848
|
-
* for extreme high-frequency bots.
|
|
849
844
|
* @returns Address of the newly deployed vault.
|
|
850
845
|
*/
|
|
851
|
-
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address
|
|
846
|
+
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address): Promise<Address>;
|
|
852
847
|
|
|
853
848
|
interface KeystoreV3 {
|
|
854
849
|
version: 3;
|
|
@@ -953,10 +948,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
953
948
|
readonly name: "_axonRegistry";
|
|
954
949
|
readonly type: "address";
|
|
955
950
|
readonly internalType: "address";
|
|
956
|
-
}, {
|
|
957
|
-
readonly name: "_trackUsedIntents";
|
|
958
|
-
readonly type: "bool";
|
|
959
|
-
readonly internalType: "bool";
|
|
960
951
|
}];
|
|
961
952
|
readonly stateMutability: "nonpayable";
|
|
962
953
|
}, {
|
|
@@ -1774,16 +1765,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1774
1765
|
}];
|
|
1775
1766
|
readonly outputs: readonly [];
|
|
1776
1767
|
readonly stateMutability: "nonpayable";
|
|
1777
|
-
}, {
|
|
1778
|
-
readonly type: "function";
|
|
1779
|
-
readonly name: "trackUsedIntents";
|
|
1780
|
-
readonly inputs: readonly [];
|
|
1781
|
-
readonly outputs: readonly [{
|
|
1782
|
-
readonly name: "";
|
|
1783
|
-
readonly type: "bool";
|
|
1784
|
-
readonly internalType: "bool";
|
|
1785
|
-
}];
|
|
1786
|
-
readonly stateMutability: "view";
|
|
1787
1768
|
}, {
|
|
1788
1769
|
readonly type: "function";
|
|
1789
1770
|
readonly name: "transferOwnership";
|
|
@@ -2492,6 +2473,10 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2492
2473
|
readonly type: "address";
|
|
2493
2474
|
readonly internalType: "address";
|
|
2494
2475
|
}];
|
|
2476
|
+
}, {
|
|
2477
|
+
readonly type: "error";
|
|
2478
|
+
readonly name: "SameTokenSwap";
|
|
2479
|
+
readonly inputs: readonly [];
|
|
2495
2480
|
}, {
|
|
2496
2481
|
readonly type: "error";
|
|
2497
2482
|
readonly name: "SelfPayment";
|
|
@@ -2575,11 +2560,7 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2575
2560
|
}, {
|
|
2576
2561
|
readonly type: "function";
|
|
2577
2562
|
readonly name: "deployVault";
|
|
2578
|
-
readonly inputs: readonly [
|
|
2579
|
-
readonly name: "trackUsedIntents";
|
|
2580
|
-
readonly type: "bool";
|
|
2581
|
-
readonly internalType: "bool";
|
|
2582
|
-
}];
|
|
2563
|
+
readonly inputs: readonly [];
|
|
2583
2564
|
readonly outputs: readonly [{
|
|
2584
2565
|
readonly name: "vault";
|
|
2585
2566
|
readonly type: "address";
|
|
@@ -2717,11 +2698,6 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2717
2698
|
readonly type: "address";
|
|
2718
2699
|
readonly indexed: false;
|
|
2719
2700
|
readonly internalType: "address";
|
|
2720
|
-
}, {
|
|
2721
|
-
readonly name: "trackUsedIntents";
|
|
2722
|
-
readonly type: "bool";
|
|
2723
|
-
readonly indexed: false;
|
|
2724
|
-
readonly internalType: "bool";
|
|
2725
2701
|
}];
|
|
2726
2702
|
readonly anonymous: false;
|
|
2727
2703
|
}, {
|
|
@@ -3040,4 +3016,4 @@ declare const AxonRegistryAbi: readonly [{
|
|
|
3040
3016
|
readonly inputs: readonly [];
|
|
3041
3017
|
}];
|
|
3042
3018
|
|
|
3043
|
-
export { type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigParams, CHAIN_NAMES, Chain, DEFAULT_DEADLINE_SECONDS, type DestinationCheckResult, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, type ExecuteInput, type ExecuteIntent, KNOWN_TOKENS, type KeystoreV3, type KnownToken, type KnownTokenSymbol, NATIVE_ETH, type OperatorCeilings, PAYMENT_INTENT_TYPEHASH, type PayInput, PaymentErrorCode, type PaymentIntent, type PaymentResult, type PaymentStatus, RELAYER_API, type RebalanceTokensResult, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, type SpendingLimit, type SupportedChainId, type SwapInput, type SwapIntent, Token, type TokenInput, type TosStatus, USDC, type VaultInfo, WINDOW, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress,
|
|
3019
|
+
export { type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigParams, CHAIN_NAMES, Chain, DEFAULT_DEADLINE_SECONDS, type DestinationCheckResult, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, type ExecuteInput, type ExecuteIntent, KNOWN_TOKENS, type KeystoreV3, type KnownToken, type KnownTokenSymbol, NATIVE_ETH, type OperatorCeilings, PAYMENT_INTENT_TYPEHASH, type PayInput, PaymentErrorCode, type PaymentIntent, type PaymentResult, type PaymentStatus, RELAYER_API, type RebalanceTokensResult, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, type SpendingLimit, type SupportedChainId, type SwapInput, type SwapIntent, Token, type TokenInput, type TosStatus, USDC, type VaultInfo, WINDOW, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signSwapIntent };
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ declare const KNOWN_TOKENS: {
|
|
|
51
51
|
readonly decimals: 6;
|
|
52
52
|
readonly addresses: {
|
|
53
53
|
readonly 8453: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2";
|
|
54
|
+
readonly 84532: "0x323e78f944A9a1FcF3a10efcC5319DBb0bB6e673";
|
|
54
55
|
readonly 42161: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9";
|
|
55
56
|
};
|
|
56
57
|
};
|
|
@@ -578,7 +579,6 @@ interface VaultInfo {
|
|
|
578
579
|
operator: Address;
|
|
579
580
|
paused: boolean;
|
|
580
581
|
version: number;
|
|
581
|
-
trackUsedIntents: boolean;
|
|
582
582
|
}
|
|
583
583
|
/** Result of a destination check (canPayTo / isDestinationAllowed). */
|
|
584
584
|
interface DestinationCheckResult {
|
|
@@ -686,7 +686,7 @@ declare class AxonClient {
|
|
|
686
686
|
isActive(): Promise<boolean>;
|
|
687
687
|
/** Returns whether the vault is currently paused (via relayer). */
|
|
688
688
|
isPaused(): Promise<boolean>;
|
|
689
|
-
/** Returns high-level vault info (owner, operator, paused, version
|
|
689
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
690
690
|
getVaultInfo(): Promise<VaultInfo>;
|
|
691
691
|
/**
|
|
692
692
|
* Check whether this bot can pay to a given destination address (via relayer).
|
|
@@ -819,8 +819,6 @@ declare function getVaultVersion(publicClient: PublicClient, vaultAddress: Addre
|
|
|
819
819
|
declare function getVaultOwner(publicClient: PublicClient, vaultAddress: Address): Promise<Address>;
|
|
820
820
|
/** Returns the vault operator address (address(0) if no operator set). */
|
|
821
821
|
declare function getVaultOperator(publicClient: PublicClient, vaultAddress: Address): Promise<Address>;
|
|
822
|
-
/** Returns whether the vault tracks used intent hashes on-chain. */
|
|
823
|
-
declare function getTrackUsedIntents(publicClient: PublicClient, vaultAddress: Address): Promise<boolean>;
|
|
824
822
|
/**
|
|
825
823
|
* Check whether a destination address is allowed for a given bot.
|
|
826
824
|
*
|
|
@@ -843,12 +841,9 @@ declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAd
|
|
|
843
841
|
*
|
|
844
842
|
* @param walletClient Wallet that will own the deployed vault.
|
|
845
843
|
* @param factoryAddress Address of the deployed AxonVaultFactory.
|
|
846
|
-
* @param trackUsedIntents If true, executed intent hashes are stored on-chain
|
|
847
|
-
* to prevent exact replay. Default true — only disable
|
|
848
|
-
* for extreme high-frequency bots.
|
|
849
844
|
* @returns Address of the newly deployed vault.
|
|
850
845
|
*/
|
|
851
|
-
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address
|
|
846
|
+
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address): Promise<Address>;
|
|
852
847
|
|
|
853
848
|
interface KeystoreV3 {
|
|
854
849
|
version: 3;
|
|
@@ -953,10 +948,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
953
948
|
readonly name: "_axonRegistry";
|
|
954
949
|
readonly type: "address";
|
|
955
950
|
readonly internalType: "address";
|
|
956
|
-
}, {
|
|
957
|
-
readonly name: "_trackUsedIntents";
|
|
958
|
-
readonly type: "bool";
|
|
959
|
-
readonly internalType: "bool";
|
|
960
951
|
}];
|
|
961
952
|
readonly stateMutability: "nonpayable";
|
|
962
953
|
}, {
|
|
@@ -1774,16 +1765,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1774
1765
|
}];
|
|
1775
1766
|
readonly outputs: readonly [];
|
|
1776
1767
|
readonly stateMutability: "nonpayable";
|
|
1777
|
-
}, {
|
|
1778
|
-
readonly type: "function";
|
|
1779
|
-
readonly name: "trackUsedIntents";
|
|
1780
|
-
readonly inputs: readonly [];
|
|
1781
|
-
readonly outputs: readonly [{
|
|
1782
|
-
readonly name: "";
|
|
1783
|
-
readonly type: "bool";
|
|
1784
|
-
readonly internalType: "bool";
|
|
1785
|
-
}];
|
|
1786
|
-
readonly stateMutability: "view";
|
|
1787
1768
|
}, {
|
|
1788
1769
|
readonly type: "function";
|
|
1789
1770
|
readonly name: "transferOwnership";
|
|
@@ -2492,6 +2473,10 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2492
2473
|
readonly type: "address";
|
|
2493
2474
|
readonly internalType: "address";
|
|
2494
2475
|
}];
|
|
2476
|
+
}, {
|
|
2477
|
+
readonly type: "error";
|
|
2478
|
+
readonly name: "SameTokenSwap";
|
|
2479
|
+
readonly inputs: readonly [];
|
|
2495
2480
|
}, {
|
|
2496
2481
|
readonly type: "error";
|
|
2497
2482
|
readonly name: "SelfPayment";
|
|
@@ -2575,11 +2560,7 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2575
2560
|
}, {
|
|
2576
2561
|
readonly type: "function";
|
|
2577
2562
|
readonly name: "deployVault";
|
|
2578
|
-
readonly inputs: readonly [
|
|
2579
|
-
readonly name: "trackUsedIntents";
|
|
2580
|
-
readonly type: "bool";
|
|
2581
|
-
readonly internalType: "bool";
|
|
2582
|
-
}];
|
|
2563
|
+
readonly inputs: readonly [];
|
|
2583
2564
|
readonly outputs: readonly [{
|
|
2584
2565
|
readonly name: "vault";
|
|
2585
2566
|
readonly type: "address";
|
|
@@ -2717,11 +2698,6 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2717
2698
|
readonly type: "address";
|
|
2718
2699
|
readonly indexed: false;
|
|
2719
2700
|
readonly internalType: "address";
|
|
2720
|
-
}, {
|
|
2721
|
-
readonly name: "trackUsedIntents";
|
|
2722
|
-
readonly type: "bool";
|
|
2723
|
-
readonly indexed: false;
|
|
2724
|
-
readonly internalType: "bool";
|
|
2725
2701
|
}];
|
|
2726
2702
|
readonly anonymous: false;
|
|
2727
2703
|
}, {
|
|
@@ -3040,4 +3016,4 @@ declare const AxonRegistryAbi: readonly [{
|
|
|
3040
3016
|
readonly inputs: readonly [];
|
|
3041
3017
|
}];
|
|
3042
3018
|
|
|
3043
|
-
export { type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigParams, CHAIN_NAMES, Chain, DEFAULT_DEADLINE_SECONDS, type DestinationCheckResult, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, type ExecuteInput, type ExecuteIntent, KNOWN_TOKENS, type KeystoreV3, type KnownToken, type KnownTokenSymbol, NATIVE_ETH, type OperatorCeilings, PAYMENT_INTENT_TYPEHASH, type PayInput, PaymentErrorCode, type PaymentIntent, type PaymentResult, type PaymentStatus, RELAYER_API, type RebalanceTokensResult, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, type SpendingLimit, type SupportedChainId, type SwapInput, type SwapIntent, Token, type TokenInput, type TosStatus, USDC, type VaultInfo, WINDOW, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress,
|
|
3019
|
+
export { type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigParams, CHAIN_NAMES, Chain, DEFAULT_DEADLINE_SECONDS, type DestinationCheckResult, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, type ExecuteInput, type ExecuteIntent, KNOWN_TOKENS, type KeystoreV3, type KnownToken, type KnownTokenSymbol, NATIVE_ETH, type OperatorCeilings, PAYMENT_INTENT_TYPEHASH, type PayInput, PaymentErrorCode, type PaymentIntent, type PaymentResult, type PaymentStatus, RELAYER_API, type RebalanceTokensResult, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, type SpendingLimit, type SupportedChainId, type SwapInput, type SwapIntent, Token, type TokenInput, type TosStatus, USDC, type VaultInfo, WINDOW, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signSwapIntent };
|
package/dist/index.js
CHANGED
|
@@ -262,11 +262,6 @@ var AxonVaultAbi = [
|
|
|
262
262
|
"name": "_axonRegistry",
|
|
263
263
|
"type": "address",
|
|
264
264
|
"internalType": "address"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"name": "_trackUsedIntents",
|
|
268
|
-
"type": "bool",
|
|
269
|
-
"internalType": "bool"
|
|
270
265
|
}
|
|
271
266
|
],
|
|
272
267
|
"stateMutability": "nonpayable"
|
|
@@ -1328,19 +1323,6 @@ var AxonVaultAbi = [
|
|
|
1328
1323
|
"outputs": [],
|
|
1329
1324
|
"stateMutability": "nonpayable"
|
|
1330
1325
|
},
|
|
1331
|
-
{
|
|
1332
|
-
"type": "function",
|
|
1333
|
-
"name": "trackUsedIntents",
|
|
1334
|
-
"inputs": [],
|
|
1335
|
-
"outputs": [
|
|
1336
|
-
{
|
|
1337
|
-
"name": "",
|
|
1338
|
-
"type": "bool",
|
|
1339
|
-
"internalType": "bool"
|
|
1340
|
-
}
|
|
1341
|
-
],
|
|
1342
|
-
"stateMutability": "view"
|
|
1343
|
-
},
|
|
1344
1326
|
{
|
|
1345
1327
|
"type": "function",
|
|
1346
1328
|
"name": "transferOwnership",
|
|
@@ -2240,6 +2222,11 @@ var AxonVaultAbi = [
|
|
|
2240
2222
|
}
|
|
2241
2223
|
]
|
|
2242
2224
|
},
|
|
2225
|
+
{
|
|
2226
|
+
"type": "error",
|
|
2227
|
+
"name": "SameTokenSwap",
|
|
2228
|
+
"inputs": []
|
|
2229
|
+
},
|
|
2243
2230
|
{
|
|
2244
2231
|
"type": "error",
|
|
2245
2232
|
"name": "SelfPayment",
|
|
@@ -2348,13 +2335,7 @@ var AxonVaultFactoryAbi = [
|
|
|
2348
2335
|
{
|
|
2349
2336
|
"type": "function",
|
|
2350
2337
|
"name": "deployVault",
|
|
2351
|
-
"inputs": [
|
|
2352
|
-
{
|
|
2353
|
-
"name": "trackUsedIntents",
|
|
2354
|
-
"type": "bool",
|
|
2355
|
-
"internalType": "bool"
|
|
2356
|
-
}
|
|
2357
|
-
],
|
|
2338
|
+
"inputs": [],
|
|
2358
2339
|
"outputs": [
|
|
2359
2340
|
{
|
|
2360
2341
|
"name": "vault",
|
|
@@ -2531,12 +2512,6 @@ var AxonVaultFactoryAbi = [
|
|
|
2531
2512
|
"type": "address",
|
|
2532
2513
|
"indexed": false,
|
|
2533
2514
|
"internalType": "address"
|
|
2534
|
-
},
|
|
2535
|
-
{
|
|
2536
|
-
"name": "trackUsedIntents",
|
|
2537
|
-
"type": "bool",
|
|
2538
|
-
"indexed": false,
|
|
2539
|
-
"internalType": "bool"
|
|
2540
2515
|
}
|
|
2541
2516
|
],
|
|
2542
2517
|
"anonymous": false
|
|
@@ -2689,13 +2664,6 @@ async function getVaultOperator(publicClient, vaultAddress) {
|
|
|
2689
2664
|
functionName: "operator"
|
|
2690
2665
|
});
|
|
2691
2666
|
}
|
|
2692
|
-
async function getTrackUsedIntents(publicClient, vaultAddress) {
|
|
2693
|
-
return publicClient.readContract({
|
|
2694
|
-
address: vaultAddress,
|
|
2695
|
-
abi: AxonVaultAbi,
|
|
2696
|
-
functionName: "trackUsedIntents"
|
|
2697
|
-
});
|
|
2698
|
-
}
|
|
2699
2667
|
async function isDestinationAllowed(publicClient, vaultAddress, botAddress, destination) {
|
|
2700
2668
|
const isBlacklisted = await publicClient.readContract({
|
|
2701
2669
|
address: vaultAddress,
|
|
@@ -2757,7 +2725,7 @@ async function isRebalanceTokenWhitelisted(publicClient, vaultAddress, token) {
|
|
|
2757
2725
|
args: [token]
|
|
2758
2726
|
});
|
|
2759
2727
|
}
|
|
2760
|
-
async function deployVault(walletClient, publicClient, factoryAddress
|
|
2728
|
+
async function deployVault(walletClient, publicClient, factoryAddress) {
|
|
2761
2729
|
if (!walletClient.account) {
|
|
2762
2730
|
throw new Error("walletClient has no account attached");
|
|
2763
2731
|
}
|
|
@@ -2765,7 +2733,7 @@ async function deployVault(walletClient, publicClient, factoryAddress, trackUsed
|
|
|
2765
2733
|
address: factoryAddress,
|
|
2766
2734
|
abi: AxonVaultFactoryAbi,
|
|
2767
2735
|
functionName: "deployVault",
|
|
2768
|
-
args: [
|
|
2736
|
+
args: [],
|
|
2769
2737
|
account: walletClient.account,
|
|
2770
2738
|
chain: walletClient.chain ?? null
|
|
2771
2739
|
});
|
|
@@ -2823,6 +2791,7 @@ var KNOWN_TOKENS = {
|
|
|
2823
2791
|
decimals: 6,
|
|
2824
2792
|
addresses: {
|
|
2825
2793
|
8453: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
|
|
2794
|
+
84532: "0x323e78f944A9a1FcF3a10efcC5319DBb0bB6e673",
|
|
2826
2795
|
42161: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"
|
|
2827
2796
|
}
|
|
2828
2797
|
},
|
|
@@ -2993,6 +2962,9 @@ function getTokenSymbolByAddress(address) {
|
|
|
2993
2962
|
}
|
|
2994
2963
|
function resolveToken(token, chainId) {
|
|
2995
2964
|
if (typeof token === "string" && token.startsWith("0x")) {
|
|
2965
|
+
if (token === "0x0000000000000000000000000000000000000000") {
|
|
2966
|
+
throw new Error("Token address cannot be the zero address");
|
|
2967
|
+
}
|
|
2996
2968
|
return token;
|
|
2997
2969
|
}
|
|
2998
2970
|
const entry = KNOWN_TOKENS[token];
|
|
@@ -3176,7 +3148,7 @@ var AxonClient = class {
|
|
|
3176
3148
|
// ============================================================================
|
|
3177
3149
|
// getVaultInfo() — via relayer
|
|
3178
3150
|
// ============================================================================
|
|
3179
|
-
/** Returns high-level vault info (owner, operator, paused, version
|
|
3151
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
3180
3152
|
async getVaultInfo() {
|
|
3181
3153
|
const path = RELAYER_API.vaultInfo(this.vaultAddress, this.chainId);
|
|
3182
3154
|
return this._get(path);
|
|
@@ -3314,6 +3286,9 @@ Timestamp: ${timestamp}`;
|
|
|
3314
3286
|
return "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
3315
3287
|
}
|
|
3316
3288
|
_buildPaymentIntent(input) {
|
|
3289
|
+
if (input.to === "0x0000000000000000000000000000000000000000") {
|
|
3290
|
+
throw new Error("Payment recipient cannot be the zero address");
|
|
3291
|
+
}
|
|
3317
3292
|
return {
|
|
3318
3293
|
bot: this.botAddress,
|
|
3319
3294
|
to: input.to,
|
|
@@ -3923,6 +3898,6 @@ var AxonRegistryAbi = [
|
|
|
3923
3898
|
}
|
|
3924
3899
|
];
|
|
3925
3900
|
|
|
3926
|
-
export { AxonClient, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, CHAIN_NAMES, Chain, DEFAULT_DEADLINE_SECONDS, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, KNOWN_TOKENS, NATIVE_ETH, PAYMENT_INTENT_TYPEHASH, PaymentErrorCode, RELAYER_API, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, Token, USDC, WINDOW, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress,
|
|
3901
|
+
export { AxonClient, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, CHAIN_NAMES, Chain, DEFAULT_DEADLINE_SECONDS, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, KNOWN_TOKENS, NATIVE_ETH, PAYMENT_INTENT_TYPEHASH, PaymentErrorCode, RELAYER_API, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, Token, USDC, WINDOW, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signSwapIntent };
|
|
3927
3902
|
//# sourceMappingURL=index.js.map
|
|
3928
3903
|
//# sourceMappingURL=index.js.map
|