@axonfi/sdk 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -10,6 +10,7 @@ declare enum Token {
10
10
  cbETH = "cbETH",
11
11
  wstETH = "wstETH",
12
12
  rETH = "rETH",
13
+ weETH = "weETH",
13
14
  LINK = "LINK",
14
15
  UNI = "UNI",
15
16
  AAVE = "AAVE",
@@ -117,9 +118,19 @@ declare const KNOWN_TOKENS: {
117
118
  readonly name: "Rocket Pool ETH";
118
119
  readonly decimals: 18;
119
120
  readonly addresses: {
121
+ readonly 8453: "0xB6fe221Fe9EeF5aBa221c348bA20A1Bf5e73624c";
120
122
  readonly 42161: "0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8";
121
123
  };
122
124
  };
125
+ readonly weETH: {
126
+ readonly symbol: "weETH";
127
+ readonly name: "EtherFi Wrapped eETH";
128
+ readonly decimals: 18;
129
+ readonly addresses: {
130
+ readonly 8453: "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A";
131
+ readonly 42161: "0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe";
132
+ };
133
+ };
123
134
  readonly LINK: {
124
135
  readonly symbol: "LINK";
125
136
  readonly name: "Chainlink";
@@ -200,6 +211,16 @@ declare const KNOWN_TOKENS: {
200
211
  };
201
212
  };
202
213
  type KnownTokenSymbol = keyof typeof KNOWN_TOKENS;
214
+ /**
215
+ * Tokens that new vaults should pre-approve as protocols at deploy time.
216
+ * This enables the two-step approval pattern (approve token → call DeFi protocol)
217
+ * without the owner having to manually add common tokens.
218
+ *
219
+ * Used by: AxonRegistry (on-chain default list), deploy scripts, dashboard.
220
+ */
221
+ declare const DEFAULT_APPROVED_TOKENS: KnownTokenSymbol[];
222
+ /** Get default approved token addresses for a specific chain. */
223
+ declare function getDefaultApprovedTokens(chainId: number): Address[];
203
224
  /** All known tokens available on a specific chain. */
204
225
  declare function getKnownTokensForChain(chainId: number): (KnownToken & {
205
226
  address: Address;
@@ -477,7 +498,7 @@ interface PayInput {
477
498
  interface ExecuteIntent {
478
499
  /** Bot's own address. Must be registered in the vault. */
479
500
  bot: Address;
480
- /** Target DeFi protocol contract address. Must be in vault's approvedProtocols. */
501
+ /** Target contract address (protocol or token). Must be approved via approveProtocol() or be a registry default token. */
481
502
  protocol: Address;
482
503
  /** keccak256 of the callData bytes. Verified by relayer before submission. */
483
504
  calldataHash: Hex;
@@ -791,8 +812,8 @@ declare class AxonClient {
791
812
  * Checks blacklist → global whitelist → bot whitelist, matching on-chain logic.
792
813
  */
793
814
  canPayTo(destination: Address): Promise<DestinationCheckResult>;
794
- /** Returns whether a protocol address is approved for executeProtocol() calls (via relayer). */
795
- isProtocolApproved(protocol: Address): Promise<boolean>;
815
+ /** Returns whether a contract address (protocol or token) is approved for executeProtocol() calls (via relayer). */
816
+ isContractApproved(protocol: Address): Promise<boolean>;
796
817
  /**
797
818
  * Returns the effective rebalance token whitelist for this vault.
798
819
  *
@@ -993,6 +1014,66 @@ declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAd
993
1014
  * @returns Address of the newly deployed vault.
994
1015
  */
995
1016
  declare function deployVault(walletClient: WalletClient, publicClient: PublicClient, factoryAddress: Address): Promise<Address>;
1017
+ /**
1018
+ * Register a bot on the vault with its initial spending configuration.
1019
+ *
1020
+ * Must be called by the vault owner (or operator if ceilings allow).
1021
+ * This is an on-chain transaction — requires gas on the owner's wallet.
1022
+ *
1023
+ * @param walletClient Owner wallet (must be vault owner or authorized operator).
1024
+ * @param publicClient Public client for the vault's chain.
1025
+ * @param vaultAddress Vault to register the bot on.
1026
+ * @param botAddress Public address of the bot to register.
1027
+ * @param config Bot spending configuration (limits, AI threshold, etc.).
1028
+ * @returns Transaction hash.
1029
+ */
1030
+ declare function addBot(walletClient: WalletClient, publicClient: PublicClient, vaultAddress: Address, botAddress: Address, config: BotConfigParams): Promise<Hex>;
1031
+ /**
1032
+ * Update an existing bot's spending configuration.
1033
+ *
1034
+ * Must be called by the vault owner (or operator within ceilings).
1035
+ * On-chain transaction — requires gas.
1036
+ *
1037
+ * @param walletClient Owner/operator wallet.
1038
+ * @param publicClient Public client for the vault's chain.
1039
+ * @param vaultAddress Vault the bot is registered on.
1040
+ * @param botAddress Bot to update.
1041
+ * @param config New spending configuration.
1042
+ * @returns Transaction hash.
1043
+ */
1044
+ declare function updateBotConfig(walletClient: WalletClient, publicClient: PublicClient, vaultAddress: Address, botAddress: Address, config: BotConfigParams): Promise<Hex>;
1045
+ /**
1046
+ * Remove a bot from the vault whitelist.
1047
+ *
1048
+ * Must be called by the vault owner (or operator).
1049
+ * The bot will immediately lose the ability to sign valid intents.
1050
+ * On-chain transaction — requires gas.
1051
+ *
1052
+ * @param walletClient Owner/operator wallet.
1053
+ * @param publicClient Public client for the vault's chain.
1054
+ * @param vaultAddress Vault to remove the bot from.
1055
+ * @param botAddress Bot to remove.
1056
+ * @returns Transaction hash.
1057
+ */
1058
+ declare function removeBot(walletClient: WalletClient, publicClient: PublicClient, vaultAddress: Address, botAddress: Address): Promise<Hex>;
1059
+ /**
1060
+ * Deposit tokens or native ETH into the vault.
1061
+ *
1062
+ * Permissionless — anyone can deposit. For ERC-20 tokens, this function
1063
+ * handles the approve + deposit in one call. For native ETH, pass
1064
+ * `NATIVE_ETH` (or `'ETH'`) as the token.
1065
+ *
1066
+ * On-chain transaction — requires gas on the depositor's wallet.
1067
+ *
1068
+ * @param walletClient Wallet sending the deposit (anyone, not just owner).
1069
+ * @param publicClient Public client for the vault's chain.
1070
+ * @param vaultAddress Vault to deposit into.
1071
+ * @param token Token address, or NATIVE_ETH for ETH deposits.
1072
+ * @param amount Amount in base units (e.g. 5_000_000n for 5 USDC, 10n**16n for 0.01 ETH).
1073
+ * @param ref Optional bytes32 reference linking to an off-chain record. Defaults to 0x0.
1074
+ * @returns Transaction hash of the deposit.
1075
+ */
1076
+ declare function deposit(walletClient: WalletClient, publicClient: PublicClient, vaultAddress: Address, token: Address, amount: bigint, ref?: Hex): Promise<Hex>;
996
1077
 
997
1078
  interface KeystoreV3 {
998
1079
  version: 3;
@@ -1320,21 +1401,21 @@ declare const AxonVaultAbi: readonly [{
1320
1401
  readonly stateMutability: "nonpayable";
1321
1402
  }, {
1322
1403
  readonly type: "function";
1323
- readonly name: "addProtocol";
1404
+ readonly name: "addRebalanceTokens";
1324
1405
  readonly inputs: readonly [{
1325
- readonly name: "protocol";
1326
- readonly type: "address";
1327
- readonly internalType: "address";
1406
+ readonly name: "tokens";
1407
+ readonly type: "address[]";
1408
+ readonly internalType: "address[]";
1328
1409
  }];
1329
1410
  readonly outputs: readonly [];
1330
1411
  readonly stateMutability: "nonpayable";
1331
1412
  }, {
1332
1413
  readonly type: "function";
1333
- readonly name: "addRebalanceTokens";
1414
+ readonly name: "approveProtocol";
1334
1415
  readonly inputs: readonly [{
1335
- readonly name: "tokens";
1336
- readonly type: "address[]";
1337
- readonly internalType: "address[]";
1416
+ readonly name: "protocol";
1417
+ readonly type: "address";
1418
+ readonly internalType: "address";
1338
1419
  }];
1339
1420
  readonly outputs: readonly [];
1340
1421
  readonly stateMutability: "nonpayable";
@@ -1763,7 +1844,7 @@ declare const AxonVaultAbi: readonly [{
1763
1844
  readonly stateMutability: "view";
1764
1845
  }, {
1765
1846
  readonly type: "function";
1766
- readonly name: "isProtocolApproved";
1847
+ readonly name: "isContractApproved";
1767
1848
  readonly inputs: readonly [{
1768
1849
  readonly name: "protocol";
1769
1850
  readonly type: "address";
@@ -1935,16 +2016,6 @@ declare const AxonVaultAbi: readonly [{
1935
2016
  }];
1936
2017
  readonly outputs: readonly [];
1937
2018
  readonly stateMutability: "nonpayable";
1938
- }, {
1939
- readonly type: "function";
1940
- readonly name: "removeProtocol";
1941
- readonly inputs: readonly [{
1942
- readonly name: "protocol";
1943
- readonly type: "address";
1944
- readonly internalType: "address";
1945
- }];
1946
- readonly outputs: readonly [];
1947
- readonly stateMutability: "nonpayable";
1948
2019
  }, {
1949
2020
  readonly type: "function";
1950
2021
  readonly name: "removeRebalanceTokens";
@@ -1961,6 +2032,16 @@ declare const AxonVaultAbi: readonly [{
1961
2032
  readonly inputs: readonly [];
1962
2033
  readonly outputs: readonly [];
1963
2034
  readonly stateMutability: "nonpayable";
2035
+ }, {
2036
+ readonly type: "function";
2037
+ readonly name: "revokeProtocol";
2038
+ readonly inputs: readonly [{
2039
+ readonly name: "protocol";
2040
+ readonly type: "address";
2041
+ readonly internalType: "address";
2042
+ }];
2043
+ readonly outputs: readonly [];
2044
+ readonly stateMutability: "nonpayable";
1964
2045
  }, {
1965
2046
  readonly type: "function";
1966
2047
  readonly name: "setOperator";
@@ -2361,7 +2442,7 @@ declare const AxonVaultAbi: readonly [{
2361
2442
  readonly anonymous: false;
2362
2443
  }, {
2363
2444
  readonly type: "event";
2364
- readonly name: "ProtocolAdded";
2445
+ readonly name: "ProtocolApproved";
2365
2446
  readonly inputs: readonly [{
2366
2447
  readonly name: "protocol";
2367
2448
  readonly type: "address";
@@ -2401,7 +2482,7 @@ declare const AxonVaultAbi: readonly [{
2401
2482
  readonly anonymous: false;
2402
2483
  }, {
2403
2484
  readonly type: "event";
2404
- readonly name: "ProtocolRemoved";
2485
+ readonly name: "ProtocolRevoked";
2405
2486
  readonly inputs: readonly [{
2406
2487
  readonly name: "protocol";
2407
2488
  readonly type: "address";
@@ -2558,6 +2639,10 @@ declare const AxonVaultAbi: readonly [{
2558
2639
  readonly type: "error";
2559
2640
  readonly name: "CalldataHashMismatch";
2560
2641
  readonly inputs: readonly [];
2642
+ }, {
2643
+ readonly type: "error";
2644
+ readonly name: "ContractNotApproved";
2645
+ readonly inputs: readonly [];
2561
2646
  }, {
2562
2647
  readonly type: "error";
2563
2648
  readonly name: "DeadlineExpired";
@@ -2686,10 +2771,6 @@ declare const AxonVaultAbi: readonly [{
2686
2771
  readonly type: "error";
2687
2772
  readonly name: "ProtocolNotApproved";
2688
2773
  readonly inputs: readonly [];
2689
- }, {
2690
- readonly type: "error";
2691
- readonly name: "ProtocolNotInList";
2692
- readonly inputs: readonly [];
2693
2774
  }, {
2694
2775
  readonly type: "error";
2695
2776
  readonly name: "RebalanceTokenNotAllowed";
@@ -2967,6 +3048,16 @@ declare const AxonRegistryAbi: readonly [{
2967
3048
  readonly internalType: "address";
2968
3049
  }];
2969
3050
  readonly stateMutability: "nonpayable";
3051
+ }, {
3052
+ readonly type: "function";
3053
+ readonly name: "VERSION";
3054
+ readonly inputs: readonly [];
3055
+ readonly outputs: readonly [{
3056
+ readonly name: "";
3057
+ readonly type: "uint256";
3058
+ readonly internalType: "uint256";
3059
+ }];
3060
+ readonly stateMutability: "view";
2970
3061
  }, {
2971
3062
  readonly type: "function";
2972
3063
  readonly name: "acceptOwnership";
@@ -2993,6 +3084,16 @@ declare const AxonRegistryAbi: readonly [{
2993
3084
  }];
2994
3085
  readonly outputs: readonly [];
2995
3086
  readonly stateMutability: "nonpayable";
3087
+ }, {
3088
+ readonly type: "function";
3089
+ readonly name: "approveDefaultToken";
3090
+ readonly inputs: readonly [{
3091
+ readonly name: "token";
3092
+ readonly type: "address";
3093
+ readonly internalType: "address";
3094
+ }];
3095
+ readonly outputs: readonly [];
3096
+ readonly stateMutability: "nonpayable";
2996
3097
  }, {
2997
3098
  readonly type: "function";
2998
3099
  readonly name: "isApprovedSwapRouter";
@@ -3021,6 +3122,20 @@ declare const AxonRegistryAbi: readonly [{
3021
3122
  readonly internalType: "bool";
3022
3123
  }];
3023
3124
  readonly stateMutability: "view";
3125
+ }, {
3126
+ readonly type: "function";
3127
+ readonly name: "isDefaultToken";
3128
+ readonly inputs: readonly [{
3129
+ readonly name: "token";
3130
+ readonly type: "address";
3131
+ readonly internalType: "address";
3132
+ }];
3133
+ readonly outputs: readonly [{
3134
+ readonly name: "";
3135
+ readonly type: "bool";
3136
+ readonly internalType: "bool";
3137
+ }];
3138
+ readonly stateMutability: "view";
3024
3139
  }, {
3025
3140
  readonly type: "function";
3026
3141
  readonly name: "owner";
@@ -3067,6 +3182,16 @@ declare const AxonRegistryAbi: readonly [{
3067
3182
  readonly inputs: readonly [];
3068
3183
  readonly outputs: readonly [];
3069
3184
  readonly stateMutability: "nonpayable";
3185
+ }, {
3186
+ readonly type: "function";
3187
+ readonly name: "revokeDefaultToken";
3188
+ readonly inputs: readonly [{
3189
+ readonly name: "token";
3190
+ readonly type: "address";
3191
+ readonly internalType: "address";
3192
+ }];
3193
+ readonly outputs: readonly [];
3194
+ readonly stateMutability: "nonpayable";
3070
3195
  }, {
3071
3196
  readonly type: "function";
3072
3197
  readonly name: "setOracleConfig";
@@ -3125,6 +3250,26 @@ declare const AxonRegistryAbi: readonly [{
3125
3250
  readonly internalType: "address";
3126
3251
  }];
3127
3252
  readonly stateMutability: "view";
3253
+ }, {
3254
+ readonly type: "event";
3255
+ readonly name: "DefaultTokenApproved";
3256
+ readonly inputs: readonly [{
3257
+ readonly name: "token";
3258
+ readonly type: "address";
3259
+ readonly indexed: true;
3260
+ readonly internalType: "address";
3261
+ }];
3262
+ readonly anonymous: false;
3263
+ }, {
3264
+ readonly type: "event";
3265
+ readonly name: "DefaultTokenRevoked";
3266
+ readonly inputs: readonly [{
3267
+ readonly name: "token";
3268
+ readonly type: "address";
3269
+ readonly indexed: true;
3270
+ readonly internalType: "address";
3271
+ }];
3272
+ readonly anonymous: false;
3128
3273
  }, {
3129
3274
  readonly type: "event";
3130
3275
  readonly name: "OracleConfigUpdated";
@@ -3253,4 +3398,4 @@ declare const AxonRegistryAbi: readonly [{
3253
3398
  readonly inputs: readonly [];
3254
3399
  }];
3255
3400
 
3256
- 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, PERMIT2_ADDRESS, type PayInput, PaymentErrorCode, type PaymentIntent, type PaymentResult, type PaymentStatus, type Permit2Authorization, RELAYER_API, type RebalanceTokensResult, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, type SpendingLimit, type SupportedChainId, type SwapInput, type SwapIntent, Token, type TokenInput, type TosStatus, type TransferAuthorization, USDC, USDC_EIP712_DOMAIN, type VaultInfo, WINDOW, WITNESS_TYPE_STRING, type X402HandleResult, type X402PaymentOption, type X402PaymentRequired, type X402Resource, X402_PROXY_ADDRESS, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, encodeRef, encryptKeystore, extractX402Metadata, findMatchingOption, formatPaymentSignature, getBotConfig, getChain, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, randomNonce, randomPermit2Nonce, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization };
3401
+ export { type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigParams, CHAIN_NAMES, Chain, DEFAULT_APPROVED_TOKENS, 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, PERMIT2_ADDRESS, type PayInput, PaymentErrorCode, type PaymentIntent, type PaymentResult, type PaymentStatus, type Permit2Authorization, RELAYER_API, type RebalanceTokensResult, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, type SpendingLimit, type SupportedChainId, type SwapInput, type SwapIntent, Token, type TokenInput, type TosStatus, type TransferAuthorization, USDC, USDC_EIP712_DOMAIN, type VaultInfo, WINDOW, WITNESS_TYPE_STRING, type X402HandleResult, type X402PaymentOption, type X402PaymentRequired, type X402Resource, X402_PROXY_ADDRESS, addBot, createAxonPublicClient, createAxonWalletClient, decryptKeystore, deployVault, deposit, encodeRef, encryptKeystore, extractX402Metadata, findMatchingOption, formatPaymentSignature, getBotConfig, getChain, getDefaultApprovedTokens, getDomainSeparator, getKnownTokensForChain, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, updateBotConfig };