@solana-program/token-wrap 2.0.0 → 2.2.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.
@@ -1,4 +1,4 @@
1
- import { Address, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, KeyPairSigner, Rpc } from '@solana/kit';
1
+ import { Address, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, Instruction, KeyPairSigner, Rpc } from '@solana/kit';
2
2
  export interface CreateMintArgs {
3
3
  rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
4
4
  unwrappedMint: Address;
@@ -11,6 +11,6 @@ export interface CreateMintResult {
11
11
  backpointer: Address;
12
12
  fundedWrappedMintLamports: bigint;
13
13
  fundedBackpointerLamports: bigint;
14
- ixs: IInstruction[];
14
+ ixs: Instruction[];
15
15
  }
16
16
  export declare function createMint({ rpc, unwrappedMint, wrappedTokenProgram, payer, idempotent, }: CreateMintArgs): Promise<CreateMintResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -5,15 +5,15 @@
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
7
  */
8
- import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount } from '@solana/kit';
8
+ import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type EncodedAccount, type FetchAccountConfig, type FetchAccountsConfig, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type MaybeAccount, type MaybeEncodedAccount } from '@solana/kit';
9
9
  import { BackpointerSeeds } from '../pdas';
10
10
  export type Backpointer = {
11
11
  unwrappedMint: Address;
12
12
  };
13
13
  export type BackpointerArgs = Backpointer;
14
- export declare function getBackpointerEncoder(): Encoder<BackpointerArgs>;
15
- export declare function getBackpointerDecoder(): Decoder<Backpointer>;
16
- export declare function getBackpointerCodec(): Codec<BackpointerArgs, Backpointer>;
14
+ export declare function getBackpointerEncoder(): FixedSizeEncoder<BackpointerArgs>;
15
+ export declare function getBackpointerDecoder(): FixedSizeDecoder<Backpointer>;
16
+ export declare function getBackpointerCodec(): FixedSizeCodec<BackpointerArgs, Backpointer>;
17
17
  export declare function decodeBackpointer<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Backpointer, TAddress>;
18
18
  export declare function decodeBackpointer<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Backpointer, TAddress>;
19
19
  export declare function fetchBackpointer<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Backpointer, TAddress>>;
@@ -14,7 +14,15 @@ export declare const TOKEN_WRAP_ERROR__ESCROW_OWNER_MISMATCH = 4;
14
14
  export declare const TOKEN_WRAP_ERROR__INVALID_WRAPPED_MINT_OWNER = 5;
15
15
  export declare const TOKEN_WRAP_ERROR__INVALID_BACKPOINTER_OWNER = 6;
16
16
  export declare const TOKEN_WRAP_ERROR__ESCROW_MISMATCH = 7;
