11/**
2- * This code was AUTOGENERATED using the codama library.
2+ * This code was AUTOGENERATED using the Codama library.
33 * Please DO NOT EDIT THIS FILE, instead use visitors
4- * to add features, then rerun codama to update it.
4+ * to add features, then rerun Codama to update it.
55 *
66 * @see https://github.com/codama-idl/codama
77 */
@@ -13,20 +13,21 @@ import {
1313 getU8Decoder ,
1414 getU8Encoder ,
1515 transformEncoder ,
16+ type AccountMeta ,
17+ type AccountSignerMeta ,
1618 type Address ,
17- type Codec ,
18- type Decoder ,
19- type Encoder ,
20- type IAccountMeta ,
21- type IAccountSignerMeta ,
22- type IInstruction ,
23- type IInstructionWithAccounts ,
24- type IInstructionWithData ,
19+ type FixedSizeCodec ,
20+ type FixedSizeDecoder ,
21+ type FixedSizeEncoder ,
22+ type Instruction ,
23+ type InstructionWithAccounts ,
24+ type InstructionWithData ,
2525 type ReadonlyAccount ,
26+ type ReadonlyUint8Array ,
2627 type TransactionSigner ,
2728 type WritableAccount ,
2829 type WritableSignerAccount ,
29- } from '@solana/web3.js ' ;
30+ } from '@solana/kit ' ;
3031import { SOLANA_FEATURE_GATE_PROGRAM_ADDRESS } from '../programs' ;
3132import { getAccountMetaFactory , type ResolvedAccount } from '../shared' ;
3233
@@ -38,19 +39,19 @@ export function getRevokePendingActivationDiscriminatorBytes() {
3839
3940export type RevokePendingActivationInstruction <
4041 TProgram extends string = typeof SOLANA_FEATURE_GATE_PROGRAM_ADDRESS ,
41- TAccountFeature extends string | IAccountMeta < string > = string ,
42- TAccountIncinerator extends string | IAccountMeta < string > = string ,
42+ TAccountFeature extends string | AccountMeta < string > = string ,
43+ TAccountIncinerator extends string | AccountMeta < string > = string ,
4344 TAccountSystemProgram extends
4445 | string
45- | IAccountMeta < string > = '11111111111111111111111111111111' ,
46- TRemainingAccounts extends readonly IAccountMeta < string > [ ] = [ ] ,
47- > = IInstruction < TProgram > &
48- IInstructionWithData < Uint8Array > &
49- IInstructionWithAccounts <
46+ | AccountMeta < string > = '11111111111111111111111111111111' ,
47+ TRemainingAccounts extends readonly AccountMeta < string > [ ] = [ ] ,
48+ > = Instruction < TProgram > &
49+ InstructionWithData < ReadonlyUint8Array > &
50+ InstructionWithAccounts <
5051 [
5152 TAccountFeature extends string
5253 ? WritableSignerAccount < TAccountFeature > &
53- IAccountSignerMeta < TAccountFeature >
54+ AccountSignerMeta < TAccountFeature >
5455 : TAccountFeature ,
5556 TAccountIncinerator extends string
5657 ? WritableAccount < TAccountIncinerator >
@@ -66,7 +67,7 @@ export type RevokePendingActivationInstructionData = { discriminator: number };
6667
6768export type RevokePendingActivationInstructionDataArgs = { } ;
6869
69- export function getRevokePendingActivationInstructionDataEncoder ( ) : Encoder < RevokePendingActivationInstructionDataArgs > {
70+ export function getRevokePendingActivationInstructionDataEncoder ( ) : FixedSizeEncoder < RevokePendingActivationInstructionDataArgs > {
7071 return transformEncoder (
7172 getStructEncoder ( [ [ 'discriminator' , getU8Encoder ( ) ] ] ) ,
7273 ( value ) => ( {
@@ -76,11 +77,11 @@ export function getRevokePendingActivationInstructionDataEncoder(): Encoder<Revo
7677 ) ;
7778}
7879
79- export function getRevokePendingActivationInstructionDataDecoder ( ) : Decoder < RevokePendingActivationInstructionData > {
80+ export function getRevokePendingActivationInstructionDataDecoder ( ) : FixedSizeDecoder < RevokePendingActivationInstructionData > {
8081 return getStructDecoder ( [ [ 'discriminator' , getU8Decoder ( ) ] ] ) ;
8182}
8283
83- export function getRevokePendingActivationInstructionDataCodec ( ) : Codec <
84+ export function getRevokePendingActivationInstructionDataCodec ( ) : FixedSizeCodec <
8485 RevokePendingActivationInstructionDataArgs ,
8586 RevokePendingActivationInstructionData
8687> {
@@ -143,27 +144,25 @@ export function getRevokePendingActivationInstruction<
143144 }
144145
145146 const getAccountMeta = getAccountMetaFactory ( programAddress , 'programId' ) ;
146- const instruction = {
147+ return Object . freeze ( {
147148 accounts : [
148149 getAccountMeta ( accounts . feature ) ,
149150 getAccountMeta ( accounts . incinerator ) ,
150151 getAccountMeta ( accounts . systemProgram ) ,
151152 ] ,
152- programAddress,
153153 data : getRevokePendingActivationInstructionDataEncoder ( ) . encode ( { } ) ,
154+ programAddress,
154155 } as RevokePendingActivationInstruction <
155156 TProgramAddress ,
156157 TAccountFeature ,
157158 TAccountIncinerator ,
158159 TAccountSystemProgram
159- > ;
160-
161- return instruction ;
160+ > ) ;
162161}
163162
164163export type ParsedRevokePendingActivationInstruction <
165164 TProgram extends string = typeof SOLANA_FEATURE_GATE_PROGRAM_ADDRESS ,
166- TAccountMetas extends readonly IAccountMeta [ ] = readonly IAccountMeta [ ] ,
165+ TAccountMetas extends readonly AccountMeta [ ] = readonly AccountMeta [ ] ,
167166> = {
168167 programAddress : Address < TProgram > ;
169168 accounts : {
@@ -179,19 +178,19 @@ export type ParsedRevokePendingActivationInstruction<
179178
180179export function parseRevokePendingActivationInstruction <
181180 TProgram extends string ,
182- TAccountMetas extends readonly IAccountMeta [ ] ,
181+ TAccountMetas extends readonly AccountMeta [ ] ,
183182> (
184- instruction : IInstruction < TProgram > &
185- IInstructionWithAccounts < TAccountMetas > &
186- IInstructionWithData < Uint8Array >
183+ instruction : Instruction < TProgram > &
184+ InstructionWithAccounts < TAccountMetas > &
185+ InstructionWithData < ReadonlyUint8Array >
187186) : ParsedRevokePendingActivationInstruction < TProgram , TAccountMetas > {
188187 if ( instruction . accounts . length < 3 ) {
189188 // TODO: Coded error.
190189 throw new Error ( 'Not enough accounts' ) ;
191190 }
192191 let accountIndex = 0 ;
193192 const getNextAccount = ( ) => {
194- const accountMeta = instruction . accounts ! [ accountIndex ] ! ;
193+ const accountMeta = ( instruction . accounts as TAccountMetas ) [ accountIndex ] ! ;
195194 accountIndex += 1 ;
196195 return accountMeta ;
197196 } ;
0 commit comments