@axonfi/sdk 0.3.3 → 0.3.5
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/LICENSE +21 -0
- package/README.md +21 -18
- package/dist/index.cjs +18 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -33
- package/dist/index.d.ts +10 -33
- package/dist/index.js +19 -43
- 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
|
};
|
|
@@ -72,6 +73,7 @@ declare const KNOWN_TOKENS: {
|
|
|
72
73
|
readonly 8453: "0x4200000000000000000000000000000000000006";
|
|
73
74
|
readonly 84532: "0x4200000000000000000000000000000000000006";
|
|
74
75
|
readonly 42161: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
76
|
+
readonly 421614: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
79
|
readonly WBTC: {
|
|
@@ -578,7 +580,6 @@ interface VaultInfo {
|
|
|
578
580
|
operator: Address;
|
|
579
581
|
paused: boolean;
|
|
580
582
|
version: number;
|
|
581
|
-
trackUsedIntents: boolean;
|
|
582
583
|
}
|
|
583
584
|
/** Result of a destination check (canPayTo / isDestinationAllowed). */
|
|
584
585
|
interface DestinationCheckResult {
|
|
@@ -686,7 +687,7 @@ declare class AxonClient {
|
|
|
686
687
|
isActive(): Promise<boolean>;
|
|
687
688
|
/** Returns whether the vault is currently paused (via relayer). */
|
|
688
689
|
isPaused(): Promise<boolean>;
|
|
689
|
-
/** Returns high-level vault info (owner, operator, paused, version
|
|
690
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
690
691
|
getVaultInfo(): Promise<VaultInfo>;
|
|
691
692
|
/**
|
|
692
693
|
* Check whether this bot can pay to a given destination address (via relayer).
|
|
@@ -819,8 +820,6 @@ declare function getVaultVersion(publicClient: PublicClient, vaultAddress: Addre
|
|
|
819
820
|
declare function getVaultOwner(publicClient: PublicClient, vaultAddress: Address): Promise<Address>;
|
|
820
821
|
/** Returns the vault operator address (address(0) if no operator set). */
|
|
821
822
|
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
823
|
/**
|
|
825
824
|
* Check whether a destination address is allowed for a given bot.
|
|
826
825
|
*
|
|
@@ -843,12 +842,9 @@ declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAd
|
|
|
843
842
|
*
|
|
844
843
|
* @param walletClient Wallet that will own the deployed vault.
|
|
845
844
|
* @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
845
|
* @returns Address of the newly deployed vault.
|
|
850
846
|
*/
|
|
851
|
-
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address
|
|
847
|
+
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address): Promise<Address>;
|
|
852
848
|
|
|
853
849
|
interface KeystoreV3 {
|
|
854
850
|
version: 3;
|
|
@@ -953,10 +949,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
953
949
|
readonly name: "_axonRegistry";
|
|
954
950
|
readonly type: "address";
|
|
955
951
|
readonly internalType: "address";
|
|
956
|
-
}, {
|
|
957
|
-
readonly name: "_trackUsedIntents";
|
|
958
|
-
readonly type: "bool";
|
|
959
|
-
readonly internalType: "bool";
|
|
960
952
|
}];
|
|
961
953
|
readonly stateMutability: "nonpayable";
|
|
962
954
|
}, {
|
|
@@ -1774,16 +1766,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1774
1766
|
}];
|
|
1775
1767
|
readonly outputs: readonly [];
|
|
1776
1768
|
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
1769
|
}, {
|
|
1788
1770
|
readonly type: "function";
|
|
1789
1771
|
readonly name: "transferOwnership";
|
|
@@ -2492,6 +2474,10 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2492
2474
|
readonly type: "address";
|
|
2493
2475
|
readonly internalType: "address";
|
|
2494
2476
|
}];
|
|
2477
|
+
}, {
|
|
2478
|
+
readonly type: "error";
|
|
2479
|
+
readonly name: "SameTokenSwap";
|
|
2480
|
+
readonly inputs: readonly [];
|
|
2495
2481
|
}, {
|
|
2496
2482
|
readonly type: "error";
|
|
2497
2483
|
readonly name: "SelfPayment";
|
|
@@ -2575,11 +2561,7 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2575
2561
|
}, {
|
|
2576
2562
|
readonly type: "function";
|
|
2577
2563
|
readonly name: "deployVault";
|
|
2578
|
-
readonly inputs: readonly [
|
|
2579
|
-
readonly name: "trackUsedIntents";
|
|
2580
|
-
readonly type: "bool";
|
|
2581
|
-
readonly internalType: "bool";
|
|
2582
|
-
}];
|
|
2564
|
+
readonly inputs: readonly [];
|
|
2583
2565
|
readonly outputs: readonly [{
|
|
2584
2566
|
readonly name: "vault";
|
|
2585
2567
|
readonly type: "address";
|
|
@@ -2717,11 +2699,6 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2717
2699
|
readonly type: "address";
|
|
2718
2700
|
readonly indexed: false;
|
|
2719
2701
|
readonly internalType: "address";
|
|
2720
|
-
}, {
|
|
2721
|
-
readonly name: "trackUsedIntents";
|
|
2722
|
-
readonly type: "bool";
|
|
2723
|
-
readonly indexed: false;
|
|
2724
|
-
readonly internalType: "bool";
|
|
2725
2702
|
}];
|
|
2726
2703
|
readonly anonymous: false;
|
|
2727
2704
|
}, {
|
|
@@ -3040,4 +3017,4 @@ declare const AxonRegistryAbi: readonly [{
|
|
|
3040
3017
|
readonly inputs: readonly [];
|
|
3041
3018
|
}];
|
|
3042
3019
|
|
|
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,
|
|
3020
|
+
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
|
};
|
|
@@ -72,6 +73,7 @@ declare const KNOWN_TOKENS: {
|
|
|
72
73
|
readonly 8453: "0x4200000000000000000000000000000000000006";
|
|
73
74
|
readonly 84532: "0x4200000000000000000000000000000000000006";
|
|
74
75
|
readonly 42161: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
76
|
+
readonly 421614: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
79
|
readonly WBTC: {
|
|
@@ -578,7 +580,6 @@ interface VaultInfo {
|
|
|
578
580
|
operator: Address;
|
|
579
581
|
paused: boolean;
|
|
580
582
|
version: number;
|
|
581
|
-
trackUsedIntents: boolean;
|
|
582
583
|
}
|
|
583
584
|
/** Result of a destination check (canPayTo / isDestinationAllowed). */
|
|
584
585
|
interface DestinationCheckResult {
|
|
@@ -686,7 +687,7 @@ declare class AxonClient {
|
|
|
686
687
|
isActive(): Promise<boolean>;
|
|
687
688
|
/** Returns whether the vault is currently paused (via relayer). */
|
|
688
689
|
isPaused(): Promise<boolean>;
|
|
689
|
-
/** Returns high-level vault info (owner, operator, paused, version
|
|
690
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
690
691
|
getVaultInfo(): Promise<VaultInfo>;
|
|
691
692
|
/**
|
|
692
693
|
* Check whether this bot can pay to a given destination address (via relayer).
|
|
@@ -819,8 +820,6 @@ declare function getVaultVersion(publicClient: PublicClient, vaultAddress: Addre
|
|
|
819
820
|
declare function getVaultOwner(publicClient: PublicClient, vaultAddress: Address): Promise<Address>;
|
|
820
821
|
/** Returns the vault operator address (address(0) if no operator set). */
|
|
821
822
|
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
823
|
/**
|
|
825
824
|
* Check whether a destination address is allowed for a given bot.
|
|
826
825
|
*
|
|
@@ -843,12 +842,9 @@ declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAd
|
|
|
843
842
|
*
|
|
844
843
|
* @param walletClient Wallet that will own the deployed vault.
|
|
845
844
|
* @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
845
|
* @returns Address of the newly deployed vault.
|
|
850
846
|
*/
|
|
851
|
-
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address
|
|
847
|
+
declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address): Promise<Address>;
|
|
852
848
|
|
|
853
849
|
interface KeystoreV3 {
|
|
854
850
|
version: 3;
|
|
@@ -953,10 +949,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
953
949
|
readonly name: "_axonRegistry";
|
|
954
950
|
readonly type: "address";
|
|
955
951
|
readonly internalType: "address";
|
|
956
|
-
}, {
|
|
957
|
-
readonly name: "_trackUsedIntents";
|
|
958
|
-
readonly type: "bool";
|
|
959
|
-
readonly internalType: "bool";
|
|
960
952
|
}];
|
|
961
953
|
readonly stateMutability: "nonpayable";
|
|
962
954
|
}, {
|
|
@@ -1774,16 +1766,6 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1774
1766
|
}];
|
|
1775
1767
|
readonly outputs: readonly [];
|
|
1776
1768
|
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
1769
|
}, {
|
|
1788
1770
|
readonly type: "function";
|
|
1789
1771
|
readonly name: "transferOwnership";
|
|
@@ -2492,6 +2474,10 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2492
2474
|
readonly type: "address";
|
|
2493
2475
|
readonly internalType: "address";
|
|
2494
2476
|
}];
|
|
2477
|
+
}, {
|
|
2478
|
+
readonly type: "error";
|
|
2479
|
+
readonly name: "SameTokenSwap";
|
|
2480
|
+
readonly inputs: readonly [];
|
|
2495
2481
|
}, {
|
|
2496
2482
|
readonly type: "error";
|
|
2497
2483
|
readonly name: "SelfPayment";
|
|
@@ -2575,11 +2561,7 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2575
2561
|
}, {
|
|
2576
2562
|
readonly type: "function";
|
|
2577
2563
|
readonly name: "deployVault";
|
|
2578
|
-
readonly inputs: readonly [
|
|
2579
|
-
readonly name: "trackUsedIntents";
|
|
2580
|
-
readonly type: "bool";
|
|
2581
|
-
readonly internalType: "bool";
|
|
2582
|
-
}];
|
|
2564
|
+
readonly inputs: readonly [];
|
|
2583
2565
|
readonly outputs: readonly [{
|
|
2584
2566
|
readonly name: "vault";
|
|
2585
2567
|
readonly type: "address";
|
|
@@ -2717,11 +2699,6 @@ declare const AxonVaultFactoryAbi: readonly [{
|
|
|
2717
2699
|
readonly type: "address";
|
|
2718
2700
|
readonly indexed: false;
|
|
2719
2701
|
readonly internalType: "address";
|
|
2720
|
-
}, {
|
|
2721
|
-
readonly name: "trackUsedIntents";
|
|
2722
|
-
readonly type: "bool";
|
|
2723
|
-
readonly indexed: false;
|
|
2724
|
-
readonly internalType: "bool";
|
|
2725
2702
|
}];
|
|
2726
2703
|
readonly anonymous: false;
|
|
2727
2704
|
}, {
|
|
@@ -3040,4 +3017,4 @@ declare const AxonRegistryAbi: readonly [{
|
|
|
3040
3017
|
readonly inputs: readonly [];
|
|
3041
3018
|
}];
|
|
3042
3019
|
|
|
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,
|
|
3020
|
+
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
|
},
|
|
@@ -2843,7 +2812,8 @@ var KNOWN_TOKENS = {
|
|
|
2843
2812
|
addresses: {
|
|
2844
2813
|
8453: "0x4200000000000000000000000000000000000006",
|
|
2845
2814
|
84532: "0x4200000000000000000000000000000000000006",
|
|
2846
|
-
42161: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
|
|
2815
|
+
42161: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
2816
|
+
421614: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
|
|
2847
2817
|
}
|
|
2848
2818
|
},
|
|
2849
2819
|
WBTC: {
|
|
@@ -2993,6 +2963,9 @@ function getTokenSymbolByAddress(address) {
|
|
|
2993
2963
|
}
|
|
2994
2964
|
function resolveToken(token, chainId) {
|
|
2995
2965
|
if (typeof token === "string" && token.startsWith("0x")) {
|
|
2966
|
+
if (token === "0x0000000000000000000000000000000000000000") {
|
|
2967
|
+
throw new Error("Token address cannot be the zero address");
|
|
2968
|
+
}
|
|
2996
2969
|
return token;
|
|
2997
2970
|
}
|
|
2998
2971
|
const entry = KNOWN_TOKENS[token];
|
|
@@ -3176,7 +3149,7 @@ var AxonClient = class {
|
|
|
3176
3149
|
// ============================================================================
|
|
3177
3150
|
// getVaultInfo() — via relayer
|
|
3178
3151
|
// ============================================================================
|
|
3179
|
-
/** Returns high-level vault info (owner, operator, paused, version
|
|
3152
|
+
/** Returns high-level vault info (owner, operator, paused, version) via relayer. */
|
|
3180
3153
|
async getVaultInfo() {
|
|
3181
3154
|
const path = RELAYER_API.vaultInfo(this.vaultAddress, this.chainId);
|
|
3182
3155
|
return this._get(path);
|
|
@@ -3314,6 +3287,9 @@ Timestamp: ${timestamp}`;
|
|
|
3314
3287
|
return "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
3315
3288
|
}
|
|
3316
3289
|
_buildPaymentIntent(input) {
|
|
3290
|
+
if (input.to === "0x0000000000000000000000000000000000000000") {
|
|
3291
|
+
throw new Error("Payment recipient cannot be the zero address");
|
|
3292
|
+
}
|
|
3317
3293
|
return {
|
|
3318
3294
|
bot: this.botAddress,
|
|
3319
3295
|
to: input.to,
|
|
@@ -3923,6 +3899,6 @@ var AxonRegistryAbi = [
|
|
|
3923
3899
|
}
|
|
3924
3900
|
];
|
|
3925
3901
|
|
|
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,
|
|
3902
|
+
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
3903
|
//# sourceMappingURL=index.js.map
|
|
3928
3904
|
//# sourceMappingURL=index.js.map
|