17
- export type TokenWrapError = typeof TOKEN_WRAP_ERROR__BACKPOINTER_MISMATCH | typeof TOKEN_WRAP_ERROR__ESCROW_MISMATCH | typeof TOKEN_WRAP_ERROR__ESCROW_OWNER_MISMATCH | typeof TOKEN_WRAP_ERROR__INVALID_BACKPOINTER_OWNER | typeof TOKEN_WRAP_ERROR__INVALID_WRAPPED_MINT_OWNER | typeof TOKEN_WRAP_ERROR__MINT_AUTHORITY_MISMATCH | typeof TOKEN_WRAP_ERROR__WRAPPED_MINT_MISMATCH | typeof TOKEN_WRAP_ERROR__ZERO_WRAP_AMOUNT;
17
+ export declare const TOKEN_WRAP_ERROR__ESCROW_IN_GOOD_STATE = 8;
18
+ export declare const TOKEN_WRAP_ERROR__UNWRAPPED_MINT_HAS_NO_METADATA = 9;
19
+ export declare const TOKEN_WRAP_ERROR__METAPLEX_METADATA_MISMATCH = 10;
20
+ export declare const TOKEN_WRAP_ERROR__METADATA_POINTER_MISSING = 11;
21
+ export declare const TOKEN_WRAP_ERROR__METADATA_POINTER_UNSET = 12;
22
+ export declare const TOKEN_WRAP_ERROR__METADATA_POINTER_MISMATCH = 13;
23
+ export declare const TOKEN_WRAP_ERROR__EXTERNAL_PROGRAM_RETURNED_NO_DATA = 14;
24
+ export declare const TOKEN_WRAP_ERROR__NO_SYNCING_TO_TOKEN2022 = 15;
25
+ export type TokenWrapError = typeof TOKEN_WRAP_ERROR__BACKPOINTER_MISMATCH | typeof TOKEN_WRAP_ERROR__ESCROW_IN_GOOD_STATE | typeof TOKEN_WRAP_ERROR__ESCROW_MISMATCH | typeof TOKEN_WRAP_ERROR__ESCROW_OWNER_MISMATCH | typeof TOKEN_WRAP_ERROR__EXTERNAL_PROGRAM_RETURNED_NO_DATA | typeof TOKEN_WRAP_ERROR__INVALID_BACKPOINTER_OWNER | typeof TOKEN_WRAP_ERROR__INVALID_WRAPPED_MINT_OWNER | typeof TOKEN_WRAP_ERROR__METADATA_POINTER_MISMATCH | typeof TOKEN_WRAP_ERROR__METADATA_POINTER_MISSING | typeof TOKEN_WRAP_ERROR__METADATA_POINTER_UNSET | typeof TOKEN_WRAP_ERROR__METAPLEX_METADATA_MISMATCH | typeof TOKEN_WRAP_ERROR__MINT_AUTHORITY_MISMATCH | typeof TOKEN_WRAP_ERROR__NO_SYNCING_TO_TOKEN2022 | typeof TOKEN_WRAP_ERROR__UNWRAPPED_MINT_HAS_NO_METADATA | typeof TOKEN_WRAP_ERROR__WRAPPED_MINT_MISMATCH | typeof TOKEN_WRAP_ERROR__ZERO_WRAP_AMOUNT;
18
26
  export declare function getTokenWrapErrorMessage(code: TokenWrapError): string;
