@shogun-sdk/intents-sdk 1.2.6-test → 1.2.6-test.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/chains.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/evm/cross-chain-limit-order.js +11 -11
- package/dist/esm/core/evm/cross-chain-limit-order.js.map +1 -1
- package/dist/esm/core/evm/intent-helpers.js +1 -1
- package/dist/esm/core/evm/intent-helpers.js.map +1 -1
- package/dist/esm/core/evm/single-chain-dca-order.js +15 -15
- package/dist/esm/core/evm/single-chain-dca-order.js.map +1 -1
- package/dist/esm/core/evm/single-chain-limit-order.js +12 -12
- package/dist/esm/core/evm/single-chain-limit-order.js.map +1 -1
- package/dist/esm/core/evm/types.js +3 -3
- package/dist/esm/core/solana/client.js +1 -1
- package/dist/esm/core/solana/client.js.map +1 -1
- package/dist/esm/core/solana/dca/single-chain-dca-order.js +8 -9
- package/dist/esm/core/solana/dca/single-chain-dca-order.js.map +1 -1
- package/dist/esm/core/solana/dca/single-chain-limit-order.js +9 -10
- package/dist/esm/core/solana/dca/single-chain-limit-order.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js +1 -3
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js +4 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js +4 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js +4 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js +2 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js +3 -5
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js +2 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js +6 -5
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js +4 -14
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js +1 -3
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js +1 -1
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js +2 -2
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaExecutionStarted.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaTokenInSwapped.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js +1 -3
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js +4 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js +5 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js +5 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js +5 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js +2 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js +3 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js +2 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js +2 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js +2 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js +6 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js +4 -14
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js +1 -1
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/shared/index.js +2 -2
- package/dist/esm/core/solana/generated/single-chain/shared/index.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js.map +1 -1
- package/dist/esm/core/solana/intent-helpers.js +3 -3
- package/dist/esm/core/solana/intent-helpers.js.map +1 -1
- package/dist/esm/core/solana/utils.js +4 -7
- package/dist/esm/core/solana/utils.js.map +1 -1
- package/dist/esm/core/sui/cross-chain-limit-order.js +1 -3
- package/dist/esm/core/sui/cross-chain-limit-order.js.map +1 -1
- package/dist/esm/core/sui/intent-helpers.js.map +1 -1
- package/dist/esm/core/sui/single-chain-dca-order.js +9 -21
- package/dist/esm/core/sui/single-chain-dca-order.js.map +1 -1
- package/dist/esm/core/sui/single-chain-limit-order.js +10 -24
- package/dist/esm/core/sui/single-chain-limit-order.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api.js.map +1 -1
- package/dist/esm/utils/generate-execution-details-hash.js +3 -3
- package/dist/esm/utils/generate-execution-details-hash.js.map +1 -1
- package/dist/esm/utils/quote/aggregator.js +71 -52
- package/dist/esm/utils/quote/aggregator.js.map +1 -1
- package/dist/esm/utils/quote/liquidswap.js +34 -9
- package/dist/esm/utils/quote/liquidswap.js.map +1 -1
- package/dist/esm/utils/quote/stablecoins-tokens.js +31 -9
- package/dist/esm/utils/quote/stablecoins-tokens.js.map +1 -1
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/core/evm/cross-chain-limit-order.d.ts +1 -1
- package/dist/types/core/evm/intent-helpers.d.ts.map +1 -1
- package/dist/types/core/evm/single-chain-dca-order.d.ts +2 -2
- package/dist/types/core/evm/single-chain-limit-order.d.ts +2 -2
- package/dist/types/core/evm/types.d.ts +1 -1
- package/dist/types/core/solana/dca/single-chain-dca-order.d.ts +2 -2
- package/dist/types/core/solana/dca/single-chain-dca-order.d.ts.map +1 -1
- package/dist/types/core/solana/dca/single-chain-limit-order.d.ts +1 -1
- package/dist/types/core/solana/dca/single-chain-limit-order.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaExecutionStarted.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaTokenInSwapped.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/shared/index.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts.map +1 -1
- package/dist/types/core/solana/intent-helpers.d.ts.map +1 -1
- package/dist/types/core/solana/utils.d.ts.map +1 -1
- package/dist/types/core/sui/cross-chain-limit-order.d.ts.map +1 -1
- package/dist/types/core/sui/intent-helpers.d.ts.map +1 -1
- package/dist/types/core/sui/single-chain-dca-order.d.ts.map +1 -1
- package/dist/types/core/sui/single-chain-limit-order.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/api.d.ts +10 -1
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/intent.d.ts.map +1 -1
- package/dist/types/utils/generate-execution-details-hash.d.ts +1 -1
- package/dist/types/utils/generate-execution-details-hash.d.ts.map +1 -1
- package/dist/types/utils/quote/aggregator.d.ts +0 -2
- package/dist/types/utils/quote/aggregator.d.ts.map +1 -1
- package/dist/types/utils/quote/liquidswap.d.ts +4 -2
- package/dist/types/utils/quote/liquidswap.d.ts.map +1 -1
- package/dist/types/utils/quote/stablecoins-tokens.d.ts +4 -1
- package/dist/types/utils/quote/stablecoins-tokens.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/chains.ts +2 -2
- package/src/constants.ts +5 -5
- package/src/core/evm/cross-chain-limit-order.ts +14 -14
- package/src/core/evm/intent-helpers.ts +14 -8
- 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/solana/client.ts +1 -1
- package/src/core/solana/dca/single-chain-dca-order.ts +18 -21
- package/src/core/solana/dca/single-chain-limit-order.ts +19 -22
- package/src/core/solana/generated/cross-chain/accounts/adminSingleton.ts +9 -11
- package/src/core/solana/generated/cross-chain/accounts/dcaOrder.ts +8 -8
- package/src/core/solana/generated/cross-chain/accounts/guard.ts +8 -8
- package/src/core/solana/generated/cross-chain/accounts/order.ts +8 -8
- package/src/core/solana/generated/cross-chain/errors/sourceChainGuard.ts +2 -7
- package/src/core/solana/generated/cross-chain/instructions/acceptAdmin.ts +10 -20
- package/src/core/solana/generated/cross-chain/instructions/cancelDcaOrder.ts +13 -31
- package/src/core/solana/generated/cross-chain/instructions/cancelOrder.ts +8 -16
- package/src/core/solana/generated/cross-chain/instructions/claimTokens.ts +9 -19
- package/src/core/solana/generated/cross-chain/instructions/collectProtocolFees.ts +10 -19
- package/src/core/solana/generated/cross-chain/instructions/createDcaOrder.ts +14 -36
- package/src/core/solana/generated/cross-chain/instructions/createGuard.ts +12 -33
- package/src/core/solana/generated/cross-chain/instructions/createOrder.ts +12 -30
- package/src/core/solana/generated/cross-chain/instructions/initialize.ts +14 -29
- package/src/core/solana/generated/cross-chain/instructions/preStartOrderExecution.ts +11 -21
- package/src/core/solana/generated/cross-chain/instructions/setAdmin.ts +8 -23
- package/src/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.ts +16 -64
- package/src/core/solana/generated/cross-chain/instructions/startOrderExecution.ts +9 -18
- package/src/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.ts +8 -16
- package/src/core/solana/generated/cross-chain/programs/sourceChainGuard.ts +40 -83
- package/src/core/solana/generated/cross-chain/shared/index.ts +7 -16
- package/src/core/solana/generated/cross-chain/types/adminUpdateStarted.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/dcaExecutionStarted.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/dcaTokenInSwapped.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.ts +1 -4
- package/src/core/solana/generated/single-chain/accounts/adminSingleton.ts +9 -11
- package/src/core/solana/generated/single-chain/accounts/dcaOrder.ts +8 -8
- package/src/core/solana/generated/single-chain/accounts/guard.ts +8 -8
- package/src/core/solana/generated/single-chain/accounts/limitOrder.ts +8 -8
- package/src/core/solana/generated/single-chain/errors/singleChainGuard.ts +2 -7
- package/src/core/solana/generated/single-chain/instructions/acceptAdmin.ts +10 -20
- package/src/core/solana/generated/single-chain/instructions/cancelDcaOrder.ts +11 -25
- package/src/core/solana/generated/single-chain/instructions/cancelLimitOrder.ts +11 -25
- package/src/core/solana/generated/single-chain/instructions/collectProtocolFees.ts +12 -25
- package/src/core/solana/generated/single-chain/instructions/createDcaOrder.ts +14 -36
- package/src/core/solana/generated/single-chain/instructions/createGuard.ts +15 -42
- package/src/core/solana/generated/single-chain/instructions/createLimitOrder.ts +14 -36
- package/src/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.ts +15 -38
- package/src/core/solana/generated/single-chain/instructions/fulfillLimitOrder.ts +15 -41
- package/src/core/solana/generated/single-chain/instructions/initialize.ts +14 -29
- package/src/core/solana/generated/single-chain/instructions/setAdmin.ts +8 -23
- package/src/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.ts +16 -64
- package/src/core/solana/generated/single-chain/programs/singleChainGuard.ts +36 -75
- package/src/core/solana/generated/single-chain/shared/index.ts +7 -16
- package/src/core/solana/generated/single-chain/types/adminUpdateStarted.ts +1 -4
- package/src/core/solana/generated/single-chain/types/dcaOrderFulfilled.ts +1 -4
- package/src/core/solana/generated/single-chain/types/limitOrderCreated.ts +1 -4
- package/src/core/solana/generated/single-chain/types/limitOrderFulfilled.ts +1 -4
- package/src/core/solana/intent-helpers.ts +20 -16
- package/src/core/solana/sdk.ts +1 -1
- package/src/core/solana/utils.ts +16 -19
- package/src/core/sui/cross-chain-limit-order.ts +1 -4
- package/src/core/sui/intent-helpers.ts +16 -25
- package/src/core/sui/order-transaction.ts +1 -1
- package/src/core/sui/single-chain-dca-order.ts +18 -31
- package/src/core/sui/single-chain-limit-order.ts +18 -33
- package/src/index.ts +2 -2
- package/src/types/api.ts +10 -1
- package/src/types/intent.ts +4 -2
- package/src/utils/generate-execution-details-hash.ts +25 -23
- package/src/utils/quote/aggregator.ts +92 -71
- package/src/utils/quote/liquidswap.ts +42 -13
- package/src/utils/quote/stablecoins-tokens.ts +31 -9
- package/dist/esm/core/evm/permit2-signature-transfer.js +0 -15
- package/dist/esm/core/evm/permit2-signature-transfer.js.map +0 -1
- package/dist/types/core/evm/permit2-signature-transfer.d.ts +0 -3
- package/dist/types/core/evm/permit2-signature-transfer.d.ts.map +0 -1
- package/src/core/evm/permit2-signature-transfer.ts +0 -15
|
@@ -52,9 +52,7 @@ export type CreateLimitOrderInstruction<
|
|
|
52
52
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
53
53
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
54
54
|
TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
|
|
55
|
-
TAccountAssociatedTokenProgram extends
|
|
56
|
-
| string
|
|
57
|
-
| AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
|
|
55
|
+
TAccountAssociatedTokenProgram extends string | AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
|
|
58
56
|
TAccountTokenInMint extends string | AccountMeta<string> = string,
|
|
59
57
|
TAccountUserTokenInAccount extends string | AccountMeta<string> = string,
|
|
60
58
|
TAccountGuardTokenInAccount extends string | AccountMeta<string> = string,
|
|
@@ -71,24 +69,18 @@ export type CreateLimitOrderInstruction<
|
|
|
71
69
|
? WritableSignerAccount<TAccountOrder> & AccountSignerMeta<TAccountOrder>
|
|
72
70
|
: TAccountOrder,
|
|
73
71
|
TAccountGuard extends string ? ReadonlyAccount<TAccountGuard> : TAccountGuard,
|
|
74
|
-
TAccountSystemProgram extends string
|
|
75
|
-
? ReadonlyAccount<TAccountSystemProgram>
|
|
76
|
-
: TAccountSystemProgram,
|
|
72
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
77
73
|
TAccountAssociatedTokenProgram extends string
|
|
78
74
|
? ReadonlyAccount<TAccountAssociatedTokenProgram>
|
|
79
75
|
: TAccountAssociatedTokenProgram,
|
|
80
|
-
TAccountTokenInMint extends string
|
|
81
|
-
? ReadonlyAccount<TAccountTokenInMint>
|
|
82
|
-
: TAccountTokenInMint,
|
|
76
|
+
TAccountTokenInMint extends string ? ReadonlyAccount<TAccountTokenInMint> : TAccountTokenInMint,
|
|
83
77
|
TAccountUserTokenInAccount extends string
|
|
84
78
|
? WritableAccount<TAccountUserTokenInAccount>
|
|
85
79
|
: TAccountUserTokenInAccount,
|
|
86
80
|
TAccountGuardTokenInAccount extends string
|
|
87
81
|
? WritableAccount<TAccountGuardTokenInAccount>
|
|
88
82
|
: TAccountGuardTokenInAccount,
|
|
89
|
-
TAccountTokenInProgram extends string
|
|
90
|
-
? ReadonlyAccount<TAccountTokenInProgram>
|
|
91
|
-
: TAccountTokenInProgram,
|
|
83
|
+
TAccountTokenInProgram extends string ? ReadonlyAccount<TAccountTokenInProgram> : TAccountTokenInProgram,
|
|
92
84
|
...TRemainingAccounts,
|
|
93
85
|
]
|
|
94
86
|
>;
|
|
@@ -120,7 +112,7 @@ export function getCreateLimitOrderInstructionDataEncoder(): Encoder<CreateLimit
|
|
|
120
112
|
['extraTransfersAmounts', getArrayEncoder(getU64Encoder())],
|
|
121
113
|
['deadline', getU32Encoder()],
|
|
122
114
|
]),
|
|
123
|
-
(value) => ({ ...value, discriminator: CREATE_LIMIT_ORDER_DISCRIMINATOR })
|
|
115
|
+
(value) => ({ ...value, discriminator: CREATE_LIMIT_ORDER_DISCRIMINATOR }),
|
|
124
116
|
);
|
|
125
117
|
}
|
|
126
118
|
|
|
@@ -139,10 +131,7 @@ export function getCreateLimitOrderInstructionDataCodec(): Codec<
|
|
|
139
131
|
CreateLimitOrderInstructionDataArgs,
|
|
140
132
|
CreateLimitOrderInstructionData
|
|
141
133
|
> {
|
|
142
|
-
return combineCodec(
|
|
143
|
-
getCreateLimitOrderInstructionDataEncoder(),
|
|
144
|
-
getCreateLimitOrderInstructionDataDecoder()
|
|
145
|
-
);
|
|
134
|
+
return combineCodec(getCreateLimitOrderInstructionDataEncoder(), getCreateLimitOrderInstructionDataDecoder());
|
|
146
135
|
}
|
|
147
136
|
|
|
148
137
|
export type CreateLimitOrderAsyncInput<
|
|
@@ -204,7 +193,7 @@ export async function getCreateLimitOrderInstructionAsync<
|
|
|
204
193
|
TAccountGuardTokenInAccount,
|
|
205
194
|
TAccountTokenInProgram
|
|
206
195
|
>,
|
|
207
|
-
config?: { programAddress?: TProgramAddress }
|
|
196
|
+
config?: { programAddress?: TProgramAddress },
|
|
208
197
|
): Promise<
|
|
209
198
|
CreateLimitOrderInstruction<
|
|
210
199
|
TProgramAddress,
|
|
@@ -241,8 +230,7 @@ export async function getCreateLimitOrderInstructionAsync<
|
|
|
241
230
|
|
|
242
231
|
// Resolve default values.
|
|
243
232
|
if (!accounts.systemProgram.value) {
|
|
244
|
-
accounts.systemProgram.value =
|
|
245
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
233
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
246
234
|
}
|
|
247
235
|
if (!accounts.associatedTokenProgram.value) {
|
|
248
236
|
accounts.associatedTokenProgram.value =
|
|
@@ -274,9 +262,7 @@ export async function getCreateLimitOrderInstructionAsync<
|
|
|
274
262
|
getAccountMeta(accounts.tokenInProgram),
|
|
275
263
|
],
|
|
276
264
|
programAddress,
|
|
277
|
-
data: getCreateLimitOrderInstructionDataEncoder().encode(
|
|
278
|
-
args as CreateLimitOrderInstructionDataArgs
|
|
279
|
-
),
|
|
265
|
+
data: getCreateLimitOrderInstructionDataEncoder().encode(args as CreateLimitOrderInstructionDataArgs),
|
|
280
266
|
} as CreateLimitOrderInstruction<
|
|
281
267
|
TProgramAddress,
|
|
282
268
|
TAccountUser,
|
|
@@ -352,7 +338,7 @@ export function getCreateLimitOrderInstruction<
|
|
|
352
338
|
TAccountGuardTokenInAccount,
|
|
353
339
|
TAccountTokenInProgram
|
|
354
340
|
>,
|
|
355
|
-
config?: { programAddress?: TProgramAddress }
|
|
341
|
+
config?: { programAddress?: TProgramAddress },
|
|
356
342
|
): CreateLimitOrderInstruction<
|
|
357
343
|
TProgramAddress,
|
|
358
344
|
TAccountUser,
|
|
@@ -387,8 +373,7 @@ export function getCreateLimitOrderInstruction<
|
|
|
387
373
|
|
|
388
374
|
// Resolve default values.
|
|
389
375
|
if (!accounts.systemProgram.value) {
|
|
390
|
-
accounts.systemProgram.value =
|
|
391
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
376
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
392
377
|
}
|
|
393
378
|
if (!accounts.associatedTokenProgram.value) {
|
|
394
379
|
accounts.associatedTokenProgram.value =
|
|
@@ -409,9 +394,7 @@ export function getCreateLimitOrderInstruction<
|
|
|
409
394
|
getAccountMeta(accounts.tokenInProgram),
|
|
410
395
|
],
|
|
411
396
|
programAddress,
|
|
412
|
-
data: getCreateLimitOrderInstructionDataEncoder().encode(
|
|
413
|
-
args as CreateLimitOrderInstructionDataArgs
|
|
414
|
-
),
|
|
397
|
+
data: getCreateLimitOrderInstructionDataEncoder().encode(args as CreateLimitOrderInstructionDataArgs),
|
|
415
398
|
} as CreateLimitOrderInstruction<
|
|
416
399
|
TProgramAddress,
|
|
417
400
|
TAccountUser,
|
|
@@ -456,13 +439,8 @@ export type ParsedCreateLimitOrderInstruction<
|
|
|
456
439
|
data: CreateLimitOrderInstructionData;
|
|
457
440
|
};
|
|
458
441
|
|
|
459
|
-
export function parseCreateLimitOrderInstruction<
|
|
460
|
-
TProgram
|
|
461
|
-
TAccountMetas extends readonly AccountMeta[],
|
|
462
|
-
>(
|
|
463
|
-
instruction: Instruction<TProgram> &
|
|
464
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
465
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
442
|
+
export function parseCreateLimitOrderInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(
|
|
443
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
466
444
|
): ParsedCreateLimitOrderInstruction<TProgram, TAccountMetas> {
|
|
467
445
|
if (instruction.accounts.length < 9) {
|
|
468
446
|
// TODO: Coded error.
|
|
@@ -36,9 +36,7 @@ import { type AccountSignerMeta, type TransactionSigner } from '@solana/signers'
|
|
|
36
36
|
import { SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
37
37
|
import { getAccountMetaFactory, type ResolvedAccount } from '../shared/index.js';
|
|
38
38
|
|
|
39
|
-
export const FULFILL_DCA_ORDER_INTERVAL_DISCRIMINATOR = new Uint8Array([
|
|
40
|
-
15, 118, 183, 60, 46, 43, 243, 244,
|
|
41
|
-
]);
|
|
39
|
+
export const FULFILL_DCA_ORDER_INTERVAL_DISCRIMINATOR = new Uint8Array([15, 118, 183, 60, 46, 43, 243, 244]);
|
|
42
40
|
|
|
43
41
|
export function getFulfillDcaOrderIntervalDiscriminatorBytes() {
|
|
44
42
|
return fixEncoderSize(getBytesEncoder(), 8).encode(FULFILL_DCA_ORDER_INTERVAL_DISCRIMINATOR);
|
|
@@ -50,9 +48,7 @@ export type FulfillDcaOrderIntervalInstruction<
|
|
|
50
48
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
51
49
|
TAccountUser extends string | AccountMeta<string> = string,
|
|
52
50
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
53
|
-
TAccountIxSysvar extends
|
|
54
|
-
| string
|
|
55
|
-
| AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
51
|
+
TAccountIxSysvar extends string | AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
56
52
|
TAccountTokenInMint extends string | AccountMeta<string> = string,
|
|
57
53
|
TAccountSolverTokenInAccount extends string | AccountMeta<string> = string,
|
|
58
54
|
TAccountGuardTokenInAccount extends string | AccountMeta<string> = string,
|
|
@@ -79,48 +75,34 @@ export type FulfillDcaOrderIntervalInstruction<
|
|
|
79
75
|
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
80
76
|
TAccountGuard extends string ? WritableAccount<TAccountGuard> : TAccountGuard,
|
|
81
77
|
TAccountIxSysvar extends string ? ReadonlyAccount<TAccountIxSysvar> : TAccountIxSysvar,
|
|
82
|
-
TAccountTokenInMint extends string
|
|
83
|
-
? ReadonlyAccount<TAccountTokenInMint>
|
|
84
|
-
: TAccountTokenInMint,
|
|
78
|
+
TAccountTokenInMint extends string ? ReadonlyAccount<TAccountTokenInMint> : TAccountTokenInMint,
|
|
85
79
|
TAccountSolverTokenInAccount extends string
|
|
86
80
|
? WritableAccount<TAccountSolverTokenInAccount>
|
|
87
81
|
: TAccountSolverTokenInAccount,
|
|
88
82
|
TAccountGuardTokenInAccount extends string
|
|
89
83
|
? WritableAccount<TAccountGuardTokenInAccount>
|
|
90
84
|
: TAccountGuardTokenInAccount,
|
|
91
|
-
TAccountTokenInProgram extends string
|
|
92
|
-
|
|
93
|
-
: TAccountTokenInProgram,
|
|
94
|
-
TAccountFeeTokenMint extends string
|
|
95
|
-
? ReadonlyAccount<TAccountFeeTokenMint>
|
|
96
|
-
: TAccountFeeTokenMint,
|
|
85
|
+
TAccountTokenInProgram extends string ? ReadonlyAccount<TAccountTokenInProgram> : TAccountTokenInProgram,
|
|
86
|
+
TAccountFeeTokenMint extends string ? ReadonlyAccount<TAccountFeeTokenMint> : TAccountFeeTokenMint,
|
|
97
87
|
TAccountSolverFeeTokenAccount extends string
|
|
98
88
|
? WritableAccount<TAccountSolverFeeTokenAccount>
|
|
99
89
|
: TAccountSolverFeeTokenAccount,
|
|
100
90
|
TAccountGuardFeeTokenAccount extends string
|
|
101
91
|
? WritableAccount<TAccountGuardFeeTokenAccount>
|
|
102
92
|
: TAccountGuardFeeTokenAccount,
|
|
103
|
-
TAccountFeeTokenProgram extends string
|
|
104
|
-
? ReadonlyAccount<TAccountFeeTokenProgram>
|
|
105
|
-
: TAccountFeeTokenProgram,
|
|
93
|
+
TAccountFeeTokenProgram extends string ? ReadonlyAccount<TAccountFeeTokenProgram> : TAccountFeeTokenProgram,
|
|
106
94
|
TAccountNativeTokenOutReceiver extends string
|
|
107
95
|
? ReadonlyAccount<TAccountNativeTokenOutReceiver>
|
|
108
96
|
: TAccountNativeTokenOutReceiver,
|
|
109
|
-
TAccountSystemProgram extends string
|
|
110
|
-
|
|
111
|
-
: TAccountSystemProgram,
|
|
112
|
-
TAccountTokenOutMint extends string
|
|
113
|
-
? ReadonlyAccount<TAccountTokenOutMint>
|
|
114
|
-
: TAccountTokenOutMint,
|
|
97
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
98
|
+
TAccountTokenOutMint extends string ? ReadonlyAccount<TAccountTokenOutMint> : TAccountTokenOutMint,
|
|
115
99
|
TAccountSolverTokenOutAccount extends string
|
|
116
100
|
? WritableAccount<TAccountSolverTokenOutAccount>
|
|
117
101
|
: TAccountSolverTokenOutAccount,
|
|
118
102
|
TAccountDestinationTokenOutAccount extends string
|
|
119
103
|
? WritableAccount<TAccountDestinationTokenOutAccount>
|
|
120
104
|
: TAccountDestinationTokenOutAccount,
|
|
121
|
-
TAccountTokenOutProgram extends string
|
|
122
|
-
? ReadonlyAccount<TAccountTokenOutProgram>
|
|
123
|
-
: TAccountTokenOutProgram,
|
|
105
|
+
TAccountTokenOutProgram extends string ? ReadonlyAccount<TAccountTokenOutProgram> : TAccountTokenOutProgram,
|
|
124
106
|
...TRemainingAccounts,
|
|
125
107
|
]
|
|
126
108
|
>;
|
|
@@ -143,7 +125,7 @@ export function getFulfillDcaOrderIntervalInstructionDataEncoder(): FixedSizeEnc
|
|
|
143
125
|
['promisedMainAmountOut', getU64Encoder()],
|
|
144
126
|
['mainAmountOutToTransfer', getU64Encoder()],
|
|
145
127
|
]),
|
|
146
|
-
(value) => ({ ...value, discriminator: FULFILL_DCA_ORDER_INTERVAL_DISCRIMINATOR })
|
|
128
|
+
(value) => ({ ...value, discriminator: FULFILL_DCA_ORDER_INTERVAL_DISCRIMINATOR }),
|
|
147
129
|
);
|
|
148
130
|
}
|
|
149
131
|
|
|
@@ -161,7 +143,7 @@ export function getFulfillDcaOrderIntervalInstructionDataCodec(): FixedSizeCodec
|
|
|
161
143
|
> {
|
|
162
144
|
return combineCodec(
|
|
163
145
|
getFulfillDcaOrderIntervalInstructionDataEncoder(),
|
|
164
|
-
getFulfillDcaOrderIntervalInstructionDataDecoder()
|
|
146
|
+
getFulfillDcaOrderIntervalInstructionDataDecoder(),
|
|
165
147
|
);
|
|
166
148
|
}
|
|
167
149
|
|
|
@@ -291,7 +273,7 @@ export function getFulfillDcaOrderIntervalInstruction<
|
|
|
291
273
|
TAccountDestinationTokenOutAccount,
|
|
292
274
|
TAccountTokenOutProgram
|
|
293
275
|
>,
|
|
294
|
-
config?: { programAddress?: TProgramAddress }
|
|
276
|
+
config?: { programAddress?: TProgramAddress },
|
|
295
277
|
): FulfillDcaOrderIntervalInstruction<
|
|
296
278
|
TProgramAddress,
|
|
297
279
|
TAccountSolver,
|
|
@@ -353,8 +335,7 @@ export function getFulfillDcaOrderIntervalInstruction<
|
|
|
353
335
|
'Sysvar1nstructions1111111111111111111111111' as Address<'Sysvar1nstructions1111111111111111111111111'>;
|
|
354
336
|
}
|
|
355
337
|
if (!accounts.systemProgram.value) {
|
|
356
|
-
accounts.systemProgram.value =
|
|
357
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
338
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
358
339
|
}
|
|
359
340
|
|
|
360
341
|
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
@@ -381,9 +362,7 @@ export function getFulfillDcaOrderIntervalInstruction<
|
|
|
381
362
|
getAccountMeta(accounts.tokenOutProgram),
|
|
382
363
|
],
|
|
383
364
|
programAddress,
|
|
384
|
-
data: getFulfillDcaOrderIntervalInstructionDataEncoder().encode(
|
|
385
|
-
args as FulfillDcaOrderIntervalInstructionDataArgs
|
|
386
|
-
),
|
|
365
|
+
data: getFulfillDcaOrderIntervalInstructionDataEncoder().encode(args as FulfillDcaOrderIntervalInstructionDataArgs),
|
|
387
366
|
} as FulfillDcaOrderIntervalInstruction<
|
|
388
367
|
TProgramAddress,
|
|
389
368
|
TAccountSolver,
|
|
@@ -488,9 +467,7 @@ export function parseFulfillDcaOrderIntervalInstruction<
|
|
|
488
467
|
TProgram extends string,
|
|
489
468
|
TAccountMetas extends readonly AccountMeta[],
|
|
490
469
|
>(
|
|
491
|
-
instruction: Instruction<TProgram> &
|
|
492
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
493
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
470
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
494
471
|
): ParsedFulfillDcaOrderIntervalInstruction<TProgram, TAccountMetas> {
|
|
495
472
|
if (instruction.accounts.length < 19) {
|
|
496
473
|
// TODO: Coded error.
|
|
@@ -36,9 +36,7 @@ import { type AccountSignerMeta, type TransactionSigner } from '@solana/signers'
|
|
|
36
36
|
import { SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
37
37
|
import { getAccountMetaFactory, type ResolvedAccount } from '../shared/index.js';
|
|
38
38
|
|
|
39
|
-
export const FULFILL_LIMIT_ORDER_DISCRIMINATOR = new Uint8Array([
|
|
40
|
-
70, 1, 151, 197, 125, 110, 46, 244,
|
|
41
|
-
]);
|
|
39
|
+
export const FULFILL_LIMIT_ORDER_DISCRIMINATOR = new Uint8Array([70, 1, 151, 197, 125, 110, 46, 244]);
|
|
42
40
|
|
|
43
41
|
export function getFulfillLimitOrderDiscriminatorBytes() {
|
|
44
42
|
return fixEncoderSize(getBytesEncoder(), 8).encode(FULFILL_LIMIT_ORDER_DISCRIMINATOR);
|
|
@@ -50,9 +48,7 @@ export type FulfillLimitOrderInstruction<
|
|
|
50
48
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
51
49
|
TAccountUser extends string | AccountMeta<string> = string,
|
|
52
50
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
53
|
-
TAccountIxSysvar extends
|
|
54
|
-
| string
|
|
55
|
-
| AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
51
|
+
TAccountIxSysvar extends string | AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
56
52
|
TAccountTokenInMint extends string | AccountMeta<string> = string,
|
|
57
53
|
TAccountSolverTokenInAccount extends string | AccountMeta<string> = string,
|
|
58
54
|
TAccountGuardTokenInAccount extends string | AccountMeta<string> = string,
|
|
@@ -79,48 +75,34 @@ export type FulfillLimitOrderInstruction<
|
|
|
79
75
|
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
80
76
|
TAccountGuard extends string ? WritableAccount<TAccountGuard> : TAccountGuard,
|
|
81
77
|
TAccountIxSysvar extends string ? ReadonlyAccount<TAccountIxSysvar> : TAccountIxSysvar,
|
|
82
|
-
TAccountTokenInMint extends string
|
|
83
|
-
? ReadonlyAccount<TAccountTokenInMint>
|
|
84
|
-
: TAccountTokenInMint,
|
|
78
|
+
TAccountTokenInMint extends string ? ReadonlyAccount<TAccountTokenInMint> : TAccountTokenInMint,
|
|
85
79
|
TAccountSolverTokenInAccount extends string
|
|
86
80
|
? WritableAccount<TAccountSolverTokenInAccount>
|
|
87
81
|
: TAccountSolverTokenInAccount,
|
|
88
82
|
TAccountGuardTokenInAccount extends string
|
|
89
83
|
? WritableAccount<TAccountGuardTokenInAccount>
|
|
90
84
|
: TAccountGuardTokenInAccount,
|
|
91
|
-
TAccountTokenInProgram extends string
|
|
92
|
-
|
|
93
|
-
: TAccountTokenInProgram,
|
|
94
|
-
TAccountFeeTokenMint extends string
|
|
95
|
-
? ReadonlyAccount<TAccountFeeTokenMint>
|
|
96
|
-
: TAccountFeeTokenMint,
|
|
85
|
+
TAccountTokenInProgram extends string ? ReadonlyAccount<TAccountTokenInProgram> : TAccountTokenInProgram,
|
|
86
|
+
TAccountFeeTokenMint extends string ? ReadonlyAccount<TAccountFeeTokenMint> : TAccountFeeTokenMint,
|
|
97
87
|
TAccountSolverFeeTokenAccount extends string
|
|
98
88
|
? WritableAccount<TAccountSolverFeeTokenAccount>
|
|
99
89
|
: TAccountSolverFeeTokenAccount,
|
|
100
90
|
TAccountGuardFeeTokenAccount extends string
|
|
101
91
|
? WritableAccount<TAccountGuardFeeTokenAccount>
|
|
102
92
|
: TAccountGuardFeeTokenAccount,
|
|
103
|
-
TAccountFeeTokenProgram extends string
|
|
104
|
-
? ReadonlyAccount<TAccountFeeTokenProgram>
|
|
105
|
-
: TAccountFeeTokenProgram,
|
|
93
|
+
TAccountFeeTokenProgram extends string ? ReadonlyAccount<TAccountFeeTokenProgram> : TAccountFeeTokenProgram,
|
|
106
94
|
TAccountNativeTokenOutReceiver extends string
|
|
107
95
|
? ReadonlyAccount<TAccountNativeTokenOutReceiver>
|
|
108
96
|
: TAccountNativeTokenOutReceiver,
|
|
109
|
-
TAccountSystemProgram extends string
|
|
110
|
-
|
|
111
|
-
: TAccountSystemProgram,
|
|
112
|
-
TAccountTokenOutMint extends string
|
|
113
|
-
? ReadonlyAccount<TAccountTokenOutMint>
|
|
114
|
-
: TAccountTokenOutMint,
|
|
97
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
98
|
+
TAccountTokenOutMint extends string ? ReadonlyAccount<TAccountTokenOutMint> : TAccountTokenOutMint,
|
|
115
99
|
TAccountSolverTokenOutAccount extends string
|
|
116
100
|
? WritableAccount<TAccountSolverTokenOutAccount>
|
|
117
101
|
: TAccountSolverTokenOutAccount,
|
|
118
102
|
TAccountDestinationTokenOutAccount extends string
|
|
119
103
|
? WritableAccount<TAccountDestinationTokenOutAccount>
|
|
120
104
|
: TAccountDestinationTokenOutAccount,
|
|
121
|
-
TAccountTokenOutProgram extends string
|
|
122
|
-
? ReadonlyAccount<TAccountTokenOutProgram>
|
|
123
|
-
: TAccountTokenOutProgram,
|
|
105
|
+
TAccountTokenOutProgram extends string ? ReadonlyAccount<TAccountTokenOutProgram> : TAccountTokenOutProgram,
|
|
124
106
|
...TRemainingAccounts,
|
|
125
107
|
]
|
|
126
108
|
>;
|
|
@@ -143,7 +125,7 @@ export function getFulfillLimitOrderInstructionDataEncoder(): FixedSizeEncoder<F
|
|
|
143
125
|
['promisedMainAmountOut', getU64Encoder()],
|
|
144
126
|
['mainAmountOutToTransfer', getU64Encoder()],
|
|
145
127
|
]),
|
|
146
|
-
(value) => ({ ...value, discriminator: FULFILL_LIMIT_ORDER_DISCRIMINATOR })
|
|
128
|
+
(value) => ({ ...value, discriminator: FULFILL_LIMIT_ORDER_DISCRIMINATOR }),
|
|
147
129
|
);
|
|
148
130
|
}
|
|
149
131
|
|
|
@@ -159,10 +141,7 @@ export function getFulfillLimitOrderInstructionDataCodec(): FixedSizeCodec<
|
|
|
159
141
|
FulfillLimitOrderInstructionDataArgs,
|
|
160
142
|
FulfillLimitOrderInstructionData
|
|
161
143
|
> {
|
|
162
|
-
return combineCodec(
|
|
163
|
-
getFulfillLimitOrderInstructionDataEncoder(),
|
|
164
|
-
getFulfillLimitOrderInstructionDataDecoder()
|
|
165
|
-
);
|
|
144
|
+
return combineCodec(getFulfillLimitOrderInstructionDataEncoder(), getFulfillLimitOrderInstructionDataDecoder());
|
|
166
145
|
}
|
|
167
146
|
|
|
168
147
|
export type FulfillLimitOrderInput<
|
|
@@ -291,7 +270,7 @@ export function getFulfillLimitOrderInstruction<
|
|
|
291
270
|
TAccountDestinationTokenOutAccount,
|
|
292
271
|
TAccountTokenOutProgram
|
|
293
272
|
>,
|
|
294
|
-
config?: { programAddress?: TProgramAddress }
|
|
273
|
+
config?: { programAddress?: TProgramAddress },
|
|
295
274
|
): FulfillLimitOrderInstruction<
|
|
296
275
|
TProgramAddress,
|
|
297
276
|
TAccountSolver,
|
|
@@ -353,8 +332,7 @@ export function getFulfillLimitOrderInstruction<
|
|
|
353
332
|
'Sysvar1nstructions1111111111111111111111111' as Address<'Sysvar1nstructions1111111111111111111111111'>;
|
|
354
333
|
}
|
|
355
334
|
if (!accounts.systemProgram.value) {
|
|
356
|
-
accounts.systemProgram.value =
|
|
357
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
335
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
358
336
|
}
|
|
359
337
|
|
|
360
338
|
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
@@ -381,9 +359,7 @@ export function getFulfillLimitOrderInstruction<
|
|
|
381
359
|
getAccountMeta(accounts.tokenOutProgram),
|
|
382
360
|
],
|
|
383
361
|
programAddress,
|
|
384
|
-
data: getFulfillLimitOrderInstructionDataEncoder().encode(
|
|
385
|
-
args as FulfillLimitOrderInstructionDataArgs
|
|
386
|
-
),
|
|
362
|
+
data: getFulfillLimitOrderInstructionDataEncoder().encode(args as FulfillLimitOrderInstructionDataArgs),
|
|
387
363
|
} as FulfillLimitOrderInstruction<
|
|
388
364
|
TProgramAddress,
|
|
389
365
|
TAccountSolver,
|
|
@@ -488,9 +464,7 @@ export function parseFulfillLimitOrderInstruction<
|
|
|
488
464
|
TProgram extends string,
|
|
489
465
|
TAccountMetas extends readonly AccountMeta[],
|
|
490
466
|
>(
|
|
491
|
-
instruction: Instruction<TProgram> &
|
|
492
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
493
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
467
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
494
468
|
): ParsedFulfillLimitOrderInstruction<TProgram, TAccountMetas> {
|
|
495
469
|
if (instruction.accounts.length < 19) {
|
|
496
470
|
// TODO: Coded error.
|
|
@@ -45,9 +45,7 @@ export type InitializeInstruction<
|
|
|
45
45
|
TAccountInitialAdmin extends string | AccountMeta<string> = string,
|
|
46
46
|
TAccountAdminSingleton extends string | AccountMeta<string> = string,
|
|
47
47
|
TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
|
|
48
|
-
TAccountProgram extends
|
|
49
|
-
| string
|
|
50
|
-
| AccountMeta<string> = 'EaSKMioKTLtbFXVaMEmHjSdZDEoZHpSmQBu6NfsND87n',
|
|
48
|
+
TAccountProgram extends string | AccountMeta<string> = 'EaSKMioKTLtbFXVaMEmHjSdZDEoZHpSmQBu6NfsND87n',
|
|
51
49
|
TAccountProgramData extends string | AccountMeta<string> = string,
|
|
52
50
|
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
|
|
53
51
|
> = Instruction<TProgram> &
|
|
@@ -57,16 +55,10 @@ export type InitializeInstruction<
|
|
|
57
55
|
TAccountInitialAdmin extends string
|
|
58
56
|
? WritableSignerAccount<TAccountInitialAdmin> & AccountSignerMeta<TAccountInitialAdmin>
|
|
59
57
|
: TAccountInitialAdmin,
|
|
60
|
-
TAccountAdminSingleton extends string
|
|
61
|
-
|
|
62
|
-
: TAccountAdminSingleton,
|
|
63
|
-
TAccountSystemProgram extends string
|
|
64
|
-
? ReadonlyAccount<TAccountSystemProgram>
|
|
65
|
-
: TAccountSystemProgram,
|
|
58
|
+
TAccountAdminSingleton extends string ? WritableAccount<TAccountAdminSingleton> : TAccountAdminSingleton,
|
|
59
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
66
60
|
TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
|
|
67
|
-
TAccountProgramData extends string
|
|
68
|
-
? ReadonlyAccount<TAccountProgramData>
|
|
69
|
-
: TAccountProgramData,
|
|
61
|
+
TAccountProgramData extends string ? ReadonlyAccount<TAccountProgramData> : TAccountProgramData,
|
|
70
62
|
...TRemainingAccounts,
|
|
71
63
|
]
|
|
72
64
|
>;
|
|
@@ -76,10 +68,10 @@ export type InitializeInstructionData = { discriminator: ReadonlyUint8Array };
|
|
|
76
68
|
export type InitializeInstructionDataArgs = Object;
|
|
77
69
|
|
|
78
70
|
export function getInitializeInstructionDataEncoder(): FixedSizeEncoder<InitializeInstructionDataArgs> {
|
|
79
|
-
return transformEncoder(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
71
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
72
|
+
...value,
|
|
73
|
+
discriminator: INITIALIZE_DISCRIMINATOR,
|
|
74
|
+
}));
|
|
83
75
|
}
|
|
84
76
|
|
|
85
77
|
export function getInitializeInstructionDataDecoder(): FixedSizeDecoder<InitializeInstructionData> {
|
|
@@ -130,7 +122,7 @@ export async function getInitializeInstructionAsync<
|
|
|
130
122
|
TAccountProgram,
|
|
131
123
|
TAccountProgramData
|
|
132
124
|
>,
|
|
133
|
-
config?: { programAddress?: TProgramAddress }
|
|
125
|
+
config?: { programAddress?: TProgramAddress },
|
|
134
126
|
): Promise<
|
|
135
127
|
InitializeInstruction<
|
|
136
128
|
TProgramAddress,
|
|
@@ -162,8 +154,7 @@ export async function getInitializeInstructionAsync<
|
|
|
162
154
|
});
|
|
163
155
|
}
|
|
164
156
|
if (!accounts.systemProgram.value) {
|
|
165
|
-
accounts.systemProgram.value =
|
|
166
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
157
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
167
158
|
}
|
|
168
159
|
if (!accounts.program.value) {
|
|
169
160
|
accounts.program.value =
|
|
@@ -230,7 +221,7 @@ export function getInitializeInstruction<
|
|
|
230
221
|
TAccountProgram,
|
|
231
222
|
TAccountProgramData
|
|
232
223
|
>,
|
|
233
|
-
config?: { programAddress?: TProgramAddress }
|
|
224
|
+
config?: { programAddress?: TProgramAddress },
|
|
234
225
|
): InitializeInstruction<
|
|
235
226
|
TProgramAddress,
|
|
236
227
|
TAccountInitialAdmin,
|
|
@@ -254,8 +245,7 @@ export function getInitializeInstruction<
|
|
|
254
245
|
|
|
255
246
|
// Resolve default values.
|
|
256
247
|
if (!accounts.systemProgram.value) {
|
|
257
|
-
accounts.systemProgram.value =
|
|
258
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
248
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
259
249
|
}
|
|
260
250
|
if (!accounts.program.value) {
|
|
261
251
|
accounts.program.value =
|
|
@@ -309,13 +299,8 @@ export type ParsedInitializeInstruction<
|
|
|
309
299
|
data: InitializeInstructionData;
|
|
310
300
|
};
|
|
311
301
|
|
|
312
|
-
export function parseInitializeInstruction<
|
|
313
|
-
TProgram
|
|
314
|
-
TAccountMetas extends readonly AccountMeta[],
|
|
315
|
-
>(
|
|
316
|
-
instruction: Instruction<TProgram> &
|
|
317
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
318
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
302
|
+
export function parseInitializeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(
|
|
303
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
319
304
|
): ParsedInitializeInstruction<TProgram, TAccountMetas> {
|
|
320
305
|
if (instruction.accounts.length < 5) {
|
|
321
306
|
// TODO: Coded error.
|
|
@@ -6,12 +6,7 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
getAddressDecoder,
|
|
11
|
-
getAddressEncoder,
|
|
12
|
-
getProgramDerivedAddress,
|
|
13
|
-
type Address,
|
|
14
|
-
} from '@solana/addresses';
|
|
9
|
+
import { getAddressDecoder, getAddressEncoder, getProgramDerivedAddress, type Address } from '@solana/addresses';
|
|
15
10
|
import {
|
|
16
11
|
combineCodec,
|
|
17
12
|
fixDecoderSize,
|
|
@@ -56,9 +51,7 @@ export type SetAdminInstruction<
|
|
|
56
51
|
TAccountAdmin extends string
|
|
57
52
|
? WritableSignerAccount<TAccountAdmin> & AccountSignerMeta<TAccountAdmin>
|
|
58
53
|
: TAccountAdmin,
|
|
59
|
-
TAccountAdminSingleton extends string
|
|
60
|
-
? WritableAccount<TAccountAdminSingleton>
|
|
61
|
-
: TAccountAdminSingleton,
|
|
54
|
+
TAccountAdminSingleton extends string ? WritableAccount<TAccountAdminSingleton> : TAccountAdminSingleton,
|
|
62
55
|
...TRemainingAccounts,
|
|
63
56
|
]
|
|
64
57
|
>;
|
|
@@ -73,7 +66,7 @@ export function getSetAdminInstructionDataEncoder(): FixedSizeEncoder<SetAdminIn
|
|
|
73
66
|
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
74
67
|
['newAdmin', getAddressEncoder()],
|
|
75
68
|
]),
|
|
76
|
-
(value) => ({ ...value, discriminator: SET_ADMIN_DISCRIMINATOR })
|
|
69
|
+
(value) => ({ ...value, discriminator: SET_ADMIN_DISCRIMINATOR }),
|
|
77
70
|
);
|
|
78
71
|
}
|
|
79
72
|
|
|
@@ -108,7 +101,7 @@ export async function getSetAdminInstructionAsync<
|
|
|
108
101
|
TProgramAddress extends Address = typeof SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS,
|
|
109
102
|
>(
|
|
110
103
|
input: SetAdminAsyncInput<TAccountAdmin, TAccountAdminSingleton>,
|
|
111
|
-
config?: { programAddress?: TProgramAddress }
|
|
104
|
+
config?: { programAddress?: TProgramAddress },
|
|
112
105
|
): Promise<SetAdminInstruction<TProgramAddress, TAccountAdmin, TAccountAdminSingleton>> {
|
|
113
106
|
// Program address.
|
|
114
107
|
const programAddress = config?.programAddress ?? SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS;
|
|
@@ -141,10 +134,7 @@ export async function getSetAdminInstructionAsync<
|
|
|
141
134
|
return instruction;
|
|
142
135
|
}
|
|
143
136
|
|
|
144
|
-
export type SetAdminInput<
|
|
145
|
-
TAccountAdmin extends string = string,
|
|
146
|
-
TAccountAdminSingleton extends string = string,
|
|
147
|
-
> = {
|
|
137
|
+
export type SetAdminInput<TAccountAdmin extends string = string, TAccountAdminSingleton extends string = string> = {
|
|
148
138
|
/** Admin signer */
|
|
149
139
|
admin: TransactionSigner<TAccountAdmin>;
|
|
150
140
|
/** Admin singleton account that grants access to admin functions */
|
|
@@ -158,7 +148,7 @@ export function getSetAdminInstruction<
|
|
|
158
148
|
TProgramAddress extends Address = typeof SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS,
|
|
159
149
|
>(
|
|
160
150
|
input: SetAdminInput<TAccountAdmin, TAccountAdminSingleton>,
|
|
161
|
-
config?: { programAddress?: TProgramAddress }
|
|
151
|
+
config?: { programAddress?: TProgramAddress },
|
|
162
152
|
): SetAdminInstruction<TProgramAddress, TAccountAdmin, TAccountAdminSingleton> {
|
|
163
153
|
// Program address.
|
|
164
154
|
const programAddress = config?.programAddress ?? SINGLE_CHAIN_GUARD_PROGRAM_ADDRESS;
|
|
@@ -197,13 +187,8 @@ export type ParsedSetAdminInstruction<
|
|
|
197
187
|
data: SetAdminInstructionData;
|
|
198
188
|
};
|
|
199
189
|
|
|
200
|
-
export function parseSetAdminInstruction<
|
|
201
|
-
TProgram
|
|
202
|
-
TAccountMetas extends readonly AccountMeta[],
|
|
203
|
-
>(
|
|
204
|
-
instruction: Instruction<TProgram> &
|
|
205
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
206
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
190
|
+
export function parseSetAdminInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(
|
|
191
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
207
192
|
): ParsedSetAdminInstruction<TProgram, TAccountMetas> {
|
|
208
193
|
if (instruction.accounts.length < 2) {
|
|
209
194
|
// TODO: Coded error.
|