@axonfi/sdk 0.14.0 → 0.15.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
@@ -501,6 +501,17 @@ interface PayInput {
501
501
  * Does NOT bypass any policy checks — full pipeline still applies.
502
502
  */
503
503
  x402Funding?: boolean;
504
+ /**
505
+ * Source token for auto-swap if vault lacks the payment token.
506
+ * Required for SWAP_REQUIRED auto-retry — the bot must sign fromToken.
507
+ * If omitted and SWAP_REQUIRED occurs, pay() throws instead of auto-retrying.
508
+ */
509
+ swapFromToken?: TokenInput;
510
+ /**
511
+ * Max input amount for auto-swap. Required alongside swapFromToken.
512
+ * Accepts bigint (raw), number (human), or string (human).
513
+ */
514
+ swapMaxFromAmount?: AmountInput;
504
515
  }
505
516
  /**
506
517
  * Signed execute intent for DeFi protocol interactions.
@@ -535,7 +546,7 @@ interface ExecuteIntent {
535
546
  * The bot signs this struct using EIP-712. The relayer submits it to
536
547
  * executeSwap() on-chain. Tokens stay in the vault (no recipient).
537
548
  *
538
- * TypeHash: keccak256("SwapIntent(address bot,address toToken,uint256 minToAmount,uint256 deadline,bytes32 ref)")
549
+ * TypeHash: keccak256("SwapIntent(address bot,address toToken,uint256 minToAmount,address fromToken,uint256 maxFromAmount,uint256 deadline,bytes32 ref)")
539
550
  */