19
27
  export declare function isTokenWrapError<TProgramErrorCode extends TokenWrapError>(error: unknown, transactionMessage: {
20
28
  instructions: Record<number, {
@@ -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 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 CLOSE_STUCK_ESCROW_DISCRIMINATOR = 3;
11
+ export declare function getCloseStuckEscrowDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type CloseStuckEscrowInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountEscrow extends string | AccountMeta<string> = string, TAccountDestination extends string | AccountMeta<string> = string, TAccountUnwrappedMint extends string | AccountMeta<string> = string, TAccountWrappedMint extends string | AccountMeta<string> = string, TAccountWrappedMintAuthority extends string | AccountMeta<string> = string, TAccountToken2022Program extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
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(): FixedSizeEncoder<CloseStuckEscrowInstructionDataArgs>;
26
+ export declare function getCloseStuckEscrowInstructionDataDecoder(): FixedSizeDecoder<CloseStuckEscrowInstructionData>;
27
+ export declare function getCloseStuckEscrowInstructionDataCodec(): FixedSizeCodec<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 AccountMeta[] = readonly AccountMeta[]> = {
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 AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCloseStuckEscrowInstruction<TProgram, TAccountMetas>;
@@ -5,11 +5,11 @@
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
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';
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
9
  import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
10
10
  export declare const CREATE_MINT_DISCRIMINATOR = 0;
11
- export declare function getCreateMintDiscriminatorBytes(): import("@solana/kit").ReadonlyUint8Array;
12
- export type CreateMintInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountWrappedMint extends string | IAccountMeta<string> = string, TAccountBackpointer extends string | IAccountMeta<string> = string, TAccountUnwrappedMint extends string | IAccountMeta<string> = string, TAccountSystemProgram extends string | IAccountMeta<string> = '11111111111111111111111111111111', TAccountWrappedTokenProgram extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
11
+ export declare function getCreateMintDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type CreateMintInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountWrappedMint extends string | AccountMeta<string> = string, TAccountBackpointer extends string | AccountMeta<string> = string, TAccountUnwrappedMint extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountWrappedTokenProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
13
  TAccountWrappedMint extends string ? WritableAccount<TAccountWrappedMint> : TAccountWrappedMint,
14
14
  TAccountBackpointer extends string ? WritableAccount<TAccountBackpointer> : TAccountBackpointer,
15
15
  TAccountUnwrappedMint extends string ? ReadonlyAccount<TAccountUnwrappedMint> : TAccountUnwrappedMint,
@@ -26,9 +26,9 @@ export type CreateMintInstructionDataArgs = {
26
26
  /** Whether the creation should fail if the wrapped mint already exists. */
27
27
  idempotent?: boolean;
28
28
  };
29
- export declare function getCreateMintInstructionDataEncoder(): Encoder<CreateMintInstructionDataArgs>;
30
- export declare function getCreateMintInstructionDataDecoder(): Decoder<CreateMintInstructionData>;
31
- export declare function getCreateMintInstructionDataCodec(): Codec<CreateMintInstructionDataArgs, CreateMintInstructionData>;
29
+ export declare function getCreateMintInstructionDataEncoder(): FixedSizeEncoder<CreateMintInstructionDataArgs>;
30
+ export declare function getCreateMintInstructionDataDecoder(): FixedSizeDecoder<CreateMintInstructionData>;
31
+ export declare function getCreateMintInstructionDataCodec(): FixedSizeCodec<CreateMintInstructionDataArgs, CreateMintInstructionData>;
32
32
  export type CreateMintInput<TAccountWrappedMint extends string = string, TAccountBackpointer extends string = string, TAccountUnwrappedMint extends string = string, TAccountSystemProgram extends string = string, TAccountWrappedTokenProgram extends string = string> = {
33
33
  /**
34
34
  * Unallocated wrapped mint account to create (PDA), address must be:
@@ -51,7 +51,7 @@ export type CreateMintInput<TAccountWrappedMint extends string = string, TAccoun
51
51
  export declare function getCreateMintInstruction<TAccountWrappedMint extends string, TAccountBackpointer extends string, TAccountUnwrappedMint extends string, TAccountSystemProgram extends string, TAccountWrappedTokenProgram extends string, TProgramAddress extends Address = typeof TOKEN_WRAP_PROGRAM_ADDRESS>(input: CreateMintInput<TAccountWrappedMint, TAccountBackpointer, TAccountUnwrappedMint, TAccountSystemProgram, TAccountWrappedTokenProgram>, config?: {
52
52
  programAddress?: TProgramAddress;
53
53
  }): CreateMintInstruction<TProgramAddress, TAccountWrappedMint, TAccountBackpointer, TAccountUnwrappedMint, TAccountSystemProgram, TAccountWrappedTokenProgram>;
54
- export type ParsedCreateMintInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
54
+ export type ParsedCreateMintInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
55
55
  programAddress: Address<TProgram>;
56
56
  accounts: {
57
57
  /**
@@ -73,4 +73,4 @@ export type ParsedCreateMintInstruction<TProgram extends string = typeof TOKEN_W
73
73
  };
74
74
  data: CreateMintInstructionData;
75
75
  };
76
- export declare function parseCreateMintInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedCreateMintInstruction<TProgram, TAccountMetas>;
76
+ export declare function parseCreateMintInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreateMintInstruction<TProgram, TAccountMetas>;
@@ -5,6 +5,9 @@
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
7
  */
8
+ export * from './closeStuckEscrow';
8
9
  export * from './createMint';
10
+ export * from './syncMetadataToSplToken';
11
+ export * from './syncMetadataToToken2022';
9
12
  export * from './unwrap';
10
13
  export * from './wrap';
@@ -0,0 +1,92 @@
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>;
@@ -0,0 +1,75 @@
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>;
@@ -5,11 +5,11 @@
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
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';
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
9
  import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
10
10
  export declare const UNWRAP_DISCRIMINATOR = 2;
11
- export declare function getUnwrapDiscriminatorBytes(): import("@solana/kit").ReadonlyUint8Array;
12
- export type UnwrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountUnwrappedEscrow extends string | IAccountMeta<string> = string, TAccountRecipientUnwrappedToken extends string | IAccountMeta<string> = string, TAccountWrappedMintAuthority extends string | IAccountMeta<string> = string, TAccountUnwrappedMint extends string | IAccountMeta<string> = string, TAccountWrappedTokenProgram extends string | IAccountMeta<string> = string, TAccountUnwrappedTokenProgram extends string | IAccountMeta<string> = string, TAccountWrappedTokenAccount extends string | IAccountMeta<string> = string, TAccountWrappedMint extends string | IAccountMeta<string> = string, TAccountTransferAuthority extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
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
13
  TAccountUnwrappedEscrow extends string ? WritableAccount<TAccountUnwrappedEscrow> : TAccountUnwrappedEscrow,
14
14
  TAccountRecipientUnwrappedToken extends string ? WritableAccount<TAccountRecipientUnwrappedToken> : TAccountRecipientUnwrappedToken,
15
15
  TAccountWrappedMintAuthority extends string ? ReadonlyAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
@@ -30,9 +30,9 @@ export type UnwrapInstructionDataArgs = {
30
30
  /** The amount of tokens to unwrap. */
31
31
  amount: number | bigint;
32
32
  };
33
- export declare function getUnwrapInstructionDataEncoder(): Encoder<UnwrapInstructionDataArgs>;
34
- export declare function getUnwrapInstructionDataDecoder(): Decoder<UnwrapInstructionData>;
35
- export declare function getUnwrapInstructionDataCodec(): Codec<UnwrapInstructionDataArgs, UnwrapInstructionData>;
33
+ export declare function getUnwrapInstructionDataEncoder(): FixedSizeEncoder<UnwrapInstructionDataArgs>;
34
+ export declare function getUnwrapInstructionDataDecoder(): FixedSizeDecoder<UnwrapInstructionData>;
35
+ export declare function getUnwrapInstructionDataCodec(): FixedSizeCodec<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
38
  * The escrow account holding the unwrapped tokens.
@@ -66,8 +66,8 @@ export type UnwrapInput<TAccountUnwrappedEscrow extends string = string, TAccoun
66
66
  };
67
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
68
  programAddress?: TProgramAddress;
69
- }): UnwrapInstruction<TProgramAddress, TAccountUnwrappedEscrow, TAccountRecipientUnwrappedToken, TAccountWrappedMintAuthority, TAccountUnwrappedMint, TAccountWrappedTokenProgram, TAccountUnwrappedTokenProgram, TAccountWrappedTokenAccount, TAccountWrappedMint, (typeof input)['transferAuthority'] extends TransactionSigner<TAccountTransferAuthority> ? ReadonlySignerAccount<TAccountTransferAuthority> & IAccountSignerMeta<TAccountTransferAuthority> : TAccountTransferAuthority>;
70
- export type ParsedUnwrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
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
71
  programAddress: Address<TProgram>;
72
72
  accounts: {
73
73
  /**
@@ -100,4 +100,4 @@ export type ParsedUnwrapInstruction<TProgram extends string = typeof TOKEN_WRAP_
100
100
  };
101
101
  data: UnwrapInstructionData;
102
102
  };
103
- export declare function parseUnwrapInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedUnwrapInstruction<TProgram, TAccountMetas>;
103
+ export declare function parseUnwrapInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedUnwrapInstruction<TProgram, TAccountMetas>;
@@ -5,11 +5,11 @@
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
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';
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
9
  import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';
10
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<[
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
13
  TAccountRecipientWrappedTokenAccount extends string ? WritableAccount<TAccountRecipientWrappedTokenAccount> : TAccountRecipientWrappedTokenAccount,
14
14
  TAccountWrappedMint extends string ? WritableAccount<TAccountWrappedMint> : TAccountWrappedMint,
15
15
  TAccountWrappedMintAuthority extends string ? ReadonlyAccount<TAccountWrappedMintAuthority> : TAccountWrappedMintAuthority,
@@ -30,9 +30,9 @@ export type WrapInstructionDataArgs = {
30
30
  /** The amount of tokens to wrap. */
31
31
  amount: number | bigint;
32
32
  };
33
- export declare function getWrapInstructionDataEncoder(): Encoder<WrapInstructionDataArgs>;
34
- export declare function getWrapInstructionDataDecoder(): Decoder<WrapInstructionData>;
35
- export declare function getWrapInstructionDataCodec(): Codec<WrapInstructionDataArgs, WrapInstructionData>;
33
+ export declare function getWrapInstructionDataEncoder(): FixedSizeEncoder<WrapInstructionDataArgs>;
34
+ export declare function getWrapInstructionDataDecoder(): FixedSizeDecoder<WrapInstructionData>;
35
+ export declare function getWrapInstructionDataCodec(): FixedSizeCodec<WrapInstructionDataArgs, WrapInstructionData>;
36
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
37
  /** The token account to receive the wrapped tokens. */
38
38
  recipientWrappedTokenAccount: Address<TAccountRecipientWrappedTokenAccount>;
@@ -66,8 +66,8 @@ export type WrapInput<TAccountRecipientWrappedTokenAccount extends string = stri
66
66
  };
67
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
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[]> = {
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
71
  programAddress: Address<TProgram>;
72
72
  accounts: {
73
73
  /** The token account to receive the wrapped tokens. */
@@ -100,4 +100,4 @@ export type ParsedWrapInstruction<TProgram extends string = typeof TOKEN_WRAP_PR
100
100
  };
101
101
  data: WrapInstructionData;
102
102
  };
103
- export declare function parseWrapInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedWrapInstruction<TProgram, TAccountMetas>;
103
+ export declare function parseWrapInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedWrapInstruction<TProgram, TAccountMetas>;
@@ -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 ParsedSyncMetadataToSplTokenInstruction, type ParsedSyncMetadataToToken2022Instruction, type ParsedUnwrapInstruction, type ParsedWrapInstruction } from '../instructions';
10
10
  export declare const TOKEN_WRAP_PROGRAM_ADDRESS: Address<"TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR">;
