Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions clients/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
"url": "https://github.com/solana-program/token-wrap/issues"
},
"peerDependencies": {
"@solana/kit": "^6.9.0"
"@solana/kit": "^6.10.0"
},
"dependencies": {
"@solana-program/system": "^0.12.2",
"@solana-program/token": "^0.14.0",
"@solana-program/token-2022": "^0.12.0",
"@solana/program-client-core": "^6.9.0"
"@solana/program-client-core": "^6.10.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@solana/kit": "^6.9.0",
"@solana/kit": "^6.10.0",
"@tsconfig/strictest": "^2.0.8",
"@types/node": "^25.9.3",
"eslint": "^10.5.0",
Expand Down
9 changes: 6 additions & 3 deletions clients/js/src/generated/programs/tokenWrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
type ClientWithRpc,
type ClientWithTransactionPlanning,
type ClientWithTransactionSending,
type ExtendedClient,
type GetAccountInfoApi,
type GetMultipleAccountsApi,
type Instruction,
Expand Down Expand Up @@ -165,6 +166,8 @@ export type TokenWrapPlugin = {
accounts: TokenWrapPluginAccounts;
instructions: TokenWrapPluginInstructions;
pdas: TokenWrapPluginPdas;
identifyInstruction: typeof identifyTokenWrapInstruction;
parseInstruction: typeof parseTokenWrapInstruction;
};

export type TokenWrapPluginAccounts = {
Expand Down Expand Up @@ -197,9 +200,7 @@ export type TokenWrapPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetM
ClientWithTransactionSending;

export function tokenWrapProgram() {
return <T extends TokenWrapPluginRequirements>(
client: T,
): Omit<T, 'tokenWrap'> & { tokenWrap: TokenWrapPlugin } => {
return <T extends TokenWrapPluginRequirements>(client: T): ExtendedClient<T, { tokenWrap: TokenWrapPlugin }> => {
return extendClient(client, {
tokenWrap: <TokenWrapPlugin>{
accounts: { backpointer: addSelfFetchFunctions(client, getBackpointerCodec()) },
Expand All @@ -219,6 +220,8 @@ export function tokenWrapProgram() {
wrappedMint: findWrappedMintPda,
wrappedMintAuthority: findWrappedMintAuthorityPda,
},
identifyInstruction: identifyTokenWrapInstruction,
parseInstruction: parseTokenWrapInstruction,
},
});
};
Expand Down
68 changes: 18 additions & 50 deletions idl.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"name": "tokenWrap",
"publicKey": "TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR",
"version": "0.1.0",
"docs": [],
"accounts": [
{
"kind": "accountNode",
Expand All @@ -22,7 +21,6 @@
{
"kind": "structFieldTypeNode",
"name": "unwrappedMint",
"docs": [],
"type": {
"kind": "publicKeyTypeNode"
}
Expand Down Expand Up @@ -110,7 +108,6 @@
"kind": "instructionArgumentNode",
"name": "discriminator",
"defaultValueStrategy": "omitted",
"docs": [],
"type": {
"kind": "numberTypeNode",
"format": "u8",
Expand Down Expand Up @@ -261,7 +258,6 @@
"kind": "instructionArgumentNode",
"name": "discriminator",
"defaultValueStrategy": "omitted",
"docs": [],
"type": {
"kind": "numberTypeNode",
"format": "u8",
Expand Down Expand Up @@ -290,7 +286,6 @@
"kind": "instructionRemainingAccountsNode",
"isOptional": true,
"isSigner": true,
"docs": [],
"value": {
"kind": "argumentValueNode",
"name": "multiSigners"
Expand Down Expand Up @@ -415,7 +410,6 @@
"kind": "instructionArgumentNode",
"name": "discriminator",
"defaultValueStrategy": "omitted",
"docs": [],
"type": {
"kind": "numberTypeNode",
"format": "u8",
Expand Down Expand Up @@ -444,7 +438,6 @@
"kind": "instructionRemainingAccountsNode",
"isOptional": true,
"isSigner": true,
"docs": [],
"value": {
"kind": "argumentValueNode",
"name": "multiSigners"
Expand Down Expand Up @@ -544,7 +537,6 @@
"kind": "instructionArgumentNode",
"name": "discriminator",
"defaultValueStrategy": "omitted",
"docs": [],
"type": {
"kind": "numberTypeNode",
"format": "u8",
Expand Down Expand Up @@ -659,7 +651,6 @@
"kind": "instructionArgumentNode",
"name": "discriminator",
"defaultValueStrategy": "omitted",
"docs": [],
"type": {
"kind": "numberTypeNode",
"format": "u8",
Expand Down Expand Up @@ -813,7 +804,6 @@
"kind": "instructionArgumentNode",
"name": "discriminator",
"defaultValueStrategy": "omitted",
"docs": [],
"type": {
"kind": "numberTypeNode",
"format": "u8",
Expand All @@ -839,7 +829,6 @@
{
"kind": "pdaNode",
"name": "backpointer",
"docs": [],
"seeds": [
{
"kind": "constantPdaSeedNode",
Expand All @@ -855,7 +844,6 @@
{
"kind": "variablePdaSeedNode",
"name": "wrappedMint",
"docs": [],
"type": {
"kind": "publicKeyTypeNode"
}
Expand All @@ -865,7 +853,6 @@
{
"kind": "pdaNode",
"name": "wrappedMint",
"docs": [],
"seeds": [
{
"kind": "constantPdaSeedNode",
Expand All @@ -881,15 +868,13 @@
{
"kind": "variablePdaSeedNode",
"name": "unwrappedMint",
"docs": [],
"type": {
"kind": "publicKeyTypeNode"
}
},
{
"kind": "variablePdaSeedNode",
"name": "wrappedTokenProgram",
"docs": [],
"type": {
"kind": "publicKeyTypeNode"
}
Expand All @@ -899,7 +884,6 @@
{
"kind": "pdaNode",
"name": "wrappedMintAuthority",
"docs": [],
"seeds": [
{
"kind": "constantPdaSeedNode",
Expand All @@ -915,7 +899,6 @@
{
"kind": "variablePdaSeedNode",
"name": "wrappedMint",
"docs": [],
"type": {
"kind": "publicKeyTypeNode"
}
Expand All @@ -929,115 +912,100 @@
"kind": "errorNode",
"name": "wrappedMintMismatch",
"code": 0,
"message": "Wrapped mint account address does not match expected PDA",
"docs": []
"message": "Wrapped mint account address does not match expected PDA"
},
{
"kind": "errorNode",
"name": "backpointerMismatch",
"code": 1,
"message": "Wrapped backpointer account address does not match expected PDA",
"docs": []
"message": "Wrapped backpointer account address does not match expected PDA"
},
{
"kind": "errorNode",
"name": "zeroWrapAmount",
"code": 2,
"message": "Wrap amount should be positive",
"docs": []
"message": "Wrap amount should be positive"
},
{
"kind": "errorNode",
"name": "mintAuthorityMismatch",
"code": 3,
"message": "Wrapped mint authority does not match expected PDA",
"docs": []
"message": "Wrapped mint authority does not match expected PDA"
},
{
"kind": "errorNode",
"name": "escrowOwnerMismatch",
"code": 4,
"message": "Unwrapped escrow token owner is not set to expected PDA",
"docs": []
"message": "Unwrapped escrow token owner is not set to expected PDA"
},
{
"kind": "errorNode",
"name": "invalidWrappedMintOwner",
"code": 5,
"message": "Wrapped mint account owner is not the expected token program",
"docs": []
"message": "Wrapped mint account owner is not the expected token program"
},
{
"kind": "errorNode",
"name": "invalidBackpointerOwner",
"code": 6,
"message": "Wrapped backpointer account owner is not the expected token wrap program",
"docs": []
"message": "Wrapped backpointer account owner is not the expected token wrap program"
},
{
"kind": "errorNode",
"name": "escrowMismatch",
"code": 7,
"message": "Escrow account address does not match expected ATA",
"docs": []
"message": "Escrow account address does not match expected ATA"
},
{
"kind": "errorNode",
"name": "escrowInGoodState",
"code": 8,
"message": "The escrow account is in a good state and cannot be recreated",
"docs": []
"message": "The escrow account is in a good state and cannot be recreated"
},
{
"kind": "errorNode",
"name": "unwrappedMintHasNoMetadata",
"code": 9,
"message": "Unwrapped mint does not have the TokenMetadata extension",
"docs": []
"message": "Unwrapped mint does not have the TokenMetadata extension"
},
{
"kind": "errorNode",
"name": "metaplexMetadataMismatch",
"code": 10,
"message": "Metaplex metadata account address does not match expected PDA",
"docs": []
"message": "Metaplex metadata account address does not match expected PDA"
},
{
"kind": "errorNode",
"name": "metadataPointerMissing",
"code": 11,
"message": "Metadata pointer extension missing on mint",
"docs": []
"message": "Metadata pointer extension missing on mint"
},
{
"kind": "errorNode",
"name": "metadataPointerUnset",
"code": 12,
"message": "Metadata pointer is unset (None)",
"docs": []
"message": "Metadata pointer is unset (None)"
},
{
"kind": "errorNode",
"name": "metadataPointerMismatch",
"code": 13,
"message": "Provided source metadata account does not match pointer",
"docs": []
"message": "Provided source metadata account does not match pointer"
},
{
"kind": "errorNode",
"name": "externalProgramReturnedNoData",
"code": 14,
"message": "External metadata program returned no data",
"docs": []
"message": "External metadata program returned no data"
},
{
"kind": "errorNode",
"name": "noSyncingToToken2022",
"code": 15,
"message": "Instruction can only be used with spl-token wrapped mints",
"docs": []
"message": "Instruction can only be used with spl-token wrapped mints"
}
]
],
"constants": []
},
"additionalPrograms": []
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
},
"devDependencies": {
"@changesets/cli": "^2.31.0",
"@codama/renderers-js": "^2.2.0",
"@codama/renderers-js": "^2.3.0",
"@solana-program/system": "^0.12.2",
"@solana/sysvars": "^6.10.0",
"@solana/prettier-config-solana": "0.0.6",
"@types/node": "^25.9.3",
"codama": "^1.6.0",
"codama": "^1.8.0",
"tsx": "^4.22.4",
"typescript": "^6.0.3"
},
Expand Down
Loading
Loading