@axonfi/sdk 0.6.0 → 0.8.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/README.md +26 -1
- package/dist/index.cjs +75 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +75 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -502,7 +502,7 @@ interface PayInput {
|
|
|
502
502
|
* executeProtocol() on-chain. The contract approves `token` to `protocol`,
|
|
503
503
|
* calls it with `callData`, then revokes the approval.
|
|
504
504
|
*
|
|
505
|
-
* TypeHash: keccak256("ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,uint256 deadline,bytes32 ref)")
|
|
505
|
+
* TypeHash: keccak256("ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,address[] extraTokens,uint256[] extraAmounts,uint256 deadline,bytes32 ref)")
|
|
506
506
|
*/
|
|
507
507
|
interface ExecuteIntent {
|
|
508
508
|
/** Bot's own address. Must be registered in the vault. */
|
|
@@ -517,6 +517,10 @@ interface ExecuteIntent {
|
|
|
517
517
|
amount: bigint;
|
|
518
518
|
/** Native ETH to send with the protocol call (e.g. WETH.deposit, Lido.submit). 0 = no ETH. */
|
|
519
519
|
value: bigint;
|
|
520
|
+
/** Additional tokens to approve to the SAME protocol (e.g. WETH for GMX execution fee). Bot-signed. */
|
|
521
|
+
extraTokens: Address[];
|
|
522
|
+
/** Approval amounts for each extra token. Must match extraTokens length. */
|
|
523
|
+
extraAmounts: bigint[];
|
|
520
524
|
/** Unix timestamp after which this intent is invalid. */
|
|
521
525
|
deadline: bigint;
|
|
522
526
|
/** keccak256 of the off-chain memo. Full memo text stored by relayer. */
|
|
@@ -557,6 +561,10 @@ interface ExecuteInput {
|
|
|
557
561
|
amount: AmountInput;
|
|
558
562
|
/** Native ETH to send with the call (wei). Optional, defaults to 0. Used for payable functions like WETH.deposit() or Lido.submit(). */
|
|
559
563
|
value?: bigint;
|
|
564
|
+
/** Additional tokens to approve to the protocol (e.g. WETH for GMX execution fee). Bot signs these. */
|
|
565
|
+
extraTokens?: Address[];
|
|
566
|
+
/** Approval amounts for each extra token (raw base units). Must match extraTokens length. */
|
|
567
|
+
extraAmounts?: bigint[];
|
|
560
568
|
/** Human-readable description. Gets keccak256-hashed to ref. */
|
|
561
569
|
memo?: string;
|
|
562
570
|
/**
|
|
@@ -994,6 +1002,20 @@ declare function getOperatorCeilings(publicClient: PublicClient, vaultAddress: A
|
|
|
994
1002
|
* Returns 0n if operator has no bot-add permission.
|
|
995
1003
|
*/
|
|
996
1004
|
declare function operatorMaxDrainPerDay(publicClient: PublicClient, vaultAddress: Address): Promise<bigint>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Returns whether ERC-1271 bot signatures are enabled on the vault.
|
|
1007
|
+
*
|
|
1008
|
+
* When disabled (default), only the vault owner's signatures are accepted by
|
|
1009
|
+
* external protocols (Permit2, Cowswap, Seaport). Bot signatures return
|
|
1010
|
+
* `0xffffffff` (invalid).
|
|
1011
|
+
*
|
|
1012
|
+
* When enabled, active bot keys can sign messages that external protocols
|
|
1013
|
+
* treat as vault-authorized — useful for Permit2 approvals, Cowswap orders, etc.
|
|
1014
|
+
*
|
|
1015
|
+
* If your bot interacts with a protocol that checks ERC-1271 and gets rejected,
|
|
1016
|
+
* the vault owner needs to call `setErc1271Bots(true)` to enable it.
|
|
1017
|
+
*/
|
|
1018
|
+
declare function isErc1271BotsEnabled(publicClient: PublicClient, vaultAddress: Address): Promise<boolean>;
|
|
997
1019
|
/** Returns whether the vault is currently paused. */
|
|
998
1020
|
declare function isVaultPaused(publicClient: PublicClient, vaultAddress: Address): Promise<boolean>;
|
|
999
1021
|
/** Returns the EIP-712 domain separator for this vault (for off-chain verification). */
|
|
@@ -1574,6 +1596,16 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1574
1596
|
readonly internalType: "uint256[]";
|
|
1575
1597
|
}];
|
|
1576
1598
|
readonly stateMutability: "view";
|
|
1599
|
+
}, {
|
|
1600
|
+
readonly type: "function";
|
|
1601
|
+
readonly name: "erc1271BotsEnabled";
|
|
1602
|
+
readonly inputs: readonly [];
|
|
1603
|
+
readonly outputs: readonly [{
|
|
1604
|
+
readonly name: "";
|
|
1605
|
+
readonly type: "bool";
|
|
1606
|
+
readonly internalType: "bool";
|
|
1607
|
+
}];
|
|
1608
|
+
readonly stateMutability: "view";
|
|
1577
1609
|
}, {
|
|
1578
1610
|
readonly type: "function";
|
|
1579
1611
|
readonly name: "executePayment";
|
|
@@ -1660,6 +1692,14 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1660
1692
|
readonly name: "value";
|
|
1661
1693
|
readonly type: "uint256";
|
|
1662
1694
|
readonly internalType: "uint256";
|
|
1695
|
+
}, {
|
|
1696
|
+
readonly name: "extraTokens";
|
|
1697
|
+
readonly type: "address[]";
|
|
1698
|
+
readonly internalType: "address[]";
|
|
1699
|
+
}, {
|
|
1700
|
+
readonly name: "extraAmounts";
|
|
1701
|
+
readonly type: "uint256[]";
|
|
1702
|
+
readonly internalType: "uint256[]";
|
|
1663
1703
|
}, {
|
|
1664
1704
|
readonly name: "deadline";
|
|
1665
1705
|
readonly type: "uint256";
|
|
@@ -2187,6 +2227,16 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2187
2227
|
}];
|
|
2188
2228
|
readonly outputs: readonly [];
|
|
2189
2229
|
readonly stateMutability: "nonpayable";
|
|
2230
|
+
}, {
|
|
2231
|
+
readonly type: "function";
|
|
2232
|
+
readonly name: "setErc1271Bots";
|
|
2233
|
+
readonly inputs: readonly [{
|
|
2234
|
+
readonly name: "enabled";
|
|
2235
|
+
readonly type: "bool";
|
|
2236
|
+
readonly internalType: "bool";
|
|
2237
|
+
}];
|
|
2238
|
+
readonly outputs: readonly [];
|
|
2239
|
+
readonly stateMutability: "nonpayable";
|
|
2190
2240
|
}, {
|
|
2191
2241
|
readonly type: "function";
|
|
2192
2242
|
readonly name: "setOperator";
|
|
@@ -2508,6 +2558,16 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2508
2558
|
readonly internalType: "address";
|
|
2509
2559
|
}];
|
|
2510
2560
|
readonly anonymous: false;
|
|
2561
|
+
}, {
|
|
2562
|
+
readonly type: "event";
|
|
2563
|
+
readonly name: "ERC1271BotsToggled";
|
|
2564
|
+
readonly inputs: readonly [{
|
|
2565
|
+
readonly name: "enabled";
|
|
2566
|
+
readonly type: "bool";
|
|
2567
|
+
readonly indexed: false;
|
|
2568
|
+
readonly internalType: "bool";
|
|
2569
|
+
}];
|
|
2570
|
+
readonly anonymous: false;
|
|
2511
2571
|
}, {
|
|
2512
2572
|
readonly type: "event";
|
|
2513
2573
|
readonly name: "ERC721Withdrawn";
|
|
@@ -2727,6 +2787,11 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2727
2787
|
readonly type: "uint256";
|
|
2728
2788
|
readonly indexed: false;
|
|
2729
2789
|
readonly internalType: "uint256";
|
|
2790
|
+
}, {
|
|
2791
|
+
readonly name: "value";
|
|
2792
|
+
readonly type: "uint256";
|
|
2793
|
+
readonly indexed: false;
|
|
2794
|
+
readonly internalType: "uint256";
|
|
2730
2795
|
}, {
|
|
2731
2796
|
readonly name: "ref";
|
|
2732
2797
|
readonly type: "bytes32";
|
|
@@ -2877,6 +2942,10 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2877
2942
|
readonly type: "error";
|
|
2878
2943
|
readonly name: "AmountMismatch";
|
|
2879
2944
|
readonly inputs: readonly [];
|
|
2945
|
+
}, {
|
|
2946
|
+
readonly type: "error";
|
|
2947
|
+
readonly name: "ArrayLengthMismatch";
|
|
2948
|
+
readonly inputs: readonly [];
|
|
2880
2949
|
}, {
|
|
2881
2950
|
readonly type: "error";
|
|
2882
2951
|
readonly name: "BotAlreadyExists";
|
|
@@ -3750,4 +3819,4 @@ declare const AxonRegistryAbi: readonly [{
|
|
|
3750
3819
|
readonly inputs: readonly [];
|
|
3751
3820
|
}];
|
|
3752
3821
|
|
|
3753
|
-
export { 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, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, predictVaultAddress, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };
|
|
3822
|
+
export { 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -502,7 +502,7 @@ interface PayInput {
|
|
|
502
502
|
* executeProtocol() on-chain. The contract approves `token` to `protocol`,
|
|
503
503
|
* calls it with `callData`, then revokes the approval.
|
|
504
504
|
*
|
|
505
|
-
* TypeHash: keccak256("ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,uint256 deadline,bytes32 ref)")
|
|
505
|
+
* TypeHash: keccak256("ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,address[] extraTokens,uint256[] extraAmounts,uint256 deadline,bytes32 ref)")
|
|
506
506
|
*/
|
|
507
507
|
interface ExecuteIntent {
|
|
508
508
|
/** Bot's own address. Must be registered in the vault. */
|
|
@@ -517,6 +517,10 @@ interface ExecuteIntent {
|
|
|
517
517
|
amount: bigint;
|
|
518
518
|
/** Native ETH to send with the protocol call (e.g. WETH.deposit, Lido.submit). 0 = no ETH. */
|
|
519
519
|
value: bigint;
|
|
520
|
+
/** Additional tokens to approve to the SAME protocol (e.g. WETH for GMX execution fee). Bot-signed. */
|
|
521
|
+
extraTokens: Address[];
|
|
522
|
+
/** Approval amounts for each extra token. Must match extraTokens length. */
|
|
523
|
+
extraAmounts: bigint[];
|
|
520
524
|
/** Unix timestamp after which this intent is invalid. */
|
|
521
525
|
deadline: bigint;
|
|
522
526
|
/** keccak256 of the off-chain memo. Full memo text stored by relayer. */
|
|
@@ -557,6 +561,10 @@ interface ExecuteInput {
|
|
|
557
561
|
amount: AmountInput;
|
|
558
562
|
/** Native ETH to send with the call (wei). Optional, defaults to 0. Used for payable functions like WETH.deposit() or Lido.submit(). */
|
|
559
563
|
value?: bigint;
|
|
564
|
+
/** Additional tokens to approve to the protocol (e.g. WETH for GMX execution fee). Bot signs these. */
|
|
565
|
+
extraTokens?: Address[];
|
|
566
|
+
/** Approval amounts for each extra token (raw base units). Must match extraTokens length. */
|
|
567
|
+
extraAmounts?: bigint[];
|
|
560
568
|
/** Human-readable description. Gets keccak256-hashed to ref. */
|
|
561
569
|
memo?: string;
|
|
562
570
|
/**
|
|
@@ -994,6 +1002,20 @@ declare function getOperatorCeilings(publicClient: PublicClient, vaultAddress: A
|
|
|
994
1002
|
* Returns 0n if operator has no bot-add permission.
|
|
995
1003
|
*/
|
|
996
1004
|
declare function operatorMaxDrainPerDay(publicClient: PublicClient, vaultAddress: Address): Promise<bigint>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Returns whether ERC-1271 bot signatures are enabled on the vault.
|
|
1007
|
+
*
|
|
1008
|
+
* When disabled (default), only the vault owner's signatures are accepted by
|
|
1009
|
+
* external protocols (Permit2, Cowswap, Seaport). Bot signatures return
|
|
1010
|
+
* `0xffffffff` (invalid).
|
|
1011
|
+
*
|
|
1012
|
+
* When enabled, active bot keys can sign messages that external protocols
|
|
1013
|
+
* treat as vault-authorized — useful for Permit2 approvals, Cowswap orders, etc.
|
|
1014
|
+
*
|
|
1015
|
+
* If your bot interacts with a protocol that checks ERC-1271 and gets rejected,
|
|
1016
|
+
* the vault owner needs to call `setErc1271Bots(true)` to enable it.
|
|
1017
|
+
*/
|
|
1018
|
+
declare function isErc1271BotsEnabled(publicClient: PublicClient, vaultAddress: Address): Promise<boolean>;
|
|
997
1019
|
/** Returns whether the vault is currently paused. */
|
|
998
1020
|
declare function isVaultPaused(publicClient: PublicClient, vaultAddress: Address): Promise<boolean>;
|
|
999
1021
|
/** Returns the EIP-712 domain separator for this vault (for off-chain verification). */
|
|
@@ -1574,6 +1596,16 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1574
1596
|
readonly internalType: "uint256[]";
|
|
1575
1597
|
}];
|
|
1576
1598
|
readonly stateMutability: "view";
|
|
1599
|
+
}, {
|
|
1600
|
+
readonly type: "function";
|
|
1601
|
+
readonly name: "erc1271BotsEnabled";
|
|
1602
|
+
readonly inputs: readonly [];
|
|
1603
|
+
readonly outputs: readonly [{
|
|
1604
|
+
readonly name: "";
|
|
1605
|
+
readonly type: "bool";
|
|
1606
|
+
readonly internalType: "bool";
|
|
1607
|
+
}];
|
|
1608
|
+
readonly stateMutability: "view";
|
|
1577
1609
|
}, {
|
|
1578
1610
|
readonly type: "function";
|
|
1579
1611
|
readonly name: "executePayment";
|
|
@@ -1660,6 +1692,14 @@ declare const AxonVaultAbi: readonly [{
|
|
|
1660
1692
|
readonly name: "value";
|
|
1661
1693
|
readonly type: "uint256";
|
|
1662
1694
|
readonly internalType: "uint256";
|
|
1695
|
+
}, {
|
|
1696
|
+
readonly name: "extraTokens";
|
|
1697
|
+
readonly type: "address[]";
|
|
1698
|
+
readonly internalType: "address[]";
|
|
1699
|
+
}, {
|
|
1700
|
+
readonly name: "extraAmounts";
|
|
1701
|
+
readonly type: "uint256[]";
|
|
1702
|
+
readonly internalType: "uint256[]";
|
|
1663
1703
|
}, {
|
|
1664
1704
|
readonly name: "deadline";
|
|
1665
1705
|
readonly type: "uint256";
|
|
@@ -2187,6 +2227,16 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2187
2227
|
}];
|
|
2188
2228
|
readonly outputs: readonly [];
|
|
2189
2229
|
readonly stateMutability: "nonpayable";
|
|
2230
|
+
}, {
|
|
2231
|
+
readonly type: "function";
|
|
2232
|
+
readonly name: "setErc1271Bots";
|
|
2233
|
+
readonly inputs: readonly [{
|
|
2234
|
+
readonly name: "enabled";
|
|
2235
|
+
readonly type: "bool";
|
|
2236
|
+
readonly internalType: "bool";
|
|
2237
|
+
}];
|
|
2238
|
+
readonly outputs: readonly [];
|
|
2239
|
+
readonly stateMutability: "nonpayable";
|
|
2190
2240
|
}, {
|
|
2191
2241
|
readonly type: "function";
|
|
2192
2242
|
readonly name: "setOperator";
|
|
@@ -2508,6 +2558,16 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2508
2558
|
readonly internalType: "address";
|
|
2509
2559
|
}];
|
|
2510
2560
|
readonly anonymous: false;
|
|
2561
|
+
}, {
|
|
2562
|
+
readonly type: "event";
|
|
2563
|
+
readonly name: "ERC1271BotsToggled";
|
|
2564
|
+
readonly inputs: readonly [{
|
|
2565
|
+
readonly name: "enabled";
|
|
2566
|
+
readonly type: "bool";
|
|
2567
|
+
readonly indexed: false;
|
|
2568
|
+
readonly internalType: "bool";
|
|
2569
|
+
}];
|
|
2570
|
+
readonly anonymous: false;
|
|
2511
2571
|
}, {
|
|
2512
2572
|
readonly type: "event";
|
|
2513
2573
|
readonly name: "ERC721Withdrawn";
|
|
@@ -2727,6 +2787,11 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2727
2787
|
readonly type: "uint256";
|
|
2728
2788
|
readonly indexed: false;
|
|
2729
2789
|
readonly internalType: "uint256";
|
|
2790
|
+
}, {
|
|
2791
|
+
readonly name: "value";
|
|
2792
|
+
readonly type: "uint256";
|
|
2793
|
+
readonly indexed: false;
|
|
2794
|
+
readonly internalType: "uint256";
|
|
2730
2795
|
}, {
|
|
2731
2796
|
readonly name: "ref";
|
|
2732
2797
|
readonly type: "bytes32";
|
|
@@ -2877,6 +2942,10 @@ declare const AxonVaultAbi: readonly [{
|
|
|
2877
2942
|
readonly type: "error";
|
|
2878
2943
|
readonly name: "AmountMismatch";
|
|
2879
2944
|
readonly inputs: readonly [];
|
|
2945
|
+
}, {
|
|
2946
|
+
readonly type: "error";
|
|
2947
|
+
readonly name: "ArrayLengthMismatch";
|
|
2948
|
+
readonly inputs: readonly [];
|
|
2880
2949
|
}, {
|
|
2881
2950
|
readonly type: "error";
|
|
2882
2951
|
readonly name: "BotAlreadyExists";
|
|
@@ -3750,4 +3819,4 @@ declare const AxonRegistryAbi: readonly [{
|
|
|
3750
3819
|
readonly inputs: readonly [];
|
|
3751
3820
|
}];
|
|
3752
3821
|
|
|
3753
|
-
export { 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, isRebalanceTokenWhitelisted, isVaultPaused, operatorMaxDrainPerDay, parseAmount, parseChainId, parsePaymentRequired, predictVaultAddress, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };
|
|
3822
|
+
export { 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 };
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var PAYMENT_INTENT_TYPEHASH = keccak256(
|
|
|
16
16
|
);
|
|
17
17
|
var EXECUTE_INTENT_TYPEHASH = keccak256(
|
|
18
18
|
stringToBytes(
|
|
19
|
-
"ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,uint256 deadline,bytes32 ref)"
|
|
19
|
+
"ExecuteIntent(address bot,address protocol,bytes32 calldataHash,address token,uint256 amount,uint256 value,address[] extraTokens,uint256[] extraAmounts,uint256 deadline,bytes32 ref)"
|
|
20
20
|
)
|
|
21
21
|
);
|
|
22
22
|
var SWAP_INTENT_TYPEHASH = keccak256(
|
|
@@ -154,6 +154,8 @@ var EXECUTE_INTENT_TYPES = {
|
|
|
154
154
|
{ name: "token", type: "address" },
|
|
155
155
|
{ name: "amount", type: "uint256" },
|
|
156
156
|
{ name: "value", type: "uint256" },
|
|
157
|
+
{ name: "extraTokens", type: "address[]" },
|
|
158
|
+
{ name: "extraAmounts", type: "uint256[]" },
|
|
157
159
|
{ name: "deadline", type: "uint256" },
|
|
158
160
|
{ name: "ref", type: "bytes32" }
|
|
159
161
|
]
|
|
@@ -210,6 +212,8 @@ async function signExecuteIntent(walletClient, vaultAddress, chainId, intent) {
|
|
|
210
212
|
token: intent.token,
|
|
211
213
|
amount: intent.amount,
|
|
212
214
|
value: intent.value,
|
|
215
|
+
extraTokens: intent.extraTokens,
|
|
216
|
+
extraAmounts: intent.extraAmounts,
|
|
213
217
|
deadline: intent.deadline,
|
|
214
218
|
ref: intent.ref
|
|
215
219
|
}
|
|
@@ -612,6 +616,19 @@ var AxonVaultAbi = [
|
|
|
612
616
|
],
|
|
613
617
|
"stateMutability": "view"
|
|
614
618
|
},
|
|
619
|
+
{
|
|
620
|
+
"type": "function",
|
|
621
|
+
"name": "erc1271BotsEnabled",
|
|
622
|
+
"inputs": [],
|
|
623
|
+
"outputs": [
|
|
624
|
+
{
|
|
625
|
+
"name": "",
|
|
626
|
+
"type": "bool",
|
|
627
|
+
"internalType": "bool"
|
|
628
|
+
}
|
|
629
|
+
],
|
|
630
|
+
"stateMutability": "view"
|
|
631
|
+
},
|
|
615
632
|
{
|
|
616
633
|
"type": "function",
|
|
617
634
|
"name": "executePayment",
|
|
@@ -721,6 +738,16 @@ var AxonVaultAbi = [
|
|
|
721
738
|
"type": "uint256",
|
|
722
739
|
"internalType": "uint256"
|
|
723
740
|
},
|
|
741
|
+
{
|
|
742
|
+
"name": "extraTokens",
|
|
743
|
+
"type": "address[]",
|
|
744
|
+
"internalType": "address[]"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"name": "extraAmounts",
|
|
748
|
+
"type": "uint256[]",
|
|
749
|
+
"internalType": "uint256[]"
|
|
750
|
+
},
|
|
724
751
|
{
|
|
725
752
|
"name": "deadline",
|
|
726
753
|
"type": "uint256",
|
|
@@ -1407,6 +1434,19 @@ var AxonVaultAbi = [
|
|
|
1407
1434
|
"outputs": [],
|
|
1408
1435
|
"stateMutability": "nonpayable"
|
|
1409
1436
|
},
|
|
1437
|
+
{
|
|
1438
|
+
"type": "function",
|
|
1439
|
+
"name": "setErc1271Bots",
|
|
1440
|
+
"inputs": [
|
|
1441
|
+
{
|
|
1442
|
+
"name": "enabled",
|
|
1443
|
+
"type": "bool",
|
|
1444
|
+
"internalType": "bool"
|
|
1445
|
+
}
|
|
1446
|
+
],
|
|
1447
|
+
"outputs": [],
|
|
1448
|
+
"stateMutability": "nonpayable"
|
|
1449
|
+
},
|
|
1410
1450
|
{
|
|
1411
1451
|
"type": "function",
|
|
1412
1452
|
"name": "setOperator",
|
|
@@ -1817,6 +1857,19 @@ var AxonVaultAbi = [
|
|
|
1817
1857
|
],
|
|
1818
1858
|
"anonymous": false
|
|
1819
1859
|
},
|
|
1860
|
+
{
|
|
1861
|
+
"type": "event",
|
|
1862
|
+
"name": "ERC1271BotsToggled",
|
|
1863
|
+
"inputs": [
|
|
1864
|
+
{
|
|
1865
|
+
"name": "enabled",
|
|
1866
|
+
"type": "bool",
|
|
1867
|
+
"indexed": false,
|
|
1868
|
+
"internalType": "bool"
|
|
1869
|
+
}
|
|
1870
|
+
],
|
|
1871
|
+
"anonymous": false
|
|
1872
|
+
},
|
|
1820
1873
|
{
|
|
1821
1874
|
"type": "event",
|
|
1822
1875
|
"name": "ERC721Withdrawn",
|
|
@@ -2095,6 +2148,12 @@ var AxonVaultAbi = [
|
|
|
2095
2148
|
"indexed": false,
|
|
2096
2149
|
"internalType": "uint256"
|
|
2097
2150
|
},
|
|
2151
|
+
{
|
|
2152
|
+
"name": "value",
|
|
2153
|
+
"type": "uint256",
|
|
2154
|
+
"indexed": false,
|
|
2155
|
+
"internalType": "uint256"
|
|
2156
|
+
},
|
|
2098
2157
|
{
|
|
2099
2158
|
"name": "ref",
|
|
2100
2159
|
"type": "bytes32",
|
|
@@ -2283,6 +2342,11 @@ var AxonVaultAbi = [
|
|
|
2283
2342
|
"name": "AmountMismatch",
|
|
2284
2343
|
"inputs": []
|
|
2285
2344
|
},
|
|
2345
|
+
{
|
|
2346
|
+
"type": "error",
|
|
2347
|
+
"name": "ArrayLengthMismatch",
|
|
2348
|
+
"inputs": []
|
|
2349
|
+
},
|
|
2286
2350
|
{
|
|
2287
2351
|
"type": "error",
|
|
2288
2352
|
"name": "BotAlreadyExists",
|
|
@@ -3268,6 +3332,13 @@ async function operatorMaxDrainPerDay(publicClient, vaultAddress) {
|
|
|
3268
3332
|
functionName: "operatorMaxDrainPerDay"
|
|
3269
3333
|
});
|
|
3270
3334
|
}
|
|
3335
|
+
async function isErc1271BotsEnabled(publicClient, vaultAddress) {
|
|
3336
|
+
return publicClient.readContract({
|
|
3337
|
+
address: vaultAddress,
|
|
3338
|
+
abi: AxonVaultAbi,
|
|
3339
|
+
functionName: "erc1271BotsEnabled"
|
|
3340
|
+
});
|
|
3341
|
+
}
|
|
3271
3342
|
async function isVaultPaused(publicClient, vaultAddress) {
|
|
3272
3343
|
return publicClient.readContract({
|
|
3273
3344
|
address: vaultAddress,
|
|
@@ -4158,6 +4229,8 @@ Timestamp: ${timestamp}`;
|
|
|
4158
4229
|
token: resolveToken(input.token, this.chainId),
|
|
4159
4230
|
amount: parseAmount(input.amount, input.token, this.chainId),
|
|
4160
4231
|
value: input.value ?? 0n,
|
|
4232
|
+
extraTokens: input.extraTokens ?? [],
|
|
4233
|
+
extraAmounts: input.extraAmounts ?? [],
|
|
4161
4234
|
deadline: input.deadline ?? this._defaultDeadline(),
|
|
4162
4235
|
ref: this._resolveRef(input.memo, input.ref)
|
|
4163
4236
|
};
|
|
@@ -4908,6 +4981,6 @@ var AxonRegistryAbi = [
|
|
|
4908
4981
|
}
|
|
4909
4982
|
];
|
|
4910
4983
|
|
|
4911
|
-
export { AxonClient, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, CHAIN_NAMES, Chain, DEFAULT_APPROVED_TOKENS, DEFAULT_DEADLINE_SECONDS, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, KNOWN_TOKENS, NATIVE_ETH, PAYMENT_INTENT_TYPEHASH, PERMIT2_ADDRESS, PaymentErrorCode, RELAYER_API, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, Token, USDC, USDC_EIP712_DOMAIN, WINDOW, WITNESS_TYPE_STRING, 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, predictVaultAddress, randomNonce, randomPermit2Nonce, removeBot, resolveToken, resolveTokenDecimals, signExecuteIntent, signPayment, signPermit2WitnessTransfer, signSwapIntent, signTransferWithAuthorization, toBotConfigParams, updateBotConfig };
|
|
4984
|
+
export { AxonClient, AxonRegistryAbi, AxonVaultAbi, AxonVaultFactoryAbi, CHAIN_NAMES, Chain, DEFAULT_APPROVED_TOKENS, DEFAULT_DEADLINE_SECONDS, EIP712_DOMAIN_NAME, EIP712_DOMAIN_VERSION, EXECUTE_INTENT_TYPEHASH, EXPLORER_ADDR, EXPLORER_TX, KNOWN_TOKENS, NATIVE_ETH, PAYMENT_INTENT_TYPEHASH, PERMIT2_ADDRESS, PaymentErrorCode, RELAYER_API, SUPPORTED_CHAIN_IDS, SWAP_INTENT_TYPEHASH, Token, USDC, USDC_EIP712_DOMAIN, WINDOW, WITNESS_TYPE_STRING, 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 };
|
|
4912
4985
|
//# sourceMappingURL=index.js.map
|
|
4913
4986
|
//# sourceMappingURL=index.js.map
|