Skip to content

Commit c25b5fa

Browse files
committed
Bump Codama renderer and adopt @solana/kit 6.10
This bumps the Codama renderer and regenerates the JS client so it stays compatible with @solana/kit 6.10. The generated 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 IDL is also re-emitted by the newer Codama (dropping empty `docs` arrays).
1 parent 8d3a40d commit c25b5fa

5 files changed

Lines changed: 377 additions & 742 deletions

File tree

clients/js/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@
4444
"url": "https://github.com/solana-program/token-wrap/issues"
4545
},
4646
"peerDependencies": {
47-
"@solana/kit": "^6.9.0"
47+
"@solana/kit": "^6.10.0"
4848
},
4949
"dependencies": {
5050
"@solana-program/system": "^0.12.2",
5151
"@solana-program/token": "^0.14.0",
5252
"@solana-program/token-2022": "^0.11.0",
53-
"@solana/program-client-core": "^6.9.0"
53+
"@solana/program-client-core": "^6.10.0"
5454
},
5555
"devDependencies": {
5656
"@eslint/js": "^10.0.1",
57-
"@solana/kit": "^6.9.0",
57+
"@solana/kit": "^6.10.0",
5858
"@tsconfig/strictest": "^2.0.8",
5959
"@types/node": "^25.9.3",
6060
"eslint": "^10.5.0",

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
type ClientWithRpc,
1919
type ClientWithTransactionPlanning,
2020
type ClientWithTransactionSending,
21+
type ExtendedClient,
2122
type GetAccountInfoApi,
2223
type GetMultipleAccountsApi,
2324
type Instruction,
@@ -165,6 +166,8 @@ export type TokenWrapPlugin = {
165166
accounts: TokenWrapPluginAccounts;
166167
instructions: TokenWrapPluginInstructions;
167168
pdas: TokenWrapPluginPdas;
169+
identifyInstruction: typeof identifyTokenWrapInstruction;
170+
parseInstruction: typeof parseTokenWrapInstruction;
168171
};
169172

170173
export type TokenWrapPluginAccounts = {
@@ -197,9 +200,7 @@ export type TokenWrapPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetM
197200
ClientWithTransactionSending;
198201

199202
export function tokenWrapProgram() {
200-
return <T extends TokenWrapPluginRequirements>(
201-
client: T,
202-
): Omit<T, 'tokenWrap'> & { tokenWrap: TokenWrapPlugin } => {
203+
return <T extends TokenWrapPluginRequirements>(client: T): ExtendedClient<T, { tokenWrap: TokenWrapPlugin }> => {
203204
return extendClient(client, {
204205
tokenWrap: <TokenWrapPlugin>{
205206
accounts: { backpointer: addSelfFetchFunctions(client, getBackpointerCodec()) },
@@ -219,6 +220,8 @@ export function tokenWrapProgram() {
219220
wrappedMint: findWrappedMintPda,
220221
wrappedMintAuthority: findWrappedMintAuthorityPda,
221222
},
223+
identifyInstruction: identifyTokenWrapInstruction,
224+
parseInstruction: parseTokenWrapInstruction,
222225
},
223226
});
224227
};

idl.json

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"name": "tokenWrap",
88
"publicKey": "TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR",
99
"version": "0.1.0",
10-
"docs": [],
1110
"accounts": [
1211
{
1312
"kind": "accountNode",
@@ -22,7 +21,6 @@
2221
{
2322
"kind": "structFieldTypeNode",
2423
"name": "unwrappedMint",
25-
"docs": [],
2624
"type": {
2725
"kind": "publicKeyTypeNode"
2826
}
@@ -110,7 +108,6 @@
110108
"kind": "instructionArgumentNode",
111109
"name": "discriminator",
112110
"defaultValueStrategy": "omitted",
113-
"docs": [],
114111
"type": {
115112
"kind": "numberTypeNode",
116113
"format": "u8",
@@ -261,7 +258,6 @@
261258
"kind": "instructionArgumentNode",
262259
"name": "discriminator",
263260
"defaultValueStrategy": "omitted",
264-
"docs": [],
265261
"type": {
266262
"kind": "numberTypeNode",
267263
"format": "u8",
@@ -290,7 +286,6 @@
290286
"kind": "instructionRemainingAccountsNode",
291287
"isOptional": true,
292288
"isSigner": true,
293-
"docs": [],
294289
"value": {
295290
"kind": "argumentValueNode",
296291
"name": "multiSigners"
@@ -415,7 +410,6 @@
415410
"kind": "instructionArgumentNode",
416411
"name": "discriminator",
417412
"defaultValueStrategy": "omitted",
418-
"docs": [],
419413
"type": {
420414
"kind": "numberTypeNode",
421415
"format": "u8",
@@ -444,7 +438,6 @@
444438
"kind": "instructionRemainingAccountsNode",
445439
"isOptional": true,
446440
"isSigner": true,
447-
"docs": [],
448441
"value": {
449442
"kind": "argumentValueNode",
450443
"name": "multiSigners"
@@ -544,7 +537,6 @@
544537
"kind": "instructionArgumentNode",
545538
"name": "discriminator",
546539
"defaultValueStrategy": "omitted",
547-
"docs": [],
548540
"type": {
549541
"kind": "numberTypeNode",
550542
"format": "u8",
@@ -659,7 +651,6 @@
659651
"kind": "instructionArgumentNode",
660652
"name": "discriminator",
661653
"defaultValueStrategy": "omitted",
662-
"docs": [],
663654
"type": {
664655
"kind": "numberTypeNode",
665656
"format": "u8",
@@ -813,7 +804,6 @@
813804
"kind": "instructionArgumentNode",
814805
"name": "discriminator",
815806
"defaultValueStrategy": "omitted",
816-
"docs": [],
817807
"type": {
818808
"kind": "numberTypeNode",
819809
"format": "u8",
@@ -839,7 +829,6 @@
839829
{
840830
"kind": "pdaNode",
841831
"name": "backpointer",
842-
"docs": [],
843832
"seeds": [
844833
{
845834
"kind": "constantPdaSeedNode",
@@ -855,7 +844,6 @@
855844
{
856845
"kind": "variablePdaSeedNode",
857846
"name": "wrappedMint",
858-
"docs": [],
859847
"type": {
860848
"kind": "publicKeyTypeNode"
861849
}
@@ -865,7 +853,6 @@
865853
{
866854
"kind": "pdaNode",
867855
"name": "wrappedMint",
868-
"docs": [],
869856
"seeds": [
870857
{
871858
"kind": "constantPdaSeedNode",
@@ -881,15 +868,13 @@
881868
{
882869
"kind": "variablePdaSeedNode",
883870
"name": "unwrappedMint",
884-
"docs": [],
885871
"type": {
886872
"kind": "publicKeyTypeNode"
887873
}
888874
},
889875
{
890876
"kind": "variablePdaSeedNode",
891877
"name": "wrappedTokenProgram",
892-
"docs": [],
893878
"type": {
894879
"kind": "publicKeyTypeNode"
895880
}
@@ -899,7 +884,6 @@
899884
{
900885
"kind": "pdaNode",
901886
"name": "wrappedMintAuthority",
902-
"docs": [],
903887
"seeds": [
904888
{
905889
"kind": "constantPdaSeedNode",
@@ -915,7 +899,6 @@
915899
{
916900
"kind": "variablePdaSeedNode",
917901
"name": "wrappedMint",
918-
"docs": [],
919902
"type": {
920903
"kind": "publicKeyTypeNode"
921904
}
@@ -929,115 +912,100 @@
929912
"kind": "errorNode",
930913
"name": "wrappedMintMismatch",
931914
"code": 0,
932-
"message": "Wrapped mint account address does not match expected PDA",
933-
"docs": []
915+
"message": "Wrapped mint account address does not match expected PDA"
934916
},
935917
{
936918
"kind": "errorNode",
937919
"name": "backpointerMismatch",
938920
"code": 1,
939-
"message": "Wrapped backpointer account address does not match expected PDA",
940-
"docs": []
921+
"message": "Wrapped backpointer account address does not match expected PDA"
941922
},
942923
{
943924
"kind": "errorNode",
944925
"name": "zeroWrapAmount",
945926
"code": 2,
946-
"message": "Wrap amount should be positive",
947-
"docs": []
927+
"message": "Wrap amount should be positive"
948928
},
949929
{
950930
"kind": "errorNode",
951931
"name": "mintAuthorityMismatch",
952932
"code": 3,
953-
"message": "Wrapped mint authority does not match expected PDA",
954-
"docs": []
933+
"message": "Wrapped mint authority does not match expected PDA"
955934
},
956935
{
957936
"kind": "errorNode",
958937
"name": "escrowOwnerMismatch",
959938
"code": 4,
960-
"message": "Unwrapped escrow token owner is not set to expected PDA",
961-
"docs": []
939+
"message": "Unwrapped escrow token owner is not set to expected PDA"
962940
},
963941
{
964942
"kind": "errorNode",
965943
"name": "invalidWrappedMintOwner",
966944
"code": 5,
967-
"message": "Wrapped mint account owner is not the expected token program",
968-
"docs": []
945+
"message": "Wrapped mint account owner is not the expected token program"
969946
},
970947
{
971948
"kind": "errorNode",
972949
"name": "invalidBackpointerOwner",
973950
"code": 6,
974-
"message": "Wrapped backpointer account owner is not the expected token wrap program",
975-
"docs": []
951+
"message": "Wrapped backpointer account owner is not the expected token wrap program"
976952
},
977953
{
978954
"kind": "errorNode",
979955
"name": "escrowMismatch",
980956
"code": 7,
981-
"message": "Escrow account address does not match expected ATA",
982-
"docs": []
957+
"message": "Escrow account address does not match expected ATA"
983958
},
984959
{
985960
"kind": "errorNode",
986961
"name": "escrowInGoodState",
987962
"code": 8,
988-
"message": "The escrow account is in a good state and cannot be recreated",
989-
"docs": []
963+
"message": "The escrow account is in a good state and cannot be recreated"
990964
},
991965
{
992966
"kind": "errorNode",
993967
"name": "unwrappedMintHasNoMetadata",
994968
"code": 9,
995-
"message": "Unwrapped mint does not have the TokenMetadata extension",
996-
"docs": []
969+
"message": "Unwrapped mint does not have the TokenMetadata extension"
997970
},
998971
{
999972
"kind": "errorNode",
1000973
"name": "metaplexMetadataMismatch",
1001974
"code": 10,
1002-
"message": "Metaplex metadata account address does not match expected PDA",
1003-
"docs": []
975+
"message": "Metaplex metadata account address does not match expected PDA"
1004976
},
1005977
{
1006978
"kind": "errorNode",
1007979
"name": "metadataPointerMissing",
1008980
"code": 11,
1009-
"message": "Metadata pointer extension missing on mint",
1010-
"docs": []
981+
"message": "Metadata pointer extension missing on mint"
1011982
},
1012983
{
1013984
"kind": "errorNode",
1014985
"name": "metadataPointerUnset",
1015986
"code": 12,
1016-
"message": "Metadata pointer is unset (None)",
1017-
"docs": []
987+
"message": "Metadata pointer is unset (None)"
1018988
},
1019989
{
1020990
"kind": "errorNode",
1021991
"name": "metadataPointerMismatch",
1022992
"code": 13,
1023-
"message": "Provided source metadata account does not match pointer",
1024-
"docs": []
993+
"message": "Provided source metadata account does not match pointer"
1025994
},
1026995
{
1027996
"kind": "errorNode",
1028997
"name": "externalProgramReturnedNoData",
1029998
"code": 14,
1030-
"message": "External metadata program returned no data",
1031-
"docs": []
999+
"message": "External metadata program returned no data"
10321000
},
10331001
{
10341002
"kind": "errorNode",
10351003
"name": "noSyncingToToken2022",
10361004
"code": 15,
1037-
"message": "Instruction can only be used with spl-token wrapped mints",
1038-
"docs": []
1005+
"message": "Instruction can only be used with spl-token wrapped mints"
10391006
}
1040-
]
1007+
],
1008+
"constants": []
10411009
},
10421010
"additionalPrograms": []
10431011
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
},
66
"devDependencies": {
77
"@changesets/cli": "^2.31.0",
8-
"@codama/renderers-js": "^2.2.0",
8+
"@codama/renderers-js": "^2.3.0",
99
"@solana-program/system": "^0.12.2",
1010
"@solana/sysvars": "^6.10.0",
1111
"@solana/prettier-config-solana": "0.0.6",
1212
"@types/node": "^25.9.3",
13-
"codama": "^1.6.0",
13+
"codama": "^1.8.0",
1414
"tsx": "^4.22.4",
1515
"typescript": "^6.0.3"
1616
},

0 commit comments

Comments
 (0)