11
11
  export declare enum TokenWrapAccount {
12
12
  Backpointer = 0
@@ -14,7 +14,10 @@ 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,
19
+ SyncMetadataToToken2022 = 4,
20
+ SyncMetadataToSplToken = 5
18
21
  }
19
22
  export declare function identifyTokenWrapInstruction(instruction: {
20
23
  data: ReadonlyUint8Array;
@@ -25,4 +28,10 @@ export type ParsedTokenWrapInstruction<TProgram extends string = 'TwRapQCDhWkZRr
25
28
  instructionType: TokenWrapInstruction.Wrap;
26
29
  } & ParsedWrapInstruction<TProgram>) | ({
27
30
  instructionType: TokenWrapInstruction.Unwrap;
28
- } & ParsedUnwrapInstruction<TProgram>);
31
+ } & ParsedUnwrapInstruction<TProgram>) | ({
32
+ instructionType: TokenWrapInstruction.CloseStuckEscrow;
33
+ } & ParsedCloseStuckEscrowInstruction<TProgram>) | ({
34
+ instructionType: TokenWrapInstruction.SyncMetadataToToken2022;
35
+ } & ParsedSyncMetadataToToken2022Instruction<TProgram>) | ({
36
+ instructionType: TokenWrapInstruction.SyncMetadataToSplToken;
37
+ } & ParsedSyncMetadataToSplTokenInstruction<TProgram>);
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @see https://github.com/codama-idl/codama
7
7
  */
