@wuwei-labs/srsly 2.0.0-beta.6 → 2.0.0-beta.7
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/cjs/codama/devnet/constants.js +1 -1
- package/dist/cjs/codama/mainnet/constants.js +1 -1
- package/dist/esm/codama/devnet/accounts/contractState.js +75 -0
- package/dist/esm/codama/devnet/accounts/contractState.js.map +1 -0
- package/dist/esm/codama/devnet/accounts/fleet.js +64 -0
- package/dist/esm/codama/devnet/accounts/fleet.js.map +1 -0
- package/dist/esm/codama/devnet/accounts/index.js +12 -0
- package/dist/esm/codama/devnet/accounts/index.js.map +1 -0
- package/dist/esm/codama/devnet/accounts/rentalState.js +74 -0
- package/dist/esm/codama/devnet/accounts/rentalState.js.map +1 -0
- package/dist/esm/codama/devnet/accounts/thread.js +77 -0
- package/dist/esm/codama/devnet/accounts/thread.js.map +1 -0
- package/dist/esm/codama/devnet/constants.js +29 -0
- package/dist/esm/codama/devnet/constants.js.map +1 -0
- package/dist/esm/codama/devnet/errors/index.js +9 -0
- package/dist/esm/codama/devnet/errors/index.js.map +1 -0
- package/dist/esm/codama/devnet/errors/srsly.js +69 -0
- package/dist/esm/codama/devnet/errors/srsly.js.map +1 -0
- package/dist/esm/codama/devnet/index.js +13 -0
- package/dist/esm/codama/devnet/index.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/acceptRental.js +347 -0
- package/dist/esm/codama/devnet/instructions/acceptRental.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/cancelRental.js +215 -0
- package/dist/esm/codama/devnet/instructions/cancelRental.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/closeContract.js +236 -0
- package/dist/esm/codama/devnet/instructions/closeContract.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/closeRental.js +250 -0
- package/dist/esm/codama/devnet/instructions/closeRental.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/createContract.js +251 -0
- package/dist/esm/codama/devnet/instructions/createContract.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/index.js +15 -0
- package/dist/esm/codama/devnet/instructions/index.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/payRental.js +270 -0
- package/dist/esm/codama/devnet/instructions/payRental.js.map +1 -0
- package/dist/esm/codama/devnet/instructions/resetRental.js +145 -0
- package/dist/esm/codama/devnet/instructions/resetRental.js.map +1 -0
- package/dist/esm/codama/devnet/programs/index.js +9 -0
- package/dist/esm/codama/devnet/programs/index.js.map +1 -0
- package/dist/esm/codama/devnet/programs/srsly.js +68 -0
- package/dist/esm/codama/devnet/programs/srsly.js.map +1 -0
- package/dist/esm/codama/devnet/shared/index.js +87 -0
- package/dist/esm/codama/devnet/shared/index.js.map +1 -0
- package/dist/esm/codama/devnet/types/clockData.js +26 -0
- package/dist/esm/codama/devnet/types/clockData.js.map +1 -0
- package/dist/esm/codama/devnet/types/equality.js +24 -0
- package/dist/esm/codama/devnet/types/equality.js.map +1 -0
- package/dist/esm/codama/devnet/types/execContext.js +33 -0
- package/dist/esm/codama/devnet/types/execContext.js.map +1 -0
- package/dist/esm/codama/devnet/types/index.js +16 -0
- package/dist/esm/codama/devnet/types/index.js.map +1 -0
- package/dist/esm/codama/devnet/types/serializableAccount.js +26 -0
- package/dist/esm/codama/devnet/types/serializableAccount.js.map +1 -0
- package/dist/esm/codama/devnet/types/serializableInstruction.js +27 -0
- package/dist/esm/codama/devnet/types/serializableInstruction.js.map +1 -0
- package/dist/esm/codama/devnet/types/threadResponse.js +33 -0
- package/dist/esm/codama/devnet/types/threadResponse.js.map +1 -0
- package/dist/esm/codama/devnet/types/trigger.js +83 -0
- package/dist/esm/codama/devnet/types/trigger.js.map +1 -0
- package/dist/esm/codama/devnet/types/triggerContext.js +42 -0
- package/dist/esm/codama/devnet/types/triggerContext.js.map +1 -0
- package/dist/esm/codama/mainnet/accounts/contractState.js +75 -0
- package/dist/esm/codama/mainnet/accounts/contractState.js.map +1 -0
- package/dist/esm/codama/mainnet/accounts/fleet.js +64 -0
- package/dist/esm/codama/mainnet/accounts/fleet.js.map +1 -0
- package/dist/esm/codama/mainnet/accounts/index.js +12 -0
- package/dist/esm/codama/mainnet/accounts/index.js.map +1 -0
- package/dist/esm/codama/mainnet/accounts/rentalState.js +74 -0
- package/dist/esm/codama/mainnet/accounts/rentalState.js.map +1 -0
- package/dist/esm/codama/mainnet/accounts/thread.js +77 -0
- package/dist/esm/codama/mainnet/accounts/thread.js.map +1 -0
- package/dist/esm/codama/mainnet/constants.js +29 -0
- package/dist/esm/codama/mainnet/constants.js.map +1 -0
- package/dist/esm/codama/mainnet/errors/index.js +9 -0
- package/dist/esm/codama/mainnet/errors/index.js.map +1 -0
- package/dist/esm/codama/mainnet/errors/srsly.js +69 -0
- package/dist/esm/codama/mainnet/errors/srsly.js.map +1 -0
- package/dist/esm/codama/mainnet/index.js +13 -0
- package/dist/esm/codama/mainnet/index.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/acceptRental.js +347 -0
- package/dist/esm/codama/mainnet/instructions/acceptRental.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/cancelRental.js +215 -0
- package/dist/esm/codama/mainnet/instructions/cancelRental.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/closeContract.js +236 -0
- package/dist/esm/codama/mainnet/instructions/closeContract.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/closeRental.js +250 -0
- package/dist/esm/codama/mainnet/instructions/closeRental.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/createContract.js +251 -0
- package/dist/esm/codama/mainnet/instructions/createContract.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/index.js +15 -0
- package/dist/esm/codama/mainnet/instructions/index.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/payRental.js +270 -0
- package/dist/esm/codama/mainnet/instructions/payRental.js.map +1 -0
- package/dist/esm/codama/mainnet/instructions/resetRental.js +145 -0
- package/dist/esm/codama/mainnet/instructions/resetRental.js.map +1 -0
- package/dist/esm/codama/mainnet/programs/index.js +9 -0
- package/dist/esm/codama/mainnet/programs/index.js.map +1 -0
- package/dist/esm/codama/mainnet/programs/srsly.js +68 -0
- package/dist/esm/codama/mainnet/programs/srsly.js.map +1 -0
- package/dist/esm/codama/mainnet/shared/index.js +87 -0
- package/dist/esm/codama/mainnet/shared/index.js.map +1 -0
- package/dist/esm/codama/mainnet/types/clockData.js +26 -0
- package/dist/esm/codama/mainnet/types/clockData.js.map +1 -0
- package/dist/esm/codama/mainnet/types/equality.js +24 -0
- package/dist/esm/codama/mainnet/types/equality.js.map +1 -0
- package/dist/esm/codama/mainnet/types/execContext.js +33 -0
- package/dist/esm/codama/mainnet/types/execContext.js.map +1 -0
- package/dist/esm/codama/mainnet/types/index.js +16 -0
- package/dist/esm/codama/mainnet/types/index.js.map +1 -0
- package/dist/esm/codama/mainnet/types/serializableAccount.js +26 -0
- package/dist/esm/codama/mainnet/types/serializableAccount.js.map +1 -0
- package/dist/esm/codama/mainnet/types/serializableInstruction.js +27 -0
- package/dist/esm/codama/mainnet/types/serializableInstruction.js.map +1 -0
- package/dist/esm/codama/mainnet/types/threadResponse.js +33 -0
- package/dist/esm/codama/mainnet/types/threadResponse.js.map +1 -0
- package/dist/esm/codama/mainnet/types/trigger.js +83 -0
- package/dist/esm/codama/mainnet/types/trigger.js.map +1 -0
- package/dist/esm/codama/mainnet/types/triggerContext.js +42 -0
- package/dist/esm/codama/mainnet/types/triggerContext.js.map +1 -0
- package/dist/esm/contract/close.js +94 -0
- package/dist/esm/contract/close.js.map +1 -0
- package/dist/esm/contract/create.js +66 -0
- package/dist/esm/contract/create.js.map +1 -0
- package/dist/esm/contract/index.js +3 -0
- package/dist/esm/contract/index.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/rental/accept.js +86 -0
- package/dist/esm/rental/accept.js.map +1 -0
- package/dist/esm/rental/cancel.js +50 -0
- package/dist/esm/rental/cancel.js.map +1 -0
- package/dist/esm/rental/close.js +52 -0
- package/dist/esm/rental/close.js.map +1 -0
- package/dist/esm/rental/index.js +5 -0
- package/dist/esm/rental/index.js.map +1 -0
- package/dist/esm/rental/reset.js +65 -0
- package/dist/esm/rental/reset.js.map +1 -0
- package/dist/esm/utils/config.js +161 -0
- package/dist/esm/utils/config.js.map +1 -0
- package/dist/esm/utils/constants.js +104 -0
- package/dist/esm/utils/constants.js.map +1 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/profiles.js +152 -0
- package/dist/esm/utils/profiles.js.map +1 -0
- package/dist/types/codama/devnet/accounts/contractState.d.ts +51 -0
- package/dist/types/codama/devnet/accounts/contractState.d.ts.map +1 -0
- package/dist/types/codama/devnet/accounts/fleet.d.ts +38 -0
- package/dist/types/codama/devnet/accounts/fleet.d.ts.map +1 -0
- package/dist/types/codama/devnet/accounts/index.d.ts +12 -0
- package/dist/types/codama/devnet/accounts/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/accounts/rentalState.d.ts +48 -0
- package/dist/types/codama/devnet/accounts/rentalState.d.ts.map +1 -0
- package/dist/types/codama/devnet/accounts/thread.d.ts +74 -0
- package/dist/types/codama/devnet/accounts/thread.d.ts.map +1 -0
- package/dist/types/codama/devnet/constants.d.ts +33 -0
- package/dist/types/codama/devnet/constants.d.ts.map +1 -0
- package/dist/types/codama/devnet/errors/index.d.ts +9 -0
- package/dist/types/codama/devnet/errors/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/errors/srsly.d.ts +50 -0
- package/dist/types/codama/devnet/errors/srsly.d.ts.map +1 -0
- package/dist/types/codama/devnet/index.d.ts +13 -0
- package/dist/types/codama/devnet/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/acceptRental.d.ts +131 -0
- package/dist/types/codama/devnet/instructions/acceptRental.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/cancelRental.d.ts +71 -0
- package/dist/types/codama/devnet/instructions/cancelRental.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/closeContract.d.ts +100 -0
- package/dist/types/codama/devnet/instructions/closeContract.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/closeRental.d.ts +83 -0
- package/dist/types/codama/devnet/instructions/closeRental.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/createContract.d.ts +108 -0
- package/dist/types/codama/devnet/instructions/createContract.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/index.d.ts +15 -0
- package/dist/types/codama/devnet/instructions/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/payRental.d.ts +110 -0
- package/dist/types/codama/devnet/instructions/payRental.d.ts.map +1 -0
- package/dist/types/codama/devnet/instructions/resetRental.d.ts +71 -0
- package/dist/types/codama/devnet/instructions/resetRental.d.ts.map +1 -0
- package/dist/types/codama/devnet/programs/index.d.ts +9 -0
- package/dist/types/codama/devnet/programs/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/programs/srsly.d.ts +47 -0
- package/dist/types/codama/devnet/programs/srsly.d.ts.map +1 -0
- package/dist/types/codama/devnet/shared/index.d.ts +50 -0
- package/dist/types/codama/devnet/shared/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/clockData.d.ts +29 -0
- package/dist/types/codama/devnet/types/clockData.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/equality.d.ts +18 -0
- package/dist/types/codama/devnet/types/equality.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/execContext.d.ts +48 -0
- package/dist/types/codama/devnet/types/execContext.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/index.d.ts +16 -0
- package/dist/types/codama/devnet/types/index.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/serializableAccount.d.ts +22 -0
- package/dist/types/codama/devnet/types/serializableAccount.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/serializableInstruction.d.ts +30 -0
- package/dist/types/codama/devnet/types/serializableInstruction.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/threadResponse.d.ts +42 -0
- package/dist/types/codama/devnet/types/threadResponse.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/trigger.d.ts +98 -0
- package/dist/types/codama/devnet/types/trigger.d.ts.map +1 -0
- package/dist/types/codama/devnet/types/triggerContext.d.ts +75 -0
- package/dist/types/codama/devnet/types/triggerContext.d.ts.map +1 -0
- package/dist/types/codama/mainnet/accounts/contractState.d.ts +51 -0
- package/dist/types/codama/mainnet/accounts/contractState.d.ts.map +1 -0
- package/dist/types/codama/mainnet/accounts/fleet.d.ts +38 -0
- package/dist/types/codama/mainnet/accounts/fleet.d.ts.map +1 -0
- package/dist/types/codama/mainnet/accounts/index.d.ts +12 -0
- package/dist/types/codama/mainnet/accounts/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/accounts/rentalState.d.ts +48 -0
- package/dist/types/codama/mainnet/accounts/rentalState.d.ts.map +1 -0
- package/dist/types/codama/mainnet/accounts/thread.d.ts +74 -0
- package/dist/types/codama/mainnet/accounts/thread.d.ts.map +1 -0
- package/dist/types/codama/mainnet/constants.d.ts +33 -0
- package/dist/types/codama/mainnet/constants.d.ts.map +1 -0
- package/dist/types/codama/mainnet/errors/index.d.ts +9 -0
- package/dist/types/codama/mainnet/errors/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/errors/srsly.d.ts +50 -0
- package/dist/types/codama/mainnet/errors/srsly.d.ts.map +1 -0
- package/dist/types/codama/mainnet/index.d.ts +13 -0
- package/dist/types/codama/mainnet/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/acceptRental.d.ts +131 -0
- package/dist/types/codama/mainnet/instructions/acceptRental.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/cancelRental.d.ts +71 -0
- package/dist/types/codama/mainnet/instructions/cancelRental.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/closeContract.d.ts +100 -0
- package/dist/types/codama/mainnet/instructions/closeContract.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/closeRental.d.ts +83 -0
- package/dist/types/codama/mainnet/instructions/closeRental.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/createContract.d.ts +108 -0
- package/dist/types/codama/mainnet/instructions/createContract.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/index.d.ts +15 -0
- package/dist/types/codama/mainnet/instructions/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/payRental.d.ts +110 -0
- package/dist/types/codama/mainnet/instructions/payRental.d.ts.map +1 -0
- package/dist/types/codama/mainnet/instructions/resetRental.d.ts +71 -0
- package/dist/types/codama/mainnet/instructions/resetRental.d.ts.map +1 -0
- package/dist/types/codama/mainnet/programs/index.d.ts +9 -0
- package/dist/types/codama/mainnet/programs/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/programs/srsly.d.ts +47 -0
- package/dist/types/codama/mainnet/programs/srsly.d.ts.map +1 -0
- package/dist/types/codama/mainnet/shared/index.d.ts +50 -0
- package/dist/types/codama/mainnet/shared/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/clockData.d.ts +29 -0
- package/dist/types/codama/mainnet/types/clockData.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/equality.d.ts +18 -0
- package/dist/types/codama/mainnet/types/equality.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/execContext.d.ts +48 -0
- package/dist/types/codama/mainnet/types/execContext.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/index.d.ts +16 -0
- package/dist/types/codama/mainnet/types/index.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/serializableAccount.d.ts +22 -0
- package/dist/types/codama/mainnet/types/serializableAccount.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/serializableInstruction.d.ts +30 -0
- package/dist/types/codama/mainnet/types/serializableInstruction.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/threadResponse.d.ts +42 -0
- package/dist/types/codama/mainnet/types/threadResponse.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/trigger.d.ts +98 -0
- package/dist/types/codama/mainnet/types/trigger.d.ts.map +1 -0
- package/dist/types/codama/mainnet/types/triggerContext.d.ts +75 -0
- package/dist/types/codama/mainnet/types/triggerContext.d.ts.map +1 -0
- package/dist/types/contract/close.d.ts +52 -0
- package/dist/types/contract/close.d.ts.map +1 -0
- package/dist/types/contract/create.d.ts +80 -0
- package/dist/types/contract/create.d.ts.map +1 -0
- package/dist/types/contract/index.d.ts +3 -0
- package/dist/types/contract/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/rental/accept.d.ts +92 -0
- package/dist/types/rental/accept.d.ts.map +1 -0
- package/dist/types/rental/cancel.d.ts +44 -0
- package/dist/types/rental/cancel.d.ts.map +1 -0
- package/dist/types/rental/close.d.ts +49 -0
- package/dist/types/rental/close.d.ts.map +1 -0
- package/dist/types/rental/index.d.ts +5 -0
- package/dist/types/rental/index.d.ts.map +1 -0
- package/dist/types/rental/reset.d.ts +68 -0
- package/dist/types/rental/reset.d.ts.map +1 -0
- package/dist/types/utils/config.d.ts +112 -0
- package/dist/types/utils/config.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +32 -0
- package/dist/types/utils/constants.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/profiles.d.ts +54 -0
- package/dist/types/utils/profiles.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { SRSLY_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { getAccountMetaFactory } from '../shared';
|
|
11
|
+
export const RESET_RENTAL_DISCRIMINATOR = new Uint8Array([
|
|
12
|
+
139, 185, 76, 32, 61, 143, 163, 183,
|
|
13
|
+
]);
|
|
14
|
+
export function getResetRentalDiscriminatorBytes() {
|
|
15
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(RESET_RENTAL_DISCRIMINATOR);
|
|
16
|
+
}
|
|
17
|
+
export function getResetRentalInstructionDataEncoder() {
|
|
18
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: RESET_RENTAL_DISCRIMINATOR }));
|
|
19
|
+
}
|
|
20
|
+
export function getResetRentalInstructionDataDecoder() {
|
|
21
|
+
return getStructDecoder([
|
|
22
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
export function getResetRentalInstructionDataCodec() {
|
|
26
|
+
return combineCodec(getResetRentalInstructionDataEncoder(), getResetRentalInstructionDataDecoder());
|
|
27
|
+
}
|
|
28
|
+
export async function getResetRentalInstructionAsync(input, config) {
|
|
29
|
+
// Program address.
|
|
30
|
+
const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
|
|
31
|
+
// Original accounts.
|
|
32
|
+
const originalAccounts = {
|
|
33
|
+
fleet: { value: input.fleet ?? null, isWritable: true },
|
|
34
|
+
gameId: { value: input.gameId ?? null, isWritable: false },
|
|
35
|
+
starbase: { value: input.starbase ?? null, isWritable: false },
|
|
36
|
+
starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true },
|
|
37
|
+
rentalState: { value: input.rentalState ?? null, isWritable: false },
|
|
38
|
+
contract: { value: input.contract ?? null, isWritable: true },
|
|
39
|
+
rentalAuthority: {
|
|
40
|
+
value: input.rentalAuthority ?? null,
|
|
41
|
+
isWritable: false,
|
|
42
|
+
},
|
|
43
|
+
sageProgram: { value: input.sageProgram ?? null, isWritable: false },
|
|
44
|
+
};
|
|
45
|
+
const accounts = originalAccounts;
|
|
46
|
+
// Resolve default values.
|
|
47
|
+
if (!accounts.rentalAuthority.value) {
|
|
48
|
+
accounts.rentalAuthority.value = await getProgramDerivedAddress({
|
|
49
|
+
programAddress,
|
|
50
|
+
seeds: [
|
|
51
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
52
|
+
114, 101, 110, 116, 97, 108, 95, 97, 117, 116, 104, 111, 114, 105,
|
|
53
|
+
116, 121,
|
|
54
|
+
])),
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (!accounts.sageProgram.value) {
|
|
59
|
+
accounts.sageProgram.value =
|
|
60
|
+
'sAgezwJpDb1aHvzNr3o24cKjsETmFEKghBEyJ1askDi';
|
|
61
|
+
}
|
|
62
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
63
|
+
const instruction = {
|
|
64
|
+
accounts: [
|
|
65
|
+
getAccountMeta(accounts.fleet),
|
|
66
|
+
getAccountMeta(accounts.gameId),
|
|
67
|
+
getAccountMeta(accounts.starbase),
|
|
68
|
+
getAccountMeta(accounts.starbasePlayer),
|
|
69
|
+
getAccountMeta(accounts.rentalState),
|
|
70
|
+
getAccountMeta(accounts.contract),
|
|
71
|
+
getAccountMeta(accounts.rentalAuthority),
|
|
72
|
+
getAccountMeta(accounts.sageProgram),
|
|
73
|
+
],
|
|
74
|
+
programAddress,
|
|
75
|
+
data: getResetRentalInstructionDataEncoder().encode({}),
|
|
76
|
+
};
|
|
77
|
+
return instruction;
|
|
78
|
+
}
|
|
79
|
+
export function getResetRentalInstruction(input, config) {
|
|
80
|
+
// Program address.
|
|
81
|
+
const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
|
|
82
|
+
// Original accounts.
|
|
83
|
+
const originalAccounts = {
|
|
84
|
+
fleet: { value: input.fleet ?? null, isWritable: true },
|
|
85
|
+
gameId: { value: input.gameId ?? null, isWritable: false },
|
|
86
|
+
starbase: { value: input.starbase ?? null, isWritable: false },
|
|
87
|
+
starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true },
|
|
88
|
+
rentalState: { value: input.rentalState ?? null, isWritable: false },
|
|
89
|
+
contract: { value: input.contract ?? null, isWritable: true },
|
|
90
|
+
rentalAuthority: {
|
|
91
|
+
value: input.rentalAuthority ?? null,
|
|
92
|
+
isWritable: false,
|
|
93
|
+
},
|
|
94
|
+
sageProgram: { value: input.sageProgram ?? null, isWritable: false },
|
|
95
|
+
};
|
|
96
|
+
const accounts = originalAccounts;
|
|
97
|
+
// Resolve default values.
|
|
98
|
+
if (!accounts.sageProgram.value) {
|
|
99
|
+
accounts.sageProgram.value =
|
|
100
|
+
'sAgezwJpDb1aHvzNr3o24cKjsETmFEKghBEyJ1askDi';
|
|
101
|
+
}
|
|
102
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
103
|
+
const instruction = {
|
|
104
|
+
accounts: [
|
|
105
|
+
getAccountMeta(accounts.fleet),
|
|
106
|
+
getAccountMeta(accounts.gameId),
|
|
107
|
+
getAccountMeta(accounts.starbase),
|
|
108
|
+
getAccountMeta(accounts.starbasePlayer),
|
|
109
|
+
getAccountMeta(accounts.rentalState),
|
|
110
|
+
getAccountMeta(accounts.contract),
|
|
111
|
+
getAccountMeta(accounts.rentalAuthority),
|
|
112
|
+
getAccountMeta(accounts.sageProgram),
|
|
113
|
+
],
|
|
114
|
+
programAddress,
|
|
115
|
+
data: getResetRentalInstructionDataEncoder().encode({}),
|
|
116
|
+
};
|
|
117
|
+
return instruction;
|
|
118
|
+
}
|
|
119
|
+
export function parseResetRentalInstruction(instruction) {
|
|
120
|
+
if (instruction.accounts.length < 8) {
|
|
121
|
+
// TODO: Coded error.
|
|
122
|
+
throw new Error('Not enough accounts');
|
|
123
|
+
}
|
|
124
|
+
let accountIndex = 0;
|
|
125
|
+
const getNextAccount = () => {
|
|
126
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
127
|
+
accountIndex += 1;
|
|
128
|
+
return accountMeta;
|
|
129
|
+
};
|
|
130
|
+
return {
|
|
131
|
+
programAddress: instruction.programAddress,
|
|
132
|
+
accounts: {
|
|
133
|
+
fleet: getNextAccount(),
|
|
134
|
+
gameId: getNextAccount(),
|
|
135
|
+
starbase: getNextAccount(),
|
|
136
|
+
starbasePlayer: getNextAccount(),
|
|
137
|
+
rentalState: getNextAccount(),
|
|
138
|
+
contract: getNextAccount(),
|
|
139
|
+
rentalAuthority: getNextAccount(),
|
|
140
|
+
sageProgram: getNextAccount(),
|
|
141
|
+
},
|
|
142
|
+
data: getResetRentalInstructionDataDecoder().decode(instruction.data),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=resetRental.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resetRental.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/instructions/resetRental.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAYjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,WAAW,CAAC;AAExE,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,UAAU,CAAC;IACvD,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;CACpC,CAAC,CAAC;AAEH,MAAM,UAAU,gCAAgC;IAC9C,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,0BAA0B,CAC3B,CAAC;AACJ,CAAC;AAmDD,MAAM,UA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AAK,EAAE,cAAc,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE;YACxB,QAAQ,EAAE,cAAc,EAAE;YAC1B,cAAc,EAAE,cAAc,EAAE;YAChC,WAAW,EAAE,cAAc,EAAE;YAC7B,QAAQ,EAAE,cAAc,EAAE;YAC1B,eAAe,EAAE,cAAc,EAAE;YACjC,WAAW,EAAE,cAAc,EAAE;SAC9B;QACD,IAAI,EAAE,oCAAoC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACtE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './srsly';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/programs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { containsBytes, fixEncoderSize, getBytesEncoder, } from '@solana/kit';
|
|
9
|
+
export const SRSLY_PROGRAM_ADDRESS = 'SRSLY1fq9TJqCk1gNSE7VZL2bztvTn9wm4VR8u8jMKT';
|
|
10
|
+
export var SrslyAccount;
|
|
11
|
+
(function (SrslyAccount) {
|
|
12
|
+
SrslyAccount[SrslyAccount["ContractState"] = 0] = "ContractState";
|
|
13
|
+
SrslyAccount[SrslyAccount["Fleet"] = 1] = "Fleet";
|
|
14
|
+
SrslyAccount[SrslyAccount["RentalState"] = 2] = "RentalState";
|
|
15
|
+
SrslyAccount[SrslyAccount["Thread"] = 3] = "Thread";
|
|
16
|
+
})(SrslyAccount || (SrslyAccount = {}));
|
|
17
|
+
export function identifySrslyAccount(account) {
|
|
18
|
+
const data = 'data' in account ? account.data : account;
|
|
19
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([190, 138, 10, 223, 189, 116, 222, 115])), 0)) {
|
|
20
|
+
return SrslyAccount.ContractState;
|
|
21
|
+
}
|
|
22
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([109, 207, 251, 48, 106, 2, 136, 163])), 0)) {
|
|
23
|
+
return SrslyAccount.Fleet;
|
|
24
|
+
}
|
|
25
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([97, 162, 29, 222, 251, 251, 180, 244])), 0)) {
|
|
26
|
+
return SrslyAccount.RentalState;
|
|
27
|
+
}
|
|
28
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([186, 27, 154, 111, 51, 36, 159, 90])), 0)) {
|
|
29
|
+
return SrslyAccount.Thread;
|
|
30
|
+
}
|
|
31
|
+
throw new Error('The provided account could not be identified as a srsly account.');
|
|
32
|
+
}
|
|
33
|
+
export var SrslyInstruction;
|
|
34
|
+
(function (SrslyInstruction) {
|
|
35
|
+
SrslyInstruction[SrslyInstruction["AcceptRental"] = 0] = "AcceptRental";
|
|
36
|
+
SrslyInstruction[SrslyInstruction["CancelRental"] = 1] = "CancelRental";
|
|
37
|
+
SrslyInstruction[SrslyInstruction["CloseContract"] = 2] = "CloseContract";
|
|
38
|
+
SrslyInstruction[SrslyInstruction["CloseRental"] = 3] = "CloseRental";
|
|
39
|
+
SrslyInstruction[SrslyInstruction["CreateContract"] = 4] = "CreateContract";
|
|
40
|
+
SrslyInstruction[SrslyInstruction["PayRental"] = 5] = "PayRental";
|
|
41
|
+
SrslyInstruction[SrslyInstruction["ResetRental"] = 6] = "ResetRental";
|
|
42
|
+
})(SrslyInstruction || (SrslyInstruction = {}));
|
|
43
|
+
export function identifySrslyInstruction(instruction) {
|
|
44
|
+
const data = 'data' in instruction ? instruction.data : instruction;
|
|
45
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([192, 221, 241, 212, 141, 161, 36, 146])), 0)) {
|
|
46
|
+
return SrslyInstruction.AcceptRental;
|
|
47
|
+
}
|
|
48
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([97, 204, 63, 8, 84, 34, 28, 43])), 0)) {
|
|
49
|
+
return SrslyInstruction.CancelRental;
|
|
50
|
+
}
|
|
51
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([37, 244, 34, 168, 92, 202, 80, 106])), 0)) {
|
|
52
|
+
return SrslyInstruction.CloseContract;
|
|
53
|
+
}
|
|
54
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([179, 188, 113, 211, 41, 232, 51, 51])), 0)) {
|
|
55
|
+
return SrslyInstruction.CloseRental;
|
|
56
|
+
}
|
|
57
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([244, 48, 244, 178, 216, 88, 122, 52])), 0)) {
|
|
58
|
+
return SrslyInstruction.CreateContract;
|
|
59
|
+
}
|
|
60
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([114, 15, 111, 207, 115, 207, 108, 169])), 0)) {
|
|
61
|
+
return SrslyInstruction.PayRental;
|
|
62
|
+
}
|
|
63
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([139, 185, 76, 32, 61, 143, 163, 183])), 0)) {
|
|
64
|
+
return SrslyInstruction.ResetRental;
|
|
65
|
+
}
|
|
66
|
+
throw new Error('The provided instruction could not be identified as a srsly instruction.');
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=srsly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"srsly.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/programs/srsly.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,GAGhB,MAAM,aAAa,CAAC;AAWrB,MAAM,CAAC,MAAM,qBAAqB,GAChC,6CAAuG,CAAC;AAE1G,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iEAAa,CAAA;IACb,iDAAK,CAAA;IACL,6DAAW,CAAA;IACX,mDAAM,CAAA;AACR,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,UAAU,oBAAoB,CAClC,OAA0D;IAE1D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;IACxD,IACE,aAAa,CACX,IAAI,EACJ,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CACzC,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CACxD,EACD,CAAC,CACF,EACD,CAAC;QACD,OAAO,YAAY,CAAC,aAAa,CAAC;IACpC,CAAC;IACD,IACE,aAAa,CACX,IAAI,EACJ,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CACzC,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CACt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AAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CACtD,EACD,CAAC,CACF,EACD,CAAC;QACD,OAAO,gBAAgB,CAAC,cAAc,CAAC;IACzC,CAAC;IACD,IACE,aAAa,CACX,IAAI,EACJ,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CACzC,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CACxD,EACD,CAAC,CACF,EACD,CAAC;QACD,OAAO,gBAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IACD,IACE,aAAa,CACX,IAAI,EACJ,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CACzC,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CACtD,EACD,CAAC,CACF,EACD,CAAC;QACD,OAAO,gBAAgB,CAAC,WAAW,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { AccountRole, isProgramDerivedAddress, isTransactionSigner as kitIsTransactionSigner, upgradeRoleToSigner, } from '@solana/kit';
|
|
9
|
+
/**
|
|
10
|
+
* Asserts that the given value is not null or undefined.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export function expectSome(value) {
|
|
14
|
+
if (value == null) {
|
|
15
|
+
throw new Error('Expected a value but received null or undefined.');
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that the given value is a PublicKey.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function expectAddress(value) {
|
|
24
|
+
if (!value) {
|
|
25
|
+
throw new Error('Expected a Address.');
|
|
26
|
+
}
|
|
27
|
+
if (typeof value === 'object' && 'address' in value) {
|
|
28
|
+
return value.address;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(value)) {
|
|
31
|
+
return value[0];
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Asserts that the given value is a PDA.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export function expectProgramDerivedAddress(value) {
|
|
40
|
+
if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {
|
|
41
|
+
throw new Error('Expected a ProgramDerivedAddress.');
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Asserts that the given value is a TransactionSigner.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export function expectTransactionSigner(value) {
|
|
50
|
+
if (!value || !isTransactionSigner(value)) {
|
|
51
|
+
throw new Error('Expected a TransactionSigner.');
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get account metas and signers from resolved accounts.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
60
|
+
return (account) => {
|
|
61
|
+
if (!account.value) {
|
|
62
|
+
if (optionalAccountStrategy === 'omitted')
|
|
63
|
+
return;
|
|
64
|
+
return Object.freeze({
|
|
65
|
+
address: programAddress,
|
|
66
|
+
role: AccountRole.READONLY,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const writableRole = account.isWritable
|
|
70
|
+
? AccountRole.WRITABLE
|
|
71
|
+
: AccountRole.READONLY;
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
address: expectAddress(account.value),
|
|
74
|
+
role: isTransactionSigner(account.value)
|
|
75
|
+
? upgradeRoleToSigner(writableRole)
|
|
76
|
+
: writableRole,
|
|
77
|
+
...(isTransactionSigner(account.value) ? { signer: account.value } : {}),
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function isTransactionSigner(value) {
|
|
82
|
+
return (!!value &&
|
|
83
|
+
typeof value === 'object' &&
|
|
84
|
+
'address' in value &&
|
|
85
|
+
kitIsTransactionSigner(value));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,mBAAmB,IAAI,sBAAsB,EAM7C,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAI,KAA2B;IACvD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,KAKa;IAEb,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,IAAI,KAAK,CAAC,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AAC,mBAAmB,CAAC,YAAY,CAAC;gBACnC,CAAC,CAAC,YAAY;YAChB,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAG+B;IAE/B,OAAO,CACL,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,SAAS,IAAI,KAAK;QAClB,sBAAsB,CAAC,KAAK,CAAC,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, } from '@solana/kit';
|
|
9
|
+
export function getClockDataEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
['slot', getU64Encoder()],
|
|
12
|
+
['epoch', getU64Encoder()],
|
|
13
|
+
['unixTimestamp', getI64Encoder()],
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
export function getClockDataDecoder() {
|
|
17
|
+
return getStructDecoder([
|
|
18
|
+
['slot', getU64Decoder()],
|
|
19
|
+
['epoch', getU64Decoder()],
|
|
20
|
+
['unixTimestamp', getI64Decoder()],
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
export function getClockDataCodec() {
|
|
24
|
+
return combineCodec(getClockDataEncoder(), getClockDataDecoder());
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=clockData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clockData.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/clockData.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,GAId,MAAM,aAAa,CAAC;AAqBrB,MAAM,UAAU,mBAAmB;IACjC,OAAO,gBAAgB,CAAC;QACtB,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC;QACzB,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;QAC1B,CAAC,eAAe,EAAE,aAAa,EAAE,CAAC;KACnC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,gBAAgB,CAAC;QACtB,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC;QACzB,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;QAC1B,CAAC,eAAe,EAAE,aAAa,EAAE,CAAC;KACnC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,YAAY,CAAC,mBAAmB,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, getEnumDecoder, getEnumEncoder, } from '@solana/kit';
|
|
9
|
+
/** Operators for describing how to compare two values to one another. */
|
|
10
|
+
export var Equality;
|
|
11
|
+
(function (Equality) {
|
|
12
|
+
Equality[Equality["GreaterThanOrEqual"] = 0] = "GreaterThanOrEqual";
|
|
13
|
+
Equality[Equality["LessThanOrEqual"] = 1] = "LessThanOrEqual";
|
|
14
|
+
})(Equality || (Equality = {}));
|
|
15
|
+
export function getEqualityEncoder() {
|
|
16
|
+
return getEnumEncoder(Equality);
|
|
17
|
+
}
|
|
18
|
+
export function getEqualityDecoder() {
|
|
19
|
+
return getEnumDecoder(Equality);
|
|
20
|
+
}
|
|
21
|
+
export function getEqualityCodec() {
|
|
22
|
+
return combineCodec(getEqualityEncoder(), getEqualityDecoder());
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=equality.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equality.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/equality.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,GAIf,MAAM,aAAa,CAAC;AAErB,yEAAyE;AACzE,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mEAAkB,CAAA;IAClB,6DAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAID,MAAM,UAAU,kBAAkB;IAChC,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,YAAY,CAAC,kBAAkB,EAAE,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, } from '@solana/kit';
|
|
9
|
+
import { getTriggerContextDecoder, getTriggerContextEncoder, } from '.';
|
|
10
|
+
export function getExecContextEncoder() {
|
|
11
|
+
return getStructEncoder([
|
|
12
|
+
['execIndex', getU64Encoder()],
|
|
13
|
+
['execsSinceReimbursement', getU64Encoder()],
|
|
14
|
+
['execsSinceSlot', getU64Encoder()],
|
|
15
|
+
['lastExecAt', getU64Encoder()],
|
|
16
|
+
['lastExecTimestamp', getI64Encoder()],
|
|
17
|
+
['triggerContext', getTriggerContextEncoder()],
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
export function getExecContextDecoder() {
|
|
21
|
+
return getStructDecoder([
|
|
22
|
+
['execIndex', getU64Decoder()],
|
|
23
|
+
['execsSinceReimbursement', getU64Decoder()],
|
|
24
|
+
['execsSinceSlot', getU64Decoder()],
|
|
25
|
+
['lastExecAt', getU64Decoder()],
|
|
26
|
+
['lastExecTimestamp', getI64Decoder()],
|
|
27
|
+
['triggerContext', getTriggerContextDecoder()],
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
export function getExecContextCodec() {
|
|
31
|
+
return combineCodec(getExecContextEncoder(), getExecContextDecoder());
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=execContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execContext.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/execContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,GAId,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GAGzB,MAAM,GAAG,CAAC;AAuCX,MAAM,UAAU,qBAAqB;IACnC,OAAO,gBAAgB,CAAC;QACtB,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;QAC9B,CAAC,yBAAyB,EAAE,aAAa,EAAE,CAAC;QAC5C,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC;QACnC,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC;QAC/B,CAAC,mBAAmB,EAAE,aAAa,EAAE,CAAC;QACtC,CAAC,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,gBAAgB,CAAC;QACtB,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC;QAC9B,CAAC,yBAAyB,EAAE,aAAa,EAAE,CAAC;QAC5C,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC;QACnC,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC;QAC/B,CAAC,mBAAmB,EAAE,aAAa,EAAE,CAAC;QACtC,CAAC,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,YAAY,CAAC,qBAAqB,EAAE,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './clockData';
|
|
9
|
+
export * from './equality';
|
|
10
|
+
export * from './execContext';
|
|
11
|
+
export * from './serializableAccount';
|
|
12
|
+
export * from './serializableInstruction';
|
|
13
|
+
export * from './threadResponse';
|
|
14
|
+
export * from './trigger';
|
|
15
|
+
export * from './triggerContext';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getStructDecoder, getStructEncoder, } from '@solana/kit';
|
|
9
|
+
export function getSerializableAccountEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
['pubkey', getAddressEncoder()],
|
|
12
|
+
['isSigner', getBooleanEncoder()],
|
|
13
|
+
['isWritable', getBooleanEncoder()],
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
export function getSerializableAccountDecoder() {
|
|
17
|
+
return getStructDecoder([
|
|
18
|
+
['pubkey', getAddressDecoder()],
|
|
19
|
+
['isSigner', getBooleanDecoder()],
|
|
20
|
+
['isWritable', getBooleanDecoder()],
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
export function getSerializableAccountCodec() {
|
|
24
|
+
return combineCodec(getSerializableAccountEncoder(), getSerializableAccountDecoder());
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=serializableAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializableAccount.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/serializableAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GAKjB,MAAM,aAAa,CAAC;AAcrB,MAAM,UAAU,6BAA6B;IAC3C,OAAO,gBAAgB,CAAC;QACtB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;QAC/B,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;QACjC,CAAC,YAAY,EAAE,iBAAiB,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,gBAAgB,CAAC;QACtB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;QAC/B,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;QACjC,CAAC,YAAY,EAAE,iBAAiB,EAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,2BAA2B;IAIzC,OAAO,YAAY,CACjB,6BAA6B,EAAE,EAC/B,6BAA6B,EAAE,CAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, } from '@solana/kit';
|
|
9
|
+
import { getSerializableAccountDecoder, getSerializableAccountEncoder, } from '.';
|
|
10
|
+
export function getSerializableInstructionEncoder() {
|
|
11
|
+
return getStructEncoder([
|
|
12
|
+
['programId', getAddressEncoder()],
|
|
13
|
+
['accounts', getArrayEncoder(getSerializableAccountEncoder())],
|
|
14
|
+
['data', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
export function getSerializableInstructionDecoder() {
|
|
18
|
+
return getStructDecoder([
|
|
19
|
+
['programId', getAddressDecoder()],
|
|
20
|
+
['accounts', getArrayDecoder(getSerializableAccountDecoder())],
|
|
21
|
+
['data', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
export function getSerializableInstructionCodec() {
|
|
25
|
+
return combineCodec(getSerializableInstructionEncoder(), getSerializableInstructionDecoder());
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=serializableInstruction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializableInstruction.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/serializableInstruction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,GAMd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAG9B,MAAM,GAAG,CAAC;AAqBX,MAAM,UAAU,iCAAiC;IAC/C,OAAO,gBAAgB,CAAC;QACtB,CAAC,WAAW,EAAE,iBAAiB,EAAE,CAAC;QAClC,CAAC,UAAU,EAAE,eAAe,CAAC,6BAA6B,EAAE,CAAC,CAAC;QAC9D,CAAC,MAAM,EAAE,oBAAoB,CAAC,eAAe,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;KACnE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,OAAO,gBAAgB,CAAC;QACtB,CAAC,WAAW,EAAE,iBAAiB,EAAE,CAAC;QAClC,CAAC,UAAU,EAAE,eAAe,CAAC,6BAA6B,EAAE,CAAC,CAAC;QAC9D,CAAC,MAAM,EAAE,oBAAoB,CAAC,eAAe,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;KACnE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,+BAA+B;IAI7C,OAAO,YAAY,CACjB,iCAAiC,EAAE,EACnC,iCAAiC,EAAE,CACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, getAddressDecoder, getAddressEncoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, } from '@solana/kit';
|
|
9
|
+
import { getSerializableInstructionDecoder, getSerializableInstructionEncoder, getTriggerDecoder, getTriggerEncoder, } from '.';
|
|
10
|
+
export function getThreadResponseEncoder() {
|
|
11
|
+
return getStructEncoder([
|
|
12
|
+
['closeTo', getOptionEncoder(getAddressEncoder())],
|
|
13
|
+
[
|
|
14
|
+
'dynamicInstruction',
|
|
15
|
+
getOptionEncoder(getSerializableInstructionEncoder()),
|
|
16
|
+
],
|
|
17
|
+
['trigger', getOptionEncoder(getTriggerEncoder())],
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
export function getThreadResponseDecoder() {
|
|
21
|
+
return getStructDecoder([
|
|
22
|
+
['closeTo', getOptionDecoder(getAddressDecoder())],
|
|
23
|
+
[
|
|
24
|
+
'dynamicInstruction',
|
|
25
|
+
getOptionDecoder(getSerializableInstructionDecoder()),
|
|
26
|
+
],
|
|
27
|
+
['trigger', getOptionDecoder(getTriggerDecoder())],
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
export function getThreadResponseCodec() {
|
|
31
|
+
return combineCodec(getThreadResponseEncoder(), getThreadResponseDecoder());
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=threadResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadResponse.js","sourceRoot":"","sources":["../../../../../src/codama/devnet/types/threadResponse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAOjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,iBAAiB,EACjB,iBAAiB,GAKlB,MAAM,GAAG,CAAC;AAiCX,MAAM,UAAU,wBAAwB;IACtC,OAAO,gBAAgB,CAAC;QACtB,CAAC,SAAS,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAClD;YACE,oBAAoB;YACpB,gBAAgB,CAAC,iCAAiC,EAAE,CAAC;SACtD;QACD,CAAC,SAAS,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC;KACnD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,gBAAgB,CAAC;QACtB,CAAC,SAAS,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAClD;YACE,oBAAoB;YACpB,gBAAgB,CAAC,iCAAiC,EAAE,CAAC;SACtD;QACD,CAAC,SAAS,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC;KACnD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB;IAIpC,OAAO,YAAY,CAAC,wBAAwB,EAAE,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getDiscriminatedUnionDecoder, getDiscriminatedUnionEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getUnitDecoder, getUnitEncoder, getUtf8Decoder, getUtf8Encoder, } from '@solana/kit';
|
|
9
|
+
import { getEqualityDecoder, getEqualityEncoder, } from '.';
|
|
10
|
+
export function getTriggerEncoder() {
|
|
11
|
+
return getDiscriminatedUnionEncoder([
|
|
12
|
+
[
|
|
13
|
+
'Account',
|
|
14
|
+
getStructEncoder([
|
|
15
|
+
['address', getAddressEncoder()],
|
|
16
|
+
['offset', getU64Encoder()],
|
|
17
|
+
['size', getU64Encoder()],
|
|
18
|
+
]),
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
'Cron',
|
|
22
|
+
getStructEncoder([
|
|
23
|
+
['schedule', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
|
|
24
|
+
['skippable', getBooleanEncoder()],
|
|
25
|
+
]),
|
|
26
|
+
],
|
|
27
|
+
['Now', getUnitEncoder()],
|
|
28
|
+
['Slot', getStructEncoder([['slot', getU64Encoder()]])],
|
|
29
|
+
['Epoch', getStructEncoder([['epoch', getU64Encoder()]])],
|
|
30
|
+
['Timestamp', getStructEncoder([['unixTs', getI64Encoder()]])],
|
|
31
|
+
[
|
|
32
|
+
'Pyth',
|
|
33
|
+
getStructEncoder([
|
|
34
|
+
['priceFeed', getAddressEncoder()],
|
|
35
|
+
['equality', getEqualityEncoder()],
|
|
36
|
+
['limit', getI64Encoder()],
|
|
37
|
+
]),
|
|
38
|
+
],
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
export function getTriggerDecoder() {
|
|
42
|
+
return getDiscriminatedUnionDecoder([
|
|
43
|
+
[
|
|
44
|
+
'Account',
|
|
45
|
+
getStructDecoder([
|
|
46
|
+
['address', getAddressDecoder()],
|
|
47
|
+
['offset', getU64Decoder()],
|
|
48
|
+
['size', getU64Decoder()],
|
|
49
|
+
]),
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
'Cron',
|
|
53
|
+
getStructDecoder([
|
|
54
|
+
['schedule', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
|
|
55
|
+
['skippable', getBooleanDecoder()],
|
|
56
|
+
]),
|
|
57
|
+
],
|
|
58
|
+
['Now', getUnitDecoder()],
|
|
59
|
+
['Slot', getStructDecoder([['slot', getU64Decoder()]])],
|
|
60
|
+
['Epoch', getStructDecoder([['epoch', getU64Decoder()]])],
|
|
61
|
+
['Timestamp', getStructDecoder([['unixTs', getI64Decoder()]])],
|
|
62
|
+
[
|
|
63
|
+
'Pyth',
|
|
64
|
+
getStructDecoder([
|
|
65
|
+
['priceFeed', getAddressDecoder()],
|
|
66
|
+
['equality', getEqualityDecoder()],
|
|
67
|
+
['limit', getI64Decoder()],
|
|
68
|
+
]),
|
|
69
|
+
],
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
72
|
+
export function getTriggerCodec() {
|
|
73
|
+
return combineCodec(getTriggerEncoder(), getTriggerDecoder());
|
|
74
|
+
}
|
|
75
|
+
export function trigger(kind, data) {
|
|
76
|
+
return Array.isArray(data)
|
|
77
|
+
? { __kind: kind, fields: data }
|
|
78
|
+
: { __kind: kind, ...(data ?? {}) };
|
|
79
|
+
}
|
|
80
|
+
export function isTrigger(kind, value) {
|
|
81
|
+
return value.__kind === kind;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=trigger.js.map
|