Skip to content

Commit 954a292

Browse files
committed
Use Codama v1.0.0
See codama-idl/codama#234
1 parent eff3b5a commit 954a292

File tree

20 files changed

+191
-185
lines changed

20 files changed

+191
-185
lines changed

clients/js/src/generated/accounts/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
import {
@@ -34,7 +34,7 @@ import {
3434
getConfigKeysEncoder,
3535
type ConfigKeys,
3636
type ConfigKeysArgs,
37-
} from '../../hooked';
37+
} from '../types';
3838

3939
export type Config = {
4040
/**
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
export * from './config';

clients/js/src/generated/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
export * from './accounts';
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
export * from './store';

clients/js/src/generated/instructions/store.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
import {
@@ -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';
3032
import {
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

3939
export 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>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
export * from './solanaConfig';

clients/js/src/generated/programs/solanaConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
import { type Address } from '@solana/web3.js';

clients/js/src/generated/shared/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
import {

clients/js/test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava';
22

3-
test('placeholder', async (t) => {
3+
test('placeholder', (t) => {
44
t.true(true);
55
});

clients/rust/src/generated/accounts/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//! This code was AUTOGENERATED using the kinobi library.
1+
//! This code was AUTOGENERATED using the codama library.
22
//! Please DO NOT EDIT THIS FILE, instead use visitors
3-
//! to add features, then rerun kinobi to update it.
3+
//! to add features, then rerun codama to update it.
44
//!
5-
//! <https://github.com/kinobi-so/kinobi>
5+
//! <https://github.com/codama-idl/codama>
66
77
use {
8-
crate::hooked::ConfigKeys,
8+
crate::generated::types::ConfigKeys,
99
borsh::{BorshDeserialize, BorshSerialize},
1010
kaigan::types::RemainderVec,
1111
};

0 commit comments

Comments
 (0)