540
551
  interface SwapIntent {
541
552
  /** Bot's own address. Must be registered in the vault. */
@@ -544,6 +555,10 @@ interface SwapIntent {
544
555
  toToken: Address;
545
556
  /** Minimum output amount (slippage floor). */
546
557
  minToAmount: bigint;
558
+ /** Source token to swap from. Bot-signed to prevent relayer substitution. */
559
+ fromToken: Address;
560
+ /** Maximum input amount the vault will spend. Bot-signed to prevent relayer substitution. */
561
+ maxFromAmount: bigint;
547
562
  /** Unix timestamp after which this intent is invalid. */
548
563
  deadline: bigint;
549
564
  /** keccak256 of the off-chain memo. Full memo text stored by relayer. */
@@ -604,10 +619,10 @@ interface SwapInput {
604
619
  idempotencyKey?: string;
605
620
  /** Intent expiry (defaults to 5 min). */
606
621
  deadline?: bigint;
607
- /** Source token to swap from — an address, Token enum, or bare symbol string. */
608
- fromToken?: TokenInput;
609
- /** Max input amount for swap: bigint (raw), number (human), or string (human). */
610
- maxFromAmount?: AmountInput;
622
+ /** Source token to swap from — an address, Token enum, or bare symbol string. Bot-signed. */
623
+ fromToken: TokenInput;
624
+ /** Max input amount for swap: bigint (raw), number (human), or string (human). Bot-signed. */
625
+ maxFromAmount: AmountInput;
611
626
  }
612
627
  /** Possible statuses returned by the relayer. */
613
628
  type PaymentStatus = 'approved' | 'pending_review' | 'rejected';
@@ -1067,6 +1082,38 @@ declare function isDestinationAllowed(publicClient: PublicClient, vaultAddress:
1067
1082
  declare function getRebalanceTokenCount(publicClient: PublicClient, vaultAddress: Address): Promise<number>;
1068
1083
  /** Returns whether a token is in the vault's on-chain rebalance whitelist. */
1069
1084
  declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAddress: Address, token: Address): Promise<boolean>;
1085
+ /** Result of previewSwapSlippage — mirrors the on-chain view return values. */
1086
+ interface SwapSlippagePreview {
1087
+ /** True if the swap would pass the oracle slippage check (or if check is disabled/oracle unavailable). */
1088
+ wouldPass: boolean;
1089
+ /** USD value of the input amount (0 if oracle unavailable). */
1090
+ fromUsd: bigint;
1091
+ /** USD value of the output amount (0 if oracle unavailable). */
1092
+ toUsd: bigint;
1093
+ /** Minimum toUsd required to pass the check (0 if check disabled). */
1094
+ minToUsd: bigint;
1095
+ }
1096
+ /**
1097
+ * Read the vault's maxSwapSlippageBps setting.
1098
+ * e.g. 9500 means swaps must retain ≥95% of USD value. 0 = check disabled.
1099
+ */
1100
+ declare function getMaxSwapSlippageBps(publicClient: PublicClient, vaultAddress: Address): Promise<bigint>;
1101
+ /**
1102
+ * Preview whether a swap would pass the on-chain oracle slippage check.
1103
+ *
1104
+ * Calls the vault's `previewSwapSlippage()` view function — zero gas, always
1105
+ * in sync with the on-chain oracle logic. Use this before signing a SwapIntent
1106
+ * to avoid signing intents that would fail on-chain.
1107
+ *
1108
+ * @param publicClient Public client for the vault's chain.
1109
+ * @param vaultAddress The vault address.
1110
+ * @param fromToken Token being sold.
1111
+ * @param fromAmount Amount being sold (base units).
1112
+ * @param toToken Token being received.
1113
+ * @param toAmount Expected amount received (base units).
1114
+ * @returns Preview result with wouldPass, fromUsd, toUsd, minToUsd.
1115
+ */
1116
+ declare function previewSwapSlippage(publicClient: PublicClient, vaultAddress: Address, fromToken: Address, fromAmount: bigint, toToken: Address, toAmount: bigint): Promise<SwapSlippagePreview>;
1070
1117
  /**
1071
1118
  * Deploy a new AxonVault via the factory.
1072
1119
  *
@@ -1129,6 +1176,11 @@ declare function updateBotConfig(walletClient: WalletClient, publicClient: Publi
1129
1176
  * The bot will immediately lose the ability to sign valid intents.
1130
1177
  * On-chain transaction — requires gas.
1131
1178
  *
1179
+ * Note: Clears the bot's config and destination count, but individual destination
1180
+ * whitelist entries persist in storage (Solidity cannot bulk-delete nested mappings).
1181
+ * If you re-register the same address, it will inherit stale whitelist entries.
1182
+ * Use a fresh keypair for new bots to avoid this.
1183
+ *
1132
1184
  * @param walletClient Owner/operator wallet.
1133
1185
  * @param publicClient Public client for the vault's chain.
1134
1186
  * @param vaultAddress Vault to remove the bot from.
@@ -1535,8 +1587,8 @@ declare const AxonVaultAbi: readonly [{
1535
1587
  }];
1536
1588
  readonly outputs: readonly [{
1537
1589
  readonly name: "";
1538
- readonly type: "bool";
1539
- readonly internalType: "bool";
1590
+ readonly type: "address";
1591
+ readonly internalType: "address";
1540
1592
  }];
1541
1593
  readonly stateMutability: "view";
1542
1594
  }, {
@@ -1746,6 +1798,14 @@ declare const AxonVaultAbi: readonly [{
1746
1798
  readonly name: "minToAmount";
1747
1799
  readonly type: "uint256";
1748
1800
  readonly internalType: "uint256";
1801
+ }, {
1802
+ readonly name: "fromToken";
1803
+ readonly type: "address";
1804
+ readonly internalType: "address";
1805
+ }, {
1806
+ readonly name: "maxFromAmount";
1807
+ readonly type: "uint256";
1808
+ readonly internalType: "uint256";
1749
1809
  }, {
1750
1810
  readonly name: "deadline";
1751
1811
  readonly type: "uint256";
@@ -1759,14 +1819,6 @@ declare const AxonVaultAbi: readonly [{
1759
1819
  readonly name: "signature";
1760
1820
  readonly type: "bytes";
1761
1821
  readonly internalType: "bytes";
1762
- }, {
1763
- readonly name: "fromToken";
1764
- readonly type: "address";
1765
- readonly internalType: "address";
1766
- }, {
1767
- readonly name: "maxFromAmount";
1768
- readonly type: "uint256";
1769
- readonly internalType: "uint256";
1770
1822
  }, {
1771
1823
  readonly name: "swapRouter";
1772
1824
  readonly type: "address";
@@ -1942,6 +1994,16 @@ declare const AxonVaultAbi: readonly [{
1942
1994
  readonly internalType: "bytes4";
1943
1995
  }];
1944
1996
  readonly stateMutability: "view";
1997
+ }, {
1998
+ readonly type: "function";
1999
+ readonly name: "maxSwapSlippageBps";
2000
+ readonly inputs: readonly [];
2001
+ readonly outputs: readonly [{
2002
+ readonly name: "";
2003
+ readonly type: "uint256";
2004
+ readonly internalType: "uint256";
2005
+ }];
2006
+ readonly stateMutability: "view";
1945
2007
  }, {
1946
2008
  readonly type: "function";
1947
2009
  readonly name: "onERC1155BatchReceived";
@@ -2074,6 +2136,24 @@ declare const AxonVaultAbi: readonly [{
2074
2136
  readonly internalType: "uint256";
2075
2137
  }];
2076
2138
  readonly stateMutability: "view";
2139
+ }, {
2140
+ readonly type: "function";
2141
+ readonly name: "oracleUsdValue";
2142
+ readonly inputs: readonly [{
2143
+ readonly name: "token";
2144
+ readonly type: "address";
2145
+ readonly internalType: "address";
2146
+ }, {
2147
+ readonly name: "amount";
2148
+ readonly type: "uint256";
2149
+ readonly internalType: "uint256";
2150
+ }];
2151
+ readonly outputs: readonly [{
2152
+ readonly name: "";
2153
+ readonly type: "uint256";
2154
+ readonly internalType: "uint256";
2155
+ }];
2156
+ readonly stateMutability: "view";
2077
2157
  }, {
2078
2158
  readonly type: "function";
2079
2159
  readonly name: "owner";
@@ -2110,6 +2190,44 @@ declare const AxonVaultAbi: readonly [{
2110
2190
  readonly internalType: "address";
2111
2191
  }];
2112
2192
  readonly stateMutability: "view";
2193
+ }, {
2194
+ readonly type: "function";
2195
+ readonly name: "previewSwapSlippage";
2196
+ readonly inputs: readonly [{
2197
+ readonly name: "fromToken";
2198
+ readonly type: "address";
2199
+ readonly internalType: "address";
2200
+ }, {
2201
+ readonly name: "fromAmount";
2202
+ readonly type: "uint256";
2203
+ readonly internalType: "uint256";
2204
+ }, {
2205
+ readonly name: "toToken";
2206
+ readonly type: "address";
2207
+ readonly internalType: "address";
2208
+ }, {
2209
+ readonly name: "toAmount";
2210
+ readonly type: "uint256";
2211
+ readonly internalType: "uint256";
2212
+ }];
2213
+ readonly outputs: readonly [{
2214
+ readonly name: "wouldPass";
2215
+ readonly type: "bool";
2216
+ readonly internalType: "bool";
2217
+ }, {
2218
+ readonly name: "fromUsd";
2219
+ readonly type: "uint256";
2220
+ readonly internalType: "uint256";
2221
+ }, {
2222
+ readonly name: "toUsd";
2223
+ readonly type: "uint256";
2224
+ readonly internalType: "uint256";
2225
+ }, {
2226
+ readonly name: "minToUsd";
2227
+ readonly type: "uint256";
2228
+ readonly internalType: "uint256";
2229
+ }];
2230
+ readonly stateMutability: "view";
2113
2231
  }, {
2114
2232
  readonly type: "function";
2115
2233
  readonly name: "rebalanceTokenCount";
@@ -2214,6 +2332,16 @@ declare const AxonVaultAbi: readonly [{
2214
2332
  }];
2215
2333
  readonly outputs: readonly [];
2216
2334
  readonly stateMutability: "nonpayable";
2335
+ }, {
2336
+ readonly type: "function";
2337
+ readonly name: "setMaxSwapSlippageBps";
2338
+ readonly inputs: readonly [{
2339
+ readonly name: "bps";
2340
+ readonly type: "uint256";
2341
+ readonly internalType: "uint256";
2342
+ }];
2343
+ readonly outputs: readonly [];
2344
+ readonly stateMutability: "nonpayable";
2217
2345
  }, {
2218
2346
  readonly type: "function";
2219
2347
  readonly name: "setOperator";
@@ -2615,6 +2743,16 @@ declare const AxonVaultAbi: readonly [{
2615
2743
  readonly internalType: "uint64";
2616
2744
  }];
2617
2745
  readonly anonymous: false;
2746
+ }, {
2747
+ readonly type: "event";
2748
+ readonly name: "MaxSwapSlippageBpsSet";
2749
+ readonly inputs: readonly [{
2750
+ readonly name: "bps";
2751
+ readonly type: "uint256";
2752
+ readonly indexed: false;
2753
+ readonly internalType: "uint256";
2754
+ }];
2755
+ readonly anonymous: false;
2618
2756
  }, {
2619
2757
  readonly type: "event";
2620
2758
  readonly name: "OperatorCeilingsUpdated";
@@ -2661,6 +2799,26 @@ declare const AxonVaultAbi: readonly [{
2661
2799
  readonly internalType: "address";
2662
2800
  }];
2663
2801
  readonly anonymous: false;
2802
+ }, {
2803
+ readonly type: "event";
2804
+ readonly name: "OracleCheckSkipped";
2805
+ readonly inputs: readonly [{
2806
+ readonly name: "fromToken";
2807
+ readonly type: "address";
2808
+ readonly indexed: true;
2809
+ readonly internalType: "address";
2810
+ }, {
2811
+ readonly name: "toToken";
2812
+ readonly type: "address";
2813
+ readonly indexed: true;
2814
+ readonly internalType: "address";
2815
+ }, {
2816
+ readonly name: "reason";
2817
+ readonly type: "string";
2818
+ readonly indexed: false;
2819
+ readonly internalType: "string";
2820
+ }];
2821
+ readonly anonymous: false;
2664
2822
  }, {
2665
2823
  readonly type: "event";
2666
2824
  readonly name: "OwnershipTransferStarted";
@@ -3075,6 +3233,10 @@ declare const AxonVaultAbi: readonly [{
3075
3233
  readonly type: "error";
3076
3234
  readonly name: "SwapOutputInsufficient";
3077
3235
  readonly inputs: readonly [];
3236
+ }, {
3237
+ readonly type: "error";
3238
+ readonly name: "SwapSlippageTooHigh";
3239
+ readonly inputs: readonly [];
3078
3240
  }, {
3079
3241
  readonly type: "error";
3080
3242
  readonly name: "TooManySpendingLimits";
@@ -3255,6 +3417,16 @@ declare const AxonVaultFactoryAbi: readonly [{
3255
3417
  readonly internalType: "uint256";
3256
3418
  }];
3257
3419
  readonly stateMutability: "view";
3420
+ }, {
3421
+ readonly type: "function";
3422
+ readonly name: "vaultVersion";
3423
+ readonly inputs: readonly [];
3424
+ readonly outputs: readonly [{
3425
+ readonly name: "";
3426
+ readonly type: "uint16";
3427
+ readonly internalType: "uint16";
3428
+ }];
3429
+ readonly stateMutability: "view";
3258
3430
  }, {
3259
3431
  readonly type: "event";
3260
3432
  readonly name: "OwnershipTransferStarted";
@@ -3760,4 +3932,4 @@ declare const AxonRegistryAbi: readonly [{
3760
3932
  readonly inputs: readonly [];
3761
3933
  }];
3762
3934
 
3763
- export { ALLOWED_WINDOWS, type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigInput, 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 SpendingLimitInput, 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, isErc1271BotsEnabled, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, predictVaultAddress, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };
3935
+ export { ALLOWED_WINDOWS, type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigInput, 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 SpendingLimitInput, type SupportedChainId, type SwapInput, type SwapIntent, type SwapSlippagePreview, 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, getMaxSwapSlippageBps, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isErc1271BotsEnabled, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, predictVaultAddress, previewSwapSlippage, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };
package/dist/index.d.ts CHANGED
@@ -501,6 +501,17 @@ interface PayInput {
501
501
  * Does NOT bypass any policy checks — full pipeline still applies.
502
502
  */
503
503
  x402Funding?: boolean;
504
+ /**
505
+ * Source token for auto-swap if vault lacks the payment token.
506
+ * Required for SWAP_REQUIRED auto-retry — the bot must sign fromToken.
507
+ * If omitted and SWAP_REQUIRED occurs, pay() throws instead of auto-retrying.
508
+ */
509
+ swapFromToken?: TokenInput;
510
+ /**
511
+ * Max input amount for auto-swap. Required alongside swapFromToken.
512
+ * Accepts bigint (raw), number (human), or string (human).
513
+ */
514
+ swapMaxFromAmount?: AmountInput;
504
515
  }
505
516
  /**
506
517
  * Signed execute intent for DeFi protocol interactions.
@@ -535,7 +546,7 @@ interface ExecuteIntent {
535
546
  * The bot signs this struct using EIP-712. The relayer submits it to
536
547
  * executeSwap() on-chain. Tokens stay in the vault (no recipient).
537
548
  *
538
- * TypeHash: keccak256("SwapIntent(address bot,address toToken,uint256 minToAmount,uint256 deadline,bytes32 ref)")
549
+ * TypeHash: keccak256("SwapIntent(address bot,address toToken,uint256 minToAmount,address fromToken,uint256 maxFromAmount,uint256 deadline,bytes32 ref)")
539
550
  */
540
551
  interface SwapIntent {
541
552
  /** Bot's own address. Must be registered in the vault. */
@@ -544,6 +555,10 @@ interface SwapIntent {
544
555
  toToken: Address;
545
556
  /** Minimum output amount (slippage floor). */
546
557
  minToAmount: bigint;
558
+ /** Source token to swap from. Bot-signed to prevent relayer substitution. */
559
+ fromToken: Address;
560
+ /** Maximum input amount the vault will spend. Bot-signed to prevent relayer substitution. */
561
+ maxFromAmount: bigint;
547
562
  /** Unix timestamp after which this intent is invalid. */
548
563
  deadline: bigint;
549
564
  /** keccak256 of the off-chain memo. Full memo text stored by relayer. */
@@ -604,10 +619,10 @@ interface SwapInput {
604
619
  idempotencyKey?: string;
605
620
  /** Intent expiry (defaults to 5 min). */
606
621
  deadline?: bigint;
607
- /** Source token to swap from — an address, Token enum, or bare symbol string. */
608
- fromToken?: TokenInput;
609
- /** Max input amount for swap: bigint (raw), number (human), or string (human). */
610
- maxFromAmount?: AmountInput;
622
+ /** Source token to swap from — an address, Token enum, or bare symbol string. Bot-signed. */
623
+ fromToken: TokenInput;
624
+ /** Max input amount for swap: bigint (raw), number (human), or string (human). Bot-signed. */
625
+ maxFromAmount: AmountInput;
611
626
  }
612
627
  /** Possible statuses returned by the relayer. */
613
628
  type PaymentStatus = 'approved' | 'pending_review' | 'rejected';
@@ -1067,6 +1082,38 @@ declare function isDestinationAllowed(publicClient: PublicClient, vaultAddress:
1067
1082
  declare function getRebalanceTokenCount(publicClient: PublicClient, vaultAddress: Address): Promise<number>;
1068
1083
  /** Returns whether a token is in the vault's on-chain rebalance whitelist. */
1069
1084
  declare function isRebalanceTokenWhitelisted(publicClient: PublicClient, vaultAddress: Address, token: Address): Promise<boolean>;
1085
+ /** Result of previewSwapSlippage — mirrors the on-chain view return values. */
1086
+ interface SwapSlippagePreview {
1087
+ /** True if the swap would pass the oracle slippage check (or if check is disabled/oracle unavailable). */
1088
+ wouldPass: boolean;
1089
+ /** USD value of the input amount (0 if oracle unavailable). */
1090
+ fromUsd: bigint;
1091
+ /** USD value of the output amount (0 if oracle unavailable). */
1092
+ toUsd: bigint;
1093
+ /** Minimum toUsd required to pass the check (0 if check disabled). */
1094
+ minToUsd: bigint;
1095
+ }
1096
+ /**
1097
+ * Read the vault's maxSwapSlippageBps setting.
1098
+ * e.g. 9500 means swaps must retain ≥95% of USD value. 0 = check disabled.
1099
+ */
1100
+ declare function getMaxSwapSlippageBps(publicClient: PublicClient, vaultAddress: Address): Promise<bigint>;
1101
+ /**
1102
+ * Preview whether a swap would pass the on-chain oracle slippage check.
1103
+ *
1104
+ * Calls the vault's `previewSwapSlippage()` view function — zero gas, always
1105
+ * in sync with the on-chain oracle logic. Use this before signing a SwapIntent
1106
+ * to avoid signing intents that would fail on-chain.
1107
+ *
1108
+ * @param publicClient Public client for the vault's chain.
1109
+ * @param vaultAddress The vault address.
1110
+ * @param fromToken Token being sold.
1111
+ * @param fromAmount Amount being sold (base units).
1112
+ * @param toToken Token being received.
1113
+ * @param toAmount Expected amount received (base units).
1114
+ * @returns Preview result with wouldPass, fromUsd, toUsd, minToUsd.
1115
+ */
1116
+ declare function previewSwapSlippage(publicClient: PublicClient, vaultAddress: Address, fromToken: Address, fromAmount: bigint, toToken: Address, toAmount: bigint): Promise<SwapSlippagePreview>;
1070
1117
  /**
1071
1118
  * Deploy a new AxonVault via the factory.
1072
1119
  *
@@ -1129,6 +1176,11 @@ declare function updateBotConfig(walletClient: WalletClient, publicClient: Publi
1129
1176
  * The bot will immediately lose the ability to sign valid intents.
1130
1177
  * On-chain transaction — requires gas.
1131
1178
  *
1179
+ * Note: Clears the bot's config and destination count, but individual destination
1180
+ * whitelist entries persist in storage (Solidity cannot bulk-delete nested mappings).
1181
+ * If you re-register the same address, it will inherit stale whitelist entries.
1182
+ * Use a fresh keypair for new bots to avoid this.
1183
+ *
1132
1184
  * @param walletClient Owner/operator wallet.
1133
1185
  * @param publicClient Public client for the vault's chain.
1134
1186
  * @param vaultAddress Vault to remove the bot from.
@@ -1535,8 +1587,8 @@ declare const AxonVaultAbi: readonly [{
1535
1587
  }];
1536
1588
  readonly outputs: readonly [{
1537
1589
  readonly name: "";
1538
- readonly type: "bool";
1539
- readonly internalType: "bool";
1590
+ readonly type: "address";
1591
+ readonly internalType: "address";
1540
1592
  }];
1541
1593
  readonly stateMutability: "view";
1542
1594
  }, {
@@ -1746,6 +1798,14 @@ declare const AxonVaultAbi: readonly [{
1746
1798
  readonly name: "minToAmount";
1747
1799
  readonly type: "uint256";
1748
1800
  readonly internalType: "uint256";
1801
+ }, {
1802
+ readonly name: "fromToken";
1803
+ readonly type: "address";
1804
+ readonly internalType: "address";
1805
+ }, {
1806
+ readonly name: "maxFromAmount";
1807
+ readonly type: "uint256";
1808
+ readonly internalType: "uint256";
1749
1809
  }, {
1750
1810
  readonly name: "deadline";
1751
1811
  readonly type: "uint256";
@@ -1759,14 +1819,6 @@ declare const AxonVaultAbi: readonly [{
1759
1819
  readonly name: "signature";
1760
1820
  readonly type: "bytes";
1761
1821
  readonly internalType: "bytes";
1762
- }, {
1763
- readonly name: "fromToken";
1764
- readonly type: "address";
1765
- readonly internalType: "address";
1766
- }, {
1767
- readonly name: "maxFromAmount";
1768
- readonly type: "uint256";
1769
- readonly internalType: "uint256";
1770
1822
  }, {
1771
1823
  readonly name: "swapRouter";
1772
1824
  readonly type: "address";
@@ -1942,6 +1994,16 @@ declare const AxonVaultAbi: readonly [{
1942
1994
  readonly internalType: "bytes4";
1943
1995
  }];
1944
1996
  readonly stateMutability: "view";
1997
+ }, {
1998
+ readonly type: "function";
1999
+ readonly name: "maxSwapSlippageBps";
2000
+ readonly inputs: readonly [];
2001
+ readonly outputs: readonly [{
2002
+ readonly name: "";
2003
+ readonly type: "uint256";
2004
+ readonly internalType: "uint256";
2005
+ }];
2006
+ readonly stateMutability: "view";
1945
2007
  }, {
1946
2008
  readonly type: "function";
1947
2009
  readonly name: "onERC1155BatchReceived";
@@ -2074,6 +2136,24 @@ declare const AxonVaultAbi: readonly [{
2074
2136
  readonly internalType: "uint256";
2075
2137
  }];
2076
2138
  readonly stateMutability: "view";
2139
+ }, {
2140
+ readonly type: "function";
2141
+ readonly name: "oracleUsdValue";
2142
+ readonly inputs: readonly [{
2143
+ readonly name: "token";
2144
+ readonly type: "address";
2145
+ readonly internalType: "address";
2146
+ }, {
2147
+ readonly name: "amount";
2148
+ readonly type: "uint256";
2149
+ readonly internalType: "uint256";
2150
+ }];
2151
+ readonly outputs: readonly [{
2152
+ readonly name: "";
2153
+ readonly type: "uint256";
2154
+ readonly internalType: "uint256";
2155
+ }];
2156
+ readonly stateMutability: "view";
2077
2157
  }, {
2078
2158
  readonly type: "function";
2079
2159
  readonly name: "owner";
@@ -2110,6 +2190,44 @@ declare const AxonVaultAbi: readonly [{
2110
2190
  readonly internalType: "address";
2111
2191
  }];
2112
2192
  readonly stateMutability: "view";
2193
+ }, {
2194
+ readonly type: "function";
2195
+ readonly name: "previewSwapSlippage";
2196
+ readonly inputs: readonly [{
2197
+ readonly name: "fromToken";
2198
+ readonly type: "address";
2199
+ readonly internalType: "address";
2200
+ }, {
2201
+ readonly name: "fromAmount";
2202
+ readonly type: "uint256";
2203
+ readonly internalType: "uint256";
2204
+ }, {
2205
+ readonly name: "toToken";
2206
+ readonly type: "address";
2207
+ readonly internalType: "address";
2208
+ }, {
2209
+ readonly name: "toAmount";
2210
+ readonly type: "uint256";
2211
+ readonly internalType: "uint256";
2212
+ }];
2213
+ readonly outputs: readonly [{
2214
+ readonly name: "wouldPass";
2215
+ readonly type: "bool";
2216
+ readonly internalType: "bool";
2217
+ }, {
2218
+ readonly name: "fromUsd";
2219
+ readonly type: "uint256";
2220
+ readonly internalType: "uint256";
2221
+ }, {
2222
+ readonly name: "toUsd";
2223
+ readonly type: "uint256";
2224
+ readonly internalType: "uint256";
2225
+ }, {
2226
+ readonly name: "minToUsd";
2227
+ readonly type: "uint256";
2228
+ readonly internalType: "uint256";
2229
+ }];
2230
+ readonly stateMutability: "view";
2113
2231
  }, {
2114
2232
  readonly type: "function";
2115
2233
  readonly name: "rebalanceTokenCount";
@@ -2214,6 +2332,16 @@ declare const AxonVaultAbi: readonly [{
2214
2332
  }];
2215
2333
  readonly outputs: readonly [];
2216
2334
  readonly stateMutability: "nonpayable";
2335
+ }, {
2336
+ readonly type: "function";
2337
+ readonly name: "setMaxSwapSlippageBps";
2338
+ readonly inputs: readonly [{
2339
+ readonly name: "bps";
2340
+ readonly type: "uint256";
2341
+ readonly internalType: "uint256";
2342
+ }];
2343
+ readonly outputs: readonly [];
2344
+ readonly stateMutability: "nonpayable";
2217
2345
  }, {
2218
2346
  readonly type: "function";
2219
2347
  readonly name: "setOperator";
@@ -2615,6 +2743,16 @@ declare const AxonVaultAbi: readonly [{
2615
2743
  readonly internalType: "uint64";
2616
2744
  }];
2617
2745
  readonly anonymous: false;
2746
+ }, {
2747
+ readonly type: "event";
2748
+ readonly name: "MaxSwapSlippageBpsSet";
2749
+ readonly inputs: readonly [{
2750
+ readonly name: "bps";
2751
+ readonly type: "uint256";
2752
+ readonly indexed: false;
2753
+ readonly internalType: "uint256";
2754
+ }];
2755
+ readonly anonymous: false;
2618
2756
  }, {
2619
2757
  readonly type: "event";
2620
2758
  readonly name: "OperatorCeilingsUpdated";
@@ -2661,6 +2799,26 @@ declare const AxonVaultAbi: readonly [{
2661
2799
  readonly internalType: "address";
2662
2800
  }];
2663
2801
  readonly anonymous: false;
2802
+ }, {
2803
+ readonly type: "event";
2804
+ readonly name: "OracleCheckSkipped";
2805
+ readonly inputs: readonly [{
2806
+ readonly name: "fromToken";
2807
+ readonly type: "address";
2808
+ readonly indexed: true;
2809
+ readonly internalType: "address";
2810
+ }, {
2811
+ readonly name: "toToken";
2812
+ readonly type: "address";
2813
+ readonly indexed: true;
2814
+ readonly internalType: "address";
2815
+ }, {
2816
+ readonly name: "reason";
2817
+ readonly type: "string";
2818
+ readonly indexed: false;
2819
+ readonly internalType: "string";
2820
+ }];
2821
+ readonly anonymous: false;
2664
2822
  }, {
2665
2823
  readonly type: "event";
2666
2824
  readonly name: "OwnershipTransferStarted";
@@ -3075,6 +3233,10 @@ declare const AxonVaultAbi: readonly [{
3075
3233
  readonly type: "error";
3076
3234
  readonly name: "SwapOutputInsufficient";
3077
3235
  readonly inputs: readonly [];
3236
+ }, {
3237
+ readonly type: "error";
3238
+ readonly name: "SwapSlippageTooHigh";
3239
+ readonly inputs: readonly [];
3078
3240
  }, {
3079
3241
  readonly type: "error";
3080
3242
  readonly name: "TooManySpendingLimits";
@@ -3255,6 +3417,16 @@ declare const AxonVaultFactoryAbi: readonly [{
3255
3417
  readonly internalType: "uint256";
3256
3418
  }];
3257
3419
  readonly stateMutability: "view";
3420
+ }, {
3421
+ readonly type: "function";
3422
+ readonly name: "vaultVersion";
3423
+ readonly inputs: readonly [];
3424
+ readonly outputs: readonly [{
3425
+ readonly name: "";
3426
+ readonly type: "uint16";
3427
+ readonly internalType: "uint16";
3428
+ }];
3429
+ readonly stateMutability: "view";
3258
3430
  }, {
3259
3431
  readonly type: "event";
3260
3432
  readonly name: "OwnershipTransferStarted";
@@ -3760,4 +3932,4 @@ declare const AxonRegistryAbi: readonly [{
3760
3932
  readonly inputs: readonly [];
3761
3933
  }];
3762
3934
 
3763
- export { ALLOWED_WINDOWS, type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigInput, 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 SpendingLimitInput, 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, isErc1271BotsEnabled, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, predictVaultAddress, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };
3935
+ export { ALLOWED_WINDOWS, type AmountInput, AxonClient, type AxonClientConfig, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, type BotConfig, type BotConfigInput, 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 SpendingLimitInput, type SupportedChainId, type SwapInput, type SwapIntent, type SwapSlippagePreview, 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, getMaxSwapSlippageBps, getOperatorCeilings, getRebalanceTokenCount, getTokenSymbolByAddress, getVaultOperator, getVaultOwner, getVaultVersion, isBotActive, isDestinationAllowed, isErc1271BotsEnabled, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, predictVaultAddress, previewSwapSlippage, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };