@solana-program/token-wrap 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/src/index.js +264 -22
  2. package/dist/src/index.js.map +1 -1
  3. package/dist/src/index.mjs +246 -25
  4. package/dist/src/index.mjs.map +1 -1
  5. package/dist/types/create-mint.d.ts +2 -2
  6. package/dist/types/examples/sync-spl-to-token2022.d.ts +1 -0
  7. package/dist/types/examples/sync-token2022-to-spl.d.ts +1 -0
  8. package/dist/types/generated/accounts/backpointer.d.ts +6 -6
  9. package/dist/types/generated/accounts/index.d.ts +2 -2
  10. package/dist/types/generated/errors/index.d.ts +2 -2
  11. package/dist/types/generated/errors/tokenWrap.d.ts +10 -3
  12. package/dist/types/generated/index.d.ts +2 -2
  13. package/dist/types/generated/instructions/closeStuckEscrow.d.ts +10 -10
  14. package/dist/types/generated/instructions/createMint.d.ts +10 -10
  15. package/dist/types/generated/instructions/index.d.ts +4 -2
  16. package/dist/types/generated/instructions/syncMetadataToSplToken.d.ts +92 -0
  17. package/dist/types/generated/instructions/syncMetadataToToken2022.d.ts +75 -0
  18. package/dist/types/generated/instructions/unwrap.d.ts +11 -11
  19. package/dist/types/generated/instructions/wrap.d.ts +11 -11
  20. package/dist/types/generated/pdas/backpointer.d.ts +2 -2
  21. package/dist/types/generated/pdas/index.d.ts +2 -2
  22. package/dist/types/generated/pdas/wrappedMint.d.ts +2 -2
  23. package/dist/types/generated/pdas/wrappedMintAuthority.d.ts +2 -2
  24. package/dist/types/generated/programs/index.d.ts +2 -2
  25. package/dist/types/generated/programs/tokenWrap.d.ts +11 -5
  26. package/dist/types/generated/shared/index.d.ts +5 -5
  27. package/dist/types/unwrap.d.ts +3 -3
  28. package/dist/types/utilities.d.ts +4 -4
  29. package/dist/types/wrap.d.ts +3 -3
  30. package/package.json +18 -18
@@ -1,12 +1,12 @@
1
1
  /**
2
- * This code was AUTOGENERATED using the codama library.
2
+ * This code was AUTOGENERATED using the Codama library.
3
3
  * 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.
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
7
  */
8
8
  import { type Address, type ReadonlyUint8Array } from '@solana/kit';
9
- import { type ParsedCloseStuckEscrowInstruction, type ParsedCreateMintInstruction, type ParsedUnwrapInstruction, type ParsedWrapInstruction } from '../instructions';
9
+ import { type ParsedCloseStuckEscrowInstruction, type ParsedCreateMintInstruction, type ParsedSyncMetadataToSplTokenInstruction, type ParsedSyncMetadataToToken2022Instruction, type ParsedUnwrapInstruction, type ParsedWrapInstruction } from '../instructions';
10
10
  export declare const TOKEN_WRAP_PROGRAM_ADDRESS: Address<"TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR">;
11
11
  export declare enum TokenWrapAccount {
12
12
  Backpointer = 0
@@ -15,7 +15,9 @@ export declare enum TokenWrapInstruction {
15
15
  CreateMint = 0,
16
16
  Wrap = 1,
17
17
  Unwrap = 2,
18
- CloseStuckEscrow = 3
18
+ CloseStuckEscrow = 3,
19
+ SyncMetadataToToken2022 = 4,
20
+ SyncMetadataToSplToken = 5
19
21
  }
20
22
  export declare function identifyTokenWrapInstruction(instruction: {
21
23
  data: ReadonlyUint8Array;
@@ -28,4 +30,8 @@ export type ParsedTokenWrapInstruction<TProgram extends string = 'TwRapQCDhWkZRr
28
30
  instructionType: TokenWrapInstruction.Unwrap;
29
31
  } & ParsedUnwrapInstruction<TProgram>) | ({
30
32
  instructionType: TokenWrapInstruction.CloseStuckEscrow;
31
- } & ParsedCloseStuckEscrowInstruction<TProgram>);
33
+ } & ParsedCloseStuckEscrowInstruction<TProgram>) | ({
34
+ instructionType: TokenWrapInstruction.SyncMetadataToToken2022;
35
+ } & ParsedSyncMetadataToToken2022Instruction<TProgram>) | ({
36
+ instructionType: TokenWrapInstruction.SyncMetadataToSplToken;
37
+ } & ParsedSyncMetadataToSplTokenInstruction<TProgram>);
@@ -1,11 +1,11 @@
1
1
  /**
2
- * This code was AUTOGENERATED using the codama library.
2
+ * This code was AUTOGENERATED using the Codama library.
3
3
  * 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.
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
7
  */
