@shogun-sdk/intents-sdk 1.2.31 → 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 +76 -25
- 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 +44 -30
- package/src/auth/siwe.ts +8 -3
- package/src/chains.ts +6 -0
- package/src/constants.ts +71 -15
- 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 +162 -21
- 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 -18
- 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 +38 -27
- 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 -29
- package/src/core/sui/intent-helpers.ts +39 -41
- 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 +22 -9
- package/src/types/api.ts +22 -2
- package/src/types/intent.ts +42 -5
- package/src/types/token-list.ts +35 -0
- package/src/utils/base-validator.ts +0 -4
- package/src/utils/defillama.ts +2 -0
- package/src/utils/generate-execution-details-hash.ts +13 -0
- package/src/utils/quote/address.ts +4 -0
- package/src/utils/quote/aggregator.ts +326 -76
- 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 +506 -0
- 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/src/utils/tokens/index.ts +38 -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 -106
- 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 -130
- 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 -319
- 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/cross-chain-limit-order.js +0 -18
- package/dist/esm/core/solana/cross-chain-limit-order.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 -177
- 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 -26
- package/dist/esm/core/sui/cross-chain-limit-order.js.map +0 -1
- package/dist/esm/core/sui/intent-helpers.js +0 -136
- 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 -38
- 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/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/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 -254
- 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/stablecoins-tokens.js +0 -13
- package/dist/esm/utils/quote/stablecoins-tokens.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 -43
- 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 -125
- 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/cross-chain-limit-order.d.ts +0 -9
- package/dist/types/core/solana/cross-chain-limit-order.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 -14
- package/dist/types/core/sui/cross-chain-limit-order.d.ts.map +0 -1
- package/dist/types/core/sui/intent-helpers.d.ts +0 -89
- 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 -42
- 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/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/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 -64
- 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/stablecoins-tokens.d.ts +0 -11
- package/dist/types/utils/quote/stablecoins-tokens.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/src/core/solana/cross-chain-limit-order.ts +0 -24
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1654 @@
|
|
|
1
|
+
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
import { Address, ReadonlyUint8Array, Instruction } from '@solana/kit';
|
|
3
|
+
import * as _mysten_sui_transactions from '@mysten/sui/transactions';
|
|
4
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
5
|
+
import * as viem from 'viem';
|
|
6
|
+
import { Address as Address$1, TypedDataDefinition, Hex } from 'viem';
|
|
7
|
+
import { SuiClient } from '@mysten/sui/client';
|
|
8
|
+
import { AddressLike, BigNumberish, ethers, BytesLike } from 'ethers';
|
|
9
|
+
import { QuoteResponse as QuoteResponse$1 } from '@jup-ag/api';
|
|
10
|
+
import { OptimalRate } from '@paraswap/sdk';
|
|
11
|
+
import { RouterCompleteTradeRoute } from 'aftermath-ts-sdk';
|
|
12
|
+
import * as bn_js from 'bn.js';
|
|
13
|
+
import { PublicKey } from '@solana/web3.js';
|
|
14
|
+
|
|
15
|
+
type TupleToUnion<ArrayType> = ArrayType extends readonly unknown[] ? ArrayType[number] : never;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Represents the blockchain platform type
|
|
19
|
+
* Used to distinguish between different blockchain ecosystems
|
|
20
|
+
*/
|
|
21
|
+
declare enum ChainType {
|
|
22
|
+
EVM = "EVM",
|
|
23
|
+
Solana = "Solana",
|
|
24
|
+
Sui = "Sui"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Enum of chain IDs for supported blockchains
|
|
28
|
+
* EVM chains use their standard chain IDs
|
|
29
|
+
* Non-EVM chains use custom assigned IDs
|
|
30
|
+
*/
|
|
31
|
+
declare enum ChainID {
|
|
32
|
+
Arbitrum = 42161,
|
|
33
|
+
Optimism = 10,
|
|
34
|
+
Base = 8453,
|
|
35
|
+
Hyperliquid = 999,
|
|
36
|
+
Solana = 7565164,
|
|
37
|
+
Sui = 101,
|
|
38
|
+
BSC = 56,
|
|
39
|
+
MONAD = 143
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Array of chain IDs that are supported by the SDK
|
|
43
|
+
* Used as a source of truth for type generation
|
|
44
|
+
*/
|
|
45
|
+
declare const SupportedChains: readonly [ChainID.Arbitrum, ChainID.Base, ChainID.Optimism, ChainID.Hyperliquid, ChainID.Solana, ChainID.Sui, ChainID.BSC, ChainID.MONAD];
|
|
46
|
+
/**
|
|
47
|
+
* Type utility to identify chains not in the SupportedChains array
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
type UnsupportedChain = Exclude<ChainID, TupleToUnion<typeof SupportedChains>>;
|
|
51
|
+
/**
|
|
52
|
+
* Type representing chains that are supported by the SDK
|
|
53
|
+
* Derived from the SupportedChains array
|
|
54
|
+
*/
|
|
55
|
+
type SupportedChain = Exclude<ChainID, UnsupportedChain>;
|
|
56
|
+
type SupportedSolanaChain = 7565164;
|
|
57
|
+
type SupportedSuiChain = 101;
|
|
58
|
+
type SupportedEvmChain = Exclude<ChainID, SupportedSolanaChain | SupportedSuiChain>;
|
|
59
|
+
declare function isEvmChain(chainId: ChainID): chainId is SupportedEvmChain;
|
|
60
|
+
/**
|
|
61
|
+
* Type guard that checks if a chain ID is among the supported chains
|
|
62
|
+
* @param chain - The chain ID to check
|
|
63
|
+
* @returns Boolean indicating if the chain is supported
|
|
64
|
+
*/
|
|
65
|
+
declare const isSupportedChain: (chain: unknown) => chain is SupportedChain;
|
|
66
|
+
/**
|
|
67
|
+
* Maps chain IDs to their corresponding chain types
|
|
68
|
+
* Used to determine which SDK implementation to use for a given chain
|
|
69
|
+
*/
|
|
70
|
+
declare const chainIdToChainTypeMap: {
|
|
71
|
+
readonly 42161: ChainType.EVM;
|
|
72
|
+
readonly 8453: ChainType.EVM;
|
|
73
|
+
readonly 10: ChainType.EVM;
|
|
74
|
+
readonly 999: ChainType.EVM;
|
|
75
|
+
readonly 7565164: ChainType.Solana;
|
|
76
|
+
readonly 101: ChainType.Sui;
|
|
77
|
+
readonly 56: ChainType.EVM;
|
|
78
|
+
readonly 143: ChainType.EVM;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare enum IntentsOrderType {
|
|
82
|
+
CROSS_CHAIN_LIMIT = "CROSS_CHAIN_LIMIT",
|
|
83
|
+
SINGLE_CHAIN_LIMIT = "SINGLE_CHAIN_LIMIT"
|
|
84
|
+
}
|
|
85
|
+
declare const PERMIT2_ADDRESS: Record<SupportedEvmChain, Address$1>;
|
|
86
|
+
declare const PROD_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, Address | Address$1>;
|
|
87
|
+
declare const TEST_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, Address | Address$1>;
|
|
88
|
+
declare const PROD_SINGLE_CHAIN_GUARD_ADDRESSES: Record<Exclude<ChainID, SupportedSuiChain>, Address | Address$1>;
|
|
89
|
+
declare const TEST_SINGLE_CHAIN_GUARD_ADDRESSES: Record<Exclude<ChainID, SupportedSuiChain>, Address | Address$1>;
|
|
90
|
+
declare const PROD_DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, Address$1>;
|
|
91
|
+
declare const PROD_DCA_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, Address$1>;
|
|
92
|
+
declare const TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, Address$1>;
|
|
93
|
+
declare const CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, `0x${string}` | Address>;
|
|
94
|
+
declare const SINGLE_CHAIN_GUARD_ADDRESSES: Record<ChainID.Arbitrum | ChainID.Optimism | ChainID.Base | ChainID.Hyperliquid | ChainID.Solana | ChainID.BSC | ChainID.MONAD, `0x${string}` | Address>;
|
|
95
|
+
declare const DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, `0x${string}`>;
|
|
96
|
+
declare const DCA_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, `0x${string}`>;
|
|
97
|
+
declare const NATIVE_SOLANA_TOKEN_ADDRESS: Address<"So11111111111111111111111111111111111111111">;
|
|
98
|
+
declare const WRAPPED_SOL_MINT_ADDRESS: Address<"So11111111111111111111111111111111111111112">;
|
|
99
|
+
type SolanaMint = {
|
|
100
|
+
name: string;
|
|
101
|
+
mint: string;
|
|
102
|
+
decimals: number;
|
|
103
|
+
};
|
|
104
|
+
declare const SOLANA_USDC_MINT: SolanaMint;
|
|
105
|
+
declare const SOLANA_MINT_TOKEN: SolanaMint;
|
|
106
|
+
declare const PROD_SUI_PACKAGE_ID = "0x2c9b6a7a018f2f02663a1b2247e7e53d0bf832b30ab9534c49699a78a2f659f2";
|
|
107
|
+
declare const TEST_SUI_PACKAGE_ID = "0x2c9b6a7a018f2f02663a1b2247e7e53d0bf832b30ab9534c49699a78a2f659f2";
|
|
108
|
+
declare const SUI_PACKAGE_ID = "0x2c9b6a7a018f2f02663a1b2247e7e53d0bf832b30ab9534c49699a78a2f659f2";
|
|
109
|
+
declare const SUI_GUARD_COLLATERAL_TYPE = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
110
|
+
declare const SUI_GUARD_STABLECOIN_TYPE = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
111
|
+
declare const AUCTIONEER_URL: string;
|
|
112
|
+
declare const MAX_UINT_32: bigint;
|
|
113
|
+
declare const MAX_UINT_64: bigint;
|
|
114
|
+
declare const MAX_UINT_128: bigint;
|
|
115
|
+
declare const MAX_UINT_256: bigint;
|
|
116
|
+
declare const NATIVE_EVM_ETH_ADDRESSES: string[];
|
|
117
|
+
declare const WRAPPED_ETH_ADDRESSES: Record<SupportedEvmChain, Address$1>;
|
|
118
|
+
declare const NATIVE_SUI_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
119
|
+
declare function isNativeEvmToken(tokenAddress: string): boolean;
|
|
120
|
+
declare const EVM_ZERO_ADDRESS: Address$1;
|
|
121
|
+
/** Placeholder signature (32 zero bytes) for unsigned/validate-only intent requests. */
|
|
122
|
+
declare const EVM_ZERO_SIGNATURE = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
123
|
+
/**
|
|
124
|
+
* Output-token addresses must be normalized to the zero address before signing the EIP-712
|
|
125
|
+
* witness: the auctioneer collapses any native sentinel (`0xeee…`/`0x0…`) to `Address::default()`
|
|
126
|
+
* when it reconstructs `requestedOutput`/`extraTransfers` to recover the signer. Signing the raw
|
|
127
|
+
* sentinel instead would yield a different hash → signature recovery fails. (`tokenIn` is NOT
|
|
128
|
+
* normalized on either side, so leave it untouched.)
|
|
129
|
+
*/
|
|
130
|
+
declare function normalizeNativeEvmTokenForSigning(tokenAddress: string): string;
|
|
131
|
+
declare const TOKEN_SEARCH_API_BASE_URL = "https://shogun-token-search-api-825534211396.europe-west4.run.app";
|
|
132
|
+
|
|
133
|
+
type StopLossType = 'FIXED' | 'TRAILING_ABSOLUTE' | 'TRAILING_PERCENT';
|
|
134
|
+
type ExtraTransfer$1 = {
|
|
135
|
+
/** Token address */
|
|
136
|
+
token: string;
|
|
137
|
+
/** Receiver address */
|
|
138
|
+
receiver: string;
|
|
139
|
+
/** Amount of tokens to transfer */
|
|
140
|
+
amount: bigint;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
type ChainOrderStatus = 'Auction' | 'NoBids' | 'Executing' | 'Fulfilled' | 'Cancelled' | 'Outdated' | 'DcaIntervalFulfilled';
|
|
144
|
+
type ApiCrossChainOrder = {
|
|
145
|
+
orderId: string;
|
|
146
|
+
user: string;
|
|
147
|
+
srcChainId: number;
|
|
148
|
+
tokenIn: string;
|
|
149
|
+
minStablecoinsAmount: string;
|
|
150
|
+
destChainId: number;
|
|
151
|
+
tokenOut: string;
|
|
152
|
+
amountOutMin: string;
|
|
153
|
+
destinationAddress: string;
|
|
154
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
155
|
+
deadline: number;
|
|
156
|
+
executionDetailsHash: string;
|
|
157
|
+
amountIn: string;
|
|
158
|
+
executionDetails: string;
|
|
159
|
+
orderCreationTime: number;
|
|
160
|
+
orderStatus: ChainOrderStatus;
|
|
161
|
+
tokensInWereSwappedToStablecoins: boolean;
|
|
162
|
+
lockedStablecoins: string;
|
|
163
|
+
nonce?: string;
|
|
164
|
+
orderFulfillmentTimestamp?: number;
|
|
165
|
+
transactionHash?: string;
|
|
166
|
+
amountOut?: string;
|
|
167
|
+
};
|
|
168
|
+
type ApiSingleChainOrder = {
|
|
169
|
+
orderId: string;
|
|
170
|
+
user: string;
|
|
171
|
+
chainId: number;
|
|
172
|
+
tokenIn: string;
|
|
173
|
+
tokenOut: string;
|
|
174
|
+
amountOutMin: string;
|
|
175
|
+
destinationAddress: string;
|
|
176
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
177
|
+
deadline: number;
|
|
178
|
+
amountIn: string;
|
|
179
|
+
orderCreationTime: number;
|
|
180
|
+
orderStatus: ChainOrderStatus;
|
|
181
|
+
nonce?: string;
|
|
182
|
+
orderFulfillmentTimestamp?: number;
|
|
183
|
+
transactionHash?: string;
|
|
184
|
+
amountOut?: string;
|
|
185
|
+
};
|
|
186
|
+
type ApiUserOrders = {
|
|
187
|
+
singleChainLimitOrders: ApiSingleChainOrder[];
|
|
188
|
+
crossChainLimitOrders: ApiCrossChainOrder[];
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Represents the response from an Intent API endpoint.
|
|
192
|
+
*/
|
|
193
|
+
interface ApiIntentResponse {
|
|
194
|
+
/** Unique identifier for the created intent */
|
|
195
|
+
intentId: string;
|
|
196
|
+
/**
|
|
197
|
+
* JWT token used for authorization or subsequent requests.
|
|
198
|
+
* Optional: order-creation responses only return `intentId`; obtain a JWT via the
|
|
199
|
+
* SIWE flow (`EVMSDK.authenticate()` / `fetchJWTToken`) instead.
|
|
200
|
+
*/
|
|
201
|
+
jwt?: string;
|
|
202
|
+
}
|
|
203
|
+
type ValidResponseData = ApiUserOrders | string | ApiIntentResponse | null;
|
|
204
|
+
type ApiResponse<T extends ValidResponseData = ValidResponseData> = {
|
|
205
|
+
success: boolean;
|
|
206
|
+
code: number;
|
|
207
|
+
data?: T;
|
|
208
|
+
error?: unknown;
|
|
209
|
+
extra_error_data?: unknown;
|
|
210
|
+
};
|
|
211
|
+
declare function isSuccessApiResponse<T extends ValidResponseData>(response: ApiResponse<T>): response is ApiResponse<T> & {
|
|
212
|
+
success: true;
|
|
213
|
+
data: T;
|
|
214
|
+
};
|
|
215
|
+
declare function isErrorApiResponse<T extends ValidResponseData>(response: ApiResponse<T>): response is ApiResponse<T> & {
|
|
216
|
+
success: false;
|
|
217
|
+
error: unknown;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
type CreateSingleChainOrderParams = {
|
|
221
|
+
chainId: SupportedChain;
|
|
222
|
+
amountIn: bigint;
|
|
223
|
+
tokenIn: string;
|
|
224
|
+
tokenOut: string;
|
|
225
|
+
amountOutMin?: bigint;
|
|
226
|
+
destinationAddress: string;
|
|
227
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
228
|
+
deadline: number;
|
|
229
|
+
stopLossType?: StopLossType;
|
|
230
|
+
stopLossTriggerPrice?: string;
|
|
231
|
+
takeProfitMinOut?: bigint;
|
|
232
|
+
};
|
|
233
|
+
declare class SingleChainOrder {
|
|
234
|
+
user: string;
|
|
235
|
+
chainId: SupportedChain;
|
|
236
|
+
amountIn: bigint;
|
|
237
|
+
tokenIn: string;
|
|
238
|
+
tokenOut: string;
|
|
239
|
+
amountOutMin: bigint;
|
|
240
|
+
destinationAddress: string;
|
|
241
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
242
|
+
deadline: number;
|
|
243
|
+
stopLossType?: StopLossType;
|
|
244
|
+
stopLossTriggerPrice?: string;
|
|
245
|
+
takeProfitMinOut?: bigint;
|
|
246
|
+
private constructor();
|
|
247
|
+
static create(input: CreateSingleChainOrderParams & {
|
|
248
|
+
user: string;
|
|
249
|
+
}): Promise<SingleChainOrder>;
|
|
250
|
+
private getRandomPreparedData;
|
|
251
|
+
private static calculateAmountOutMin;
|
|
252
|
+
private static getSingleChainOrderScenario;
|
|
253
|
+
toIntentRequest(preparedData: SingleChainPreparedData): SingleChainUserIntentRequest;
|
|
254
|
+
sendToAuctioneer(preparedData: SingleChainPreparedData): Promise<ApiResponse>;
|
|
255
|
+
toEVMTypedData(): Promise<{
|
|
256
|
+
orderTypedData: viem.TypedDataDefinition;
|
|
257
|
+
nonce: bigint;
|
|
258
|
+
}>;
|
|
259
|
+
toSolanaInstructionsByteArray(): Promise<SolanaOrderInstructionResult & {
|
|
260
|
+
secretNumber: string;
|
|
261
|
+
}>;
|
|
262
|
+
toSuiTransaction(secretHash: Uint8Array, guardAddress: string, client?: any): Promise<_mysten_sui_transactions.Transaction>;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Details required to execute the order on the destination chain
|
|
267
|
+
* Contains all information needed for the cross-chain fulfillment
|
|
268
|
+
*/
|
|
269
|
+
type ExecutionDetails = {
|
|
270
|
+
/** Chain ID where tokens will be received */
|
|
271
|
+
destChainId: SupportedChain;
|
|
272
|
+
/** Token address on the destination chain to receive */
|
|
273
|
+
tokenOut: string;
|
|
274
|
+
/** Minimum amount of destination tokens to receive, in smallest units */
|
|
275
|
+
amountOutMin: bigint;
|
|
276
|
+
/** Recipient wallet address on the destination chain */
|
|
277
|
+
destinationAddress: string;
|
|
278
|
+
/** Extra transfers to be made */
|
|
279
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
280
|
+
/** Stop loss type, must match the auctioneer's `stopLossType` field */
|
|
281
|
+
stopLossType?: StopLossType;
|
|
282
|
+
/** Initial trigger price (tokenIn/tokenOut) that arms the stop loss */
|
|
283
|
+
stopLossTriggerPrice?: string;
|
|
284
|
+
/** Take profit minimum amount out */
|
|
285
|
+
takeProfitMinOut?: bigint;
|
|
286
|
+
};
|
|
287
|
+
type Hash = `0x${string}`;
|
|
288
|
+
/** Hash of execution details, used to verify order integrity across chains */
|
|
289
|
+
type ExecutionDetailsHash = Hash;
|
|
290
|
+
type EvmPreparedData = {
|
|
291
|
+
/** Random nonce for Permit2 signature, prevents replay attacks */
|
|
292
|
+
nonce: string;
|
|
293
|
+
/** EIP-712 signature authorizing the order */
|
|
294
|
+
signature: string | Hash;
|
|
295
|
+
};
|
|
296
|
+
type SuiPreparedData = {
|
|
297
|
+
/** Transaction hash of the successful order creation transaction */
|
|
298
|
+
transactionHash: string;
|
|
299
|
+
/** Secret number for single-chain orders (optional for cross-chain) */
|
|
300
|
+
secretNumber?: string;
|
|
301
|
+
};
|
|
302
|
+
type SolanaPreparedData = {
|
|
303
|
+
/** Public key of the created order account on Solana */
|
|
304
|
+
orderPubkey: string;
|
|
305
|
+
/** Secret number for single-chain orders (optional for cross-chain) */
|
|
306
|
+
secretNumber?: string;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Source chain data sent to the auctioneer
|
|
310
|
+
* Contains all information needed to start the cross-chain swap from the source chain
|
|
311
|
+
*/
|
|
312
|
+
type SourceChainData = {
|
|
313
|
+
/** User's wallet address that initiated the order */
|
|
314
|
+
user: string;
|
|
315
|
+
/** Source chain ID where tokens will be sent from */
|
|
316
|
+
srcChainId: SupportedChain;
|
|
317
|
+
/** Token address on the source chain to be swapped */
|
|
318
|
+
tokenIn: string;
|
|
319
|
+
/** Amount of source tokens to swap, in smallest units */
|
|
320
|
+
amountIn: bigint;
|
|
321
|
+
/** Minimum amount of stablecoins in the intermediate swap, in smallest units */
|
|
322
|
+
minStablecoinsAmount: bigint;
|
|
323
|
+
/** Timestamp (in seconds) after which the order expires */
|
|
324
|
+
deadline: number;
|
|
325
|
+
/** Hash of execution details for cross-chain verification */
|
|
326
|
+
executionDetailsHash: ExecutionDetailsHash;
|
|
327
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
328
|
+
};
|
|
329
|
+
type CrossChainUserIntentRequest = {
|
|
330
|
+
/** Generic data common to all chains */
|
|
331
|
+
genericData: SourceChainData;
|
|
332
|
+
/** JSON-stringified execution details for the destination chain */
|
|
333
|
+
executionDetails: string;
|
|
334
|
+
/** Chain-specific data including signatures and transaction details */
|
|
335
|
+
chainSpecificData: {
|
|
336
|
+
/** EVM-specific data (for Ethereum, Arbitrum, Optimism, Base) */
|
|
337
|
+
EVM?: EvmPreparedData;
|
|
338
|
+
/** Solana-specific data */
|
|
339
|
+
Solana?: SolanaPreparedData;
|
|
340
|
+
/** Sui-specific data */
|
|
341
|
+
Sui?: SuiPreparedData;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
type SingleChainUserIntentRequest = {
|
|
345
|
+
genericData: SingleChainOrder;
|
|
346
|
+
chainSpecificData: {
|
|
347
|
+
EVM?: EvmPreparedData;
|
|
348
|
+
Solana?: SolanaPreparedData;
|
|
349
|
+
Sui?: SuiPreparedData;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Source chain data for a cross-chain DCA order. Mirrors the auctioneer's
|
|
354
|
+
* `CrossChainDcaOrderGenericRequestData` (common cross-chain fields + flattened
|
|
355
|
+
* `CommonDcaOrderData`). The destination fields live in `executionDetails`.
|
|
356
|
+
*/
|
|
357
|
+
type DcaCrossChainSourceChainData = {
|
|
358
|
+
user: string;
|
|
359
|
+
srcChainId: SupportedChain;
|
|
360
|
+
tokenIn: string;
|
|
361
|
+
minStablecoinsAmount: bigint;
|
|
362
|
+
deadline: number;
|
|
363
|
+
executionDetailsHash: ExecutionDetailsHash;
|
|
364
|
+
/** Flattened CommonDcaOrderData */
|
|
365
|
+
startTime: number;
|
|
366
|
+
amountInPerInterval: bigint;
|
|
367
|
+
totalIntervals: number;
|
|
368
|
+
intervalDuration: number;
|
|
369
|
+
};
|
|
370
|
+
type DcaCrossChainUserIntentRequest = {
|
|
371
|
+
genericData: DcaCrossChainSourceChainData;
|
|
372
|
+
/** JSON-stringified execution details for the destination chain */
|
|
373
|
+
executionDetails: string;
|
|
374
|
+
chainSpecificData: {
|
|
375
|
+
EVM?: DcaSingleChainEVMPreparedData;
|
|
376
|
+
Solana?: DcaSingleChainSolanaPreparedData;
|
|
377
|
+
Sui?: DcaSingleChainSuiPreparedData;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
type ChainPreparedData = EvmPreparedData | SuiPreparedData | SolanaPreparedData;
|
|
381
|
+
type CrossChainOrderPrepared = {
|
|
382
|
+
order: CrossChainOrder;
|
|
383
|
+
preparedData: ChainPreparedData;
|
|
384
|
+
};
|
|
385
|
+
type SingleChainEVMPreparedData = {
|
|
386
|
+
nonce: string;
|
|
387
|
+
signature: string | Hash;
|
|
388
|
+
};
|
|
389
|
+
type SingleChainSolanaPreparedData = {
|
|
390
|
+
secretNumber: string;
|
|
391
|
+
orderPubkey: string;
|
|
392
|
+
};
|
|
393
|
+
type SingleChainSuiPreparedData = {
|
|
394
|
+
transactionHash: string;
|
|
395
|
+
secretNumber: string;
|
|
396
|
+
};
|
|
397
|
+
type SingleChainPreparedData = SingleChainEVMPreparedData | SingleChainSolanaPreparedData | SingleChainSuiPreparedData;
|
|
398
|
+
type SingleChainOrderPrepared = {
|
|
399
|
+
order: SingleChainOrder;
|
|
400
|
+
preparedData: SingleChainPreparedData;
|
|
401
|
+
};
|
|
402
|
+
type DcaSingleChainSuiPreparedData = {
|
|
403
|
+
transactionHash: string;
|
|
404
|
+
secretNumber: string;
|
|
405
|
+
};
|
|
406
|
+
type DcaSingleChainUserIntentRequest = {
|
|
407
|
+
genericData: DcaSingleChainOrder;
|
|
408
|
+
chainSpecificData: {
|
|
409
|
+
EVM?: DcaSingleChainEVMPreparedData;
|
|
410
|
+
Solana?: DcaSingleChainSolanaPreparedData;
|
|
411
|
+
Sui?: DcaSingleChainSuiPreparedData;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
type DcaSingleChainEVMPreparedData = {
|
|
415
|
+
nonce: string;
|
|
416
|
+
signature: string | Hash;
|
|
417
|
+
};
|
|
418
|
+
type DcaSingleChainSolanaPreparedData = {
|
|
419
|
+
secretNumber: string;
|
|
420
|
+
orderPubkey: string;
|
|
421
|
+
};
|
|
422
|
+
type DcaSingleChainPreparedData = DcaSingleChainEVMPreparedData | DcaSingleChainSolanaPreparedData | DcaSingleChainSuiPreparedData;
|
|
423
|
+
type DcaSingleChainOrderPrepared = {
|
|
424
|
+
order: DcaSingleChainOrder;
|
|
425
|
+
preparedData: DcaSingleChainPreparedData;
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
type CreateCrossChainOrderParams = {
|
|
429
|
+
/** Source chain ID where tokens will be sent from */
|
|
430
|
+
sourceChainId: SupportedChain;
|
|
431
|
+
/** Token address on the source chain to be swapped */
|
|
432
|
+
sourceTokenAddress: string;
|
|
433
|
+
/** Amount of source tokens to swap with decimals */
|
|
434
|
+
sourceTokenAmount: bigint;
|
|
435
|
+
/** Destination chain ID where tokens will be received */
|
|
436
|
+
destinationChainId: SupportedChain;
|
|
437
|
+
/** Token address on the destination chain to receive */
|
|
438
|
+
destinationTokenAddress: string;
|
|
439
|
+
/** Minimum amount of destination tokens to receive */
|
|
440
|
+
destinationTokenMinAmount?: bigint;
|
|
441
|
+
/** Recipient wallet address on the destination chain */
|
|
442
|
+
destinationAddress: string;
|
|
443
|
+
/** Minimum amount of stablecoins in the intermediate swap */
|
|
444
|
+
minStablecoinAmount?: bigint;
|
|
445
|
+
/** Timestamp (in seconds) after which the order expires */
|
|
446
|
+
deadline: number;
|
|
447
|
+
/** Extra transfers to be made */
|
|
448
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
449
|
+
/** Stop loss */
|
|
450
|
+
stopLossType?: StopLossType;
|
|
451
|
+
stopLossTriggerPrice?: string;
|
|
452
|
+
/** Take profit min out */
|
|
453
|
+
takeProfitMinOut?: bigint;
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* Represents a X-chain swap order
|
|
457
|
+
* Contains all the information needed to execute the order on both source and destination chains
|
|
458
|
+
*/
|
|
459
|
+
declare class CrossChainOrder {
|
|
460
|
+
/** User's wallet address that initiates the order */
|
|
461
|
+
user: string;
|
|
462
|
+
/** Source chain ID where tokens will be sent from */
|
|
463
|
+
sourceChainId: SupportedChain;
|
|
464
|
+
/** Token address on the source chain to be swapped */
|
|
465
|
+
sourceTokenAddress: string;
|
|
466
|
+
/** Amount of source tokens to swap */
|
|
467
|
+
sourceTokenAmount: bigint;
|
|
468
|
+
/** Destination chain ID where tokens will be received */
|
|
469
|
+
destinationChainId: SupportedChain;
|
|
470
|
+
/** Token address on the destination chain to receive */
|
|
471
|
+
destinationTokenAddress: string;
|
|
472
|
+
/** Minimum amount of destination tokens to receive */
|
|
473
|
+
destinationTokenMinAmount: bigint;
|
|
474
|
+
/** Recipient wallet address on the destination chain */
|
|
475
|
+
destinationAddress: string;
|
|
476
|
+
/** Minimum amount of stablecoins in the intermediate swap */
|
|
477
|
+
minStablecoinAmount: bigint;
|
|
478
|
+
/** Timestamp (in seconds) after which the order expires */
|
|
479
|
+
deadline: number;
|
|
480
|
+
/** Extra transfers to be made */
|
|
481
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
482
|
+
/** Stop loss */
|
|
483
|
+
stopLossType?: StopLossType;
|
|
484
|
+
stopLossTriggerPrice?: string;
|
|
485
|
+
/** Take profit min out */
|
|
486
|
+
takeProfitMinOut?: bigint;
|
|
487
|
+
private constructor();
|
|
488
|
+
/**
|
|
489
|
+
* Factory method to create and validate a new Order instance
|
|
490
|
+
* @param input Order parameters
|
|
491
|
+
* @returns Validated Order instance
|
|
492
|
+
* @throws {ValidationError} If order validation fails
|
|
493
|
+
*/
|
|
494
|
+
static create(input: CreateCrossChainOrderParams & {
|
|
495
|
+
user: string;
|
|
496
|
+
}): Promise<CrossChainOrder>;
|
|
497
|
+
private getRandomPreparedData;
|
|
498
|
+
private static calculateAmountOutMin;
|
|
499
|
+
/**
|
|
500
|
+
* Gets the execution details for the destination chain
|
|
501
|
+
* These details are used to complete the order on the destination chain
|
|
502
|
+
* @returns Structured execution details object
|
|
503
|
+
*/
|
|
504
|
+
getExecutionDetails(): ExecutionDetails;
|
|
505
|
+
executionDetailsHashToBytes(): Uint8Array;
|
|
506
|
+
/**
|
|
507
|
+
* Generates a cryptographic hash of the execution details
|
|
508
|
+
* This hash is used to verify order integrity across chains
|
|
509
|
+
* @returns SHA-256 hash of the execution details as a 0x-prefixed hex string
|
|
510
|
+
* @throws {ValidationError} If hash generation fails
|
|
511
|
+
*/
|
|
512
|
+
getExecutionDetailsHash(): Hash;
|
|
513
|
+
toIntentRequest(preparedData: ChainPreparedData): CrossChainUserIntentRequest;
|
|
514
|
+
/**
|
|
515
|
+
* Converts the order to the format required for source chain processing
|
|
516
|
+
* Used when sending the order to the auctioneer for execution
|
|
517
|
+
* @returns Object containing source chain-specific data
|
|
518
|
+
*/
|
|
519
|
+
toSourceChainData(): SourceChainData;
|
|
520
|
+
/**
|
|
521
|
+
* Serializes the order to a JSON-compatible object
|
|
522
|
+
* Converts bigint values to strings to ensure proper JSON serialization
|
|
523
|
+
* @returns JSON-serializable representation of the order
|
|
524
|
+
*/
|
|
525
|
+
toJSON(): {
|
|
526
|
+
user: string;
|
|
527
|
+
sourceChainId: number;
|
|
528
|
+
sourceTokenAddress: string;
|
|
529
|
+
sourceTokenAmount: string;
|
|
530
|
+
destinationChainId: number;
|
|
531
|
+
destinationTokenAddress: string;
|
|
532
|
+
destinationTokenMinAmount: string;
|
|
533
|
+
destinationAddress: string;
|
|
534
|
+
minStablecoinAmount: string;
|
|
535
|
+
deadline: number;
|
|
536
|
+
executionDetailsHash: `0x${string}`;
|
|
537
|
+
extraTransfers: ExtraTransfer$1[] | undefined;
|
|
538
|
+
};
|
|
539
|
+
sendToAuctioneer(preparedData: ChainPreparedData): Promise<ApiResponse>;
|
|
540
|
+
toEVMTypedData(): Promise<{
|
|
541
|
+
orderTypedData: TypedDataDefinition;
|
|
542
|
+
nonce: bigint;
|
|
543
|
+
}>;
|
|
544
|
+
toSolanaInstructionsByteArray(): Promise<SolanaOrderInstructionResult>;
|
|
545
|
+
toSuiTransaction(client?: any): Promise<_mysten_sui_transactions.Transaction>;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
type SolanaOrderInstructionResult = {
|
|
549
|
+
orderAddress: string;
|
|
550
|
+
txBytes: ReadonlyUint8Array;
|
|
551
|
+
};
|
|
552
|
+
declare function getSolanaSingleChainOrderInstructions(order: SingleChainOrder, options?: {
|
|
553
|
+
rpcUrl?: string;
|
|
554
|
+
}): Promise<SolanaOrderInstructionResult & {
|
|
555
|
+
secretNumber: string;
|
|
556
|
+
}>;
|
|
557
|
+
declare function getSolanaCrossChainOrderInstructions(order: CrossChainOrder, options?: {
|
|
558
|
+
rpcUrl?: string;
|
|
559
|
+
}): Promise<SolanaOrderInstructionResult>;
|
|
560
|
+
|
|
561
|
+
type CreateDcaSingleChainOrderParams = {
|
|
562
|
+
chainId: SupportedChain;
|
|
563
|
+
tokenIn: string;
|
|
564
|
+
tokenOut: string;
|
|
565
|
+
destinationAddress: string;
|
|
566
|
+
startTime: number;
|
|
567
|
+
amountInPerInterval: bigint;
|
|
568
|
+
totalIntervals: number;
|
|
569
|
+
intervalDuration: number;
|
|
570
|
+
amountOutMin?: bigint;
|
|
571
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
572
|
+
deadline: number;
|
|
573
|
+
};
|
|
574
|
+
declare class DcaSingleChainOrder {
|
|
575
|
+
user: string;
|
|
576
|
+
chainId: SupportedChain;
|
|
577
|
+
tokenIn: string;
|
|
578
|
+
tokenOut: string;
|
|
579
|
+
destinationAddress: string;
|
|
580
|
+
startTime: number;
|
|
581
|
+
amountInPerInterval: bigint | number;
|
|
582
|
+
totalIntervals: number;
|
|
583
|
+
intervalDuration: number;
|
|
584
|
+
amountOutMin: bigint | number;
|
|
585
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
586
|
+
deadline: number;
|
|
587
|
+
private constructor();
|
|
588
|
+
static create(input: CreateDcaSingleChainOrderParams & {
|
|
589
|
+
user: string;
|
|
590
|
+
}): Promise<DcaSingleChainOrder>;
|
|
591
|
+
private getRandomPreparedData;
|
|
592
|
+
getTotalAmountIn(): bigint;
|
|
593
|
+
toIntentRequest(preparedData: DcaSingleChainPreparedData): DcaSingleChainUserIntentRequest;
|
|
594
|
+
sendToAuctioneer(preparedData: DcaSingleChainPreparedData): Promise<ApiResponse>;
|
|
595
|
+
toEVMTypedData(): Promise<{
|
|
596
|
+
orderTypedData: viem.TypedDataDefinition;
|
|
597
|
+
nonce: bigint;
|
|
598
|
+
}>;
|
|
599
|
+
toSolanaInstructionsByteArray(): Promise<SolanaOrderInstructionResult & {
|
|
600
|
+
secretNumber: string;
|
|
601
|
+
}>;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
type EVMConfig = {
|
|
605
|
+
chainId: SupportedEvmChain;
|
|
606
|
+
rpcProviderUrl?: string;
|
|
607
|
+
privateKey: `0x${string}`;
|
|
608
|
+
};
|
|
609
|
+
type SolanaConfig = {
|
|
610
|
+
rpcProviderUrl?: string;
|
|
611
|
+
privateKey: string;
|
|
612
|
+
/**
|
|
613
|
+
* Transaction confirmation level
|
|
614
|
+
* - 'confirmed': Transaction has been processed and confirmed by the cluster
|
|
615
|
+
* - 'finalized': Transaction has been finalized and cannot be rolled back
|
|
616
|
+
*/
|
|
617
|
+
commitment: 'confirmed' | 'finalized';
|
|
618
|
+
};
|
|
619
|
+
type SuiConfig = {
|
|
620
|
+
privateKey: string;
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Base SDK providing common functionality for all blockchain implementations
|
|
625
|
+
*/
|
|
626
|
+
declare abstract class BaseSDK {
|
|
627
|
+
abstract getUserAddress(): Promise<string>;
|
|
628
|
+
protected abstract prepareCrossChainOrder(order: CrossChainOrder): Promise<CrossChainOrderPrepared>;
|
|
629
|
+
protected prepareSingleChainOrder?(order: SingleChainOrder): Promise<SingleChainOrderPrepared>;
|
|
630
|
+
protected prepareDcaSingleChainOrder?(order: DcaSingleChainOrder): Promise<DcaSingleChainOrderPrepared>;
|
|
631
|
+
private static makeRequest;
|
|
632
|
+
private static validateOrder;
|
|
633
|
+
private static sendOrder;
|
|
634
|
+
createCrossChainOrder(params: CreateCrossChainOrderParams): Promise<CrossChainOrderPrepared>;
|
|
635
|
+
createAndSendCrossChainOrder(params: CreateCrossChainOrderParams): Promise<ApiResponse>;
|
|
636
|
+
static sendCrossChainOrder(preparedOrder: CrossChainOrderPrepared): Promise<ApiResponse>;
|
|
637
|
+
static validateCrossChainOrder(intentRequest: CrossChainUserIntentRequest): Promise<void>;
|
|
638
|
+
createSingleChainOrder(params: CreateSingleChainOrderParams): Promise<SingleChainOrderPrepared>;
|
|
639
|
+
createAndSendSingleChainOrder(params: CreateSingleChainOrderParams): Promise<ApiResponse>;
|
|
640
|
+
static sendSingleChainOrder(preparedOrder: SingleChainOrderPrepared): Promise<ApiResponse>;
|
|
641
|
+
static validateSingleChainOrder(intentRequest: SingleChainUserIntentRequest): Promise<void>;
|
|
642
|
+
createDcaSingleChainOrder(params: CreateDcaSingleChainOrderParams): Promise<DcaSingleChainOrderPrepared>;
|
|
643
|
+
createAndSendDcaSingleChainOrder(params: CreateDcaSingleChainOrderParams): Promise<ApiResponse>;
|
|
644
|
+
static sendDcaSingleChainOrder(preparedOrder: DcaSingleChainOrderPrepared): Promise<ApiResponse>;
|
|
645
|
+
static validateDcaSingleChainOrder(intentRequest: DcaSingleChainUserIntentRequest): Promise<void>;
|
|
646
|
+
static validateDcaCrossChainOrder(intentRequest: DcaCrossChainUserIntentRequest): Promise<void>;
|
|
647
|
+
static sendDcaCrossChainOrder(intentRequest: DcaCrossChainUserIntentRequest): Promise<ApiResponse>;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
type CancelSingleChainOrderParams$1 = {
|
|
651
|
+
orderId: string;
|
|
652
|
+
user: string;
|
|
653
|
+
tokenIn: string;
|
|
654
|
+
amountIn: bigint;
|
|
655
|
+
requestedOutput: ExtraTransfer$1;
|
|
656
|
+
extraTransfers: ExtraTransfer$1[];
|
|
657
|
+
encodedExternalCallData: string;
|
|
658
|
+
deadline: number;
|
|
659
|
+
nonce: bigint;
|
|
660
|
+
};
|
|
661
|
+
type CancelCrossChainOrderParams$1 = {
|
|
662
|
+
orderId: string;
|
|
663
|
+
user: string;
|
|
664
|
+
tokenIn: string;
|
|
665
|
+
amountIn: bigint;
|
|
666
|
+
srcChainId: number;
|
|
667
|
+
deadline: number;
|
|
668
|
+
minStablecoinsAmount: bigint;
|
|
669
|
+
executionDetailsHash: string;
|
|
670
|
+
nonce: bigint;
|
|
671
|
+
};
|
|
672
|
+
/**
|
|
673
|
+
* Handles EVM-specific aspects of cross-chain swaps for Ethereum-compatible chains:
|
|
674
|
+
*/
|
|
675
|
+
declare class EVMSDK extends BaseSDK {
|
|
676
|
+
private readonly config;
|
|
677
|
+
private readonly evmIntentProvider;
|
|
678
|
+
constructor(config: EVMConfig);
|
|
679
|
+
cancelCrossChainOrder(params: CancelCrossChainOrderParams$1): Promise<string>;
|
|
680
|
+
cancelSingleChainOrder(params: CancelSingleChainOrderParams$1): Promise<string>;
|
|
681
|
+
authenticate(token?: string): Promise<string>;
|
|
682
|
+
/**
|
|
683
|
+
* Gets the user's Ethereum address derived from their private key
|
|
684
|
+
* @returns Promise resolving to the user's Ethereum address as a 0x-prefixed string
|
|
685
|
+
*/
|
|
686
|
+
getUserAddress(): Promise<string>;
|
|
687
|
+
protected approveAllowanceIfNeeded(tokenAddress: Address$1, amount: bigint): Promise<void>;
|
|
688
|
+
/**
|
|
689
|
+
* Prepares an EVM order for submission
|
|
690
|
+
*
|
|
691
|
+
* This method:
|
|
692
|
+
* 1. Validates token balances and allowances
|
|
693
|
+
* 2. Creates and signs the EIP-712 typed data for Permit2
|
|
694
|
+
* 3. Prepares the order for submission to the auctioneer
|
|
695
|
+
*
|
|
696
|
+
* @param order The validated order to prepare
|
|
697
|
+
* @returns Promise resolving to a prepared order with EVM-specific signature data
|
|
698
|
+
*/
|
|
699
|
+
protected prepareCrossChainOrder(order: CrossChainOrder): Promise<CrossChainOrderPrepared>;
|
|
700
|
+
protected prepareSingleChainOrder(order: SingleChainOrder): Promise<SingleChainOrderPrepared>;
|
|
701
|
+
protected prepareDcaSingleChainOrder(order: DcaSingleChainOrder): Promise<DcaSingleChainOrderPrepared>;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Solana-specific SDK implementation
|
|
706
|
+
*
|
|
707
|
+
* Handles Solana-specific aspects of cross-chain swaps using Solana blockchain.
|
|
708
|
+
* Uses @solana/kit for transaction creation, signing, and submission.
|
|
709
|
+
* Supports cross-chain swaps from Solana to other supported chains.
|
|
710
|
+
*/
|
|
711
|
+
declare class SolanaSDK extends BaseSDK {
|
|
712
|
+
/** Configuration for Solana connection and authentication */
|
|
713
|
+
private readonly config;
|
|
714
|
+
/** Client for Solana RPC interactions and transaction handling */
|
|
715
|
+
private client;
|
|
716
|
+
/**
|
|
717
|
+
* Creates a new instance of the Solana SDK
|
|
718
|
+
*
|
|
719
|
+
* @param config Solana configuration including privateKey, commitment level, and optional RPC URL
|
|
720
|
+
*/
|
|
721
|
+
constructor(config: SolanaConfig);
|
|
722
|
+
/**
|
|
723
|
+
* Gets the user's Solana wallet address derived from their private key
|
|
724
|
+
*
|
|
725
|
+
* Uses @solana/kit to securely derive the wallet address from the private key
|
|
726
|
+
*
|
|
727
|
+
* @returns Promise resolving to the user's Solana address as a Base58-encoded string
|
|
728
|
+
* @throws {SolanaError} If address derivation fails
|
|
729
|
+
*/
|
|
730
|
+
getUserAddress(): Promise<string>;
|
|
731
|
+
cancelCrossChainOrder(orderId: string): Promise<string>;
|
|
732
|
+
cancelSingleChainOrder(orderId: string): Promise<string>;
|
|
733
|
+
/**
|
|
734
|
+
* Creates a CryptoKeyPair from the user's private key
|
|
735
|
+
*
|
|
736
|
+
* Converts the Base58-encoded private key to the format required by WebCrypto API
|
|
737
|
+
*
|
|
738
|
+
* @returns Promise resolving to a CryptoKeyPair for transaction signing
|
|
739
|
+
* @private
|
|
740
|
+
*/
|
|
741
|
+
private getUserCryptoKeypair;
|
|
742
|
+
/**
|
|
743
|
+
* Creates a KeyPairSigner from the user's crypto keypair
|
|
744
|
+
*
|
|
745
|
+
* The KeyPairSigner is used for transaction signing and verification
|
|
746
|
+
*
|
|
747
|
+
* @returns Promise resolving to a KeyPairSigner for transaction operations
|
|
748
|
+
* @private
|
|
749
|
+
*/
|
|
750
|
+
private getUserSigner;
|
|
751
|
+
authenticate(token?: string): Promise<string>;
|
|
752
|
+
/**
|
|
753
|
+
* Prepares a Solana order for submission
|
|
754
|
+
*
|
|
755
|
+
* This method:
|
|
756
|
+
* 1. Gets the user's signer from their private key
|
|
757
|
+
* 2. Generates Solana-specific instructions for the order
|
|
758
|
+
* 3. Creates, signs, and submits the transaction to the Solana blockchain
|
|
759
|
+
* 4. Returns the prepared order with the orderPubkey for tracking
|
|
760
|
+
*
|
|
761
|
+
* @param order The validated order to prepare
|
|
762
|
+
* @returns Promise resolving to a prepared order with Solana-specific data
|
|
763
|
+
* @protected
|
|
764
|
+
*/
|
|
765
|
+
protected prepareCrossChainOrder(order: CrossChainOrder): Promise<CrossChainOrderPrepared>;
|
|
766
|
+
protected prepareSingleChainOrder(order: SingleChainOrder): Promise<SingleChainOrderPrepared>;
|
|
767
|
+
cancelDcaSingleChainOrder(orderId: string): Promise<string>;
|
|
768
|
+
protected prepareDcaSingleChainOrder(order: DcaSingleChainOrder): Promise<DcaSingleChainOrderPrepared>;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Sui-specific SDK implementation
|
|
773
|
+
*
|
|
774
|
+
* Handles Sui-specific aspects of cross-chain swaps using the Sui blockchain.
|
|
775
|
+
* Uses @mysten/sui libraries for transaction creation, signing, and submission.
|
|
776
|
+
* Supports cross-chain swaps from Sui to other supported chains.
|
|
777
|
+
*/
|
|
778
|
+
declare class SuiSDK extends BaseSDK {
|
|
779
|
+
/** Configuration for Sui connection and authentication */
|
|
780
|
+
private readonly config;
|
|
781
|
+
/** Client for Sui RPC interactions and transaction handling */
|
|
782
|
+
private client;
|
|
783
|
+
/**
|
|
784
|
+
* Creates a new instance of the Sui SDK
|
|
785
|
+
*
|
|
786
|
+
* @param config Sui configuration including privateKey and optional RPC URL
|
|
787
|
+
*/
|
|
788
|
+
constructor(config: SuiConfig);
|
|
789
|
+
/**
|
|
790
|
+
* Gets the user's Sui wallet address derived from their private key
|
|
791
|
+
*
|
|
792
|
+
* Uses Ed25519Keypair to securely derive the wallet address from the private key
|
|
793
|
+
*
|
|
794
|
+
* @returns Promise resolving to the user's Sui address as a hex string
|
|
795
|
+
*/
|
|
796
|
+
getUserAddress(): Promise<string>;
|
|
797
|
+
/**
|
|
798
|
+
* Creates an Ed25519Keypair from the user's private key
|
|
799
|
+
*
|
|
800
|
+
* The keypair is used for transaction signing and address derivation
|
|
801
|
+
*
|
|
802
|
+
* @returns Ed25519Keypair for cryptographic operations
|
|
803
|
+
* @private
|
|
804
|
+
*/
|
|
805
|
+
private getKeyPair;
|
|
806
|
+
authenticate(token?: string): Promise<string>;
|
|
807
|
+
/**
|
|
808
|
+
* Prepares a Sui order for submission
|
|
809
|
+
*
|
|
810
|
+
* This method:
|
|
811
|
+
* 1. Gets the user's keypair from their private key
|
|
812
|
+
* 2. Generates Sui-specific transaction for the order
|
|
813
|
+
* 3. Signs and executes the transaction on the Sui blockchain
|
|
814
|
+
* 4. Returns the prepared order with the transaction hash for tracking
|
|
815
|
+
*
|
|
816
|
+
* @param order The validated order to prepare
|
|
817
|
+
* @returns Promise resolving to a prepared order with Sui-specific data
|
|
818
|
+
* @protected
|
|
819
|
+
*/
|
|
820
|
+
protected prepareCrossChainOrder(order: CrossChainOrder): Promise<CrossChainOrderPrepared>;
|
|
821
|
+
cancelCrossChainOrder(orderId: string): Promise<string>;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Parameters for {@link fetchUserOrders}.
|
|
826
|
+
*
|
|
827
|
+
* The auctioneer resolves the wallets to query from the JWT claims and/or the `wallet`
|
|
828
|
+
* address, so at least one of `token`/`wallet` must be provided. `network` optionally
|
|
829
|
+
* restricts the results to a single chain.
|
|
830
|
+
*/
|
|
831
|
+
interface FetchUserOrdersParams {
|
|
832
|
+
/**
|
|
833
|
+
* SIWE-issued JWT. Optional while the auctioneer skips JWT verification — when present,
|
|
834
|
+
* its wallet claims are queried in addition to `wallet`. Obtain it with
|
|
835
|
+
* `EVMSDK.authenticate()` (or the `fetchSiweMessage` + `fetchJWTToken` pair).
|
|
836
|
+
*/
|
|
837
|
+
token?: string;
|
|
838
|
+
/** Wallet address to query. Required when no `token` is supplied. */
|
|
839
|
+
wallet?: string;
|
|
840
|
+
/** Restrict results to a single chain; omit to return orders on every network. */
|
|
841
|
+
network?: SupportedChain;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Fetches the orders owned by a wallet (and/or the wallets encoded in a SIWE-issued JWT).
|
|
845
|
+
*
|
|
846
|
+
* ⚠️ The auctioneer currently skips JWT verification, so the queried wallet may be passed
|
|
847
|
+
* directly via `wallet`. Once verification is restored, only wallets proved via SIWE (i.e.
|
|
848
|
+
* carried by a valid `token`) will be readable.
|
|
849
|
+
*/
|
|
850
|
+
declare function fetchUserOrders({ token, wallet, network }: FetchUserOrdersParams): Promise<ApiUserOrders>;
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Query filters for `GET /user_intent`.
|
|
854
|
+
*
|
|
855
|
+
* The auctioneer resolves the wallets to query from the (currently unvalidated) JWT claims
|
|
856
|
+
* and/or the `wallet` param; at least one source must be present. `network` optionally
|
|
857
|
+
* restricts results to a single chain — omit it to return orders on every network.
|
|
858
|
+
*/
|
|
859
|
+
interface GetUserOrdersParams {
|
|
860
|
+
/** Wallet address to query. Combined with any wallet(s) carried by the JWT claims. */
|
|
861
|
+
wallet?: string;
|
|
862
|
+
/** Restrict results to a single chain. Serialized as its chain id (e.g. 8453). */
|
|
863
|
+
network?: SupportedChain;
|
|
864
|
+
}
|
|
865
|
+
declare class AuctioneerAPI {
|
|
866
|
+
aggregatedToken?: string;
|
|
867
|
+
constructor(aggregatedToken?: string);
|
|
868
|
+
extend(token: string): void;
|
|
869
|
+
getUserOrders(params?: GetUserOrdersParams): Promise<ApiUserOrders>;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
type FetchSiweMessageParams = {
|
|
873
|
+
wallet: string;
|
|
874
|
+
chainId: ChainID;
|
|
875
|
+
};
|
|
876
|
+
type FetchJWTParams = {
|
|
877
|
+
message: string;
|
|
878
|
+
signature: string;
|
|
879
|
+
};
|
|
880
|
+
declare function fetchSiweMessage(params: FetchSiweMessageParams): Promise<ApiResponse<string>>;
|
|
881
|
+
declare function fetchJWTToken(params: FetchJWTParams, token?: string): Promise<ApiResponse<string>>;
|
|
882
|
+
|
|
883
|
+
declare class BaseError extends Error {
|
|
884
|
+
readonly cause?: unknown | undefined;
|
|
885
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
886
|
+
toJSON(): Record<string, unknown>;
|
|
887
|
+
private formatCause;
|
|
888
|
+
}
|
|
889
|
+
declare class ValidationError extends BaseError {
|
|
890
|
+
constructor(message: string, cause?: unknown);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Response structure from DefiLlama API for token prices
|
|
895
|
+
*/
|
|
896
|
+
interface DefiLlamaTokensResponse {
|
|
897
|
+
coins: Record<string, DefiLlamaCoinData>;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Individual token data from DefiLlama API
|
|
901
|
+
*/
|
|
902
|
+
interface DefiLlamaCoinData {
|
|
903
|
+
/** Number of decimal places for the token */
|
|
904
|
+
decimals: number;
|
|
905
|
+
/** Token symbol (e.g., "ETH", "USDC") */
|
|
906
|
+
symbol: string;
|
|
907
|
+
/** Current price in USD */
|
|
908
|
+
price: number;
|
|
909
|
+
/** Unix timestamp of the price data */
|
|
910
|
+
timestamp: number;
|
|
911
|
+
/** Confidence level of the price data (0-1) */
|
|
912
|
+
confidence: number;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Retrieves token data from DefiLlama response by chain and address
|
|
916
|
+
*/
|
|
917
|
+
declare const getCoinFromResponse: (response: DefiLlamaTokensResponse, chainId: ChainID, tokenAddress: string) => DefiLlamaCoinData;
|
|
918
|
+
/**
|
|
919
|
+
* Fetch tokens data for array of coins
|
|
920
|
+
*
|
|
921
|
+
* @param tokens Array of [ChainID, Token Address] tuples
|
|
922
|
+
* @returns Promise resolving to DefiLlama tokens response
|
|
923
|
+
*/
|
|
924
|
+
declare function getTokensData(tokens: Array<[ChainID, string]>): Promise<DefiLlamaTokensResponse>;
|
|
925
|
+
declare function calculateAmounts({ srcChainId, tokenIn, amountIn, destChainId, tokenOut, }: {
|
|
926
|
+
srcChainId: SupportedChain;
|
|
927
|
+
tokenIn: string;
|
|
928
|
+
amountIn: bigint;
|
|
929
|
+
destChainId: SupportedChain;
|
|
930
|
+
tokenOut: string;
|
|
931
|
+
}): Promise<{
|
|
932
|
+
amountOut: bigint;
|
|
933
|
+
minStablecoinsAmount: bigint;
|
|
934
|
+
}>;
|
|
935
|
+
|
|
936
|
+
type CancelSingleChainOrderParams = {
|
|
937
|
+
orderId: string;
|
|
938
|
+
user: string;
|
|
939
|
+
tokenIn: string;
|
|
940
|
+
amountIn: bigint;
|
|
941
|
+
requestedOutput: ExtraTransfer$1;
|
|
942
|
+
extraTransfers: ExtraTransfer$1[];
|
|
943
|
+
encodedExternalCallData: string;
|
|
944
|
+
deadline: number;
|
|
945
|
+
nonce: bigint;
|
|
946
|
+
};
|
|
947
|
+
type CancelCrossChainOrderParams = {
|
|
948
|
+
orderId: string;
|
|
949
|
+
user: string;
|
|
950
|
+
tokenIn: string;
|
|
951
|
+
amountIn: bigint;
|
|
952
|
+
srcChainId: number;
|
|
953
|
+
deadline: number;
|
|
954
|
+
minStablecoinsAmount: bigint;
|
|
955
|
+
executionDetailsHash: string;
|
|
956
|
+
nonce: bigint;
|
|
957
|
+
};
|
|
958
|
+
declare function getCancelCrossChainOrderRawData(params: CancelCrossChainOrderParams): Hex;
|
|
959
|
+
declare function getCancelSingleChainOrderRawData(params: CancelSingleChainOrderParams): Hex;
|
|
960
|
+
declare function getInvalidateNoncesRawData(nonce: bigint): Hex;
|
|
961
|
+
|
|
962
|
+
declare function cancelDcaSingleChainOrderInstructions(orderAddress: string, options?: {
|
|
963
|
+
rpcUrl?: string;
|
|
964
|
+
}): Promise<Instruction[]>;
|
|
965
|
+
|
|
966
|
+
declare function getEVMSingleChainOrderTypedData(order: SingleChainOrder): Promise<{
|
|
967
|
+
orderTypedData: TypedDataDefinition;
|
|
968
|
+
nonce: bigint;
|
|
969
|
+
}>;
|
|
970
|
+
/**
|
|
971
|
+
* Generates typed data for EVM order signatures
|
|
972
|
+
* @param order The order to generate typed data for
|
|
973
|
+
* @returns Object containing the typed data and nonce
|
|
974
|
+
*/
|
|
975
|
+
declare function getEVMCrossChainOrderTypedData(order: CrossChainOrder): Promise<{
|
|
976
|
+
orderTypedData: TypedDataDefinition;
|
|
977
|
+
nonce: bigint;
|
|
978
|
+
}>;
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Inspect Solana guards to find orders that are currently locked on-chain.
|
|
982
|
+
* @param userAddress - The user's Solana address
|
|
983
|
+
* @param config - The Solana RPC configuration
|
|
984
|
+
* @returns An object containing the Solana guard programs for cross-chain and single-chain orders
|
|
985
|
+
*/
|
|
986
|
+
declare function getSolanaOrdersWithLockedFunds(userAddress: string, config?: {
|
|
987
|
+
rpcUrl?: string;
|
|
988
|
+
}): Promise<{
|
|
989
|
+
crossChainGuardPrograms: {
|
|
990
|
+
pubkey: _solana_kit.Address;
|
|
991
|
+
}[];
|
|
992
|
+
}>;
|
|
993
|
+
|
|
994
|
+
declare function cancelCrossChainOrderInstructionsAsBytes(orderAddress: string, signerAddress: string, options?: {
|
|
995
|
+
rpcUrl?: string;
|
|
996
|
+
}): Promise<{
|
|
997
|
+
versionedMessageBytes: ReadonlyUint8Array;
|
|
998
|
+
}>;
|
|
999
|
+
declare function cancelSingleChainOrderInstructionsAsBytes(orderAddress: string, signerAddress: string, options?: {
|
|
1000
|
+
rpcUrl?: string;
|
|
1001
|
+
}): Promise<{
|
|
1002
|
+
versionedMessageBytes: ReadonlyUint8Array;
|
|
1003
|
+
}>;
|
|
1004
|
+
|
|
1005
|
+
declare const createSuiClient: () => SuiClient;
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Generates Sui order transaction for creating an order
|
|
1009
|
+
* @param order The order to generate transaction for
|
|
1010
|
+
* @param client The Sui client instance (optional, creates new if not provided)
|
|
1011
|
+
* @returns Object containing the transaction
|
|
1012
|
+
*/
|
|
1013
|
+
declare function getSuiOrderTransaction(order: CrossChainOrder, client?: ReturnType<typeof createSuiClient>): Promise<Transaction>;
|
|
1014
|
+
|
|
1015
|
+
declare function getSuiCancelCrossChainOrder(orderId: string): Promise<Transaction>;
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Generates secret hash based on types, addresses and secret number for single chain DCA orders
|
|
1019
|
+
* @param coinOutType Type tag of Coin OUT
|
|
1020
|
+
* @param receiver Main Coins OUT receiver
|
|
1021
|
+
* @param secretNumber Secret number, for hash randomness
|
|
1022
|
+
* @param extraTransferCoinOut Type tag of extra transfer coin OUT
|
|
1023
|
+
* @param extraTransferReceiver Receiver of extra transfer
|
|
1024
|
+
*/
|
|
1025
|
+
declare function getDcaSecretHash(coinOutType: string, receiver: string, secretNumber: string, extraTransferCoinOut?: string, extraTransferReceiver?: string): number[];
|
|
1026
|
+
/**
|
|
1027
|
+
* Generates Sui single-chain DCA order transaction
|
|
1028
|
+
* @param order The DCA order to generate transaction for
|
|
1029
|
+
* @param secretHash The secret hash for the order
|
|
1030
|
+
* @param guardAddress The guard contract address
|
|
1031
|
+
* @param client The Sui client instance
|
|
1032
|
+
* @returns Transaction object for creating the DCA order
|
|
1033
|
+
*/
|
|
1034
|
+
declare function getSuiSingleChainDcaOrderTransaction(order: DcaSingleChainOrder, secretHash: Uint8Array, guardAddress: string, client?: ReturnType<typeof createSuiClient>): Promise<Transaction>;
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Generates random U64 number
|
|
1038
|
+
*/
|
|
1039
|
+
declare function getRandomU64Number(): string;
|
|
1040
|
+
/**
|
|
1041
|
+
* Generates secret hash based on types, addresses and secret number for single chain limit orders
|
|
1042
|
+
* @param coinOutType Type tag of Coin OUT
|
|
1043
|
+
* @param receiver Main Coins OUT receiver
|
|
1044
|
+
* @param secretNumber Secret number, for hash randomness
|
|
1045
|
+
* @param extraTransferCoinOut Type tag of extra transfer coin OUT
|
|
1046
|
+
* @param extraTransferReceiver Receiver of extra transfer
|
|
1047
|
+
*/
|
|
1048
|
+
declare function getSecretHash(coinOutType: string, receiver: string, secretNumber: string, extraTransferCoinOut?: string, extraTransferReceiver?: string): number[];
|
|
1049
|
+
/**
|
|
1050
|
+
* Generates Sui single-chain limit order transaction
|
|
1051
|
+
* @param order The single-chain order to generate transaction for
|
|
1052
|
+
* @param secretHash The secret hash for the order
|
|
1053
|
+
* @param guardAddress The guard contract address
|
|
1054
|
+
* @param client The Sui client instance
|
|
1055
|
+
* @returns Transaction object for creating the limit order
|
|
1056
|
+
*/
|
|
1057
|
+
declare function getSuiSingleChainLimitOrderTransaction(order: SingleChainOrder, secretHash: Uint8Array, guardAddress: string, client?: ReturnType<typeof createSuiClient>): Promise<Transaction>;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Computes the SHA-256 hash the auctioneer expects for cross-chain execution details.
|
|
1061
|
+
*
|
|
1062
|
+
* The auctioneer recomputes sha256 over the exact `executionDetails` JSON string it
|
|
1063
|
+
* receives and rejects the order when it differs (hash mismatch). Callers therefore MUST
|
|
1064
|
+
* hash the same serialized string they send on the wire — pass that string here directly
|
|
1065
|
+
* instead of re-serializing a parallel object, which is how key-order/field drift creeps in.
|
|
1066
|
+
*/
|
|
1067
|
+
declare function generateExecutionDetailsHash(executionDetails: string): string;
|
|
1068
|
+
|
|
1069
|
+
type CreateSuiSingleChainLimitOrderIntentParams = {
|
|
1070
|
+
user: string;
|
|
1071
|
+
tokenIn: string;
|
|
1072
|
+
tokenOut: string;
|
|
1073
|
+
amountIn: bigint;
|
|
1074
|
+
amountOutMin: bigint;
|
|
1075
|
+
destinationAddress: string;
|
|
1076
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1077
|
+
deadline: number;
|
|
1078
|
+
transactionHash: string;
|
|
1079
|
+
secretNumber?: string;
|
|
1080
|
+
takeProfitMinOut?: bigint;
|
|
1081
|
+
stopLossType?: StopLossType;
|
|
1082
|
+
stopLossTriggerPrice?: string;
|
|
1083
|
+
};
|
|
1084
|
+
type CreateSuiSingleChainDcaOrderIntentParams = {
|
|
1085
|
+
user: string;
|
|
1086
|
+
tokenIn: string;
|
|
1087
|
+
tokenOut: string;
|
|
1088
|
+
amountInPerInterval: bigint;
|
|
1089
|
+
totalIntervals: number;
|
|
1090
|
+
intervalDuration: number;
|
|
1091
|
+
amountOutMin: bigint;
|
|
1092
|
+
destinationAddress: string;
|
|
1093
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1094
|
+
deadline: number;
|
|
1095
|
+
startTime: number;
|
|
1096
|
+
transactionHash: string;
|
|
1097
|
+
secretNumber?: string;
|
|
1098
|
+
};
|
|
1099
|
+
type CreateSuiCrossChainOrderIntentParams = {
|
|
1100
|
+
user: string;
|
|
1101
|
+
srcChainId: number;
|
|
1102
|
+
tokenIn: string;
|
|
1103
|
+
amountIn: bigint;
|
|
1104
|
+
minStablecoinsAmount: bigint;
|
|
1105
|
+
deadline: number;
|
|
1106
|
+
destChainId: number;
|
|
1107
|
+
destinationAddress: string;
|
|
1108
|
+
tokenOut: string;
|
|
1109
|
+
amountOutMin: bigint;
|
|
1110
|
+
transactionHash: string;
|
|
1111
|
+
takeProfitMinOut?: bigint;
|
|
1112
|
+
stopLossType?: StopLossType;
|
|
1113
|
+
stopLossTriggerPrice?: string;
|
|
1114
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1115
|
+
};
|
|
1116
|
+
/**
|
|
1117
|
+
* Creates a Sui single-chain limit order intent request
|
|
1118
|
+
* @param params Parameters for creating the intent request
|
|
1119
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1120
|
+
*/
|
|
1121
|
+
declare function createSuiSingleChainLimitOrderIntentRequest(params: CreateSuiSingleChainLimitOrderIntentParams): SingleChainUserIntentRequest;
|
|
1122
|
+
/**
|
|
1123
|
+
* Creates a Sui single-chain DCA order intent request
|
|
1124
|
+
* @param params Parameters for creating the intent request
|
|
1125
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1126
|
+
*/
|
|
1127
|
+
declare function createSuiSingleChainDcaOrderIntentRequest(params: CreateSuiSingleChainDcaOrderIntentParams): DcaSingleChainUserIntentRequest;
|
|
1128
|
+
/**
|
|
1129
|
+
* Creates a Sui cross-chain order intent request
|
|
1130
|
+
* @param params Parameters for creating the intent request
|
|
1131
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1132
|
+
*/
|
|
1133
|
+
declare function createSuiCrossChainOrderIntentRequest(params: CreateSuiCrossChainOrderIntentParams): CrossChainUserIntentRequest;
|
|
1134
|
+
/**
|
|
1135
|
+
* Generates secret hash for Sui single-chain limit orders
|
|
1136
|
+
* @param tokenOut Output token address
|
|
1137
|
+
* @param receiver Receiver address
|
|
1138
|
+
* @param secretNumber Secret number (optional, generates random if not provided)
|
|
1139
|
+
* @param extraTransfers Extra transfers array
|
|
1140
|
+
* @returns Object containing secret number and secret hash
|
|
1141
|
+
*/
|
|
1142
|
+
declare function generateSuiLimitOrderSecretData(tokenOut: string, receiver: string, secretNumber?: string, extraTransfers?: ExtraTransfer$1[]): {
|
|
1143
|
+
secretNumber: string;
|
|
1144
|
+
secretHash: Uint8Array;
|
|
1145
|
+
};
|
|
1146
|
+
/**
|
|
1147
|
+
* Generates secret hash for Sui single-chain DCA orders
|
|
1148
|
+
* @param tokenOut Output token address
|
|
1149
|
+
* @param receiver Receiver address
|
|
1150
|
+
* @param secretNumber Secret number (optional, generates random if not provided)
|
|
1151
|
+
* @param extraTransfers Extra transfers array
|
|
1152
|
+
* @returns Object containing secret number and secret hash
|
|
1153
|
+
*/
|
|
1154
|
+
declare function generateSuiDcaOrderSecretData(tokenOut: string, receiver: string, secretNumber?: string, extraTransfers?: ExtraTransfer$1[]): {
|
|
1155
|
+
secretNumber: string;
|
|
1156
|
+
secretHash: Uint8Array;
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
declare function getSolanaDcaSingleChainOrderInstructions(order: DcaSingleChainOrder, options?: {
|
|
1160
|
+
rpcUrl?: string;
|
|
1161
|
+
}): Promise<SolanaOrderInstructionResult & {
|
|
1162
|
+
secretNumber: string;
|
|
1163
|
+
}>;
|
|
1164
|
+
|
|
1165
|
+
type TransferDataStruct = {
|
|
1166
|
+
token: AddressLike;
|
|
1167
|
+
receiver: AddressLike;
|
|
1168
|
+
amount: BigNumberish;
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
type SingleChainDcaOrderStruct = {
|
|
1172
|
+
user: AddressLike;
|
|
1173
|
+
tokenIn: AddressLike;
|
|
1174
|
+
startTime: BigNumberish;
|
|
1175
|
+
amountInPerInterval: BigNumberish;
|
|
1176
|
+
totalIntervals: BigNumberish;
|
|
1177
|
+
intervalDuration: BigNumberish;
|
|
1178
|
+
requestedOutput: TransferDataStruct;
|
|
1179
|
+
extraTransfers: TransferDataStruct[];
|
|
1180
|
+
encodedExternalCallData: BytesLike;
|
|
1181
|
+
deadline: BigNumberish;
|
|
1182
|
+
nonce: BigNumberish;
|
|
1183
|
+
};
|
|
1184
|
+
/**
|
|
1185
|
+
* Signs Permit2 struct with SingleChainDcaOrder
|
|
1186
|
+
*/
|
|
1187
|
+
declare function signSingleChainDcaOrder(signer: ethers.Wallet, order: SingleChainDcaOrderStruct, chainId: number, guardAddress: string, permit2Address: string): Promise<{
|
|
1188
|
+
domain: any;
|
|
1189
|
+
types: any;
|
|
1190
|
+
values: any;
|
|
1191
|
+
signature: string;
|
|
1192
|
+
}>;
|
|
1193
|
+
|
|
1194
|
+
type SingleChainLimitOrderStruct = {
|
|
1195
|
+
user: AddressLike;
|
|
1196
|
+
tokenIn: AddressLike;
|
|
1197
|
+
amountIn: BigNumberish;
|
|
1198
|
+
requestedOutput: TransferDataStruct;
|
|
1199
|
+
extraTransfers: TransferDataStruct[];
|
|
1200
|
+
encodedExternalCallData: BytesLike;
|
|
1201
|
+
deadline: BigNumberish;
|
|
1202
|
+
nonce: BigNumberish;
|
|
1203
|
+
};
|
|
1204
|
+
/**
|
|
1205
|
+
* Signs Permit2 struct with SingleChainLimitOrder
|
|
1206
|
+
*/
|
|
1207
|
+
declare function signSingleChainLimitOrder(signer: ethers.Wallet, order: SingleChainLimitOrderStruct, chainId: number, guardAddress: string, permit2Address: string): Promise<{
|
|
1208
|
+
domain: any;
|
|
1209
|
+
types: any;
|
|
1210
|
+
values: any;
|
|
1211
|
+
signature: string;
|
|
1212
|
+
}>;
|
|
1213
|
+
|
|
1214
|
+
type RelayQuoteResult = {
|
|
1215
|
+
amountOut: bigint;
|
|
1216
|
+
amountIn: bigint;
|
|
1217
|
+
amountOutUsd: number;
|
|
1218
|
+
amountInUsd: number;
|
|
1219
|
+
slippage: number;
|
|
1220
|
+
priceImpact: number;
|
|
1221
|
+
quote: any;
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
type SwapEstimateResult = {
|
|
1225
|
+
amountOut: bigint;
|
|
1226
|
+
amountIn: bigint;
|
|
1227
|
+
amountOutUsd: number;
|
|
1228
|
+
amountInUsd: number;
|
|
1229
|
+
quote: OptimalRate;
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
type LiquidSwapQuoteResponse = {
|
|
1233
|
+
success: boolean;
|
|
1234
|
+
amountIn: string;
|
|
1235
|
+
amountOut: string;
|
|
1236
|
+
averagePriceImpact: string;
|
|
1237
|
+
execution: any;
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
type SingleChainQuoteParams = {
|
|
1241
|
+
chainId: ChainID;
|
|
1242
|
+
amount: bigint;
|
|
1243
|
+
tokenIn: string;
|
|
1244
|
+
tokenOut: string;
|
|
1245
|
+
slippageBps?: number;
|
|
1246
|
+
provider?: RouteProvider;
|
|
1247
|
+
};
|
|
1248
|
+
type RouteProvider = 'paraswap' | 'jupiter' | 'aftermath' | 'liquidswap' | 'raydium' | 'pumpfun' | 'relay';
|
|
1249
|
+
type Quote = {
|
|
1250
|
+
amountIn: bigint;
|
|
1251
|
+
amountOut: bigint;
|
|
1252
|
+
amountOutMin?: bigint;
|
|
1253
|
+
amountOutUsd: number;
|
|
1254
|
+
amountInUsd: number;
|
|
1255
|
+
slippage: number;
|
|
1256
|
+
priceImpact: number;
|
|
1257
|
+
provider: RouteProvider;
|
|
1258
|
+
rawQuote: any;
|
|
1259
|
+
};
|
|
1260
|
+
type IntentsQuoteParams = {
|
|
1261
|
+
sourceChainId: ChainID;
|
|
1262
|
+
destChainId: ChainID;
|
|
1263
|
+
amount: bigint;
|
|
1264
|
+
tokenIn: string;
|
|
1265
|
+
tokenOut: string;
|
|
1266
|
+
};
|
|
1267
|
+
type QuoteResponseInternal = {
|
|
1268
|
+
amountInUsd: number;
|
|
1269
|
+
estimatedAmountInAsMinStablecoinAmount: bigint;
|
|
1270
|
+
estimatedAmountOut: bigint;
|
|
1271
|
+
estimatedAmountOutUsd: number;
|
|
1272
|
+
estimatedAmountOutReduced: bigint;
|
|
1273
|
+
estimatedAmountOutUsdReduced: number;
|
|
1274
|
+
};
|
|
1275
|
+
type QuoteResponse = QuoteResponseInternal & {
|
|
1276
|
+
/** Metadata for source token */
|
|
1277
|
+
tokenIn: {
|
|
1278
|
+
address: string;
|
|
1279
|
+
chainId: ChainID;
|
|
1280
|
+
};
|
|
1281
|
+
/** Metadata for destination token */
|
|
1282
|
+
tokenOut: {
|
|
1283
|
+
address: string;
|
|
1284
|
+
chainId: ChainID;
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
declare class QuoteProvider {
|
|
1288
|
+
static getQuote(params: IntentsQuoteParams): Promise<QuoteResponse>;
|
|
1289
|
+
/**
|
|
1290
|
+
* Get a quote for Solana with explicit provider selection
|
|
1291
|
+
* @param params - Quote parameters including provider preference
|
|
1292
|
+
* @returns Quote response
|
|
1293
|
+
*/
|
|
1294
|
+
static getSolanaQuote(params: {
|
|
1295
|
+
amount: bigint;
|
|
1296
|
+
tokenIn: string;
|
|
1297
|
+
tokenOut: string;
|
|
1298
|
+
slippageBps?: number;
|
|
1299
|
+
provider?: 'jupiter' | 'raydium' | 'pumpfun';
|
|
1300
|
+
}): Promise<Quote>;
|
|
1301
|
+
private static getQuoteFromRouters;
|
|
1302
|
+
static getSingleChainQuote(params: SingleChainQuoteParams): Promise<Quote>;
|
|
1303
|
+
static transformLiquidSwapQuote(liquidSwapQuote: LiquidSwapQuoteResponse): Quote;
|
|
1304
|
+
/**
|
|
1305
|
+
* Calculates the weighted reduction factor for an amount in USD.
|
|
1306
|
+
* For amounts <= $5, the reduction factor is 0.65.
|
|
1307
|
+
*/
|
|
1308
|
+
static calculateWeightedReductionFactorForUsd(amountUsd: number): number;
|
|
1309
|
+
protected static getLiquidSwapQuote(params: SingleChainQuoteParams): Promise<LiquidSwapQuoteResponse>;
|
|
1310
|
+
protected static getJupiterQuote(params: SingleChainQuoteParams): Promise<{
|
|
1311
|
+
quote: QuoteResponse$1;
|
|
1312
|
+
}>;
|
|
1313
|
+
protected static getParaswapQuote(params: SingleChainQuoteParams): Promise<SwapEstimateResult>;
|
|
1314
|
+
protected static getRelayQuote(params: SingleChainQuoteParams): Promise<RelayQuoteResult>;
|
|
1315
|
+
protected static getAftermathQuote(params: SingleChainQuoteParams): Promise<RouterCompleteTradeRoute>;
|
|
1316
|
+
protected static getRaydiumQuote(params: SingleChainQuoteParams): Promise<Quote>;
|
|
1317
|
+
protected static getPumpFunQuote(params: SingleChainQuoteParams): Promise<Quote>;
|
|
1318
|
+
private static transformAftermathQuote;
|
|
1319
|
+
private static transformParaswapQuote;
|
|
1320
|
+
private static transformRelayQuote;
|
|
1321
|
+
static transformJupiterQuote({ quote }: {
|
|
1322
|
+
quote: QuoteResponse$1;
|
|
1323
|
+
}): Quote;
|
|
1324
|
+
private static transformRaydiumQuote;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
type ExtraTransfer = {
|
|
1328
|
+
token: PublicKey;
|
|
1329
|
+
receiver: PublicKey;
|
|
1330
|
+
amount: string;
|
|
1331
|
+
};
|
|
1332
|
+
/**
|
|
1333
|
+
* Generate secret number and prepare secret hash for single chain limit orders
|
|
1334
|
+
* @param tokenOut Token OUT Pubkey
|
|
1335
|
+
* @param receiver Token OUT receiver Pubkey
|
|
1336
|
+
* @param extraTransfers Requested extra transfers
|
|
1337
|
+
*/
|
|
1338
|
+
declare function prepareSecretData(tokenOut: PublicKey, receiver: PublicKey, extraTransfers: ExtraTransfer[]): {
|
|
1339
|
+
secretHash: number[];
|
|
1340
|
+
secretNumber: bn_js;
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Generate secret number and prepare secret hash for single chain DCA orders
|
|
1345
|
+
* @param tokenOut Token OUT Pubkey
|
|
1346
|
+
* @param receiver Token OUT receiver Pubkey
|
|
1347
|
+
* @param extraTransfers Requested extra transfers
|
|
1348
|
+
*/
|
|
1349
|
+
declare function prepareDcaSecretData(tokenOut: PublicKey, receiver: PublicKey, extraTransfers: ExtraTransfer[]): {
|
|
1350
|
+
secretHash: number[];
|
|
1351
|
+
secretNumber: bn_js;
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
interface TokenSearchParams {
|
|
1355
|
+
/** Optional: search phrase (symbol, token name, or address) */
|
|
1356
|
+
q?: string;
|
|
1357
|
+
/** Optional: Chain ID filter (e.g. 8453 = Base, 42161 = Arbitrum, 7565164 = Solana, 101 = Sui) */
|
|
1358
|
+
networkId?: number;
|
|
1359
|
+
/** Optional: page number for pagination (default = 1) */
|
|
1360
|
+
page?: number;
|
|
1361
|
+
/** Optional: number of results per page (default = 20) */
|
|
1362
|
+
limit?: number;
|
|
1363
|
+
/** Optional: Abort signal to cancel requests (useful in UI search inputs) */
|
|
1364
|
+
signal?: AbortSignal;
|
|
1365
|
+
}
|
|
1366
|
+
/** Normalized token shape returned by the API */
|
|
1367
|
+
interface TokenInfo {
|
|
1368
|
+
address: string;
|
|
1369
|
+
symbol: string;
|
|
1370
|
+
name: string;
|
|
1371
|
+
chainId: number;
|
|
1372
|
+
decimals: number;
|
|
1373
|
+
image?: string;
|
|
1374
|
+
isVerified?: boolean;
|
|
1375
|
+
}
|
|
1376
|
+
/** Paginated API response */
|
|
1377
|
+
interface TokenSearchResponse {
|
|
1378
|
+
count: number;
|
|
1379
|
+
page: number;
|
|
1380
|
+
limit: number;
|
|
1381
|
+
results: TokenInfo[];
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* getTokenList
|
|
1386
|
+
*
|
|
1387
|
+
* High-level SDK function for token discovery.
|
|
1388
|
+
* Supports cancellation via AbortController.
|
|
1389
|
+
*
|
|
1390
|
+
* Example:
|
|
1391
|
+
* ```ts
|
|
1392
|
+
* import { getTokenList } from "@shogun/sdk";
|
|
1393
|
+
*
|
|
1394
|
+
* const controller = new AbortController();
|
|
1395
|
+
* const res = await getTokenList({ q: "usdc", networkId: 8453, signal: controller.signal });
|
|
1396
|
+
*
|
|
1397
|
+
* To cancel:
|
|
1398
|
+
* controller.abort();
|
|
1399
|
+
* ```
|
|
1400
|
+
*/
|
|
1401
|
+
declare function getTokenList(params: TokenSearchParams): Promise<TokenSearchResponse>;
|
|
1402
|
+
|
|
1403
|
+
type CreateEvmSingleChainLimitOrderIntentParams = {
|
|
1404
|
+
user: `0x${string}`;
|
|
1405
|
+
chainId: SupportedEvmChain;
|
|
1406
|
+
tokenIn: string;
|
|
1407
|
+
tokenOut: string;
|
|
1408
|
+
amountIn: bigint;
|
|
1409
|
+
amountOutMin: bigint;
|
|
1410
|
+
destinationAddress: string;
|
|
1411
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1412
|
+
deadline: number;
|
|
1413
|
+
nonce?: string;
|
|
1414
|
+
signature?: string;
|
|
1415
|
+
takeProfitMinOut?: bigint;
|
|
1416
|
+
stopLossType?: StopLossType;
|
|
1417
|
+
stopLossTriggerPrice?: string;
|
|
1418
|
+
};
|
|
1419
|
+
type CreateEvmSingleChainDcaOrderIntentParams = {
|
|
1420
|
+
user: `0x${string}`;
|
|
1421
|
+
chainId: SupportedEvmChain;
|
|
1422
|
+
tokenIn: string;
|
|
1423
|
+
tokenOut: string;
|
|
1424
|
+
amountInPerInterval: bigint;
|
|
1425
|
+
totalIntervals: number;
|
|
1426
|
+
intervalDuration: number;
|
|
1427
|
+
amountOutMin: bigint;
|
|
1428
|
+
destinationAddress: string;
|
|
1429
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1430
|
+
deadline: number;
|
|
1431
|
+
startTime: number;
|
|
1432
|
+
nonce?: string;
|
|
1433
|
+
signature?: string;
|
|
1434
|
+
};
|
|
1435
|
+
type CreateEvmCrossChainOrderIntentParams = {
|
|
1436
|
+
user: `0x${string}`;
|
|
1437
|
+
sourceChainId: SupportedEvmChain;
|
|
1438
|
+
sourceTokenAddress: string;
|
|
1439
|
+
sourceTokenAmount: bigint;
|
|
1440
|
+
destinationChainId: number;
|
|
1441
|
+
destinationTokenAddress: string;
|
|
1442
|
+
destinationTokenMinAmount?: bigint;
|
|
1443
|
+
destinationAddress: string;
|
|
1444
|
+
minStablecoinAmount?: bigint;
|
|
1445
|
+
deadline: number;
|
|
1446
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1447
|
+
nonce?: string;
|
|
1448
|
+
signature?: string;
|
|
1449
|
+
takeProfitMinOut?: bigint;
|
|
1450
|
+
stopLossType?: StopLossType;
|
|
1451
|
+
stopLossTriggerPrice?: string;
|
|
1452
|
+
};
|
|
1453
|
+
/**
|
|
1454
|
+
* Creates an EVM single-chain limit order intent request
|
|
1455
|
+
* @param params Parameters for creating the intent request
|
|
1456
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1457
|
+
*/
|
|
1458
|
+
declare function createEvmSingleChainLimitOrderIntentRequest(params: CreateEvmSingleChainLimitOrderIntentParams): SingleChainUserIntentRequest;
|
|
1459
|
+
/**
|
|
1460
|
+
* Creates an EVM single-chain DCA order intent request
|
|
1461
|
+
* @param params Parameters for creating the intent request
|
|
1462
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1463
|
+
*/
|
|
1464
|
+
declare function createEvmSingleChainDcaOrderIntentRequest(params: CreateEvmSingleChainDcaOrderIntentParams): DcaSingleChainUserIntentRequest;
|
|
1465
|
+
/**
|
|
1466
|
+
* Creates an EVM cross-chain order intent request
|
|
1467
|
+
* @param params Parameters for creating the intent request
|
|
1468
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1469
|
+
*/
|
|
1470
|
+
declare function createEvmCrossChainOrderIntentRequest(params: CreateEvmCrossChainOrderIntentParams): CrossChainUserIntentRequest;
|
|
1471
|
+
/**
|
|
1472
|
+
* Generates EVM typed data and nonce for single-chain limit orders
|
|
1473
|
+
* @param order The single-chain order
|
|
1474
|
+
* @returns Object containing typed data and nonce for signing
|
|
1475
|
+
*/
|
|
1476
|
+
declare function generateEvmSingleChainLimitOrderTypedData(order: SingleChainOrder): Promise<{
|
|
1477
|
+
orderTypedData: TypedDataDefinition;
|
|
1478
|
+
nonce: bigint;
|
|
1479
|
+
}>;
|
|
1480
|
+
/**
|
|
1481
|
+
* Generates EVM typed data and nonce for single-chain DCA orders
|
|
1482
|
+
* @param order The DCA order
|
|
1483
|
+
* @returns Object containing typed data and nonce for signing
|
|
1484
|
+
*/
|
|
1485
|
+
declare function generateEvmSingleChainDcaOrderTypedData(order: DcaSingleChainOrder): Promise<{
|
|
1486
|
+
orderTypedData: TypedDataDefinition;
|
|
1487
|
+
nonce: bigint;
|
|
1488
|
+
}>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Generates EVM typed data and nonce for cross-chain orders
|
|
1491
|
+
* @param order The cross-chain order
|
|
1492
|
+
* @returns Object containing typed data and nonce for signing
|
|
1493
|
+
*/
|
|
1494
|
+
declare function generateEvmCrossChainOrderTypedData(order: CrossChainOrder): Promise<{
|
|
1495
|
+
orderTypedData: TypedDataDefinition;
|
|
1496
|
+
nonce: bigint;
|
|
1497
|
+
}>;
|
|
1498
|
+
/**
|
|
1499
|
+
* Generates a random nonce for EVM orders
|
|
1500
|
+
* @returns Random nonce as string
|
|
1501
|
+
*/
|
|
1502
|
+
declare function generateEvmRandomNonce(): string;
|
|
1503
|
+
type CreateEvmCrossChainDcaOrderIntentParams = {
|
|
1504
|
+
user: `0x${string}`;
|
|
1505
|
+
sourceChainId: SupportedEvmChain;
|
|
1506
|
+
sourceTokenAddress: string;
|
|
1507
|
+
destinationChainId: number;
|
|
1508
|
+
destinationTokenAddress: string;
|
|
1509
|
+
destinationTokenMinAmount?: bigint;
|
|
1510
|
+
destinationAddress: string;
|
|
1511
|
+
minStablecoinAmount?: bigint;
|
|
1512
|
+
deadline: number;
|
|
1513
|
+
startTime: number;
|
|
1514
|
+
amountInPerInterval: bigint;
|
|
1515
|
+
totalIntervals: number;
|
|
1516
|
+
intervalDuration: number;
|
|
1517
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1518
|
+
nonce?: string;
|
|
1519
|
+
signature?: string;
|
|
1520
|
+
};
|
|
1521
|
+
/**
|
|
1522
|
+
* Creates an EVM cross-chain DCA order intent request, ready to POST to
|
|
1523
|
+
* `/user_intent/cross_chain/dca_order`. Pass `nonce`/`signature` from
|
|
1524
|
+
* {@link getEVMCrossChainDcaOrderTypedData} for an executable order.
|
|
1525
|
+
*/
|
|
1526
|
+
declare function createEvmCrossChainDcaOrderIntentRequest(params: CreateEvmCrossChainDcaOrderIntentParams): DcaCrossChainUserIntentRequest;
|
|
1527
|
+
/**
|
|
1528
|
+
* Generates the EIP-712 typed data (and nonce) for a cross-chain DCA order's Permit2 witness.
|
|
1529
|
+
* Sign `orderTypedData`, then pass the resulting `nonce`/`signature` into
|
|
1530
|
+
* {@link createEvmCrossChainDcaOrderIntentRequest} — both share the same execution-details hash.
|
|
1531
|
+
*/
|
|
1532
|
+
declare function getEVMCrossChainDcaOrderTypedData(params: CreateEvmCrossChainDcaOrderIntentParams, providedNonce?: bigint): {
|
|
1533
|
+
orderTypedData: TypedDataDefinition;
|
|
1534
|
+
nonce: bigint;
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
type CreateSolanaSingleChainLimitOrderIntentParams = {
|
|
1538
|
+
user: string;
|
|
1539
|
+
tokenIn: string;
|
|
1540
|
+
tokenOut: string;
|
|
1541
|
+
amountIn: bigint;
|
|
1542
|
+
amountOutMin: bigint;
|
|
1543
|
+
destinationAddress: string;
|
|
1544
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1545
|
+
deadline: number;
|
|
1546
|
+
orderPubkey?: string;
|
|
1547
|
+
secretNumber?: string;
|
|
1548
|
+
stopLossType?: StopLossType;
|
|
1549
|
+
stopLossTriggerPrice?: string;
|
|
1550
|
+
takeProfitMinOut?: bigint;
|
|
1551
|
+
};
|
|
1552
|
+
type CreateSolanaSingleChainDcaOrderIntentParams = {
|
|
1553
|
+
user: string;
|
|
1554
|
+
tokenIn: string;
|
|
1555
|
+
tokenOut: string;
|
|
1556
|
+
amountInPerInterval: bigint;
|
|
1557
|
+
totalIntervals: number;
|
|
1558
|
+
intervalDuration: number;
|
|
1559
|
+
amountOutMin: bigint;
|
|
1560
|
+
destinationAddress: string;
|
|
1561
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1562
|
+
deadline: number;
|
|
1563
|
+
startTime: number;
|
|
1564
|
+
orderPubkey?: string;
|
|
1565
|
+
secretNumber?: string;
|
|
1566
|
+
};
|
|
1567
|
+
type CreateSolanaCrossChainOrderIntentParams = {
|
|
1568
|
+
user: string;
|
|
1569
|
+
sourceChainId: number;
|
|
1570
|
+
sourceTokenAddress: string;
|
|
1571
|
+
sourceTokenAmount: bigint;
|
|
1572
|
+
destinationChainId: number;
|
|
1573
|
+
destinationTokenAddress: string;
|
|
1574
|
+
destinationTokenMinAmount?: bigint;
|
|
1575
|
+
destinationAddress: string;
|
|
1576
|
+
minStablecoinAmount?: bigint;
|
|
1577
|
+
deadline: number;
|
|
1578
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1579
|
+
orderPubkey?: string;
|
|
1580
|
+
stopLossType?: StopLossType;
|
|
1581
|
+
stopLossTriggerPrice?: string;
|
|
1582
|
+
takeProfitMinOut?: bigint;
|
|
1583
|
+
};
|
|
1584
|
+
/**
|
|
1585
|
+
* Creates a Solana single-chain limit order intent request
|
|
1586
|
+
* @param params Parameters for creating the intent request
|
|
1587
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1588
|
+
*/
|
|
1589
|
+
declare function createSolanaSingleChainLimitOrderIntentRequest(params: CreateSolanaSingleChainLimitOrderIntentParams): SingleChainUserIntentRequest;
|
|
1590
|
+
/**
|
|
1591
|
+
* Creates a Solana single-chain DCA order intent request
|
|
1592
|
+
* @param params Parameters for creating the intent request
|
|
1593
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1594
|
+
*/
|
|
1595
|
+
declare function createSolanaSingleChainDcaOrderIntentRequest(params: CreateSolanaSingleChainDcaOrderIntentParams): DcaSingleChainUserIntentRequest;
|
|
1596
|
+
/**
|
|
1597
|
+
* Creates a Solana cross-chain order intent request
|
|
1598
|
+
* @param params Parameters for creating the intent request
|
|
1599
|
+
* @returns Formatted intent request ready to send to auctioneer
|
|
1600
|
+
*/
|
|
1601
|
+
declare function createSolanaCrossChainOrderIntentRequest(params: CreateSolanaCrossChainOrderIntentParams): CrossChainUserIntentRequest;
|
|
1602
|
+
/**
|
|
1603
|
+
* Generates instruction bytes for Solana single-chain limit orders
|
|
1604
|
+
* @param order The single-chain order
|
|
1605
|
+
* @returns Promise resolving to instruction bytes
|
|
1606
|
+
*/
|
|
1607
|
+
declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleChainOrder): Promise<SolanaOrderInstructionResult & {
|
|
1608
|
+
secretNumber: string;
|
|
1609
|
+
}>;
|
|
1610
|
+
/**
|
|
1611
|
+
* Generates instruction bytes for Solana single-chain DCA orders
|
|
1612
|
+
* @param order The DCA order
|
|
1613
|
+
* @returns Promise resolving to instruction bytes
|
|
1614
|
+
*/
|
|
1615
|
+
declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleChainOrder): Promise<SolanaOrderInstructionResult & {
|
|
1616
|
+
secretNumber: string;
|
|
1617
|
+
}>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Generates instruction bytes for Solana cross-chain orders
|
|
1620
|
+
* @param order The cross-chain order
|
|
1621
|
+
* @returns Promise resolving to instruction bytes
|
|
1622
|
+
*/
|
|
1623
|
+
declare function generateSolanaCrossChainOrderInstructions(order: CrossChainOrder): Promise<SolanaOrderInstructionResult>;
|
|
1624
|
+
/**
|
|
1625
|
+
* Generates secret data for Solana single-chain limit orders
|
|
1626
|
+
* @param tokenOut Output token mint address
|
|
1627
|
+
* @param receiver Receiver public key
|
|
1628
|
+
* @param secretNumber Secret number (optional, generates random if not provided)
|
|
1629
|
+
* @param extraTransfers Extra transfers array
|
|
1630
|
+
* @returns Object containing secret number and prepared secret data
|
|
1631
|
+
*/
|
|
1632
|
+
declare function generateSolanaLimitOrderSecretData(tokenOut: string, receiver: string, secretNumber?: string, extraTransfers?: ExtraTransfer$1[]): {
|
|
1633
|
+
secretNumber: string;
|
|
1634
|
+
secretData: any;
|
|
1635
|
+
};
|
|
1636
|
+
/**
|
|
1637
|
+
* Generates secret data for Solana single-chain DCA orders
|
|
1638
|
+
* @param tokenOut Output token mint address
|
|
1639
|
+
* @param receiver Receiver public key
|
|
1640
|
+
* @param secretNumber Secret number (optional, generates random if not provided)
|
|
1641
|
+
* @param extraTransfers Extra transfers array
|
|
1642
|
+
* @returns Object containing secret number and prepared secret data
|
|
1643
|
+
*/
|
|
1644
|
+
declare function generateSolanaDcaOrderSecretData(tokenOut: string, receiver: string, secretNumber?: string, extraTransfers?: ExtraTransfer$1[]): {
|
|
1645
|
+
secretNumber: string;
|
|
1646
|
+
secretData: any;
|
|
1647
|
+
};
|
|
1648
|
+
/**
|
|
1649
|
+
* Generates a random secret number for Solana orders
|
|
1650
|
+
* @returns Random secret number as string
|
|
1651
|
+
*/
|
|
1652
|
+
declare function generateSolanaRandomSecretNumber(): string;
|
|
1653
|
+
|
|
1654
|
+
export { AUCTIONEER_URL, type ApiCrossChainOrder, type ApiIntentResponse, type ApiResponse, type ApiSingleChainOrder, type ApiUserOrders, AuctioneerAPI, CROSS_CHAIN_GUARD_ADDRESSES, type CancelCrossChainOrderParams, type CancelSingleChainOrderParams, ChainID, type ChainOrderStatus, ChainType, type CreateCrossChainOrderParams, type CreateDcaSingleChainOrderParams, type CreateEvmCrossChainDcaOrderIntentParams, type CreateEvmCrossChainOrderIntentParams, type CreateEvmSingleChainDcaOrderIntentParams, type CreateEvmSingleChainLimitOrderIntentParams, type CreateSingleChainOrderParams, type CreateSolanaCrossChainOrderIntentParams, type CreateSolanaSingleChainDcaOrderIntentParams, type CreateSolanaSingleChainLimitOrderIntentParams, type CreateSuiCrossChainOrderIntentParams, type CreateSuiSingleChainDcaOrderIntentParams, type CreateSuiSingleChainLimitOrderIntentParams, CrossChainOrder, DCA_CROSS_CHAIN_GUARD_ADDRESSES, DCA_SINGLE_CHAIN_GUARD_ADDRESSES, DcaSingleChainOrder, type DefiLlamaCoinData, type DefiLlamaTokensResponse, type EVMConfig, EVMSDK, EVM_ZERO_ADDRESS, EVM_ZERO_SIGNATURE, type FetchJWTParams, type FetchSiweMessageParams, type FetchUserOrdersParams, type GetUserOrdersParams, IntentsOrderType, type IntentsQuoteParams, MAX_UINT_128, MAX_UINT_256, MAX_UINT_32, MAX_UINT_64, NATIVE_EVM_ETH_ADDRESSES, NATIVE_SOLANA_TOKEN_ADDRESS, NATIVE_SUI_TOKEN_ADDRESS, PERMIT2_ADDRESS, PROD_CROSS_CHAIN_GUARD_ADDRESSES, PROD_DCA_CROSS_CHAIN_GUARD_ADDRESSES, PROD_DCA_SINGLE_CHAIN_GUARD_ADDRESSES, PROD_SINGLE_CHAIN_GUARD_ADDRESSES, PROD_SUI_PACKAGE_ID, QuoteProvider, type QuoteResponse, SINGLE_CHAIN_GUARD_ADDRESSES, SOLANA_MINT_TOKEN, SOLANA_USDC_MINT, SUI_GUARD_COLLATERAL_TYPE, SUI_GUARD_STABLECOIN_TYPE, SUI_PACKAGE_ID, SingleChainOrder, type SolanaConfig, type SolanaOrderInstructionResult, SolanaSDK, type StopLossType, type SuiConfig, SuiSDK, type SupportedChain, SupportedChains, type SupportedEvmChain, TEST_CROSS_CHAIN_GUARD_ADDRESSES, TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES, TEST_SINGLE_CHAIN_GUARD_ADDRESSES, TEST_SUI_PACKAGE_ID, TOKEN_SEARCH_API_BASE_URL, type TokenInfo, type TokenSearchParams, type TokenSearchResponse, ValidationError, WRAPPED_ETH_ADDRESSES, WRAPPED_SOL_MINT_ADDRESS, calculateAmounts, cancelCrossChainOrderInstructionsAsBytes, cancelDcaSingleChainOrderInstructions, cancelSingleChainOrderInstructionsAsBytes, chainIdToChainTypeMap, createEvmCrossChainDcaOrderIntentRequest, createEvmCrossChainOrderIntentRequest, createEvmSingleChainDcaOrderIntentRequest, createEvmSingleChainLimitOrderIntentRequest, createSolanaCrossChainOrderIntentRequest, createSolanaSingleChainDcaOrderIntentRequest, createSolanaSingleChainLimitOrderIntentRequest, createSuiCrossChainOrderIntentRequest, createSuiSingleChainDcaOrderIntentRequest, createSuiSingleChainLimitOrderIntentRequest, fetchJWTToken, fetchSiweMessage, fetchUserOrders, generateEvmCrossChainOrderTypedData, generateEvmRandomNonce, generateEvmSingleChainDcaOrderTypedData, generateEvmSingleChainLimitOrderTypedData, generateExecutionDetailsHash, generateSolanaCrossChainOrderInstructions, generateSolanaDcaOrderSecretData, generateSolanaLimitOrderSecretData, generateSolanaRandomSecretNumber, generateSolanaSingleChainDcaOrderInstructions, generateSolanaSingleChainLimitOrderInstructions, generateSuiDcaOrderSecretData, generateSuiLimitOrderSecretData, getCancelCrossChainOrderRawData, getCancelSingleChainOrderRawData, getCoinFromResponse, getDcaSecretHash, getEVMCrossChainDcaOrderTypedData, getEVMCrossChainOrderTypedData, getEVMSingleChainOrderTypedData, getInvalidateNoncesRawData, getSecretHash, getSolanaCrossChainOrderInstructions, getSolanaDcaSingleChainOrderInstructions, getSolanaOrdersWithLockedFunds, getSolanaSingleChainOrderInstructions, getSuiCancelCrossChainOrder, getSuiOrderTransaction, getRandomU64Number as getSuiRandomU64Number, getSuiSingleChainDcaOrderTransaction, getSuiSingleChainLimitOrderTransaction, getTokenList, getTokensData, isErrorApiResponse, isEvmChain, isNativeEvmToken, isSuccessApiResponse, isSupportedChain, normalizeNativeEvmTokenForSigning, prepareDcaSecretData, prepareSecretData, signSingleChainDcaOrder, signSingleChainLimitOrder };
|