@shogun-sdk/intents-sdk 1.3.0 → 1.4.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 +15 -22
- package/dist/index.cjs +8997 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1654 -0
- package/dist/index.d.ts +1654 -0
- package/dist/index.js +9246 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -15
- package/src/auth/siwe.ts +8 -3
- package/src/chains.ts +6 -0
- package/src/constants.ts +67 -13
- package/src/core/evm/chain-provider.ts +4 -1
- package/src/core/evm/connectors/monad.ts +27 -0
- package/src/core/evm/cross-chain-limit-order.ts +14 -14
- package/src/core/evm/intent-helpers.ts +153 -19
- package/src/core/evm/intent-provider.ts +5 -4
- package/src/core/evm/permit2.ts +36 -0
- package/src/core/evm/single-chain-dca-order.ts +18 -18
- package/src/core/evm/single-chain-limit-order.ts +15 -15
- package/src/core/evm/types.ts +4 -4
- package/src/core/evm/validator.ts +1 -1
- package/src/core/orders/api/fetch.ts +33 -16
- package/src/core/orders/api/index.ts +39 -8
- package/src/core/orders/common.ts +2 -0
- package/src/core/orders/cross-chain.ts +15 -8
- package/src/core/orders/single-chain.ts +30 -13
- package/src/core/sdk.ts +11 -0
- package/src/core/solana/cancel-order.ts +4 -2
- package/src/core/solana/client.ts +1 -1
- package/src/core/solana/dca/cancel-order.ts +2 -1
- package/src/core/solana/dca/single-chain-dca-order.ts +19 -22
- package/src/core/solana/dca/single-chain-limit-order.ts +20 -22
- package/src/core/solana/generated/cross-chain/accounts/dcaOrder.ts +2 -2
- package/src/core/solana/generated/cross-chain/accounts/guard.ts +22 -10
- package/src/core/solana/generated/cross-chain/errors/sourceChainGuard.ts +37 -33
- package/src/core/solana/generated/cross-chain/instructions/cancelDcaOrder.ts +36 -22
- package/src/core/solana/generated/cross-chain/instructions/cancelOrder.ts +32 -18
- package/src/core/solana/generated/cross-chain/instructions/claimTokensForDcaInterval.ts +396 -0
- package/src/core/solana/generated/cross-chain/instructions/index.ts +5 -0
- package/src/core/solana/generated/cross-chain/instructions/preStartDcaOrderExecution.ts +504 -0
- package/src/core/solana/generated/cross-chain/instructions/setCancelAuthorities.ts +326 -0
- package/src/core/solana/generated/cross-chain/instructions/startDcaOrderExecution.ts +440 -0
- package/src/core/solana/generated/cross-chain/instructions/startDcaOrderExecutionAfterSwap.ts +322 -0
- package/src/core/solana/generated/cross-chain/programs/sourceChainGuard.ts +80 -0
- package/src/core/solana/generated/cross-chain/types/cancelAuthoritiesUpdated.ts +40 -0
- package/src/core/solana/generated/cross-chain/types/index.ts +1 -0
- package/src/core/solana/generated/single-chain/accounts/guard.ts +22 -10
- package/src/core/solana/generated/single-chain/errors/singleChainGuard.ts +24 -20
- package/src/core/solana/generated/single-chain/instructions/cancelDcaOrder.ts +28 -14
- package/src/core/solana/generated/single-chain/instructions/cancelLimitOrder.ts +28 -14
- package/src/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.ts +30 -4
- package/src/core/solana/generated/single-chain/instructions/fulfillLimitOrder.ts +30 -4
- package/src/core/solana/generated/single-chain/instructions/index.ts +1 -0
- package/src/core/solana/generated/single-chain/instructions/setCancelAuthorities.ts +326 -0
- package/src/core/solana/generated/single-chain/programs/singleChainGuard.ts +17 -1
- package/src/core/solana/generated/single-chain/types/cancelAuthoritiesUpdated.ts +40 -0
- package/src/core/solana/generated/single-chain/types/index.ts +1 -0
- package/src/core/solana/intent-helpers.ts +31 -23
- package/src/core/solana/sdk.ts +1 -1
- package/src/core/solana/utils.ts +10 -1
- package/src/core/sui/cross-chain-limit-order.ts +1 -4
- package/src/core/sui/intent-helpers.ts +28 -31
- package/src/core/sui/order-transaction.ts +1 -1
- package/src/core/sui/single-chain-dca-order.ts +19 -32
- package/src/core/sui/single-chain-limit-order.ts +19 -34
- package/src/index.ts +8 -2
- package/src/types/api.ts +22 -2
- package/src/types/intent.ts +40 -4
- package/src/types/token-list.ts +2 -2
- package/src/utils/base-validator.ts +0 -4
- package/src/utils/defillama.ts +2 -0
- package/src/utils/generate-execution-details-hash.ts +11 -32
- package/src/utils/quote/address.ts +4 -0
- package/src/utils/quote/aggregator.ts +266 -106
- package/src/utils/quote/liquidswap.ts +42 -13
- package/src/utils/quote/paraswap.ts +2 -0
- package/src/utils/quote/pricing/constants.ts +33 -0
- package/src/utils/quote/pricing/decimals.ts +11 -0
- package/src/utils/quote/pricing/estimate-amount-out.ts +36 -0
- package/src/utils/quote/pricing/expenses.ts +62 -0
- package/src/utils/quote/pricing/gas.ts +28 -0
- package/src/utils/quote/pumpfun/estimations.ts +206 -0
- package/src/utils/quote/pumpfun/estimations_amm.ts +165 -0
- package/src/utils/quote/pumpfun/index.ts +266 -0
- package/src/utils/quote/pumpfun/models.ts +163 -0
- package/src/utils/quote/pumpfun/utils.ts +343 -0
- package/src/utils/quote/raydium.ts +350 -9
- package/src/utils/quote/relay.ts +99 -0
- package/src/utils/quote/stablecoins-tokens.ts +35 -8
- package/src/utils/quote/utils.ts +8 -0
- package/dist/esm/auth/siwe.js +0 -26
- package/dist/esm/auth/siwe.js.map +0 -1
- package/dist/esm/chains.js +0 -62
- package/dist/esm/chains.js.map +0 -1
- package/dist/esm/config.js +0 -2
- package/dist/esm/config.js.map +0 -1
- package/dist/esm/constants.js +0 -107
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/core/evm/abi/erc20.js +0 -313
- package/dist/esm/core/evm/abi/erc20.js.map +0 -1
- package/dist/esm/core/evm/abi/permit2.js +0 -395
- package/dist/esm/core/evm/abi/permit2.js.map +0 -1
- package/dist/esm/core/evm/abi/single-chain-guard-limit.js +0 -768
- package/dist/esm/core/evm/abi/single-chain-guard-limit.js.map +0 -1
- package/dist/esm/core/evm/abi/source-chain-guard.js +0 -1121
- package/dist/esm/core/evm/abi/source-chain-guard.js.map +0 -1
- package/dist/esm/core/evm/cancel-order.js +0 -130
- package/dist/esm/core/evm/cancel-order.js.map +0 -1
- package/dist/esm/core/evm/chain-provider.js +0 -118
- package/dist/esm/core/evm/chain-provider.js.map +0 -1
- package/dist/esm/core/evm/connectors/hyperevm.js +0 -23
- package/dist/esm/core/evm/connectors/hyperevm.js.map +0 -1
- package/dist/esm/core/evm/cross-chain-limit-order.js +0 -43
- package/dist/esm/core/evm/cross-chain-limit-order.js.map +0 -1
- package/dist/esm/core/evm/intent-helpers.js +0 -135
- package/dist/esm/core/evm/intent-helpers.js.map +0 -1
- package/dist/esm/core/evm/intent-provider.js +0 -162
- package/dist/esm/core/evm/intent-provider.js.map +0 -1
- package/dist/esm/core/evm/order-signature.js +0 -41
- package/dist/esm/core/evm/order-signature.js.map +0 -1
- package/dist/esm/core/evm/permit2.js +0 -82
- package/dist/esm/core/evm/permit2.js.map +0 -1
- package/dist/esm/core/evm/sdk.js +0 -175
- package/dist/esm/core/evm/sdk.js.map +0 -1
- package/dist/esm/core/evm/single-chain-dca-order.js +0 -49
- package/dist/esm/core/evm/single-chain-dca-order.js.map +0 -1
- package/dist/esm/core/evm/single-chain-limit-order.js +0 -45
- package/dist/esm/core/evm/single-chain-limit-order.js.map +0 -1
- package/dist/esm/core/evm/types.js +0 -8
- package/dist/esm/core/evm/types.js.map +0 -1
- package/dist/esm/core/evm/validator.js +0 -111
- package/dist/esm/core/evm/validator.js.map +0 -1
- package/dist/esm/core/orders/api/fetch.js +0 -17
- package/dist/esm/core/orders/api/fetch.js.map +0 -1
- package/dist/esm/core/orders/api/index.js +0 -31
- package/dist/esm/core/orders/api/index.js.map +0 -1
- package/dist/esm/core/orders/common.js +0 -8
- package/dist/esm/core/orders/common.js.map +0 -1
- package/dist/esm/core/orders/cross-chain.js +0 -311
- package/dist/esm/core/orders/cross-chain.js.map +0 -1
- package/dist/esm/core/orders/dca-single-chain.js +0 -172
- package/dist/esm/core/orders/dca-single-chain.js.map +0 -1
- package/dist/esm/core/orders/single-chain.js +0 -197
- package/dist/esm/core/orders/single-chain.js.map +0 -1
- package/dist/esm/core/sdk.js +0 -86
- package/dist/esm/core/sdk.js.map +0 -1
- package/dist/esm/core/solana/cancel-order.js +0 -176
- package/dist/esm/core/solana/cancel-order.js.map +0 -1
- package/dist/esm/core/solana/client.js +0 -19
- package/dist/esm/core/solana/client.js.map +0 -1
- package/dist/esm/core/solana/dca/cancel-order.js +0 -61
- package/dist/esm/core/solana/dca/cancel-order.js.map +0 -1
- package/dist/esm/core/solana/dca/create-order.js +0 -82
- package/dist/esm/core/solana/dca/create-order.js.map +0 -1
- package/dist/esm/core/solana/dca/single-chain-dca-order.js +0 -23
- package/dist/esm/core/solana/dca/single-chain-dca-order.js.map +0 -1
- package/dist/esm/core/solana/dca/single-chain-limit-order.js +0 -29
- package/dist/esm/core/solana/dca/single-chain-limit-order.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js +0 -60
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/dcaOrder.js +0 -90
- package/dist/esm/core/solana/generated/cross-chain/accounts/dcaOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/guard.js +0 -64
- package/dist/esm/core/solana/generated/cross-chain/accounts/guard.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/index.js +0 -12
- package/dist/esm/core/solana/generated/cross-chain/accounts/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/order.js +0 -78
- package/dist/esm/core/solana/generated/cross-chain/accounts/order.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/errors/index.js +0 -9
- package/dist/esm/core/solana/generated/cross-chain/errors/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js +0 -140
- package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/index.js +0 -13
- package/dist/esm/core/solana/generated/cross-chain/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js +0 -88
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js +0 -118
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js +0 -107
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js +0 -127
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js +0 -133
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js +0 -170
- package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js +0 -188
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js +0 -166
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/index.js +0 -22
- package/dist/esm/core/solana/generated/cross-chain/instructions/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js +0 -126
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js +0 -110
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js +0 -98
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js +0 -111
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js +0 -98
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js +0 -106
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/programs/index.js +0 -9
- package/dist/esm/core/solana/generated/cross-chain/programs/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js +0 -98
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js +0 -79
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js +0 -18
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdated.js +0 -18
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdated.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.js +0 -24
- package/dist/esm/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaExecutionStarted.js +0 -32
- package/dist/esm/core/solana/generated/cross-chain/types/dcaExecutionStarted.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderCreated.js +0 -42
- package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.js +0 -26
- package/dist/esm/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaTokenInSwapped.js +0 -28
- package/dist/esm/core/solana/generated/cross-chain/types/dcaTokenInSwapped.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/executionStarted.js +0 -30
- package/dist/esm/core/solana/generated/cross-chain/types/executionStarted.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.js +0 -26
- package/dist/esm/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/guardCreated.js +0 -28
- package/dist/esm/core/solana/generated/cross-chain/types/guardCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/index.js +0 -22
- package/dist/esm/core/solana/generated/cross-chain/types/index.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/orderCancelled.js +0 -18
- package/dist/esm/core/solana/generated/cross-chain/types/orderCancelled.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/orderCreated.js +0 -36
- package/dist/esm/core/solana/generated/cross-chain/types/orderCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/orderFulfilled.js +0 -18
- package/dist/esm/core/solana/generated/cross-chain/types/orderFulfilled.js.map +0 -1
- package/dist/esm/core/solana/generated/cross-chain/types/tokenInSwapped.js +0 -26
- package/dist/esm/core/solana/generated/cross-chain/types/tokenInSwapped.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js +0 -60
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/dcaOrder.js +0 -75
- package/dist/esm/core/solana/generated/single-chain/accounts/dcaOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/guard.js +0 -62
- package/dist/esm/core/solana/generated/single-chain/accounts/guard.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/index.js +0 -12
- package/dist/esm/core/solana/generated/single-chain/accounts/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/limitOrder.js +0 -65
- package/dist/esm/core/solana/generated/single-chain/accounts/limitOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/errors/index.js +0 -9
- package/dist/esm/core/solana/generated/single-chain/errors/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js +0 -101
- package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/index.js +0 -13
- package/dist/esm/core/solana/generated/single-chain/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js +0 -88
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js +0 -84
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js +0 -84
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js +0 -121
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js +0 -172
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js +0 -163
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js +0 -168
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js +0 -146
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js +0 -146
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/index.js +0 -20
- package/dist/esm/core/solana/generated/single-chain/instructions/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js +0 -126
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js +0 -98
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js +0 -111
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/programs/index.js +0 -9
- package/dist/esm/core/solana/generated/single-chain/programs/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js +0 -90
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/shared/index.js +0 -79
- package/dist/esm/core/solana/generated/single-chain/shared/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js +0 -18
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdated.js +0 -18
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdated.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js +0 -24
- package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderCreated.js +0 -42
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js +0 -18
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.js +0 -30
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js +0 -26
- package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/index.js +0 -18
- package/dist/esm/core/solana/generated/single-chain/types/index.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js +0 -36
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js +0 -24
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js.map +0 -1
- package/dist/esm/core/solana/generated/single-chain/types/orderCancelled.js +0 -18
- package/dist/esm/core/solana/generated/single-chain/types/orderCancelled.js.map +0 -1
- package/dist/esm/core/solana/inspect.js +0 -43
- package/dist/esm/core/solana/inspect.js.map +0 -1
- package/dist/esm/core/solana/intent-helpers.js +0 -180
- package/dist/esm/core/solana/intent-helpers.js.map +0 -1
- package/dist/esm/core/solana/order-instructions.js +0 -163
- package/dist/esm/core/solana/order-instructions.js.map +0 -1
- package/dist/esm/core/solana/sdk.js +0 -220
- package/dist/esm/core/solana/sdk.js.map +0 -1
- package/dist/esm/core/solana/utils.js +0 -19
- package/dist/esm/core/solana/utils.js.map +0 -1
- package/dist/esm/core/solana/validator.js +0 -28
- package/dist/esm/core/solana/validator.js.map +0 -1
- package/dist/esm/core/sui/cancel.js +0 -36
- package/dist/esm/core/sui/cancel.js.map +0 -1
- package/dist/esm/core/sui/client.js +0 -3
- package/dist/esm/core/sui/client.js.map +0 -1
- package/dist/esm/core/sui/cross-chain-limit-order.js +0 -9
- package/dist/esm/core/sui/cross-chain-limit-order.js.map +0 -1
- package/dist/esm/core/sui/intent-helpers.js +0 -140
- package/dist/esm/core/sui/intent-helpers.js.map +0 -1
- package/dist/esm/core/sui/order-transaction.js +0 -58
- package/dist/esm/core/sui/order-transaction.js.map +0 -1
- package/dist/esm/core/sui/sdk.js +0 -119
- package/dist/esm/core/sui/sdk.js.map +0 -1
- package/dist/esm/core/sui/single-chain-dca-order.js +0 -99
- package/dist/esm/core/sui/single-chain-dca-order.js.map +0 -1
- package/dist/esm/core/sui/single-chain-limit-order.js +0 -103
- package/dist/esm/core/sui/single-chain-limit-order.js.map +0 -1
- package/dist/esm/core/sui/validator.js +0 -31
- package/dist/esm/core/sui/validator.js.map +0 -1
- package/dist/esm/errors/index.js +0 -68
- package/dist/esm/errors/index.js.map +0 -1
- package/dist/esm/index.js +0 -41
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/api.js +0 -7
- package/dist/esm/types/api.js.map +0 -1
- package/dist/esm/types/intent.js +0 -2
- package/dist/esm/types/intent.js.map +0 -1
- package/dist/esm/types/token-list.js +0 -2
- package/dist/esm/types/token-list.js.map +0 -1
- package/dist/esm/utils/base-validator.js +0 -91
- package/dist/esm/utils/base-validator.js.map +0 -1
- package/dist/esm/utils/defillama.js +0 -104
- package/dist/esm/utils/defillama.js.map +0 -1
- package/dist/esm/utils/generate-execution-details-hash.js +0 -15
- package/dist/esm/utils/generate-execution-details-hash.js.map +0 -1
- package/dist/esm/utils/logger.js +0 -109
- package/dist/esm/utils/logger.js.map +0 -1
- package/dist/esm/utils/order-validator.js +0 -112
- package/dist/esm/utils/order-validator.js.map +0 -1
- package/dist/esm/utils/parsers.js +0 -28
- package/dist/esm/utils/parsers.js.map +0 -1
- package/dist/esm/utils/quote/aftermath.js +0 -15
- package/dist/esm/utils/quote/aftermath.js.map +0 -1
- package/dist/esm/utils/quote/aggregator.js +0 -329
- package/dist/esm/utils/quote/aggregator.js.map +0 -1
- package/dist/esm/utils/quote/jupiter.js +0 -31
- package/dist/esm/utils/quote/jupiter.js.map +0 -1
- package/dist/esm/utils/quote/liquidswap.js +0 -22
- package/dist/esm/utils/quote/liquidswap.js.map +0 -1
- package/dist/esm/utils/quote/paraswap.js +0 -67
- package/dist/esm/utils/quote/paraswap.js.map +0 -1
- package/dist/esm/utils/quote/raydium.js +0 -82
- package/dist/esm/utils/quote/raydium.js.map +0 -1
- package/dist/esm/utils/quote/stablecoins-tokens.js +0 -13
- package/dist/esm/utils/quote/stablecoins-tokens.js.map +0 -1
- package/dist/esm/utils/tokens/index.js +0 -37
- package/dist/esm/utils/tokens/index.js.map +0 -1
- package/dist/esm/utils/type-utils.js +0 -2
- package/dist/esm/utils/type-utils.js.map +0 -1
- package/dist/types/auth/siwe.d.ts +0 -13
- package/dist/types/auth/siwe.d.ts.map +0 -1
- package/dist/types/chains.d.ts +0 -62
- package/dist/types/chains.d.ts.map +0 -1
- package/dist/types/config.d.ts +0 -21
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -44
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/core/evm/abi/erc20.d.ts +0 -240
- package/dist/types/core/evm/abi/erc20.d.ts.map +0 -1
- package/dist/types/core/evm/abi/permit2.d.ts +0 -304
- package/dist/types/core/evm/abi/permit2.d.ts.map +0 -1
- package/dist/types/core/evm/abi/single-chain-guard-limit.d.ts +0 -596
- package/dist/types/core/evm/abi/single-chain-guard-limit.d.ts.map +0 -1
- package/dist/types/core/evm/abi/source-chain-guard.d.ts +0 -877
- package/dist/types/core/evm/abi/source-chain-guard.d.ts.map +0 -1
- package/dist/types/core/evm/cancel-order.d.ts +0 -28
- package/dist/types/core/evm/cancel-order.d.ts.map +0 -1
- package/dist/types/core/evm/chain-provider.d.ts +0 -62338
- package/dist/types/core/evm/chain-provider.d.ts.map +0 -1
- package/dist/types/core/evm/connectors/hyperevm.d.ts +0 -38
- package/dist/types/core/evm/connectors/hyperevm.d.ts.map +0 -1
- package/dist/types/core/evm/cross-chain-limit-order.d.ts +0 -22
- package/dist/types/core/evm/cross-chain-limit-order.d.ts.map +0 -1
- package/dist/types/core/evm/intent-helpers.d.ts +0 -105
- package/dist/types/core/evm/intent-helpers.d.ts.map +0 -1
- package/dist/types/core/evm/intent-provider.d.ts +0 -19
- package/dist/types/core/evm/intent-provider.d.ts.map +0 -1
- package/dist/types/core/evm/order-signature.d.ts +0 -22
- package/dist/types/core/evm/order-signature.d.ts.map +0 -1
- package/dist/types/core/evm/permit2.d.ts +0 -261
- package/dist/types/core/evm/permit2.d.ts.map +0 -1
- package/dist/types/core/evm/sdk.d.ts +0 -63
- package/dist/types/core/evm/sdk.d.ts.map +0 -1
- package/dist/types/core/evm/single-chain-dca-order.d.ts +0 -26
- package/dist/types/core/evm/single-chain-dca-order.d.ts.map +0 -1
- package/dist/types/core/evm/single-chain-limit-order.d.ts +0 -23
- package/dist/types/core/evm/single-chain-limit-order.d.ts.map +0 -1
- package/dist/types/core/evm/types.d.ts +0 -8
- package/dist/types/core/evm/types.d.ts.map +0 -1
- package/dist/types/core/evm/validator.d.ts +0 -23
- package/dist/types/core/evm/validator.d.ts.map +0 -1
- package/dist/types/core/orders/api/fetch.d.ts +0 -3
- package/dist/types/core/orders/api/fetch.d.ts.map +0 -1
- package/dist/types/core/orders/api/index.d.ts +0 -8
- package/dist/types/core/orders/api/index.d.ts.map +0 -1
- package/dist/types/core/orders/common.d.ts +0 -12
- package/dist/types/core/orders/common.d.ts.map +0 -1
- package/dist/types/core/orders/cross-chain.d.ts +0 -123
- package/dist/types/core/orders/cross-chain.d.ts.map +0 -1
- package/dist/types/core/orders/dca-single-chain.d.ts +0 -47
- package/dist/types/core/orders/dca-single-chain.d.ts.map +0 -1
- package/dist/types/core/orders/single-chain.d.ts +0 -47
- package/dist/types/core/orders/single-chain.d.ts.map +0 -1
- package/dist/types/core/sdk.d.ts +0 -30
- package/dist/types/core/sdk.d.ts.map +0 -1
- package/dist/types/core/solana/cancel-order.d.ts +0 -18
- package/dist/types/core/solana/cancel-order.d.ts.map +0 -1
- package/dist/types/core/solana/client.d.ts +0 -11
- package/dist/types/core/solana/client.d.ts.map +0 -1
- package/dist/types/core/solana/dca/cancel-order.d.ts +0 -5
- package/dist/types/core/solana/dca/cancel-order.d.ts.map +0 -1
- package/dist/types/core/solana/dca/create-order.d.ts +0 -8
- package/dist/types/core/solana/dca/create-order.d.ts.map +0 -1
- package/dist/types/core/solana/dca/single-chain-dca-order.d.ts +0 -14
- package/dist/types/core/solana/dca/single-chain-dca-order.d.ts.map +0 -1
- package/dist/types/core/solana/dca/single-chain-limit-order.d.ts +0 -19
- package/dist/types/core/solana/dca/single-chain-limit-order.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts +0 -40
- package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/dcaOrder.d.ts +0 -110
- package/dist/types/core/solana/generated/cross-chain/accounts/dcaOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/guard.d.ts +0 -52
- package/dist/types/core/solana/generated/cross-chain/accounts/guard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/index.d.ts +0 -12
- package/dist/types/core/solana/generated/cross-chain/accounts/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/order.d.ts +0 -92
- package/dist/types/core/solana/generated/cross-chain/accounts/order.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/errors/index.d.ts +0 -9
- package/dist/types/core/solana/generated/cross-chain/errors/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts +0 -97
- package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/index.d.ts +0 -13
- package/dist/types/core/solana/generated/cross-chain/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts +0 -56
- package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelDcaOrder.d.ts +0 -124
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelDcaOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts +0 -108
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts +0 -131
- package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts +0 -91
- package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createDcaOrder.d.ts +0 -130
- package/dist/types/core/solana/generated/cross-chain/instructions/createDcaOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts +0 -137
- package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts +0 -122
- package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/index.d.ts +0 -22
- package/dist/types/core/solana/generated/cross-chain/instructions/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts +0 -86
- package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts +0 -105
- package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts +0 -61
- package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts +0 -68
- package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts +0 -85
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts +0 -95
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/programs/index.d.ts +0 -9
- package/dist/types/core/solana/generated/cross-chain/programs/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts +0 -69
- package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts +0 -52
- package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts +0 -16
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdated.d.ts +0 -16
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.d.ts +0 -17
- package/dist/types/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaExecutionStarted.d.ts +0 -28
- package/dist/types/core/solana/generated/cross-chain/types/dcaExecutionStarted.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaOrderCreated.d.ts +0 -38
- package/dist/types/core/solana/generated/cross-chain/types/dcaOrderCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.d.ts +0 -18
- package/dist/types/core/solana/generated/cross-chain/types/dcaOrderIntervalFulfilled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaTokenInSwapped.d.ts +0 -24
- package/dist/types/core/solana/generated/cross-chain/types/dcaTokenInSwapped.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/executionStarted.d.ts +0 -26
- package/dist/types/core/solana/generated/cross-chain/types/executionStarted.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.d.ts +0 -18
- package/dist/types/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/guardCreated.d.ts +0 -19
- package/dist/types/core/solana/generated/cross-chain/types/guardCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/index.d.ts +0 -22
- package/dist/types/core/solana/generated/cross-chain/types/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/orderCancelled.d.ts +0 -16
- package/dist/types/core/solana/generated/cross-chain/types/orderCancelled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/orderCreated.d.ts +0 -32
- package/dist/types/core/solana/generated/cross-chain/types/orderCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/orderFulfilled.d.ts +0 -16
- package/dist/types/core/solana/generated/cross-chain/types/orderFulfilled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/cross-chain/types/tokenInSwapped.d.ts +0 -22
- package/dist/types/core/solana/generated/cross-chain/types/tokenInSwapped.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts +0 -40
- package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/accounts/dcaOrder.d.ts +0 -99
- package/dist/types/core/solana/generated/single-chain/accounts/dcaOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/accounts/guard.d.ts +0 -48
- package/dist/types/core/solana/generated/single-chain/accounts/guard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/accounts/index.d.ts +0 -12
- package/dist/types/core/solana/generated/single-chain/accounts/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/accounts/limitOrder.d.ts +0 -79
- package/dist/types/core/solana/generated/single-chain/accounts/limitOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/errors/index.d.ts +0 -9
- package/dist/types/core/solana/generated/single-chain/errors/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts +0 -71
- package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/index.d.ts +0 -13
- package/dist/types/core/solana/generated/single-chain/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts +0 -56
- package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts +0 -72
- package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts +0 -72
- package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts +0 -91
- package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts +0 -134
- package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts +0 -107
- package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts +0 -126
- package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts +0 -179
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts +0 -179
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/index.d.ts +0 -20
- package/dist/types/core/solana/generated/single-chain/instructions/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts +0 -86
- package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts +0 -61
- package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts +0 -68
- package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/programs/index.d.ts +0 -9
- package/dist/types/core/solana/generated/single-chain/programs/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts +0 -63
- package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/shared/index.d.ts +0 -52
- package/dist/types/core/solana/generated/single-chain/shared/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts +0 -16
- package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/adminUpdated.d.ts +0 -16
- package/dist/types/core/solana/generated/single-chain/types/adminUpdated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts +0 -17
- package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderCreated.d.ts +0 -38
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts +0 -16
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.d.ts +0 -26
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/guardCreated.d.ts +0 -18
- package/dist/types/core/solana/generated/single-chain/types/guardCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/index.d.ts +0 -18
- package/dist/types/core/solana/generated/single-chain/types/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts +0 -32
- package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts +0 -20
- package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/single-chain/types/orderCancelled.d.ts +0 -16
- package/dist/types/core/solana/generated/single-chain/types/orderCancelled.d.ts.map +0 -1
- package/dist/types/core/solana/inspect.d.ts +0 -14
- package/dist/types/core/solana/inspect.d.ts.map +0 -1
- package/dist/types/core/solana/intent-helpers.d.ts +0 -120
- package/dist/types/core/solana/intent-helpers.d.ts.map +0 -1
- package/dist/types/core/solana/order-instructions.d.ts +0 -16
- package/dist/types/core/solana/order-instructions.d.ts.map +0 -1
- package/dist/types/core/solana/sdk.d.ts +0 -73
- package/dist/types/core/solana/sdk.d.ts.map +0 -1
- package/dist/types/core/solana/utils.d.ts +0 -7
- package/dist/types/core/solana/utils.d.ts.map +0 -1
- package/dist/types/core/solana/validator.d.ts +0 -11
- package/dist/types/core/solana/validator.d.ts.map +0 -1
- package/dist/types/core/sui/cancel.d.ts +0 -3
- package/dist/types/core/sui/cancel.d.ts.map +0 -1
- package/dist/types/core/sui/client.d.ts +0 -3
- package/dist/types/core/sui/client.d.ts.map +0 -1
- package/dist/types/core/sui/cross-chain-limit-order.d.ts +0 -5
- package/dist/types/core/sui/cross-chain-limit-order.d.ts.map +0 -1
- package/dist/types/core/sui/intent-helpers.d.ts +0 -90
- package/dist/types/core/sui/intent-helpers.d.ts.map +0 -1
- package/dist/types/core/sui/order-transaction.d.ts +0 -11
- package/dist/types/core/sui/order-transaction.d.ts.map +0 -1
- package/dist/types/core/sui/sdk.d.ts +0 -57
- package/dist/types/core/sui/sdk.d.ts.map +0 -1
- package/dist/types/core/sui/single-chain-dca-order.d.ts +0 -22
- package/dist/types/core/sui/single-chain-dca-order.d.ts.map +0 -1
- package/dist/types/core/sui/single-chain-limit-order.d.ts +0 -26
- package/dist/types/core/sui/single-chain-limit-order.d.ts.map +0 -1
- package/dist/types/core/sui/validator.d.ts +0 -11
- package/dist/types/core/sui/validator.d.ts.map +0 -1
- package/dist/types/errors/index.d.ts +0 -20
- package/dist/types/errors/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -43
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types/api.d.ts +0 -65
- package/dist/types/types/api.d.ts.map +0 -1
- package/dist/types/types/intent.d.ts +0 -136
- package/dist/types/types/intent.d.ts.map +0 -1
- package/dist/types/types/token-list.d.ts +0 -30
- package/dist/types/types/token-list.d.ts.map +0 -1
- package/dist/types/utils/base-validator.d.ts +0 -46
- package/dist/types/utils/base-validator.d.ts.map +0 -1
- package/dist/types/utils/defillama.d.ts +0 -61
- package/dist/types/utils/defillama.d.ts.map +0 -1
- package/dist/types/utils/generate-execution-details-hash.d.ts +0 -11
- package/dist/types/utils/generate-execution-details-hash.d.ts.map +0 -1
- package/dist/types/utils/logger.d.ts +0 -35
- package/dist/types/utils/logger.d.ts.map +0 -1
- package/dist/types/utils/order-validator.d.ts +0 -64
- package/dist/types/utils/order-validator.d.ts.map +0 -1
- package/dist/types/utils/parsers.d.ts +0 -6
- package/dist/types/utils/parsers.d.ts.map +0 -1
- package/dist/types/utils/quote/aftermath.d.ts +0 -9
- package/dist/types/utils/quote/aftermath.d.ts.map +0 -1
- package/dist/types/utils/quote/aggregator.d.ts +0 -80
- package/dist/types/utils/quote/aggregator.d.ts.map +0 -1
- package/dist/types/utils/quote/jupiter.d.ts +0 -16
- package/dist/types/utils/quote/jupiter.d.ts.map +0 -1
- package/dist/types/utils/quote/liquidswap.d.ts +0 -16
- package/dist/types/utils/quote/liquidswap.d.ts.map +0 -1
- package/dist/types/utils/quote/paraswap.d.ts +0 -23
- package/dist/types/utils/quote/paraswap.d.ts.map +0 -1
- package/dist/types/utils/quote/raydium.d.ts +0 -79
- package/dist/types/utils/quote/raydium.d.ts.map +0 -1
- package/dist/types/utils/quote/stablecoins-tokens.d.ts +0 -11
- package/dist/types/utils/quote/stablecoins-tokens.d.ts.map +0 -1
- package/dist/types/utils/tokens/index.d.ts +0 -20
- package/dist/types/utils/tokens/index.d.ts.map +0 -1
- package/dist/types/utils/type-utils.d.ts +0 -2
- package/dist/types/utils/type-utils.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shogun-sdk/intents-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shogun Network Intent-based cross-chain swaps SDK",
|
|
6
6
|
"author": "Shogun network",
|
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "https://github.com/shogun-network/shogun-sdk.git"
|
|
14
14
|
},
|
|
15
|
-
"main": "./dist/
|
|
16
|
-
"
|
|
17
|
-
"
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"types": "./dist/
|
|
21
|
-
"
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs",
|
|
23
|
+
"default": "./dist/index.js"
|
|
22
24
|
},
|
|
23
25
|
"./package.json": "./package.json"
|
|
24
26
|
},
|
|
@@ -45,40 +47,51 @@
|
|
|
45
47
|
"@types/bn.js": "5.2.0",
|
|
46
48
|
"@types/node": "22.13.10",
|
|
47
49
|
"codama": "1.3.4",
|
|
48
|
-
"
|
|
50
|
+
"tsup": "^8.5.0",
|
|
51
|
+
"typescript": "5.8.2",
|
|
52
|
+
"vitest": "^2.1.9"
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
55
|
+
"@codama/visitors-core": "^1.3.7",
|
|
51
56
|
"@coral-xyz/anchor": "0.31.1",
|
|
52
57
|
"@jup-ag/api": "6.0.44",
|
|
53
58
|
"@mysten/bcs": "1.8.0",
|
|
54
59
|
"@mysten/sui": "1.29.1",
|
|
55
60
|
"@paraswap/sdk": "7.3.1",
|
|
56
|
-
"@raydium-io/raydium-sdk-v2": "0.2.
|
|
61
|
+
"@raydium-io/raydium-sdk-v2": "0.2.30-alpha",
|
|
62
|
+
"@solana-program/system": "0.8.0",
|
|
63
|
+
"@solana-program/token": "0.6.0",
|
|
57
64
|
"@solana/accounts": "3.0.3",
|
|
58
65
|
"@solana/addresses": "3.0.3",
|
|
59
66
|
"@solana/codecs": "3.0.3",
|
|
67
|
+
"@solana/compat": "3.0.2",
|
|
60
68
|
"@solana/errors": "3.0.3",
|
|
61
69
|
"@solana/instructions": "3.0.3",
|
|
70
|
+
"@solana/kit": "3.0.2",
|
|
62
71
|
"@solana/programs": "3.0.3",
|
|
63
72
|
"@solana/signers": "3.0.3",
|
|
64
|
-
"@solana/
|
|
65
|
-
"@
|
|
73
|
+
"@solana/transaction-confirmation": "3.0.2",
|
|
74
|
+
"@solana/transactions": "3.0.2",
|
|
75
|
+
"@solana/web3.js": "1.98.4",
|
|
76
|
+
"@uniswap/permit2-sdk": "1.3.0",
|
|
66
77
|
"aftermath-ts-sdk": "1.3.14",
|
|
67
78
|
"bn.js": "5.2.2",
|
|
68
79
|
"dayjs": "1.11.13",
|
|
80
|
+
"decimal.js": "^10.4.3",
|
|
69
81
|
"ethers": "6.13.5",
|
|
70
82
|
"js-sha3": "0.9.3",
|
|
71
83
|
"solana": "3.0.0",
|
|
72
|
-
"viem": "2.
|
|
84
|
+
"viem": "2.40.3"
|
|
73
85
|
},
|
|
74
86
|
"scripts": {
|
|
75
|
-
"
|
|
76
|
-
"build
|
|
77
|
-
"clean": "rm -rf ./dist",
|
|
87
|
+
"clean": "rm -rf dist",
|
|
88
|
+
"build": "tsup --clean",
|
|
78
89
|
"check:types": "tsc --noEmit --project ./tsconfig.build.json",
|
|
79
90
|
"lint": "npx eslint --fix --ext .ts ./src",
|
|
80
91
|
"format": "prettier --write ./src",
|
|
81
92
|
"pre-publish": "pnpm node ./scripts/prePublish.js",
|
|
82
|
-
"generate-solana-idl": "pnpm node ./scripts/codama.js"
|
|
93
|
+
"generate-solana-idl": "pnpm node ./scripts/codama.js",
|
|
94
|
+
"test": "vitest run",
|
|
95
|
+
"test:watch": "vitest"
|
|
83
96
|
}
|
|
84
97
|
}
|
package/src/auth/siwe.ts
CHANGED
|
@@ -24,12 +24,17 @@ export async function fetchSiweMessage(params: FetchSiweMessageParams) {
|
|
|
24
24
|
|
|
25
25
|
export async function fetchJWTToken(params: FetchJWTParams, token?: string) {
|
|
26
26
|
const url = `${AUCTIONEER_URL}/siwe`;
|
|
27
|
+
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
|
|
28
|
+
// Only forward an existing token when present; the server merges the newly verified
|
|
29
|
+
// wallet into it. Sending `Bearer undefined` would be a no-op the server discards.
|
|
30
|
+
if (token) {
|
|
31
|
+
headers.Authorization = `Bearer ${token}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
const response = await fetch(url, {
|
|
28
35
|
method: 'POST',
|
|
29
36
|
body: JSON.stringify(params),
|
|
30
|
-
headers
|
|
31
|
-
Authorization: `Bearer ${token}`,
|
|
32
|
-
},
|
|
37
|
+
headers,
|
|
33
38
|
});
|
|
34
39
|
|
|
35
40
|
if (!response.ok) {
|
package/src/chains.ts
CHANGED
|
@@ -22,6 +22,8 @@ export enum ChainID {
|
|
|
22
22
|
Hyperliquid = 999,
|
|
23
23
|
Solana = 7565164,
|
|
24
24
|
Sui = 101,
|
|
25
|
+
BSC = 56,
|
|
26
|
+
MONAD = 143,
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
@@ -35,6 +37,8 @@ export const SupportedChains = [
|
|
|
35
37
|
ChainID.Hyperliquid,
|
|
36
38
|
ChainID.Solana,
|
|
37
39
|
ChainID.Sui,
|
|
40
|
+
ChainID.BSC,
|
|
41
|
+
ChainID.MONAD
|
|
38
42
|
] as const;
|
|
39
43
|
|
|
40
44
|
/**
|
|
@@ -78,4 +82,6 @@ export const chainIdToChainTypeMap = {
|
|
|
78
82
|
[ChainID.Hyperliquid]: ChainType.EVM,
|
|
79
83
|
[ChainID.Solana]: ChainType.Solana,
|
|
80
84
|
[ChainID.Sui]: ChainType.Sui,
|
|
85
|
+
[ChainID.BSC]: ChainType.EVM,
|
|
86
|
+
[ChainID.MONAD]: ChainType.EVM,
|
|
81
87
|
} as const;
|
package/src/constants.ts
CHANGED
|
@@ -15,17 +15,21 @@ export const PERMIT2_ADDRESS: Record<SupportedEvmChain, EvmAddress> = {
|
|
|
15
15
|
[ChainID.Optimism]: '0x000000000022d473030f116ddee9f6b43ac78ba3' as EvmAddress,
|
|
16
16
|
[ChainID.Base]: '0x000000000022d473030f116ddee9f6b43ac78ba3' as EvmAddress,
|
|
17
17
|
[ChainID.Hyperliquid]: '0x000000000022d473030f116ddee9f6b43ac78ba3' as EvmAddress,
|
|
18
|
+
[ChainID.BSC]: '0x000000000022d473030f116ddee9f6b43ac78ba3' as EvmAddress,
|
|
19
|
+
[ChainID.MONAD]: '0x000000000022d473030f116ddee9f6b43ac78ba3' as EvmAddress,
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
// Production guard addresses
|
|
21
23
|
export const PROD_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, SolanaAddress | EvmAddress> = {
|
|
22
|
-
[ChainID.Arbitrum]: '
|
|
23
|
-
[ChainID.Optimism]: '
|
|
24
|
-
[ChainID.Base]: '
|
|
25
|
-
[ChainID.Hyperliquid]: '
|
|
24
|
+
[ChainID.Arbitrum]: '0x7f23f071be7d3161c026ae49289d34f3e7b89992' as EvmAddress,
|
|
25
|
+
[ChainID.Optimism]: '0x8c29c82c65a0a58311f0e8967580e08e548c4614' as EvmAddress,
|
|
26
|
+
[ChainID.Base]: '0x165d1187acf51a96faf6908e5d5cc459fe21fdba' as EvmAddress,
|
|
27
|
+
[ChainID.Hyperliquid]: '0xe5329801f8c0ee293286e8be253d009b01d4e54e' as EvmAddress,
|
|
26
28
|
[ChainID.Solana]:
|
|
27
29
|
'AiTqNSZe6Nxs2myiUX1cP6YfiER3v2pWuMYMSLYcrpyo' as SolanaAddress<'AiTqNSZe6Nxs2myiUX1cP6YfiER3v2pWuMYMSLYcrpyo'>,
|
|
28
30
|
[ChainID.Sui]: '0x70d005df81d0fd7f7a7aaf87fa8676bff427f7202897b373bbf3d5bf0a8792de',
|
|
31
|
+
[ChainID.BSC]: '0x18bab93fad2a790a6635553451307d309b1de2b4' as EvmAddress,
|
|
32
|
+
[ChainID.MONAD]: '0x4E657A1386A6DB821cE764625Fb24BFbB54eA12E' as EvmAddress,
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
// Test guard addresses
|
|
@@ -37,6 +41,8 @@ export const TEST_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, SolanaAddr
|
|
|
37
41
|
[ChainID.Solana]:
|
|
38
42
|
'97XuksD34dyU3qyPDNwQ8qfPw1zHoUa7xVxBVdojSJ7E' as SolanaAddress<'97XuksD34dyU3qyPDNwQ8qfPw1zHoUa7xVxBVdojSJ7E'>,
|
|
39
43
|
[ChainID.Sui]: '0x47f2934f621483bc485feeb78972dd2fb25840074e296fffb9e64f9bde6d2ff1',
|
|
44
|
+
[ChainID.BSC]: '0x41E46ea2a85E49c28A0cE313B4F7a6AEC1AfD852' as EvmAddress,
|
|
45
|
+
[ChainID.MONAD]: '0x0000000000000000000000000000000000000000' as EvmAddress,
|
|
40
46
|
};
|
|
41
47
|
|
|
42
48
|
// Prod guard addresses
|
|
@@ -45,11 +51,13 @@ export const PROD_SINGLE_CHAIN_GUARD_ADDRESSES: Record<
|
|
|
45
51
|
SolanaAddress | EvmAddress
|
|
46
52
|
> = {
|
|
47
53
|
[ChainID.Arbitrum]: '0x0' as EvmAddress,
|
|
48
|
-
[ChainID.Optimism]: '
|
|
54
|
+
[ChainID.Optimism]: '0xdcbb658910b5192a43b79fd8244bdf27940d3b6b' as EvmAddress,
|
|
49
55
|
[ChainID.Base]: '0x449808a27f42518c57791d4c2c6626f0069a0ed9' as EvmAddress,
|
|
50
56
|
[ChainID.Hyperliquid]: '0x618ee9b6829261108d811b91581e00da192b0b75' as EvmAddress,
|
|
51
57
|
[ChainID.Solana]:
|
|
52
58
|
'CwWkajHjBCWMKZdwR5D1P5M6Fgf9dAyxqZ1qDZgZGo1e' as SolanaAddress<'CwWkajHjBCWMKZdwR5D1P5M6Fgf9dAyxqZ1qDZgZGo1e'>,
|
|
59
|
+
[ChainID.BSC]: '0xA69c47F93Ccc5BcCdc4b3c71646F61Fa5baa3323' as EvmAddress,
|
|
60
|
+
[ChainID.MONAD]: '0x8CBaa5Db68C1dC5485DbC8dd1f86b089614926E7' as EvmAddress,
|
|
53
61
|
};
|
|
54
62
|
|
|
55
63
|
// Test guard addresses
|
|
@@ -63,13 +71,29 @@ export const TEST_SINGLE_CHAIN_GUARD_ADDRESSES: Record<
|
|
|
63
71
|
[ChainID.Hyperliquid]: '0x6a2f41f905035fa89b7329c0661061b580b1eb92' as EvmAddress,
|
|
64
72
|
[ChainID.Solana]:
|
|
65
73
|
'4wi5wsgSs9q9WV55s9AvKWTdeMNPcDXhzcbx5SoRRFcg' as SolanaAddress<'4wi5wsgSs9q9WV55s9AvKWTdeMNPcDXhzcbx5SoRRFcg'>,
|
|
74
|
+
[ChainID.BSC]: '0xBc68262535d2a8D42bA80c9bbF5299DfbfEc0040' as EvmAddress,
|
|
75
|
+
[ChainID.MONAD]: '0x0000000000000000000000000000000000000000' as EvmAddress,
|
|
66
76
|
};
|
|
67
77
|
|
|
68
78
|
export const PROD_DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, EvmAddress> = {
|
|
69
79
|
[ChainID.Arbitrum]: '0x0000000000000000000000000000000000000000' as EvmAddress,
|
|
70
|
-
[ChainID.Optimism]: '
|
|
71
|
-
[ChainID.Base]: '
|
|
72
|
-
|
|
80
|
+
[ChainID.Optimism]: '0x1b754840f058b78e412156d2674b5954728cb86e' as EvmAddress,
|
|
81
|
+
[ChainID.Base]: '0x2df3ab1bb8b9d48769718003de2d8ca8e9d3c465' as EvmAddress,
|
|
82
|
+
// HyperEVM SingleChainGuardDca per the on-chain deployment + auctioneer config.
|
|
83
|
+
// (0x618ee9… is the SingleChainGuardLimit, which previously sat here by mistake.)
|
|
84
|
+
[ChainID.Hyperliquid]: '0xdcbb658910b5192a43b79fd8244bdf27940d3b6b' as EvmAddress,
|
|
85
|
+
[ChainID.BSC]: '0x11ef880e2e8d17c114b9eb87369ce3d1311c62e1' as EvmAddress,
|
|
86
|
+
[ChainID.MONAD]: '0x418302C3bef14D405A9B30381a9cb9d4d82EB2d4' as EvmAddress,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const PROD_DCA_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, EvmAddress> = {
|
|
90
|
+
[ChainID.Base]: '0x10fcdfdf20b4488f7da9036aa421ee51db6d436c' as EvmAddress,
|
|
91
|
+
[ChainID.Arbitrum]: '0xfd1bf54b0058240325cd865638444806146682b1' as EvmAddress,
|
|
92
|
+
[ChainID.BSC]: '0xaa704102bf25d4c87b0efc544c6008ed187ba011' as EvmAddress,
|
|
93
|
+
[ChainID.Hyperliquid]: '0xffef1e5af589e251d539576869d2a977846c85a2' as EvmAddress,
|
|
94
|
+
[ChainID.Optimism]: '0x386b310f137febfff79f72201dedef81501c1029' as EvmAddress,
|
|
95
|
+
[ChainID.MONAD]: '0x68D338b4a1499D93bcD2A9D3C921c8472cA4cE4e' as EvmAddress,
|
|
96
|
+
|
|
73
97
|
};
|
|
74
98
|
|
|
75
99
|
// Test guard addresses
|
|
@@ -78,6 +102,8 @@ export const TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, Ev
|
|
|
78
102
|
[ChainID.Optimism]: '0x0000000000000000000000000000000000000000' as EvmAddress,
|
|
79
103
|
[ChainID.Base]: '0x79fd6a458066396c8938823049b6e614ce6b71f2' as EvmAddress,
|
|
80
104
|
[ChainID.Hyperliquid]: '0x5156e6c7b7a1c60ed4d6b2175f88f1f6875c78d8' as EvmAddress,
|
|
105
|
+
[ChainID.BSC]: '0x25c283094f9EDA9F1455a1ecbEEf10c69311D962' as EvmAddress,
|
|
106
|
+
[ChainID.MONAD]: '0x0000000000000000000000000000000000000000' as EvmAddress,
|
|
81
107
|
};
|
|
82
108
|
|
|
83
109
|
export const CROSS_CHAIN_GUARD_ADDRESSES = useProdConfig
|
|
@@ -92,6 +118,10 @@ export const DCA_SINGLE_CHAIN_GUARD_ADDRESSES = useProdConfig
|
|
|
92
118
|
? PROD_DCA_SINGLE_CHAIN_GUARD_ADDRESSES
|
|
93
119
|
: TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES;
|
|
94
120
|
|
|
121
|
+
// No separate test deployment is configured for cross-chain DCA guards yet; prod values
|
|
122
|
+
// match the auctioneer's `cross_chain.guard_dca` config and are used in both modes.
|
|
123
|
+
export const DCA_CROSS_CHAIN_GUARD_ADDRESSES = PROD_DCA_CROSS_CHAIN_GUARD_ADDRESSES;
|
|
124
|
+
|
|
95
125
|
export const NATIVE_SOLANA_TOKEN_ADDRESS =
|
|
96
126
|
'So11111111111111111111111111111111111111111' as SolanaAddress<'So11111111111111111111111111111111111111111'>;
|
|
97
127
|
export const WRAPPED_SOL_MINT_ADDRESS =
|
|
@@ -111,7 +141,7 @@ export const SOLANA_USDC_MINT = {
|
|
|
111
141
|
|
|
112
142
|
export const SOLANA_MINT_TOKEN = SOLANA_USDC_MINT;
|
|
113
143
|
|
|
114
|
-
export const PROD_SUI_PACKAGE_ID = '0x2c9b6a7a018f2f02663a1b2247e7e53d0bf832b30ab9534c49699a78a2f659f2'// '0x9c0c9b7f5ddf7efbde76571783ef4a8a26b36ae5c2ef2eeba8fbc604a29cb195';
|
|
144
|
+
export const PROD_SUI_PACKAGE_ID = '0x2c9b6a7a018f2f02663a1b2247e7e53d0bf832b30ab9534c49699a78a2f659f2'; // '0x9c0c9b7f5ddf7efbde76571783ef4a8a26b36ae5c2ef2eeba8fbc604a29cb195';
|
|
115
145
|
export const TEST_SUI_PACKAGE_ID = '0x2c9b6a7a018f2f02663a1b2247e7e53d0bf832b30ab9534c49699a78a2f659f2';
|
|
116
146
|
export const SUI_PACKAGE_ID = useProdConfig ? PROD_SUI_PACKAGE_ID : TEST_SUI_PACKAGE_ID;
|
|
117
147
|
|
|
@@ -121,9 +151,15 @@ export const SUI_GUARD_COLLATERAL_TYPE =
|
|
|
121
151
|
export const SUI_GUARD_STABLECOIN_TYPE =
|
|
122
152
|
'0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC';
|
|
123
153
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
154
|
+
// `INTENTS_AUCTIONEER_URL` overrides the default endpoint (e.g. to target a locally
|
|
155
|
+
// running auctioneer) without touching the committed `useProdConfig` flag. Guarded so it
|
|
156
|
+
// is a no-op in browser bundles where `process` is undefined.
|
|
157
|
+
const auctioneerUrlOverride =
|
|
158
|
+
typeof process !== 'undefined' ? process.env?.INTENTS_AUCTIONEER_URL : undefined;
|
|
159
|
+
|
|
160
|
+
export const AUCTIONEER_URL =
|
|
161
|
+
auctioneerUrlOverride ||
|
|
162
|
+
(useProdConfig ? 'https://auctioneer-825534211396.us-central1.run.app' : 'http://127.0.0.1:8080');
|
|
127
163
|
|
|
128
164
|
export const MAX_UINT_32 = 2n ** 32n - 1n;
|
|
129
165
|
export const MAX_UINT_64 = 2n ** 64n - 1n;
|
|
@@ -140,6 +176,8 @@ export const WRAPPED_ETH_ADDRESSES: Record<SupportedEvmChain, EvmAddress> = {
|
|
|
140
176
|
[ChainID.Optimism]: '0x4200000000000000000000000000000000000006' as EvmAddress,
|
|
141
177
|
[ChainID.Base]: '0x4200000000000000000000000000000000000006' as EvmAddress,
|
|
142
178
|
[ChainID.Hyperliquid]: '0x5555555555555555555555555555555555555555' as EvmAddress,
|
|
179
|
+
[ChainID.BSC]: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c' as EvmAddress,
|
|
180
|
+
[ChainID.MONAD]: '0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A' as EvmAddress,
|
|
143
181
|
};
|
|
144
182
|
|
|
145
183
|
export const NATIVE_SUI_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI';
|
|
@@ -150,4 +188,20 @@ export function isNativeEvmToken(tokenAddress: string): boolean {
|
|
|
150
188
|
return NATIVE_EVM_ETH_ADDRESSES.some((addr) => addr.toLowerCase() === normalizedAddress);
|
|
151
189
|
}
|
|
152
190
|
|
|
153
|
-
export const
|
|
191
|
+
export const EVM_ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' as EvmAddress;
|
|
192
|
+
|
|
193
|
+
/** Placeholder signature (32 zero bytes) for unsigned/validate-only intent requests. */
|
|
194
|
+
export const EVM_ZERO_SIGNATURE = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Output-token addresses must be normalized to the zero address before signing the EIP-712
|
|
198
|
+
* witness: the auctioneer collapses any native sentinel (`0xeee…`/`0x0…`) to `Address::default()`
|
|
199
|
+
* when it reconstructs `requestedOutput`/`extraTransfers` to recover the signer. Signing the raw
|
|
200
|
+
* sentinel instead would yield a different hash → signature recovery fails. (`tokenIn` is NOT
|
|
201
|
+
* normalized on either side, so leave it untouched.)
|
|
202
|
+
*/
|
|
203
|
+
export function normalizeNativeEvmTokenForSigning(tokenAddress: string): string {
|
|
204
|
+
return isNativeEvmToken(tokenAddress) ? EVM_ZERO_ADDRESS : tokenAddress;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export const TOKEN_SEARCH_API_BASE_URL = 'https://shogun-token-search-api-825534211396.europe-west4.run.app';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type WalletClient,
|
|
13
13
|
} from 'viem';
|
|
14
14
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
15
|
-
import { arbitrum, base, optimism } from 'viem/chains';
|
|
15
|
+
import { arbitrum, base, optimism, bsc, } from 'viem/chains';
|
|
16
16
|
import { ChainID, type SupportedEvmChain } from '../../chains.js';
|
|
17
17
|
import type { EVMConfig } from '../../config.js';
|
|
18
18
|
import { ERC20ABI } from './abi/erc20.js';
|
|
@@ -20,12 +20,15 @@ import { SOURCE_CHAIN_GUARD_ABI } from './abi/source-chain-guard.js';
|
|
|
20
20
|
import { PERMIT2_ABI } from './abi/permit2.js';
|
|
21
21
|
import { SINGLE_CHAIN_GUARD_LIMIT_ABI } from './abi/single-chain-guard-limit.js';
|
|
22
22
|
import { hyperEVM } from './connectors/hyperevm.js';
|
|
23
|
+
import { monadMainnet } from './connectors/monad.js';
|
|
23
24
|
|
|
24
25
|
export const chainIdToProviderChainMap: Record<SupportedEvmChain, Chain> = {
|
|
25
26
|
[ChainID.Arbitrum]: arbitrum,
|
|
26
27
|
[ChainID.Optimism]: optimism,
|
|
27
28
|
[ChainID.Base]: base,
|
|
28
29
|
[ChainID.Hyperliquid]: hyperEVM,
|
|
30
|
+
[ChainID.BSC]: bsc,
|
|
31
|
+
[ChainID.MONAD]: monadMainnet,
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export class ChainProvider {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineChain } from 'viem';
|
|
2
|
+
|
|
3
|
+
export const monadMainnet = defineChain({
|
|
4
|
+
id: 143,
|
|
5
|
+
name: 'Monad Mainnet',
|
|
6
|
+
network: 'monad-mainnet',
|
|
7
|
+
nativeCurrency: {
|
|
8
|
+
name: 'Monad',
|
|
9
|
+
symbol: 'MON',
|
|
10
|
+
decimals: 18,
|
|
11
|
+
},
|
|
12
|
+
rpcUrls: {
|
|
13
|
+
default: {
|
|
14
|
+
http: ['https://rpc-mainnet.monadinfra.com', 'https://rpc4.monad.xyz', 'https://rpc3.monad.xyz', 'https://rpc1.monad.xyz'],
|
|
15
|
+
},
|
|
16
|
+
public: {
|
|
17
|
+
http: ['https://rpc-mainnet.monadinfra.com', 'https://rpc4.monad.xyz', 'https://rpc3.monad.xyz', 'https://rpc1.monad.xyz'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
blockExplorers: {
|
|
21
|
+
default: {
|
|
22
|
+
name: 'Monad Explorer',
|
|
23
|
+
url: 'https://monadscan.com',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
testnet: false,
|
|
27
|
+
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ethers, type TypedDataField, type AddressLike, type BigNumberish } from
|
|
2
|
-
import { SignatureTransfer } from
|
|
1
|
+
import { ethers, type TypedDataField, type AddressLike, type BigNumberish } from 'ethers';
|
|
2
|
+
import { SignatureTransfer } from '@uniswap/permit2-sdk';
|
|
3
3
|
|
|
4
4
|
export const OrderInfoType: Record<string, TypedDataField[]> = {
|
|
5
5
|
OrderInfo: [
|
|
6
|
-
{ name:
|
|
7
|
-
{ name:
|
|
8
|
-
{ name:
|
|
9
|
-
{ name:
|
|
10
|
-
{ name:
|
|
11
|
-
{ name:
|
|
12
|
-
{ name:
|
|
13
|
-
{ name:
|
|
6
|
+
{ name: 'user', type: 'address' },
|
|
7
|
+
{ name: 'tokenIn', type: 'address' },
|
|
8
|
+
{ name: 'srcChainId', type: 'uint32' },
|
|
9
|
+
{ name: 'deadline', type: 'uint32' },
|
|
10
|
+
{ name: 'amountIn', type: 'uint128' },
|
|
11
|
+
{ name: 'minStablecoinsAmount', type: 'uint128' },
|
|
12
|
+
{ name: 'executionDetailsHash', type: 'bytes32' },
|
|
13
|
+
{ name: 'nonce', type: 'uint256' },
|
|
14
14
|
],
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -33,7 +33,7 @@ export async function signCrossChainLimitOrder(
|
|
|
33
33
|
orderInfo: OrderInfoStruct,
|
|
34
34
|
chainId: number,
|
|
35
35
|
guardAddress: string,
|
|
36
|
-
permit2Address: string
|
|
36
|
+
permit2Address: string,
|
|
37
37
|
): Promise<{
|
|
38
38
|
domain: any;
|
|
39
39
|
types: any;
|
|
@@ -54,9 +54,9 @@ export async function signCrossChainLimitOrder(
|
|
|
54
54
|
chainId,
|
|
55
55
|
{
|
|
56
56
|
witness: orderInfo,
|
|
57
|
-
witnessTypeName:
|
|
57
|
+
witnessTypeName: 'OrderInfo',
|
|
58
58
|
witnessType: OrderInfoType,
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
60
|
);
|
|
61
61
|
|
|
62
62
|
return {
|
|
@@ -70,7 +70,7 @@ export async function signCrossChainLimitOrder(
|
|
|
70
70
|
verifyingContract: permitData.domain.verifyingContract,
|
|
71
71
|
},
|
|
72
72
|
permitData.types,
|
|
73
|
-
permitData.values
|
|
73
|
+
permitData.values,
|
|
74
74
|
),
|
|
75
75
|
};
|
|
76
76
|
}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
import type { Address, Hex, TypedDataDefinition } from 'viem';
|
|
1
2
|
import type { SupportedEvmChain } from '../../chains.js';
|
|
2
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
SingleChainUserIntentRequest,
|
|
5
|
+
CrossChainUserIntentRequest,
|
|
6
|
+
DcaSingleChainUserIntentRequest,
|
|
7
|
+
DcaCrossChainUserIntentRequest,
|
|
8
|
+
} from '../../types/intent.js';
|
|
3
9
|
import type { SingleChainOrder } from '../orders/single-chain.js';
|
|
4
10
|
import type { CrossChainOrder } from '../orders/cross-chain.js';
|
|
5
11
|
import type { DcaSingleChainOrder } from '../orders/dca-single-chain.js';
|
|
6
|
-
import type { ExtraTransfer } from '../orders/common.js';
|
|
7
|
-
import {
|
|
12
|
+
import type { ExtraTransfer, StopLossType } from '../orders/common.js';
|
|
13
|
+
import {
|
|
14
|
+
getEVMCrossChainOrderTypedData,
|
|
15
|
+
getEVMSingleChainOrderTypedData,
|
|
16
|
+
getEVMDcaSingleChainOrderTypedData,
|
|
17
|
+
} from './order-signature.js';
|
|
18
|
+
import {
|
|
19
|
+
CROSS_CHAIN_DCA_PERMIT2_TYPES,
|
|
20
|
+
PERMIT2_DOMAIN,
|
|
21
|
+
type CrossChainDcaPermitTransferFrom,
|
|
22
|
+
} from './permit2.js';
|
|
23
|
+
import { EVMIntentProvider } from './intent-provider.js';
|
|
24
|
+
import { DCA_CROSS_CHAIN_GUARD_ADDRESSES, EVM_ZERO_SIGNATURE } from '../../constants.js';
|
|
8
25
|
import { generateExecutionDetailsHash } from '../../utils/generate-execution-details-hash.js';
|
|
9
26
|
import { Parsers } from '../../utils/parsers.js';
|
|
10
27
|
|
|
@@ -20,8 +37,9 @@ export type CreateEvmSingleChainLimitOrderIntentParams = {
|
|
|
20
37
|
deadline: number;
|
|
21
38
|
nonce?: string;
|
|
22
39
|
signature?: string;
|
|
23
|
-
stopLossMaxOut?: bigint;
|
|
24
40
|
takeProfitMinOut?: bigint;
|
|
41
|
+
stopLossType?: StopLossType;
|
|
42
|
+
stopLossTriggerPrice?: string;
|
|
25
43
|
};
|
|
26
44
|
|
|
27
45
|
export type CreateEvmSingleChainDcaOrderIntentParams = {
|
|
@@ -55,8 +73,9 @@ export type CreateEvmCrossChainOrderIntentParams = {
|
|
|
55
73
|
extraTransfers?: ExtraTransfer[];
|
|
56
74
|
nonce?: string;
|
|
57
75
|
signature?: string;
|
|
58
|
-
stopLossMaxOut?: bigint;
|
|
59
76
|
takeProfitMinOut?: bigint;
|
|
77
|
+
stopLossType?: StopLossType;
|
|
78
|
+
stopLossTriggerPrice?: string;
|
|
60
79
|
};
|
|
61
80
|
|
|
62
81
|
/**
|
|
@@ -65,7 +84,7 @@ export type CreateEvmCrossChainOrderIntentParams = {
|
|
|
65
84
|
* @returns Formatted intent request ready to send to auctioneer
|
|
66
85
|
*/
|
|
67
86
|
export function createEvmSingleChainLimitOrderIntentRequest(
|
|
68
|
-
params: CreateEvmSingleChainLimitOrderIntentParams
|
|
87
|
+
params: CreateEvmSingleChainLimitOrderIntentParams,
|
|
69
88
|
): SingleChainUserIntentRequest {
|
|
70
89
|
const order: SingleChainOrder = {
|
|
71
90
|
user: params.user,
|
|
@@ -77,8 +96,9 @@ export function createEvmSingleChainLimitOrderIntentRequest(
|
|
|
77
96
|
destinationAddress: params.destinationAddress,
|
|
78
97
|
extraTransfers: params.extraTransfers,
|
|
79
98
|
deadline: params.deadline,
|
|
80
|
-
stopLossMaxOut: params.stopLossMaxOut,
|
|
81
99
|
takeProfitMinOut: params.takeProfitMinOut,
|
|
100
|
+
stopLossType: params.stopLossType,
|
|
101
|
+
stopLossTriggerPrice: params.stopLossTriggerPrice,
|
|
82
102
|
} as SingleChainOrder;
|
|
83
103
|
|
|
84
104
|
return {
|
|
@@ -86,7 +106,7 @@ export function createEvmSingleChainLimitOrderIntentRequest(
|
|
|
86
106
|
chainSpecificData: {
|
|
87
107
|
EVM: {
|
|
88
108
|
nonce: params.nonce || String(Math.floor(Math.random() * 10000000)),
|
|
89
|
-
signature: params.signature ||
|
|
109
|
+
signature: params.signature || EVM_ZERO_SIGNATURE,
|
|
90
110
|
},
|
|
91
111
|
},
|
|
92
112
|
};
|
|
@@ -98,7 +118,7 @@ export function createEvmSingleChainLimitOrderIntentRequest(
|
|
|
98
118
|
* @returns Formatted intent request ready to send to auctioneer
|
|
99
119
|
*/
|
|
100
120
|
export function createEvmSingleChainDcaOrderIntentRequest(
|
|
101
|
-
params: CreateEvmSingleChainDcaOrderIntentParams
|
|
121
|
+
params: CreateEvmSingleChainDcaOrderIntentParams,
|
|
102
122
|
): DcaSingleChainUserIntentRequest {
|
|
103
123
|
const order: DcaSingleChainOrder = {
|
|
104
124
|
user: params.user,
|
|
@@ -120,7 +140,7 @@ export function createEvmSingleChainDcaOrderIntentRequest(
|
|
|
120
140
|
chainSpecificData: {
|
|
121
141
|
EVM: {
|
|
122
142
|
nonce: params.nonce || String(Math.floor(Math.random() * 10000000)),
|
|
123
|
-
signature: params.signature ||
|
|
143
|
+
signature: params.signature || EVM_ZERO_SIGNATURE,
|
|
124
144
|
},
|
|
125
145
|
},
|
|
126
146
|
};
|
|
@@ -132,7 +152,7 @@ export function createEvmSingleChainDcaOrderIntentRequest(
|
|
|
132
152
|
* @returns Formatted intent request ready to send to auctioneer
|
|
133
153
|
*/
|
|
134
154
|
export function createEvmCrossChainOrderIntentRequest(
|
|
135
|
-
params: CreateEvmCrossChainOrderIntentParams
|
|
155
|
+
params: CreateEvmCrossChainOrderIntentParams,
|
|
136
156
|
): CrossChainUserIntentRequest {
|
|
137
157
|
const executionDetails = {
|
|
138
158
|
destChainId: params.destinationChainId,
|
|
@@ -140,15 +160,14 @@ export function createEvmCrossChainOrderIntentRequest(
|
|
|
140
160
|
amountOutMin: params.destinationTokenMinAmount?.toString() || '1',
|
|
141
161
|
destinationAddress: params.destinationAddress,
|
|
142
162
|
extraTransfers: params.extraTransfers,
|
|
143
|
-
stopLossMaxOut: params.stopLossMaxOut?.toString(),
|
|
144
163
|
takeProfitMinOut: params.takeProfitMinOut?.toString(),
|
|
164
|
+
stopLossType: params.stopLossType,
|
|
165
|
+
stopLossTriggerPrice: params.stopLossTriggerPrice,
|
|
145
166
|
};
|
|
146
167
|
const executionDetailsString = JSON.stringify(executionDetails, Parsers.bigIntReplacer);
|
|
147
168
|
|
|
148
|
-
//
|
|
149
|
-
const executionDetailsHash = generateExecutionDetailsHash(
|
|
150
|
-
executionDetails
|
|
151
|
-
);
|
|
169
|
+
// Hash the exact string we send; the auctioneer recomputes sha256 over it and rejects on mismatch
|
|
170
|
+
const executionDetailsHash = generateExecutionDetailsHash(executionDetailsString);
|
|
152
171
|
|
|
153
172
|
const genericData = {
|
|
154
173
|
user: params.user,
|
|
@@ -159,8 +178,6 @@ export function createEvmCrossChainOrderIntentRequest(
|
|
|
159
178
|
deadline: params.deadline,
|
|
160
179
|
executionDetailsHash: executionDetailsHash as `0x${string}`,
|
|
161
180
|
extraTransfers: params.extraTransfers,
|
|
162
|
-
stopLossMaxOut: params.stopLossMaxOut,
|
|
163
|
-
takeProfitMinOut: params.takeProfitMinOut,
|
|
164
181
|
};
|
|
165
182
|
|
|
166
183
|
return {
|
|
@@ -169,7 +186,7 @@ export function createEvmCrossChainOrderIntentRequest(
|
|
|
169
186
|
chainSpecificData: {
|
|
170
187
|
EVM: {
|
|
171
188
|
nonce: params.nonce || String(Math.floor(Math.random() * 10000000)),
|
|
172
|
-
signature: params.signature ||
|
|
189
|
+
signature: params.signature || EVM_ZERO_SIGNATURE,
|
|
173
190
|
},
|
|
174
191
|
},
|
|
175
192
|
};
|
|
@@ -209,3 +226,120 @@ export async function generateEvmCrossChainOrderTypedData(order: CrossChainOrder
|
|
|
209
226
|
export function generateEvmRandomNonce(): string {
|
|
210
227
|
return String(Math.floor(Math.random() * 10000000));
|
|
211
228
|
}
|
|
229
|
+
|
|
230
|
+
export type CreateEvmCrossChainDcaOrderIntentParams = {
|
|
231
|
+
user: `0x${string}`;
|
|
232
|
+
sourceChainId: SupportedEvmChain;
|
|
233
|
+
sourceTokenAddress: string;
|
|
234
|
+
destinationChainId: number;
|
|
235
|
+
destinationTokenAddress: string;
|
|
236
|
+
destinationTokenMinAmount?: bigint;
|
|
237
|
+
destinationAddress: string;
|
|
238
|
+
minStablecoinAmount?: bigint;
|
|
239
|
+
deadline: number;
|
|
240
|
+
startTime: number;
|
|
241
|
+
amountInPerInterval: bigint;
|
|
242
|
+
totalIntervals: number;
|
|
243
|
+
intervalDuration: number;
|
|
244
|
+
extraTransfers?: ExtraTransfer[];
|
|
245
|
+
nonce?: string;
|
|
246
|
+
signature?: string;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Builds the cross-chain DCA execution-details string and its SHA-256 hash.
|
|
251
|
+
* Both the wire payload and the EIP-712 witness must reference the SAME string/hash, so this
|
|
252
|
+
* is the single source of truth — the auctioneer recomputes sha256 over the string it receives.
|
|
253
|
+
*/
|
|
254
|
+
function buildCrossChainDcaExecutionDetails(params: CreateEvmCrossChainDcaOrderIntentParams): {
|
|
255
|
+
executionDetailsString: string;
|
|
256
|
+
executionDetailsHash: string;
|
|
257
|
+
} {
|
|
258
|
+
const executionDetails = {
|
|
259
|
+
destChainId: params.destinationChainId,
|
|
260
|
+
tokenOut: params.destinationTokenAddress,
|
|
261
|
+
amountOutMin: params.destinationTokenMinAmount?.toString() || '1',
|
|
262
|
+
destinationAddress: params.destinationAddress,
|
|
263
|
+
extraTransfers: params.extraTransfers,
|
|
264
|
+
};
|
|
265
|
+
const executionDetailsString = JSON.stringify(executionDetails, Parsers.bigIntReplacer);
|
|
266
|
+
return { executionDetailsString, executionDetailsHash: generateExecutionDetailsHash(executionDetailsString) };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Creates an EVM cross-chain DCA order intent request, ready to POST to
|
|
271
|
+
* `/user_intent/cross_chain/dca_order`. Pass `nonce`/`signature` from
|
|
272
|
+
* {@link getEVMCrossChainDcaOrderTypedData} for an executable order.
|
|
273
|
+
*/
|
|
274
|
+
export function createEvmCrossChainDcaOrderIntentRequest(
|
|
275
|
+
params: CreateEvmCrossChainDcaOrderIntentParams,
|
|
276
|
+
): DcaCrossChainUserIntentRequest {
|
|
277
|
+
const { executionDetailsString, executionDetailsHash } = buildCrossChainDcaExecutionDetails(params);
|
|
278
|
+
|
|
279
|
+
return {
|
|
280
|
+
genericData: {
|
|
281
|
+
user: params.user,
|
|
282
|
+
srcChainId: params.sourceChainId,
|
|
283
|
+
tokenIn: params.sourceTokenAddress,
|
|
284
|
+
minStablecoinsAmount: params.minStablecoinAmount || 1n,
|
|
285
|
+
deadline: params.deadline,
|
|
286
|
+
executionDetailsHash: executionDetailsHash as `0x${string}`,
|
|
287
|
+
startTime: params.startTime,
|
|
288
|
+
amountInPerInterval: params.amountInPerInterval,
|
|
289
|
+
totalIntervals: params.totalIntervals,
|
|
290
|
+
intervalDuration: params.intervalDuration,
|
|
291
|
+
},
|
|
292
|
+
executionDetails: executionDetailsString,
|
|
293
|
+
chainSpecificData: {
|
|
294
|
+
EVM: {
|
|
295
|
+
nonce: params.nonce || generateEvmRandomNonce(),
|
|
296
|
+
signature: params.signature || EVM_ZERO_SIGNATURE,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Generates the EIP-712 typed data (and nonce) for a cross-chain DCA order's Permit2 witness.
|
|
304
|
+
* Sign `orderTypedData`, then pass the resulting `nonce`/`signature` into
|
|
305
|
+
* {@link createEvmCrossChainDcaOrderIntentRequest} — both share the same execution-details hash.
|
|
306
|
+
*/
|
|
307
|
+
export function getEVMCrossChainDcaOrderTypedData(
|
|
308
|
+
params: CreateEvmCrossChainDcaOrderIntentParams,
|
|
309
|
+
providedNonce?: bigint,
|
|
310
|
+
): { orderTypedData: TypedDataDefinition; nonce: bigint } {
|
|
311
|
+
const { executionDetailsHash } = buildCrossChainDcaExecutionDetails(params);
|
|
312
|
+
const nonce = providedNonce ?? EVMIntentProvider.getRandomNonce();
|
|
313
|
+
const totalAmountIn = params.amountInPerInterval * BigInt(params.totalIntervals);
|
|
314
|
+
const spender = DCA_CROSS_CHAIN_GUARD_ADDRESSES[params.sourceChainId] as Address;
|
|
315
|
+
|
|
316
|
+
const message: CrossChainDcaPermitTransferFrom = {
|
|
317
|
+
permitted: { token: params.sourceTokenAddress as Address, amount: totalAmountIn },
|
|
318
|
+
spender,
|
|
319
|
+
nonce,
|
|
320
|
+
deadline: BigInt(params.deadline),
|
|
321
|
+
witness: {
|
|
322
|
+
user: params.user as Address,
|
|
323
|
+
tokenIn: params.sourceTokenAddress as Address,
|
|
324
|
+
srcChainId: params.sourceChainId,
|
|
325
|
+
startTime: params.startTime,
|
|
326
|
+
deadline: params.deadline,
|
|
327
|
+
totalIntervals: params.totalIntervals,
|
|
328
|
+
intervalDuration: params.intervalDuration,
|
|
329
|
+
amountInPerInterval: params.amountInPerInterval,
|
|
330
|
+
minStablecoinsAmountPerInterval: params.minStablecoinAmount || 1n,
|
|
331
|
+
executionDetailsHash: executionDetailsHash as Hex,
|
|
332
|
+
nonce,
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
return {
|
|
337
|
+
orderTypedData: {
|
|
338
|
+
domain: PERMIT2_DOMAIN(params.sourceChainId),
|
|
339
|
+
types: CROSS_CHAIN_DCA_PERMIT2_TYPES,
|
|
340
|
+
primaryType: 'PermitWitnessTransferFrom',
|
|
341
|
+
message,
|
|
342
|
+
},
|
|
343
|
+
nonce,
|
|
344
|
+
};
|
|
345
|
+
}
|