Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clients/js/src/generated/accounts/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

import {
Expand Down Expand Up @@ -34,7 +34,7 @@ import {
getConfigKeysEncoder,
type ConfigKeys,
type ConfigKeysArgs,
} from '../../hooked';
} from '../types';

export type Config = {
/**
Expand Down
6 changes: 3 additions & 3 deletions clients/js/src/generated/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

export * from './config';
6 changes: 3 additions & 3 deletions clients/js/src/generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

export * from './accounts';
Expand Down
6 changes: 3 additions & 3 deletions clients/js/src/generated/instructions/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

export * from './store';
27 changes: 16 additions & 11 deletions clients/js/src/generated/instructions/store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

import {
Expand All @@ -27,14 +27,14 @@ import {
type WritableAccount,
type WritableSignerAccount,
} from '@solana/web3.js';
import { SOLANA_CONFIG_PROGRAM_ADDRESS } from '../programs';
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';
import {
getConfigKeysDecoder,
getConfigKeysEncoder,
type ConfigKeys,
type ConfigKeysArgs,
} from '../../hooked';
import { SOLANA_CONFIG_PROGRAM_ADDRESS } from '../programs';
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';
} from '../types';

export type StoreInstruction<
TProgram extends string = typeof SOLANA_CONFIG_PROGRAM_ADDRESS,
Expand Down Expand Up @@ -111,17 +111,22 @@ export type StoreInput<TAccountConfigAccount extends string = string> = {
signers?: Array<TransactionSigner>;
};

export function getStoreInstruction<TAccountConfigAccount extends string>(
input: StoreInput<TAccountConfigAccount>
export function getStoreInstruction<
TAccountConfigAccount extends string,
TProgramAddress extends Address = typeof SOLANA_CONFIG_PROGRAM_ADDRESS,
>(
input: StoreInput<TAccountConfigAccount>,
config?: { programAddress?: TProgramAddress }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, so one could use the config program client against a different config program (configurable program ID)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! This is a late addition from @mcintyre94 (See PR). For instance, this allows someone to use the SPL Token JS client for the Token 2022 program (if someone was taking bloody ages to release a Token 2022 client for example 👀).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig it!!

): StoreInstruction<
typeof SOLANA_CONFIG_PROGRAM_ADDRESS,
TProgramAddress,
(typeof input)['configAccount'] extends TransactionSigner<TAccountConfigAccount>
? WritableSignerAccount<TAccountConfigAccount> &
IAccountSignerMeta<TAccountConfigAccount>
: TAccountConfigAccount
> {
// Program address.
const programAddress = SOLANA_CONFIG_PROGRAM_ADDRESS;
const programAddress =
config?.programAddress ?? SOLANA_CONFIG_PROGRAM_ADDRESS;

// Original accounts.
const originalAccounts = {
Expand Down Expand Up @@ -152,7 +157,7 @@ export function getStoreInstruction<TAccountConfigAccount extends string>(
args as StoreInstructionDataArgs
),
} as StoreInstruction<
typeof SOLANA_CONFIG_PROGRAM_ADDRESS,
TProgramAddress,
(typeof input)['configAccount'] extends TransactionSigner<TAccountConfigAccount>
? WritableSignerAccount<TAccountConfigAccount> &
IAccountSignerMeta<TAccountConfigAccount>
Expand Down
6 changes: 3 additions & 3 deletions clients/js/src/generated/programs/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

export * from './solanaConfig';
6 changes: 3 additions & 3 deletions clients/js/src/generated/programs/solanaConfig.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

import { type Address } from '@solana/web3.js';
Expand Down
6 changes: 3 additions & 3 deletions clients/js/src/generated/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
* to add features, then rerun codama to update it.
*
* @see https://github.com/kinobi-so/kinobi
* @see https://github.com/codama-idl/codama
*/

import {
Expand Down
2 changes: 1 addition & 1 deletion clients/js/test/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';

test('placeholder', async (t) => {
test('placeholder', (t) => {
t.true(true);
});
8 changes: 4 additions & 4 deletions clients/rust/src/generated/accounts/config.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>

use {
crate::hooked::ConfigKeys,
crate::generated::types::ConfigKeys,
borsh::{BorshDeserialize, BorshSerialize},
kaigan::types::RemainderVec,
};
Expand Down
6 changes: 3 additions & 3 deletions clients/rust/src/generated/accounts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>

pub(crate) mod r#config;

Expand Down
6 changes: 3 additions & 3 deletions clients/rust/src/generated/errors/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>
6 changes: 3 additions & 3 deletions clients/rust/src/generated/instructions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>

pub(crate) mod r#store;

Expand Down
10 changes: 5 additions & 5 deletions clients/rust/src/generated/instructions/store.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>

use {
crate::hooked::ConfigKeys,
crate::generated::types::ConfigKeys,
borsh::{BorshDeserialize, BorshSerialize},
kaigan::types::RemainderVec,
};
Expand Down Expand Up @@ -110,7 +110,7 @@ impl StoreBuilder {
self.data = Some(data);
self
}
/// Add an aditional account to the instruction.
/// Add an additional account to the instruction.
#[inline(always)]
pub fn add_remaining_account(
&mut self,
Expand Down
6 changes: 3 additions & 3 deletions clients/rust/src/generated/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>

pub mod accounts;
pub mod errors;
Expand Down
6 changes: 3 additions & 3 deletions clients/rust/src/generated/programs.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! This code was AUTOGENERATED using the kinobi library.
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/kinobi-so/kinobi>
//! <https://github.com/codama-idl/codama>

use solana_program::{pubkey, pubkey::Pubkey};

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
"devDependencies": {
"@iarna/toml": "^2.2.5",
"@kinobi-so/renderers-js": "^0.21.2",
"@kinobi-so/renderers-rust": "^0.21.1",
"kinobi": "^0.21.0",
"@codama/renderers-js": "^1.0.0",
"@codama/renderers-rust": "^1.0.0",
"codama": "^1.0.0",
"typescript": "^5.5.2",
"zx": "^7.2.3"
},
Expand Down
Loading
Loading