Skip to content

Commit 3801f5f

Browse files
authored
Bump JS client to Kit v4 (#263)
1 parent 817e052 commit 3801f5f

File tree

10 files changed

+400
-340
lines changed

10 files changed

+400
-340
lines changed

clients/js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
},
4343
"homepage": "https://github.com/solana-program/memo#readme",
4444
"peerDependencies": {
45-
"@solana/kit": "^3.0"
45+
"@solana/kit": "^4.0"
4646
},
4747
"devDependencies": {
4848
"@ava/typescript": "^4.1.0",
4949
"@solana/eslint-config-solana": "^3.0.3",
50-
"@solana/kit": "^3.0",
50+
"@solana/kit": "^4.0",
5151
"@types/node": "^24",
5252
"@typescript-eslint/eslint-plugin": "^7.16.1",
5353
"@typescript-eslint/parser": "^7.16.1",

clients/js/pnpm-lock.yaml

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

clients/js/src/generated/index.ts

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

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
*/
@@ -81,23 +81,18 @@ export function getAddMemoInstruction<
8181
})
8282
);
8383

84-
const instruction = {
84+
return Object.freeze({
8585
accounts: remainingAccounts,
86-
programAddress,
8786
data: getAddMemoInstructionDataEncoder().encode(
8887
args as AddMemoInstructionDataArgs
8988
),
90-
} as AddMemoInstruction<TProgramAddress>;
91-
92-
return instruction;
89+
programAddress,
90+
} as AddMemoInstruction<TProgramAddress>);
9391
}
9492

9593
export type ParsedAddMemoInstruction<
9694
TProgram extends string = typeof MEMO_PROGRAM_ADDRESS,
97-
> = {
98-
programAddress: Address<TProgram>;
99-
data: AddMemoInstructionData;
100-
};
95+
> = { programAddress: Address<TProgram>; data: AddMemoInstructionData };
10196

10297
export function parseAddMemoInstruction<TProgram extends string>(
10398
instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>

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

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

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

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

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

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

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
*/
@@ -23,7 +23,7 @@ import {
2323
* @internal
2424
*/
2525
export function expectSome<T>(value: T | null | undefined): T {
26-
if (value == null) {
26+
if (value === null || value === undefined) {
2727
throw new Error('Expected a value but received null or undefined.');
2828
}
2929
return value;
@@ -48,7 +48,7 @@ export function expectAddress<T extends string = string>(
4848
return value.address;
4949
}
5050
if (Array.isArray(value)) {
51-
return value[0];
51+
return value[0] as Address<T>;
5252
}
5353
return value as Address<T>;
5454
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"generate:clients": "zx ./scripts/generate-clients.mjs"
55
},
66
"devDependencies": {
7-
"@codama/renderers-js": "^1.3",
7+
"@codama/renderers-js": "^1.4",
88
"@codama/renderers-rust": "~1.1",
99
"@iarna/toml": "^2.2.5",
1010
"codama": "^1.3",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)