11/**
2- * This code was AUTOGENERATED using the kinobi 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 kinobi to update it.
4+ * to add features, then rerun codama to update it.
55 *
6- * @see https://github.com/kinobi-so/kinobi
6+ * @see https://github.com/codama-idl/codama
77 */
88
99import {
@@ -27,14 +27,14 @@ import {
2727 type WritableAccount ,
2828 type WritableSignerAccount ,
2929} from '@solana/web3.js' ;
30+ import { SOLANA_CONFIG_PROGRAM_ADDRESS } from '../programs' ;
31+ import { getAccountMetaFactory , type ResolvedAccount } from '../shared' ;
3032import {
3133 getConfigKeysDecoder ,
3234 getConfigKeysEncoder ,
3335 type ConfigKeys ,
3436 type ConfigKeysArgs ,
35- } from '../../hooked' ;
36- import { SOLANA_CONFIG_PROGRAM_ADDRESS } from '../programs' ;
37- import { getAccountMetaFactory , type ResolvedAccount } from '../shared' ;
37+ } from '../types' ;
3838
3939export type StoreInstruction <
4040 TProgram extends string = typeof SOLANA_CONFIG_PROGRAM_ADDRESS ,
@@ -111,17 +111,22 @@ export type StoreInput<TAccountConfigAccount extends string = string> = {
111111 signers ?: Array < TransactionSigner > ;
112112} ;
113113
114- export function getStoreInstruction < TAccountConfigAccount extends string > (
115- input : StoreInput < TAccountConfigAccount >
114+ export function getStoreInstruction <
115+ TAccountConfigAccount extends string ,
116+ TProgramAddress extends Address = typeof SOLANA_CONFIG_PROGRAM_ADDRESS ,
117+ > (
118+ input : StoreInput < TAccountConfigAccount > ,
119+ config ?: { programAddress ?: TProgramAddress }
116120) : StoreInstruction <
117- typeof SOLANA_CONFIG_PROGRAM_ADDRESS ,
121+ TProgramAddress ,
118122 ( typeof input ) [ 'configAccount' ] extends TransactionSigner < TAccountConfigAccount >
119123 ? WritableSignerAccount < TAccountConfigAccount > &
120124 IAccountSignerMeta < TAccountConfigAccount >
121125 : TAccountConfigAccount
122126> {
123127 // Program address.
124- const programAddress = SOLANA_CONFIG_PROGRAM_ADDRESS ;
128+ const programAddress =
129+ config ?. programAddress ?? SOLANA_CONFIG_PROGRAM_ADDRESS ;
125130
126131 // Original accounts.
127132 const originalAccounts = {
@@ -152,7 +157,7 @@ export function getStoreInstruction<TAccountConfigAccount extends string>(
152157 args as StoreInstructionDataArgs
153158 ) ,
154159 } as StoreInstruction <
155- typeof SOLANA_CONFIG_PROGRAM_ADDRESS ,
160+ TProgramAddress ,
156161 ( typeof input ) [ 'configAccount' ] extends TransactionSigner < TAccountConfigAccount >
157162 ? WritableSignerAccount < TAccountConfigAccount > &
158163 IAccountSignerMeta < TAccountConfigAccount >
0 commit comments