@solana-program/token-wrap 2.3.0 → 2.5.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/package.json +20 -19
- package/src/create-mint.ts +125 -0
- package/src/examples/multisig.ts +295 -0
- package/src/examples/single-signer.ts +175 -0
- package/src/examples/sync-spl-to-token2022.ts +96 -0
- package/src/examples/sync-token2022-to-spl.ts +101 -0
- package/src/generated/accounts/backpointer.ts +125 -0
- package/{dist/types/generated/accounts/index.d.ts → src/generated/accounts/index.ts} +1 -0
- package/{dist/types/generated/errors/index.d.ts → src/generated/errors/index.ts} +1 -0
- package/src/generated/errors/tokenWrap.ts +89 -0
- package/{dist/types/generated/index.d.ts → src/generated/index.ts} +1 -0
- package/src/generated/instructions/closeStuckEscrow.ts +235 -0
- package/src/generated/instructions/createMint.ts +250 -0
- package/{dist/types/generated/instructions/index.d.ts → src/generated/instructions/index.ts} +1 -0
- package/src/generated/instructions/syncMetadataToSplToken.ts +305 -0
- package/src/generated/instructions/syncMetadataToToken2022.ts +253 -0
- package/src/generated/instructions/unwrap.ts +326 -0
- package/src/generated/instructions/wrap.ts +326 -0
- package/src/generated/pdas/backpointer.ts +32 -0
- package/{dist/types/generated/pdas/index.d.ts → src/generated/pdas/index.ts} +1 -0
- package/src/generated/pdas/wrappedMint.ts +37 -0
- package/src/generated/pdas/wrappedMintAuthority.ts +32 -0
- package/{dist/types/generated/programs/index.d.ts → src/generated/programs/index.ts} +1 -0
- package/src/generated/programs/tokenWrap.ts +228 -0
- package/src/global.d.ts +8 -0
- package/src/index.ts +23 -0
- package/src/unwrap.ts +208 -0
- package/src/utilities.ts +234 -0
- package/src/wrap.ts +211 -0
- package/dist/src/index.js +0 -1292
- package/dist/src/index.js.map +0 -1
- package/dist/src/index.mjs +0 -1206
- package/dist/src/index.mjs.map +0 -1
- package/dist/types/create-mint.d.ts +0 -16
- package/dist/types/examples/multisig.d.ts +0 -1
- package/dist/types/examples/single-signer.d.ts +0 -1
- package/dist/types/examples/sync-spl-to-token2022.d.ts +0 -1
- package/dist/types/examples/sync-token2022-to-spl.d.ts +0 -1
- package/dist/types/generated/accounts/backpointer.d.ts +0 -29
- package/dist/types/generated/errors/tokenWrap.d.ts +0 -35
- package/dist/types/generated/instructions/closeStuckEscrow.d.ts +0 -63
- package/dist/types/generated/instructions/createMint.d.ts +0 -76
- package/dist/types/generated/instructions/syncMetadataToSplToken.d.ts +0 -92
- package/dist/types/generated/instructions/syncMetadataToToken2022.d.ts +0 -75
- package/dist/types/generated/instructions/unwrap.d.ts +0 -103
- package/dist/types/generated/instructions/wrap.d.ts +0 -103
- package/dist/types/generated/pdas/backpointer.d.ts +0 -14
- package/dist/types/generated/pdas/wrappedMint.d.ts +0 -15
- package/dist/types/generated/pdas/wrappedMintAuthority.d.ts +0 -14
- package/dist/types/generated/programs/tokenWrap.d.ts +0 -37
- package/dist/types/generated/shared/index.d.ts +0 -49
- package/dist/types/index.d.ts +0 -5
- package/dist/types/unwrap.d.ts +0 -45
- package/dist/types/utilities.d.ts +0 -39
- package/dist/types/wrap.d.ts +0 -42
|
@@ -1,92 +0,0 @@
|
|
|
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 AccountMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount } from '@solana/kit';
|
|
9
|
-
import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
-
export declare const SYNC_METADATA_TO_SPL_TOKEN_DISCRIMINATOR = 5;
|
|
11
|
-
export declare function getSyncMetadataToSplTokenDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
-
export type SyncMetadataToSplTokenInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetaplexMetadata extends string | AccountMeta<string> = string, TAccountWrappedMintAuthority extends string | AccountMeta<string> = string, TAccountWrappedMint extends string | AccountMeta<string> = string, TAccountUnwrappedMint extends string | AccountMeta<string> = string, TAccountMetaplexProgram extends string | AccountMeta<string> = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountRentSysvar extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111', TAccountSourceMetadata extends string | AccountMeta<string> = string, TAccountOwnerProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
-
TAccountMetaplexMetadata extends string ? WritableAccount<TAccountMetaplexMetadata> : TAccountMetaplexMetadata,
|
|
14
|
-
TAccountWrappedMintAuthority extends string ? WritableAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
|
|
15
|
-
TAccountWrappedMint extends string ? ReadonlyAccount<TAccountWrappedMint> : TAccountWrappedMint,
|
|
16
|
-
TAccountUnwrappedMint extends string ? ReadonlyAccount<TAccountUnwrappedMint> : TAccountUnwrappedMint,
|
|
17
|
-
TAccountMetaplexProgram extends string ? ReadonlyAccount<TAccountMetaplexProgram> : TAccountMetaplexProgram,
|
|
18
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
19
|
-
TAccountRentSysvar extends string ? ReadonlyAccount<TAccountRentSysvar> : TAccountRentSysvar,
|
|
20
|
-
TAccountSourceMetadata extends string ? ReadonlyAccount<TAccountSourceMetadata> : TAccountSourceMetadata,
|
|
21
|
-
TAccountOwnerProgram extends string ? ReadonlyAccount<TAccountOwnerProgram> : TAccountOwnerProgram,
|
|
22
|
-
...TRemainingAccounts
|
|
23
|
-
]>;
|
|
24
|
-
export type SyncMetadataToSplTokenInstructionData = {
|
|
25
|
-
discriminator: number;
|
|
26
|
-
};
|
|
27
|
-
export type SyncMetadataToSplTokenInstructionDataArgs = {};
|
|
28
|
-
export declare function getSyncMetadataToSplTokenInstructionDataEncoder(): FixedSizeEncoder<SyncMetadataToSplTokenInstructionDataArgs>;
|
|
29
|
-
export declare function getSyncMetadataToSplTokenInstructionDataDecoder(): FixedSizeDecoder<SyncMetadataToSplTokenInstructionData>;
|
|
30
|
-
export declare function getSyncMetadataToSplTokenInstructionDataCodec(): FixedSizeCodec<SyncMetadataToSplTokenInstructionDataArgs, SyncMetadataToSplTokenInstructionData>;
|
|
31
|
-
export type SyncMetadataToSplTokenInput<TAccountMetaplexMetadata extends string = string, TAccountWrappedMintAuthority extends string = string, TAccountWrappedMint extends string = string, TAccountUnwrappedMint extends string = string, TAccountMetaplexProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRentSysvar extends string = string, TAccountSourceMetadata extends string = string, TAccountOwnerProgram extends string = string> = {
|
|
32
|
-
/** `Metaplex` metadata account */
|
|
33
|
-
metaplexMetadata: Address<TAccountMetaplexMetadata>;
|
|
34
|
-
/** Wrapped mint authority (PDA) */
|
|
35
|
-
wrappedMintAuthority: Address<TAccountWrappedMintAuthority>;
|
|
36
|
-
/** Wrapped SPL Token mint */
|
|
37
|
-
wrappedMint: Address<TAccountWrappedMint>;
|
|
38
|
-
/** Unwrapped mint */
|
|
39
|
-
unwrappedMint: Address<TAccountUnwrappedMint>;
|
|
40
|
-
/** `Metaplex` Token Metadata Program */
|
|
41
|
-
metaplexProgram?: Address<TAccountMetaplexProgram>;
|
|
42
|
-
/** System program */
|
|
43
|
-
systemProgram?: Address<TAccountSystemProgram>;
|
|
44
|
-
/** Rent sysvar */
|
|
45
|
-
rentSysvar?: Address<TAccountRentSysvar>;
|
|
46
|
-
/**
|
|
47
|
-
* Source metadata account. Required if unwrapped mint
|
|
48
|
-
* is an SPL-Token or, if a Token-2022, its metadata pointer indicates
|
|
49
|
-
* an external account.
|
|
50
|
-
*/
|
|
51
|
-
sourceMetadata?: Address<TAccountSourceMetadata>;
|
|
52
|
-
/**
|
|
53
|
-
* Owner program. Required when metadata account is
|
|
54
|
-
* owned by a third-party program.
|
|
55
|
-
*/
|
|
56
|
-
ownerProgram?: Address<TAccountOwnerProgram>;
|
|
57
|
-
};
|
|
58
|
-
export declare function getSyncMetadataToSplTokenInstruction<TAccountMetaplexMetadata extends string, TAccountWrappedMintAuthority extends string, TAccountWrappedMint extends string, TAccountUnwrappedMint extends string, TAccountMetaplexProgram extends string, TAccountSystemProgram extends string, TAccountRentSysvar extends string, TAccountSourceMetadata extends string, TAccountOwnerProgram extends string, TProgramAddress extends Address = typeof TOKEN_WRAP_PROGRAM_ADDRESS>(input: SyncMetadataToSplTokenInput<TAccountMetaplexMetadata, TAccountWrappedMintAuthority, TAccountWrappedMint, TAccountUnwrappedMint, TAccountMetaplexProgram, TAccountSystemProgram, TAccountRentSysvar, TAccountSourceMetadata, TAccountOwnerProgram>, config?: {
|
|
59
|
-
programAddress?: TProgramAddress;
|
|
60
|
-
}): SyncMetadataToSplTokenInstruction<TProgramAddress, TAccountMetaplexMetadata, TAccountWrappedMintAuthority, TAccountWrappedMint, TAccountUnwrappedMint, TAccountMetaplexProgram, TAccountSystemProgram, TAccountRentSysvar, TAccountSourceMetadata, TAccountOwnerProgram>;
|
|
61
|
-
export type ParsedSyncMetadataToSplTokenInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
62
|
-
programAddress: Address<TProgram>;
|
|
63
|
-
accounts: {
|
|
64
|
-
/** `Metaplex` metadata account */
|
|
65
|
-
metaplexMetadata: TAccountMetas[0];
|
|
66
|
-
/** Wrapped mint authority (PDA) */
|
|
67
|
-
wrappedMintAuthority: TAccountMetas[1];
|
|
68
|
-
/** Wrapped SPL Token mint */
|
|
69
|
-
wrappedMint: TAccountMetas[2];
|
|
70
|
-
/** Unwrapped mint */
|
|
71
|
-
unwrappedMint: TAccountMetas[3];
|
|
72
|
-
/** `Metaplex` Token Metadata Program */
|
|
73
|
-
metaplexProgram: TAccountMetas[4];
|
|
74
|
-
/** System program */
|
|
75
|
-
systemProgram: TAccountMetas[5];
|
|
76
|
-
/** Rent sysvar */
|
|
77
|
-
rentSysvar: TAccountMetas[6];
|
|
78
|
-
/**
|
|
79
|
-
* Source metadata account. Required if unwrapped mint
|
|
80
|
-
* is an SPL-Token or, if a Token-2022, its metadata pointer indicates
|
|
81
|
-
* an external account.
|
|
82
|
-
*/
|
|
83
|
-
sourceMetadata?: TAccountMetas[7] | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* Owner program. Required when metadata account is
|
|
86
|
-
* owned by a third-party program.
|
|
87
|
-
*/
|
|
88
|
-
ownerProgram?: TAccountMetas[8] | undefined;
|
|
89
|
-
};
|
|
90
|
-
data: SyncMetadataToSplTokenInstructionData;
|
|
91
|
-
};
|
|
92
|
-
export declare function parseSyncMetadataToSplTokenInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSyncMetadataToSplTokenInstruction<TProgram, TAccountMetas>;
|
|
@@ -1,75 +0,0 @@
|
|
|
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 AccountMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount } from '@solana/kit';
|
|
9
|
-
import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
-
export declare const SYNC_METADATA_TO_TOKEN2022_DISCRIMINATOR = 4;
|
|
11
|
-
export declare function getSyncMetadataToToken2022DiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
-
export type SyncMetadataToToken2022Instruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountWrappedMint extends string | AccountMeta<string> = string, TAccountWrappedMintAuthority extends string | AccountMeta<string> = string, TAccountUnwrappedMint extends string | AccountMeta<string> = string, TAccountToken2022Program extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TAccountSourceMetadata extends string | AccountMeta<string> = string, TAccountOwnerProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
-
TAccountWrappedMint extends string ? WritableAccount<TAccountWrappedMint> : TAccountWrappedMint,
|
|
14
|
-
TAccountWrappedMintAuthority extends string ? ReadonlyAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
|
|
15
|
-
TAccountUnwrappedMint extends string ? ReadonlyAccount<TAccountUnwrappedMint> : TAccountUnwrappedMint,
|
|
16
|
-
TAccountToken2022Program extends string ? ReadonlyAccount<TAccountToken2022Program> : TAccountToken2022Program,
|
|
17
|
-
TAccountSourceMetadata extends string ? ReadonlyAccount<TAccountSourceMetadata> : TAccountSourceMetadata,
|
|
18
|
-
TAccountOwnerProgram extends string ? ReadonlyAccount<TAccountOwnerProgram> : TAccountOwnerProgram,
|
|
19
|
-
...TRemainingAccounts
|
|
20
|
-
]>;
|
|
21
|
-
export type SyncMetadataToToken2022InstructionData = {
|
|
22
|
-
discriminator: number;
|
|
23
|
-
};
|
|
24
|
-
export type SyncMetadataToToken2022InstructionDataArgs = {};
|
|
25
|
-
export declare function getSyncMetadataToToken2022InstructionDataEncoder(): FixedSizeEncoder<SyncMetadataToToken2022InstructionDataArgs>;
|
|
26
|
-
export declare function getSyncMetadataToToken2022InstructionDataDecoder(): FixedSizeDecoder<SyncMetadataToToken2022InstructionData>;
|
|
27
|
-
export declare function getSyncMetadataToToken2022InstructionDataCodec(): FixedSizeCodec<SyncMetadataToToken2022InstructionDataArgs, SyncMetadataToToken2022InstructionData>;
|
|
28
|
-
export type SyncMetadataToToken2022Input<TAccountWrappedMint extends string = string, TAccountWrappedMintAuthority extends string = string, TAccountUnwrappedMint extends string = string, TAccountToken2022Program extends string = string, TAccountSourceMetadata extends string = string, TAccountOwnerProgram extends string = string> = {
|
|
29
|
-
/** Wrapped mint */
|
|
30
|
-
wrappedMint: Address<TAccountWrappedMint>;
|
|
31
|
-
/** Wrapped mint authority PDA */
|
|
32
|
-
wrappedMintAuthority: Address<TAccountWrappedMintAuthority>;
|
|
33
|
-
/** Unwrapped mint */
|
|
34
|
-
unwrappedMint: Address<TAccountUnwrappedMint>;
|
|
35
|
-
/** Token-2022 program */
|
|
36
|
-
token2022Program?: Address<TAccountToken2022Program>;
|
|
37
|
-
/**
|
|
38
|
-
* Source metadata account. Required if metadata pointer
|
|
39
|
-
* indicates external account.
|
|
40
|
-
*/
|
|
41
|
-
sourceMetadata?: Address<TAccountSourceMetadata>;
|
|
42
|
-
/**
|
|
43
|
-
* Owner program. Required when metadata account is
|
|
44
|
-
* owned by a third-party program.
|
|
45
|
-
*/
|
|
46
|
-
ownerProgram?: Address<TAccountOwnerProgram>;
|
|
47
|
-
};
|
|
48
|
-
export declare function getSyncMetadataToToken2022Instruction<TAccountWrappedMint extends string, TAccountWrappedMintAuthority extends string, TAccountUnwrappedMint extends string, TAccountToken2022Program extends string, TAccountSourceMetadata extends string, TAccountOwnerProgram extends string, TProgramAddress extends Address = typeof TOKEN_WRAP_PROGRAM_ADDRESS>(input: SyncMetadataToToken2022Input<TAccountWrappedMint, TAccountWrappedMintAuthority, TAccountUnwrappedMint, TAccountToken2022Program, TAccountSourceMetadata, TAccountOwnerProgram>, config?: {
|
|
49
|
-
programAddress?: TProgramAddress;
|
|
50
|
-
}): SyncMetadataToToken2022Instruction<TProgramAddress, TAccountWrappedMint, TAccountWrappedMintAuthority, TAccountUnwrappedMint, TAccountToken2022Program, TAccountSourceMetadata, TAccountOwnerProgram>;
|
|
51
|
-
export type ParsedSyncMetadataToToken2022Instruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
52
|
-
programAddress: Address<TProgram>;
|
|
53
|
-
accounts: {
|
|
54
|
-
/** Wrapped mint */
|
|
55
|
-
wrappedMint: TAccountMetas[0];
|
|
56
|
-
/** Wrapped mint authority PDA */
|
|
57
|
-
wrappedMintAuthority: TAccountMetas[1];
|
|
58
|
-
/** Unwrapped mint */
|
|
59
|
-
unwrappedMint: TAccountMetas[2];
|
|
60
|
-
/** Token-2022 program */
|
|
61
|
-
token2022Program: TAccountMetas[3];
|
|
62
|
-
/**
|
|
63
|
-
* Source metadata account. Required if metadata pointer
|
|
64
|
-
* indicates external account.
|
|
65
|
-
*/
|
|
66
|
-
sourceMetadata?: TAccountMetas[4] | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Owner program. Required when metadata account is
|
|
69
|
-
* owned by a third-party program.
|
|
70
|
-
*/
|
|
71
|
-
ownerProgram?: TAccountMetas[5] | undefined;
|
|
72
|
-
};
|
|
73
|
-
data: SyncMetadataToToken2022InstructionData;
|
|
74
|
-
};
|
|
75
|
-
export declare function parseSyncMetadataToToken2022Instruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSyncMetadataToToken2022Instruction<TProgram, TAccountMetas>;
|
|
@@ -1,103 +0,0 @@
|
|
|
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 AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from '@solana/kit';
|
|
9
|
-
import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
-
export declare const UNWRAP_DISCRIMINATOR = 2;
|
|
11
|
-
export declare function getUnwrapDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
-
export type UnwrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountUnwrappedEscrow extends string | AccountMeta<string> = string, TAccountRecipientUnwrappedToken extends string | AccountMeta<string> = string, TAccountWrappedMintAuthority extends string | AccountMeta<string> = string, TAccountUnwrappedMint extends string | AccountMeta<string> = string, TAccountWrappedTokenProgram extends string | AccountMeta<string> = string, TAccountUnwrappedTokenProgram extends string | AccountMeta<string> = string, TAccountWrappedTokenAccount extends string | AccountMeta<string> = string, TAccountWrappedMint extends string | AccountMeta<string> = string, TAccountTransferAuthority extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
-
TAccountUnwrappedEscrow extends string ? WritableAccount<TAccountUnwrappedEscrow> : TAccountUnwrappedEscrow,
|
|
14
|
-
TAccountRecipientUnwrappedToken extends string ? WritableAccount<TAccountRecipientUnwrappedToken> : TAccountRecipientUnwrappedToken,
|
|
15
|
-
TAccountWrappedMintAuthority extends string ? ReadonlyAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
|
|
16
|
-
TAccountUnwrappedMint extends string ? ReadonlyAccount<TAccountUnwrappedMint> : TAccountUnwrappedMint,
|
|
17
|
-
TAccountWrappedTokenProgram extends string ? ReadonlyAccount<TAccountWrappedTokenProgram> : TAccountWrappedTokenProgram,
|
|
18
|
-
TAccountUnwrappedTokenProgram extends string ? ReadonlyAccount<TAccountUnwrappedTokenProgram> : TAccountUnwrappedTokenProgram,
|
|
19
|
-
TAccountWrappedTokenAccount extends string ? WritableAccount<TAccountWrappedTokenAccount> : TAccountWrappedTokenAccount,
|
|
20
|
-
TAccountWrappedMint extends string ? WritableAccount<TAccountWrappedMint> : TAccountWrappedMint,
|
|
21
|
-
TAccountTransferAuthority extends string ? ReadonlyAccount<TAccountTransferAuthority> : TAccountTransferAuthority,
|
|
22
|
-
...TRemainingAccounts
|
|
23
|
-
]>;
|
|
24
|
-
export type UnwrapInstructionData = {
|
|
25
|
-
discriminator: number;
|
|
26
|
-
/** The amount of tokens to unwrap. */
|
|
27
|
-
amount: bigint;
|
|
28
|
-
};
|
|
29
|
-
export type UnwrapInstructionDataArgs = {
|
|
30
|
-
/** The amount of tokens to unwrap. */
|
|
31
|
-
amount: number | bigint;
|
|
32
|
-
};
|
|
33
|
-
export declare function getUnwrapInstructionDataEncoder(): FixedSizeEncoder<UnwrapInstructionDataArgs>;
|
|
34
|
-
export declare function getUnwrapInstructionDataDecoder(): FixedSizeDecoder<UnwrapInstructionData>;
|
|
35
|
-
export declare function getUnwrapInstructionDataCodec(): FixedSizeCodec<UnwrapInstructionDataArgs, UnwrapInstructionData>;
|
|
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
|
-
/**
|
|
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
|
-
*/
|
|
41
|
-
unwrappedEscrow: Address<TAccountUnwrappedEscrow>;
|
|
42
|
-
/** The account to receive the unwrapped tokens. */
|
|
43
|
-
recipientUnwrappedToken: Address<TAccountRecipientUnwrappedToken>;
|
|
44
|
-
/**
|
|
45
|
-
* The PDA authority of the wrapped mint,
|
|
46
|
-
* address must be: `get_wrapped_mint_authority(wrapped_mint)`
|
|
47
|
-
*/
|
|
48
|
-
wrappedMintAuthority: Address<TAccountWrappedMintAuthority>;
|
|
49
|
-
/** The mint of the unwrapped tokens */
|
|
50
|
-
unwrappedMint: Address<TAccountUnwrappedMint>;
|
|
51
|
-
/** The token program of the wrapped tokens */
|
|
52
|
-
wrappedTokenProgram: Address<TAccountWrappedTokenProgram>;
|
|
53
|
-
/** The token program of the unwrapped tokens */
|
|
54
|
-
unwrappedTokenProgram: Address<TAccountUnwrappedTokenProgram>;
|
|
55
|
-
/** The source token account for the wrapped tokens */
|
|
56
|
-
wrappedTokenAccount: Address<TAccountWrappedTokenAccount>;
|
|
57
|
-
/**
|
|
58
|
-
* The wrapped mint account, address must be:
|
|
59
|
-
* `get_wrapped_mint_address(unwrapped_mint_address, wrapped_token_program_id)`
|
|
60
|
-
*/
|
|
61
|
-
wrappedMint: Address<TAccountWrappedMint>;
|
|
62
|
-
/** The authority to burn the wrapped tokens. */
|
|
63
|
-
transferAuthority: Address<TAccountTransferAuthority> | TransactionSigner<TAccountTransferAuthority>;
|
|
64
|
-
amount: UnwrapInstructionDataArgs['amount'];
|
|
65
|
-
multiSigners?: Array<TransactionSigner>;
|
|
66
|
-
};
|
|
67
|
-
export declare function getUnwrapInstruction<TAccountUnwrappedEscrow extends string, TAccountRecipientUnwrappedToken extends string, TAccountWrappedMintAuthority extends string, TAccountUnwrappedMint extends string, TAccountWrappedTokenProgram extends string, TAccountUnwrappedTokenProgram extends string, TAccountWrappedTokenAccount extends string, TAccountWrappedMint extends string, TAccountTransferAuthority extends string, TProgramAddress extends Address = typeof TOKEN_WRAP_PROGRAM_ADDRESS>(input: UnwrapInput<TAccountUnwrappedEscrow, TAccountRecipientUnwrappedToken, TAccountWrappedMintAuthority, TAccountUnwrappedMint, TAccountWrappedTokenProgram, TAccountUnwrappedTokenProgram, TAccountWrappedTokenAccount, TAccountWrappedMint, TAccountTransferAuthority>, config?: {
|
|
68
|
-
programAddress?: TProgramAddress;
|
|
69
|
-
}): UnwrapInstruction<TProgramAddress, TAccountUnwrappedEscrow, TAccountRecipientUnwrappedToken, TAccountWrappedMintAuthority, TAccountUnwrappedMint, TAccountWrappedTokenProgram, TAccountUnwrappedTokenProgram, TAccountWrappedTokenAccount, TAccountWrappedMint, (typeof input)['transferAuthority'] extends TransactionSigner<TAccountTransferAuthority> ? ReadonlySignerAccount<TAccountTransferAuthority> & AccountSignerMeta<TAccountTransferAuthority> : TAccountTransferAuthority>;
|
|
70
|
-
export type ParsedUnwrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
71
|
-
programAddress: Address<TProgram>;
|
|
72
|
-
accounts: {
|
|
73
|
-
/**
|
|
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
|
-
*/
|
|
77
|
-
unwrappedEscrow: TAccountMetas[0];
|
|
78
|
-
/** The account to receive the unwrapped tokens. */
|
|
79
|
-
recipientUnwrappedToken: TAccountMetas[1];
|
|
80
|
-
/**
|
|
81
|
-
* The PDA authority of the wrapped mint,
|
|
82
|
-
* address must be: `get_wrapped_mint_authority(wrapped_mint)`
|
|
83
|
-
*/
|
|
84
|
-
wrappedMintAuthority: TAccountMetas[2];
|
|
85
|
-
/** The mint of the unwrapped tokens */
|
|
86
|
-
unwrappedMint: TAccountMetas[3];
|
|
87
|
-
/** The token program of the wrapped tokens */
|
|
88
|
-
wrappedTokenProgram: TAccountMetas[4];
|
|
89
|
-
/** The token program of the unwrapped tokens */
|
|
90
|
-
unwrappedTokenProgram: TAccountMetas[5];
|
|
91
|
-
/** The source token account for the wrapped tokens */
|
|
92
|
-
wrappedTokenAccount: TAccountMetas[6];
|
|
93
|
-
/**
|
|
94
|
-
* The wrapped mint account, address must be:
|
|
95
|
-
* `get_wrapped_mint_address(unwrapped_mint_address, wrapped_token_program_id)`
|
|
96
|
-
*/
|
|
97
|
-
wrappedMint: TAccountMetas[7];
|
|
98
|
-
/** The authority to burn the wrapped tokens. */
|
|
99
|
-
transferAuthority: TAccountMetas[8];
|
|
100
|
-
};
|
|
101
|
-
data: UnwrapInstructionData;
|
|
102
|
-
};
|
|
103
|
-
export declare function parseUnwrapInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedUnwrapInstruction<TProgram, TAccountMetas>;
|
|
@@ -1,103 +0,0 @@
|
|
|
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 AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, 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(): ReadonlyUint8Array;
|
|
12
|
-
export type WrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountRecipientWrappedTokenAccount extends string | AccountMeta<string> = string, TAccountWrappedMint extends string | AccountMeta<string> = string, TAccountWrappedMintAuthority extends string | AccountMeta<string> = string, TAccountUnwrappedTokenProgram extends string | AccountMeta<string> = string, TAccountWrappedTokenProgram extends string | AccountMeta<string> = string, TAccountUnwrappedTokenAccount extends string | AccountMeta<string> = string, TAccountUnwrappedMint extends string | AccountMeta<string> = string, TAccountUnwrappedEscrow extends string | AccountMeta<string> = string, TAccountTransferAuthority extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
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(): FixedSizeEncoder<WrapInstructionDataArgs>;
|
|
34
|
-
export declare function getWrapInstructionDataDecoder(): FixedSizeDecoder<WrapInstructionData>;
|
|
35
|
-
export declare function getWrapInstructionDataCodec(): FixedSizeCodec<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> & AccountSignerMeta<TAccountTransferAuthority> : TAccountTransferAuthority>;
|
|
70
|
-
export type ParsedWrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
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 AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedWrapInstruction<TProgram, TAccountMetas>;
|
|
@@ -1,14 +0,0 @@
|
|
|
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>;
|
|
@@ -1,15 +0,0 @@
|
|
|
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>;
|
|
@@ -1,14 +0,0 @@
|
|
|
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>;
|
|
@@ -1,37 +0,0 @@
|
|
|
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 ParsedCloseStuckEscrowInstruction, type ParsedCreateMintInstruction, type ParsedSyncMetadataToSplTokenInstruction, type ParsedSyncMetadataToToken2022Instruction, 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
|
-
CloseStuckEscrow = 3,
|
|
19
|
-
SyncMetadataToToken2022 = 4,
|
|
20
|
-
SyncMetadataToSplToken = 5
|
|
21
|
-
}
|
|
22
|
-
export declare function identifyTokenWrapInstruction(instruction: {
|
|
23
|
-
data: ReadonlyUint8Array;
|
|
24
|
-
} | ReadonlyUint8Array): TokenWrapInstruction;
|
|
25
|
-
export type ParsedTokenWrapInstruction<TProgram extends string = 'TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR'> = ({
|
|
26
|
-
instructionType: TokenWrapInstruction.CreateMint;
|
|
27
|
-
} & ParsedCreateMintInstruction<TProgram>) | ({
|
|
28
|
-
instructionType: TokenWrapInstruction.Wrap;
|
|
29
|
-
} & ParsedWrapInstruction<TProgram>) | ({
|
|
30
|
-
instructionType: TokenWrapInstruction.Unwrap;
|
|
31
|
-
} & ParsedUnwrapInstruction<TProgram>) | ({
|
|
32
|
-
instructionType: TokenWrapInstruction.CloseStuckEscrow;
|
|
33
|
-
} & ParsedCloseStuckEscrowInstruction<TProgram>) | ({
|
|
34
|
-
instructionType: TokenWrapInstruction.SyncMetadataToToken2022;
|
|
35
|
-
} & ParsedSyncMetadataToToken2022Instruction<TProgram>) | ({
|
|
36
|
-
instructionType: TokenWrapInstruction.SyncMetadataToSplToken;
|
|
37
|
-
} & ParsedSyncMetadataToSplTokenInstruction<TProgram>);
|
|
@@ -1,49 +0,0 @@
|
|
|
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 AccountMeta, type AccountSignerMeta, type Address, 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 InstructionWithByteDelta = {
|
|
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) => AccountMeta | AccountSignerMeta | undefined;
|
|
49
|
-
export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
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';
|
package/dist/types/unwrap.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Address, GetAccountInfoApi, Instruction, Rpc, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayerSigner, 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: Instruction[];
|
|
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<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayerSigner>;
|
|
45
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, Instruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime, TransactionWithinSizeLimit } 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: Instruction[];
|
|
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: Instruction[];
|
|
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): Transaction & FullySignedTransaction & TransactionWithBlockhashLifetime & TransactionWithinSizeLimit;
|