@shogun-sdk/intents-sdk 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/constants.js +24 -8
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/evm/intent-provider.js +55 -2
- package/dist/esm/core/evm/intent-provider.js.map +1 -1
- package/dist/esm/core/evm/order-signature.js +12 -1
- package/dist/esm/core/evm/order-signature.js.map +1 -1
- package/dist/esm/core/evm/permit2.js +24 -1
- package/dist/esm/core/evm/permit2.js.map +1 -1
- package/dist/esm/core/evm/sdk.js +9 -4
- package/dist/esm/core/evm/sdk.js.map +1 -1
- package/dist/esm/core/evm/validator.js +21 -0
- package/dist/esm/core/evm/validator.js.map +1 -1
- package/dist/esm/core/orders/cross-chain.js +4 -1
- package/dist/esm/core/orders/cross-chain.js.map +1 -1
- package/dist/esm/core/orders/dca-single-chain.js +169 -0
- package/dist/esm/core/orders/dca-single-chain.js.map +1 -0
- package/dist/esm/core/orders/single-chain.js +6 -1
- package/dist/esm/core/orders/single-chain.js.map +1 -1
- package/dist/esm/core/sdk.js +55 -81
- package/dist/esm/core/sdk.js.map +1 -1
- package/dist/esm/core/solana/dca/cancel-order.js +61 -0
- package/dist/esm/core/solana/dca/cancel-order.js.map +1 -0
- package/dist/esm/core/solana/dca/create-order.js +82 -0
- package/dist/esm/core/solana/dca/create-order.js.map +1 -0
- package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js +5 -20
- 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 -16
- 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 +4 -16
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js +14 -56
- 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 +6 -24
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js +4 -16
- 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.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js +1 -4
- 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 +2 -8
- 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 +3 -12
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js +2 -5
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/tokenInSwapped.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/cancelDcaOrder.js +2 -8
- 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 +2 -8
- 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 +6 -24
- 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 +6 -24
- 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 +4 -16
- 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 +6 -24
- 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 +9 -36
- 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 +8 -32
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js.map +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 +1 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/shared/index.js +2 -5
- package/dist/esm/core/solana/generated/single-chain/shared/index.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/guardCreated.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js.map +1 -1
- package/dist/esm/core/solana/inspect.js +43 -0
- package/dist/esm/core/solana/inspect.js.map +1 -0
- package/dist/esm/core/solana/sdk.js +36 -0
- package/dist/esm/core/solana/sdk.js.map +1 -1
- package/dist/esm/core/solana/utils.js.map +1 -1
- package/dist/esm/core/solana/validator.js +3 -0
- package/dist/esm/core/solana/validator.js.map +1 -1
- package/dist/esm/core/sui/sdk.js +0 -3
- package/dist/esm/core/sui/sdk.js.map +1 -1
- package/dist/esm/core/sui/validator.js +4 -0
- package/dist/esm/core/sui/validator.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/base-validator.js +28 -0
- package/dist/esm/utils/base-validator.js.map +1 -1
- package/dist/esm/utils/order-validator.js +31 -0
- package/dist/esm/utils/order-validator.js.map +1 -1
- package/dist/esm/utils/quote/aggregator.js +2 -2
- package/dist/esm/utils/quote/aggregator.js.map +1 -1
- package/dist/esm/utils/quote/liquidswap.js.map +1 -1
- package/dist/types/constants.d.ts +10 -7
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/core/evm/intent-provider.d.ts +5 -2
- package/dist/types/core/evm/intent-provider.d.ts.map +1 -1
- package/dist/types/core/evm/order-signature.d.ts +5 -0
- package/dist/types/core/evm/order-signature.d.ts.map +1 -1
- package/dist/types/core/evm/permit2.d.ts +90 -0
- package/dist/types/core/evm/permit2.d.ts.map +1 -1
- package/dist/types/core/evm/sdk.d.ts +3 -1
- package/dist/types/core/evm/sdk.d.ts.map +1 -1
- package/dist/types/core/evm/validator.d.ts +4 -0
- package/dist/types/core/evm/validator.d.ts.map +1 -1
- package/dist/types/core/orders/cross-chain.d.ts.map +1 -1
- package/dist/types/core/orders/dca-single-chain.d.ts +47 -0
- package/dist/types/core/orders/dca-single-chain.d.ts.map +1 -0
- package/dist/types/core/orders/single-chain.d.ts.map +1 -1
- package/dist/types/core/sdk.d.ts +15 -10
- package/dist/types/core/sdk.d.ts.map +1 -1
- package/dist/types/core/solana/dca/cancel-order.d.ts +5 -0
- package/dist/types/core/solana/dca/cancel-order.d.ts.map +1 -0
- package/dist/types/core/solana/dca/create-order.d.ts +8 -0
- package/dist/types/core/solana/dca/create-order.d.ts.map +1 -0
- 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 +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/cancelOrder.d.ts +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 +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 +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/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 +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 +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 +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/shared/index.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/tokenInSwapped.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 +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 +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 +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 +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 +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/shared/index.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/guardCreated.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/inspect.d.ts +14 -0
- package/dist/types/core/solana/inspect.d.ts.map +1 -0
- package/dist/types/core/solana/sdk.d.ts +4 -1
- package/dist/types/core/solana/sdk.d.ts.map +1 -1
- package/dist/types/core/solana/utils.d.ts +2 -1
- package/dist/types/core/solana/utils.d.ts.map +1 -1
- package/dist/types/core/solana/validator.d.ts +1 -0
- package/dist/types/core/solana/validator.d.ts.map +1 -1
- package/dist/types/core/sui/sdk.d.ts +1 -2
- package/dist/types/core/sui/sdk.d.ts.map +1 -1
- package/dist/types/core/sui/validator.d.ts +1 -0
- package/dist/types/core/sui/validator.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/intent.d.ts +22 -0
- package/dist/types/types/intent.d.ts.map +1 -1
- package/dist/types/utils/base-validator.d.ts +7 -0
- package/dist/types/utils/base-validator.d.ts.map +1 -1
- package/dist/types/utils/order-validator.d.ts +15 -0
- package/dist/types/utils/order-validator.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/auth/siwe.ts +1 -1
- package/src/constants.ts +72 -39
- package/src/core/evm/connectors/hyperevm.ts +1 -1
- package/src/core/evm/intent-provider.ts +88 -4
- package/src/core/evm/order-signature.ts +23 -1
- package/src/core/evm/permit2.ts +47 -1
- package/src/core/evm/sdk.ts +20 -7
- package/src/core/evm/validator.ts +32 -0
- package/src/core/orders/api/fetch.ts +0 -1
- package/src/core/orders/api/index.ts +4 -4
- package/src/core/orders/cross-chain.ts +5 -1
- package/src/core/orders/dca-single-chain.ts +143 -0
- package/src/core/orders/single-chain.ts +8 -1
- package/src/core/sdk.ts +72 -100
- package/src/core/solana/cancel-order.ts +1 -1
- package/src/core/solana/dca/cancel-order.ts +91 -0
- package/src/core/solana/dca/create-order.ts +142 -0
- package/src/core/solana/generated/cross-chain/errors/sourceChainGuard.ts +1 -3
- package/src/core/solana/generated/cross-chain/instructions/acceptAdmin.ts +1 -1
- package/src/core/solana/generated/cross-chain/instructions/cancelOrder.ts +6 -21
- package/src/core/solana/generated/cross-chain/instructions/claimTokens.ts +5 -17
- package/src/core/solana/generated/cross-chain/instructions/collectProtocolFees.ts +6 -20
- package/src/core/solana/generated/cross-chain/instructions/createGuard.ts +14 -56
- package/src/core/solana/generated/cross-chain/instructions/createOrder.ts +6 -24
- package/src/core/solana/generated/cross-chain/instructions/initialize.ts +1 -1
- package/src/core/solana/generated/cross-chain/instructions/preStartOrderExecution.ts +6 -20
- package/src/core/solana/generated/cross-chain/instructions/setAdmin.ts +1 -4
- package/src/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.ts +2 -7
- package/src/core/solana/generated/cross-chain/instructions/startOrderExecution.ts +4 -12
- package/src/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.ts +3 -12
- package/src/core/solana/generated/cross-chain/shared/index.ts +2 -5
- package/src/core/solana/generated/cross-chain/types/auctioneerPubkeyUpdated.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/tokenInSwapped.ts +1 -5
- package/src/core/solana/generated/single-chain/errors/singleChainGuard.ts +1 -3
- package/src/core/solana/generated/single-chain/instructions/acceptAdmin.ts +1 -1
- package/src/core/solana/generated/single-chain/instructions/cancelDcaOrder.ts +4 -12
- package/src/core/solana/generated/single-chain/instructions/cancelLimitOrder.ts +4 -12
- package/src/core/solana/generated/single-chain/instructions/collectProtocolFees.ts +8 -28
- package/src/core/solana/generated/single-chain/instructions/createDcaOrder.ts +6 -24
- package/src/core/solana/generated/single-chain/instructions/createGuard.ts +5 -20
- package/src/core/solana/generated/single-chain/instructions/createLimitOrder.ts +6 -24
- package/src/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.ts +9 -36
- package/src/core/solana/generated/single-chain/instructions/fulfillLimitOrder.ts +8 -32
- package/src/core/solana/generated/single-chain/instructions/initialize.ts +1 -1
- package/src/core/solana/generated/single-chain/instructions/setAdmin.ts +1 -4
- package/src/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.ts +2 -7
- package/src/core/solana/generated/single-chain/shared/index.ts +2 -5
- package/src/core/solana/generated/single-chain/types/auctioneerPubkeyUpdated.ts +1 -4
- package/src/core/solana/generated/single-chain/types/guardCreated.ts +1 -5
- package/src/core/solana/generated/single-chain/types/limitOrderFulfilled.ts +1 -4
- package/src/core/solana/inspect.ts +50 -0
- package/src/core/solana/order-instructions.ts +1 -1
- package/src/core/solana/sdk.ts +65 -2
- package/src/core/solana/utils.ts +2 -1
- package/src/core/solana/validator.ts +4 -0
- package/src/core/sui/sdk.ts +2 -6
- package/src/core/sui/validator.ts +5 -0
- package/src/index.ts +12 -1
- package/src/types/api.ts +1 -1
- package/src/types/intent.ts +27 -0
- package/src/utils/base-validator.ts +40 -0
- package/src/utils/order-validator.ts +38 -0
- package/src/utils/quote/aggregator.ts +2 -2
- package/src/utils/quote/liquidswap.ts +2 -2
|
@@ -42,9 +42,7 @@ export function getSourceChainGuardErrorMessage(code: SourceChainGuardError): st
|
|
|
42
42
|
|
|
43
43
|
export function isSourceChainGuardError<TProgramErrorCode extends SourceChainGuardError>(
|
|
44
44
|
error: unknown,
|
|
45
|
-
transactionMessage: {
|
|
46
|
-
instructions: Record<number, { programAddress: Address }>;
|
|
47
|
-
},
|
|
45
|
+
transactionMessage: { instructions: Record<number, { programAddress: Address }> },
|
|
48
46
|
code?: TProgramErrorCode,
|
|
49
47
|
): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &
|
|
50
48
|
Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {
|
|
@@ -58,7 +58,7 @@ export type AcceptAdminInstruction<
|
|
|
58
58
|
|
|
59
59
|
export type AcceptAdminInstructionData = { discriminator: ReadonlyUint8Array };
|
|
60
60
|
|
|
61
|
-
export type AcceptAdminInstructionDataArgs =
|
|
61
|
+
export type AcceptAdminInstructionDataArgs = object;
|
|
62
62
|
|
|
63
63
|
export function getAcceptAdminInstructionDataEncoder(): Encoder<AcceptAdminInstructionDataArgs> {
|
|
64
64
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -93,7 +93,7 @@ export type CancelOrderInstruction<
|
|
|
93
93
|
|
|
94
94
|
export type CancelOrderInstructionData = { discriminator: ReadonlyUint8Array };
|
|
95
95
|
|
|
96
|
-
export type CancelOrderInstructionDataArgs =
|
|
96
|
+
export type CancelOrderInstructionDataArgs = object;
|
|
97
97
|
|
|
98
98
|
export function getCancelOrderInstructionDataEncoder(): Encoder<CancelOrderInstructionDataArgs> {
|
|
99
99
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -208,26 +208,14 @@ export function getCancelOrderInstruction<
|
|
|
208
208
|
user: { value: input.user ?? null, isWritable: true },
|
|
209
209
|
order: { value: input.order ?? null, isWritable: true },
|
|
210
210
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
211
|
-
recoveredTokenMint: {
|
|
212
|
-
|
|
213
|
-
isWritable: false,
|
|
214
|
-
},
|
|
215
|
-
userRecoveredTokenAccount: {
|
|
216
|
-
value: input.userRecoveredTokenAccount ?? null,
|
|
217
|
-
isWritable: true,
|
|
218
|
-
},
|
|
211
|
+
recoveredTokenMint: { value: input.recoveredTokenMint ?? null, isWritable: false },
|
|
212
|
+
userRecoveredTokenAccount: { value: input.userRecoveredTokenAccount ?? null, isWritable: true },
|
|
219
213
|
guardRecoveredTokenAccount: {
|
|
220
214
|
value: input.guardRecoveredTokenAccount ?? null,
|
|
221
215
|
isWritable: true,
|
|
222
216
|
},
|
|
223
|
-
recoveredTokenProgram: {
|
|
224
|
-
|
|
225
|
-
isWritable: false,
|
|
226
|
-
},
|
|
227
|
-
collateralTokenMint: {
|
|
228
|
-
value: input.collateralTokenMint ?? null,
|
|
229
|
-
isWritable: false,
|
|
230
|
-
},
|
|
217
|
+
recoveredTokenProgram: { value: input.recoveredTokenProgram ?? null, isWritable: false },
|
|
218
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
231
219
|
userCollateralTokenAccount: {
|
|
232
220
|
value: input.userCollateralTokenAccount ?? null,
|
|
233
221
|
isWritable: true,
|
|
@@ -236,10 +224,7 @@ export function getCancelOrderInstruction<
|
|
|
236
224
|
value: input.guardCollateralTokenAccount ?? null,
|
|
237
225
|
isWritable: true,
|
|
238
226
|
},
|
|
239
|
-
collateralTokenProgram: {
|
|
240
|
-
value: input.collateralTokenProgram ?? null,
|
|
241
|
-
isWritable: false,
|
|
242
|
-
},
|
|
227
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
243
228
|
};
|
|
244
229
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
245
230
|
|
|
@@ -101,7 +101,7 @@ export type ClaimTokensInstruction<
|
|
|
101
101
|
|
|
102
102
|
export type ClaimTokensInstructionData = { discriminator: ReadonlyUint8Array };
|
|
103
103
|
|
|
104
|
-
export type ClaimTokensInstructionDataArgs =
|
|
104
|
+
export type ClaimTokensInstructionDataArgs = object;
|
|
105
105
|
|
|
106
106
|
export function getClaimTokensInstructionDataEncoder(): Encoder<ClaimTokensInstructionDataArgs> {
|
|
107
107
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -240,10 +240,7 @@ export function getClaimTokensInstruction<
|
|
|
240
240
|
user: { value: input.user ?? null, isWritable: true },
|
|
241
241
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
242
242
|
ixSysvar: { value: input.ixSysvar ?? null, isWritable: false },
|
|
243
|
-
recoveredTokenMint: {
|
|
244
|
-
value: input.recoveredTokenMint ?? null,
|
|
245
|
-
isWritable: false,
|
|
246
|
-
},
|
|
243
|
+
recoveredTokenMint: { value: input.recoveredTokenMint ?? null, isWritable: false },
|
|
247
244
|
solverRecoveredTokenAccount: {
|
|
248
245
|
value: input.solverRecoveredTokenAccount ?? null,
|
|
249
246
|
isWritable: true,
|
|
@@ -252,14 +249,8 @@ export function getClaimTokensInstruction<
|
|
|
252
249
|
value: input.guardRecoveredTokenAccount ?? null,
|
|
253
250
|
isWritable: true,
|
|
254
251
|
},
|
|
255
|
-
recoveredTokenProgram: {
|
|
256
|
-
|
|
257
|
-
isWritable: false,
|
|
258
|
-
},
|
|
259
|
-
collateralTokenMint: {
|
|
260
|
-
value: input.collateralTokenMint ?? null,
|
|
261
|
-
isWritable: false,
|
|
262
|
-
},
|
|
252
|
+
recoveredTokenProgram: { value: input.recoveredTokenProgram ?? null, isWritable: false },
|
|
253
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
263
254
|
solverCollateralTokenAccount: {
|
|
264
255
|
value: input.solverCollateralTokenAccount ?? null,
|
|
265
256
|
isWritable: true,
|
|
@@ -272,10 +263,7 @@ export function getClaimTokensInstruction<
|
|
|
272
263
|
value: input.guardCollateralTokenAccount ?? null,
|
|
273
264
|
isWritable: true,
|
|
274
265
|
},
|
|
275
|
-
collateralTokenProgram: {
|
|
276
|
-
value: input.collateralTokenProgram ?? null,
|
|
277
|
-
isWritable: false,
|
|
278
|
-
},
|
|
266
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
279
267
|
};
|
|
280
268
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
281
269
|
|
|
@@ -75,11 +75,9 @@ export type CollectProtocolFeesInstruction<
|
|
|
75
75
|
]
|
|
76
76
|
>;
|
|
77
77
|
|
|
78
|
-
export type CollectProtocolFeesInstructionData = {
|
|
79
|
-
discriminator: ReadonlyUint8Array;
|
|
80
|
-
};
|
|
78
|
+
export type CollectProtocolFeesInstructionData = { discriminator: ReadonlyUint8Array };
|
|
81
79
|
|
|
82
|
-
export type CollectProtocolFeesInstructionDataArgs =
|
|
80
|
+
export type CollectProtocolFeesInstructionDataArgs = object;
|
|
83
81
|
|
|
84
82
|
export function getCollectProtocolFeesInstructionDataEncoder(): Encoder<CollectProtocolFeesInstructionDataArgs> {
|
|
85
83
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -164,10 +162,7 @@ export async function getCollectProtocolFeesInstructionAsync<
|
|
|
164
162
|
admin: { value: input.admin ?? null, isWritable: true },
|
|
165
163
|
adminSingleton: { value: input.adminSingleton ?? null, isWritable: false },
|
|
166
164
|
guard: { value: input.guard ?? null, isWritable: true },
|
|
167
|
-
collateralTokenMint: {
|
|
168
|
-
value: input.collateralTokenMint ?? null,
|
|
169
|
-
isWritable: false,
|
|
170
|
-
},
|
|
165
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
171
166
|
adminCollateralTokenAccount: {
|
|
172
167
|
value: input.adminCollateralTokenAccount ?? null,
|
|
173
168
|
isWritable: true,
|
|
@@ -176,10 +171,7 @@ export async function getCollectProtocolFeesInstructionAsync<
|
|
|
176
171
|
value: input.guardCollateralTokenAccount ?? null,
|
|
177
172
|
isWritable: true,
|
|
178
173
|
},
|
|
179
|
-
collateralTokenProgram: {
|
|
180
|
-
value: input.collateralTokenProgram ?? null,
|
|
181
|
-
isWritable: false,
|
|
182
|
-
},
|
|
174
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
183
175
|
};
|
|
184
176
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
185
177
|
|
|
@@ -281,10 +273,7 @@ export function getCollectProtocolFeesInstruction<
|
|
|
281
273
|
admin: { value: input.admin ?? null, isWritable: true },
|
|
282
274
|
adminSingleton: { value: input.adminSingleton ?? null, isWritable: false },
|
|
283
275
|
guard: { value: input.guard ?? null, isWritable: true },
|
|
284
|
-
collateralTokenMint: {
|
|
285
|
-
value: input.collateralTokenMint ?? null,
|
|
286
|
-
isWritable: false,
|
|
287
|
-
},
|
|
276
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
288
277
|
adminCollateralTokenAccount: {
|
|
289
278
|
value: input.adminCollateralTokenAccount ?? null,
|
|
290
279
|
isWritable: true,
|
|
@@ -293,10 +282,7 @@ export function getCollectProtocolFeesInstruction<
|
|
|
293
282
|
value: input.guardCollateralTokenAccount ?? null,
|
|
294
283
|
isWritable: true,
|
|
295
284
|
},
|
|
296
|
-
collateralTokenProgram: {
|
|
297
|
-
value: input.collateralTokenProgram ?? null,
|
|
298
|
-
isWritable: false,
|
|
299
|
-
},
|
|
285
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
300
286
|
};
|
|
301
287
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
302
288
|
|
|
@@ -214,34 +214,13 @@ export async function getCreateGuardInstructionAsync<
|
|
|
214
214
|
guard: { value: input.guard ?? null, isWritable: true },
|
|
215
215
|
adminSingleton: { value: input.adminSingleton ?? null, isWritable: false },
|
|
216
216
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
217
|
-
associatedTokenProgram: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
collateralTokenAccount: {
|
|
226
|
-
value: input.collateralTokenAccount ?? null,
|
|
227
|
-
isWritable: true,
|
|
228
|
-
},
|
|
229
|
-
collateralTokenProgram: {
|
|
230
|
-
value: input.collateralTokenProgram ?? null,
|
|
231
|
-
isWritable: false,
|
|
232
|
-
},
|
|
233
|
-
stablecoinTokenMint: {
|
|
234
|
-
value: input.stablecoinTokenMint ?? null,
|
|
235
|
-
isWritable: false,
|
|
236
|
-
},
|
|
237
|
-
stablecoinTokenAccount: {
|
|
238
|
-
value: input.stablecoinTokenAccount ?? null,
|
|
239
|
-
isWritable: true,
|
|
240
|
-
},
|
|
241
|
-
stablecoinTokenProgram: {
|
|
242
|
-
value: input.stablecoinTokenProgram ?? null,
|
|
243
|
-
isWritable: false,
|
|
244
|
-
},
|
|
217
|
+
associatedTokenProgram: { value: input.associatedTokenProgram ?? null, isWritable: false },
|
|
218
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
219
|
+
collateralTokenAccount: { value: input.collateralTokenAccount ?? null, isWritable: true },
|
|
220
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
221
|
+
stablecoinTokenMint: { value: input.stablecoinTokenMint ?? null, isWritable: false },
|
|
222
|
+
stablecoinTokenAccount: { value: input.stablecoinTokenAccount ?? null, isWritable: true },
|
|
223
|
+
stablecoinTokenProgram: { value: input.stablecoinTokenProgram ?? null, isWritable: false },
|
|
245
224
|
};
|
|
246
225
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
247
226
|
|
|
@@ -422,34 +401,13 @@ export function getCreateGuardInstruction<
|
|
|
422
401
|
guard: { value: input.guard ?? null, isWritable: true },
|
|
423
402
|
adminSingleton: { value: input.adminSingleton ?? null, isWritable: false },
|
|
424
403
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
425
|
-
associatedTokenProgram: {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
},
|
|
433
|
-
collateralTokenAccount: {
|
|
434
|
-
value: input.collateralTokenAccount ?? null,
|
|
435
|
-
isWritable: true,
|
|
436
|
-
},
|
|
437
|
-
collateralTokenProgram: {
|
|
438
|
-
value: input.collateralTokenProgram ?? null,
|
|
439
|
-
isWritable: false,
|
|
440
|
-
},
|
|
441
|
-
stablecoinTokenMint: {
|
|
442
|
-
value: input.stablecoinTokenMint ?? null,
|
|
443
|
-
isWritable: false,
|
|
444
|
-
},
|
|
445
|
-
stablecoinTokenAccount: {
|
|
446
|
-
value: input.stablecoinTokenAccount ?? null,
|
|
447
|
-
isWritable: true,
|
|
448
|
-
},
|
|
449
|
-
stablecoinTokenProgram: {
|
|
450
|
-
value: input.stablecoinTokenProgram ?? null,
|
|
451
|
-
isWritable: false,
|
|
452
|
-
},
|
|
404
|
+
associatedTokenProgram: { value: input.associatedTokenProgram ?? null, isWritable: false },
|
|
405
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
406
|
+
collateralTokenAccount: { value: input.collateralTokenAccount ?? null, isWritable: true },
|
|
407
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
408
|
+
stablecoinTokenMint: { value: input.stablecoinTokenMint ?? null, isWritable: false },
|
|
409
|
+
stablecoinTokenAccount: { value: input.stablecoinTokenAccount ?? null, isWritable: true },
|
|
410
|
+
stablecoinTokenProgram: { value: input.stablecoinTokenProgram ?? null, isWritable: false },
|
|
453
411
|
};
|
|
454
412
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
455
413
|
|
|
@@ -210,19 +210,10 @@ export async function getCreateOrderInstructionAsync<
|
|
|
210
210
|
order: { value: input.order ?? null, isWritable: true },
|
|
211
211
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
212
212
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
213
|
-
associatedTokenProgram: {
|
|
214
|
-
value: input.associatedTokenProgram ?? null,
|
|
215
|
-
isWritable: false,
|
|
216
|
-
},
|
|
213
|
+
associatedTokenProgram: { value: input.associatedTokenProgram ?? null, isWritable: false },
|
|
217
214
|
tokenInMint: { value: input.tokenInMint ?? null, isWritable: false },
|
|
218
|
-
userTokenInAccount: {
|
|
219
|
-
|
|
220
|
-
isWritable: true,
|
|
221
|
-
},
|
|
222
|
-
guardTokenInAccount: {
|
|
223
|
-
value: input.guardTokenInAccount ?? null,
|
|
224
|
-
isWritable: true,
|
|
225
|
-
},
|
|
215
|
+
userTokenInAccount: { value: input.userTokenInAccount ?? null, isWritable: true },
|
|
216
|
+
guardTokenInAccount: { value: input.guardTokenInAccount ?? null, isWritable: true },
|
|
226
217
|
tokenInProgram: { value: input.tokenInProgram ?? null, isWritable: false },
|
|
227
218
|
};
|
|
228
219
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
@@ -361,19 +352,10 @@ export function getCreateOrderInstruction<
|
|
|
361
352
|
order: { value: input.order ?? null, isWritable: true },
|
|
362
353
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
363
354
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
364
|
-
associatedTokenProgram: {
|
|
365
|
-
value: input.associatedTokenProgram ?? null,
|
|
366
|
-
isWritable: false,
|
|
367
|
-
},
|
|
355
|
+
associatedTokenProgram: { value: input.associatedTokenProgram ?? null, isWritable: false },
|
|
368
356
|
tokenInMint: { value: input.tokenInMint ?? null, isWritable: false },
|
|
369
|
-
userTokenInAccount: {
|
|
370
|
-
|
|
371
|
-
isWritable: true,
|
|
372
|
-
},
|
|
373
|
-
guardTokenInAccount: {
|
|
374
|
-
value: input.guardTokenInAccount ?? null,
|
|
375
|
-
isWritable: true,
|
|
376
|
-
},
|
|
357
|
+
userTokenInAccount: { value: input.userTokenInAccount ?? null, isWritable: true },
|
|
358
|
+
guardTokenInAccount: { value: input.guardTokenInAccount ?? null, isWritable: true },
|
|
377
359
|
tokenInProgram: { value: input.tokenInProgram ?? null, isWritable: false },
|
|
378
360
|
};
|
|
379
361
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
@@ -65,7 +65,7 @@ export type InitializeInstruction<
|
|
|
65
65
|
|
|
66
66
|
export type InitializeInstructionData = { discriminator: ReadonlyUint8Array };
|
|
67
67
|
|
|
68
|
-
export type InitializeInstructionDataArgs =
|
|
68
|
+
export type InitializeInstructionDataArgs = object;
|
|
69
69
|
|
|
70
70
|
export function getInitializeInstructionDataEncoder(): Encoder<InitializeInstructionDataArgs> {
|
|
71
71
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -89,11 +89,9 @@ export type PreStartOrderExecutionInstruction<
|
|
|
89
89
|
]
|
|
90
90
|
>;
|
|
91
91
|
|
|
92
|
-
export type PreStartOrderExecutionInstructionData = {
|
|
93
|
-
discriminator: ReadonlyUint8Array;
|
|
94
|
-
};
|
|
92
|
+
export type PreStartOrderExecutionInstructionData = { discriminator: ReadonlyUint8Array };
|
|
95
93
|
|
|
96
|
-
export type PreStartOrderExecutionInstructionDataArgs =
|
|
94
|
+
export type PreStartOrderExecutionInstructionDataArgs = object;
|
|
97
95
|
|
|
98
96
|
export function getPreStartOrderExecutionInstructionDataEncoder(): Encoder<PreStartOrderExecutionInstructionDataArgs> {
|
|
99
97
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -214,10 +212,7 @@ export function getPreStartOrderExecutionInstruction<
|
|
|
214
212
|
order: { value: input.order ?? null, isWritable: true },
|
|
215
213
|
guard: { value: input.guard ?? null, isWritable: true },
|
|
216
214
|
ixSysvar: { value: input.ixSysvar ?? null, isWritable: false },
|
|
217
|
-
collateralTokenMint: {
|
|
218
|
-
value: input.collateralTokenMint ?? null,
|
|
219
|
-
isWritable: false,
|
|
220
|
-
},
|
|
215
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
221
216
|
solverCollateralTokenAccount: {
|
|
222
217
|
value: input.solverCollateralTokenAccount ?? null,
|
|
223
218
|
isWritable: true,
|
|
@@ -226,19 +221,10 @@ export function getPreStartOrderExecutionInstruction<
|
|
|
226
221
|
value: input.guardCollateralTokenAccount ?? null,
|
|
227
222
|
isWritable: true,
|
|
228
223
|
},
|
|
229
|
-
collateralTokenProgram: {
|
|
230
|
-
value: input.collateralTokenProgram ?? null,
|
|
231
|
-
isWritable: false,
|
|
232
|
-
},
|
|
224
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
233
225
|
tokenInMint: { value: input.tokenInMint ?? null, isWritable: false },
|
|
234
|
-
solverTokenInAccount: {
|
|
235
|
-
|
|
236
|
-
isWritable: true,
|
|
237
|
-
},
|
|
238
|
-
guardTokenInAccount: {
|
|
239
|
-
value: input.guardTokenInAccount ?? null,
|
|
240
|
-
isWritable: true,
|
|
241
|
-
},
|
|
226
|
+
solverTokenInAccount: { value: input.solverTokenInAccount ?? null, isWritable: true },
|
|
227
|
+
guardTokenInAccount: { value: input.guardTokenInAccount ?? null, isWritable: true },
|
|
242
228
|
tokenInProgram: { value: input.tokenInProgram ?? null, isWritable: false },
|
|
243
229
|
};
|
|
244
230
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
@@ -56,10 +56,7 @@ export type SetAdminInstruction<
|
|
|
56
56
|
]
|
|
57
57
|
>;
|
|
58
58
|
|
|
59
|
-
export type SetAdminInstructionData = {
|
|
60
|
-
discriminator: ReadonlyUint8Array;
|
|
61
|
-
newAdmin: Address;
|
|
62
|
-
};
|
|
59
|
+
export type SetAdminInstructionData = { discriminator: ReadonlyUint8Array; newAdmin: Address };
|
|
63
60
|
|
|
64
61
|
export type SetAdminInstructionDataArgs = { newAdmin: Address };
|
|
65
62
|
|
|
@@ -64,9 +64,7 @@ export type SetAuctioneerPubKeyInstructionData = {
|
|
|
64
64
|
auctioneerPubKey: Address;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
export type SetAuctioneerPubKeyInstructionDataArgs = {
|
|
68
|
-
auctioneerPubKey: Address;
|
|
69
|
-
};
|
|
67
|
+
export type SetAuctioneerPubKeyInstructionDataArgs = { auctioneerPubKey: Address };
|
|
70
68
|
|
|
71
69
|
export function getSetAuctioneerPubKeyInstructionDataEncoder(): Encoder<SetAuctioneerPubKeyInstructionDataArgs> {
|
|
72
70
|
return transformEncoder(
|
|
@@ -74,10 +72,7 @@ export function getSetAuctioneerPubKeyInstructionDataEncoder(): Encoder<SetAucti
|
|
|
74
72
|
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
75
73
|
['auctioneerPubKey', getAddressEncoder()],
|
|
76
74
|
]),
|
|
77
|
-
(value) => ({
|
|
78
|
-
...value,
|
|
79
|
-
discriminator: SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR,
|
|
80
|
-
}),
|
|
75
|
+
(value) => ({ ...value, discriminator: SET_AUCTIONEER_PUB_KEY_DISCRIMINATOR }),
|
|
81
76
|
);
|
|
82
77
|
}
|
|
83
78
|
|
|
@@ -77,11 +77,9 @@ export type StartOrderExecutionInstruction<
|
|
|
77
77
|
]
|
|
78
78
|
>;
|
|
79
79
|
|
|
80
|
-
export type StartOrderExecutionInstructionData = {
|
|
81
|
-
discriminator: ReadonlyUint8Array;
|
|
82
|
-
};
|
|
80
|
+
export type StartOrderExecutionInstructionData = { discriminator: ReadonlyUint8Array };
|
|
83
81
|
|
|
84
|
-
export type StartOrderExecutionInstructionDataArgs =
|
|
82
|
+
export type StartOrderExecutionInstructionDataArgs = object;
|
|
85
83
|
|
|
86
84
|
export function getStartOrderExecutionInstructionDataEncoder(): Encoder<StartOrderExecutionInstructionDataArgs> {
|
|
87
85
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -175,10 +173,7 @@ export function getStartOrderExecutionInstruction<
|
|
|
175
173
|
order: { value: input.order ?? null, isWritable: true },
|
|
176
174
|
guard: { value: input.guard ?? null, isWritable: true },
|
|
177
175
|
ixSysvar: { value: input.ixSysvar ?? null, isWritable: false },
|
|
178
|
-
collateralTokenMint: {
|
|
179
|
-
value: input.collateralTokenMint ?? null,
|
|
180
|
-
isWritable: false,
|
|
181
|
-
},
|
|
176
|
+
collateralTokenMint: { value: input.collateralTokenMint ?? null, isWritable: false },
|
|
182
177
|
solverCollateralTokenAccount: {
|
|
183
178
|
value: input.solverCollateralTokenAccount ?? null,
|
|
184
179
|
isWritable: true,
|
|
@@ -187,10 +182,7 @@ export function getStartOrderExecutionInstruction<
|
|
|
187
182
|
value: input.guardCollateralTokenAccount ?? null,
|
|
188
183
|
isWritable: true,
|
|
189
184
|
},
|
|
190
|
-
collateralTokenProgram: {
|
|
191
|
-
value: input.collateralTokenProgram ?? null,
|
|
192
|
-
isWritable: false,
|
|
193
|
-
},
|
|
185
|
+
collateralTokenProgram: { value: input.collateralTokenProgram ?? null, isWritable: false },
|
|
194
186
|
};
|
|
195
187
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
196
188
|
|
|
@@ -94,10 +94,7 @@ export function getStartOrderExecutionAfterSwapInstructionDataEncoder(): Encoder
|
|
|
94
94
|
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
95
95
|
['stablecoinsAmount', getU64Encoder()],
|
|
96
96
|
]),
|
|
97
|
-
(value) => ({
|
|
98
|
-
...value,
|
|
99
|
-
discriminator: START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR,
|
|
100
|
-
}),
|
|
97
|
+
(value) => ({ ...value, discriminator: START_ORDER_EXECUTION_AFTER_SWAP_DISCRIMINATOR }),
|
|
101
98
|
);
|
|
102
99
|
}
|
|
103
100
|
|
|
@@ -196,10 +193,7 @@ export function getStartOrderExecutionAfterSwapInstruction<
|
|
|
196
193
|
order: { value: input.order ?? null, isWritable: true },
|
|
197
194
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
198
195
|
ixSysvar: { value: input.ixSysvar ?? null, isWritable: false },
|
|
199
|
-
stablecoinTokenMint: {
|
|
200
|
-
value: input.stablecoinTokenMint ?? null,
|
|
201
|
-
isWritable: false,
|
|
202
|
-
},
|
|
196
|
+
stablecoinTokenMint: { value: input.stablecoinTokenMint ?? null, isWritable: false },
|
|
203
197
|
solverStablecoinTokenAccount: {
|
|
204
198
|
value: input.solverStablecoinTokenAccount ?? null,
|
|
205
199
|
isWritable: true,
|
|
@@ -208,10 +202,7 @@ export function getStartOrderExecutionAfterSwapInstruction<
|
|
|
208
202
|
value: input.guardStablecoinTokenAccount ?? null,
|
|
209
203
|
isWritable: true,
|
|
210
204
|
},
|
|
211
|
-
stablecoinTokenProgram: {
|
|
212
|
-
value: input.stablecoinTokenProgram ?? null,
|
|
213
|
-
isWritable: false,
|
|
214
|
-
},
|
|
205
|
+
stablecoinTokenProgram: { value: input.stablecoinTokenProgram ?? null, isWritable: false },
|
|
215
206
|
};
|
|
216
207
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
217
208
|
|
|
@@ -102,17 +102,14 @@ export function getAccountMetaFactory(programAddress: Address, optionalAccountSt
|
|
|
102
102
|
return (account: ResolvedAccount): IAccountMeta | IAccountSignerMeta | undefined => {
|
|
103
103
|
if (!account.value) {
|
|
104
104
|
if (optionalAccountStrategy === 'omitted') return;
|
|
105
|
-
return Object.freeze({
|
|
106
|
-
address: programAddress,
|
|
107
|
-
role: AccountRole.READONLY,
|
|
108
|
-
});
|
|
105
|
+
return Object.freeze({ address: programAddress, role: AccountRole.READONLY });
|
|
109
106
|
}
|
|
110
107
|
|
|
111
108
|
const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
|
|
112
109
|
return Object.freeze({
|
|
113
110
|
address: expectAddress(account.value),
|
|
114
111
|
role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,
|
|
115
|
-
...(isTransactionSigner(account.value) ? { signer: account.value } :
|
|
112
|
+
...(isTransactionSigner(account.value) ? { signer: account.value } : Object),
|
|
116
113
|
});
|
|
117
114
|
};
|
|
118
115
|
}
|
|
@@ -18,10 +18,7 @@ import {
|
|
|
18
18
|
type Encoder,
|
|
19
19
|
} from '@solana/kit';
|
|
20
20
|
|
|
21
|
-
export type AuctioneerPubkeyUpdated = {
|
|
22
|
-
guardId: Address;
|
|
23
|
-
auctioneerPubKey: Address;
|
|
24
|
-
};
|
|
21
|
+
export type AuctioneerPubkeyUpdated = { guardId: Address; auctioneerPubKey: Address };
|
|
25
22
|
|
|
26
23
|
export type AuctioneerPubkeyUpdatedArgs = AuctioneerPubkeyUpdated;
|
|
27
24
|
|
|
@@ -20,11 +20,7 @@ import {
|
|
|
20
20
|
type Encoder,
|
|
21
21
|
} from '@solana/kit';
|
|
22
22
|
|
|
23
|
-
export type TokenInSwapped = {
|
|
24
|
-
orderId: Address;
|
|
25
|
-
solver: Address;
|
|
26
|
-
stablecoinsAmount: bigint;
|
|
27
|
-
};
|
|
23
|
+
export type TokenInSwapped = { orderId: Address; solver: Address; stablecoinsAmount: bigint };
|
|
28
24
|
|
|
29
25
|
export type TokenInSwappedArgs = {
|
|
30
26
|
orderId: Address;
|
|
@@ -130,9 +130,7 @@ export function getSingleChainGuardErrorMessage(code: SingleChainGuardError): st
|
|
|
130
130
|
|
|
131
131
|
export function isSingleChainGuardError<TProgramErrorCode extends SingleChainGuardError>(
|
|
132
132
|
error: unknown,
|
|
133
|
-
transactionMessage: {
|
|
134
|
-
instructions: Record<number, { programAddress: Address }>;
|
|
135
|
-
},
|
|
133
|
+
transactionMessage: { instructions: Record<number, { programAddress: Address }> },
|
|
136
134
|
code?: TProgramErrorCode,
|
|
137
135
|
): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &
|
|
138
136
|
Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {
|
|
@@ -58,7 +58,7 @@ export type AcceptAdminInstruction<
|
|
|
58
58
|
|
|
59
59
|
export type AcceptAdminInstructionData = { discriminator: ReadonlyUint8Array };
|
|
60
60
|
|
|
61
|
-
export type AcceptAdminInstructionDataArgs =
|
|
61
|
+
export type AcceptAdminInstructionDataArgs = object;
|
|
62
62
|
|
|
63
63
|
export function getAcceptAdminInstructionDataEncoder(): Encoder<AcceptAdminInstructionDataArgs> {
|
|
64
64
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -71,11 +71,9 @@ export type CancelDcaOrderInstruction<
|
|
|
71
71
|
]
|
|
72
72
|
>;
|
|
73
73
|
|
|
74
|
-
export type CancelDcaOrderInstructionData = {
|
|
75
|
-
discriminator: ReadonlyUint8Array;
|
|
76
|
-
};
|
|
74
|
+
export type CancelDcaOrderInstructionData = { discriminator: ReadonlyUint8Array };
|
|
77
75
|
|
|
78
|
-
export type CancelDcaOrderInstructionDataArgs =
|
|
76
|
+
export type CancelDcaOrderInstructionDataArgs = object;
|
|
79
77
|
|
|
80
78
|
export function getCancelDcaOrderInstructionDataEncoder(): Encoder<CancelDcaOrderInstructionDataArgs> {
|
|
81
79
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -159,14 +157,8 @@ export function getCancelDcaOrderInstruction<
|
|
|
159
157
|
order: { value: input.order ?? null, isWritable: true },
|
|
160
158
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
161
159
|
tokenInMint: { value: input.tokenInMint ?? null, isWritable: false },
|
|
162
|
-
userTokenInAccount: {
|
|
163
|
-
|
|
164
|
-
isWritable: true,
|
|
165
|
-
},
|
|
166
|
-
guardTokenInAccount: {
|
|
167
|
-
value: input.guardTokenInAccount ?? null,
|
|
168
|
-
isWritable: true,
|
|
169
|
-
},
|
|
160
|
+
userTokenInAccount: { value: input.userTokenInAccount ?? null, isWritable: true },
|
|
161
|
+
guardTokenInAccount: { value: input.guardTokenInAccount ?? null, isWritable: true },
|
|
170
162
|
tokenInProgram: { value: input.tokenInProgram ?? null, isWritable: false },
|
|
171
163
|
};
|
|
172
164
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|
|
@@ -71,11 +71,9 @@ export type CancelLimitOrderInstruction<
|
|
|
71
71
|
]
|
|
72
72
|
>;
|
|
73
73
|
|
|
74
|
-
export type CancelLimitOrderInstructionData = {
|
|
75
|
-
discriminator: ReadonlyUint8Array;
|
|
76
|
-
};
|
|
74
|
+
export type CancelLimitOrderInstructionData = { discriminator: ReadonlyUint8Array };
|
|
77
75
|
|
|
78
|
-
export type CancelLimitOrderInstructionDataArgs =
|
|
76
|
+
export type CancelLimitOrderInstructionDataArgs = object;
|
|
79
77
|
|
|
80
78
|
export function getCancelLimitOrderInstructionDataEncoder(): Encoder<CancelLimitOrderInstructionDataArgs> {
|
|
81
79
|
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
@@ -159,14 +157,8 @@ export function getCancelLimitOrderInstruction<
|
|
|
159
157
|
order: { value: input.order ?? null, isWritable: true },
|
|
160
158
|
guard: { value: input.guard ?? null, isWritable: false },
|
|
161
159
|
tokenInMint: { value: input.tokenInMint ?? null, isWritable: false },
|
|
162
|
-
userTokenInAccount: {
|
|
163
|
-
|
|
164
|
-
isWritable: true,
|
|
165
|
-
},
|
|
166
|
-
guardTokenInAccount: {
|
|
167
|
-
value: input.guardTokenInAccount ?? null,
|
|
168
|
-
isWritable: true,
|
|
169
|
-
},
|
|
160
|
+
userTokenInAccount: { value: input.userTokenInAccount ?? null, isWritable: true },
|
|
161
|
+
guardTokenInAccount: { value: input.guardTokenInAccount ?? null, isWritable: true },
|
|
170
162
|
tokenInProgram: { value: input.tokenInProgram ?? null, isWritable: false },
|
|
171
163
|
};
|
|
172
164
|
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedAccount>;
|