@solana-program/token-wrap 1.0.0 → 2.1.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.
- package/dist/src/index.js +172 -112
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +162 -111
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/create-mint.d.ts +5 -10
- package/dist/types/generated/errors/tokenWrap.d.ts +3 -1
- package/dist/types/generated/instructions/closeStuckEscrow.d.ts +63 -0
- package/dist/types/generated/instructions/index.d.ts +1 -0
- package/dist/types/generated/instructions/unwrap.d.ts +4 -4
- package/dist/types/generated/instructions/wrap.d.ts +2 -2
- package/dist/types/generated/programs/tokenWrap.d.ts +6 -3
- package/dist/types/index.d.ts +4 -4
- package/dist/types/unwrap.d.ts +9 -15
- package/dist/types/utilities.d.ts +16 -29
- package/dist/types/wrap.d.ts +11 -17
- package/package.json +15 -14
|
@@ -0,0 +1,63 @@
|
|
|
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 IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const CLOSE_STUCK_ESCROW_DISCRIMINATOR = 3;
|
|
11
|
+
export declare function getCloseStuckEscrowDiscriminatorBytes(): import("@solana/kit").ReadonlyUint8Array;
|
|
12
|
+
export type CloseStuckEscrowInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountEscrow extends string | IAccountMeta<string> = string, TAccountDestination extends string | IAccountMeta<string> = string, TAccountUnwrappedMint extends string | IAccountMeta<string> = string, TAccountWrappedMint extends string | IAccountMeta<string> = string, TAccountWrappedMintAuthority extends string | IAccountMeta<string> = string, TAccountToken2022Program extends string | IAccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountEscrow extends string ? WritableAccount<TAccountEscrow> : TAccountEscrow,
|
|
14
|
+
TAccountDestination extends string ? WritableAccount<TAccountDestination> : TAccountDestination,
|
|
15
|
+
TAccountUnwrappedMint extends string ? ReadonlyAccount<TAccountUnwrappedMint> : TAccountUnwrappedMint,
|
|
16
|
+
TAccountWrappedMint extends string ? ReadonlyAccount<TAccountWrappedMint> : TAccountWrappedMint,
|
|
17
|
+
TAccountWrappedMintAuthority extends string ? ReadonlyAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
|
|
18
|
+
TAccountToken2022Program extends string ? ReadonlyAccount<TAccountToken2022Program> : TAccountToken2022Program,
|
|
19
|
+
...TRemainingAccounts
|
|
20
|
+
]>;
|
|
21
|
+
export type CloseStuckEscrowInstructionData = {
|
|
22
|
+
discriminator: number;
|
|
23
|
+
};
|
|
24
|
+
export type CloseStuckEscrowInstructionDataArgs = {};
|
|
25
|
+
export declare function getCloseStuckEscrowInstructionDataEncoder(): Encoder<CloseStuckEscrowInstructionDataArgs>;
|
|
26
|
+
export declare function getCloseStuckEscrowInstructionDataDecoder(): Decoder<CloseStuckEscrowInstructionData>;
|
|
27
|
+
export declare function getCloseStuckEscrowInstructionDataCodec(): Codec<CloseStuckEscrowInstructionDataArgs, CloseStuckEscrowInstructionData>;
|
|
28
|
+
export type CloseStuckEscrowInput<TAccountEscrow extends string = string, TAccountDestination extends string = string, TAccountUnwrappedMint extends string = string, TAccountWrappedMint extends string = string, TAccountWrappedMintAuthority extends string = string, TAccountToken2022Program extends string = string> = {
|
|
29
|
+
/** Escrow account to close (ATA) */
|
|
30
|
+
escrow: Address<TAccountEscrow>;
|
|
31
|
+
/** Destination for lamports from closed account */
|
|
32
|
+
destination: Address<TAccountDestination>;
|
|
33
|
+
/** Unwrapped mint */
|
|
34
|
+
unwrappedMint: Address<TAccountUnwrappedMint>;
|
|
35
|
+
/** Wrapped mint */
|
|
36
|
+
wrappedMint: Address<TAccountWrappedMint>;
|
|
37
|
+
/** Wrapped mint authority (PDA) */
|
|
38
|
+
wrappedMintAuthority: Address<TAccountWrappedMintAuthority>;
|
|
39
|
+
/** Token-2022 program */
|
|
40
|
+
token2022Program?: Address<TAccountToken2022Program>;
|
|
41
|
+
};
|
|
42
|
+
export declare function getCloseStuckEscrowInstruction<TAccountEscrow extends string, TAccountDestination extends string, TAccountUnwrappedMint extends string, TAccountWrappedMint extends string, TAccountWrappedMintAuthority extends string, TAccountToken2022Program extends string, TProgramAddress extends Address = typeof TOKEN_WRAP_PROGRAM_ADDRESS>(input: CloseStuckEscrowInput<TAccountEscrow, TAccountDestination, TAccountUnwrappedMint, TAccountWrappedMint, TAccountWrappedMintAuthority, TAccountToken2022Program>, config?: {
|
|
43
|
+
programAddress?: TProgramAddress;
|
|
44
|
+
}): CloseStuckEscrowInstruction<TProgramAddress, TAccountEscrow, TAccountDestination, TAccountUnwrappedMint, TAccountWrappedMint, TAccountWrappedMintAuthority, TAccountToken2022Program>;
|
|
45
|
+
export type ParsedCloseStuckEscrowInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
46
|
+
programAddress: Address<TProgram>;
|
|
47
|
+
accounts: {
|
|
48
|
+
/** Escrow account to close (ATA) */
|
|
49
|
+
escrow: TAccountMetas[0];
|
|
50
|
+
/** Destination for lamports from closed account */
|
|
51
|
+
destination: TAccountMetas[1];
|
|
52
|
+
/** Unwrapped mint */
|
|
53
|
+
unwrappedMint: TAccountMetas[2];
|
|
54
|
+
/** Wrapped mint */
|
|
55
|
+
wrappedMint: TAccountMetas[3];
|
|
56
|
+
/** Wrapped mint authority (PDA) */
|
|
57
|
+
wrappedMintAuthority: TAccountMetas[4];
|
|
58
|
+
/** Token-2022 program */
|
|
59
|
+
token2022Program?: TAccountMetas[5] | undefined;
|
|
60
|
+
};
|
|
61
|
+
data: CloseStuckEscrowInstructionData;
|
|
62
|
+
};
|
|
63
|
+
export declare function parseCloseStuckEscrowInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedCloseStuckEscrowInstruction<TProgram, TAccountMetas>;
|
|
@@ -35,8 +35,8 @@ export declare function getUnwrapInstructionDataDecoder(): Decoder<UnwrapInstruc
|
|
|
35
35
|
export declare function getUnwrapInstructionDataCodec(): Codec<UnwrapInstructionDataArgs, UnwrapInstructionData>;
|
|
36
36
|
export type UnwrapInput<TAccountUnwrappedEscrow extends string = string, TAccountRecipientUnwrappedToken extends string = string, TAccountWrappedMintAuthority extends string = string, TAccountUnwrappedMint extends string = string, TAccountWrappedTokenProgram extends string = string, TAccountUnwrappedTokenProgram extends string = string, TAccountWrappedTokenAccount extends string = string, TAccountWrappedMint extends string = string, TAccountTransferAuthority extends string = string> = {
|
|
37
37
|
/**
|
|
38
|
-
* The escrow account holding the unwrapped tokens
|
|
39
|
-
* must be
|
|
38
|
+
* The escrow account holding the unwrapped tokens.
|
|
39
|
+
* Address must be ATA: get_escrow_address(unwrapped_mint, unwrapped_token_program, wrapped_token_program)
|
|
40
40
|
*/
|
|
41
41
|
unwrappedEscrow: Address<TAccountUnwrappedEscrow>;
|
|
42
42
|
/** The account to receive the unwrapped tokens. */
|
|
@@ -71,8 +71,8 @@ export type ParsedUnwrapInstruction<TProgram extends string = typeof TOKEN_WRAP_
|
|
|
71
71
|
programAddress: Address<TProgram>;
|
|
72
72
|
accounts: {
|
|
73
73
|
/**
|
|
74
|
-
* The escrow account holding the unwrapped tokens
|
|
75
|
-
* must be
|
|
74
|
+
* The escrow account holding the unwrapped tokens.
|
|
75
|
+
* Address must be ATA: get_escrow_address(unwrapped_mint, unwrapped_token_program, wrapped_token_program)
|
|
76
76
|
*/
|
|
77
77
|
unwrappedEscrow: TAccountMetas[0];
|
|
78
78
|
/** The account to receive the unwrapped tokens. */
|
|
@@ -56,7 +56,7 @@ export type WrapInput<TAccountRecipientWrappedTokenAccount extends string = stri
|
|
|
56
56
|
unwrappedMint: Address<TAccountUnwrappedMint>;
|
|
57
57
|
/**
|
|
58
58
|
* The escrow account that holds the unwrapped tokens.
|
|
59
|
-
* must be
|
|
59
|
+
* Address must be ATA: get_escrow_address(unwrapped_mint, unwrapped_token_program, wrapped_token_program)
|
|
60
60
|
*/
|
|
61
61
|
unwrappedEscrow: Address<TAccountUnwrappedEscrow>;
|
|
62
62
|
/** The authority to transfer the unwrapped tokens. */
|
|
@@ -92,7 +92,7 @@ export type ParsedWrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PR
|
|
|
92
92
|
unwrappedMint: TAccountMetas[6];
|
|
93
93
|
/**
|
|
94
94
|
* The escrow account that holds the unwrapped tokens.
|
|
95
|
-
* must be
|
|
95
|
+
* Address must be ATA: get_escrow_address(unwrapped_mint, unwrapped_token_program, wrapped_token_program)
|
|
96
96
|
*/
|
|
97
97
|
unwrappedEscrow: TAccountMetas[7];
|
|
98
98
|
/** The authority to transfer the unwrapped tokens. */
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
8
|
import { type Address, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
-
import { type ParsedCreateMintInstruction, type ParsedUnwrapInstruction, type ParsedWrapInstruction } from '../instructions';
|
|
9
|
+
import { type ParsedCloseStuckEscrowInstruction, type ParsedCreateMintInstruction, 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
|
|
@@ -14,7 +14,8 @@ export declare enum TokenWrapAccount {
|
|
|
14
14
|
export declare enum TokenWrapInstruction {
|
|
15
15
|
CreateMint = 0,
|
|
16
16
|
Wrap = 1,
|
|
17
|
-
Unwrap = 2
|
|
17
|
+
Unwrap = 2,
|
|
18
|
+
CloseStuckEscrow = 3
|
|
18
19
|
}
|
|
19
20
|
export declare function identifyTokenWrapInstruction(instruction: {
|
|
20
21
|
data: ReadonlyUint8Array;
|
|
@@ -25,4 +26,6 @@ export type ParsedTokenWrapInstruction<TProgram extends string = 'TwRapQCDhWkZRr
|
|
|
25
26
|
instructionType: TokenWrapInstruction.Wrap;
|
|
26
27
|
} & ParsedWrapInstruction<TProgram>) | ({
|
|
27
28
|
instructionType: TokenWrapInstruction.Unwrap;
|
|
28
|
-
} & ParsedUnwrapInstruction<TProgram>)
|
|
29
|
+
} & ParsedUnwrapInstruction<TProgram>) | ({
|
|
30
|
+
instructionType: TokenWrapInstruction.CloseStuckEscrow;
|
|
31
|
+
} & ParsedCloseStuckEscrowInstruction<TProgram>);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './generated';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
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';
|
package/dist/types/unwrap.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { Address, CompilableTransactionMessage, GetAccountInfoApi, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
|
|
1
|
+
import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
|
|
2
2
|
import { Blockhash } from '@solana/rpc-types';
|
|
3
3
|
export interface SingleSignerUnwrapArgs {
|
|
4
4
|
rpc: Rpc<GetAccountInfoApi>;
|
|
5
|
-
blockhash: {
|
|
6
|
-
blockhash: Blockhash;
|
|
7
|
-
lastValidBlockHeight: bigint;
|
|
8
|
-
};
|
|
9
5
|
payer: TransactionSigner;
|
|
10
6
|
wrappedTokenAccount: Address;
|
|
11
|
-
unwrappedEscrow: Address;
|
|
12
7
|
amount: bigint | number;
|
|
13
8
|
recipientUnwrappedToken: Address;
|
|
14
9
|
transferAuthority?: Address | TransactionSigner;
|
|
@@ -17,8 +12,6 @@ export interface SingleSignerUnwrapArgs {
|
|
|
17
12
|
unwrappedTokenProgram?: Address;
|
|
18
13
|
}
|
|
19
14
|
interface UnwrapTxBuilderArgs {
|
|
20
|
-
payer: TransactionSigner;
|
|
21
|
-
unwrappedEscrow: Address;
|
|
22
15
|
wrappedTokenAccount: Address;
|
|
23
16
|
amount: bigint | number;
|
|
24
17
|
wrappedMint: Address;
|
|
@@ -27,15 +20,11 @@ interface UnwrapTxBuilderArgs {
|
|
|
27
20
|
recipientUnwrappedToken: Address;
|
|
28
21
|
unwrappedTokenProgram: Address;
|
|
29
22
|
wrappedTokenProgram: Address;
|
|
30
|
-
blockhash: {
|
|
31
|
-
blockhash: Blockhash;
|
|
32
|
-
lastValidBlockHeight: bigint;
|
|
33
|
-
};
|
|
34
23
|
transferAuthority: Address | TransactionSigner;
|
|
35
24
|
multiSigners?: TransactionSigner[];
|
|
36
25
|
}
|
|
37
26
|
export interface SingleSignerUnwrapResult {
|
|
38
|
-
|
|
27
|
+
ixs: IInstruction[];
|
|
39
28
|
recipientUnwrappedToken: Address;
|
|
40
29
|
amount: bigint;
|
|
41
30
|
}
|
|
@@ -43,9 +32,14 @@ export interface SingleSignerUnwrapResult {
|
|
|
43
32
|
* Creates, signs (single signer or default authority), and sends an unwrap transaction.
|
|
44
33
|
* Derives necessary PDAs and default accounts if not provided.
|
|
45
34
|
*/
|
|
46
|
-
export declare function
|
|
35
|
+
export declare function singleSignerUnwrap({ rpc, payer, wrappedTokenAccount, amount, recipientUnwrappedToken, transferAuthority: inputTransferAuthority, unwrappedMint: inputUnwrappedMint, wrappedTokenProgram: inputWrappedTokenProgram, unwrappedTokenProgram: inputUnwrappedTokenProgram, }: SingleSignerUnwrapArgs): Promise<SingleSignerUnwrapResult>;
|
|
47
36
|
export interface MultiSignerUnWrapTxBuilderArgs extends UnwrapTxBuilderArgs {
|
|
37
|
+
payer: TransactionSigner;
|
|
38
|
+
blockhash: {
|
|
39
|
+
blockhash: Blockhash;
|
|
40
|
+
lastValidBlockHeight: bigint;
|
|
41
|
+
};
|
|
48
42
|
multiSigners: TransactionSigner[];
|
|
49
43
|
}
|
|
50
|
-
export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime
|
|
44
|
+
export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
|
|
51
45
|
export {};
|
|
@@ -1,45 +1,32 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime } from '@solana/kit';
|
|
2
|
+
import { Token } from '@solana-program/token-2022';
|
|
2
3
|
import { Blockhash } from '@solana/rpc-types';
|
|
3
|
-
|
|
4
|
+
import { Account } from '@solana/accounts';
|
|
5
|
+
export declare function createTokenAccount({ rpc, payer, mint, owner, tokenProgram, }: {
|
|
4
6
|
rpc: Rpc<GetMinimumBalanceForRentExemptionApi>;
|
|
5
|
-
blockhash: {
|
|
6
|
-
blockhash: Blockhash;
|
|
7
|
-
lastValidBlockHeight: bigint;
|
|
8
|
-
};
|
|
9
7
|
payer: KeyPairSigner;
|
|
10
8
|
mint: Address;
|
|
11
9
|
owner: Address;
|
|
12
10
|
tokenProgram: Address;
|
|
13
11
|
}): Promise<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
version: 0;
|
|
17
|
-
}>, "feePayer">;
|
|
18
|
-
keyPair: Readonly<{
|
|
19
|
-
address: Address<string>;
|
|
20
|
-
signMessages(messages: readonly import("@solana/kit").SignableMessage[], config?: import("@solana/kit").MessagePartialSignerConfig): Promise<readonly import("@solana/kit").SignatureDictionary[]>;
|
|
21
|
-
}> & Readonly<{
|
|
22
|
-
address: Address<string>;
|
|
23
|
-
signTransactions(transactions: readonly Transaction[], config?: import("@solana/kit").TransactionPartialSignerConfig): Promise<readonly import("@solana/kit").SignatureDictionary[]>;
|
|
24
|
-
}> & {
|
|
25
|
-
keyPair: CryptoKeyPair;
|
|
26
|
-
};
|
|
12
|
+
ixs: IInstruction[];
|
|
13
|
+
keyPair: KeyPairSigner;
|
|
27
14
|
}>;
|
|
28
|
-
export interface
|
|
15
|
+
export interface CreateEscrowAccountArgs {
|
|
29
16
|
rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
|
|
30
|
-
blockhash: {
|
|
31
|
-
blockhash: Blockhash;
|
|
32
|
-
lastValidBlockHeight: bigint;
|
|
33
|
-
};
|
|
34
17
|
payer: KeyPairSigner;
|
|
35
18
|
unwrappedMint: Address;
|
|
36
19
|
wrappedTokenProgram: Address;
|
|
37
20
|
}
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
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>;
|
|
43
30
|
export declare function getOwnerFromAccount(rpc: Rpc<GetAccountInfoApi>, accountAddress: Address): Promise<Address>;
|
|
44
31
|
export declare function getMintFromTokenAccount(rpc: Rpc<GetAccountInfoApi>, tokenAccountAddress: Address): Promise<Address>;
|
|
45
32
|
export interface MultiSigCombineArgs {
|
package/dist/types/wrap.d.ts
CHANGED
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import { Address, CompilableTransactionMessage, GetAccountInfoApi, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
|
|
1
|
+
import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
|
|
2
2
|
import { Blockhash } from '@solana/rpc-types';
|
|
3
|
-
interface
|
|
4
|
-
payer: TransactionSigner;
|
|
3
|
+
interface IxBuilderArgs {
|
|
5
4
|
unwrappedTokenAccount: Address;
|
|
6
|
-
escrowAccount: Address;
|
|
7
5
|
wrappedTokenProgram: Address;
|
|
8
6
|
amount: bigint | number;
|
|
9
7
|
wrappedMint: Address;
|
|
10
8
|
wrappedMintAuthority: Address;
|
|
11
|
-
blockhash: {
|
|
12
|
-
blockhash: Blockhash;
|
|
13
|
-
lastValidBlockHeight: bigint;
|
|
14
|
-
};
|
|
15
9
|
transferAuthority: Address | TransactionSigner;
|
|
16
10
|
unwrappedMint: Address;
|
|
17
11
|
recipientWrappedTokenAccount: Address;
|
|
18
12
|
unwrappedTokenProgram: Address;
|
|
19
13
|
multiSigners?: TransactionSigner[];
|
|
20
14
|
}
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
export declare function multisigOfflineSignWrapTx(args: MultiSignerWrapTxBuilderArgs): CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime;
|
|
25
|
-
export interface SingleSignerWrapArgs {
|
|
26
|
-
rpc: Rpc<GetAccountInfoApi>;
|
|
15
|
+
export interface MultiSignerWrapIxBuilderArgs extends IxBuilderArgs {
|
|
16
|
+
payer: TransactionSigner;
|
|
27
17
|
blockhash: {
|
|
28
18
|
blockhash: Blockhash;
|
|
29
19
|
lastValidBlockHeight: bigint;
|
|
30
20
|
};
|
|
21
|
+
multiSigners: TransactionSigner[];
|
|
22
|
+
}
|
|
23
|
+
export declare function multisigOfflineSignWrap(args: MultiSignerWrapIxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
|
|
24
|
+
export interface SingleSignerWrapArgs {
|
|
25
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
31
26
|
payer: TransactionSigner;
|
|
32
27
|
unwrappedTokenAccount: Address;
|
|
33
|
-
escrowAccount: Address;
|
|
34
28
|
wrappedTokenProgram: Address;
|
|
35
29
|
amount: bigint | number;
|
|
36
30
|
transferAuthority?: Address | TransactionSigner;
|
|
@@ -39,10 +33,10 @@ export interface SingleSignerWrapArgs {
|
|
|
39
33
|
unwrappedTokenProgram?: Address;
|
|
40
34
|
}
|
|
41
35
|
export interface SingleSignerWrapResult {
|
|
42
|
-
|
|
36
|
+
ixs: IInstruction[];
|
|
43
37
|
recipientWrappedTokenAccount: Address;
|
|
44
38
|
escrowAccount: Address;
|
|
45
39
|
amount: bigint;
|
|
46
40
|
}
|
|
47
|
-
export declare function
|
|
41
|
+
export declare function singleSignerWrap({ rpc, payer, unwrappedTokenAccount, wrappedTokenProgram, amount, transferAuthority: inputTransferAuthority, unwrappedMint: inputUnwrappedMint, recipientWrappedTokenAccount: inputRecipientTokenAccount, unwrappedTokenProgram: inputUnwrappedTokenProgram, }: SingleSignerWrapArgs): Promise<SingleSignerWrapResult>;
|
|
48
42
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-program/token-wrap",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.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,27 +32,28 @@
|
|
|
32
32
|
"url": "https://github.com/solana-program/token-wrap/issues"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@solana/kit": "^2.1.
|
|
35
|
+
"@solana/kit": "^2.1.1"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@solana-program/system": "^0.7.0",
|
|
39
39
|
"@solana-program/token": "^0.5.1",
|
|
40
|
-
"@solana-program/token-2022": "^0.4.
|
|
41
|
-
"@solana/
|
|
40
|
+
"@solana-program/token-2022": "^0.4.2",
|
|
41
|
+
"@solana/accounts": "^2.1.1",
|
|
42
|
+
"@solana/rpc-types": "^2.1.1"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@eslint/js": "^9.
|
|
45
|
-
"@solana/kit": "^2.1.
|
|
45
|
+
"@eslint/js": "^9.29.0",
|
|
46
|
+
"@solana/kit": "^2.1.1",
|
|
46
47
|
"@tsconfig/strictest": "^2.0.5",
|
|
47
|
-
"@types/node": "^
|
|
48
|
-
"eslint": "^9.
|
|
49
|
-
"eslint-config-prettier": "^10.1.
|
|
50
|
-
"prettier": "^3.
|
|
51
|
-
"tsup": "^8.
|
|
52
|
-
"tsx": "^4.
|
|
53
|
-
"typedoc": "^0.28.
|
|
48
|
+
"@types/node": "^24.0.4",
|
|
49
|
+
"eslint": "^9.29.0",
|
|
50
|
+
"eslint-config-prettier": "^10.1.5",
|
|
51
|
+
"prettier": "^3.6.1",
|
|
52
|
+
"tsup": "^8.5.0",
|
|
53
|
+
"tsx": "^4.20.3",
|
|
54
|
+
"typedoc": "^0.28.5",
|
|
54
55
|
"typescript": "^5.8.2",
|
|
55
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"typescript-eslint": "^8.35.0"
|
|
56
57
|
},
|
|
57
58
|
"scripts": {
|
|
58
59
|
"build": "tsc && tsup",
|