@shogun-sdk/intents-sdk 1.0.2 → 1.1.1
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 +0 -1
- package/dist/esm/auth/siwe.js +26 -0
- package/dist/esm/auth/siwe.js.map +1 -0
- package/dist/esm/chains.js +21 -8
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/constants.js +73 -35
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/evm/abi/single-chain-guard-limit.js +768 -0
- package/dist/esm/core/evm/abi/single-chain-guard-limit.js.map +1 -0
- package/dist/esm/core/evm/cancel-order.js +130 -0
- package/dist/esm/core/evm/cancel-order.js.map +1 -0
- package/dist/esm/core/evm/{viem-provider.js → chain-provider.js} +18 -3
- package/dist/esm/core/evm/chain-provider.js.map +1 -0
- package/dist/esm/core/evm/connectors/hyperevm.js +23 -0
- package/dist/esm/core/evm/connectors/hyperevm.js.map +1 -0
- package/dist/esm/core/evm/intent-provider.js +58 -8
- package/dist/esm/core/evm/intent-provider.js.map +1 -1
- package/dist/esm/core/evm/order-signature.js +15 -15
- package/dist/esm/core/evm/order-signature.js.map +1 -1
- package/dist/esm/core/evm/permit2.js +31 -3
- package/dist/esm/core/evm/permit2.js.map +1 -1
- package/dist/esm/core/evm/sdk.js +94 -78
- package/dist/esm/core/evm/sdk.js.map +1 -1
- package/dist/esm/core/evm/validator.js +52 -8
- package/dist/esm/core/evm/validator.js.map +1 -1
- package/dist/esm/core/orders/api/fetch.js +17 -0
- package/dist/esm/core/orders/api/fetch.js.map +1 -0
- package/dist/esm/core/orders/api/index.js +31 -0
- package/dist/esm/core/orders/api/index.js.map +1 -0
- package/dist/esm/core/orders/common.js +8 -0
- package/dist/esm/core/orders/common.js.map +1 -0
- package/dist/esm/core/orders/cross-chain.js +316 -0
- package/dist/esm/core/orders/cross-chain.js.map +1 -0
- package/dist/esm/core/orders/single-chain.js +185 -0
- package/dist/esm/core/orders/single-chain.js.map +1 -0
- package/dist/esm/core/sdk.js +77 -109
- package/dist/esm/core/sdk.js.map +1 -1
- package/dist/esm/core/solana/cancel-order.js +176 -0
- package/dist/esm/core/solana/cancel-order.js.map +1 -0
- package/dist/esm/core/solana/generated/{accounts → cross-chain/accounts}/adminSingleton.js +3 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js.map +1 -0
- package/dist/esm/core/solana/generated/{accounts → cross-chain/accounts}/guard.js +1 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/guard.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/accounts/index.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/accounts/order.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/errors/index.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/index.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js +91 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/index.js +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/index.js.map +1 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/initialize.js +19 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/programs/index.js.map +1 -0
- package/dist/esm/core/solana/generated/{programs → cross-chain/programs}/sourceChainGuard.js +16 -12
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js +18 -0
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdated.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/executionStarted.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/guardCreated.js.map +1 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/index.js +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/index.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/orderCancelled.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/orderCreated.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/orderFulfilled.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/types/tokenInSwapped.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js +58 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/dcaOrder.js +75 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/dcaOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/guard.js +62 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/guard.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/index.js +12 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/limitOrder.js +65 -0
- package/dist/esm/core/solana/generated/single-chain/accounts/limitOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/errors/index.js +9 -0
- package/dist/esm/core/solana/generated/single-chain/errors/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js +101 -0
- package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/index.js +13 -0
- package/dist/esm/core/solana/generated/single-chain/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js +91 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js +91 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js +91 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js +140 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js +188 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js +173 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js +184 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js +170 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js +167 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/index.js +20 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js +127 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js +98 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js +104 -0
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/programs/index.js +9 -0
- package/dist/esm/core/solana/generated/single-chain/programs/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js +90 -0
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/shared/index.js +82 -0
- package/dist/esm/core/solana/generated/single-chain/shared/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js +18 -0
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdated.js +18 -0
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdated.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js +24 -0
- package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderCreated.js +42 -0
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderCreated.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js +18 -0
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.js +30 -0
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js +26 -0
- package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/index.js +18 -0
- package/dist/esm/core/solana/generated/single-chain/types/index.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js +36 -0
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js +24 -0
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js.map +1 -0
- package/dist/esm/core/solana/generated/single-chain/types/orderCancelled.js +18 -0
- package/dist/esm/core/solana/generated/single-chain/types/orderCancelled.js.map +1 -0
- package/dist/esm/core/solana/order-instructions.js +89 -28
- package/dist/esm/core/solana/order-instructions.js.map +1 -1
- package/dist/esm/core/solana/sdk.js +86 -26
- package/dist/esm/core/solana/sdk.js.map +1 -1
- package/dist/esm/core/solana/utils.js +19 -0
- package/dist/esm/core/solana/utils.js.map +1 -0
- package/dist/esm/core/solana/validator.js +4 -1
- package/dist/esm/core/solana/validator.js.map +1 -1
- package/dist/esm/core/sui/cancel.js +36 -0
- package/dist/esm/core/sui/cancel.js.map +1 -0
- package/dist/esm/core/sui/order-transaction.js +10 -19
- package/dist/esm/core/sui/order-transaction.js.map +1 -1
- package/dist/esm/core/sui/sdk.js +49 -24
- package/dist/esm/core/sui/sdk.js.map +1 -1
- package/dist/esm/core/sui/validator.js +4 -1
- package/dist/esm/core/sui/validator.js.map +1 -1
- package/dist/esm/errors/index.js +0 -32
- package/dist/esm/errors/index.js.map +1 -1
- package/dist/esm/index.js +16 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api.js +6 -1
- package/dist/esm/types/api.js.map +1 -1
- package/dist/esm/utils/base-validator.js +16 -4
- package/dist/esm/utils/base-validator.js.map +1 -1
- package/dist/esm/utils/defillama.js +12 -23
- package/dist/esm/utils/defillama.js.map +1 -1
- package/dist/esm/utils/order-validator.js +17 -11
- package/dist/esm/utils/order-validator.js.map +1 -1
- package/dist/esm/utils/parsers.js +8 -31
- package/dist/esm/utils/parsers.js.map +1 -1
- package/dist/esm/utils/quote/aftermath.js +15 -0
- package/dist/esm/utils/quote/aftermath.js.map +1 -0
- package/dist/esm/utils/quote/aggregator.js +254 -0
- package/dist/esm/utils/quote/aggregator.js.map +1 -0
- package/dist/esm/utils/quote/jupiter.js +31 -0
- package/dist/esm/utils/quote/jupiter.js.map +1 -0
- package/dist/esm/utils/quote/liquidswap.js +22 -0
- package/dist/esm/utils/quote/liquidswap.js.map +1 -0
- package/dist/esm/utils/quote/paraswap.js +67 -0
- package/dist/esm/utils/quote/paraswap.js.map +1 -0
- package/dist/esm/utils/quote/stablecoins-tokens.js +13 -0
- package/dist/esm/utils/quote/stablecoins-tokens.js.map +1 -0
- package/dist/types/auth/siwe.d.ts +13 -0
- package/dist/types/auth/siwe.d.ts.map +1 -0
- package/dist/types/chains.d.ts +11 -9
- package/dist/types/chains.d.ts.map +1 -1
- package/dist/types/constants.d.ts +29 -11
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/core/evm/abi/single-chain-guard-limit.d.ts +596 -0
- package/dist/types/core/evm/abi/single-chain-guard-limit.d.ts.map +1 -0
- package/dist/types/core/evm/cancel-order.d.ts +28 -0
- package/dist/types/core/evm/cancel-order.d.ts.map +1 -0
- package/dist/types/core/evm/chain-provider.d.ts +62338 -0
- package/dist/types/core/evm/chain-provider.d.ts.map +1 -0
- package/dist/types/core/evm/connectors/hyperevm.d.ts +38 -0
- package/dist/types/core/evm/connectors/hyperevm.d.ts.map +1 -0
- package/dist/types/core/evm/intent-provider.d.ts +9 -6
- package/dist/types/core/evm/intent-provider.d.ts.map +1 -1
- package/dist/types/core/evm/order-signature.d.ts +9 -17
- package/dist/types/core/evm/order-signature.d.ts.map +1 -1
- package/dist/types/core/evm/permit2.d.ts +100 -4
- package/dist/types/core/evm/permit2.d.ts.map +1 -1
- package/dist/types/core/evm/sdk.d.ts +34 -27
- package/dist/types/core/evm/sdk.d.ts.map +1 -1
- package/dist/types/core/evm/validator.d.ts +8 -2
- package/dist/types/core/evm/validator.d.ts.map +1 -1
- package/dist/types/core/orders/api/fetch.d.ts +3 -0
- package/dist/types/core/orders/api/fetch.d.ts.map +1 -0
- package/dist/types/core/orders/api/index.d.ts +8 -0
- package/dist/types/core/orders/api/index.d.ts.map +1 -0
- package/dist/types/core/orders/common.d.ts +12 -0
- package/dist/types/core/orders/common.d.ts.map +1 -0
- package/dist/types/core/{order.d.ts → orders/cross-chain.d.ts} +36 -33
- package/dist/types/core/orders/cross-chain.d.ts.map +1 -0
- package/dist/types/core/orders/single-chain.d.ts +46 -0
- package/dist/types/core/orders/single-chain.d.ts.map +1 -0
- package/dist/types/core/sdk.d.ts +13 -77
- package/dist/types/core/sdk.d.ts.map +1 -1
- package/dist/types/core/solana/cancel-order.d.ts +18 -0
- package/dist/types/core/solana/cancel-order.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{accounts → cross-chain/accounts}/adminSingleton.d.ts +5 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{accounts → cross-chain/accounts}/guard.d.ts +1 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/guard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/accounts/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{accounts → cross-chain/accounts}/order.d.ts +1 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/order.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/errors/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts +56 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/claimTokens.d.ts +6 -6
- package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/collectProtocolFees.d.ts +3 -3
- package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/index.d.ts +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/initialize.d.ts +30 -7
- package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/setAdmin.d.ts +3 -3
- package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/setAuctioneerPubKey.d.ts +3 -3
- package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/programs/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{programs → cross-chain/programs}/sourceChainGuard.d.ts +17 -14
- package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts +16 -0
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/executionStarted.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/guardCreated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/index.d.ts +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/orderCancelled.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/orderCreated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/orderFulfilled.d.ts.map +1 -0
- package/dist/types/core/solana/generated/cross-chain/types/tokenInSwapped.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts +40 -0
- package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/accounts/dcaOrder.d.ts +99 -0
- package/dist/types/core/solana/generated/single-chain/accounts/dcaOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/accounts/guard.d.ts +48 -0
- package/dist/types/core/solana/generated/single-chain/accounts/guard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/accounts/index.d.ts +12 -0
- package/dist/types/core/solana/generated/single-chain/accounts/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/accounts/limitOrder.d.ts +79 -0
- package/dist/types/core/solana/generated/single-chain/accounts/limitOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/errors/index.d.ts +9 -0
- package/dist/types/core/solana/generated/single-chain/errors/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts +71 -0
- package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/index.d.ts +13 -0
- package/dist/types/core/solana/generated/single-chain/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts +56 -0
- package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts +72 -0
- package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts +72 -0
- package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts +91 -0
- package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts +134 -0
- package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts +107 -0
- package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts +126 -0
- package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts +179 -0
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts +179 -0
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/index.d.ts +20 -0
- package/dist/types/core/solana/generated/single-chain/instructions/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts +86 -0
- package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts +61 -0
- package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts +68 -0
- package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/programs/index.d.ts +9 -0
- package/dist/types/core/solana/generated/single-chain/programs/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts +63 -0
- package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/shared/index.d.ts +52 -0
- package/dist/types/core/solana/generated/single-chain/shared/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts +16 -0
- package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/adminUpdated.d.ts +16 -0
- package/dist/types/core/solana/generated/single-chain/types/adminUpdated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts +17 -0
- package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderCreated.d.ts +38 -0
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderCreated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts +16 -0
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.d.ts +26 -0
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/guardCreated.d.ts +18 -0
- package/dist/types/core/solana/generated/single-chain/types/guardCreated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/index.d.ts +18 -0
- package/dist/types/core/solana/generated/single-chain/types/index.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts +32 -0
- package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts +20 -0
- package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts.map +1 -0
- package/dist/types/core/solana/generated/single-chain/types/orderCancelled.d.ts +16 -0
- package/dist/types/core/solana/generated/single-chain/types/orderCancelled.d.ts.map +1 -0
- package/dist/types/core/solana/order-instructions.d.ts +14 -15
- package/dist/types/core/solana/order-instructions.d.ts.map +1 -1
- package/dist/types/core/solana/sdk.d.ts +8 -4
- package/dist/types/core/solana/sdk.d.ts.map +1 -1
- package/dist/types/core/solana/utils.d.ts +6 -0
- package/dist/types/core/solana/utils.d.ts.map +1 -0
- package/dist/types/core/solana/validator.d.ts +2 -1
- package/dist/types/core/solana/validator.d.ts.map +1 -1
- package/dist/types/core/sui/cancel.d.ts +3 -0
- package/dist/types/core/sui/cancel.d.ts.map +1 -0
- package/dist/types/core/sui/order-transaction.d.ts +2 -7
- package/dist/types/core/sui/order-transaction.d.ts.map +1 -1
- package/dist/types/core/sui/sdk.d.ts +6 -4
- package/dist/types/core/sui/sdk.d.ts.map +1 -1
- package/dist/types/core/sui/validator.d.ts +2 -1
- package/dist/types/core/sui/validator.d.ts.map +1 -1
- package/dist/types/errors/index.d.ts +0 -15
- package/dist/types/errors/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +20 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/api.d.ts +59 -2
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/intent.d.ts +33 -57
- package/dist/types/types/intent.d.ts.map +1 -1
- package/dist/types/utils/base-validator.d.ts +15 -4
- package/dist/types/utils/base-validator.d.ts.map +1 -1
- package/dist/types/utils/defillama.d.ts +1 -1
- package/dist/types/utils/defillama.d.ts.map +1 -1
- package/dist/types/utils/order-validator.d.ts +20 -11
- package/dist/types/utils/order-validator.d.ts.map +1 -1
- package/dist/types/utils/parsers.d.ts +0 -13
- package/dist/types/utils/parsers.d.ts.map +1 -1
- package/dist/types/utils/quote/aftermath.d.ts +9 -0
- package/dist/types/utils/quote/aftermath.d.ts.map +1 -0
- package/dist/types/utils/quote/aggregator.d.ts +64 -0
- package/dist/types/utils/quote/aggregator.d.ts.map +1 -0
- package/dist/types/utils/quote/jupiter.d.ts +16 -0
- package/dist/types/utils/quote/jupiter.d.ts.map +1 -0
- package/dist/types/utils/quote/liquidswap.d.ts +16 -0
- package/dist/types/utils/quote/liquidswap.d.ts.map +1 -0
- package/dist/types/utils/quote/paraswap.d.ts +23 -0
- package/dist/types/utils/quote/paraswap.d.ts.map +1 -0
- package/dist/types/utils/quote/stablecoins-tokens.d.ts +11 -0
- package/dist/types/utils/quote/stablecoins-tokens.d.ts.map +1 -0
- package/package.json +14 -2
- package/src/auth/siwe.ts +41 -0
- package/src/chains.ts +21 -10
- package/src/constants.ts +86 -38
- package/src/core/evm/abi/single-chain-guard-limit.ts +767 -0
- package/src/core/evm/cancel-order.ts +163 -0
- package/src/core/evm/{viem-provider.ts → chain-provider.ts} +18 -2
- package/src/core/evm/connectors/hyperevm.ts +23 -0
- package/src/core/evm/intent-provider.ts +71 -12
- package/src/core/evm/order-signature.ts +25 -38
- package/src/core/evm/permit2.ts +82 -12
- package/src/core/evm/sdk.ts +147 -89
- package/src/core/evm/validator.ts +73 -11
- package/src/core/orders/api/fetch.ts +22 -0
- package/src/core/orders/api/index.ts +33 -0
- package/src/core/orders/common.ts +19 -0
- package/src/core/orders/cross-chain.ts +323 -0
- package/src/core/orders/single-chain.ts +174 -0
- package/src/core/sdk.ts +102 -136
- package/src/core/solana/cancel-order.ts +264 -0
- package/src/core/solana/generated/{accounts → cross-chain/accounts}/adminSingleton.ts +15 -9
- package/src/core/solana/generated/{accounts → cross-chain/accounts}/guard.ts +10 -10
- package/src/core/solana/generated/{accounts → cross-chain/accounts}/order.ts +8 -8
- package/src/core/solana/generated/cross-chain/instructions/acceptAdmin.ts +200 -0
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/claimTokens.ts +10 -10
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/collectProtocolFees.ts +8 -8
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/createGuard.ts +5 -5
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/createOrder.ts +5 -5
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/index.ts +1 -0
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/initialize.ts +104 -12
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/setAdmin.ts +8 -8
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/setAuctioneerPubKey.ts +8 -8
- package/src/core/solana/generated/{programs → cross-chain/programs}/sourceChainGuard.ts +16 -2
- package/src/core/solana/generated/{shared → cross-chain/shared}/index.ts +2 -2
- package/src/core/solana/generated/cross-chain/types/adminUpdateStarted.ts +35 -0
- package/src/core/solana/generated/{types → cross-chain/types}/index.ts +1 -0
- package/src/core/solana/generated/single-chain/accounts/adminSingleton.ts +142 -0
- package/src/core/solana/generated/single-chain/accounts/dcaOrder.ts +222 -0
- package/src/core/solana/generated/single-chain/accounts/guard.ts +156 -0
- package/src/core/solana/generated/single-chain/accounts/index.ts +12 -0
- package/src/core/solana/generated/single-chain/accounts/limitOrder.ts +192 -0
- package/src/core/solana/generated/single-chain/errors/index.ts +9 -0
- package/src/core/solana/generated/single-chain/errors/singleChainGuard.ts +140 -0
- package/src/core/solana/generated/single-chain/index.ts +13 -0
- package/src/core/solana/generated/single-chain/instructions/acceptAdmin.ts +200 -0
- package/src/core/solana/generated/single-chain/instructions/cancelDcaOrder.ts +251 -0
- package/src/core/solana/generated/single-chain/instructions/cancelLimitOrder.ts +254 -0
- package/src/core/solana/generated/single-chain/instructions/collectProtocolFees.ts +373 -0
- package/src/core/solana/generated/single-chain/instructions/createDcaOrder.ts +500 -0
- package/src/core/solana/generated/single-chain/instructions/createGuard.ts +437 -0
- package/src/core/solana/generated/single-chain/instructions/createLimitOrder.ts +491 -0
- package/src/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.ts +538 -0
- package/src/core/solana/generated/single-chain/instructions/fulfillLimitOrder.ts +532 -0
- package/src/core/solana/generated/single-chain/instructions/index.ts +20 -0
- package/src/core/solana/generated/single-chain/instructions/initialize.ts +323 -0
- package/src/core/solana/generated/single-chain/instructions/setAdmin.ts +211 -0
- package/src/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.ts +241 -0
- package/src/core/solana/generated/single-chain/programs/index.ts +9 -0
- package/src/core/solana/generated/single-chain/programs/singleChainGuard.ts +247 -0
- package/src/core/solana/generated/single-chain/shared/index.ts +124 -0
- package/src/core/solana/generated/single-chain/types/adminUpdateStarted.ts +35 -0
- package/src/core/solana/generated/single-chain/types/adminUpdated.ts +35 -0
- package/src/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.ts +44 -0
- package/src/core/solana/generated/single-chain/types/dcaOrderCreated.ts +89 -0
- package/src/core/solana/generated/single-chain/types/dcaOrderFulfilled.ts +35 -0
- package/src/core/solana/generated/single-chain/types/dcaOrderIntervalFulfilled.ts +63 -0
- package/src/core/solana/generated/single-chain/types/guardCreated.ts +47 -0
- package/src/core/solana/generated/single-chain/types/index.ts +18 -0
- package/src/core/solana/generated/single-chain/types/limitOrderCreated.ts +77 -0
- package/src/core/solana/generated/single-chain/types/limitOrderFulfilled.ts +46 -0
- package/src/core/solana/generated/single-chain/types/orderCancelled.ts +35 -0
- package/src/core/solana/order-instructions.ts +166 -52
- package/src/core/solana/sdk.ts +134 -31
- package/src/core/solana/utils.ts +31 -0
- package/src/core/solana/validator.ts +5 -1
- package/src/core/sui/cancel.ts +44 -0
- package/src/core/sui/order-transaction.ts +14 -31
- package/src/core/sui/sdk.ts +75 -30
- package/src/core/sui/validator.ts +5 -1
- package/src/errors/index.ts +1 -37
- package/src/index.ts +36 -14
- package/src/types/api.ts +73 -4
- package/src/types/intent.ts +42 -63
- package/src/utils/base-validator.ts +26 -8
- package/src/utils/defillama.ts +15 -30
- package/src/utils/order-validator.ts +21 -23
- package/src/utils/parsers.ts +10 -35
- package/src/utils/quote/aftermath.ts +24 -0
- package/src/utils/quote/aggregator.ts +331 -0
- package/src/utils/quote/jupiter.ts +39 -0
- package/src/utils/quote/liquidswap.ts +42 -0
- package/src/utils/quote/paraswap.ts +87 -0
- package/src/utils/quote/stablecoins-tokens.ts +22 -0
- package/dist/esm/core/evm/viem-provider.js.map +0 -1
- package/dist/esm/core/order.js +0 -190
- package/dist/esm/core/order.js.map +0 -1
- package/dist/esm/core/solana/generated/accounts/adminSingleton.js.map +0 -1
- package/dist/esm/core/solana/generated/accounts/guard.js.map +0 -1
- package/dist/esm/core/solana/generated/accounts/index.js.map +0 -1
- package/dist/esm/core/solana/generated/accounts/order.js.map +0 -1
- package/dist/esm/core/solana/generated/errors/index.js.map +0 -1
- package/dist/esm/core/solana/generated/errors/sourceChainGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/index.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/cancelOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/claimTokens.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/collectProtocolFees.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/createGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/createOrder.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/index.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/initialize.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/preStartOrderExecution.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/setAdmin.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/setAuctioneerPubKey.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/startOrderExecution.js.map +0 -1
- package/dist/esm/core/solana/generated/instructions/startOrderExecutionAfterSwap.js.map +0 -1
- package/dist/esm/core/solana/generated/programs/index.js.map +0 -1
- package/dist/esm/core/solana/generated/programs/sourceChainGuard.js.map +0 -1
- package/dist/esm/core/solana/generated/shared/index.js.map +0 -1
- package/dist/esm/core/solana/generated/types/adminUpdated.js.map +0 -1
- package/dist/esm/core/solana/generated/types/auctioneerPubkeyUpdated.js.map +0 -1
- package/dist/esm/core/solana/generated/types/executionStarted.js.map +0 -1
- package/dist/esm/core/solana/generated/types/guardCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/types/index.js.map +0 -1
- package/dist/esm/core/solana/generated/types/orderCancelled.js.map +0 -1
- package/dist/esm/core/solana/generated/types/orderCreated.js.map +0 -1
- package/dist/esm/core/solana/generated/types/orderFulfilled.js.map +0 -1
- package/dist/esm/core/solana/generated/types/tokenInSwapped.js.map +0 -1
- package/dist/esm/types/user-order.js +0 -16
- package/dist/esm/types/user-order.js.map +0 -1
- package/dist/types/core/evm/viem-provider.d.ts +0 -19304
- package/dist/types/core/evm/viem-provider.d.ts.map +0 -1
- package/dist/types/core/order.d.ts.map +0 -1
- package/dist/types/core/solana/generated/accounts/adminSingleton.d.ts.map +0 -1
- package/dist/types/core/solana/generated/accounts/guard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/accounts/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/accounts/order.d.ts.map +0 -1
- package/dist/types/core/solana/generated/errors/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/errors/sourceChainGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/cancelOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/claimTokens.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/collectProtocolFees.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/createGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/createOrder.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/initialize.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/preStartOrderExecution.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/setAdmin.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/setAuctioneerPubKey.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/startOrderExecution.d.ts.map +0 -1
- package/dist/types/core/solana/generated/instructions/startOrderExecutionAfterSwap.d.ts.map +0 -1
- package/dist/types/core/solana/generated/programs/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/programs/sourceChainGuard.d.ts.map +0 -1
- package/dist/types/core/solana/generated/shared/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/adminUpdated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/auctioneerPubkeyUpdated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/executionStarted.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/guardCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/index.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/orderCancelled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/orderCreated.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/orderFulfilled.d.ts.map +0 -1
- package/dist/types/core/solana/generated/types/tokenInSwapped.d.ts.map +0 -1
- package/dist/types/types/user-order.d.ts +0 -37
- package/dist/types/types/user-order.d.ts.map +0 -1
- package/src/core/order.ts +0 -186
- package/src/types/user-order.ts +0 -74
- package/dist/esm/core/solana/generated/{accounts → cross-chain/accounts}/index.js +0 -0
- package/dist/esm/core/solana/generated/{accounts → cross-chain/accounts}/order.js +0 -0
- package/dist/esm/core/solana/generated/{errors → cross-chain/errors}/index.js +0 -0
- package/dist/esm/core/solana/generated/{errors → cross-chain/errors}/sourceChainGuard.js +0 -0
- package/dist/esm/core/solana/generated/{index.js → cross-chain/index.js} +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/cancelOrder.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/claimTokens.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/collectProtocolFees.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/createGuard.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/createOrder.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/preStartOrderExecution.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/setAdmin.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/setAuctioneerPubKey.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/startOrderExecution.js +0 -0
- package/dist/esm/core/solana/generated/{instructions → cross-chain/instructions}/startOrderExecutionAfterSwap.js +0 -0
- package/dist/esm/core/solana/generated/{programs → cross-chain/programs}/index.js +0 -0
- package/dist/esm/core/solana/generated/{shared → cross-chain/shared}/index.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/adminUpdated.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/auctioneerPubkeyUpdated.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/executionStarted.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/guardCreated.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/orderCancelled.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/orderCreated.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/orderFulfilled.js +0 -0
- package/dist/esm/core/solana/generated/{types → cross-chain/types}/tokenInSwapped.js +0 -0
- package/dist/types/core/solana/generated/{accounts → cross-chain/accounts}/index.d.ts +0 -0
- package/dist/types/core/solana/generated/{errors → cross-chain/errors}/index.d.ts +0 -0
- package/dist/types/core/solana/generated/{errors → cross-chain/errors}/sourceChainGuard.d.ts +0 -0
- package/dist/types/core/solana/generated/{index.d.ts → cross-chain/index.d.ts} +0 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/cancelOrder.d.ts +0 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/createGuard.d.ts +0 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/createOrder.d.ts +0 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/preStartOrderExecution.d.ts +0 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/startOrderExecution.d.ts +0 -0
- package/dist/types/core/solana/generated/{instructions → cross-chain/instructions}/startOrderExecutionAfterSwap.d.ts +0 -0
- package/dist/types/core/solana/generated/{programs → cross-chain/programs}/index.d.ts +0 -0
- package/dist/types/core/solana/generated/{shared → cross-chain/shared}/index.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/adminUpdated.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/auctioneerPubkeyUpdated.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/executionStarted.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/guardCreated.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/orderCancelled.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/orderCreated.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/orderFulfilled.d.ts +0 -0
- package/dist/types/core/solana/generated/{types → cross-chain/types}/tokenInSwapped.d.ts +0 -0
- package/src/core/solana/generated/{accounts → cross-chain/accounts}/index.ts +0 -0
- package/src/core/solana/generated/{errors → cross-chain/errors}/index.ts +0 -0
- package/src/core/solana/generated/{errors → cross-chain/errors}/sourceChainGuard.ts +0 -0
- package/src/core/solana/generated/{index.ts → cross-chain/index.ts} +0 -0
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/cancelOrder.ts +4 -4
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/preStartOrderExecution.ts +4 -4
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/startOrderExecution.ts +4 -4
- package/src/core/solana/generated/{instructions → cross-chain/instructions}/startOrderExecutionAfterSwap.ts +4 -4
- package/src/core/solana/generated/{programs → cross-chain/programs}/index.ts +0 -0
- package/src/core/solana/generated/{types → cross-chain/types}/adminUpdated.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/auctioneerPubkeyUpdated.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/executionStarted.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/guardCreated.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/orderCancelled.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/orderCreated.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/orderFulfilled.ts +4 -4
- package/src/core/solana/generated/{types → cross-chain/types}/tokenInSwapped.ts +4 -4
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
assertAccountExists,
|
|
11
|
+
assertAccountsExist,
|
|
12
|
+
decodeAccount,
|
|
13
|
+
fetchEncodedAccount,
|
|
14
|
+
fetchEncodedAccounts,
|
|
15
|
+
type Account,
|
|
16
|
+
type EncodedAccount,
|
|
17
|
+
type FetchAccountConfig,
|
|
18
|
+
type FetchAccountsConfig,
|
|
19
|
+
type MaybeAccount,
|
|
20
|
+
type MaybeEncodedAccount,
|
|
21
|
+
} from '@solana/kit';
|
|
22
|
+
import { getAddressDecoder, getAddressEncoder, type Address } from '@solana/kit';
|
|
23
|
+
import {
|
|
24
|
+
combineCodec,
|
|
25
|
+
fixDecoderSize,
|
|
26
|
+
fixEncoderSize,
|
|
27
|
+
getBytesDecoder,
|
|
28
|
+
getBytesEncoder,
|
|
29
|
+
getStructDecoder,
|
|
30
|
+
getStructEncoder,
|
|
31
|
+
getU64Decoder,
|
|
32
|
+
getU64Encoder,
|
|
33
|
+
getU8Decoder,
|
|
34
|
+
getU8Encoder,
|
|
35
|
+
transformEncoder,
|
|
36
|
+
type Codec,
|
|
37
|
+
type Decoder,
|
|
38
|
+
type Encoder,
|
|
39
|
+
type ReadonlyUint8Array,
|
|
40
|
+
} from '@solana/kit';
|
|
41
|
+
|
|
42
|
+
export const GUARD_DISCRIMINATOR = new Uint8Array([54, 187, 84, 137, 192, 15, 74, 248]);
|
|
43
|
+
|
|
44
|
+
export function getGuardDiscriminatorBytes() {
|
|
45
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(GUARD_DISCRIMINATOR);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type Guard = {
|
|
49
|
+
discriminator: ReadonlyUint8Array;
|
|
50
|
+
/** Token that is used for collected protocol fees */
|
|
51
|
+
feeToken: Address;
|
|
52
|
+
/** Version that allows having multiple Guards with same `fee_token` */
|
|
53
|
+
version: number;
|
|
54
|
+
/** PDA bump */
|
|
55
|
+
bump: number;
|
|
56
|
+
/** Public key of auctioneer that signs permissions and confirmations */
|
|
57
|
+
auctioneerPubKey: Address;
|
|
58
|
+
/** Amount of collected fees, in collateral tokens */
|
|
59
|
+
collectedFees: bigint;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type GuardArgs = {
|
|
63
|
+
/** Token that is used for collected protocol fees */
|
|
64
|
+
feeToken: Address;
|
|
65
|
+
/** Version that allows having multiple Guards with same `fee_token` */
|
|
66
|
+
version: number;
|
|
67
|
+
/** PDA bump */
|
|
68
|
+
bump: number;
|
|
69
|
+
/** Public key of auctioneer that signs permissions and confirmations */
|
|
70
|
+
auctioneerPubKey: Address;
|
|
71
|
+
/** Amount of collected fees, in collateral tokens */
|
|
72
|
+
collectedFees: number | bigint;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export function getGuardEncoder(): Encoder<GuardArgs> {
|
|
76
|
+
return transformEncoder(
|
|
77
|
+
getStructEncoder([
|
|
78
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
79
|
+
['feeToken', getAddressEncoder()],
|
|
80
|
+
['version', getU8Encoder()],
|
|
81
|
+
['bump', getU8Encoder()],
|
|
82
|
+
['auctioneerPubKey', getAddressEncoder()],
|
|
83
|
+
['collectedFees', getU64Encoder()],
|
|
84
|
+
]),
|
|
85
|
+
(value) => ({ ...value, discriminator: GUARD_DISCRIMINATOR }),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function getGuardDecoder(): Decoder<Guard> {
|
|
90
|
+
return getStructDecoder([
|
|
91
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
92
|
+
['feeToken', getAddressDecoder()],
|
|
93
|
+
['version', getU8Decoder()],
|
|
94
|
+
['bump', getU8Decoder()],
|
|
95
|
+
['auctioneerPubKey', getAddressDecoder()],
|
|
96
|
+
['collectedFees', getU64Decoder()],
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function getGuardCodec(): Codec<GuardArgs, Guard> {
|
|
101
|
+
return combineCodec(getGuardEncoder(), getGuardDecoder());
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function decodeGuard<TAddress extends string = string>(
|
|
105
|
+
encodedAccount: EncodedAccount<TAddress>,
|
|
106
|
+
): Account<Guard, TAddress>;
|
|
107
|
+
export function decodeGuard<TAddress extends string = string>(
|
|
108
|
+
encodedAccount: MaybeEncodedAccount<TAddress>,
|
|
109
|
+
): MaybeAccount<Guard, TAddress>;
|
|
110
|
+
export function decodeGuard<TAddress extends string = string>(
|
|
111
|
+
encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,
|
|
112
|
+
): Account<Guard, TAddress> | MaybeAccount<Guard, TAddress> {
|
|
113
|
+
return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getGuardDecoder());
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export async function fetchGuard<TAddress extends string = string>(
|
|
117
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
118
|
+
address: Address<TAddress>,
|
|
119
|
+
config?: FetchAccountConfig,
|
|
120
|
+
): Promise<Account<Guard, TAddress>> {
|
|
121
|
+
const maybeAccount = await fetchMaybeGuard(rpc, address, config);
|
|
122
|
+
assertAccountExists(maybeAccount);
|
|
123
|
+
return maybeAccount;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export async function fetchMaybeGuard<TAddress extends string = string>(
|
|
127
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
128
|
+
address: Address<TAddress>,
|
|
129
|
+
config?: FetchAccountConfig,
|
|
130
|
+
): Promise<MaybeAccount<Guard, TAddress>> {
|
|
131
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
132
|
+
return decodeGuard(maybeAccount);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export async function fetchAllGuard(
|
|
136
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
137
|
+
addresses: Array<Address>,
|
|
138
|
+
config?: FetchAccountsConfig,
|
|
139
|
+
): Promise<Account<Guard>[]> {
|
|
140
|
+
const maybeAccounts = await fetchAllMaybeGuard(rpc, addresses, config);
|
|
141
|
+
assertAccountsExist(maybeAccounts);
|
|
142
|
+
return maybeAccounts;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export async function fetchAllMaybeGuard(
|
|
146
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
147
|
+
addresses: Array<Address>,
|
|
148
|
+
config?: FetchAccountsConfig,
|
|
149
|
+
): Promise<MaybeAccount<Guard>[]> {
|
|
150
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
151
|
+
return maybeAccounts.map((maybeAccount) => decodeGuard(maybeAccount));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function getGuardSize(): number {
|
|
155
|
+
return 82;
|
|
156
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './adminSingleton.js';
|
|
10
|
+
export * from './dcaOrder.js';
|
|
11
|
+
export * from './guard.js';
|
|
12
|
+
export * from './limitOrder.js';
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
assertAccountExists,
|
|
11
|
+
assertAccountsExist,
|
|
12
|
+
decodeAccount,
|
|
13
|
+
fetchEncodedAccount,
|
|
14
|
+
fetchEncodedAccounts,
|
|
15
|
+
type Account,
|
|
16
|
+
type EncodedAccount,
|
|
17
|
+
type FetchAccountConfig,
|
|
18
|
+
type FetchAccountsConfig,
|
|
19
|
+
type MaybeAccount,
|
|
20
|
+
type MaybeEncodedAccount,
|
|
21
|
+
} from '@solana/kit';
|
|
22
|
+
import { getAddressDecoder, getAddressEncoder, type Address } from '@solana/kit';
|
|
23
|
+
import {
|
|
24
|
+
combineCodec,
|
|
25
|
+
fixDecoderSize,
|
|
26
|
+
fixEncoderSize,
|
|
27
|
+
getArrayDecoder,
|
|
28
|
+
getArrayEncoder,
|
|
29
|
+
getBytesDecoder,
|
|
30
|
+
getBytesEncoder,
|
|
31
|
+
getStructDecoder,
|
|
32
|
+
getStructEncoder,
|
|
33
|
+
getU32Decoder,
|
|
34
|
+
getU32Encoder,
|
|
35
|
+
getU64Decoder,
|
|
36
|
+
getU64Encoder,
|
|
37
|
+
transformEncoder,
|
|
38
|
+
type Codec,
|
|
39
|
+
type Decoder,
|
|
40
|
+
type Encoder,
|
|
41
|
+
type ReadonlyUint8Array,
|
|
42
|
+
} from '@solana/kit';
|
|
43
|
+
|
|
44
|
+
export const LIMIT_ORDER_DISCRIMINATOR = new Uint8Array([137, 183, 212, 91, 115, 29, 141, 227]);
|
|
45
|
+
|
|
46
|
+
export function getLimitOrderDiscriminatorBytes() {
|
|
47
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(LIMIT_ORDER_DISCRIMINATOR);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type LimitOrder = {
|
|
51
|
+
discriminator: ReadonlyUint8Array;
|
|
52
|
+
/** User address, that created this order */
|
|
53
|
+
user: Address;
|
|
54
|
+
/** Guard address, that will protect this order execution */
|
|
55
|
+
guard: Address;
|
|
56
|
+
/** Token IN that user wants to spend */
|
|
57
|
+
tokenInMint: Address;
|
|
58
|
+
/** Amount of tokens In locked */
|
|
59
|
+
amountIn: bigint;
|
|
60
|
+
/** Minimum amount of tokens OUT to receive */
|
|
61
|
+
amountOutMin: bigint;
|
|
62
|
+
/**
|
|
63
|
+
* Keccak256 hash of (token_out,receiver,extra_transfers_tokens_and_receivers,secret_number)
|
|
64
|
+
* Since we want to hide tokens OUT right until execution moment to protect user from
|
|
65
|
+
* any sort of MEV attack
|
|
66
|
+
*/
|
|
67
|
+
secretHash: ReadonlyUint8Array;
|
|
68
|
+
/**
|
|
69
|
+
* Array of requested extra transfers amounts
|
|
70
|
+
* Since we want to hide tokens OUT and receivers right until execution moment
|
|
71
|
+
* to protect user from any sort of MEV attack
|
|
72
|
+
* Tokens and receivers will be collected from `remaining_accounts`
|
|
73
|
+
* during fulfillment and checked against `secret_hash` value
|
|
74
|
+
*/
|
|
75
|
+
extraTransfersAmounts: Array<bigint>;
|
|
76
|
+
/** Deadline for the operation, in Unix timestamp format, in SECONDS */
|
|
77
|
+
deadline: number;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type LimitOrderArgs = {
|
|
81
|
+
/** User address, that created this order */
|
|
82
|
+
user: Address;
|
|
83
|
+
/** Guard address, that will protect this order execution */
|
|
84
|
+
guard: Address;
|
|
85
|
+
/** Token IN that user wants to spend */
|
|
86
|
+
tokenInMint: Address;
|
|
87
|
+
/** Amount of tokens In locked */
|
|
88
|
+
amountIn: number | bigint;
|
|
89
|
+
/** Minimum amount of tokens OUT to receive */
|
|
90
|
+
amountOutMin: number | bigint;
|
|
91
|
+
/**
|
|
92
|
+
* Keccak256 hash of (token_out,receiver,extra_transfers_tokens_and_receivers,secret_number)
|
|
93
|
+
* Since we want to hide tokens OUT right until execution moment to protect user from
|
|
94
|
+
* any sort of MEV attack
|
|
95
|
+
*/
|
|
96
|
+
secretHash: ReadonlyUint8Array;
|
|
97
|
+
/**
|
|
98
|
+
* Array of requested extra transfers amounts
|
|
99
|
+
* Since we want to hide tokens OUT and receivers right until execution moment
|
|
100
|
+
* to protect user from any sort of MEV attack
|
|
101
|
+
* Tokens and receivers will be collected from `remaining_accounts`
|
|
102
|
+
* during fulfillment and checked against `secret_hash` value
|
|
103
|
+
*/
|
|
104
|
+
extraTransfersAmounts: Array<number | bigint>;
|
|
105
|
+
/** Deadline for the operation, in Unix timestamp format, in SECONDS */
|
|
106
|
+
deadline: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export function getLimitOrderEncoder(): Encoder<LimitOrderArgs> {
|
|
110
|
+
return transformEncoder(
|
|
111
|
+
getStructEncoder([
|
|
112
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
113
|
+
['user', getAddressEncoder()],
|
|
114
|
+
['guard', getAddressEncoder()],
|
|
115
|
+
['tokenInMint', getAddressEncoder()],
|
|
116
|
+
['amountIn', getU64Encoder()],
|
|
117
|
+
['amountOutMin', getU64Encoder()],
|
|
118
|
+
['secretHash', fixEncoderSize(getBytesEncoder(), 32)],
|
|
119
|
+
['extraTransfersAmounts', getArrayEncoder(getU64Encoder())],
|
|
120
|
+
['deadline', getU32Encoder()],
|
|
121
|
+
]),
|
|
122
|
+
(value) => ({ ...value, discriminator: LIMIT_ORDER_DISCRIMINATOR }),
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function getLimitOrderDecoder(): Decoder<LimitOrder> {
|
|
127
|
+
return getStructDecoder([
|
|
128
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
129
|
+
['user', getAddressDecoder()],
|
|
130
|
+
['guard', getAddressDecoder()],
|
|
131
|
+
['tokenInMint', getAddressDecoder()],
|
|
132
|
+
['amountIn', getU64Decoder()],
|
|
133
|
+
['amountOutMin', getU64Decoder()],
|
|
134
|
+
['secretHash', fixDecoderSize(getBytesDecoder(), 32)],
|
|
135
|
+
['extraTransfersAmounts', getArrayDecoder(getU64Decoder())],
|
|
136
|
+
['deadline', getU32Decoder()],
|
|
137
|
+
]);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function getLimitOrderCodec(): Codec<LimitOrderArgs, LimitOrder> {
|
|
141
|
+
return combineCodec(getLimitOrderEncoder(), getLimitOrderDecoder());
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function decodeLimitOrder<TAddress extends string = string>(
|
|
145
|
+
encodedAccount: EncodedAccount<TAddress>,
|
|
146
|
+
): Account<LimitOrder, TAddress>;
|
|
147
|
+
export function decodeLimitOrder<TAddress extends string = string>(
|
|
148
|
+
encodedAccount: MaybeEncodedAccount<TAddress>,
|
|
149
|
+
): MaybeAccount<LimitOrder, TAddress>;
|
|
150
|
+
export function decodeLimitOrder<TAddress extends string = string>(
|
|
151
|
+
encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,
|
|
152
|
+
): Account<LimitOrder, TAddress> | MaybeAccount<LimitOrder, TAddress> {
|
|
153
|
+
return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getLimitOrderDecoder());
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export async function fetchLimitOrder<TAddress extends string = string>(
|
|
157
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
158
|
+
address: Address<TAddress>,
|
|
159
|
+
config?: FetchAccountConfig,
|
|
160
|
+
): Promise<Account<LimitOrder, TAddress>> {
|
|
161
|
+
const maybeAccount = await fetchMaybeLimitOrder(rpc, address, config);
|
|
162
|
+
assertAccountExists(maybeAccount);
|
|
163
|
+
return maybeAccount;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export async function fetchMaybeLimitOrder<TAddress extends string = string>(
|
|
167
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
168
|
+
address: Address<TAddress>,
|
|
169
|
+
config?: FetchAccountConfig,
|
|
170
|
+
): Promise<MaybeAccount<LimitOrder, TAddress>> {
|
|
171
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
172
|
+
return decodeLimitOrder(maybeAccount);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export async function fetchAllLimitOrder(
|
|
176
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
177
|
+
addresses: Array<Address>,
|
|
178
|
+
config?: FetchAccountsConfig,
|
|
179
|
+
): Promise<Account<LimitOrder>[]> {
|
|
180
|
+
const maybeAccounts = await fetchAllMaybeLimitOrder(rpc, addresses, config);
|
|
181
|
+
assertAccountsExist(maybeAccounts);
|
|
182
|
+
return maybeAccounts;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export async function fetchAllMaybeLimitOrder(
|
|
186
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
187
|
+
addresses: Array<Address>,
|
|
188
|
+
config?: FetchAccountsConfig,
|
|
189
|
+
): Promise<MaybeAccount<LimitOrder>[]> {
|
|
190
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
191
|
+
return maybeAccounts.map((maybeAccount) => decodeLimitOrder(maybeAccount));
|
|
192
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './singleChainGuard.js';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { type Address } from '@solana/kit';
|
|
10
|
+
import { type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';
|
|
11
|
+
import { isProgramError } from '@solana/kit';
|
|
12
|
+
import { SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
13
|
+
|
|
14
|
+
/** NotUpgradeAuthority: Account is not upgrade authority */
|
|
15
|
+
export const SINGLE_CHAIN_GUARD_ERROR__NOT_UPGRADE_AUTHORITY = 0x1770; // 6000
|
|
16
|
+
/** NotAdmin: Account is not Admin */
|
|
17
|
+
export const SINGLE_CHAIN_GUARD_ERROR__NOT_ADMIN = 0x1771; // 6001
|
|
18
|
+
/** NotPendingAdmin: Account is not Pending Admin */
|
|
19
|
+
export const SINGLE_CHAIN_GUARD_ERROR__NOT_PENDING_ADMIN = 0x1772; // 6002
|
|
20
|
+
/** NotASolver: Account is not a Solver */
|
|
21
|
+
export const SINGLE_CHAIN_GUARD_ERROR__NOT_A_SOLVER = 0x1773; // 6003
|
|
22
|
+
/** NotAUser: Account is not a User */
|
|
23
|
+
export const SINGLE_CHAIN_GUARD_ERROR__NOT_A_USER = 0x1774; // 6004
|
|
24
|
+
/** ZeroAmount: Amount must not be zero */
|
|
25
|
+
export const SINGLE_CHAIN_GUARD_ERROR__ZERO_AMOUNT = 0x1775; // 6005
|
|
26
|
+
/** ZeroAmountIn: Amount IN must not be zero */
|
|
27
|
+
export const SINGLE_CHAIN_GUARD_ERROR__ZERO_AMOUNT_IN = 0x1776; // 6006
|
|
28
|
+
/** WrongOrder: Wrong order */
|
|
29
|
+
export const SINGLE_CHAIN_GUARD_ERROR__WRONG_ORDER = 0x1777; // 6007
|
|
30
|
+
/** InvalidGuard: Invalid Guard */
|
|
31
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INVALID_GUARD = 0x1778; // 6008
|
|
32
|
+
/** ExpiredDeadline: Expired deadline */
|
|
33
|
+
export const SINGLE_CHAIN_GUARD_ERROR__EXPIRED_DEADLINE = 0x1779; // 6009
|
|
34
|
+
/** InvalidStartPermission: Invalid permission */
|
|
35
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INVALID_START_PERMISSION = 0x177a; // 6010
|
|
36
|
+
/** SystemProgramNotProvided: System program not provided */
|
|
37
|
+
export const SINGLE_CHAIN_GUARD_ERROR__SYSTEM_PROGRAM_NOT_PROVIDED = 0x177b; // 6011
|
|
38
|
+
/** TokenOutAccountNotProvided: Token OUT account not provided */
|
|
39
|
+
export const SINGLE_CHAIN_GUARD_ERROR__TOKEN_OUT_ACCOUNT_NOT_PROVIDED = 0x177c; // 6012
|
|
40
|
+
/** ExtraTransferAccountNotProvided: Extra transfer account not provided */
|
|
41
|
+
export const SINGLE_CHAIN_GUARD_ERROR__EXTRA_TRANSFER_ACCOUNT_NOT_PROVIDED = 0x177d; // 6013
|
|
42
|
+
/** InvalidExtraTransferAccount: Invalid extra transfer account */
|
|
43
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INVALID_EXTRA_TRANSFER_ACCOUNT = 0x177e; // 6014
|
|
44
|
+
/** CpiCallNotAllowed: CPI call is not allowed */
|
|
45
|
+
export const SINGLE_CHAIN_GUARD_ERROR__CPI_CALL_NOT_ALLOWED = 0x177f; // 6015
|
|
46
|
+
/** FeeTransferNotAllowed: Fee transfer not allowed */
|
|
47
|
+
export const SINGLE_CHAIN_GUARD_ERROR__FEE_TRANSFER_NOT_ALLOWED = 0x1780; // 6016
|
|
48
|
+
/** BelowMinAmountOut: Below minimum amount OUT */
|
|
49
|
+
export const SINGLE_CHAIN_GUARD_ERROR__BELOW_MIN_AMOUNT_OUT = 0x1781; // 6017
|
|
50
|
+
/** SecretHashMismatch: Secret hash mismatch */
|
|
51
|
+
export const SINGLE_CHAIN_GUARD_ERROR__SECRET_HASH_MISMATCH = 0x1782; // 6018
|
|
52
|
+
/** InvalidIntervalDuration: Invalid interval duration */
|
|
53
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INVALID_INTERVAL_DURATION = 0x1783; // 6019
|
|
54
|
+
/** InvalidDcaOrder: Invalid DCA order */
|
|
55
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INVALID_DCA_ORDER = 0x1784; // 6020
|
|
56
|
+
/** IntervalIsFulfilled: Interval is already fulfilled */
|
|
57
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INTERVAL_IS_FULFILLED = 0x1785; // 6021
|
|
58
|
+
/** InstructionNotFound: Ed25519Program instruction */
|
|
59
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INSTRUCTION_NOT_FOUND = 0x1786; // 6022
|
|
60
|
+
/** SigVerificationFailed: Signature verification failed */
|
|
61
|
+
export const SINGLE_CHAIN_GUARD_ERROR__SIG_VERIFICATION_FAILED = 0x1787; // 6023
|
|
62
|
+
/** InvalidSigner: Invalid signer */
|
|
63
|
+
export const SINGLE_CHAIN_GUARD_ERROR__INVALID_SIGNER = 0x1788; // 6024
|
|
64
|
+
|
|
65
|
+
export type SingleChainGuardError =
|
|
66
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__BELOW_MIN_AMOUNT_OUT
|
|
67
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__CPI_CALL_NOT_ALLOWED
|
|
68
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__EXPIRED_DEADLINE
|
|
69
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__EXTRA_TRANSFER_ACCOUNT_NOT_PROVIDED
|
|
70
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__FEE_TRANSFER_NOT_ALLOWED
|
|
71
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INSTRUCTION_NOT_FOUND
|
|
72
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INTERVAL_IS_FULFILLED
|
|
73
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INVALID_DCA_ORDER
|
|
74
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INVALID_EXTRA_TRANSFER_ACCOUNT
|
|
75
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INVALID_GUARD
|
|
76
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INVALID_INTERVAL_DURATION
|
|
77
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INVALID_SIGNER
|
|
78
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__INVALID_START_PERMISSION
|
|
79
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__NOT_ADMIN
|
|
80
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__NOT_A_SOLVER
|
|
81
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__NOT_A_USER
|
|
82
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__NOT_PENDING_ADMIN
|
|
83
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__NOT_UPGRADE_AUTHORITY
|
|
84
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__SECRET_HASH_MISMATCH
|
|
85
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__SIG_VERIFICATION_FAILED
|
|
86
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__SYSTEM_PROGRAM_NOT_PROVIDED
|
|
87
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__TOKEN_OUT_ACCOUNT_NOT_PROVIDED
|
|
88
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__WRONG_ORDER
|
|
89
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__ZERO_AMOUNT
|
|
90
|
+
| typeof SINGLE_CHAIN_GUARD_ERROR__ZERO_AMOUNT_IN;
|
|
91
|
+
|
|
92
|
+
let singleChainGuardErrorMessages: Record<SingleChainGuardError, string> | undefined;
|
|
93
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
94
|
+
singleChainGuardErrorMessages = {
|
|
95
|
+
[SINGLE_CHAIN_GUARD_ERROR__BELOW_MIN_AMOUNT_OUT]: `Below minimum amount OUT`,
|
|
96
|
+
[SINGLE_CHAIN_GUARD_ERROR__CPI_CALL_NOT_ALLOWED]: `CPI call is not allowed`,
|
|
97
|
+
[SINGLE_CHAIN_GUARD_ERROR__EXPIRED_DEADLINE]: `Expired deadline`,
|
|
98
|
+
[SINGLE_CHAIN_GUARD_ERROR__EXTRA_TRANSFER_ACCOUNT_NOT_PROVIDED]: `Extra transfer account not provided`,
|
|
99
|
+
[SINGLE_CHAIN_GUARD_ERROR__FEE_TRANSFER_NOT_ALLOWED]: `Fee transfer not allowed`,
|
|
100
|
+
[SINGLE_CHAIN_GUARD_ERROR__INSTRUCTION_NOT_FOUND]: `Ed25519Program instruction`,
|
|
101
|
+
[SINGLE_CHAIN_GUARD_ERROR__INTERVAL_IS_FULFILLED]: `Interval is already fulfilled`,
|
|
102
|
+
[SINGLE_CHAIN_GUARD_ERROR__INVALID_DCA_ORDER]: `Invalid DCA order`,
|
|
103
|
+
[SINGLE_CHAIN_GUARD_ERROR__INVALID_EXTRA_TRANSFER_ACCOUNT]: `Invalid extra transfer account`,
|
|
104
|
+
[SINGLE_CHAIN_GUARD_ERROR__INVALID_GUARD]: `Invalid Guard`,
|
|
105
|
+
[SINGLE_CHAIN_GUARD_ERROR__INVALID_INTERVAL_DURATION]: `Invalid interval duration`,
|
|
106
|
+
[SINGLE_CHAIN_GUARD_ERROR__INVALID_SIGNER]: `Invalid signer`,
|
|
107
|
+
[SINGLE_CHAIN_GUARD_ERROR__INVALID_START_PERMISSION]: `Invalid permission`,
|
|
108
|
+
[SINGLE_CHAIN_GUARD_ERROR__NOT_ADMIN]: `Account is not Admin`,
|
|
109
|
+
[SINGLE_CHAIN_GUARD_ERROR__NOT_A_SOLVER]: `Account is not a Solver`,
|
|
110
|
+
[SINGLE_CHAIN_GUARD_ERROR__NOT_A_USER]: `Account is not a User`,
|
|
111
|
+
[SINGLE_CHAIN_GUARD_ERROR__NOT_PENDING_ADMIN]: `Account is not Pending Admin`,
|
|
112
|
+
[SINGLE_CHAIN_GUARD_ERROR__NOT_UPGRADE_AUTHORITY]: `Account is not upgrade authority`,
|
|
113
|
+
[SINGLE_CHAIN_GUARD_ERROR__SECRET_HASH_MISMATCH]: `Secret hash mismatch`,
|
|
114
|
+
[SINGLE_CHAIN_GUARD_ERROR__SIG_VERIFICATION_FAILED]: `Signature verification failed`,
|
|
115
|
+
[SINGLE_CHAIN_GUARD_ERROR__SYSTEM_PROGRAM_NOT_PROVIDED]: `System program not provided`,
|
|
116
|
+
[SINGLE_CHAIN_GUARD_ERROR__TOKEN_OUT_ACCOUNT_NOT_PROVIDED]: `Token OUT account not provided`,
|
|
117
|
+
[SINGLE_CHAIN_GUARD_ERROR__WRONG_ORDER]: `Wrong order`,
|
|
118
|
+
[SINGLE_CHAIN_GUARD_ERROR__ZERO_AMOUNT]: `Amount must not be zero`,
|
|
119
|
+
[SINGLE_CHAIN_GUARD_ERROR__ZERO_AMOUNT_IN]: `Amount IN must not be zero`,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function getSingleChainGuardErrorMessage(code: SingleChainGuardError): string {
|
|
124
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
125
|
+
return (singleChainGuardErrorMessages as Record<SingleChainGuardError, string>)[code];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return 'Error message not available in production bundles.';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function isSingleChainGuardError<TProgramErrorCode extends SingleChainGuardError>(
|
|
132
|
+
error: unknown,
|
|
133
|
+
transactionMessage: {
|
|
134
|
+
instructions: Record<number, { programAddress: Address }>;
|
|
135
|
+
},
|
|
136
|
+
code?: TProgramErrorCode,
|
|
137
|
+
): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &
|
|
138
|
+
Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {
|
|
139
|
+
return isProgramError<TProgramErrorCode>(error, transactionMessage, SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS, code);
|
|
140
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './accounts/index.js';
|
|
10
|
+
export * from './errors/index.js';
|
|
11
|
+
export * from './instructions/index.js';
|
|
12
|
+
export * from './programs/index.js';
|
|
13
|
+
export * from './types/index.js';
|