8
- import { type Address, type IAccountMeta, type IAccountSignerMeta, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
8
+ import { type AccountMeta, type AccountSignerMeta, type Address, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
9
9
  /**
10
10
  * Asserts that the given value is not null or undefined.
11
11
  * @internal
@@ -38,12 +38,12 @@ export type ResolvedAccount<T extends string = string, U extends Address<T> | Pr
38
38
  * Defines an instruction that stores additional bytes on-chain.
39
39
  * @internal
40
40
  */
41
- export type IInstructionWithByteDelta = {
41
+ export type InstructionWithByteDelta = {
42
42
  byteDelta: number;
43
43
  };
44
44
  /**
45
45
  * Get account metas and signers from resolved accounts.
46
46
  * @internal
47
47
  */
48
- export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => IAccountMeta | IAccountSignerMeta | undefined;
48
+ export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
49
49
  export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
@@ -1,4 +1,4 @@
1
- import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
1
+ import { Address, GetAccountInfoApi, Instruction, Rpc, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayerSigner, TransactionSigner } from '@solana/kit';
2
2
  import { Blockhash } from '@solana/rpc-types';
3
3
  export interface SingleSignerUnwrapArgs {
4
4
  rpc: Rpc<GetAccountInfoApi>;
@@ -24,7 +24,7 @@ interface UnwrapTxBuilderArgs {
24
24
  multiSigners?: TransactionSigner[];
25
25
  }
26
26
  export interface SingleSignerUnwrapResult {
27
- ixs: IInstruction[];
27
+ ixs: Instruction[];
28
28
  recipientUnwrappedToken: Address;
29
29
  amount: bigint;
30
30
  }
@@ -41,5 +41,5 @@ export interface MultiSignerUnWrapTxBuilderArgs extends UnwrapTxBuilderArgs {
41
41
  };
42
42
  multiSigners: TransactionSigner[];
43
43
  }
44
- export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
44
+ export declare function multisigOfflineSignUnwrap(args: MultiSignerUnWrapTxBuilderArgs): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayerSigner>;
45
45
  export {};
@@ -1,4 +1,4 @@
1
- import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime } from '@solana/kit';
1
+ import { Address, FullySignedTransaction, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, Instruction, KeyPairSigner, Rpc, Transaction, TransactionWithBlockhashLifetime, TransactionWithinSizeLimit } from '@solana/kit';
2
2
  import { Token } from '@solana-program/token-2022';
3
3
  import { Blockhash } from '@solana/rpc-types';
4
4
  import { Account } from '@solana/accounts';
@@ -9,7 +9,7 @@ export declare function createTokenAccount({ rpc, payer, mint, owner, tokenProgr
9
9
  owner: Address;
10
10
  tokenProgram: Address;
11
11
  }): Promise<{
12
- ixs: IInstruction[];
12
+ ixs: Instruction[];
13
13
  keyPair: KeyPairSigner;
14
14
  }>;
15
15
  export interface CreateEscrowAccountArgs {
@@ -24,7 +24,7 @@ export type CreateEscrowAccountResult = {
24
24
  } | {
25
25
  kind: 'instructions_to_create';
26
26
  address: Address;
27
- ixs: IInstruction[];
27
+ ixs: Instruction[];
28
28
  };
29
29
  export declare function createEscrowAccount({ rpc, payer, unwrappedMint, wrappedTokenProgram, }: CreateEscrowAccountArgs): Promise<CreateEscrowAccountResult>;
30
30
  export declare function getOwnerFromAccount(rpc: Rpc<GetAccountInfoApi>, accountAddress: Address): Promise<Address>;
@@ -36,4 +36,4 @@ export interface MultiSigCombineArgs {
36
36
  lastValidBlockHeight: bigint;
37
37
  };
38
38
  }
39
- export declare function combinedMultisigTx({ signedTxs, blockhash, }: MultiSigCombineArgs): FullySignedTransaction & TransactionWithBlockhashLifetime;
39
+ export declare function combinedMultisigTx({ signedTxs, blockhash, }: MultiSigCombineArgs): Transaction & FullySignedTransaction & TransactionWithBlockhashLifetime & TransactionWithinSizeLimit;
@@ -1,4 +1,4 @@
1
- import { Address, CompilableTransactionMessage, GetAccountInfoApi, IInstruction, Rpc, TransactionMessageWithBlockhashLifetime, TransactionSigner } from '@solana/kit';
1
+ import { Address, GetAccountInfoApi, Instruction, Rpc, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayerSigner, TransactionSigner } from '@solana/kit';
2
2
  import { Blockhash } from '@solana/rpc-types';
3
3
  interface IxBuilderArgs {
4
4
  unwrappedTokenAccount: Address;
@@ -20,7 +20,7 @@ export interface MultiSignerWrapIxBuilderArgs extends IxBuilderArgs {
20
20
  };
21
21
  multiSigners: TransactionSigner[];
22
22
  }
23
- export declare function multisigOfflineSignWrap(args: MultiSignerWrapIxBuilderArgs): Promise<CompilableTransactionMessage & TransactionMessageWithBlockhashLifetime>;
23
+ export declare function multisigOfflineSignWrap(args: MultiSignerWrapIxBuilderArgs): Promise<TransactionMessage & TransactionMessageWithBlockhashLifetime & TransactionMessageWithFeePayerSigner>;
24
24
  export interface SingleSignerWrapArgs {
25
25
  rpc: Rpc<GetAccountInfoApi>;
26
26
  payer: TransactionSigner;
@@ -33,7 +33,7 @@ export interface SingleSignerWrapArgs {
33
33
  unwrappedTokenProgram?: Address;
34
34
  }
35
35
  export interface SingleSignerWrapResult {
36
- ixs: IInstruction[];
36
+ ixs: Instruction[];
37
37
  recipientWrappedTokenAccount: Address;
38
38
  escrowAccount: Address;
39
39
  amount: bigint;