Skip to content

Commit 265657c

Browse files
authored
Bump Codama renderer and adopt @solana/kit 6.10 (#85)
This bumps the Codama renderers and regenerates both clients. The JS program plugin now returns the homomorphic `ExtendedClient` type (introduced in kit 6.10) instead of the previous `Omit<T, ...>` intersection, and the client's kit floor is raised to ^6.10.0. The Rust renderer bump (3.0 -> 3.1) switches the generated fetch helpers to the minimal `solana-rpc-client` crate, so the Rust client's `fetch` feature now depends on `solana-rpc-client` instead of `solana-client`.
1 parent ebf8a89 commit 265657c

8 files changed

Lines changed: 639 additions & 2258 deletions

File tree

Cargo.lock

Lines changed: 92 additions & 1788 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@solana-config/oxc": "^0.1.1",
48-
"@solana/kit": "^6.4.0",
48+
"@solana/kit": "^6.10.0",
4949
"@solana/kit-plugin-litesvm": "^0.10.0",
5050
"@solana/kit-plugin-signer": "^0.10.0",
5151
"@types/node": "^24",
@@ -59,6 +59,6 @@
5959
"vitest": "^4.0.15"
6060
},
6161
"peerDependencies": {
62-
"@solana/kit": "^6.4.0"
62+
"@solana/kit": "^6.10.0"
6363
}
6464
}

clients/js/pnpm-lock.yaml

Lines changed: 432 additions & 412 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
type ClientWithRpc,
2020
type ClientWithTransactionPlanning,
2121
type ClientWithTransactionSending,
22+
type ExtendedClient,
2223
type GetAccountInfoApi,
2324
type GetMultipleAccountsApi,
2425
type Instruction,
@@ -285,7 +286,12 @@ export function parseSystemInstruction<TProgram extends string>(
285286
}
286287
}
287288

288-
export type SystemPlugin = { accounts: SystemPluginAccounts; instructions: SystemPluginInstructions };
289+
export type SystemPlugin = {
290+
accounts: SystemPluginAccounts;
291+
instructions: SystemPluginInstructions;
292+
identifyInstruction: typeof identifySystemInstruction;
293+
parseInstruction: typeof parseSystemInstruction;
294+
};
289295

290296
export type SystemPluginAccounts = { nonce: ReturnType<typeof getNonceCodec> & SelfFetchFunctions<NonceArgs, Nonce> };
291297

@@ -334,7 +340,7 @@ export type SystemPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMult
334340
ClientWithTransactionSending;
335341

336342
export function systemProgram() {
337-
return <T extends SystemPluginRequirements>(client: T): Omit<T, 'system'> & { system: SystemPlugin } => {
343+
return <T extends SystemPluginRequirements>(client: T): ExtendedClient<T, { system: SystemPlugin }> => {
338344
return extendClient(client, {
339345
system: <SystemPlugin>{
340346
accounts: { nonce: addSelfFetchFunctions(client, getNonceCodec()) },
@@ -370,6 +376,8 @@ export function systemProgram() {
370376
createAccountAllowPrefund: input =>
371377
addSelfPlanAndSendFunctions(client, getCreateAccountAllowPrefundInstruction(input)),
372378
},
379+
identifyInstruction: identifySystemInstruction,
380+
parseInstruction: parseSystemInstruction,
373381
},
374382
});
375383
};

clients/rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ readme = "README.md"
88
license-file = "../../LICENSE"
99

1010
[features]
11-
fetch = ["dep:solana-client"]
11+
fetch = ["dep:solana-rpc-client"]
1212
test-sbf = []
1313

1414
[dependencies]
@@ -23,7 +23,7 @@ solana-address = { version = "~2.4", features = [
2323
'curve25519',
2424
'decode',
2525
] }
26-
solana-client = { version = "^3.0", optional = true }
26+
solana-rpc-client = { version = "^3.0", optional = true }
2727
solana-cpi = "~3.1"
2828
solana-decode-error = "~2.3"
2929
solana-instruction = "~3.2"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl<'a> TryFrom<&solana_account_info::AccountInfo<'a>> for Nonce {
4141

4242
#[cfg(feature = "fetch")]
4343
pub fn fetch_nonce(
44-
rpc: &solana_client::rpc_client::RpcClient,
44+
rpc: &solana_rpc_client::rpc_client::RpcClient,
4545
address: &solana_address::Address,
4646
) -> Result<crate::shared::DecodedAccount<Nonce>, std::io::Error> {
4747
let accounts = fetch_all_nonce(rpc, &[*address])?;
@@ -50,7 +50,7 @@ pub fn fetch_nonce(
5050

5151
#[cfg(feature = "fetch")]
5252
pub fn fetch_all_nonce(
53-
rpc: &solana_client::rpc_client::RpcClient,
53+
rpc: &solana_rpc_client::rpc_client::RpcClient,
5454
addresses: &[solana_address::Address],
5555
) -> Result<Vec<crate::shared::DecodedAccount<Nonce>>, std::io::Error> {
5656
let accounts = rpc
@@ -74,7 +74,7 @@ pub fn fetch_all_nonce(
7474

7575
#[cfg(feature = "fetch")]
7676
pub fn fetch_maybe_nonce(
77-
rpc: &solana_client::rpc_client::RpcClient,
77+
rpc: &solana_rpc_client::rpc_client::RpcClient,
7878
address: &solana_address::Address,
7979
) -> Result<crate::shared::MaybeAccount<Nonce>, std::io::Error> {
8080
let accounts = fetch_all_maybe_nonce(rpc, &[*address])?;
@@ -83,7 +83,7 @@ pub fn fetch_maybe_nonce(
8383

8484
#[cfg(feature = "fetch")]
8585
pub fn fetch_all_maybe_nonce(
86-
rpc: &solana_client::rpc_client::RpcClient,
86+
rpc: &solana_rpc_client::rpc_client::RpcClient,
8787
addresses: &[solana_address::Address],
8888
) -> Result<Vec<crate::shared::MaybeAccount<Nonce>>, std::io::Error> {
8989
let accounts = rpc

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@codama/renderers-js": "^2.2.0",
5-
"@codama/renderers-rust": "^3.0.0",
6-
"codama": "^1.6.0",
4+
"@codama/renderers-js": "^2.3.0",
5+
"@codama/renderers-rust": "^3.1.0",
6+
"codama": "^1.8.0",
77
"typescript": "^5.9.3"
88
},
99
"engines": {

pnpm-lock.yaml

Lines changed: 94 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)