@solana-program/token-wrap 0.0.0 → 2.0.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.
@@ -0,0 +1,103 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type TransactionSigner, type WritableAccount } from '@solana/kit';
9
+ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
10
+ export declare const WRAP_DISCRIMINATOR = 1;
11
+ export declare function getWrapDiscriminatorBytes(): import("@solana/kit").ReadonlyUint8Array;
12
+ export type WrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountRecipientWrappedTokenAccount extends string | IAccountMeta<string> = string, TAccountWrappedMint extends string | IAccountMeta<string> = string, TAccountWrappedMintAuthority extends string | IAccountMeta<string> = string, TAccountUnwrappedTokenProgram extends string | IAccountMeta<string> = string, TAccountWrappedTokenProgram extends string | IAccountMeta<string> = string, TAccountUnwrappedTokenAccount extends string | IAccountMeta<string> = string, TAccountUnwrappedMint extends string | IAccountMeta<string> = string, TAccountUnwrappedEscrow extends string | IAccountMeta<string> = string, TAccountTransferAuthority extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
13
+ TAccountRecipientWrappedTokenAccount extends string ? WritableAccount<TAccountRecipientWrappedTokenAccount> : TAccountRecipientWrappedTokenAccount,
14
+ TAccountWrappedMint extends string ? WritableAccount<TAccountWrappedMint> : TAccountWrappedMint,
15
+ TAccountWrappedMintAuthority extends string ? ReadonlyAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
16
+ TAccountUnwrappedTokenProgram extends string ? ReadonlyAccount<TAccountUnwrappedTokenProgram> : TAccountUnwrappedTokenProgram,
17
+ TAccountWrappedTokenProgram extends string ? ReadonlyAccount<TAccountWrappedTokenProgram> : TAccountWrappedTokenProgram,
18
+ TAccountUnwrappedTokenAccount extends string ? WritableAccount<TAccountUnwrappedTokenAccount> : TAccountUnwrappedTokenAccount,
19
+ TAccountUnwrappedMint extends string ? ReadonlyAccount<TAccountUnwrappedMint> : TAccountUnwrappedMint,
20
+ TAccountUnwrappedEscrow extends string ? WritableAccount<TAccountUnwrappedEscrow> : TAccountUnwrappedEscrow,
21
+ TAccountTransferAuthority extends string ? ReadonlyAccount<TAccountTransferAuthority> : TAccountTransferAuthority,
22
+ ...TRemainingAccounts
23
+ ]>;
24
+ export type WrapInstructionData = {
25
+ discriminator: number;
26
+ /** The amount of tokens to wrap. */
27
+ amount: bigint;
28
+ };
29
+ export type WrapInstructionDataArgs = {
30
+ /** The amount of tokens to wrap. */
31
+ amount: number | bigint;
32
+ };
33
+ export declare function getWrapInstructionDataEncoder(): Encoder<WrapInstructionDataArgs>;
34
+ export declare function getWrapInstructionDataDecoder(): Decoder<WrapInstructionData>;
35
+ export declare function getWrapInstructionDataCodec(): Codec<WrapInstructionDataArgs, WrapInstructionData>;
36
+ export type WrapInput<TAccountRecipientWrappedTokenAccount extends string = string, TAccountWrappedMint extends string = string, TAccountWrappedMintAuthority extends string = string, TAccountUnwrappedTokenProgram extends string = string, TAccountWrappedTokenProgram extends string = string, TAccountUnwrappedTokenAccount extends string = string, TAccountUnwrappedMint extends string = string, TAccountUnwrappedEscrow extends string = string, TAccountTransferAuthority extends string = string> = {
37
+ /** The token account to receive the wrapped tokens. */
38
+ recipientWrappedTokenAccount: Address<TAccountRecipientWrappedTokenAccount>;
39
+ /**
40
+ * Wrapped mint, must be initialized, address must be:
41
+ * `get_wrapped_mint_address(unwrapped_mint_address, wrapped_token_program_id)`
42
+ */
43
+ wrappedMint: Address<TAccountWrappedMint>;
44
+ /**
45
+ * The PDA authority of the wrapped mint, address must be
46
+ * `get_wrapped_mint_authority(wrapped_mint)`
47
+ */
48
+ wrappedMintAuthority: Address<TAccountWrappedMintAuthority>;
49
+ /** The token program of the unwrapped tokens. */
50
+ unwrappedTokenProgram: Address<TAccountUnwrappedTokenProgram>;
51
+ /** The token program of the wrapped tokens. */
52
+ wrappedTokenProgram: Address<TAccountWrappedTokenProgram>;
53
+ /** The source token account for the unwrapped tokens. */
54
+ unwrappedTokenAccount: Address<TAccountUnwrappedTokenAccount>;
55
+ /** The mint of the unwrapped tokens. */
56
+ unwrappedMint: Address<TAccountUnwrappedMint>;
57
+ /**
58
+ * The escrow account that holds the unwrapped tokens.
59
+ * Address must be ATA: get_escrow_address(unwrapped_mint, unwrapped_token_program, wrapped_token_program)
60
+ */
61
+ unwrappedEscrow: Address<TAccountUnwrappedEscrow>;
62
+ /** The authority to transfer the unwrapped tokens. */
63
+ transferAuthority: Address<TAccountTransferAuthority> | TransactionSigner<TAccountTransferAuthority>;
64
+ amount: WrapInstructionDataArgs['amount'];
65
+ multiSigners?: Array<TransactionSigner>;
66
+ };
67
+ export declare function getWrapInstruction<TAccountRecipientWrappedTokenAccount extends string, TAccountWrappedMint extends string, TAccountWrappedMintAuthority extends string, TAccountUnwrappedTokenProgram extends string, TAccountWrappedTokenProgram extends string, TAccountUnwrappedTokenAccount extends string, TAccountUnwrappedMint extends string, TAccountUnwrappedEscrow extends string, TAccountTransferAuthority extends string, TProgramAddress extends Address = typeof TOKEN_WRAP_PROGRAM_ADDRESS>(input: WrapInput<TAccountRecipientWrappedTokenAccount, TAccountWrappedMint, TAccountWrappedMintAuthority, TAccountUnwrappedTokenProgram, TAccountWrappedTokenProgram, TAccountUnwrappedTokenAccount, TAccountUnwrappedMint, TAccountUnwrappedEscrow, TAccountTransferAuthority>, config?: {
68
+ programAddress?: TProgramAddress;
69
+ }): WrapInstruction<TProgramAddress, TAccountRecipientWrappedTokenAccount, TAccountWrappedMint, TAccountWrappedMintAuthority, TAccountUnwrappedTokenProgram, TAccountWrappedTokenProgram, TAccountUnwrappedTokenAccount, TAccountUnwrappedMint, TAccountUnwrappedEscrow, (typeof input)['transferAuthority'] extends TransactionSigner<TAccountTransferAuthority> ? ReadonlySignerAccount<TAccountTransferAuthority> & IAccountSignerMeta<TAccountTransferAuthority> : TAccountTransferAuthority>;
70
+ export type ParsedWrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
71
+ programAddress: Address<TProgram>;
72
+ accounts: {
73
+ /** The token account to receive the wrapped tokens. */
74
+ recipientWrappedTokenAccount: TAccountMetas[0];
75
+ /**
76
+ * Wrapped mint, must be initialized, address must be:
77
+ * `get_wrapped_mint_address(unwrapped_mint_address, wrapped_token_program_id)`
78
+ */
79
+ wrappedMint: TAccountMetas[1];
80
+ /**
81
+ * The PDA authority of the wrapped mint, address must be
82
+ * `get_wrapped_mint_authority(wrapped_mint)`
83
+ */
84
+ wrappedMintAuthority: TAccountMetas[2];
85
+ /** The token program of the unwrapped tokens. */
86
+ unwrappedTokenProgram: TAccountMetas[3];
87
+ /** The token program of the wrapped tokens. */
88
+ wrappedTokenProgram: TAccountMetas[4];
89
+ /** The source token account for the unwrapped tokens. */
90
+ unwrappedTokenAccount: TAccountMetas[5];
91
+ /** The mint of the unwrapped tokens. */
92
+ unwrappedMint: TAccountMetas[6];
93
+ /**
94
+ * The escrow account that holds the unwrapped tokens.
95
+ * Address must be ATA: get_escrow_address(unwrapped_mint, unwrapped_token_program, wrapped_token_program)
96
+ */
97
+ unwrappedEscrow: TAccountMetas[7];
98
+ /** The authority to transfer the unwrapped tokens. */
99
+ transferAuthority: TAccountMetas[8];
100
+ };
101
+ data: WrapInstructionData;
102
+ };
103
+ export declare function parseWrapInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedWrapInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type ProgramDerivedAddress } from '@solana/kit';
9
+ export type BackpointerSeeds = {
10
+ wrappedMint: Address;
11
+ };
12
+ export declare function findBackpointerPda(seeds: BackpointerSeeds, config?: {
13
+ programAddress?: Address | undefined;
14
+ }): Promise<ProgramDerivedAddress>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from './backpointer';
9
+ export * from './wrappedMint';
10
+ export * from './wrappedMintAuthority';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type ProgramDerivedAddress } from '@solana/kit';
9
+ export type WrappedMintSeeds = {
10
+ unwrappedMint: Address;
11
+ wrappedTokenProgram: Address;
12
+ };
13
+ export declare function findWrappedMintPda(seeds: WrappedMintSeeds, config?: {
14
+ programAddress?: Address | undefined;
15
+ }): Promise<ProgramDerivedAddress>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type ProgramDerivedAddress } from '@solana/kit';
9
+ export type WrappedMintAuthoritySeeds = {
10
+ wrappedMint: Address;
11
+ };
12
+ export declare function findWrappedMintAuthorityPda(seeds: WrappedMintAuthoritySeeds, config?: {
13
+ programAddress?: Address | undefined;
14
+ }): Promise<ProgramDerivedAddress>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from './tokenWrap';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type ReadonlyUint8Array } from '@solana/kit';
9
+ import { type ParsedCreateMintInstruction, type ParsedUnwrapInstruction, type ParsedWrapInstruction } from '../instructions';
10
+ export declare const TOKEN_WRAP_PROGRAM_ADDRESS: Address<"TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR">;
11
+ export declare enum TokenWrapAccount {
12
+ Backpointer = 0
13
+ }
14
+ export declare enum TokenWrapInstruction {
15
+ CreateMint = 0,
16
+ Wrap = 1,
17
+ Unwrap = 2
18
+ }
19
+ export declare function identifyTokenWrapInstruction(instruction: {
20
+ data: ReadonlyUint8Array;
21
+ } | ReadonlyUint8Array): TokenWrapInstruction;
22
+ export type ParsedTokenWrapInstruction<TProgram extends string = 'TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR'> = ({
23
+ instructionType: TokenWrapInstruction.CreateMint;
24
+ } & ParsedCreateMintInstruction<TProgram>) | ({
25
+ instructionType: TokenWrapInstruction.Wrap;
26
+ } & ParsedWrapInstruction<TProgram>) | ({
27
+ instructionType: TokenWrapInstruction.Unwrap;
28
+ } & ParsedUnwrapInstruction<TProgram>);
@@ -0,0 +1,49 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type IAccountMeta, type IAccountSignerMeta, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
9
+ /**
10
+ * Asserts that the given value is not null or undefined.
11
+ * @internal
12
+ */
13
+ export declare function expectSome<T>(value: T | null | undefined): T;
14
+ /**
15
+ * Asserts that the given value is a PublicKey.
16
+ * @internal
17
+ */
18
+ export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
19
+ /**
20
+ * Asserts that the given value is a PDA.
21
+ * @internal
22
+ */
23
+ export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
24
+ /**
25
+ * Asserts that the given value is a TransactionSigner.
26
+ * @internal
27
+ */
28
+ export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
29
+ /**
30
+ * Defines an instruction account to resolve.
31
+ * @internal
32
+ */
33
+ export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
34
+ isWritable: boolean;
35
+ value: U;
36
+ };
37
+ /**
38
+ * Defines an instruction that stores additional bytes on-chain.
39
+ * @internal
40
+ */
41
+ export type IInstructionWithByteDelta = {
42
+ byteDelta: number;
43
+ };
44
+ /**
45
+ * Get account metas and signers from resolved accounts.
46
+ * @internal
47
+ */
48
+ export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => IAccountMeta | IAccountSignerMeta | undefined;
49
+ export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
@@ -0,0 +1,5 @@
1
+ export * from './generated';
2
+ export { createMint, type CreateMintArgs, type CreateMintResult } from './create-mint';
3
+ export { singleSignerWrap, type SingleSignerWrapArgs, type SingleSignerWrapResult, multisigOfflineSignWrap, type MultiSignerWrapIxBuilderArgs, } from './wrap';
4
+ export { singleSignerUnwrap, type SingleSignerUnwrapArgs, type SingleSignerUnwrapResult, multisigOfflineSignUnwrap, } from './unwrap';
5
+ export { createEscrowAccount, type CreateEscrowAccountArgs, type CreateEscrowAccountResult, combinedMultisigTx, type MultiSigCombineArgs, } from './utilities';
@@ -0,0 +1,45 @@
1
+ import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
2
+ import { Blockhash } from '@solana/rpc-types';
3
+ export interface SingleSignerUnwrapArgs {
4
+ rpc: Rpc<GetAccountInfoApi>;
5
+ payer: TransactionSigner;
6
+ wrappedTokenAccount: Address;
7
+ amount: bigint | number;
8
+ recipientUnwrappedToken: Address;
9
+ transferAuthority?: Address | TransactionSigner;
10
+ unwrappedMint?: Address;
11
+ wrappedTokenProgram?: Address;
12
+ unwrappedTokenProgram?: Address;
13
+ }
14
+ interface UnwrapTxBuilderArgs {
15
+ wrappedTokenAccount: Address;
16
+ amount: bigint | number;
17
+ wrappedMint: Address;
18
+ wrappedMintAuthority: Address;
19
+ unwrappedMint: Address;
20
+ recipientUnwrappedToken: Address;
21
+ unwrappedTokenProgram: Address;
22
+ wrappedTokenProgram: Address;
23
+ transferAuthority: Address | TransactionSigner;
24
+ multiSigners?: TransactionSigner[];
25
+ }
26
+ export interface SingleSignerUnwrapResult {
27
+ ixs: IInstruction[];
28
+ recipientUnwrappedToken: Address;
29
+ amount: bigint;
30
+ }
31
+ /**
32
+ * Creates, signs (single signer or default authority), and sends an unwrap transaction.
33
+ * Derives necessary PDAs and default accounts if not provided.
34
+ */
35
+ export declare function singleSignerUnwrap({ rpc, payer, wrappedTokenAccount, amount, recipientUnwrappedToken, transferAuthority: inputTransferAuthority, unwrappedMint: inputUnwrappedMint, wrappedTokenProgram: inputWrappedTokenProgram, unwrappedTokenProgram: inputUnwrappedTokenProgram, }: SingleSignerUnwrapArgs): Promise<SingleSignerUnwrapResult>;
36
+ export interface MultiSignerUnWrapTxBuilderArgs extends UnwrapTxBuilderArgs {
37
+ payer: TransactionSigner;
38
+ blockhash: {
39
+ blockhash: Blockhash;
40
+ lastValidBlockHeight: bigint;
41
+ };
42
+ multiSigners: TransactionSigner[];
43
+ }
44
+ export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
45
+ export {};
@@ -0,0 +1,39 @@
1
+ import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime } from '@solana/kit';
2
+ import { Token } from '@solana-program/token-2022';
3
+ import { Blockhash } from '@solana/rpc-types';
4
+ import { Account } from '@solana/accounts';
5
+ export declare function createTokenAccount({ rpc, payer, mint, owner, tokenProgram, }: {
6
+ rpc: Rpc<GetMinimumBalanceForRentExemptionApi>;
7
+ payer: KeyPairSigner;
8
+ mint: Address;
9
+ owner: Address;
10
+ tokenProgram: Address;
11
+ }): Promise<{
12
+ ixs: IInstruction[];
13
+ keyPair: KeyPairSigner;
14
+ }>;
15
+ export interface CreateEscrowAccountArgs {
16
+ rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
17
+ payer: KeyPairSigner;
18
+ unwrappedMint: Address;
19
+ wrappedTokenProgram: Address;
20
+ }
21
+ export type CreateEscrowAccountResult = {
22
+ kind: 'already_exists';
23
+ account: Account<Token>;
24
+ } | {
25
+ kind: 'instructions_to_create';
26
+ address: Address;
27
+ ixs: IInstruction[];
28
+ };
29
+ export declare function createEscrowAccount({ rpc, payer, unwrappedMint, wrappedTokenProgram, }: CreateEscrowAccountArgs): Promise<CreateEscrowAccountResult>;
30
+ export declare function getOwnerFromAccount(rpc: Rpc<GetAccountInfoApi>, accountAddress: Address): Promise<Address>;
31
+ export declare function getMintFromTokenAccount(rpc: Rpc<GetAccountInfoApi>, tokenAccountAddress: Address): Promise<Address>;
32
+ export interface MultiSigCombineArgs {
33
+ signedTxs: (Transaction & TransactionWithBlockhashLifetime)[];
34
+ blockhash: {
35
+ blockhash: Blockhash;
36
+ lastValidBlockHeight: bigint;
37
+ };
38
+ }
39
+ export declare function combinedMultisigTx({ signedTxs, blockhash, }: MultiSigCombineArgs): FullySignedTransaction & TransactionWithBlockhashLifetime;
@@ -0,0 +1,42 @@
1
+ import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
2
+ import { Blockhash } from '@solana/rpc-types';
3
+ interface IxBuilderArgs {
4
+ unwrappedTokenAccount: Address;
5
+ wrappedTokenProgram: Address;
6
+ amount: bigint | number;
7
+ wrappedMint: Address;
8
+ wrappedMintAuthority: Address;
9
+ transferAuthority: Address | TransactionSigner;
10
+ unwrappedMint: Address;
11
+ recipientWrappedTokenAccount: Address;
12
+ unwrappedTokenProgram: Address;
13
+ multiSigners?: TransactionSigner[];
14
+ }
15
+ export interface MultiSignerWrapIxBuilderArgs extends IxBuilderArgs {
16
+ payer: TransactionSigner;
17
+ blockhash: {
18
+ blockhash: Blockhash;
19
+ lastValidBlockHeight: bigint;
20
+ };
21
+ multiSigners: TransactionSigner[];
22
+ }
23
+ export declare function multisigOfflineSignWrap(args: MultiSignerWrapIxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
24
+ export interface SingleSignerWrapArgs {
25
+ rpc: Rpc<GetAccountInfoApi>;
26
+ payer: TransactionSigner;
27
+ unwrappedTokenAccount: Address;
28
+ wrappedTokenProgram: Address;
29
+ amount: bigint | number;
30
+ transferAuthority?: Address | TransactionSigner;
31
+ unwrappedMint?: Address;
32
+ recipientWrappedTokenAccount?: Address;
33
+ unwrappedTokenProgram?: Address;
34
+ }
35
+ export interface SingleSignerWrapResult {
36
+ ixs: IInstruction[];
37
+ recipientWrappedTokenAccount: Address;
38
+ escrowAccount: Address;
39
+ amount: bigint;
40
+ }
41
+ export declare function singleSignerWrap({ rpc, payer, unwrappedTokenAccount, wrappedTokenProgram, amount, transferAuthority: inputTransferAuthority, unwrappedMint: inputUnwrappedMint, recipientWrappedTokenAccount: inputRecipientTokenAccount, unwrappedTokenProgram: inputUnwrappedTokenProgram, }: SingleSignerWrapArgs): Promise<SingleSignerWrapResult>;
42
+ export {};
package/package.json CHANGED
@@ -1,16 +1,68 @@
1
1
  {
2
2
  "name": "@solana-program/token-wrap",
3
- "version": "0.0.0",
4
- "description": "",
5
- "main": "index.js",
3
+ "version": "2.0.0",
4
+ "description": "Javascript helpers for interacting with the Solana Token Wrap program",
5
+ "author": "Anza Maintainers <maintainers@anza.xyz>",
6
+ "license": "Apache-2.0",
7
+ "sideEffects": false,
8
+ "module": "./dist/src/index.mjs",
9
+ "main": "./dist/src/index.js",
10
+ "types": "./dist/types/index.d.ts",
11
+ "type": "commonjs",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/types/index.d.ts",
15
+ "import": "./dist/src/index.mjs",
16
+ "require": "./dist/src/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "./dist/src",
21
+ "./dist/types"
22
+ ],
6
23
  "publishConfig": {
7
24
  "access": "public",
8
25
  "registry": "https://registry.npmjs.org"
9
26
  },
10
- "keywords": [],
11
- "author": "",
12
- "license": "Apache-2.0",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/solana-program/token-wrap.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/solana-program/token-wrap/issues"
33
+ },
34
+ "peerDependencies": {
35
+ "@solana/kit": "^2.1.1"
36
+ },
37
+ "dependencies": {
38
+ "@solana-program/system": "^0.7.0",
39
+ "@solana-program/token": "^0.5.1",
40
+ "@solana-program/token-2022": "^0.4.1",
41
+ "@solana/accounts": "^2.1.1",
42
+ "@solana/rpc-types": "^2.1.1"
43
+ },
44
+ "devDependencies": {
45
+ "@eslint/js": "^9.28.0",
46
+ "@solana/kit": "^2.1.1",
47
+ "@tsconfig/strictest": "^2.0.5",
48
+ "@types/node": "^22.15.30",
49
+ "eslint": "^9.28.0",
50
+ "eslint-config-prettier": "^10.1.5",
51
+ "prettier": "^3.5.3",
52
+ "tsup": "^8.5.0",
53
+ "tsx": "^4.19.3",
54
+ "typedoc": "^0.28.5",
55
+ "typescript": "^5.8.2",
56
+ "typescript-eslint": "^8.33.1"
57
+ },
13
58
  "scripts": {
14
- "test": "echo \"Error: no test specified\" && exit 1"
59
+ "build": "tsc && tsup",
60
+ "build:docs": "typedoc src/index.ts",
61
+ "lint": "eslint --ext js,ts,tsx src",
62
+ "lint:fix": "eslint --fix --ext js,ts,tsx src",
63
+ "format": "prettier --write .",
64
+ "format:check": "prettier --check .",
65
+ "example:single-signer": "tsx src/examples/single-signer.ts",
66
+ "example:multisig": "tsx src/examples/multisig.ts"
15
67
  }
16
68
  }