@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
|
@@ -50,9 +50,7 @@ export type CreateOrderInstruction<
|
|
|
50
50
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
51
51
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
52
52
|
TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
|
|
53
|
-
TAccountAssociatedTokenProgram extends
|
|
54
|
-
| string
|
|
55
|
-
| AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
|
|
53
|
+
TAccountAssociatedTokenProgram extends string | AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
|
|
56
54
|
TAccountTokenInMint extends string | AccountMeta<string> = string,
|
|
57
55
|
TAccountUserTokenInAccount extends string | AccountMeta<string> = string,
|
|
58
56
|
TAccountGuardTokenInAccount extends string | AccountMeta<string> = string,
|
|
@@ -69,24 +67,18 @@ export type CreateOrderInstruction<
|
|
|
69
67
|
? WritableSignerAccount<TAccountOrder> & AccountSignerMeta<TAccountOrder>
|
|
70
68
|
: TAccountOrder,
|
|
71
69
|
TAccountGuard extends string ? ReadonlyAccount<TAccountGuard> : TAccountGuard,
|
|
72
|
-
TAccountSystemProgram extends string
|
|
73
|
-
? ReadonlyAccount<TAccountSystemProgram>
|
|
74
|
-
: TAccountSystemProgram,
|
|
70
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
75
71
|
TAccountAssociatedTokenProgram extends string
|
|
76
72
|
? ReadonlyAccount<TAccountAssociatedTokenProgram>
|
|
77
73
|
: TAccountAssociatedTokenProgram,
|
|
78
|
-
TAccountTokenInMint extends string
|
|
79
|
-
? ReadonlyAccount<TAccountTokenInMint>
|
|
80
|
-
: TAccountTokenInMint,
|
|
74
|
+
TAccountTokenInMint extends string ? ReadonlyAccount<TAccountTokenInMint> : TAccountTokenInMint,
|
|
81
75
|
TAccountUserTokenInAccount extends string
|
|
82
76
|
? WritableAccount<TAccountUserTokenInAccount>
|
|
83
77
|
: TAccountUserTokenInAccount,
|
|
84
78
|
TAccountGuardTokenInAccount extends string
|
|
85
79
|
? WritableAccount<TAccountGuardTokenInAccount>
|
|
86
80
|
: TAccountGuardTokenInAccount,
|
|
87
|
-
TAccountTokenInProgram extends string
|
|
88
|
-
? ReadonlyAccount<TAccountTokenInProgram>
|
|
89
|
-
: TAccountTokenInProgram,
|
|
81
|
+
TAccountTokenInProgram extends string ? ReadonlyAccount<TAccountTokenInProgram> : TAccountTokenInProgram,
|
|
90
82
|
...TRemainingAccounts,
|
|
91
83
|
]
|
|
92
84
|
>;
|
|
@@ -115,7 +107,7 @@ export function getCreateOrderInstructionDataEncoder(): FixedSizeEncoder<CreateO
|
|
|
115
107
|
['deadline', getU32Encoder()],
|
|
116
108
|
['executionDetailsHash', fixEncoderSize(getBytesEncoder(), 32)],
|
|
117
109
|
]),
|
|
118
|
-
(value) => ({ ...value, discriminator: CREATE_ORDER_DISCRIMINATOR })
|
|
110
|
+
(value) => ({ ...value, discriminator: CREATE_ORDER_DISCRIMINATOR }),
|
|
119
111
|
);
|
|
120
112
|
}
|
|
121
113
|
|
|
@@ -133,10 +125,7 @@ export function getCreateOrderInstructionDataCodec(): FixedSizeCodec<
|
|
|
133
125
|
CreateOrderInstructionDataArgs,
|
|
134
126
|
CreateOrderInstructionData
|
|
135
127
|
> {
|
|
136
|
-
return combineCodec(
|
|
137
|
-
getCreateOrderInstructionDataEncoder(),
|
|
138
|
-
getCreateOrderInstructionDataDecoder()
|
|
139
|
-
);
|
|
128
|
+
return combineCodec(getCreateOrderInstructionDataEncoder(), getCreateOrderInstructionDataDecoder());
|
|
140
129
|
}
|
|
141
130
|
|
|
142
131
|
export type CreateOrderAsyncInput<
|
|
@@ -197,7 +186,7 @@ export async function getCreateOrderInstructionAsync<
|
|
|
197
186
|
TAccountGuardTokenInAccount,
|
|
198
187
|
TAccountTokenInProgram
|
|
199
188
|
>,
|
|
200
|
-
config?: { programAddress?: TProgramAddress }
|
|
189
|
+
config?: { programAddress?: TProgramAddress },
|
|
201
190
|
): Promise<
|
|
202
191
|
CreateOrderInstruction<
|
|
203
192
|
TProgramAddress,
|
|
@@ -234,8 +223,7 @@ export async function getCreateOrderInstructionAsync<
|
|
|
234
223
|
|
|
235
224
|
// Resolve default values.
|
|
236
225
|
if (!accounts.systemProgram.value) {
|
|
237
|
-
accounts.systemProgram.value =
|
|
238
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
226
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
239
227
|
}
|
|
240
228
|
if (!accounts.associatedTokenProgram.value) {
|
|
241
229
|
accounts.associatedTokenProgram.value =
|
|
@@ -342,7 +330,7 @@ export function getCreateOrderInstruction<
|
|
|
342
330
|
TAccountGuardTokenInAccount,
|
|
343
331
|
TAccountTokenInProgram
|
|
344
332
|
>,
|
|
345
|
-
config?: { programAddress?: TProgramAddress }
|
|
333
|
+
config?: { programAddress?: TProgramAddress },
|
|
346
334
|
): CreateOrderInstruction<
|
|
347
335
|
TProgramAddress,
|
|
348
336
|
TAccountUser,
|
|
@@ -377,8 +365,7 @@ export function getCreateOrderInstruction<
|
|
|
377
365
|
|
|
378
366
|
// Resolve default values.
|
|
379
367
|
if (!accounts.systemProgram.value) {
|
|
380
|
-
accounts.systemProgram.value =
|
|
381
|
-
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
368
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
382
369
|
}
|
|
383
370
|
if (!accounts.associatedTokenProgram.value) {
|
|
384
371
|
accounts.associatedTokenProgram.value =
|
|
@@ -444,13 +431,8 @@ export type ParsedCreateOrderInstruction<
|
|
|
444
431
|
data: CreateOrderInstructionData;
|
|
445
432
|
};
|
|
446
433
|
|
|
447
|
-
export function parseCreateOrderInstruction<
|
|
448
|
-
TProgram
|
|
449
|
-
TAccountMetas extends readonly AccountMeta[],
|
|
450
|
-
>(
|
|
451
|
-
instruction: Instruction<TProgram> &
|
|
452
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
453
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
434
|
+
export function parseCreateOrderInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(
|
|
435
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
454
436
|
): ParsedCreateOrderInstruction<TProgram, TAccountMetas> {
|
|
455
437
|
if (instruction.accounts.length < 9) {
|
|
456
438
|
// 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> = 'DQZQGiVa1PBXesdbCRzmJpZ7AyntLXfAwP5Qty1hgFqQ',
|
|
48
|
+
TAccountProgram extends string | AccountMeta<string> = 'DQZQGiVa1PBXesdbCRzmJpZ7AyntLXfAwP5Qty1hgFqQ',
|
|
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.
|
|
@@ -34,9 +34,7 @@ import { type AccountSignerMeta, type TransactionSigner } from '@solana/signers'
|
|
|
34
34
|
import { SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
35
35
|
import { getAccountMetaFactory, type ResolvedAccount } from '../shared/index.js';
|
|
36
36
|
|
|
37
|
-
export const PRE_START_ORDER_EXECUTION_DISCRIMINATOR = new Uint8Array([
|
|
38
|
-
69, 230, 54, 217, 254, 93, 181, 32,
|
|
39
|
-
]);
|
|
37
|
+
export const PRE_START_ORDER_EXECUTION_DISCRIMINATOR = new Uint8Array([69, 230, 54, 217, 254, 93, 181, 32]);
|
|
40
38
|
|
|
41
39
|
export function getPreStartOrderExecutionDiscriminatorBytes() {
|
|
42
40
|
return fixEncoderSize(getBytesEncoder(), 8).encode(PRE_START_ORDER_EXECUTION_DISCRIMINATOR);
|
|
@@ -47,9 +45,7 @@ export type PreStartOrderExecutionInstruction<
|
|
|
47
45
|
TAccountSolver extends string | AccountMeta<string> = string,
|
|
48
46
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
49
47
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
50
|
-
TAccountIxSysvar extends
|
|
51
|
-
| string
|
|
52
|
-
| AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
48
|
+
TAccountIxSysvar extends string | AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
53
49
|
TAccountCollateralTokenMint extends string | AccountMeta<string> = string,
|
|
54
50
|
TAccountSolverCollateralTokenAccount extends string | AccountMeta<string> = string,
|
|
55
51
|
TAccountGuardCollateralTokenAccount extends string | AccountMeta<string> = string,
|
|
@@ -81,18 +77,14 @@ export type PreStartOrderExecutionInstruction<
|
|
|
81
77
|
TAccountCollateralTokenProgram extends string
|
|
82
78
|
? ReadonlyAccount<TAccountCollateralTokenProgram>
|
|
83
79
|
: TAccountCollateralTokenProgram,
|
|
84
|
-
TAccountTokenInMint extends string
|
|
85
|
-
? ReadonlyAccount<TAccountTokenInMint>
|
|
86
|
-
: TAccountTokenInMint,
|
|
80
|
+
TAccountTokenInMint extends string ? ReadonlyAccount<TAccountTokenInMint> : TAccountTokenInMint,
|
|
87
81
|
TAccountSolverTokenInAccount extends string
|
|
88
82
|
? WritableAccount<TAccountSolverTokenInAccount>
|
|
89
83
|
: TAccountSolverTokenInAccount,
|
|
90
84
|
TAccountGuardTokenInAccount extends string
|
|
91
85
|
? WritableAccount<TAccountGuardTokenInAccount>
|
|
92
86
|
: TAccountGuardTokenInAccount,
|
|
93
|
-
TAccountTokenInProgram extends string
|
|
94
|
-
? ReadonlyAccount<TAccountTokenInProgram>
|
|
95
|
-
: TAccountTokenInProgram,
|
|
87
|
+
TAccountTokenInProgram extends string ? ReadonlyAccount<TAccountTokenInProgram> : TAccountTokenInProgram,
|
|
96
88
|
...TRemainingAccounts,
|
|
97
89
|
]
|
|
98
90
|
>;
|
|
@@ -102,10 +94,10 @@ export type PreStartOrderExecutionInstructionData = { discriminator: ReadonlyUin
|
|
|
102
94
|
export type PreStartOrderExecutionInstructionDataArgs = Object;
|
|
103
95
|
|
|
104
96
|
export function getPreStartOrderExecutionInstructionDataEncoder(): FixedSizeEncoder<PreStartOrderExecutionInstructionDataArgs> {
|
|
105
|
-
return transformEncoder(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
);
|
|
97
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
98
|
+
...value,
|
|
99
|
+
discriminator: PRE_START_ORDER_EXECUTION_DISCRIMINATOR,
|
|
100
|
+
}));
|
|
109
101
|
}
|
|
110
102
|
|
|
111
103
|
export function getPreStartOrderExecutionInstructionDataDecoder(): FixedSizeDecoder<PreStartOrderExecutionInstructionData> {
|
|
@@ -118,7 +110,7 @@ export function getPreStartOrderExecutionInstructionDataCodec(): FixedSizeCodec<
|
|
|
118
110
|
> {
|
|
119
111
|
return combineCodec(
|
|
120
112
|
getPreStartOrderExecutionInstructionDataEncoder(),
|
|
121
|
-
getPreStartOrderExecutionInstructionDataDecoder()
|
|
113
|
+
getPreStartOrderExecutionInstructionDataDecoder(),
|
|
122
114
|
);
|
|
123
115
|
}
|
|
124
116
|
|
|
@@ -195,7 +187,7 @@ export function getPreStartOrderExecutionInstruction<
|
|
|
195
187
|
TAccountGuardTokenInAccount,
|
|
196
188
|
TAccountTokenInProgram
|
|
197
189
|
>,
|
|
198
|
-
config?: { programAddress?: TProgramAddress }
|
|
190
|
+
config?: { programAddress?: TProgramAddress },
|
|
199
191
|
): PreStartOrderExecutionInstruction<
|
|
200
192
|
TProgramAddress,
|
|
201
193
|
TAccountSolver,
|
|
@@ -323,9 +315,7 @@ export function parsePreStartOrderExecutionInstruction<
|
|
|
323
315
|
TProgram extends string,
|
|
324
316
|
TAccountMetas extends readonly AccountMeta[],
|
|
325
317
|
>(
|
|
326
|
-
instruction: Instruction<TProgram> &
|
|
327
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
328
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
318
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
329
319
|
): ParsedPreStartOrderExecutionInstruction<TProgram, TAccountMetas> {
|
|
330
320
|
if (instruction.accounts.length < 12) {
|
|
331
321
|
// 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 SOURCE_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 ?? SOURCE_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 SOURCE_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 ?? SOURCE_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.
|
|
@@ -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,
|
|
@@ -39,9 +34,7 @@ import { type AccountSignerMeta, type TransactionSigner } from '@solana/signers'
|
|
|
39
34
|
import { SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
40
35
|
import { getAccountMetaFactory, type ResolvedAccount } from '../shared/index.js';
|
|
41
36
|
|
|
42
|
-
export const SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR = new Uint8Array([
|
|
43
|
-
153, 39, 10, 108, 220, 0, 84, 47,
|
|
44
|
-
]);
|
|
37
|
+
export const SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR = new Uint8Array([153, 39, 10, 108, 220, 0, 84, 47]);
|
|
45
38
|
|
|
46
39
|
export function getSetAuctioneerPubKeyDiscriminatorBytes() {
|
|
47
40
|
return fixEncoderSize(getBytesEncoder(), 8).encode(SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR);
|
|
@@ -60,9 +53,7 @@ export type SetAuctioneerPubKeyInstruction<
|
|
|
60
53
|
TAccountAdmin extends string
|
|
61
54
|
? WritableSignerAccount<TAccountAdmin> & AccountSignerMeta<TAccountAdmin>
|
|
62
55
|
: TAccountAdmin,
|
|
63
|
-
TAccountAdminSingleton extends string
|
|
64
|
-
? ReadonlyAccount<TAccountAdminSingleton>
|
|
65
|
-
: TAccountAdminSingleton,
|
|
56
|
+
TAccountAdminSingleton extends string ? ReadonlyAccount<TAccountAdminSingleton> : TAccountAdminSingleton,
|
|
66
57
|
TAccountGuard extends string ? WritableAccount<TAccountGuard> : TAccountGuard,
|
|
67
58
|
...TRemainingAccounts,
|
|
68
59
|
]
|
|
@@ -81,7 +72,7 @@ export function getSetAuctioneerPubKeyInstructionDataEncoder(): FixedSizeEncoder
|
|
|
81
72
|
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
82
73
|
['auctioneerPubKey', getAddressEncoder()],
|
|
83
74
|
]),
|
|
84
|
-
(value) => ({ ...value, discriminator: SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR })
|
|
75
|
+
(value) => ({ ...value, discriminator: SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR }),
|
|
85
76
|
);
|
|
86
77
|
}
|
|
87
78
|
|
|
@@ -96,10 +87,7 @@ export function getSetAuctioneerPubKeyInstructionDataCodec(): FixedSizeCodec<
|
|
|
96
87
|
SetAuctioneerPubKeyInstructionDataArgs,
|
|
97
88
|
SetAuctioneerPubKeyInstructionData
|
|
98
89
|
> {
|
|
99
|
-
return combineCodec(
|
|
100
|
-
getSetAuctioneerPubKeyInstructionDataEncoder(),
|
|
101
|
-
getSetAuctioneerPubKeyInstructionDataDecoder()
|
|
102
|
-
);
|
|
90
|
+
return combineCodec(getSetAuctioneerPubKeyInstructionDataEncoder(), getSetAuctioneerPubKeyInstructionDataDecoder());
|
|
103
91
|
}
|
|
104
92
|
|
|
105
93
|
export type SetAuctioneerPubKeyAsyncInput<
|
|
@@ -123,15 +111,8 @@ export async function getSetAuctioneerPubKeyInstructionAsync<
|
|
|
123
111
|
TProgramAddress extends Address = typeof SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS,
|
|
124
112
|
>(
|
|
125
113
|
input: SetAuctioneerPubKeyAsyncInput<TAccountAdmin, TAccountAdminSingleton, TAccountGuard>,
|
|
126
|
-
config?: { programAddress?: TProgramAddress }
|
|
127
|
-
): Promise<
|
|
128
|
-
SetAuctioneerPubKeyInstruction<
|
|
129
|
-
TProgramAddress,
|
|
130
|
-
TAccountAdmin,
|
|
131
|
-
TAccountAdminSingleton,
|
|
132
|
-
TAccountGuard
|
|
133
|
-
>
|
|
134
|
-
> {
|
|
114
|
+
config?: { programAddress?: TProgramAddress },
|
|
115
|
+
): Promise<SetAuctioneerPubKeyInstruction<TProgramAddress, TAccountAdmin, TAccountAdminSingleton, TAccountGuard>> {
|
|
135
116
|
// Program address.
|
|
136
117
|
const programAddress = config?.programAddress ?? SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS;
|
|
137
118
|
|
|
@@ -156,21 +137,10 @@ export async function getSetAuctioneerPubKeyInstructionAsync<
|
|
|
156
137
|
|
|
157
138
|
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
158
139
|
const instruction = {
|
|
159
|
-
accounts: [
|
|
160
|
-
getAccountMeta(accounts.admin),
|
|
161
|
-
getAccountMeta(accounts.adminSingleton),
|
|
162
|
-
getAccountMeta(accounts.guard),
|
|
163
|
-
],
|
|
140
|
+
accounts: [getAccountMeta(accounts.admin), getAccountMeta(accounts.adminSingleton), getAccountMeta(accounts.guard)],
|
|
164
141
|
programAddress,
|
|
165
|
-
data: getSetAuctioneerPubKeyInstructionDataEncoder().encode(
|
|
166
|
-
|
|
167
|
-
),
|
|
168
|
-
} as SetAuctioneerPubKeyInstruction<
|
|
169
|
-
TProgramAddress,
|
|
170
|
-
TAccountAdmin,
|
|
171
|
-
TAccountAdminSingleton,
|
|
172
|
-
TAccountGuard
|
|
173
|
-
>;
|
|
142
|
+
data: getSetAuctioneerPubKeyInstructionDataEncoder().encode(args as SetAuctioneerPubKeyInstructionDataArgs),
|
|
143
|
+
} as SetAuctioneerPubKeyInstruction<TProgramAddress, TAccountAdmin, TAccountAdminSingleton, TAccountGuard>;
|
|
174
144
|
|
|
175
145
|
return instruction;
|
|
176
146
|
}
|
|
@@ -196,13 +166,8 @@ export function getSetAuctioneerPubKeyInstruction<
|
|
|
196
166
|
TProgramAddress extends Address = typeof SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS,
|
|
197
167
|
>(
|
|
198
168
|
input: SetAuctioneerPubKeyInput<TAccountAdmin, TAccountAdminSingleton, TAccountGuard>,
|
|
199
|
-
config?: { programAddress?: TProgramAddress }
|
|
200
|
-
): SetAuctioneerPubKeyInstruction<
|
|
201
|
-
TProgramAddress,
|
|
202
|
-
TAccountAdmin,
|
|
203
|
-
TAccountAdminSingleton,
|
|
204
|
-
TAccountGuard
|
|
205
|
-
> {
|
|
169
|
+
config?: { programAddress?: TProgramAddress },
|
|
170
|
+
): SetAuctioneerPubKeyInstruction<TProgramAddress, TAccountAdmin, TAccountAdminSingleton, TAccountGuard> {
|
|
206
171
|
// Program address.
|
|
207
172
|
const programAddress = config?.programAddress ?? SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS;
|
|
208
173
|
|
|
@@ -219,21 +184,10 @@ export function getSetAuctioneerPubKeyInstruction<
|
|
|
219
184
|
|
|
220
185
|
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
221
186
|
const instruction = {
|
|
222
|
-
accounts: [
|
|
223
|
-
getAccountMeta(accounts.admin),
|
|
224
|
-
getAccountMeta(accounts.adminSingleton),
|
|
225
|
-
getAccountMeta(accounts.guard),
|
|
226
|
-
],
|
|
187
|
+
accounts: [getAccountMeta(accounts.admin), getAccountMeta(accounts.adminSingleton), getAccountMeta(accounts.guard)],
|
|
227
188
|
programAddress,
|
|
228
|
-
data: getSetAuctioneerPubKeyInstructionDataEncoder().encode(
|
|
229
|
-
|
|
230
|
-
),
|
|
231
|
-
} as SetAuctioneerPubKeyInstruction<
|
|
232
|
-
TProgramAddress,
|
|
233
|
-
TAccountAdmin,
|
|
234
|
-
TAccountAdminSingleton,
|
|
235
|
-
TAccountGuard
|
|
236
|
-
>;
|
|
189
|
+
data: getSetAuctioneerPubKeyInstructionDataEncoder().encode(args as SetAuctioneerPubKeyInstructionDataArgs),
|
|
190
|
+
} as SetAuctioneerPubKeyInstruction<TProgramAddress, TAccountAdmin, TAccountAdminSingleton, TAccountGuard>;
|
|
237
191
|
|
|
238
192
|
return instruction;
|
|
239
193
|
}
|
|
@@ -258,9 +212,7 @@ export function parseSetAuctioneerPubKeyInstruction<
|
|
|
258
212
|
TProgram extends string,
|
|
259
213
|
TAccountMetas extends readonly AccountMeta[],
|
|
260
214
|
>(
|
|
261
|
-
instruction: Instruction<TProgram> &
|
|
262
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
263
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
215
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
264
216
|
): ParsedSetAuctioneerPubKeyInstruction<TProgram, TAccountMetas> {
|
|
265
217
|
if (instruction.accounts.length < 3) {
|
|
266
218
|
// TODO: Coded error.
|
|
@@ -34,9 +34,7 @@ import { type AccountSignerMeta, type TransactionSigner } from '@solana/signers'
|
|
|
34
34
|
import { SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
35
35
|
import { getAccountMetaFactory, type ResolvedAccount } from '../shared/index.js';
|
|
36
36
|
|
|
37
|
-
export const START_ORDER_EXECUTION_DISCRIMINATOR = new Uint8Array([
|
|
38
|
-
38, 237, 19, 225, 182, 31, 246, 143,
|
|
39
|
-
]);
|
|
37
|
+
export const START_ORDER_EXECUTION_DISCRIMINATOR = new Uint8Array([38, 237, 19, 225, 182, 31, 246, 143]);
|
|
40
38
|
|
|
41
39
|
export function getStartOrderExecutionDiscriminatorBytes() {
|
|
42
40
|
return fixEncoderSize(getBytesEncoder(), 8).encode(START_ORDER_EXECUTION_DISCRIMINATOR);
|
|
@@ -47,9 +45,7 @@ export type StartOrderExecutionInstruction<
|
|
|
47
45
|
TAccountSolver extends string | AccountMeta<string> = string,
|
|
48
46
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
49
47
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
50
|
-
TAccountIxSysvar extends
|
|
51
|
-
| string
|
|
52
|
-
| AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
48
|
+
TAccountIxSysvar extends string | AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
53
49
|
TAccountCollateralTokenMint extends string | AccountMeta<string> = string,
|
|
54
50
|
TAccountSolverCollateralTokenAccount extends string | AccountMeta<string> = string,
|
|
55
51
|
TAccountGuardCollateralTokenAccount extends string | AccountMeta<string> = string,
|
|
@@ -86,10 +82,10 @@ export type StartOrderExecutionInstructionData = { discriminator: ReadonlyUint8A
|
|
|
86
82
|
export type StartOrderExecutionInstructionDataArgs = Object;
|
|
87
83
|
|
|
88
84
|
export function getStartOrderExecutionInstructionDataEncoder(): FixedSizeEncoder<StartOrderExecutionInstructionDataArgs> {
|
|
89
|
-
return transformEncoder(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
);
|
|
85
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
86
|
+
...value,
|
|
87
|
+
discriminator: START_ORDER_EXECUTION_DISCRIMINATOR,
|
|
88
|
+
}));
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
export function getStartOrderExecutionInstructionDataDecoder(): FixedSizeDecoder<StartOrderExecutionInstructionData> {
|
|
@@ -100,10 +96,7 @@ export function getStartOrderExecutionInstructionDataCodec(): FixedSizeCodec<
|
|
|
100
96
|
StartOrderExecutionInstructionDataArgs,
|
|
101
97
|
StartOrderExecutionInstructionData
|
|
102
98
|
> {
|
|
103
|
-
return combineCodec(
|
|
104
|
-
getStartOrderExecutionInstructionDataEncoder(),
|
|
105
|
-
getStartOrderExecutionInstructionDataDecoder()
|
|
106
|
-
);
|
|
99
|
+
return combineCodec(getStartOrderExecutionInstructionDataEncoder(), getStartOrderExecutionInstructionDataDecoder());
|
|
107
100
|
}
|
|
108
101
|
|
|
109
102
|
export type StartOrderExecutionInput<
|
|
@@ -159,7 +152,7 @@ export function getStartOrderExecutionInstruction<
|
|
|
159
152
|
TAccountGuardCollateralTokenAccount,
|
|
160
153
|
TAccountCollateralTokenProgram
|
|
161
154
|
>,
|
|
162
|
-
config?: { programAddress?: TProgramAddress }
|
|
155
|
+
config?: { programAddress?: TProgramAddress },
|
|
163
156
|
): StartOrderExecutionInstruction<
|
|
164
157
|
TProgramAddress,
|
|
165
158
|
TAccountSolver,
|
|
@@ -263,9 +256,7 @@ export function parseStartOrderExecutionInstruction<
|
|
|
263
256
|
TProgram extends string,
|
|
264
257
|
TAccountMetas extends readonly AccountMeta[],
|
|
265
258
|
>(
|
|
266
|
-
instruction: Instruction<TProgram> &
|
|
267
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
268
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
259
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
269
260
|
): ParsedStartOrderExecutionInstruction<TProgram, TAccountMetas> {
|
|
270
261
|
if (instruction.accounts.length < 8) {
|
|
271
262
|
// TODO: Coded error.
|
|
@@ -36,14 +36,10 @@ import { type AccountSignerMeta, type TransactionSigner } from '@solana/signers'
|
|
|
36
36
|
import { SOURCE_CHAIN_GUARD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
37
37
|
import { getAccountMetaFactory, type ResolvedAccount } from '../shared/index.js';
|
|
38
38
|
|
|
39
|
-
export const START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR = new Uint8Array([
|
|
40
|
-
142, 117, 45, 141, 169, 107, 117, 209,
|
|
41
|
-
]);
|
|
39
|
+
export const START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR = new Uint8Array([142, 117, 45, 141, 169, 107, 117, 209]);
|
|
42
40
|
|
|
43
41
|
export function getStartOrderExecutionAfterSwapDiscriminatorBytes() {
|
|
44
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(
|
|
45
|
-
START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR
|
|
46
|
-
);
|
|
42
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR);
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
export type StartOrderExecutionAfterSwapInstruction<
|
|
@@ -51,9 +47,7 @@ export type StartOrderExecutionAfterSwapInstruction<
|
|
|
51
47
|
TAccountSolver extends string | AccountMeta<string> = string,
|
|
52
48
|
TAccountOrder extends string | AccountMeta<string> = string,
|
|
53
49
|
TAccountGuard extends string | AccountMeta<string> = string,
|
|
54
|
-
TAccountIxSysvar extends
|
|
55
|
-
| string
|
|
56
|
-
| AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
50
|
+
TAccountIxSysvar extends string | AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
|
|
57
51
|
TAccountStablecoinTokenMint extends string | AccountMeta<string> = string,
|
|
58
52
|
TAccountSolverStablecoinTokenAccount extends string | AccountMeta<string> = string,
|
|
59
53
|
TAccountGuardStablecoinTokenAccount extends string | AccountMeta<string> = string,
|
|
@@ -100,7 +94,7 @@ export function getStartOrderExecutionAfterSwapInstructionDataEncoder(): FixedSi
|
|
|
100
94
|
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
101
95
|
['stablecoinsAmount', getU64Encoder()],
|
|
102
96
|
]),
|
|
103
|
-
(value) => ({ ...value, discriminator: START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR })
|
|
97
|
+
(value) => ({ ...value, discriminator: START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR }),
|
|
104
98
|
);
|
|
105
99
|
}
|
|
106
100
|
|
|
@@ -117,7 +111,7 @@ export function getStartOrderExecutionAfterSwapInstructionDataCodec(): FixedSize
|
|
|
117
111
|
> {
|
|
118
112
|
return combineCodec(
|
|
119
113
|
getStartOrderExecutionAfterSwapInstructionDataEncoder(),
|
|
120
|
-
getStartOrderExecutionAfterSwapInstructionDataDecoder()
|
|
114
|
+
getStartOrderExecutionAfterSwapInstructionDataDecoder(),
|
|
121
115
|
);
|
|
122
116
|
}
|
|
123
117
|
|
|
@@ -178,7 +172,7 @@ export function getStartOrderExecutionAfterSwapInstruction<
|
|
|
178
172
|
TAccountGuardStablecoinTokenAccount,
|
|
179
173
|
TAccountStablecoinTokenProgram
|
|
180
174
|
>,
|
|
181
|
-
config?: { programAddress?: TProgramAddress }
|
|
175
|
+
config?: { programAddress?: TProgramAddress },
|
|
182
176
|
): StartOrderExecutionAfterSwapInstruction<
|
|
183
177
|
TProgramAddress,
|
|
184
178
|
TAccountSolver,
|
|
@@ -235,7 +229,7 @@ export function getStartOrderExecutionAfterSwapInstruction<
|
|
|
235
229
|
],
|
|
236
230
|
programAddress,
|
|
237
231
|
data: getStartOrderExecutionAfterSwapInstructionDataEncoder().encode(
|
|
238
|
-
args as StartOrderExecutionAfterSwapInstructionDataArgs
|
|
232
|
+
args as StartOrderExecutionAfterSwapInstructionDataArgs,
|
|
239
233
|
),
|
|
240
234
|
} as StartOrderExecutionAfterSwapInstruction<
|
|
241
235
|
TProgramAddress,
|
|
@@ -291,9 +285,7 @@ export function parseStartOrderExecutionAfterSwapInstruction<
|
|
|
291
285
|
TProgram extends string,
|
|
292
286
|
TAccountMetas extends readonly AccountMeta[],
|
|
293
287
|
>(
|
|
294
|
-
instruction: Instruction<TProgram> &
|
|
295
|
-
InstructionWithAccounts<TAccountMetas> &
|
|
296
|
-
InstructionWithData<ReadonlyUint8Array>
|
|
288
|
+
instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>,
|
|
297
289
|
): ParsedStartOrderExecutionAfterSwapInstruction<TProgram, TAccountMetas> {
|
|
298
290
|
if (instruction.accounts.length < 8) {
|
|
299
291
|
// TODO: Coded error.
|