8
- import { type Address, type IAccountMeta, type IAccountSignerMeta, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
8
+ import { type AccountMeta, type AccountSignerMeta, type Address, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
9
9
  /**
10
10
  * Asserts that the given value is not null or undefined.
11
11
  * @internal
@@ -38,12 +38,12 @@ export type ResolvedAccount<T extends string = string, U extends Address<T> | Pr
38
38
  * Defines an instruction that stores additional bytes on-chain.
39
39
  * @internal
40
40
  */
41
- export type IInstructionWithByteDelta = {
41
+ export type InstructionWithByteDelta = {
42
42
  byteDelta: number;
43
43
  };
44
44
  /**
45
45
  * Get account metas and signers from resolved accounts.
46
46
  * @internal
47
47
  */
48
- export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => IAccountMeta | IAccountSignerMeta | undefined;
48
+ export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
49
49
  export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
@@ -1,4 +1,4 @@
1
- import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
1
+ import { Address, GetAccountInfoApi, Instruction, Rpc, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayerSigner, TransactionSigner } from '@solana/kit';
2
2
  import { Blockhash } from '@solana/rpc-types';
3
3
  export interface SingleSignerUnwrapArgs {
4
4
  rpc: Rpc<GetAccountInfoApi>;
@@ -24,7 +24,7 @@ interface UnwrapTxBuilderArgs {
24
24
  multiSigners?: TransactionSigner[];
25
25
  }
26
26
  export interface SingleSignerUnwrapResult {
27
- ixs: IInstruction[];
27
+ ixs: Instruction[];
28
28
  recipientUnwrappedToken: Address;
29
29
  amount: bigint;
30
30
  }
@@ -41,5 +41,5 @@ export interface MultiSignerUnWrapTxBuilderArgs extends UnwrapTxBuilderArgs {
41
41
  };
42
42
  multiSigners: TransactionSigner[];
43
43
  }
44
- export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
44
+ export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayerSigner>;
45
45
  export {};
@@ -1,4 +1,4 @@
1
- import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime } from '@solana/kit';
1
+ import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, Instruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime, TransactionWithinSizeLimit } from '@solana/kit';
2
2
  import { Token } from '@solana-program/token-2022';
3
3
  import { Blockhash } from '@solana/rpc-types';
4
4
  import { Account } from '@solana/accounts';
@@ -9,7 +9,7 @@ export declare function createTokenAccount({ rpc, payer, mint, owner, tokenProgr
9
9
  owner: Address;
10
10
  tokenProgram: Address;
11
11
  }): Promise<{
12
- ixs: IInstruction[];
12
+ ixs: Instruction[];
13
13
  keyPair: KeyPairSigner;
14
14
  }>;
15
15
  export interface CreateEscrowAccountArgs {
@@ -24,7 +24,7 @@ export type CreateEscrowAccountResult = {
24
24
  } | {
25
25
  kind: 'instructions_to_create';
26
26
  address: Address;
27
- ixs: IInstruction[];
27
+ ixs: Instruction[];
28
28
  };
29
29
  export declare function createEscrowAccount({ rpc, payer, unwrappedMint, wrappedTokenProgram, }: CreateEscrowAccountArgs): Promise<CreateEscrowAccountResult>;
30
30
  export declare function getOwnerFromAccount(rpc: Rpc<GetAccountInfoApi>, accountAddress: Address): Promise<Address>;
@@ -36,4 +36,4 @@ export interface MultiSigCombineArgs {
36
36
  lastValidBlockHeight: bigint;
37
37
  };
38
38
  }
39
- export declare function combinedMultisigTx({ signedTxs, blockhash, }: MultiSigCombineArgs): FullySignedTransaction & TransactionWithBlockhashLifetime;
39
+ export declare function combinedMultisigTx({ signedTxs, blockhash, }: MultiSigCombineArgs): Transaction & FullySignedTransaction & TransactionWithBlockhashLifetime & TransactionWithinSizeLimit;
@@ -1,4 +1,4 @@
1
- import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
1
+ import { Address, GetAccountInfoApi, Instruction, Rpc, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayerSigner, TransactionSigner } from '@solana/kit';
2
2
  import { Blockhash } from '@solana/rpc-types';
3
3
  interface IxBuilderArgs {
4
4
  unwrappedTokenAccount: Address;
@@ -20,7 +20,7 @@ export interface MultiSignerWrapIxBuilderArgs extends IxBuilderArgs {
20
20
  };
21
21
  multiSigners: TransactionSigner[];
22
22
  }
23
- export declare function multisigOfflineSignWrap(args: MultiSignerWrapIxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
23
+ export declare function multisigOfflineSignWrap(args: MultiSignerWrapIxBuilderArgs): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayerSigner>;
24
24
  export interface SingleSignerWrapArgs {
25
25
  rpc: Rpc<GetAccountInfoApi>;
26
26
  payer: TransactionSigner;
@@ -33,7 +33,7 @@ export interface SingleSignerWrapArgs {
33
33
  unwrappedTokenProgram?: Address;
34
34
  }
35
35
  export interface SingleSignerWrapResult {
36
- ixs: IInstruction[];
36
+ ixs: Instruction[];
37
37
  recipientWrappedTokenAccount: Address;
38
38
  escrowAccount: Address;
39
39
  amount: bigint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-program/token-wrap",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "Javascript helpers for interacting with the Solana Token Wrap program",
5
5
  "author": "Anza Maintainers <maintainers@anza.xyz>",
6
6
  "license": "Apache-2.0",
@@ -32,28 +32,28 @@
32
32
  "url": "https://github.com/solana-program/token-wrap/issues"
33
33
  },
34
34
  "peerDependencies": {
35
- "@solana/kit": "^2.1.1"
35
+ "@solana/kit": "^4.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@solana-program/system": "^0.7.0",
39
- "@solana-program/token": "^0.5.1",
40
- "@solana-program/token-2022": "^0.4.2",
41
- "@solana/accounts": "^2.1.1",
42
- "@solana/rpc-types": "^2.1.1"
38
+ "@solana-program/system": "^0.9.0",
39
+ "@solana-program/token": "^0.7.0",
40
+ "@solana-program/token-2022": "^0.6.0",
41
+ "@solana/accounts": "^4.0.0",
42
+ "@solana/rpc-types": "^4.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@eslint/js": "^9.29.0",
46
- "@solana/kit": "^2.1.1",
47
- "@tsconfig/strictest": "^2.0.5",
48
- "@types/node": "^24.0.4",
49
- "eslint": "^9.29.0",
50
- "eslint-config-prettier": "^10.1.5",
51
- "prettier": "^3.6.1",
45
+ "@eslint/js": "^9.37.0",
46
+ "@solana/kit": "^4.0.0",
47
+ "@tsconfig/strictest": "^2.0.6",
48
+ "@types/node": "^24.7.2",
49
+ "eslint": "^9.37.0",
50
+ "eslint-config-prettier": "^10.1.8",
51
+ "prettier": "^3.6.2",
52
52
  "tsup": "^8.5.0",
53
- "tsx": "^4.20.3",
54
- "typedoc": "^0.28.5",
55
- "typescript": "^5.8.2",
56
- "typescript-eslint": "^8.35.0"
53
+ "tsx": "^4.20.6",
54
+ "typedoc": "^0.28.14",
55
+ "typescript": "^5.9.3",
56
+ "typescript-eslint": "^8.46.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsc && tsup",