@lightprotocol/compressed-token 0.23.0-beta.4 → 0.23.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser/index.cjs +1 -218
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/types-C7ZeGpIm.cjs +2 -0
- package/dist/cjs/browser/types-C7ZeGpIm.cjs.map +1 -0
- package/dist/cjs/browser/unified/index.cjs +1 -379
- package/dist/cjs/browser/unified/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +1 -219
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/types-BGRaX3tR.cjs +2 -0
- package/dist/cjs/node/types-BGRaX3tR.cjs.map +1 -0
- package/dist/cjs/node/unified/index.cjs +1 -380
- package/dist/cjs/node/unified/index.cjs.map +1 -1
- package/dist/es/browser/index.js +1 -166
- package/dist/es/browser/index.js.map +1 -1
- package/dist/es/browser/types-BvBzUhrt.js +2 -0
- package/dist/es/browser/types-BvBzUhrt.js.map +1 -0
- package/dist/es/browser/unified/index.js +1 -284
- package/dist/es/browser/unified/index.js.map +1 -1
- package/dist/types/index.d.ts +611 -1343
- package/dist/types/unified/index.d.ts +779 -1636
- package/package.json +4 -3
- package/dist/cjs/browser/types-qZMOMIxa.cjs +0 -11351
- package/dist/cjs/browser/types-qZMOMIxa.cjs.map +0 -1
- package/dist/cjs/node/types-BsKbElnz.cjs +0 -10113
- package/dist/cjs/node/types-BsKbElnz.cjs.map +0 -1
- package/dist/es/browser/types-pblNXos5.js +0 -10454
- package/dist/es/browser/types-pblNXos5.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,84 +1,23 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
TransactionInstruction,
|
|
5
|
-
Commitment,
|
|
6
|
-
AccountInfo,
|
|
7
|
-
Signer,
|
|
8
|
-
ConfirmOptions,
|
|
9
|
-
TransactionSignature,
|
|
10
|
-
AccountMeta,
|
|
11
|
-
Keypair,
|
|
12
|
-
Connection,
|
|
13
|
-
} from '@solana/web3.js';
|
|
14
|
-
import {
|
|
15
|
-
ValidityProofWithContext,
|
|
16
|
-
AddressTreeInfo,
|
|
17
|
-
TreeInfo,
|
|
18
|
-
MerkleContext,
|
|
19
|
-
Rpc,
|
|
20
|
-
ParsedTokenAccount,
|
|
21
|
-
CompressedAccountWithMerkleContext,
|
|
22
|
-
ValidityProof,
|
|
23
|
-
TreeType,
|
|
24
|
-
PackedMerkleContextLegacy,
|
|
25
|
-
CompressedCpiContext,
|
|
26
|
-
InputTokenDataWithContext as InputTokenDataWithContext$1,
|
|
27
|
-
CompressedProof,
|
|
28
|
-
} from '@lightprotocol/stateless.js';
|
|
2
|
+
import { PublicKey, TransactionInstruction, Commitment, AccountInfo, Signer, ConfirmOptions, TransactionSignature, AccountMeta, Keypair, Connection } from '@solana/web3.js';
|
|
3
|
+
import { ValidityProofWithContext, AddressTreeInfo, TreeInfo, MerkleContext, Rpc, ParsedTokenAccount, CompressedAccountWithMerkleContext, ValidityProof, TreeType, PackedMerkleContextLegacy, CompressedCpiContext, InputTokenDataWithContext as InputTokenDataWithContext$1, CompressedProof } from '@lightprotocol/stateless.js';
|
|
29
4
|
export { ParsedTokenAccount as ParsedTokenAccountInterface } from '@lightprotocol/stateless.js';
|
|
30
5
|
import { Mint, Account } from '@solana/spl-token';
|
|
31
6
|
export { Account, AccountState } from '@solana/spl-token';
|
|
32
7
|
|
|
33
8
|
declare class Buffer$1 extends Uint8Array {
|
|
34
|
-
length: number
|
|
35
|
-
write(
|
|
36
|
-
string: string,
|
|
37
|
-
offset?: number,
|
|
38
|
-
length?: number,
|
|
39
|
-
encoding?: string,
|
|
40
|
-
): number;
|
|
9
|
+
length: number
|
|
10
|
+
write(string: string, offset?: number, length?: number, encoding?: string): number;
|
|
41
11
|
toString(encoding?: string, start?: number, end?: number): string;
|
|
42
|
-
toJSON(): { type: 'Buffer'
|
|
12
|
+
toJSON(): { type: 'Buffer', data: any[] };
|
|
43
13
|
equals(otherBuffer: Buffer$1): boolean;
|
|
44
|
-
compare(
|
|
45
|
-
|
|
46
|
-
targetStart?: number,
|
|
47
|
-
targetEnd?: number,
|
|
48
|
-
sourceStart?: number,
|
|
49
|
-
sourceEnd?: number,
|
|
50
|
-
): number;
|
|
51
|
-
copy(
|
|
52
|
-
targetBuffer: Buffer$1,
|
|
53
|
-
targetStart?: number,
|
|
54
|
-
sourceStart?: number,
|
|
55
|
-
sourceEnd?: number,
|
|
56
|
-
): number;
|
|
14
|
+
compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
15
|
+
copy(targetBuffer: Buffer$1, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
57
16
|
slice(start?: number, end?: number): Buffer$1;
|
|
58
|
-
writeUIntLE(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
noAssert?: boolean,
|
|
63
|
-
): number;
|
|
64
|
-
writeUIntBE(
|
|
65
|
-
value: number,
|
|
66
|
-
offset: number,
|
|
67
|
-
byteLength: number,
|
|
68
|
-
noAssert?: boolean,
|
|
69
|
-
): number;
|
|
70
|
-
writeIntLE(
|
|
71
|
-
value: number,
|
|
72
|
-
offset: number,
|
|
73
|
-
byteLength: number,
|
|
74
|
-
noAssert?: boolean,
|
|
75
|
-
): number;
|
|
76
|
-
writeIntBE(
|
|
77
|
-
value: number,
|
|
78
|
-
offset: number,
|
|
79
|
-
byteLength: number,
|
|
80
|
-
noAssert?: boolean,
|
|
81
|
-
): number;
|
|
17
|
+
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
18
|
+
writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
19
|
+
writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
20
|
+
writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
82
21
|
readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
|
83
22
|
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
|
84
23
|
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
|
@@ -124,21 +63,9 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
124
63
|
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
|
|
125
64
|
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
|
|
126
65
|
fill(value: any, offset?: number, end?: number): this;
|
|
127
|
-
indexOf(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
encoding?: string,
|
|
131
|
-
): number;
|
|
132
|
-
lastIndexOf(
|
|
133
|
-
value: string | number | Buffer$1,
|
|
134
|
-
byteOffset?: number,
|
|
135
|
-
encoding?: string,
|
|
136
|
-
): number;
|
|
137
|
-
includes(
|
|
138
|
-
value: string | number | Buffer$1,
|
|
139
|
-
byteOffset?: number,
|
|
140
|
-
encoding?: string,
|
|
141
|
-
): boolean;
|
|
66
|
+
indexOf(value: string | number | Buffer$1, byteOffset?: number, encoding?: string): number;
|
|
67
|
+
lastIndexOf(value: string | number | Buffer$1, byteOffset?: number, encoding?: string): number;
|
|
68
|
+
includes(value: string | number | Buffer$1, byteOffset?: number, encoding?: string): boolean;
|
|
142
69
|
|
|
143
70
|
/**
|
|
144
71
|
* Allocates a new buffer containing the given {str}.
|
|
@@ -146,19 +73,19 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
146
73
|
* @param str String to store in buffer.
|
|
147
74
|
* @param encoding encoding to use, optional. Default is 'utf8'
|
|
148
75
|
*/
|
|
149
|
-
constructor(str: string, encoding?: string);
|
|
76
|
+
constructor (str: string, encoding?: string);
|
|
150
77
|
/**
|
|
151
78
|
* Allocates a new buffer of {size} octets.
|
|
152
79
|
*
|
|
153
80
|
* @param size count of octets to allocate.
|
|
154
81
|
*/
|
|
155
|
-
constructor(size: number);
|
|
82
|
+
constructor (size: number);
|
|
156
83
|
/**
|
|
157
84
|
* Allocates a new buffer containing the given {array} of octets.
|
|
158
85
|
*
|
|
159
86
|
* @param array The octets to store.
|
|
160
87
|
*/
|
|
161
|
-
constructor(array: Uint8Array);
|
|
88
|
+
constructor (array: Uint8Array);
|
|
162
89
|
/**
|
|
163
90
|
* Produces a Buffer backed by the same allocated memory as
|
|
164
91
|
* the given {ArrayBuffer}.
|
|
@@ -166,19 +93,19 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
166
93
|
*
|
|
167
94
|
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
|
168
95
|
*/
|
|
169
|
-
constructor(arrayBuffer: ArrayBuffer);
|
|
96
|
+
constructor (arrayBuffer: ArrayBuffer);
|
|
170
97
|
/**
|
|
171
98
|
* Allocates a new buffer containing the given {array} of octets.
|
|
172
99
|
*
|
|
173
100
|
* @param array The octets to store.
|
|
174
101
|
*/
|
|
175
|
-
constructor(array: any[]);
|
|
102
|
+
constructor (array: any[]);
|
|
176
103
|
/**
|
|
177
104
|
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
|
178
105
|
*
|
|
179
106
|
* @param buffer The buffer to copy.
|
|
180
107
|
*/
|
|
181
|
-
constructor(buffer: Buffer$1);
|
|
108
|
+
constructor (buffer: Buffer$1);
|
|
182
109
|
prototype: Buffer$1;
|
|
183
110
|
/**
|
|
184
111
|
* Allocates a new Buffer using an {array} of octets.
|
|
@@ -196,11 +123,7 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
196
123
|
* @param byteOffset
|
|
197
124
|
* @param length
|
|
198
125
|
*/
|
|
199
|
-
static from(
|
|
200
|
-
arrayBuffer: ArrayBuffer,
|
|
201
|
-
byteOffset?: number,
|
|
202
|
-
length?: number,
|
|
203
|
-
): Buffer$1;
|
|
126
|
+
static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer$1;
|
|
204
127
|
/**
|
|
205
128
|
* Copies the passed {buffer} data onto a new Buffer instance.
|
|
206
129
|
*
|
|
@@ -260,11 +183,7 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
260
183
|
* If parameter is omitted, buffer will be filled with zeros.
|
|
261
184
|
* @param encoding encoding used for call to buf.fill while initializing
|
|
262
185
|
*/
|
|
263
|
-
static alloc(
|
|
264
|
-
size: number,
|
|
265
|
-
fill?: string | Buffer$1 | number,
|
|
266
|
-
encoding?: string,
|
|
267
|
-
): Buffer$1;
|
|
186
|
+
static alloc(size: number, fill?: string | Buffer$1 | number, encoding?: string): Buffer$1;
|
|
268
187
|
/**
|
|
269
188
|
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
|
|
270
189
|
* of the newly created Buffer are unknown and may contain sensitive data.
|
|
@@ -429,13 +348,7 @@ interface TokenMetadataInstructionData {
|
|
|
429
348
|
updateAuthority?: PublicKey | null;
|
|
430
349
|
additionalMetadata: AdditionalMetadata[] | null;
|
|
431
350
|
}
|
|
432
|
-
declare function createTokenMetadata(
|
|
433
|
-
name: string,
|
|
434
|
-
symbol: string,
|
|
435
|
-
uri: string,
|
|
436
|
-
updateAuthority?: PublicKey | null,
|
|
437
|
-
additionalMetadata?: AdditionalMetadata[] | null,
|
|
438
|
-
): TokenMetadataInstructionData;
|
|
351
|
+
declare function createTokenMetadata(name: string, symbol: string, uri: string, updateAuthority?: PublicKey | null, additionalMetadata?: AdditionalMetadata[] | null): TokenMetadataInstructionData;
|
|
439
352
|
/**
|
|
440
353
|
* Create instruction for initializing a c-token mint.
|
|
441
354
|
*
|
|
@@ -449,17 +362,7 @@ declare function createTokenMetadata(
|
|
|
449
362
|
* @param outputStateTreeInfo Output state tree info.
|
|
450
363
|
* @param metadata Optional token metadata.
|
|
451
364
|
*/
|
|
452
|
-
declare function createMintInstruction(
|
|
453
|
-
mintSigner: PublicKey,
|
|
454
|
-
decimals: number,
|
|
455
|
-
mintAuthority: PublicKey,
|
|
456
|
-
freezeAuthority: PublicKey | null,
|
|
457
|
-
payer: PublicKey,
|
|
458
|
-
validityProof: ValidityProofWithContext,
|
|
459
|
-
addressTreeInfo: AddressTreeInfo,
|
|
460
|
-
outputStateTreeInfo: TreeInfo,
|
|
461
|
-
metadata?: TokenMetadataInstructionData,
|
|
462
|
-
): TransactionInstruction;
|
|
365
|
+
declare function createMintInstruction(mintSigner: PublicKey, decimals: number, mintAuthority: PublicKey, freezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext, addressTreeInfo: AddressTreeInfo, outputStateTreeInfo: TreeInfo, metadata?: TokenMetadataInstructionData): TransactionInstruction;
|
|
463
366
|
|
|
464
367
|
/**
|
|
465
368
|
* SPL-compatible base mint structure
|
|
@@ -593,7 +496,7 @@ declare function serializeMint(mint: CompressedMint): Buffer$1;
|
|
|
593
496
|
* Extension type constants
|
|
594
497
|
*/
|
|
595
498
|
declare enum ExtensionType {
|
|
596
|
-
TokenMetadata = 19
|
|
499
|
+
TokenMetadata = 19
|
|
597
500
|
}
|
|
598
501
|
/**
|
|
599
502
|
* Decode TokenMetadata from raw extension data using Borsh layout
|
|
@@ -611,9 +514,7 @@ declare function encodeTokenMetadata(metadata: TokenMetadata): Buffer$1;
|
|
|
611
514
|
* @param extensions - Array of raw extensions
|
|
612
515
|
* @returns Parsed TokenMetadata or null if not found
|
|
613
516
|
*/
|
|
614
|
-
declare function extractTokenMetadata(
|
|
615
|
-
extensions: MintExtension[] | null,
|
|
616
|
-
): TokenMetadata | null;
|
|
517
|
+
declare function extractTokenMetadata(extensions: MintExtension[] | null): TokenMetadata | null;
|
|
617
518
|
/**
|
|
618
519
|
* Metadata portion of MintInstructionData
|
|
619
520
|
* Used for instruction encoding when metadata extension is present
|
|
@@ -664,12 +565,7 @@ interface MintInterface {
|
|
|
664
565
|
* @returns Object with mint, optional merkleContext, mintContext, and
|
|
665
566
|
* tokenMetadata
|
|
666
567
|
*/
|
|
667
|
-
declare function getMintInterface(
|
|
668
|
-
rpc: Rpc,
|
|
669
|
-
address: PublicKey,
|
|
670
|
-
commitment?: Commitment,
|
|
671
|
-
programId?: PublicKey,
|
|
672
|
-
): Promise<MintInterface>;
|
|
568
|
+
declare function getMintInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<MintInterface>;
|
|
673
569
|
/**
|
|
674
570
|
* Unpack mint info from raw account data for SPL/T22/c-token.
|
|
675
571
|
*
|
|
@@ -678,11 +574,7 @@ declare function getMintInterface(
|
|
|
678
574
|
* @param programId Token program ID. Default c-token.
|
|
679
575
|
* @returns Object with mint, optional mintContext and tokenMetadata.
|
|
680
576
|
*/
|
|
681
|
-
declare function unpackMintInterface(
|
|
682
|
-
address: PublicKey,
|
|
683
|
-
data: Buffer$1 | Uint8Array | AccountInfo<Buffer$1>,
|
|
684
|
-
programId?: PublicKey,
|
|
685
|
-
): Omit<MintInterface, 'merkleContext'>;
|
|
577
|
+
declare function unpackMintInterface(address: PublicKey, data: Buffer$1 | Uint8Array | AccountInfo<Buffer$1>, programId?: PublicKey): Omit<MintInterface, 'merkleContext'>;
|
|
686
578
|
/**
|
|
687
579
|
* Unpack c-token mint context and metadata from raw account data
|
|
688
580
|
*
|
|
@@ -697,22 +589,18 @@ declare function unpackMintData(data: Buffer$1 | Uint8Array): {
|
|
|
697
589
|
|
|
698
590
|
/**
|
|
699
591
|
* Create instruction for updating a compressed mint's mint authority.
|
|
592
|
+
* Works for both compressed and decompressed mints.
|
|
700
593
|
*
|
|
701
594
|
* @param mintInterface MintInterface from getMintInterface() - must have merkleContext
|
|
702
595
|
* @param currentMintAuthority Current mint authority public key (must sign)
|
|
703
596
|
* @param newMintAuthority New mint authority (or null to revoke)
|
|
704
597
|
* @param payer Fee payer public key
|
|
705
|
-
* @param validityProof Validity proof for the compressed mint
|
|
598
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
706
599
|
*/
|
|
707
|
-
declare function createUpdateMintAuthorityInstruction(
|
|
708
|
-
mintInterface: MintInterface,
|
|
709
|
-
currentMintAuthority: PublicKey,
|
|
710
|
-
newMintAuthority: PublicKey | null,
|
|
711
|
-
payer: PublicKey,
|
|
712
|
-
validityProof: ValidityProofWithContext,
|
|
713
|
-
): TransactionInstruction;
|
|
600
|
+
declare function createUpdateMintAuthorityInstruction(mintInterface: MintInterface, currentMintAuthority: PublicKey, newMintAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null): TransactionInstruction;
|
|
714
601
|
/**
|
|
715
602
|
* Create instruction for updating a compressed mint's freeze authority.
|
|
603
|
+
* Works for both compressed and decompressed mints.
|
|
716
604
|
*
|
|
717
605
|
* Output queue is automatically derived from mintInterface.merkleContext.treeInfo
|
|
718
606
|
* (preferring nextTreeInfo.queue if available for rollover support).
|
|
@@ -721,15 +609,9 @@ declare function createUpdateMintAuthorityInstruction(
|
|
|
721
609
|
* @param currentFreezeAuthority Current freeze authority public key (must sign)
|
|
722
610
|
* @param newFreezeAuthority New freeze authority (or null to revoke)
|
|
723
611
|
* @param payer Fee payer public key
|
|
724
|
-
* @param validityProof Validity proof for the compressed mint
|
|
612
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
725
613
|
*/
|
|
726
|
-
declare function createUpdateFreezeAuthorityInstruction(
|
|
727
|
-
mintInterface: MintInterface,
|
|
728
|
-
currentFreezeAuthority: PublicKey,
|
|
729
|
-
newFreezeAuthority: PublicKey | null,
|
|
730
|
-
payer: PublicKey,
|
|
731
|
-
validityProof: ValidityProofWithContext,
|
|
732
|
-
): TransactionInstruction;
|
|
614
|
+
declare function createUpdateFreezeAuthorityInstruction(mintInterface: MintInterface, currentFreezeAuthority: PublicKey, newFreezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null): TransactionInstruction;
|
|
733
615
|
|
|
734
616
|
/**
|
|
735
617
|
* Create instruction for updating a compressed mint's metadata field.
|
|
@@ -740,22 +622,13 @@ declare function createUpdateFreezeAuthorityInstruction(
|
|
|
740
622
|
* @param mintInterface MintInterface from getMintInterface() - must have merkleContext and tokenMetadata
|
|
741
623
|
* @param authority Metadata update authority public key (must sign)
|
|
742
624
|
* @param payer Fee payer public key
|
|
743
|
-
* @param validityProof Validity proof for the compressed mint
|
|
625
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
744
626
|
* @param fieldType Field to update: 'name', 'symbol', 'uri', or 'custom'
|
|
745
627
|
* @param value New value for the field
|
|
746
628
|
* @param customKey Custom key name (required if fieldType is 'custom')
|
|
747
629
|
* @param extensionIndex Extension index (default: 0)
|
|
748
630
|
*/
|
|
749
|
-
declare function createUpdateMetadataFieldInstruction(
|
|
750
|
-
mintInterface: MintInterface,
|
|
751
|
-
authority: PublicKey,
|
|
752
|
-
payer: PublicKey,
|
|
753
|
-
validityProof: ValidityProofWithContext,
|
|
754
|
-
fieldType: 'name' | 'symbol' | 'uri' | 'custom',
|
|
755
|
-
value: string,
|
|
756
|
-
customKey?: string,
|
|
757
|
-
extensionIndex?: number,
|
|
758
|
-
): TransactionInstruction;
|
|
631
|
+
declare function createUpdateMetadataFieldInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number): TransactionInstruction;
|
|
759
632
|
/**
|
|
760
633
|
* Create instruction for updating a compressed mint's metadata authority.
|
|
761
634
|
*
|
|
@@ -766,17 +639,10 @@ declare function createUpdateMetadataFieldInstruction(
|
|
|
766
639
|
* @param currentAuthority Current metadata update authority public key (must sign)
|
|
767
640
|
* @param newAuthority New metadata update authority public key
|
|
768
641
|
* @param payer Fee payer public key
|
|
769
|
-
* @param validityProof Validity proof for the compressed mint
|
|
642
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
770
643
|
* @param extensionIndex Extension index (default: 0)
|
|
771
644
|
*/
|
|
772
|
-
declare function createUpdateMetadataAuthorityInstruction(
|
|
773
|
-
mintInterface: MintInterface,
|
|
774
|
-
currentAuthority: PublicKey,
|
|
775
|
-
newAuthority: PublicKey,
|
|
776
|
-
payer: PublicKey,
|
|
777
|
-
validityProof: ValidityProofWithContext,
|
|
778
|
-
extensionIndex?: number,
|
|
779
|
-
): TransactionInstruction;
|
|
645
|
+
declare function createUpdateMetadataAuthorityInstruction(mintInterface: MintInterface, currentAuthority: PublicKey, newAuthority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, extensionIndex?: number): TransactionInstruction;
|
|
780
646
|
/**
|
|
781
647
|
* Create instruction for removing a metadata key from a compressed mint.
|
|
782
648
|
*
|
|
@@ -786,20 +652,12 @@ declare function createUpdateMetadataAuthorityInstruction(
|
|
|
786
652
|
* @param mintInterface MintInterface from getMintInterface() - must have merkleContext and tokenMetadata
|
|
787
653
|
* @param authority Metadata update authority public key (must sign)
|
|
788
654
|
* @param payer Fee payer public key
|
|
789
|
-
* @param validityProof Validity proof for the compressed mint
|
|
655
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
790
656
|
* @param key Metadata key to remove
|
|
791
657
|
* @param idempotent If true, don't error if key doesn't exist (default: false)
|
|
792
658
|
* @param extensionIndex Extension index (default: 0)
|
|
793
659
|
*/
|
|
794
|
-
declare function createRemoveMetadataKeyInstruction(
|
|
795
|
-
mintInterface: MintInterface,
|
|
796
|
-
authority: PublicKey,
|
|
797
|
-
payer: PublicKey,
|
|
798
|
-
validityProof: ValidityProofWithContext,
|
|
799
|
-
key: string,
|
|
800
|
-
idempotent?: boolean,
|
|
801
|
-
extensionIndex?: number,
|
|
802
|
-
): TransactionInstruction;
|
|
660
|
+
declare function createRemoveMetadataKeyInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, key: string, idempotent?: boolean, extensionIndex?: number): TransactionInstruction;
|
|
803
661
|
|
|
804
662
|
interface CompressToPubkey {
|
|
805
663
|
bump: number;
|
|
@@ -809,57 +667,75 @@ interface CompressToPubkey {
|
|
|
809
667
|
interface CompressibleConfig {
|
|
810
668
|
tokenAccountVersion: number;
|
|
811
669
|
rentPayment: number;
|
|
812
|
-
hasTopUp: number;
|
|
813
670
|
compressionOnly: number;
|
|
814
671
|
writeTopUp: number;
|
|
815
672
|
compressToAccountPubkey?: CompressToPubkey | null;
|
|
816
673
|
}
|
|
817
674
|
interface CreateAssociatedCTokenAccountParams {
|
|
818
|
-
|
|
819
|
-
compressibleConfig?: CompressibleConfig;
|
|
675
|
+
compressibleConfig?: CompressibleConfig | null;
|
|
820
676
|
}
|
|
677
|
+
/**
|
|
678
|
+
* Default compressible config for c-token ATAs - matches Rust SDK defaults.
|
|
679
|
+
*
|
|
680
|
+
* - tokenAccountVersion: 3 (ShaFlat) - latest hashing scheme
|
|
681
|
+
* - rentPayment: 16 - prepay 16 epochs (~24 hours rent)
|
|
682
|
+
* - compressionOnly: 1 - required for ATAs
|
|
683
|
+
* - writeTopUp: 766 - per-write top-up (~2 epochs rent) when rent < 2 epochs
|
|
684
|
+
* - compressToAccountPubkey: null - required for ATAs
|
|
685
|
+
*
|
|
686
|
+
* Cost breakdown at ATA creation:
|
|
687
|
+
* - Rent sponsor PDA (LIGHT_TOKEN_RENT_SPONSOR) pays: rent exemption (~890,880 lamports)
|
|
688
|
+
* - Fee payer pays: compression_cost (11K) + 16 epochs rent (~6,400) = ~17,400 lamports + tx fees
|
|
689
|
+
*
|
|
690
|
+
* Per-write top-up (transfers):
|
|
691
|
+
* - When account rent is below 2 epochs, fee payer pays 766 lamports top-up
|
|
692
|
+
* - This keeps the account perpetually funded when actively used
|
|
693
|
+
*
|
|
694
|
+
* Rent calculation (272-byte compressible ctoken account):
|
|
695
|
+
* - rent_per_epoch = base_rent (128) + bytes * rent_per_byte (272 * 1) = 400 lamports
|
|
696
|
+
* - 16 epochs = 16 * 400 = 6,400 lamports (24 hours)
|
|
697
|
+
* - 2 epochs = 2 * 400 = 800 lamports (~3 hours, writeTopUp = 766 is conservative)
|
|
698
|
+
*
|
|
699
|
+
* Account size breakdown (272 bytes):
|
|
700
|
+
* - 165 bytes: SPL token base layout
|
|
701
|
+
* - 1 byte: account_type discriminator
|
|
702
|
+
* - 1 byte: Option discriminator for extensions
|
|
703
|
+
* - 4 bytes: Vec length prefix
|
|
704
|
+
* - 1 byte: extension type discriminant
|
|
705
|
+
* - 4 bytes: CompressibleExtension header (decimals_option, decimals, compression_only, is_ata)
|
|
706
|
+
* - 96 bytes: CompressionInfo struct
|
|
707
|
+
*/
|
|
708
|
+
declare const DEFAULT_COMPRESSIBLE_CONFIG: CompressibleConfig;
|
|
821
709
|
/**
|
|
822
710
|
* Create instruction for creating an associated compressed token account.
|
|
711
|
+
* Uses the default rent sponsor PDA by default.
|
|
823
712
|
*
|
|
824
713
|
* @param feePayer Fee payer public key.
|
|
825
714
|
* @param owner Owner of the associated token account.
|
|
826
715
|
* @param mint Mint address.
|
|
827
|
-
* @param compressibleConfig
|
|
828
|
-
* @param configAccount
|
|
829
|
-
* @param rentPayerPda
|
|
830
|
-
*/
|
|
831
|
-
declare function createAssociatedCTokenAccountInstruction(
|
|
832
|
-
feePayer: PublicKey,
|
|
833
|
-
owner: PublicKey,
|
|
834
|
-
mint: PublicKey,
|
|
835
|
-
compressibleConfig?: CompressibleConfig,
|
|
836
|
-
configAccount?: PublicKey,
|
|
837
|
-
rentPayerPda?: PublicKey,
|
|
838
|
-
): TransactionInstruction;
|
|
716
|
+
* @param compressibleConfig Compressible configuration (defaults to rent sponsor config).
|
|
717
|
+
* @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
|
|
718
|
+
* @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
|
|
719
|
+
*/
|
|
720
|
+
declare function createAssociatedCTokenAccountInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
|
|
839
721
|
/**
|
|
840
722
|
* Create idempotent instruction for creating an associated compressed token account.
|
|
723
|
+
* Uses the default rent sponsor PDA by default.
|
|
841
724
|
*
|
|
842
725
|
* @param feePayer Fee payer public key.
|
|
843
726
|
* @param owner Owner of the associated token account.
|
|
844
727
|
* @param mint Mint address.
|
|
845
|
-
* @param compressibleConfig
|
|
846
|
-
* @param configAccount
|
|
847
|
-
* @param rentPayerPda
|
|
728
|
+
* @param compressibleConfig Compressible configuration (defaults to rent sponsor config).
|
|
729
|
+
* @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
|
|
730
|
+
* @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
|
|
848
731
|
*/
|
|
849
|
-
declare function createAssociatedCTokenAccountIdempotentInstruction(
|
|
850
|
-
feePayer: PublicKey,
|
|
851
|
-
owner: PublicKey,
|
|
852
|
-
mint: PublicKey,
|
|
853
|
-
compressibleConfig?: CompressibleConfig,
|
|
854
|
-
configAccount?: PublicKey,
|
|
855
|
-
rentPayerPda?: PublicKey,
|
|
856
|
-
): TransactionInstruction;
|
|
732
|
+
declare function createAssociatedCTokenAccountIdempotentInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
|
|
857
733
|
|
|
858
734
|
/**
|
|
859
735
|
* c-token-specific config for createAssociatedTokenAccountInterfaceInstruction
|
|
860
736
|
*/
|
|
861
737
|
interface CTokenConfig {
|
|
862
|
-
compressibleConfig?: CompressibleConfig;
|
|
738
|
+
compressibleConfig?: CompressibleConfig | null;
|
|
863
739
|
configAccount?: PublicKey;
|
|
864
740
|
rentPayerPda?: PublicKey;
|
|
865
741
|
}
|
|
@@ -876,15 +752,7 @@ interface CTokenConfig {
|
|
|
876
752
|
* @param associatedTokenProgramId Associated token program ID.
|
|
877
753
|
* @param ctokenConfig Optional c-token-specific configuration.
|
|
878
754
|
*/
|
|
879
|
-
declare function createAssociatedTokenAccountInterfaceInstruction(
|
|
880
|
-
payer: PublicKey,
|
|
881
|
-
associatedToken: PublicKey,
|
|
882
|
-
owner: PublicKey,
|
|
883
|
-
mint: PublicKey,
|
|
884
|
-
programId?: PublicKey,
|
|
885
|
-
associatedTokenProgramId?: PublicKey,
|
|
886
|
-
ctokenConfig?: CTokenConfig,
|
|
887
|
-
): TransactionInstruction;
|
|
755
|
+
declare function createAssociatedTokenAccountInterfaceInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
|
|
888
756
|
/**
|
|
889
757
|
* Create idempotent instruction for creating an associated token account (SPL,
|
|
890
758
|
* Token-2022, or c-token). Follows SPL Token API signature with optional c-token
|
|
@@ -898,43 +766,44 @@ declare function createAssociatedTokenAccountInterfaceInstruction(
|
|
|
898
766
|
* @param associatedTokenProgramId Associated token program ID.
|
|
899
767
|
* @param ctokenConfig Optional c-token-specific configuration.
|
|
900
768
|
*/
|
|
901
|
-
declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(
|
|
902
|
-
payer: PublicKey,
|
|
903
|
-
associatedToken: PublicKey,
|
|
904
|
-
owner: PublicKey,
|
|
905
|
-
mint: PublicKey,
|
|
906
|
-
programId?: PublicKey,
|
|
907
|
-
associatedTokenProgramId?: PublicKey,
|
|
908
|
-
ctokenConfig?: CTokenConfig,
|
|
909
|
-
): TransactionInstruction;
|
|
769
|
+
declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
|
|
910
770
|
/**
|
|
911
771
|
* Short alias for createAssociatedTokenAccountInterfaceIdempotentInstruction.
|
|
912
772
|
*/
|
|
913
773
|
declare const createAtaInterfaceIdempotentInstruction: typeof createAssociatedTokenAccountInterfaceIdempotentInstruction;
|
|
914
774
|
|
|
915
775
|
/**
|
|
916
|
-
*
|
|
776
|
+
* Parameters for creating a MintTo instruction.
|
|
777
|
+
*/
|
|
778
|
+
interface CreateMintToInstructionParams {
|
|
779
|
+
/** Mint account (CMint - decompressed compressed mint) */
|
|
780
|
+
mint: PublicKey;
|
|
781
|
+
/** Destination CToken account to mint to */
|
|
782
|
+
destination: PublicKey;
|
|
783
|
+
/** Amount of tokens to mint */
|
|
784
|
+
amount: number | bigint;
|
|
785
|
+
/** Mint authority (must be signer) */
|
|
786
|
+
authority: PublicKey;
|
|
787
|
+
/** Maximum lamports for rent and top-up combined. Transaction fails if exceeded. (0 = no limit) */
|
|
788
|
+
maxTopUp?: number;
|
|
789
|
+
/** Optional fee payer for rent top-ups. If not provided, authority pays. */
|
|
790
|
+
feePayer?: PublicKey;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Create instruction for minting tokens to a CToken account.
|
|
917
794
|
*
|
|
918
|
-
*
|
|
919
|
-
*
|
|
920
|
-
*
|
|
921
|
-
* @param
|
|
922
|
-
* @
|
|
923
|
-
* @param outputStateTreeInfo Output state tree info.
|
|
924
|
-
* @param recipientAccount Recipient onchain token account address.
|
|
925
|
-
* @param amount Amount to mint.
|
|
795
|
+
* This is a simple 3-4 account instruction for minting to decompressed CToken accounts.
|
|
796
|
+
* Uses discriminator 7 (CTokenMintTo).
|
|
797
|
+
*
|
|
798
|
+
* @param params - Mint instruction parameters
|
|
799
|
+
* @returns TransactionInstruction for minting tokens
|
|
926
800
|
*/
|
|
927
|
-
declare function createMintToInstruction(
|
|
928
|
-
authority: PublicKey,
|
|
929
|
-
payer: PublicKey,
|
|
930
|
-
validityProof: ValidityProofWithContext,
|
|
931
|
-
merkleContext: MerkleContext,
|
|
932
|
-
mintData: MintInstructionData,
|
|
933
|
-
outputStateTreeInfo: TreeInfo,
|
|
934
|
-
recipientAccount: PublicKey,
|
|
935
|
-
amount: number | bigint,
|
|
936
|
-
): TransactionInstruction;
|
|
801
|
+
declare function createMintToInstruction(params: CreateMintToInstructionParams): TransactionInstruction;
|
|
937
802
|
|
|
803
|
+
/** Default compressible config PDA (V1) */
|
|
804
|
+
declare const LIGHT_TOKEN_CONFIG: PublicKey;
|
|
805
|
+
/** Default rent sponsor PDA (V1) */
|
|
806
|
+
declare const LIGHT_TOKEN_RENT_SPONSOR: PublicKey;
|
|
938
807
|
/**
|
|
939
808
|
* Token data version enum - mirrors Rust TokenDataVersion
|
|
940
809
|
* Used for compressed token account hashing strategy
|
|
@@ -945,7 +814,7 @@ declare enum TokenDataVersion {
|
|
|
945
814
|
/** V2: Poseidon hash with big-endian amount, discriminator [0,0,0,0,0,0,0,3] */
|
|
946
815
|
V2 = 2,
|
|
947
816
|
/** ShaFlat: SHA256 hash of borsh-serialized data, discriminator [0,0,0,0,0,0,0,4] */
|
|
948
|
-
ShaFlat = 3
|
|
817
|
+
ShaFlat = 3
|
|
949
818
|
}
|
|
950
819
|
declare const POOL_SEED: Buffer$1<ArrayBuffer>;
|
|
951
820
|
declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
|
|
@@ -959,6 +828,47 @@ declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
|
959
828
|
declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
960
829
|
declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
961
830
|
declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
831
|
+
/**
|
|
832
|
+
* Rent configuration constants for compressible ctoken accounts.
|
|
833
|
+
* These match the Rust SDK defaults in program-libs/compressible/src/rent/config.rs
|
|
834
|
+
*/
|
|
835
|
+
/** Base rent per epoch (lamports) */
|
|
836
|
+
declare const BASE_RENT_PER_EPOCH = 128;
|
|
837
|
+
/** Rent per byte per epoch (lamports) */
|
|
838
|
+
declare const RENT_PER_BYTE_PER_EPOCH = 1;
|
|
839
|
+
/** Slots per rent epoch (1.5 hours) */
|
|
840
|
+
declare const SLOTS_PER_RENT_EPOCH = 13500;
|
|
841
|
+
/** Compression cost (lamports) - paid at account creation */
|
|
842
|
+
declare const COMPRESSION_COST = 10000;
|
|
843
|
+
/** Compression incentive (lamports) - paid at account creation */
|
|
844
|
+
declare const COMPRESSION_INCENTIVE = 1000;
|
|
845
|
+
/** Total compression cost (COMPRESSION_COST + COMPRESSION_INCENTIVE) */
|
|
846
|
+
declare const TOTAL_COMPRESSION_COST: number;
|
|
847
|
+
/**
|
|
848
|
+
* Compressible ctoken account size in bytes.
|
|
849
|
+
* = 165 (base SPL token) + 1 (account_type) + 1 (Option) + 4 (Vec len) + 1 (ext disc) + 4 (ext header) + 96 (CompressionInfo) = 272
|
|
850
|
+
* Source: program-libs/token-interface/src/state/token/top_up.rs MIN_SIZE_WITH_COMPRESSIBLE
|
|
851
|
+
*/
|
|
852
|
+
declare const COMPRESSIBLE_CTOKEN_ACCOUNT_SIZE = 272;
|
|
853
|
+
/**
|
|
854
|
+
* Calculate rent per epoch for a given account size.
|
|
855
|
+
* Formula: base_rent + (bytes * lamports_per_byte_per_epoch)
|
|
856
|
+
*/
|
|
857
|
+
declare function rentPerEpoch(bytes: number): number;
|
|
858
|
+
/**
|
|
859
|
+
* Default rent per epoch for a compressible ctoken account (272 bytes).
|
|
860
|
+
* = 128 + 272 = 400 lamports
|
|
861
|
+
*/
|
|
862
|
+
declare const COMPRESSIBLE_CTOKEN_RENT_PER_EPOCH: number;
|
|
863
|
+
/** Default prepaid epochs (24 hours = 16 epochs * 1.5h) */
|
|
864
|
+
declare const DEFAULT_PREPAY_EPOCHS = 16;
|
|
865
|
+
/** Default write top-up (lamports) - ~2 epochs rent */
|
|
866
|
+
declare const DEFAULT_WRITE_TOP_UP = 766;
|
|
867
|
+
/**
|
|
868
|
+
* Calculate fee payer cost at ATA creation.
|
|
869
|
+
* = compression_cost (11K) + (prepay_epochs * rent_per_epoch)
|
|
870
|
+
*/
|
|
871
|
+
declare function calculateFeePayerCostAtCreation(prepayEpochs?: number, accountBytes?: number): number;
|
|
962
872
|
|
|
963
873
|
/**
|
|
964
874
|
* Create instruction for minting tokens from a c-mint to compressed accounts.
|
|
@@ -976,79 +886,45 @@ declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer
|
|
|
976
886
|
* @param tokenAccountVersion Token account version (default:
|
|
977
887
|
* TokenDataVersion.ShaFlat).
|
|
978
888
|
*/
|
|
979
|
-
declare function createMintToCompressedInstruction(
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
recipient: PublicKey;
|
|
987
|
-
amount: number | bigint;
|
|
988
|
-
}>,
|
|
989
|
-
outputStateTreeInfo?: TreeInfo,
|
|
990
|
-
tokenAccountVersion?: TokenDataVersion,
|
|
991
|
-
): TransactionInstruction;
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* Create mint-to instruction for SPL, Token-2022, or compressed token mints.
|
|
889
|
+
declare function createMintToCompressedInstruction(authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, merkleContext: MerkleContext, mintData: MintInstructionData, recipients: Array<{
|
|
890
|
+
recipient: PublicKey;
|
|
891
|
+
amount: number | bigint;
|
|
892
|
+
}>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: TokenDataVersion): TransactionInstruction;
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Create mint-to instruction for SPL, Token-2022, or CToken mints.
|
|
995
896
|
* This instruction ONLY mints to decompressed/onchain token accounts.
|
|
996
897
|
*
|
|
997
|
-
*
|
|
898
|
+
* For CToken mints, the mint must be decompressed first (CMint account must exist on-chain).
|
|
899
|
+
*
|
|
900
|
+
* @param mintInterface Mint interface (SPL, Token-2022, or CToken).
|
|
998
901
|
* @param destination Destination onchain token account address.
|
|
999
902
|
* @param authority Mint authority public key.
|
|
1000
903
|
* @param payer Fee payer public key.
|
|
1001
904
|
* @param amount Amount to mint.
|
|
1002
|
-
* @param validityProof
|
|
1003
|
-
* @param multiSigners Multi-signature signer public keys.
|
|
905
|
+
* @param validityProof Not used (legacy parameter, kept for compatibility).
|
|
906
|
+
* @param multiSigners Multi-signature signer public keys (SPL/T22 only).
|
|
1004
907
|
*/
|
|
1005
|
-
declare function createMintToInterfaceInstruction(
|
|
1006
|
-
mintInterface: MintInterface,
|
|
1007
|
-
destination: PublicKey,
|
|
1008
|
-
authority: PublicKey,
|
|
1009
|
-
payer: PublicKey,
|
|
1010
|
-
amount: number | bigint,
|
|
1011
|
-
validityProof?: ValidityProofWithContext,
|
|
1012
|
-
multiSigners?: PublicKey[],
|
|
1013
|
-
): TransactionInstruction;
|
|
908
|
+
declare function createMintToInterfaceInstruction(mintInterface: MintInterface, destination: PublicKey, authority: PublicKey, payer: PublicKey, amount: number | bigint, validityProof?: ValidityProofWithContext, multiSigners?: PublicKey[]): TransactionInstruction;
|
|
1014
909
|
|
|
1015
910
|
/**
|
|
1016
|
-
* Create a
|
|
911
|
+
* Create a Light token transfer instruction.
|
|
912
|
+
*
|
|
913
|
+
* For c-token accounts with compressible extension, the program needs
|
|
914
|
+
* system_program and fee_payer to handle rent top-ups.
|
|
1017
915
|
*
|
|
1018
916
|
* @param source Source c-token account
|
|
1019
917
|
* @param destination Destination c-token account
|
|
1020
918
|
* @param owner Owner of the source account (signer, also pays for compressible extension top-ups)
|
|
1021
919
|
* @param amount Amount to transfer
|
|
1022
|
-
* @
|
|
1023
|
-
|
|
1024
|
-
declare function createCTokenTransferInstruction(
|
|
1025
|
-
source: PublicKey,
|
|
1026
|
-
destination: PublicKey,
|
|
1027
|
-
owner: PublicKey,
|
|
1028
|
-
amount: number | bigint,
|
|
1029
|
-
): TransactionInstruction;
|
|
1030
|
-
/**
|
|
1031
|
-
* Construct a transfer instruction for SPL/T22/c-token. Defaults to c-token
|
|
1032
|
-
* program. For cross-program transfers (SPL <> c-token), use `wrap`/`unwrap`.
|
|
1033
|
-
*
|
|
1034
|
-
* @param source Source token account
|
|
1035
|
-
* @param destination Destination token account
|
|
1036
|
-
* @param owner Owner of the source account (signer)
|
|
1037
|
-
* @param amount Amount to transfer
|
|
1038
|
-
* @returns instruction for c-token transfer
|
|
920
|
+
* @param feePayer Optional fee payer for top-ups (defaults to owner)
|
|
921
|
+
* @returns Transaction instruction for Light token transfer
|
|
1039
922
|
*/
|
|
1040
|
-
declare function
|
|
1041
|
-
source: PublicKey,
|
|
1042
|
-
destination: PublicKey,
|
|
1043
|
-
owner: PublicKey,
|
|
1044
|
-
amount: number | bigint,
|
|
1045
|
-
multiSigners?: (Signer | PublicKey)[],
|
|
1046
|
-
programId?: PublicKey,
|
|
1047
|
-
): TransactionInstruction;
|
|
923
|
+
declare function createLightTokenTransferInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
|
|
1048
924
|
|
|
1049
925
|
declare namespace BN {
|
|
1050
|
-
type Endianness =
|
|
1051
|
-
type IPrimeName =
|
|
926
|
+
type Endianness = "le" | "be";
|
|
927
|
+
type IPrimeName = "k256" | "p224" | "p192" | "p25519";
|
|
1052
928
|
|
|
1053
929
|
interface MPrime {
|
|
1054
930
|
name: string;
|
|
@@ -1070,7 +946,7 @@ declare class BN {
|
|
|
1070
946
|
|
|
1071
947
|
constructor(
|
|
1072
948
|
number: bigint | number | string | number[] | Uint8Array | Buffer | BN,
|
|
1073
|
-
base?: number |
|
|
949
|
+
base?: number | "hex",
|
|
1074
950
|
endian?: BN.Endianness,
|
|
1075
951
|
);
|
|
1076
952
|
constructor(
|
|
@@ -1116,7 +992,7 @@ declare class BN {
|
|
|
1116
992
|
/**
|
|
1117
993
|
* @description convert to base-string and pad with zeroes
|
|
1118
994
|
*/
|
|
1119
|
-
toString(base?: number |
|
|
995
|
+
toString(base?: number | "hex", length?: number): string;
|
|
1120
996
|
|
|
1121
997
|
/**
|
|
1122
998
|
* @description convert to Javascript Number (limited to 53 bits)
|
|
@@ -1376,11 +1252,7 @@ declare class BN {
|
|
|
1376
1252
|
/**
|
|
1377
1253
|
* @description division with remainder
|
|
1378
1254
|
*/
|
|
1379
|
-
divmod(
|
|
1380
|
-
b: BN,
|
|
1381
|
-
mode?: 'div' | 'mod',
|
|
1382
|
-
positive?: boolean,
|
|
1383
|
-
): { div: BN; mod: BN };
|
|
1255
|
+
divmod(b: BN, mode?: "div" | "mod", positive?: boolean): { div: BN; mod: BN };
|
|
1384
1256
|
|
|
1385
1257
|
/**
|
|
1386
1258
|
* @description reduct
|
|
@@ -1748,21 +1620,14 @@ declare function toTokenPoolInfo(info: SplInterfaceInfo): TokenPoolInfo;
|
|
|
1748
1620
|
*
|
|
1749
1621
|
* @returns SplInterfaceInfo for the to-be-initialized interface
|
|
1750
1622
|
*/
|
|
1751
|
-
declare function deriveSplInterfaceInfo(
|
|
1752
|
-
mint: PublicKey,
|
|
1753
|
-
tokenProgramId: PublicKey,
|
|
1754
|
-
poolIndex?: number,
|
|
1755
|
-
): SplInterfaceInfo;
|
|
1623
|
+
declare function deriveSplInterfaceInfo(mint: PublicKey, tokenProgramId: PublicKey, poolIndex?: number): SplInterfaceInfo;
|
|
1756
1624
|
/**
|
|
1757
1625
|
* Check if the SPL interface info is initialized and has a balance.
|
|
1758
1626
|
* @param mint The mint of the SPL interface
|
|
1759
1627
|
* @param splInterfaceInfo The SPL interface info (or TokenPoolInfo for backward compatibility)
|
|
1760
1628
|
* @returns True if the SPL interface info is initialized and has a balance
|
|
1761
1629
|
*/
|
|
1762
|
-
declare function checkSplInterfaceInfo(
|
|
1763
|
-
splInterfaceInfo: SplInterfaceInfo | TokenPoolInfo,
|
|
1764
|
-
mint: PublicKey,
|
|
1765
|
-
): boolean;
|
|
1630
|
+
declare function checkSplInterfaceInfo(splInterfaceInfo: SplInterfaceInfo | TokenPoolInfo, mint: PublicKey): boolean;
|
|
1766
1631
|
/**
|
|
1767
1632
|
* Get the SPL interface infos for a given mint.
|
|
1768
1633
|
* @param rpc The RPC client
|
|
@@ -1771,11 +1636,7 @@ declare function checkSplInterfaceInfo(
|
|
|
1771
1636
|
*
|
|
1772
1637
|
* @returns The SPL interface infos
|
|
1773
1638
|
*/
|
|
1774
|
-
declare function getSplInterfaceInfos(
|
|
1775
|
-
rpc: Rpc,
|
|
1776
|
-
mint: PublicKey,
|
|
1777
|
-
commitment?: Commitment,
|
|
1778
|
-
): Promise<SplInterfaceInfo[]>;
|
|
1639
|
+
declare function getSplInterfaceInfos(rpc: Rpc, mint: PublicKey, commitment?: Commitment): Promise<SplInterfaceInfo[]>;
|
|
1779
1640
|
type SplInterfaceActivity = {
|
|
1780
1641
|
signature: string;
|
|
1781
1642
|
amount: BN;
|
|
@@ -1787,7 +1648,7 @@ type SplInterfaceActivity = {
|
|
|
1787
1648
|
declare enum Action {
|
|
1788
1649
|
Compress = 1,
|
|
1789
1650
|
Decompress = 2,
|
|
1790
|
-
Transfer = 3
|
|
1651
|
+
Transfer = 3
|
|
1791
1652
|
}
|
|
1792
1653
|
/**
|
|
1793
1654
|
* For `compress` and `mintTo` instructions only.
|
|
@@ -1799,9 +1660,7 @@ declare enum Action {
|
|
|
1799
1660
|
*
|
|
1800
1661
|
* @returns A random SPL interface info
|
|
1801
1662
|
*/
|
|
1802
|
-
declare function selectSplInterfaceInfo(
|
|
1803
|
-
infos: SplInterfaceInfo[],
|
|
1804
|
-
): SplInterfaceInfo;
|
|
1663
|
+
declare function selectSplInterfaceInfo(infos: SplInterfaceInfo[]): SplInterfaceInfo;
|
|
1805
1664
|
/**
|
|
1806
1665
|
* Select one or multiple SPL interface infos from the SPL interface infos.
|
|
1807
1666
|
*
|
|
@@ -1814,10 +1673,7 @@ declare function selectSplInterfaceInfo(
|
|
|
1814
1673
|
*
|
|
1815
1674
|
* @returns Array with one or more SPL interface infos.
|
|
1816
1675
|
*/
|
|
1817
|
-
declare function selectSplInterfaceInfosForDecompression(
|
|
1818
|
-
infos: SplInterfaceInfo[],
|
|
1819
|
-
decompressAmount: number | BN,
|
|
1820
|
-
): SplInterfaceInfo[];
|
|
1676
|
+
declare function selectSplInterfaceInfosForDecompression(infos: SplInterfaceInfo[], decompressAmount: number | BN): SplInterfaceInfo[];
|
|
1821
1677
|
/**
|
|
1822
1678
|
* @deprecated Use {@link SplInterfaceActivity} instead.
|
|
1823
1679
|
*/
|
|
@@ -1825,26 +1681,15 @@ type TokenPoolActivity = SplInterfaceActivity;
|
|
|
1825
1681
|
/**
|
|
1826
1682
|
* @deprecated Use {@link deriveSplInterfaceInfo} instead.
|
|
1827
1683
|
*/
|
|
1828
|
-
declare function deriveTokenPoolInfo(
|
|
1829
|
-
mint: PublicKey,
|
|
1830
|
-
tokenProgramId: PublicKey,
|
|
1831
|
-
poolIndex?: number,
|
|
1832
|
-
): TokenPoolInfo;
|
|
1684
|
+
declare function deriveTokenPoolInfo(mint: PublicKey, tokenProgramId: PublicKey, poolIndex?: number): TokenPoolInfo;
|
|
1833
1685
|
/**
|
|
1834
1686
|
* @deprecated Use {@link checkSplInterfaceInfo} instead.
|
|
1835
1687
|
*/
|
|
1836
|
-
declare function checkTokenPoolInfo(
|
|
1837
|
-
tokenPoolInfo: TokenPoolInfo,
|
|
1838
|
-
mint: PublicKey,
|
|
1839
|
-
): boolean;
|
|
1688
|
+
declare function checkTokenPoolInfo(tokenPoolInfo: TokenPoolInfo, mint: PublicKey): boolean;
|
|
1840
1689
|
/**
|
|
1841
1690
|
* @deprecated Use {@link getSplInterfaceInfos} instead.
|
|
1842
1691
|
*/
|
|
1843
|
-
declare function getTokenPoolInfos(
|
|
1844
|
-
rpc: Rpc,
|
|
1845
|
-
mint: PublicKey,
|
|
1846
|
-
commitment?: Commitment,
|
|
1847
|
-
): Promise<TokenPoolInfo[]>;
|
|
1692
|
+
declare function getTokenPoolInfos(rpc: Rpc, mint: PublicKey, commitment?: Commitment): Promise<TokenPoolInfo[]>;
|
|
1848
1693
|
/**
|
|
1849
1694
|
* @deprecated Use {@link selectSplInterfaceInfo} instead.
|
|
1850
1695
|
*/
|
|
@@ -1852,10 +1697,7 @@ declare function selectTokenPoolInfo(infos: TokenPoolInfo[]): TokenPoolInfo;
|
|
|
1852
1697
|
/**
|
|
1853
1698
|
* @deprecated Use {@link selectSplInterfaceInfosForDecompression} instead.
|
|
1854
1699
|
*/
|
|
1855
|
-
declare function selectTokenPoolInfosForDecompression(
|
|
1856
|
-
infos: TokenPoolInfo[],
|
|
1857
|
-
decompressAmount: number | BN,
|
|
1858
|
-
): TokenPoolInfo[];
|
|
1700
|
+
declare function selectTokenPoolInfosForDecompression(infos: TokenPoolInfo[], decompressAmount: number | BN): TokenPoolInfo[];
|
|
1859
1701
|
|
|
1860
1702
|
/**
|
|
1861
1703
|
* Create decompressInterface instruction using Transfer2.
|
|
@@ -1873,26 +1715,17 @@ declare function selectTokenPoolInfosForDecompression(
|
|
|
1873
1715
|
* @param decimals Mint decimals (required for SPL destinations)
|
|
1874
1716
|
* @returns TransactionInstruction
|
|
1875
1717
|
*/
|
|
1876
|
-
declare function createDecompressInterfaceInstruction(
|
|
1877
|
-
payer: PublicKey,
|
|
1878
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
1879
|
-
toAddress: PublicKey,
|
|
1880
|
-
amount: bigint,
|
|
1881
|
-
validityProof: ValidityProofWithContext,
|
|
1882
|
-
splInterfaceInfo: SplInterfaceInfo | undefined,
|
|
1883
|
-
decimals: number,
|
|
1884
|
-
): TransactionInstruction;
|
|
1718
|
+
declare function createDecompressInterfaceInstruction(payer: PublicKey, inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: bigint, validityProof: ValidityProofWithContext, splInterfaceInfo: SplInterfaceInfo | undefined, decimals: number): TransactionInstruction;
|
|
1885
1719
|
|
|
1886
1720
|
declare const TokenAccountSourceType: {
|
|
1887
|
-
readonly Spl:
|
|
1888
|
-
readonly Token2022:
|
|
1889
|
-
readonly SplCold:
|
|
1890
|
-
readonly Token2022Cold:
|
|
1891
|
-
readonly CTokenHot:
|
|
1892
|
-
readonly CTokenCold:
|
|
1721
|
+
readonly Spl: "spl";
|
|
1722
|
+
readonly Token2022: "token2022";
|
|
1723
|
+
readonly SplCold: "spl-cold";
|
|
1724
|
+
readonly Token2022Cold: "token2022-cold";
|
|
1725
|
+
readonly CTokenHot: "ctoken-hot";
|
|
1726
|
+
readonly CTokenCold: "ctoken-cold";
|
|
1893
1727
|
};
|
|
1894
|
-
type TokenAccountSourceTypeValue =
|
|
1895
|
-
(typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
|
|
1728
|
+
type TokenAccountSourceTypeValue = (typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
|
|
1896
1729
|
/** @internal */
|
|
1897
1730
|
interface TokenAccountSource {
|
|
1898
1731
|
type: TokenAccountSourceTypeValue;
|
|
@@ -1919,36 +1752,25 @@ interface AccountInterface {
|
|
|
1919
1752
|
_mint?: PublicKey;
|
|
1920
1753
|
}
|
|
1921
1754
|
/** @internal */
|
|
1922
|
-
declare function convertTokenDataToAccount(
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
tlv: Buffer$1 | null;
|
|
1931
|
-
},
|
|
1932
|
-
): Account;
|
|
1755
|
+
declare function convertTokenDataToAccount(address: PublicKey, tokenData: {
|
|
1756
|
+
mint: PublicKey;
|
|
1757
|
+
owner: PublicKey;
|
|
1758
|
+
amount: BN;
|
|
1759
|
+
delegate: PublicKey | null;
|
|
1760
|
+
state: number;
|
|
1761
|
+
tlv: Buffer$1 | null;
|
|
1762
|
+
}): Account;
|
|
1933
1763
|
/** Convert compressed account to AccountInfo */
|
|
1934
|
-
declare function toAccountInfo(
|
|
1935
|
-
compressedAccount: CompressedAccountWithMerkleContext,
|
|
1936
|
-
): AccountInfo<Buffer$1>;
|
|
1764
|
+
declare function toAccountInfo(compressedAccount: CompressedAccountWithMerkleContext): AccountInfo<Buffer$1>;
|
|
1937
1765
|
/** @internal */
|
|
1938
|
-
declare function parseCTokenHot(
|
|
1939
|
-
address: PublicKey,
|
|
1940
|
-
accountInfo: AccountInfo<Buffer$1>,
|
|
1941
|
-
): {
|
|
1766
|
+
declare function parseCTokenHot(address: PublicKey, accountInfo: AccountInfo<Buffer$1>): {
|
|
1942
1767
|
accountInfo: AccountInfo<Buffer$1>;
|
|
1943
1768
|
loadContext: undefined;
|
|
1944
1769
|
parsed: Account;
|
|
1945
1770
|
isCold: false;
|
|
1946
1771
|
};
|
|
1947
1772
|
/** @internal */
|
|
1948
|
-
declare function parseCTokenCold(
|
|
1949
|
-
address: PublicKey,
|
|
1950
|
-
compressedAccount: CompressedAccountWithMerkleContext,
|
|
1951
|
-
): {
|
|
1773
|
+
declare function parseCTokenCold(address: PublicKey, compressedAccount: CompressedAccountWithMerkleContext): {
|
|
1952
1774
|
accountInfo: AccountInfo<Buffer$1>;
|
|
1953
1775
|
loadContext: MerkleContext;
|
|
1954
1776
|
parsed: Account;
|
|
@@ -1964,12 +1786,7 @@ declare function parseCTokenCold(
|
|
|
1964
1786
|
*
|
|
1965
1787
|
* @return Token account information with compression context if applicable
|
|
1966
1788
|
*/
|
|
1967
|
-
declare function getAccountInterface(
|
|
1968
|
-
rpc: Rpc,
|
|
1969
|
-
address: PublicKey,
|
|
1970
|
-
commitment?: Commitment,
|
|
1971
|
-
programId?: PublicKey,
|
|
1972
|
-
): Promise<AccountInterface>;
|
|
1789
|
+
declare function getAccountInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
|
|
1973
1790
|
|
|
1974
1791
|
/**
|
|
1975
1792
|
* Options for interface operations (load, transfer)
|
|
@@ -1981,34 +1798,95 @@ interface InterfaceOptions {
|
|
|
1981
1798
|
/**
|
|
1982
1799
|
* Transfer tokens using the c-token interface.
|
|
1983
1800
|
*
|
|
1984
|
-
*
|
|
1801
|
+
* High-level action: resolves balances, builds all instructions (load +
|
|
1802
|
+
* transfer), signs, and sends. Creates the recipient ATA if it does not exist.
|
|
1803
|
+
*
|
|
1804
|
+
* For instruction-level control, use `createTransferInterfaceInstructions`.
|
|
1985
1805
|
*
|
|
1986
1806
|
* @param rpc RPC connection
|
|
1987
1807
|
* @param payer Fee payer (signer)
|
|
1988
1808
|
* @param source Source c-token ATA address
|
|
1989
1809
|
* @param mint Mint address
|
|
1990
|
-
* @param destination
|
|
1810
|
+
* @param destination Recipient wallet public key
|
|
1991
1811
|
* @param owner Source owner (signer)
|
|
1992
1812
|
* @param amount Amount to transfer
|
|
1993
|
-
* @param programId Token program ID (default:
|
|
1813
|
+
* @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
|
|
1994
1814
|
* @param confirmOptions Optional confirm options
|
|
1995
1815
|
* @param options Optional interface options
|
|
1996
1816
|
* @param wrap Include SPL/T22 wrapping (default: false)
|
|
1997
|
-
* @returns Transaction signature
|
|
1817
|
+
* @returns Transaction signature of the transfer transaction
|
|
1818
|
+
*/
|
|
1819
|
+
declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer, amount: number | bigint | BN, programId?: PublicKey, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, wrap?: boolean): Promise<TransactionSignature>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Options for createTransferInterfaceInstructions.
|
|
1822
|
+
*/
|
|
1823
|
+
interface TransferOptions extends InterfaceOptions {
|
|
1824
|
+
/** Include SPL/T22 wrapping to c-token ATA (unified path). Default: false. */
|
|
1825
|
+
wrap?: boolean;
|
|
1826
|
+
/** Token program ID. Default: LIGHT_TOKEN_PROGRAM_ID. */
|
|
1827
|
+
programId?: PublicKey;
|
|
1828
|
+
/**
|
|
1829
|
+
* Include an idempotent recipient ATA creation instruction in the
|
|
1830
|
+
* transfer transaction. No extra RPC fetch -- uses
|
|
1831
|
+
* createAssociatedTokenAccountInterfaceIdempotentInstruction which is
|
|
1832
|
+
* a no-op on-chain if the ATA already exists (~200 CU overhead).
|
|
1833
|
+
* Default: true.
|
|
1834
|
+
*/
|
|
1835
|
+
ensureRecipientAta?: boolean;
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Splits the last element from an array.
|
|
1839
|
+
*
|
|
1840
|
+
* Useful for separating load transactions (parallel) from the final transfer
|
|
1841
|
+
* transaction (sequential) returned by `createTransferInterfaceInstructions`.
|
|
1842
|
+
*
|
|
1843
|
+
* @returns `{ rest, last }` where `rest` is everything before the last
|
|
1844
|
+
* element and `last` is the last element.
|
|
1845
|
+
* @throws if the input array is empty.
|
|
1846
|
+
*/
|
|
1847
|
+
declare function sliceLast<T>(items: T[]): {
|
|
1848
|
+
rest: T[];
|
|
1849
|
+
last: T;
|
|
1850
|
+
};
|
|
1851
|
+
/**
|
|
1852
|
+
* Create instructions for a c-token transfer.
|
|
1853
|
+
*
|
|
1854
|
+
* Returns `TransactionInstruction[][]` -- an array of transaction instruction
|
|
1855
|
+
* arrays. Each inner array is one transaction to sign and send.
|
|
1856
|
+
*
|
|
1857
|
+
* - All transactions except the last can be sent in parallel (load/decompress).
|
|
1858
|
+
* - The last transaction is the transfer and must be sent after all others
|
|
1859
|
+
* confirm.
|
|
1860
|
+
* - For a hot sender or <=8 cold inputs, the result is a single-element array.
|
|
1861
|
+
*
|
|
1862
|
+
* Use `sliceLast` to separate the parallel prefix from the final transfer:
|
|
1863
|
+
* ```
|
|
1864
|
+
* const batches = await createTransferInterfaceInstructions(...);
|
|
1865
|
+
* const { rest, last } = sliceLast(batches);
|
|
1866
|
+
* ```
|
|
1867
|
+
*
|
|
1868
|
+
* When `ensureRecipientAta` is true (the default), an idempotent ATA creation
|
|
1869
|
+
* instruction is included in the transfer (last) transaction. No extra RPC
|
|
1870
|
+
* fetch -- the instruction is a no-op on-chain if the ATA already exists.
|
|
1871
|
+
* Set `ensureRecipientAta: false` if you manage recipient ATAs yourself.
|
|
1872
|
+
*
|
|
1873
|
+
* All transactions require payer + sender as signers.
|
|
1874
|
+
*
|
|
1875
|
+
* Hash uniqueness guarantee: all compressed accounts for the sender are
|
|
1876
|
+
* fetched once, then partitioned into non-overlapping chunks by tree version.
|
|
1877
|
+
* Each hash appears in exactly one batch. This is enforced at runtime by
|
|
1878
|
+
* `assertUniqueInputHashes` inside `_buildLoadBatches`.
|
|
1879
|
+
*
|
|
1880
|
+
* @param rpc RPC connection
|
|
1881
|
+
* @param payer Fee payer public key
|
|
1882
|
+
* @param mint Mint address
|
|
1883
|
+
* @param amount Amount to transfer
|
|
1884
|
+
* @param sender Sender public key (must sign all transactions)
|
|
1885
|
+
* @param recipient Recipient public key
|
|
1886
|
+
* @param options Optional configuration
|
|
1887
|
+
* @returns TransactionInstruction[][] -- send [0..n-2] in parallel, then [n-1]
|
|
1998
1888
|
*/
|
|
1999
|
-
declare function
|
|
2000
|
-
rpc: Rpc,
|
|
2001
|
-
payer: Signer,
|
|
2002
|
-
source: PublicKey,
|
|
2003
|
-
mint: PublicKey,
|
|
2004
|
-
destination: PublicKey,
|
|
2005
|
-
owner: Signer,
|
|
2006
|
-
amount: number | bigint | BN,
|
|
2007
|
-
programId?: PublicKey,
|
|
2008
|
-
confirmOptions?: ConfirmOptions,
|
|
2009
|
-
options?: InterfaceOptions,
|
|
2010
|
-
wrap?: boolean,
|
|
2011
|
-
): Promise<TransactionSignature>;
|
|
1889
|
+
declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, recipient: PublicKey, options?: TransferOptions): Promise<TransactionInstruction[][]>;
|
|
2012
1890
|
|
|
2013
1891
|
/**
|
|
2014
1892
|
* Account info interface for compressible accounts.
|
|
@@ -2100,7 +1978,7 @@ interface LoadResult {
|
|
|
2100
1978
|
* ```typescript
|
|
2101
1979
|
* const poolInfo = await myProgram.fetchPoolState(rpc, poolAddress);
|
|
2102
1980
|
* const vault0Ata = getAssociatedTokenAddressInterface(token0Mint, poolAddress);
|
|
2103
|
-
* const vault0Info = await getAtaInterface(rpc, vault0Ata, poolAddress, token0Mint, undefined,
|
|
1981
|
+
* const vault0Info = await getAtaInterface(rpc, vault0Ata, poolAddress, token0Mint, undefined, LIGHT_TOKEN_PROGRAM_ID);
|
|
2104
1982
|
* const userAta = getAssociatedTokenAddressInterface(tokenMint, userWallet);
|
|
2105
1983
|
* const userAtaInfo = await getAtaInterface(rpc, userAta, userWallet, tokenMint);
|
|
2106
1984
|
*
|
|
@@ -2129,21 +2007,11 @@ interface LoadResult {
|
|
|
2129
2007
|
* }
|
|
2130
2008
|
* ```
|
|
2131
2009
|
*/
|
|
2132
|
-
declare function createLoadAccountsParams(
|
|
2133
|
-
rpc: Rpc,
|
|
2134
|
-
payer: PublicKey,
|
|
2135
|
-
programId: PublicKey,
|
|
2136
|
-
programAccounts?: CompressibleAccountInput[],
|
|
2137
|
-
atas?: AccountInterface[],
|
|
2138
|
-
options?: InterfaceOptions,
|
|
2139
|
-
): Promise<LoadResult>;
|
|
2010
|
+
declare function createLoadAccountsParams(rpc: Rpc, payer: PublicKey, programId: PublicKey, programAccounts?: CompressibleAccountInput[], atas?: AccountInterface[], options?: InterfaceOptions): Promise<LoadResult>;
|
|
2140
2011
|
/**
|
|
2141
2012
|
* Calculate compute units for compressible load operation
|
|
2142
2013
|
*/
|
|
2143
|
-
declare function calculateCompressibleLoadComputeUnits(
|
|
2144
|
-
compressedAccountCount: number,
|
|
2145
|
-
hasValidityProof: boolean,
|
|
2146
|
-
): number;
|
|
2014
|
+
declare function calculateCompressibleLoadComputeUnits(compressedAccountCount: number, hasValidityProof: boolean): number;
|
|
2147
2015
|
|
|
2148
2016
|
/**
|
|
2149
2017
|
* Create a wrap instruction that moves tokens from an SPL/T22 account to a
|
|
@@ -2159,16 +2027,23 @@ declare function calculateCompressibleLoadComputeUnits(
|
|
|
2159
2027
|
* @param payer Fee payer (defaults to owner)
|
|
2160
2028
|
* @returns Instruction to wrap tokens
|
|
2161
2029
|
*/
|
|
2162
|
-
declare function createWrapInstruction(
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2030
|
+
declare function createWrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
|
|
2031
|
+
|
|
2032
|
+
/**
|
|
2033
|
+
* Create an unwrap instruction that moves tokens from a c-token account to an
|
|
2034
|
+
* SPL/T22 account.
|
|
2035
|
+
*
|
|
2036
|
+
* @param source Source c-token account
|
|
2037
|
+
* @param destination Destination SPL/T22 token account
|
|
2038
|
+
* @param owner Owner of the source account (signer)
|
|
2039
|
+
* @param mint Mint address
|
|
2040
|
+
* @param amount Amount to unwrap,
|
|
2041
|
+
* @param splInterfaceInfo SPL interface info for the decompression
|
|
2042
|
+
* @param decimals Mint decimals (required for transfer_checked)
|
|
2043
|
+
* @param payer Fee payer (defaults to owner if not provided)
|
|
2044
|
+
* @returns TransactionInstruction to unwrap tokens
|
|
2045
|
+
*/
|
|
2046
|
+
declare function createUnwrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
|
|
2172
2047
|
|
|
2173
2048
|
/**
|
|
2174
2049
|
* Create and initialize a new mint for SPL/T22/c-token.
|
|
@@ -2180,32 +2055,21 @@ declare function createWrapInstruction(
|
|
|
2180
2055
|
* @param decimals Location of the decimal place
|
|
2181
2056
|
* @param keypair Mint keypair (defaults to a random keypair)
|
|
2182
2057
|
* @param confirmOptions Confirm options
|
|
2183
|
-
* @param programId Token program ID (defaults to
|
|
2058
|
+
* @param programId Token program ID (defaults to LIGHT_TOKEN_PROGRAM_ID)
|
|
2184
2059
|
* @param tokenMetadata Optional token metadata (c-token mints only)
|
|
2185
2060
|
* @param outputStateTreeInfo Optional output state tree info (c-token mints only)
|
|
2186
2061
|
* @param addressTreeInfo Optional address tree info (c-token mints only)
|
|
2187
2062
|
*
|
|
2188
2063
|
* @returns Object with mint address and transaction signature
|
|
2189
2064
|
*/
|
|
2190
|
-
declare function createMintInterface(
|
|
2191
|
-
rpc: Rpc,
|
|
2192
|
-
payer: Signer,
|
|
2193
|
-
mintAuthority: PublicKey | Signer,
|
|
2194
|
-
freezeAuthority: PublicKey | Signer | null,
|
|
2195
|
-
decimals: number,
|
|
2196
|
-
keypair?: Keypair,
|
|
2197
|
-
confirmOptions?: ConfirmOptions,
|
|
2198
|
-
programId?: PublicKey,
|
|
2199
|
-
tokenMetadata?: TokenMetadataInstructionData,
|
|
2200
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2201
|
-
addressTreeInfo?: AddressTreeInfo,
|
|
2202
|
-
): Promise<{
|
|
2065
|
+
declare function createMintInterface(rpc: Rpc, payer: Signer, mintAuthority: PublicKey | Signer, freezeAuthority: PublicKey | Signer | null, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, programId?: PublicKey, tokenMetadata?: TokenMetadataInstructionData, outputStateTreeInfo?: TreeInfo, addressTreeInfo?: AddressTreeInfo): Promise<{
|
|
2203
2066
|
mint: PublicKey;
|
|
2204
2067
|
transactionSignature: TransactionSignature;
|
|
2205
2068
|
}>;
|
|
2206
2069
|
|
|
2207
2070
|
/**
|
|
2208
2071
|
* Update the mint authority of a compressed token mint.
|
|
2072
|
+
* Works for both compressed and decompressed mints.
|
|
2209
2073
|
*
|
|
2210
2074
|
* @param rpc RPC connection
|
|
2211
2075
|
* @param payer Fee payer (signer)
|
|
@@ -2214,16 +2078,10 @@ declare function createMintInterface(
|
|
|
2214
2078
|
* @param newMintAuthority New mint authority (or null to revoke)
|
|
2215
2079
|
* @param confirmOptions Optional confirm options
|
|
2216
2080
|
*/
|
|
2217
|
-
declare function updateMintAuthority(
|
|
2218
|
-
rpc: Rpc,
|
|
2219
|
-
payer: Signer,
|
|
2220
|
-
mint: PublicKey,
|
|
2221
|
-
currentMintAuthority: Signer,
|
|
2222
|
-
newMintAuthority: PublicKey | null,
|
|
2223
|
-
confirmOptions?: ConfirmOptions,
|
|
2224
|
-
): Promise<TransactionSignature>;
|
|
2081
|
+
declare function updateMintAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentMintAuthority: Signer, newMintAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2225
2082
|
/**
|
|
2226
2083
|
* Update the freeze authority of a compressed token mint.
|
|
2084
|
+
* Works for both compressed and decompressed mints.
|
|
2227
2085
|
*
|
|
2228
2086
|
* @param rpc RPC connection
|
|
2229
2087
|
* @param payer Fee payer (signer)
|
|
@@ -2232,17 +2090,11 @@ declare function updateMintAuthority(
|
|
|
2232
2090
|
* @param newFreezeAuthority New freeze authority (or null to revoke)
|
|
2233
2091
|
* @param confirmOptions Optional confirm options
|
|
2234
2092
|
*/
|
|
2235
|
-
declare function updateFreezeAuthority(
|
|
2236
|
-
rpc: Rpc,
|
|
2237
|
-
payer: Signer,
|
|
2238
|
-
mint: PublicKey,
|
|
2239
|
-
currentFreezeAuthority: Signer,
|
|
2240
|
-
newFreezeAuthority: PublicKey | null,
|
|
2241
|
-
confirmOptions?: ConfirmOptions,
|
|
2242
|
-
): Promise<TransactionSignature>;
|
|
2093
|
+
declare function updateFreezeAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentFreezeAuthority: Signer, newFreezeAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2243
2094
|
|
|
2244
2095
|
/**
|
|
2245
2096
|
* Update a metadata field on a compressed token mint.
|
|
2097
|
+
* Works for both compressed and decompressed mints.
|
|
2246
2098
|
*
|
|
2247
2099
|
* @param rpc RPC connection
|
|
2248
2100
|
* @param payer Fee payer (signer)
|
|
@@ -2254,19 +2106,10 @@ declare function updateFreezeAuthority(
|
|
|
2254
2106
|
* @param extensionIndex Extension index (default: 0)
|
|
2255
2107
|
* @param confirmOptions Optional confirm options
|
|
2256
2108
|
*/
|
|
2257
|
-
declare function updateMetadataField(
|
|
2258
|
-
rpc: Rpc,
|
|
2259
|
-
payer: Signer,
|
|
2260
|
-
mint: PublicKey,
|
|
2261
|
-
authority: Signer,
|
|
2262
|
-
fieldType: 'name' | 'symbol' | 'uri' | 'custom',
|
|
2263
|
-
value: string,
|
|
2264
|
-
customKey?: string,
|
|
2265
|
-
extensionIndex?: number,
|
|
2266
|
-
confirmOptions?: ConfirmOptions,
|
|
2267
|
-
): Promise<TransactionSignature>;
|
|
2109
|
+
declare function updateMetadataField(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2268
2110
|
/**
|
|
2269
2111
|
* Update the metadata authority of a compressed token mint.
|
|
2112
|
+
* Works for both compressed and decompressed mints.
|
|
2270
2113
|
*
|
|
2271
2114
|
* @param rpc RPC connection
|
|
2272
2115
|
* @param payer Fee payer (signer)
|
|
@@ -2276,17 +2119,10 @@ declare function updateMetadataField(
|
|
|
2276
2119
|
* @param extensionIndex Extension index (default: 0)
|
|
2277
2120
|
* @param confirmOptions Optional confirm options
|
|
2278
2121
|
*/
|
|
2279
|
-
declare function updateMetadataAuthority(
|
|
2280
|
-
rpc: Rpc,
|
|
2281
|
-
payer: Signer,
|
|
2282
|
-
mint: PublicKey,
|
|
2283
|
-
currentAuthority: Signer,
|
|
2284
|
-
newAuthority: PublicKey,
|
|
2285
|
-
extensionIndex?: number,
|
|
2286
|
-
confirmOptions?: ConfirmOptions,
|
|
2287
|
-
): Promise<TransactionSignature>;
|
|
2122
|
+
declare function updateMetadataAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentAuthority: Signer, newAuthority: PublicKey, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2288
2123
|
/**
|
|
2289
2124
|
* Remove a metadata key from a compressed token mint.
|
|
2125
|
+
* Works for both compressed and decompressed mints.
|
|
2290
2126
|
*
|
|
2291
2127
|
* @param rpc RPC connection
|
|
2292
2128
|
* @param payer Fee payer (signer)
|
|
@@ -2297,16 +2133,7 @@ declare function updateMetadataAuthority(
|
|
|
2297
2133
|
* @param extensionIndex Extension index (default: 0)
|
|
2298
2134
|
* @param confirmOptions Optional confirm options
|
|
2299
2135
|
*/
|
|
2300
|
-
declare function removeMetadataKey(
|
|
2301
|
-
rpc: Rpc,
|
|
2302
|
-
payer: Signer,
|
|
2303
|
-
mint: PublicKey,
|
|
2304
|
-
authority: Signer,
|
|
2305
|
-
key: string,
|
|
2306
|
-
idempotent?: boolean,
|
|
2307
|
-
extensionIndex?: number,
|
|
2308
|
-
confirmOptions?: ConfirmOptions,
|
|
2309
|
-
): Promise<TransactionSignature>;
|
|
2136
|
+
declare function removeMetadataKey(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, key: string, idempotent?: boolean, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2310
2137
|
|
|
2311
2138
|
/**
|
|
2312
2139
|
* Create an associated token account for SPL/T22/c-token. Defaults to c-token
|
|
@@ -2319,23 +2146,13 @@ declare function removeMetadataKey(
|
|
|
2319
2146
|
* @param allowOwnerOffCurve Allow owner to be a PDA (default: false)
|
|
2320
2147
|
* @param confirmOptions Options for confirming the transaction
|
|
2321
2148
|
* @param programId Token program ID (default:
|
|
2322
|
-
*
|
|
2149
|
+
* LIGHT_TOKEN_PROGRAM_ID)
|
|
2323
2150
|
* @param associatedTokenProgramId ATA program ID (auto-derived if not
|
|
2324
2151
|
* provided)
|
|
2325
2152
|
* @param ctokenConfig Optional rent config
|
|
2326
2153
|
* @returns Address of the new associated token account
|
|
2327
2154
|
*/
|
|
2328
|
-
declare function createAtaInterface(
|
|
2329
|
-
rpc: Rpc,
|
|
2330
|
-
payer: Signer,
|
|
2331
|
-
mint: PublicKey,
|
|
2332
|
-
owner: PublicKey,
|
|
2333
|
-
allowOwnerOffCurve?: boolean,
|
|
2334
|
-
confirmOptions?: ConfirmOptions,
|
|
2335
|
-
programId?: PublicKey,
|
|
2336
|
-
associatedTokenProgramId?: PublicKey,
|
|
2337
|
-
ctokenConfig?: CTokenConfig,
|
|
2338
|
-
): Promise<PublicKey>;
|
|
2155
|
+
declare function createAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
|
|
2339
2156
|
/**
|
|
2340
2157
|
* Create an associated token account idempotently for SPL/T22/c-token. Defaults
|
|
2341
2158
|
* to c-token program.
|
|
@@ -2349,35 +2166,32 @@ declare function createAtaInterface(
|
|
|
2349
2166
|
* @param allowOwnerOffCurve Allow owner to be a PDA (default: false)
|
|
2350
2167
|
* @param confirmOptions Options for confirming the transaction
|
|
2351
2168
|
* @param programId Token program ID (default:
|
|
2352
|
-
*
|
|
2169
|
+
* LIGHT_TOKEN_PROGRAM_ID)
|
|
2353
2170
|
* @param associatedTokenProgramId ATA program ID (auto-derived if not
|
|
2354
2171
|
* provided)
|
|
2355
2172
|
* @param ctokenConfig Optional c-token-specific configuration
|
|
2356
2173
|
*
|
|
2357
2174
|
* @returns Address of the associated token account
|
|
2358
2175
|
*/
|
|
2359
|
-
declare function createAtaInterfaceIdempotent(
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
)
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
outputQueue?: PublicKey,
|
|
2379
|
-
confirmOptions?: ConfirmOptions,
|
|
2380
|
-
): Promise<TransactionSignature>;
|
|
2176
|
+
declare function createAtaInterfaceIdempotent(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
|
|
2177
|
+
|
|
2178
|
+
/**
|
|
2179
|
+
* Mint tokens to a CToken account.
|
|
2180
|
+
*
|
|
2181
|
+
* This is a simple mint instruction for minting to decompressed CToken accounts.
|
|
2182
|
+
* The mint must be decompressed (CMint account must exist on-chain).
|
|
2183
|
+
*
|
|
2184
|
+
* @param rpc - RPC connection
|
|
2185
|
+
* @param payer - Fee payer (signer)
|
|
2186
|
+
* @param mint - Mint address (CMint account)
|
|
2187
|
+
* @param destination - Destination CToken account
|
|
2188
|
+
* @param authority - Mint authority (signer)
|
|
2189
|
+
* @param amount - Amount to mint
|
|
2190
|
+
* @param maxTopUp - Optional maximum lamports for rent top-up
|
|
2191
|
+
* @param confirmOptions - Optional confirm options
|
|
2192
|
+
* @returns Transaction signature
|
|
2193
|
+
*/
|
|
2194
|
+
declare function mintTo$1(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer, amount: number | bigint, maxTopUp?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2381
2195
|
|
|
2382
2196
|
/**
|
|
2383
2197
|
* Mint compressed tokens directly to compressed accounts.
|
|
@@ -2391,50 +2205,33 @@ declare function mintTo$1(
|
|
|
2391
2205
|
* @param tokenAccountVersion Token account version (default: 3)
|
|
2392
2206
|
* @param confirmOptions Optional confirm options
|
|
2393
2207
|
*/
|
|
2394
|
-
declare function mintToCompressed(
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
authority: Signer,
|
|
2399
|
-
recipients: Array<{
|
|
2400
|
-
recipient: PublicKey;
|
|
2401
|
-
amount: number | bigint;
|
|
2402
|
-
}>,
|
|
2403
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2404
|
-
tokenAccountVersion?: number,
|
|
2405
|
-
confirmOptions?: ConfirmOptions,
|
|
2406
|
-
): Promise<TransactionSignature>;
|
|
2208
|
+
declare function mintToCompressed(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, recipients: Array<{
|
|
2209
|
+
recipient: PublicKey;
|
|
2210
|
+
amount: number | bigint;
|
|
2211
|
+
}>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2407
2212
|
|
|
2408
2213
|
/**
|
|
2409
2214
|
* Mint tokens to a decompressed/onchain token account.
|
|
2410
|
-
* Works with SPL, Token-2022, and
|
|
2215
|
+
* Works with SPL, Token-2022, and CToken mints.
|
|
2411
2216
|
*
|
|
2412
2217
|
* This function ONLY mints to decompressed onchain token accounts, never to compressed accounts.
|
|
2218
|
+
* For CToken mints, the mint must be decompressed first (CMint account must exist on-chain).
|
|
2219
|
+
*
|
|
2413
2220
|
* The signature matches the standard SPL mintTo for simplicity and consistency.
|
|
2414
2221
|
*
|
|
2415
2222
|
* @param rpc - RPC connection to use
|
|
2416
2223
|
* @param payer - Transaction fee payer
|
|
2417
|
-
* @param mint - Mint address (SPL, Token-2022, or
|
|
2224
|
+
* @param mint - Mint address (SPL, Token-2022, or CToken mint)
|
|
2418
2225
|
* @param destination - Destination token account address (must be an existing onchain token account)
|
|
2419
2226
|
* @param authority - Mint authority (can be Signer or PublicKey if multiSigners provided)
|
|
2420
2227
|
* @param amount - Amount to mint
|
|
2421
2228
|
* @param multiSigners - Optional: Multi-signature signers (default: [])
|
|
2422
2229
|
* @param confirmOptions - Optional: Transaction confirmation options
|
|
2423
|
-
* @param programId - Optional: Token program ID
|
|
2230
|
+
* @param programId - Optional: Token program ID. If undefined, auto-detects.
|
|
2424
2231
|
*
|
|
2425
2232
|
* @returns Transaction signature
|
|
2426
2233
|
*/
|
|
2427
|
-
declare function mintToInterface(
|
|
2428
|
-
rpc: Rpc,
|
|
2429
|
-
payer: Signer,
|
|
2430
|
-
mint: PublicKey,
|
|
2431
|
-
destination: PublicKey,
|
|
2432
|
-
authority: Signer | PublicKey,
|
|
2433
|
-
amount: number | bigint,
|
|
2434
|
-
multiSigners?: Signer[],
|
|
2435
|
-
confirmOptions?: ConfirmOptions,
|
|
2436
|
-
programId?: PublicKey,
|
|
2437
|
-
): Promise<TransactionSignature>;
|
|
2234
|
+
declare function mintToInterface(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer | PublicKey, amount: number | bigint, multiSigners?: Signer[], confirmOptions?: ConfirmOptions, programId?: PublicKey): Promise<TransactionSignature>;
|
|
2438
2235
|
|
|
2439
2236
|
/**
|
|
2440
2237
|
* Retrieve the associated token account, or create it if it doesn't exist.
|
|
@@ -2453,23 +2250,13 @@ declare function mintToInterface(
|
|
|
2453
2250
|
* state.
|
|
2454
2251
|
* @param confirmOptions Options for confirming the transaction
|
|
2455
2252
|
* @param programId Token program ID (defaults to
|
|
2456
|
-
*
|
|
2253
|
+
* LIGHT_TOKEN_PROGRAM_ID)
|
|
2457
2254
|
* @param associatedTokenProgramId Associated token program ID (auto-derived if
|
|
2458
2255
|
* not provided)
|
|
2459
2256
|
*
|
|
2460
2257
|
* @returns AccountInterface with aggregated balance and source breakdown
|
|
2461
2258
|
*/
|
|
2462
|
-
declare function getOrCreateAtaInterface(
|
|
2463
|
-
rpc: Rpc,
|
|
2464
|
-
payer: Signer,
|
|
2465
|
-
mint: PublicKey,
|
|
2466
|
-
owner: PublicKey | Signer,
|
|
2467
|
-
allowOwnerOffCurve?: boolean,
|
|
2468
|
-
commitment?: Commitment,
|
|
2469
|
-
confirmOptions?: ConfirmOptions,
|
|
2470
|
-
programId?: PublicKey,
|
|
2471
|
-
associatedTokenProgramId?: PublicKey,
|
|
2472
|
-
): Promise<AccountInterface>;
|
|
2259
|
+
declare function getOrCreateAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey | Signer, allowOwnerOffCurve?: boolean, commitment?: Commitment, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey): Promise<AccountInterface>;
|
|
2473
2260
|
|
|
2474
2261
|
/**
|
|
2475
2262
|
* Decompress compressed (cold) tokens to an on-chain token account.
|
|
@@ -2487,17 +2274,7 @@ declare function getOrCreateAtaInterface(
|
|
|
2487
2274
|
* @param confirmOptions Confirm options
|
|
2488
2275
|
* @returns Transaction signature, null if nothing to load.
|
|
2489
2276
|
*/
|
|
2490
|
-
declare function decompressInterface(
|
|
2491
|
-
rpc: Rpc,
|
|
2492
|
-
payer: Signer,
|
|
2493
|
-
owner: Signer,
|
|
2494
|
-
mint: PublicKey,
|
|
2495
|
-
amount?: number | bigint | BN,
|
|
2496
|
-
destinationAta?: PublicKey,
|
|
2497
|
-
destinationOwner?: PublicKey,
|
|
2498
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2499
|
-
confirmOptions?: ConfirmOptions,
|
|
2500
|
-
): Promise<TransactionSignature | null>;
|
|
2277
|
+
declare function decompressInterface(rpc: Rpc, payer: Signer, owner: Signer, mint: PublicKey, amount?: number | bigint | BN, destinationAta?: PublicKey, destinationOwner?: PublicKey, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature | null>;
|
|
2501
2278
|
|
|
2502
2279
|
/**
|
|
2503
2280
|
* Wrap tokens from an SPL/T22 account to a c-token account.
|
|
@@ -2531,18 +2308,50 @@ declare function decompressInterface(
|
|
|
2531
2308
|
*
|
|
2532
2309
|
* @returns Transaction signature
|
|
2533
2310
|
*/
|
|
2534
|
-
declare function wrap(
|
|
2535
|
-
rpc: Rpc,
|
|
2536
|
-
payer: Signer,
|
|
2537
|
-
source: PublicKey,
|
|
2538
|
-
destination: PublicKey,
|
|
2539
|
-
owner: Signer,
|
|
2540
|
-
mint: PublicKey,
|
|
2541
|
-
amount: bigint,
|
|
2542
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2543
|
-
confirmOptions?: ConfirmOptions,
|
|
2544
|
-
): Promise<TransactionSignature>;
|
|
2311
|
+
declare function wrap(rpc: Rpc, payer: Signer, source: PublicKey, destination: PublicKey, owner: Signer, mint: PublicKey, amount: bigint, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2545
2312
|
|
|
2313
|
+
/**
|
|
2314
|
+
* Build instruction batches for unwrapping c-tokens to SPL/T22 tokens.
|
|
2315
|
+
*
|
|
2316
|
+
* Returns `TransactionInstruction[][]` with the same shape as
|
|
2317
|
+
* `createLoadAtaInstructions` and `createTransferInterfaceInstructions`:
|
|
2318
|
+
* each inner array is one transaction. Load batches (if any) come first,
|
|
2319
|
+
* followed by one final unwrap transaction.
|
|
2320
|
+
*
|
|
2321
|
+
* Uses amount-aware input selection: only loads the cold inputs needed to
|
|
2322
|
+
* cover the unwrap amount (plus padding to fill a single proof batch).
|
|
2323
|
+
*
|
|
2324
|
+
* @param rpc RPC connection
|
|
2325
|
+
* @param destination Destination SPL/T22 token account (must exist)
|
|
2326
|
+
* @param owner Owner of the c-token
|
|
2327
|
+
* @param mint Mint address
|
|
2328
|
+
* @param amount Amount to unwrap (defaults to full balance)
|
|
2329
|
+
* @param payer Fee payer (defaults to owner)
|
|
2330
|
+
* @param splInterfaceInfo Optional: SPL interface info
|
|
2331
|
+
* @param interfaceOptions Optional: interface options for load
|
|
2332
|
+
* @param wrap Whether to use unified (wrap) mode for loading.
|
|
2333
|
+
* Default false.
|
|
2334
|
+
* @returns Instruction batches - each inner array is one transaction
|
|
2335
|
+
*/
|
|
2336
|
+
declare function createUnwrapInstructions(rpc: Rpc, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount?: number | bigint | BN, payer?: PublicKey, splInterfaceInfo?: SplInterfaceInfo, interfaceOptions?: InterfaceOptions, wrap?: boolean): Promise<TransactionInstruction[][]>;
|
|
2337
|
+
|
|
2338
|
+
/**
|
|
2339
|
+
* Select compressed inputs for a target amount.
|
|
2340
|
+
*
|
|
2341
|
+
* Sorts by amount descending (largest first), accumulates until the target
|
|
2342
|
+
* is met, then pads to {@link MAX_INPUT_ACCOUNTS} if possible within a
|
|
2343
|
+
* single batch.
|
|
2344
|
+
*
|
|
2345
|
+
* - If the amount is covered by N <= 8 inputs, returns min(8, total) inputs.
|
|
2346
|
+
* - If more than 8 inputs are needed, returns exactly as many as required
|
|
2347
|
+
* (no padding beyond the amount-needed count).
|
|
2348
|
+
* - Returns [] when `neededAmount <= 0` or `accounts` is empty.
|
|
2349
|
+
*
|
|
2350
|
+
* @param accounts Cold compressed token accounts available for loading.
|
|
2351
|
+
* @param neededAmount Amount that must be covered by selected inputs.
|
|
2352
|
+
* @returns Subset of `accounts`, sorted largest-first.
|
|
2353
|
+
*/
|
|
2354
|
+
declare function selectInputsForAmount(accounts: ParsedTokenAccount[], neededAmount: bigint): ParsedTokenAccount[];
|
|
2546
2355
|
/**
|
|
2547
2356
|
* Create instructions to load an ATA from its AccountInterface.
|
|
2548
2357
|
*
|
|
@@ -2559,14 +2368,7 @@ declare function wrap(
|
|
|
2559
2368
|
* @param targetAta Target ATA address (used for type detection in standard mode)
|
|
2560
2369
|
* @returns Array of instructions (empty if nothing to load)
|
|
2561
2370
|
*/
|
|
2562
|
-
declare function createLoadAtaInstructionsFromInterface(
|
|
2563
|
-
rpc: Rpc,
|
|
2564
|
-
payer: PublicKey,
|
|
2565
|
-
ata: AccountInterface,
|
|
2566
|
-
options?: InterfaceOptions,
|
|
2567
|
-
wrap?: boolean,
|
|
2568
|
-
targetAta?: PublicKey,
|
|
2569
|
-
): Promise<TransactionInstruction[]>;
|
|
2371
|
+
declare function createLoadAtaInstructionsFromInterface(rpc: Rpc, payer: PublicKey, ata: AccountInterface, options?: InterfaceOptions, wrap?: boolean, targetAta?: PublicKey): Promise<TransactionInstruction[]>;
|
|
2570
2372
|
|
|
2571
2373
|
/**
|
|
2572
2374
|
* Derive the canonical associated token address for any of SPL/T22/c-token.
|
|
@@ -2581,13 +2383,7 @@ declare function createLoadAtaInstructionsFromInterface(
|
|
|
2581
2383
|
* auto-detected.
|
|
2582
2384
|
* @returns Associated token address.
|
|
2583
2385
|
*/
|
|
2584
|
-
declare function getAssociatedTokenAddressInterface(
|
|
2585
|
-
mint: PublicKey,
|
|
2586
|
-
owner: PublicKey,
|
|
2587
|
-
allowOwnerOffCurve?: boolean,
|
|
2588
|
-
programId?: PublicKey,
|
|
2589
|
-
associatedTokenProgramId?: PublicKey,
|
|
2590
|
-
): PublicKey;
|
|
2386
|
+
declare function getAssociatedTokenAddressInterface(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): PublicKey;
|
|
2591
2387
|
|
|
2592
2388
|
/**
|
|
2593
2389
|
* Input for creating off-chain metadata JSON.
|
|
@@ -2645,9 +2441,7 @@ interface OffChainTokenMetadataJson {
|
|
|
2645
2441
|
* // Then use uri with createMint
|
|
2646
2442
|
* await createMint(rpc, payer, { ...params, uri });
|
|
2647
2443
|
*/
|
|
2648
|
-
declare function toOffChainMetadataJson(
|
|
2649
|
-
meta: OffChainTokenMetadata,
|
|
2650
|
-
): OffChainTokenMetadataJson;
|
|
2444
|
+
declare function toOffChainMetadataJson(meta: OffChainTokenMetadata): OffChainTokenMetadataJson;
|
|
2651
2445
|
|
|
2652
2446
|
/**
|
|
2653
2447
|
* Approve a delegate to spend tokens
|
|
@@ -2662,15 +2456,7 @@ declare function toOffChainMetadataJson(
|
|
|
2662
2456
|
*
|
|
2663
2457
|
* @return Signature of the confirmed transaction
|
|
2664
2458
|
*/
|
|
2665
|
-
declare function approve(
|
|
2666
|
-
rpc: Rpc,
|
|
2667
|
-
payer: Signer,
|
|
2668
|
-
mint: PublicKey,
|
|
2669
|
-
amount: number | BN,
|
|
2670
|
-
owner: Signer,
|
|
2671
|
-
delegate: PublicKey,
|
|
2672
|
-
confirmOptions?: ConfirmOptions,
|
|
2673
|
-
): Promise<TransactionSignature>;
|
|
2459
|
+
declare function approve(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, delegate: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2674
2460
|
|
|
2675
2461
|
/**
|
|
2676
2462
|
* Mint compressed tokens to a solana address from an external mint authority
|
|
@@ -2689,17 +2475,7 @@ declare function approve(
|
|
|
2689
2475
|
*
|
|
2690
2476
|
* @return Signature of the confirmed transaction
|
|
2691
2477
|
*/
|
|
2692
|
-
declare function approveAndMintTo(
|
|
2693
|
-
rpc: Rpc,
|
|
2694
|
-
payer: Signer,
|
|
2695
|
-
mint: PublicKey,
|
|
2696
|
-
toPubkey: PublicKey,
|
|
2697
|
-
authority: Signer,
|
|
2698
|
-
amount: number | BN,
|
|
2699
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2700
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2701
|
-
confirmOptions?: ConfirmOptions,
|
|
2702
|
-
): Promise<TransactionSignature>;
|
|
2478
|
+
declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, toPubkey: PublicKey, authority: Signer, amount: number | BN, outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2703
2479
|
|
|
2704
2480
|
/**
|
|
2705
2481
|
* Compress SPL tokens
|
|
@@ -2719,18 +2495,7 @@ declare function approveAndMintTo(
|
|
|
2719
2495
|
*
|
|
2720
2496
|
* @return Signature of the confirmed transaction
|
|
2721
2497
|
*/
|
|
2722
|
-
declare function compress(
|
|
2723
|
-
rpc: Rpc,
|
|
2724
|
-
payer: Signer,
|
|
2725
|
-
mint: PublicKey,
|
|
2726
|
-
amount: number | BN | number[] | BN[],
|
|
2727
|
-
owner: Signer,
|
|
2728
|
-
sourceTokenAccount: PublicKey,
|
|
2729
|
-
toAddress: PublicKey | Array<PublicKey>,
|
|
2730
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2731
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2732
|
-
confirmOptions?: ConfirmOptions,
|
|
2733
|
-
): Promise<TransactionSignature>;
|
|
2498
|
+
declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN | number[] | BN[], owner: Signer, sourceTokenAccount: PublicKey, toAddress: PublicKey | Array<PublicKey>, outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2734
2499
|
|
|
2735
2500
|
/**
|
|
2736
2501
|
* Compress SPL tokens into compressed token format
|
|
@@ -2750,17 +2515,7 @@ declare function compress(
|
|
|
2750
2515
|
*
|
|
2751
2516
|
* @return Signature of the confirmed transaction
|
|
2752
2517
|
*/
|
|
2753
|
-
declare function compressSplTokenAccount(
|
|
2754
|
-
rpc: Rpc,
|
|
2755
|
-
payer: Signer,
|
|
2756
|
-
mint: PublicKey,
|
|
2757
|
-
owner: Signer,
|
|
2758
|
-
tokenAccount: PublicKey,
|
|
2759
|
-
remainingAmount?: BN,
|
|
2760
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2761
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2762
|
-
confirmOptions?: ConfirmOptions,
|
|
2763
|
-
): Promise<TransactionSignature>;
|
|
2518
|
+
declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, remainingAmount?: BN, outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2764
2519
|
|
|
2765
2520
|
/**
|
|
2766
2521
|
* Create and initialize a new SPL token mint
|
|
@@ -2780,16 +2535,7 @@ declare function compressSplTokenAccount(
|
|
|
2780
2535
|
*
|
|
2781
2536
|
* @return Object with mint address and transaction signature
|
|
2782
2537
|
*/
|
|
2783
|
-
declare function createMint(
|
|
2784
|
-
rpc: Rpc,
|
|
2785
|
-
payer: Signer,
|
|
2786
|
-
mintAuthority: PublicKey | Signer,
|
|
2787
|
-
decimals: number,
|
|
2788
|
-
keypair?: Keypair,
|
|
2789
|
-
confirmOptions?: ConfirmOptions,
|
|
2790
|
-
tokenProgramId?: PublicKey | boolean,
|
|
2791
|
-
freezeAuthority?: PublicKey | Signer | null,
|
|
2792
|
-
): Promise<{
|
|
2538
|
+
declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey | Signer, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey | boolean, freezeAuthority?: PublicKey | Signer | null): Promise<{
|
|
2793
2539
|
mint: PublicKey;
|
|
2794
2540
|
transactionSignature: TransactionSignature;
|
|
2795
2541
|
}>;
|
|
@@ -2806,13 +2552,7 @@ declare function createMint(
|
|
|
2806
2552
|
*
|
|
2807
2553
|
* @return transaction signature
|
|
2808
2554
|
*/
|
|
2809
|
-
declare function createSplInterface(
|
|
2810
|
-
rpc: Rpc,
|
|
2811
|
-
payer: Signer,
|
|
2812
|
-
mint: PublicKey,
|
|
2813
|
-
confirmOptions?: ConfirmOptions,
|
|
2814
|
-
tokenProgramId?: PublicKey,
|
|
2815
|
-
): Promise<TransactionSignature>;
|
|
2555
|
+
declare function createSplInterface(rpc: Rpc, payer: Signer, mint: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
2816
2556
|
/**
|
|
2817
2557
|
* @deprecated Use {@link createSplInterface} instead.
|
|
2818
2558
|
*/
|
|
@@ -2831,14 +2571,7 @@ declare const createTokenPool: typeof createSplInterface;
|
|
|
2831
2571
|
*
|
|
2832
2572
|
* @return transaction signature
|
|
2833
2573
|
*/
|
|
2834
|
-
declare function addSplInterfaces(
|
|
2835
|
-
rpc: Rpc,
|
|
2836
|
-
payer: Signer,
|
|
2837
|
-
mint: PublicKey,
|
|
2838
|
-
numMaxAdditionalPools: number,
|
|
2839
|
-
confirmOptions?: ConfirmOptions,
|
|
2840
|
-
tokenProgramId?: PublicKey,
|
|
2841
|
-
): Promise<string>;
|
|
2574
|
+
declare function addSplInterfaces(rpc: Rpc, payer: Signer, mint: PublicKey, numMaxAdditionalPools: number, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<string>;
|
|
2842
2575
|
/**
|
|
2843
2576
|
* @deprecated Use {@link addSplInterfaces} instead.
|
|
2844
2577
|
*/
|
|
@@ -2858,13 +2591,7 @@ declare const addTokenPools: typeof addSplInterfaces;
|
|
|
2858
2591
|
* @return Object with transaction signatures and the address of the created
|
|
2859
2592
|
* lookup table
|
|
2860
2593
|
*/
|
|
2861
|
-
declare function createTokenProgramLookupTable(
|
|
2862
|
-
rpc: Rpc,
|
|
2863
|
-
payer: Signer,
|
|
2864
|
-
authority: Signer,
|
|
2865
|
-
mints?: PublicKey[],
|
|
2866
|
-
additionalAccounts?: PublicKey[],
|
|
2867
|
-
): Promise<{
|
|
2594
|
+
declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
|
|
2868
2595
|
txIds: TransactionSignature[];
|
|
2869
2596
|
address: PublicKey;
|
|
2870
2597
|
}>;
|
|
@@ -2884,16 +2611,7 @@ declare function createTokenProgramLookupTable(
|
|
|
2884
2611
|
*
|
|
2885
2612
|
* @return confirmed transaction signature
|
|
2886
2613
|
*/
|
|
2887
|
-
declare function decompress(
|
|
2888
|
-
rpc: Rpc,
|
|
2889
|
-
payer: Signer,
|
|
2890
|
-
mint: PublicKey,
|
|
2891
|
-
amount: number | BN,
|
|
2892
|
-
owner: Signer,
|
|
2893
|
-
toAddress: PublicKey,
|
|
2894
|
-
splInterfaceInfos?: SplInterfaceInfo[],
|
|
2895
|
-
confirmOptions?: ConfirmOptions,
|
|
2896
|
-
): Promise<TransactionSignature>;
|
|
2614
|
+
declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, splInterfaceInfos?: SplInterfaceInfo[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2897
2615
|
|
|
2898
2616
|
/**
|
|
2899
2617
|
* Merge multiple compressed token accounts for a given mint into fewer
|
|
@@ -2913,13 +2631,7 @@ declare function decompress(
|
|
|
2913
2631
|
*
|
|
2914
2632
|
* @return confirmed transaction signature
|
|
2915
2633
|
*/
|
|
2916
|
-
declare function mergeTokenAccounts(
|
|
2917
|
-
rpc: Rpc,
|
|
2918
|
-
payer: Signer,
|
|
2919
|
-
mint: PublicKey,
|
|
2920
|
-
owner: Signer,
|
|
2921
|
-
confirmOptions?: ConfirmOptions,
|
|
2922
|
-
): Promise<TransactionSignature>;
|
|
2634
|
+
declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2923
2635
|
|
|
2924
2636
|
/**
|
|
2925
2637
|
* Mint compressed tokens to a solana address
|
|
@@ -2941,17 +2653,7 @@ declare function mergeTokenAccounts(
|
|
|
2941
2653
|
*
|
|
2942
2654
|
* @return Signature of the confirmed transaction
|
|
2943
2655
|
*/
|
|
2944
|
-
declare function mintTo(
|
|
2945
|
-
rpc: Rpc,
|
|
2946
|
-
payer: Signer,
|
|
2947
|
-
mint: PublicKey,
|
|
2948
|
-
toPubkey: PublicKey | PublicKey[],
|
|
2949
|
-
authority: Signer,
|
|
2950
|
-
amount: number | BN | number[] | BN[],
|
|
2951
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2952
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2953
|
-
confirmOptions?: ConfirmOptions,
|
|
2954
|
-
): Promise<TransactionSignature>;
|
|
2656
|
+
declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, toPubkey: PublicKey | PublicKey[], authority: Signer, amount: number | BN | number[] | BN[], outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2955
2657
|
|
|
2956
2658
|
/**
|
|
2957
2659
|
* Revoke one or more delegated token accounts
|
|
@@ -2965,13 +2667,7 @@ declare function mintTo(
|
|
|
2965
2667
|
*
|
|
2966
2668
|
* @return Signature of the confirmed transaction
|
|
2967
2669
|
*/
|
|
2968
|
-
declare function revoke(
|
|
2969
|
-
rpc: Rpc,
|
|
2970
|
-
payer: Signer,
|
|
2971
|
-
accounts: ParsedTokenAccount[],
|
|
2972
|
-
owner: Signer,
|
|
2973
|
-
confirmOptions?: ConfirmOptions,
|
|
2974
|
-
): Promise<TransactionSignature>;
|
|
2670
|
+
declare function revoke(rpc: Rpc, payer: Signer, accounts: ParsedTokenAccount[], owner: Signer, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2975
2671
|
|
|
2976
2672
|
/**
|
|
2977
2673
|
* Transfer compressed tokens from one owner to another.
|
|
@@ -2989,15 +2685,7 @@ declare function revoke(
|
|
|
2989
2685
|
*
|
|
2990
2686
|
* @return confirmed transaction signature
|
|
2991
2687
|
*/
|
|
2992
|
-
declare function transfer(
|
|
2993
|
-
rpc: Rpc,
|
|
2994
|
-
payer: Signer,
|
|
2995
|
-
mint: PublicKey,
|
|
2996
|
-
amount: number | BN,
|
|
2997
|
-
owner: Signer,
|
|
2998
|
-
toAddress: PublicKey,
|
|
2999
|
-
confirmOptions?: ConfirmOptions,
|
|
3000
|
-
): Promise<TransactionSignature>;
|
|
2688
|
+
declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
3001
2689
|
|
|
3002
2690
|
/**
|
|
3003
2691
|
* Transfer delegated compressed tokens to another owner
|
|
@@ -3012,15 +2700,7 @@ declare function transfer(
|
|
|
3012
2700
|
*
|
|
3013
2701
|
* @return confirmed transaction signature
|
|
3014
2702
|
*/
|
|
3015
|
-
declare function transferDelegated(
|
|
3016
|
-
rpc: Rpc,
|
|
3017
|
-
payer: Signer,
|
|
3018
|
-
mint: PublicKey,
|
|
3019
|
-
amount: number | BN,
|
|
3020
|
-
owner: Signer,
|
|
3021
|
-
toAddress: PublicKey,
|
|
3022
|
-
confirmOptions?: ConfirmOptions,
|
|
3023
|
-
): Promise<TransactionSignature>;
|
|
2703
|
+
declare function transferDelegated(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
3024
2704
|
|
|
3025
2705
|
/**
|
|
3026
2706
|
* Decompress delegated compressed tokens. Remaining compressed tokens are
|
|
@@ -3038,21 +2718,10 @@ declare function transferDelegated(
|
|
|
3038
2718
|
*
|
|
3039
2719
|
* @return Signature of the confirmed transaction
|
|
3040
2720
|
*/
|
|
3041
|
-
declare function decompressDelegated(
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
amount: number | BN,
|
|
3046
|
-
owner: Signer,
|
|
3047
|
-
toAddress: PublicKey,
|
|
3048
|
-
splInterfaceInfos?: SplInterfaceInfo[],
|
|
3049
|
-
confirmOptions?: ConfirmOptions,
|
|
3050
|
-
): Promise<TransactionSignature>;
|
|
3051
|
-
|
|
3052
|
-
declare const ERROR_NO_ACCOUNTS_FOUND =
|
|
3053
|
-
'Could not find accounts to select for transfer.';
|
|
3054
|
-
declare const ERROR_MIXED_TREE_TYPES =
|
|
3055
|
-
'Cannot select accounts from different tree types (V1/V2) in the same batch. Filter accounts by tree type first.';
|
|
2721
|
+
declare function decompressDelegated(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, splInterfaceInfos?: SplInterfaceInfo[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2722
|
+
|
|
2723
|
+
declare const ERROR_NO_ACCOUNTS_FOUND = "Could not find accounts to select for transfer.";
|
|
2724
|
+
declare const ERROR_MIXED_TREE_TYPES = "Cannot select accounts from different tree types (V1/V2) in the same batch. Filter accounts by tree type first.";
|
|
3056
2725
|
/**
|
|
3057
2726
|
* Options for input account selection
|
|
3058
2727
|
*/
|
|
@@ -3067,9 +2736,7 @@ interface SelectInputAccountsOptions {
|
|
|
3067
2736
|
/**
|
|
3068
2737
|
* Groups accounts by tree type for separate processing
|
|
3069
2738
|
*/
|
|
3070
|
-
declare function groupAccountsByTreeType(
|
|
3071
|
-
accounts: ParsedTokenAccount[],
|
|
3072
|
-
): Map<TreeType, ParsedTokenAccount[]>;
|
|
2739
|
+
declare function groupAccountsByTreeType(accounts: ParsedTokenAccount[]): Map<TreeType, ParsedTokenAccount[]>;
|
|
3073
2740
|
/**
|
|
3074
2741
|
* Result of selectAccountsByPreferredTreeType
|
|
3075
2742
|
*/
|
|
@@ -3094,10 +2761,7 @@ interface SelectedAccountsResult {
|
|
|
3094
2761
|
* @param requiredAmount Minimum amount needed (optional - if not provided, returns all from preferred type)
|
|
3095
2762
|
* @returns Selected accounts from a single tree type
|
|
3096
2763
|
*/
|
|
3097
|
-
declare function selectAccountsByPreferredTreeType(
|
|
3098
|
-
accounts: ParsedTokenAccount[],
|
|
3099
|
-
requiredAmount?: BN,
|
|
3100
|
-
): SelectedAccountsResult;
|
|
2764
|
+
declare function selectAccountsByPreferredTreeType(accounts: ParsedTokenAccount[], requiredAmount?: BN): SelectedAccountsResult;
|
|
3101
2765
|
/**
|
|
3102
2766
|
* Selects token accounts for approval, first trying to find an exact match, then falling back to minimum selection.
|
|
3103
2767
|
*
|
|
@@ -3116,16 +2780,11 @@ declare function selectAccountsByPreferredTreeType(
|
|
|
3116
2780
|
* - totalLamports: Total lamports from selected accounts.
|
|
3117
2781
|
* - maxPossibleAmount: Max approvable amount given maxInputs.
|
|
3118
2782
|
*/
|
|
3119
|
-
declare function selectTokenAccountsForApprove(
|
|
3120
|
-
accounts: ParsedTokenAccount[],
|
|
3121
|
-
approveAmount: BN,
|
|
3122
|
-
maxInputs?: number,
|
|
3123
|
-
options?: SelectInputAccountsOptions,
|
|
3124
|
-
): [
|
|
2783
|
+
declare function selectTokenAccountsForApprove(accounts: ParsedTokenAccount[], approveAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3125
2784
|
selectedAccounts: ParsedTokenAccount[],
|
|
3126
2785
|
total: BN,
|
|
3127
2786
|
totalLamports: BN | null,
|
|
3128
|
-
maxPossibleAmount: BN
|
|
2787
|
+
maxPossibleAmount: BN
|
|
3129
2788
|
];
|
|
3130
2789
|
/**
|
|
3131
2790
|
* Selects the minimum number of compressed token accounts required for a
|
|
@@ -3139,12 +2798,7 @@ declare function selectTokenAccountsForApprove(
|
|
|
3139
2798
|
*
|
|
3140
2799
|
* @returns Returns selected accounts and their totals.
|
|
3141
2800
|
*/
|
|
3142
|
-
declare function selectMinCompressedTokenAccountsForDecompression(
|
|
3143
|
-
accounts: ParsedTokenAccount[],
|
|
3144
|
-
amount: BN,
|
|
3145
|
-
maxInputs?: number,
|
|
3146
|
-
options?: SelectInputAccountsOptions,
|
|
3147
|
-
): {
|
|
2801
|
+
declare function selectMinCompressedTokenAccountsForDecompression(accounts: ParsedTokenAccount[], amount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): {
|
|
3148
2802
|
selectedAccounts: ParsedTokenAccount[];
|
|
3149
2803
|
total: BN;
|
|
3150
2804
|
totalLamports: BN | null;
|
|
@@ -3168,31 +2822,22 @@ declare function selectMinCompressedTokenAccountsForDecompression(
|
|
|
3168
2822
|
* maxPossibleAmount: BN
|
|
3169
2823
|
* ]
|
|
3170
2824
|
*/
|
|
3171
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
3172
|
-
accounts: ParsedTokenAccount[],
|
|
3173
|
-
transferAmount: BN,
|
|
3174
|
-
maxInputs?: number,
|
|
3175
|
-
options?: SelectInputAccountsOptions,
|
|
3176
|
-
): [
|
|
2825
|
+
declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3177
2826
|
selectedAccounts: ParsedTokenAccount[],
|
|
3178
2827
|
total: BN,
|
|
3179
2828
|
totalLamports: BN | null,
|
|
3180
|
-
maxPossibleAmount: BN
|
|
2829
|
+
maxPossibleAmount: BN
|
|
3181
2830
|
];
|
|
3182
2831
|
/**
|
|
3183
2832
|
* Executes {@link selectMinCompressedTokenAccountsForTransfer} strategy,
|
|
3184
2833
|
* returns partial amounts if insufficient accounts are found instead of
|
|
3185
2834
|
* throwing an error.
|
|
3186
2835
|
*/
|
|
3187
|
-
declare function selectMinCompressedTokenAccountsForTransferOrPartial(
|
|
3188
|
-
accounts: ParsedTokenAccount[],
|
|
3189
|
-
transferAmount: BN,
|
|
3190
|
-
maxInputs?: number,
|
|
3191
|
-
): [
|
|
2836
|
+
declare function selectMinCompressedTokenAccountsForTransferOrPartial(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
3192
2837
|
selectedAccounts: ParsedTokenAccount[],
|
|
3193
2838
|
total: BN,
|
|
3194
2839
|
totalLamports: BN | null,
|
|
3195
|
-
maxPossibleAmount: BN
|
|
2840
|
+
maxPossibleAmount: BN
|
|
3196
2841
|
];
|
|
3197
2842
|
/**
|
|
3198
2843
|
* Selects compressed token accounts for a transfer, ensuring one extra account
|
|
@@ -3235,31 +2880,22 @@ declare function selectMinCompressedTokenAccountsForTransferOrPartial(
|
|
|
3235
2880
|
* console.log(totalLamports!.toString()); // '15'
|
|
3236
2881
|
* console.log(maxPossibleAmount.toString()); // '150'
|
|
3237
2882
|
*/
|
|
3238
|
-
declare function selectSmartCompressedTokenAccountsForTransfer(
|
|
3239
|
-
accounts: ParsedTokenAccount[],
|
|
3240
|
-
transferAmount: BN,
|
|
3241
|
-
maxInputs?: number,
|
|
3242
|
-
options?: SelectInputAccountsOptions,
|
|
3243
|
-
): [
|
|
2883
|
+
declare function selectSmartCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3244
2884
|
selectedAccounts: ParsedTokenAccount[],
|
|
3245
2885
|
total: BN,
|
|
3246
2886
|
totalLamports: BN | null,
|
|
3247
|
-
maxPossibleAmount: BN
|
|
2887
|
+
maxPossibleAmount: BN
|
|
3248
2888
|
];
|
|
3249
2889
|
/**
|
|
3250
2890
|
* Executes {@link selectMinCompressedTokenAccountsForTransfer} strategy,
|
|
3251
2891
|
* returns partial amounts if insufficient accounts are found instead of
|
|
3252
2892
|
* throwing an error.
|
|
3253
2893
|
*/
|
|
3254
|
-
declare function selectSmartCompressedTokenAccountsForTransferOrPartial(
|
|
3255
|
-
accounts: ParsedTokenAccount[],
|
|
3256
|
-
transferAmount: BN,
|
|
3257
|
-
maxInputs?: number,
|
|
3258
|
-
): [
|
|
2894
|
+
declare function selectSmartCompressedTokenAccountsForTransferOrPartial(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
3259
2895
|
selectedAccounts: ParsedTokenAccount[],
|
|
3260
2896
|
total: BN,
|
|
3261
2897
|
totalLamports: BN | null,
|
|
3262
|
-
maxPossibleAmount: BN
|
|
2898
|
+
maxPossibleAmount: BN
|
|
3263
2899
|
];
|
|
3264
2900
|
|
|
3265
2901
|
type TokenTransferOutputData = {
|
|
@@ -3332,9 +2968,7 @@ type CompressSplTokenAccountInstructionData = {
|
|
|
3332
2968
|
remainingAmount: BN | null;
|
|
3333
2969
|
cpiContext: CompressedCpiContext | null;
|
|
3334
2970
|
};
|
|
3335
|
-
declare function isSingleSplInterfaceInfo(
|
|
3336
|
-
splInterfaceInfos: SplInterfaceInfo | SplInterfaceInfo[],
|
|
3337
|
-
): splInterfaceInfos is SplInterfaceInfo;
|
|
2971
|
+
declare function isSingleSplInterfaceInfo(splInterfaceInfos: SplInterfaceInfo | SplInterfaceInfo[]): splInterfaceInfos is SplInterfaceInfo;
|
|
3338
2972
|
/**
|
|
3339
2973
|
* @deprecated Use {@link isSingleSplInterfaceInfo} instead.
|
|
3340
2974
|
*/
|
|
@@ -3445,9 +3079,7 @@ type PackCompressedTokenAccountsParams = {
|
|
|
3445
3079
|
/**
|
|
3446
3080
|
* Packs Compressed Token Accounts.
|
|
3447
3081
|
*/
|
|
3448
|
-
declare function packCompressedTokenAccounts(
|
|
3449
|
-
params: PackCompressedTokenAccountsParams,
|
|
3450
|
-
): {
|
|
3082
|
+
declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
|
|
3451
3083
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
3452
3084
|
remainingAccountMetas: AccountMeta[];
|
|
3453
3085
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -3460,10 +3092,7 @@ declare function packCompressedTokenAccounts(
|
|
|
3460
3092
|
* @param mint The mint of the token pool
|
|
3461
3093
|
* @returns True if all input accounts belong to the same mint
|
|
3462
3094
|
*/
|
|
3463
|
-
declare function checkMint(
|
|
3464
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
3465
|
-
mint: PublicKey,
|
|
3466
|
-
): boolean;
|
|
3095
|
+
declare function checkMint(compressedTokenAccounts: ParsedTokenAccount[], mint: PublicKey): boolean;
|
|
3467
3096
|
|
|
3468
3097
|
type LightCompressedToken = {
|
|
3469
3098
|
version: '1.2.0';
|
|
@@ -3475,7 +3104,7 @@ type LightCompressedToken = {
|
|
|
3475
3104
|
'This instruction creates a token pool for a given mint. Every spl mint',
|
|
3476
3105
|
'can have one token pool. When a token is compressed the tokens are',
|
|
3477
3106
|
'transferrred to the token pool, and their compressed equivalent is',
|
|
3478
|
-
'minted into a Merkle tree.'
|
|
3107
|
+
'minted into a Merkle tree.'
|
|
3479
3108
|
];
|
|
3480
3109
|
accounts: [
|
|
3481
3110
|
{
|
|
@@ -3508,7 +3137,7 @@ type LightCompressedToken = {
|
|
|
3508
3137
|
name: 'cpiAuthorityPda';
|
|
3509
3138
|
isMut: false;
|
|
3510
3139
|
isSigner: false;
|
|
3511
|
-
}
|
|
3140
|
+
}
|
|
3512
3141
|
];
|
|
3513
3142
|
args: [];
|
|
3514
3143
|
},
|
|
@@ -3516,7 +3145,7 @@ type LightCompressedToken = {
|
|
|
3516
3145
|
name: 'addTokenPool';
|
|
3517
3146
|
docs: [
|
|
3518
3147
|
'This instruction creates an additional token pool for a given mint.',
|
|
3519
|
-
'The maximum number of token pools per mint is 5.'
|
|
3148
|
+
'The maximum number of token pools per mint is 5.'
|
|
3520
3149
|
];
|
|
3521
3150
|
accounts: [
|
|
3522
3151
|
{
|
|
@@ -3554,13 +3183,13 @@ type LightCompressedToken = {
|
|
|
3554
3183
|
name: 'cpiAuthorityPda';
|
|
3555
3184
|
isMut: false;
|
|
3556
3185
|
isSigner: false;
|
|
3557
|
-
}
|
|
3186
|
+
}
|
|
3558
3187
|
];
|
|
3559
3188
|
args: [
|
|
3560
3189
|
{
|
|
3561
3190
|
name: 'tokenPoolIndex';
|
|
3562
3191
|
type: 'u8';
|
|
3563
|
-
}
|
|
3192
|
+
}
|
|
3564
3193
|
];
|
|
3565
3194
|
},
|
|
3566
3195
|
{
|
|
@@ -3572,7 +3201,7 @@ type LightCompressedToken = {
|
|
|
3572
3201
|
'every amount and pubkey input pair. A constant amount of lamports can be',
|
|
3573
3202
|
'transferred to each output account to enable. A use case to add lamports',
|
|
3574
3203
|
'to a compressed token account is to prevent spam. This is the only way',
|
|
3575
|
-
'to add lamports to a compressed token account.'
|
|
3204
|
+
'to add lamports to a compressed token account.'
|
|
3576
3205
|
];
|
|
3577
3206
|
accounts: [
|
|
3578
3207
|
{
|
|
@@ -3652,7 +3281,7 @@ type LightCompressedToken = {
|
|
|
3652
3281
|
isMut: true;
|
|
3653
3282
|
isSigner: false;
|
|
3654
3283
|
isOptional: true;
|
|
3655
|
-
}
|
|
3284
|
+
}
|
|
3656
3285
|
];
|
|
3657
3286
|
args: [
|
|
3658
3287
|
{
|
|
@@ -3672,7 +3301,7 @@ type LightCompressedToken = {
|
|
|
3672
3301
|
type: {
|
|
3673
3302
|
option: 'u64';
|
|
3674
3303
|
};
|
|
3675
|
-
}
|
|
3304
|
+
}
|
|
3676
3305
|
];
|
|
3677
3306
|
},
|
|
3678
3307
|
{
|
|
@@ -3680,7 +3309,7 @@ type LightCompressedToken = {
|
|
|
3680
3309
|
docs: [
|
|
3681
3310
|
'Compresses the balance of an spl token account sub an optional remaining',
|
|
3682
3311
|
'amount. This instruction does not close the spl token account. To close',
|
|
3683
|
-
'the account bundle a close spl account instruction in your transaction.'
|
|
3312
|
+
'the account bundle a close spl account instruction in your transaction.'
|
|
3684
3313
|
];
|
|
3685
3314
|
accounts: [
|
|
3686
3315
|
{
|
|
@@ -3696,7 +3325,7 @@ type LightCompressedToken = {
|
|
|
3696
3325
|
docs: [
|
|
3697
3326
|
'Authority is verified through proof since both owner and delegate',
|
|
3698
3327
|
'are included in the token data hash, which is a public input to the',
|
|
3699
|
-
'validity proof.'
|
|
3328
|
+
'validity proof.'
|
|
3700
3329
|
];
|
|
3701
3330
|
},
|
|
3702
3331
|
{
|
|
@@ -3757,7 +3386,7 @@ type LightCompressedToken = {
|
|
|
3757
3386
|
name: 'systemProgram';
|
|
3758
3387
|
isMut: false;
|
|
3759
3388
|
isSigner: false;
|
|
3760
|
-
}
|
|
3389
|
+
}
|
|
3761
3390
|
];
|
|
3762
3391
|
args: [
|
|
3763
3392
|
{
|
|
@@ -3777,7 +3406,7 @@ type LightCompressedToken = {
|
|
|
3777
3406
|
defined: 'CompressedCpiContext';
|
|
3778
3407
|
};
|
|
3779
3408
|
};
|
|
3780
|
-
}
|
|
3409
|
+
}
|
|
3781
3410
|
];
|
|
3782
3411
|
},
|
|
3783
3412
|
{
|
|
@@ -3790,7 +3419,7 @@ type LightCompressedToken = {
|
|
|
3790
3419
|
'accounts specify less lamports than inputs the remaining lamports are',
|
|
3791
3420
|
'transferred to an output compressed account. Signer must be owner or',
|
|
3792
3421
|
'delegate. If a delegated token account is transferred the delegate is',
|
|
3793
|
-
'not preserved.'
|
|
3422
|
+
'not preserved.'
|
|
3794
3423
|
];
|
|
3795
3424
|
accounts: [
|
|
3796
3425
|
{
|
|
@@ -3806,7 +3435,7 @@ type LightCompressedToken = {
|
|
|
3806
3435
|
docs: [
|
|
3807
3436
|
'Authority is verified through proof since both owner and delegate',
|
|
3808
3437
|
'are included in the token data hash, which is a public input to the',
|
|
3809
|
-
'validity proof.'
|
|
3438
|
+
'validity proof.'
|
|
3810
3439
|
];
|
|
3811
3440
|
},
|
|
3812
3441
|
{
|
|
@@ -3867,13 +3496,13 @@ type LightCompressedToken = {
|
|
|
3867
3496
|
name: 'systemProgram';
|
|
3868
3497
|
isMut: false;
|
|
3869
3498
|
isSigner: false;
|
|
3870
|
-
}
|
|
3499
|
+
}
|
|
3871
3500
|
];
|
|
3872
3501
|
args: [
|
|
3873
3502
|
{
|
|
3874
3503
|
name: 'inputs';
|
|
3875
3504
|
type: 'bytes';
|
|
3876
|
-
}
|
|
3505
|
+
}
|
|
3877
3506
|
];
|
|
3878
3507
|
},
|
|
3879
3508
|
{
|
|
@@ -3884,7 +3513,7 @@ type LightCompressedToken = {
|
|
|
3884
3513
|
'be called by a delegate.',
|
|
3885
3514
|
'The instruction creates two output accounts:',
|
|
3886
3515
|
'1. one account with delegated amount',
|
|
3887
|
-
'2. one account with remaining(change) amount'
|
|
3516
|
+
'2. one account with remaining(change) amount'
|
|
3888
3517
|
];
|
|
3889
3518
|
accounts: [
|
|
3890
3519
|
{
|
|
@@ -3900,7 +3529,7 @@ type LightCompressedToken = {
|
|
|
3900
3529
|
docs: [
|
|
3901
3530
|
'Authority is verified through proof since both owner and delegate',
|
|
3902
3531
|
'are included in the token data hash, which is a public input to the',
|
|
3903
|
-
'validity proof.'
|
|
3532
|
+
'validity proof.'
|
|
3904
3533
|
];
|
|
3905
3534
|
},
|
|
3906
3535
|
{
|
|
@@ -3943,20 +3572,20 @@ type LightCompressedToken = {
|
|
|
3943
3572
|
name: 'systemProgram';
|
|
3944
3573
|
isMut: false;
|
|
3945
3574
|
isSigner: false;
|
|
3946
|
-
}
|
|
3575
|
+
}
|
|
3947
3576
|
];
|
|
3948
3577
|
args: [
|
|
3949
3578
|
{
|
|
3950
3579
|
name: 'inputs';
|
|
3951
3580
|
type: 'bytes';
|
|
3952
|
-
}
|
|
3581
|
+
}
|
|
3953
3582
|
];
|
|
3954
3583
|
},
|
|
3955
3584
|
{
|
|
3956
3585
|
name: 'revoke';
|
|
3957
3586
|
docs: [
|
|
3958
3587
|
'Revokes a delegation. The instruction merges all inputs into one output',
|
|
3959
|
-
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
3588
|
+
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
3960
3589
|
];
|
|
3961
3590
|
accounts: [
|
|
3962
3591
|
{
|
|
@@ -3972,7 +3601,7 @@ type LightCompressedToken = {
|
|
|
3972
3601
|
docs: [
|
|
3973
3602
|
'Authority is verified through proof since both owner and delegate',
|
|
3974
3603
|
'are included in the token data hash, which is a public input to the',
|
|
3975
|
-
'validity proof.'
|
|
3604
|
+
'validity proof.'
|
|
3976
3605
|
];
|
|
3977
3606
|
},
|
|
3978
3607
|
{
|
|
@@ -4015,20 +3644,20 @@ type LightCompressedToken = {
|
|
|
4015
3644
|
name: 'systemProgram';
|
|
4016
3645
|
isMut: false;
|
|
4017
3646
|
isSigner: false;
|
|
4018
|
-
}
|
|
3647
|
+
}
|
|
4019
3648
|
];
|
|
4020
3649
|
args: [
|
|
4021
3650
|
{
|
|
4022
3651
|
name: 'inputs';
|
|
4023
3652
|
type: 'bytes';
|
|
4024
|
-
}
|
|
3653
|
+
}
|
|
4025
3654
|
];
|
|
4026
3655
|
},
|
|
4027
3656
|
{
|
|
4028
3657
|
name: 'freeze';
|
|
4029
3658
|
docs: [
|
|
4030
3659
|
'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
|
|
4031
|
-
'many outputs as inputs. Balances and delegates are preserved.'
|
|
3660
|
+
'many outputs as inputs. Balances and delegates are preserved.'
|
|
4032
3661
|
];
|
|
4033
3662
|
accounts: [
|
|
4034
3663
|
{
|
|
@@ -4087,20 +3716,20 @@ type LightCompressedToken = {
|
|
|
4087
3716
|
name: 'mint';
|
|
4088
3717
|
isMut: false;
|
|
4089
3718
|
isSigner: false;
|
|
4090
|
-
}
|
|
3719
|
+
}
|
|
4091
3720
|
];
|
|
4092
3721
|
args: [
|
|
4093
3722
|
{
|
|
4094
3723
|
name: 'inputs';
|
|
4095
3724
|
type: 'bytes';
|
|
4096
|
-
}
|
|
3725
|
+
}
|
|
4097
3726
|
];
|
|
4098
3727
|
},
|
|
4099
3728
|
{
|
|
4100
3729
|
name: 'thaw';
|
|
4101
3730
|
docs: [
|
|
4102
3731
|
'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
|
|
4103
|
-
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
3732
|
+
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
4104
3733
|
];
|
|
4105
3734
|
accounts: [
|
|
4106
3735
|
{
|
|
@@ -4159,13 +3788,13 @@ type LightCompressedToken = {
|
|
|
4159
3788
|
name: 'mint';
|
|
4160
3789
|
isMut: false;
|
|
4161
3790
|
isSigner: false;
|
|
4162
|
-
}
|
|
3791
|
+
}
|
|
4163
3792
|
];
|
|
4164
3793
|
args: [
|
|
4165
3794
|
{
|
|
4166
3795
|
name: 'inputs';
|
|
4167
3796
|
type: 'bytes';
|
|
4168
|
-
}
|
|
3797
|
+
}
|
|
4169
3798
|
];
|
|
4170
3799
|
},
|
|
4171
3800
|
{
|
|
@@ -4173,7 +3802,7 @@ type LightCompressedToken = {
|
|
|
4173
3802
|
docs: [
|
|
4174
3803
|
'Burns compressed tokens and spl tokens from the pool account. Delegates',
|
|
4175
3804
|
'can burn tokens. The output compressed token account remains delegated.',
|
|
4176
|
-
'Creates one output compressed token account.'
|
|
3805
|
+
'Creates one output compressed token account.'
|
|
4177
3806
|
];
|
|
4178
3807
|
accounts: [
|
|
4179
3808
|
{
|
|
@@ -4189,7 +3818,7 @@ type LightCompressedToken = {
|
|
|
4189
3818
|
docs: [
|
|
4190
3819
|
'Authority is verified through proof since both owner and delegate',
|
|
4191
3820
|
'are included in the token data hash, which is a public input to the',
|
|
4192
|
-
'validity proof.'
|
|
3821
|
+
'validity proof.'
|
|
4193
3822
|
];
|
|
4194
3823
|
},
|
|
4195
3824
|
{
|
|
@@ -4246,13 +3875,13 @@ type LightCompressedToken = {
|
|
|
4246
3875
|
name: 'systemProgram';
|
|
4247
3876
|
isMut: false;
|
|
4248
3877
|
isSigner: false;
|
|
4249
|
-
}
|
|
3878
|
+
}
|
|
4250
3879
|
];
|
|
4251
3880
|
args: [
|
|
4252
3881
|
{
|
|
4253
3882
|
name: 'inputs';
|
|
4254
3883
|
type: 'bytes';
|
|
4255
|
-
}
|
|
3884
|
+
}
|
|
4256
3885
|
];
|
|
4257
3886
|
},
|
|
4258
3887
|
{
|
|
@@ -4260,7 +3889,7 @@ type LightCompressedToken = {
|
|
|
4260
3889
|
docs: [
|
|
4261
3890
|
'This function is a stub to allow Anchor to include the input types in',
|
|
4262
3891
|
'the IDL. It should not be included in production builds nor be called in',
|
|
4263
|
-
'practice.'
|
|
3892
|
+
'practice.'
|
|
4264
3893
|
];
|
|
4265
3894
|
accounts: [
|
|
4266
3895
|
{
|
|
@@ -4276,7 +3905,7 @@ type LightCompressedToken = {
|
|
|
4276
3905
|
docs: [
|
|
4277
3906
|
'Authority is verified through proof since both owner and delegate',
|
|
4278
3907
|
'are included in the token data hash, which is a public input to the',
|
|
4279
|
-
'validity proof.'
|
|
3908
|
+
'validity proof.'
|
|
4280
3909
|
];
|
|
4281
3910
|
},
|
|
4282
3911
|
{
|
|
@@ -4337,7 +3966,7 @@ type LightCompressedToken = {
|
|
|
4337
3966
|
name: 'systemProgram';
|
|
4338
3967
|
isMut: false;
|
|
4339
3968
|
isSigner: false;
|
|
4340
|
-
}
|
|
3969
|
+
}
|
|
4341
3970
|
];
|
|
4342
3971
|
args: [
|
|
4343
3972
|
{
|
|
@@ -4351,9 +3980,9 @@ type LightCompressedToken = {
|
|
|
4351
3980
|
type: {
|
|
4352
3981
|
defined: 'TokenData';
|
|
4353
3982
|
};
|
|
4354
|
-
}
|
|
3983
|
+
}
|
|
4355
3984
|
];
|
|
4356
|
-
}
|
|
3985
|
+
}
|
|
4357
3986
|
];
|
|
4358
3987
|
types: [
|
|
4359
3988
|
{
|
|
@@ -4366,7 +3995,7 @@ type LightCompressedToken = {
|
|
|
4366
3995
|
},
|
|
4367
3996
|
{
|
|
4368
3997
|
name: 'Frozen';
|
|
4369
|
-
}
|
|
3998
|
+
}
|
|
4370
3999
|
];
|
|
4371
4000
|
};
|
|
4372
4001
|
},
|
|
@@ -4398,7 +4027,7 @@ type LightCompressedToken = {
|
|
|
4398
4027
|
defined: 'CompressedAccountData';
|
|
4399
4028
|
};
|
|
4400
4029
|
};
|
|
4401
|
-
}
|
|
4030
|
+
}
|
|
4402
4031
|
];
|
|
4403
4032
|
};
|
|
4404
4033
|
},
|
|
@@ -4422,7 +4051,7 @@ type LightCompressedToken = {
|
|
|
4422
4051
|
type: {
|
|
4423
4052
|
array: ['u8', 32];
|
|
4424
4053
|
};
|
|
4425
|
-
}
|
|
4054
|
+
}
|
|
4426
4055
|
];
|
|
4427
4056
|
};
|
|
4428
4057
|
},
|
|
@@ -4435,7 +4064,7 @@ type LightCompressedToken = {
|
|
|
4435
4064
|
name: 'setContext';
|
|
4436
4065
|
docs: [
|
|
4437
4066
|
'Is set by the program that is invoking the CPI to signal that is should',
|
|
4438
|
-
'set the cpi context.'
|
|
4067
|
+
'set the cpi context.'
|
|
4439
4068
|
];
|
|
4440
4069
|
type: 'bool';
|
|
4441
4070
|
},
|
|
@@ -4443,17 +4072,17 @@ type LightCompressedToken = {
|
|
|
4443
4072
|
name: 'firstSetContext';
|
|
4444
4073
|
docs: [
|
|
4445
4074
|
'Is set to wipe the cpi context since someone could have set it before',
|
|
4446
|
-
'with unrelated data.'
|
|
4075
|
+
'with unrelated data.'
|
|
4447
4076
|
];
|
|
4448
4077
|
type: 'bool';
|
|
4449
4078
|
},
|
|
4450
4079
|
{
|
|
4451
4080
|
name: 'cpiContextAccountIndex';
|
|
4452
4081
|
docs: [
|
|
4453
|
-
'Index of cpi context account in remaining accounts.'
|
|
4082
|
+
'Index of cpi context account in remaining accounts.'
|
|
4454
4083
|
];
|
|
4455
4084
|
type: 'u8';
|
|
4456
|
-
}
|
|
4085
|
+
}
|
|
4457
4086
|
];
|
|
4458
4087
|
};
|
|
4459
4088
|
},
|
|
@@ -4479,7 +4108,7 @@ type LightCompressedToken = {
|
|
|
4479
4108
|
type: {
|
|
4480
4109
|
array: ['u8', 32];
|
|
4481
4110
|
};
|
|
4482
|
-
}
|
|
4111
|
+
}
|
|
4483
4112
|
];
|
|
4484
4113
|
};
|
|
4485
4114
|
},
|
|
@@ -4505,7 +4134,7 @@ type LightCompressedToken = {
|
|
|
4505
4134
|
docs: [
|
|
4506
4135
|
'Is required if the signer is delegate,',
|
|
4507
4136
|
'-> delegate is authority account,',
|
|
4508
|
-
'owner = Some(owner) is the owner of the token account.'
|
|
4137
|
+
'owner = Some(owner) is the owner of the token account.'
|
|
4509
4138
|
];
|
|
4510
4139
|
type: {
|
|
4511
4140
|
option: {
|
|
@@ -4552,7 +4181,7 @@ type LightCompressedToken = {
|
|
|
4552
4181
|
type: {
|
|
4553
4182
|
option: 'u8';
|
|
4554
4183
|
};
|
|
4555
|
-
}
|
|
4184
|
+
}
|
|
4556
4185
|
];
|
|
4557
4186
|
};
|
|
4558
4187
|
},
|
|
@@ -4592,7 +4221,7 @@ type LightCompressedToken = {
|
|
|
4592
4221
|
{
|
|
4593
4222
|
name: 'outputAccountMerkleTreeIndex';
|
|
4594
4223
|
type: 'u8';
|
|
4595
|
-
}
|
|
4224
|
+
}
|
|
4596
4225
|
];
|
|
4597
4226
|
};
|
|
4598
4227
|
},
|
|
@@ -4650,14 +4279,14 @@ type LightCompressedToken = {
|
|
|
4650
4279
|
type: {
|
|
4651
4280
|
option: 'u64';
|
|
4652
4281
|
};
|
|
4653
|
-
}
|
|
4282
|
+
}
|
|
4654
4283
|
];
|
|
4655
4284
|
};
|
|
4656
4285
|
},
|
|
4657
4286
|
{
|
|
4658
4287
|
name: 'DelegatedTransfer';
|
|
4659
4288
|
docs: [
|
|
4660
|
-
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
4289
|
+
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
4661
4290
|
];
|
|
4662
4291
|
type: {
|
|
4663
4292
|
kind: 'struct';
|
|
@@ -4672,12 +4301,12 @@ type LightCompressedToken = {
|
|
|
4672
4301
|
'Index of change compressed account in output compressed accounts. In',
|
|
4673
4302
|
"case that the delegate didn't spend the complete delegated compressed",
|
|
4674
4303
|
'account balance the change compressed account will be delegated to her',
|
|
4675
|
-
'as well.'
|
|
4304
|
+
'as well.'
|
|
4676
4305
|
];
|
|
4677
4306
|
type: {
|
|
4678
4307
|
option: 'u8';
|
|
4679
4308
|
};
|
|
4680
|
-
}
|
|
4309
|
+
}
|
|
4681
4310
|
];
|
|
4682
4311
|
};
|
|
4683
4312
|
},
|
|
@@ -4715,12 +4344,12 @@ type LightCompressedToken = {
|
|
|
4715
4344
|
{
|
|
4716
4345
|
name: 'tlv';
|
|
4717
4346
|
docs: [
|
|
4718
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4347
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4719
4348
|
];
|
|
4720
4349
|
type: {
|
|
4721
4350
|
option: 'bytes';
|
|
4722
4351
|
};
|
|
4723
|
-
}
|
|
4352
|
+
}
|
|
4724
4353
|
];
|
|
4725
4354
|
};
|
|
4726
4355
|
},
|
|
@@ -4776,7 +4405,7 @@ type LightCompressedToken = {
|
|
|
4776
4405
|
{
|
|
4777
4406
|
name: 'isCompress';
|
|
4778
4407
|
type: 'bool';
|
|
4779
|
-
}
|
|
4408
|
+
}
|
|
4780
4409
|
];
|
|
4781
4410
|
};
|
|
4782
4411
|
},
|
|
@@ -4840,7 +4469,7 @@ type LightCompressedToken = {
|
|
|
4840
4469
|
defined: 'CompressedCpiContext';
|
|
4841
4470
|
};
|
|
4842
4471
|
};
|
|
4843
|
-
}
|
|
4472
|
+
}
|
|
4844
4473
|
];
|
|
4845
4474
|
};
|
|
4846
4475
|
},
|
|
@@ -4856,7 +4485,7 @@ type LightCompressedToken = {
|
|
|
4856
4485
|
{
|
|
4857
4486
|
name: 'seq';
|
|
4858
4487
|
type: 'u64';
|
|
4859
|
-
}
|
|
4488
|
+
}
|
|
4860
4489
|
];
|
|
4861
4490
|
};
|
|
4862
4491
|
},
|
|
@@ -4882,7 +4511,7 @@ type LightCompressedToken = {
|
|
|
4882
4511
|
{
|
|
4883
4512
|
name: 'addressMerkleTreeRootIndex';
|
|
4884
4513
|
type: 'u16';
|
|
4885
|
-
}
|
|
4514
|
+
}
|
|
4886
4515
|
];
|
|
4887
4516
|
};
|
|
4888
4517
|
},
|
|
@@ -4900,7 +4529,7 @@ type LightCompressedToken = {
|
|
|
4900
4529
|
{
|
|
4901
4530
|
name: 'merkleTreeIndex';
|
|
4902
4531
|
type: 'u8';
|
|
4903
|
-
}
|
|
4532
|
+
}
|
|
4904
4533
|
];
|
|
4905
4534
|
};
|
|
4906
4535
|
},
|
|
@@ -4924,17 +4553,17 @@ type LightCompressedToken = {
|
|
|
4924
4553
|
{
|
|
4925
4554
|
name: 'rootIndex';
|
|
4926
4555
|
docs: [
|
|
4927
|
-
'Index of root used in inclusion validity proof.'
|
|
4556
|
+
'Index of root used in inclusion validity proof.'
|
|
4928
4557
|
];
|
|
4929
4558
|
type: 'u16';
|
|
4930
4559
|
},
|
|
4931
4560
|
{
|
|
4932
4561
|
name: 'readOnly';
|
|
4933
4562
|
docs: [
|
|
4934
|
-
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
4563
|
+
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
4935
4564
|
];
|
|
4936
4565
|
type: 'bool';
|
|
4937
|
-
}
|
|
4566
|
+
}
|
|
4938
4567
|
];
|
|
4939
4568
|
};
|
|
4940
4569
|
},
|
|
@@ -4958,7 +4587,7 @@ type LightCompressedToken = {
|
|
|
4958
4587
|
{
|
|
4959
4588
|
name: 'proveByIndex';
|
|
4960
4589
|
type: 'bool';
|
|
4961
|
-
}
|
|
4590
|
+
}
|
|
4962
4591
|
];
|
|
4963
4592
|
};
|
|
4964
4593
|
},
|
|
@@ -4988,12 +4617,12 @@ type LightCompressedToken = {
|
|
|
4988
4617
|
{
|
|
4989
4618
|
name: 'tlv';
|
|
4990
4619
|
docs: [
|
|
4991
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4620
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4992
4621
|
];
|
|
4993
4622
|
type: {
|
|
4994
4623
|
option: 'bytes';
|
|
4995
4624
|
};
|
|
4996
|
-
}
|
|
4625
|
+
}
|
|
4997
4626
|
];
|
|
4998
4627
|
};
|
|
4999
4628
|
},
|
|
@@ -5067,7 +4696,7 @@ type LightCompressedToken = {
|
|
|
5067
4696
|
type: {
|
|
5068
4697
|
option: 'bytes';
|
|
5069
4698
|
};
|
|
5070
|
-
}
|
|
4699
|
+
}
|
|
5071
4700
|
];
|
|
5072
4701
|
};
|
|
5073
4702
|
},
|
|
@@ -5085,7 +4714,7 @@ type LightCompressedToken = {
|
|
|
5085
4714
|
name: 'index';
|
|
5086
4715
|
docs: ['Index of compressed account hash in queue.'];
|
|
5087
4716
|
type: 'u16';
|
|
5088
|
-
}
|
|
4717
|
+
}
|
|
5089
4718
|
];
|
|
5090
4719
|
};
|
|
5091
4720
|
},
|
|
@@ -5113,7 +4742,7 @@ type LightCompressedToken = {
|
|
|
5113
4742
|
name: 'delegate';
|
|
5114
4743
|
docs: [
|
|
5115
4744
|
'If `delegate` is `Some` then `delegated_amount` represents',
|
|
5116
|
-
'the amount authorized by the delegate'
|
|
4745
|
+
'the amount authorized by the delegate'
|
|
5117
4746
|
];
|
|
5118
4747
|
type: {
|
|
5119
4748
|
option: 'publicKey';
|
|
@@ -5129,15 +4758,15 @@ type LightCompressedToken = {
|
|
|
5129
4758
|
{
|
|
5130
4759
|
name: 'tlv';
|
|
5131
4760
|
docs: [
|
|
5132
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4761
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
5133
4762
|
];
|
|
5134
4763
|
type: {
|
|
5135
4764
|
option: 'bytes';
|
|
5136
4765
|
};
|
|
5137
|
-
}
|
|
4766
|
+
}
|
|
5138
4767
|
];
|
|
5139
4768
|
};
|
|
5140
|
-
}
|
|
4769
|
+
}
|
|
5141
4770
|
];
|
|
5142
4771
|
errors: [
|
|
5143
4772
|
{
|
|
@@ -5294,7 +4923,7 @@ type LightCompressedToken = {
|
|
|
5294
4923
|
{
|
|
5295
4924
|
code: 6032;
|
|
5296
4925
|
name: 'NoMatchingBumpFound';
|
|
5297
|
-
}
|
|
4926
|
+
}
|
|
5298
4927
|
];
|
|
5299
4928
|
};
|
|
5300
4929
|
declare const IDL: LightCompressedToken;
|
|
@@ -5305,30 +4934,14 @@ declare const CompressedTokenInstructionDataTransferLayout: Layout<unknown>;
|
|
|
5305
4934
|
declare const mintToLayout: Layout<unknown>;
|
|
5306
4935
|
declare const batchCompressLayout: Layout<unknown>;
|
|
5307
4936
|
declare const compressSplTokenAccountInstructionDataLayout: Layout<unknown>;
|
|
5308
|
-
declare function encodeMintToInstructionData(
|
|
5309
|
-
|
|
5310
|
-
): Buffer$1;
|
|
5311
|
-
declare function
|
|
5312
|
-
|
|
5313
|
-
):
|
|
5314
|
-
declare function
|
|
5315
|
-
|
|
5316
|
-
): Buffer$1;
|
|
5317
|
-
declare function decodeBatchCompressInstructionData(
|
|
5318
|
-
buffer: Buffer$1,
|
|
5319
|
-
): BatchCompressInstructionData;
|
|
5320
|
-
declare function encodeCompressSplTokenAccountInstructionData(
|
|
5321
|
-
data: CompressSplTokenAccountInstructionData,
|
|
5322
|
-
): Buffer$1;
|
|
5323
|
-
declare function decodeCompressSplTokenAccountInstructionData(
|
|
5324
|
-
buffer: Buffer$1,
|
|
5325
|
-
): CompressSplTokenAccountInstructionData;
|
|
5326
|
-
declare function encodeTransferInstructionData(
|
|
5327
|
-
data: CompressedTokenInstructionDataTransfer,
|
|
5328
|
-
): Buffer$1;
|
|
5329
|
-
declare function decodeTransferInstructionData(
|
|
5330
|
-
buffer: Buffer$1,
|
|
5331
|
-
): CompressedTokenInstructionDataTransfer;
|
|
4937
|
+
declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
|
|
4938
|
+
declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
|
|
4939
|
+
declare function encodeBatchCompressInstructionData(data: BatchCompressInstructionData): Buffer$1;
|
|
4940
|
+
declare function decodeBatchCompressInstructionData(buffer: Buffer$1): BatchCompressInstructionData;
|
|
4941
|
+
declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
|
|
4942
|
+
declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
|
|
4943
|
+
declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
|
|
4944
|
+
declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
|
|
5332
4945
|
interface BaseAccountsLayoutParams {
|
|
5333
4946
|
feePayer: PublicKey;
|
|
5334
4947
|
authority: PublicKey;
|
|
@@ -5370,44 +4983,20 @@ type freezeAccountsLayoutParams = BaseAccountsLayoutParams & {
|
|
|
5370
4983
|
mint: PublicKey;
|
|
5371
4984
|
};
|
|
5372
4985
|
type thawAccountsLayoutParams = freezeAccountsLayoutParams;
|
|
5373
|
-
declare const createTokenPoolAccountsLayout: (
|
|
5374
|
-
|
|
5375
|
-
) => AccountMeta[];
|
|
5376
|
-
declare const
|
|
5377
|
-
|
|
5378
|
-
) => AccountMeta[];
|
|
5379
|
-
declare const
|
|
5380
|
-
|
|
5381
|
-
) => AccountMeta[];
|
|
5382
|
-
declare const transferAccountsLayout: (
|
|
5383
|
-
accounts: transferAccountsLayoutParams,
|
|
5384
|
-
) => AccountMeta[];
|
|
5385
|
-
declare const approveAccountsLayout: (
|
|
5386
|
-
accounts: approveAccountsLayoutParams,
|
|
5387
|
-
) => AccountMeta[];
|
|
5388
|
-
declare const revokeAccountsLayout: (
|
|
5389
|
-
accounts: approveAccountsLayoutParams,
|
|
5390
|
-
) => AccountMeta[];
|
|
5391
|
-
declare const freezeAccountsLayout: (
|
|
5392
|
-
accounts: freezeAccountsLayoutParams,
|
|
5393
|
-
) => AccountMeta[];
|
|
5394
|
-
declare const thawAccountsLayout: (
|
|
5395
|
-
accounts: freezeAccountsLayoutParams,
|
|
5396
|
-
) => AccountMeta[];
|
|
4986
|
+
declare const createTokenPoolAccountsLayout: (accounts: createTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
4987
|
+
declare const addTokenPoolAccountsLayout: (accounts: addTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
4988
|
+
declare const mintToAccountsLayout: (accounts: mintToAccountsLayoutParams) => AccountMeta[];
|
|
4989
|
+
declare const transferAccountsLayout: (accounts: transferAccountsLayoutParams) => AccountMeta[];
|
|
4990
|
+
declare const approveAccountsLayout: (accounts: approveAccountsLayoutParams) => AccountMeta[];
|
|
4991
|
+
declare const revokeAccountsLayout: (accounts: approveAccountsLayoutParams) => AccountMeta[];
|
|
4992
|
+
declare const freezeAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
|
|
4993
|
+
declare const thawAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
|
|
5397
4994
|
declare const CompressedTokenInstructionDataApproveLayout: Layout<unknown>;
|
|
5398
4995
|
declare const CompressedTokenInstructionDataRevokeLayout: Layout<unknown>;
|
|
5399
|
-
declare function encodeApproveInstructionData(
|
|
5400
|
-
|
|
5401
|
-
): Buffer$1;
|
|
5402
|
-
declare function
|
|
5403
|
-
buffer: Buffer$1,
|
|
5404
|
-
): CompressedTokenInstructionDataApprove;
|
|
5405
|
-
declare function encodeRevokeInstructionData(
|
|
5406
|
-
data: CompressedTokenInstructionDataRevoke,
|
|
5407
|
-
): Buffer$1;
|
|
5408
|
-
declare function decodeRevokeInstructionData(
|
|
5409
|
-
buffer: Buffer$1,
|
|
5410
|
-
): CompressedTokenInstructionDataRevoke;
|
|
4996
|
+
declare function encodeApproveInstructionData(data: CompressedTokenInstructionDataApprove): Buffer$1;
|
|
4997
|
+
declare function decodeApproveInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataApprove;
|
|
4998
|
+
declare function encodeRevokeInstructionData(data: CompressedTokenInstructionDataRevoke): Buffer$1;
|
|
4999
|
+
declare function decodeRevokeInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataRevoke;
|
|
5411
5000
|
|
|
5412
5001
|
type CompressParams = {
|
|
5413
5002
|
/**
|
|
@@ -5501,11 +5090,7 @@ type DecompressParams = {
|
|
|
5501
5090
|
/**
|
|
5502
5091
|
* Token pool(s)
|
|
5503
5092
|
*/
|
|
5504
|
-
tokenPoolInfos:
|
|
5505
|
-
| TokenPoolInfo
|
|
5506
|
-
| TokenPoolInfo[]
|
|
5507
|
-
| SplInterfaceInfo
|
|
5508
|
-
| SplInterfaceInfo[];
|
|
5093
|
+
tokenPoolInfos: TokenPoolInfo | TokenPoolInfo[] | SplInterfaceInfo | SplInterfaceInfo[];
|
|
5509
5094
|
};
|
|
5510
5095
|
type TransferParams = {
|
|
5511
5096
|
/**
|
|
@@ -5790,17 +5375,12 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
5790
5375
|
/**
|
|
5791
5376
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
5792
5377
|
*/
|
|
5793
|
-
declare const parseTokenData: (
|
|
5794
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
5795
|
-
) => {
|
|
5378
|
+
declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
|
|
5796
5379
|
mint: PublicKey;
|
|
5797
5380
|
currentOwner: PublicKey;
|
|
5798
5381
|
delegate: PublicKey | null;
|
|
5799
5382
|
};
|
|
5800
|
-
declare const parseMaybeDelegatedTransfer: (
|
|
5801
|
-
inputs: ParsedTokenAccount[],
|
|
5802
|
-
outputs: TokenTransferOutputData[],
|
|
5803
|
-
) => {
|
|
5383
|
+
declare const parseMaybeDelegatedTransfer: (inputs: ParsedTokenAccount[], outputs: TokenTransferOutputData[]) => {
|
|
5804
5384
|
delegatedTransfer: DelegatedTransfer | null;
|
|
5805
5385
|
authority: PublicKey;
|
|
5806
5386
|
};
|
|
@@ -5812,11 +5392,7 @@ declare const parseMaybeDelegatedTransfer: (
|
|
|
5812
5392
|
* @returns Output token data for the transfer
|
|
5813
5393
|
* instruction
|
|
5814
5394
|
*/
|
|
5815
|
-
declare function createTransferOutputState(
|
|
5816
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
5817
|
-
toAddress: PublicKey,
|
|
5818
|
-
amount: number | BN,
|
|
5819
|
-
): TokenTransferOutputData[];
|
|
5395
|
+
declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData[];
|
|
5820
5396
|
/**
|
|
5821
5397
|
* Create the output state for a compress transaction.
|
|
5822
5398
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -5824,10 +5400,7 @@ declare function createTransferOutputState(
|
|
|
5824
5400
|
* @returns Output token data for the compress
|
|
5825
5401
|
* instruction
|
|
5826
5402
|
*/
|
|
5827
|
-
declare function createDecompressOutputState(
|
|
5828
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
5829
|
-
amount: number | BN,
|
|
5830
|
-
): TokenTransferOutputData[];
|
|
5403
|
+
declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData[];
|
|
5831
5404
|
declare class CompressedTokenProgram {
|
|
5832
5405
|
/**
|
|
5833
5406
|
* @internal
|
|
@@ -5865,17 +5438,11 @@ declare class CompressedTokenProgram {
|
|
|
5865
5438
|
*
|
|
5866
5439
|
* @returns The index and bump number.
|
|
5867
5440
|
*/
|
|
5868
|
-
static findSplInterfaceIndexAndBump(
|
|
5869
|
-
poolPda: PublicKey,
|
|
5870
|
-
mint: PublicKey,
|
|
5871
|
-
): [number, number];
|
|
5441
|
+
static findSplInterfaceIndexAndBump(poolPda: PublicKey, mint: PublicKey): [number, number];
|
|
5872
5442
|
/**
|
|
5873
5443
|
* @deprecated Use {@link findSplInterfaceIndexAndBump} instead.
|
|
5874
5444
|
*/
|
|
5875
|
-
static findTokenPoolIndexAndBump(
|
|
5876
|
-
poolPda: PublicKey,
|
|
5877
|
-
mint: PublicKey,
|
|
5878
|
-
): [number, number];
|
|
5445
|
+
static findTokenPoolIndexAndBump(poolPda: PublicKey, mint: PublicKey): [number, number];
|
|
5879
5446
|
/**
|
|
5880
5447
|
* Derive the SPL interface PDA with index.
|
|
5881
5448
|
*
|
|
@@ -5885,17 +5452,11 @@ declare class CompressedTokenProgram {
|
|
|
5885
5452
|
*
|
|
5886
5453
|
* @returns The SPL interface PDA and bump.
|
|
5887
5454
|
*/
|
|
5888
|
-
static deriveSplInterfacePdaWithIndex(
|
|
5889
|
-
mint: PublicKey,
|
|
5890
|
-
index: number,
|
|
5891
|
-
): [PublicKey, number];
|
|
5455
|
+
static deriveSplInterfacePdaWithIndex(mint: PublicKey, index: number): [PublicKey, number];
|
|
5892
5456
|
/**
|
|
5893
5457
|
* @deprecated Use {@link deriveSplInterfacePdaWithIndex} instead.
|
|
5894
5458
|
*/
|
|
5895
|
-
static deriveTokenPoolPdaWithIndex(
|
|
5896
|
-
mint: PublicKey,
|
|
5897
|
-
index: number,
|
|
5898
|
-
): [PublicKey, number];
|
|
5459
|
+
static deriveTokenPoolPdaWithIndex(mint: PublicKey, index: number): [PublicKey, number];
|
|
5899
5460
|
/** @internal */
|
|
5900
5461
|
static get deriveCpiAuthorityPda(): PublicKey;
|
|
5901
5462
|
/**
|
|
@@ -5911,23 +5472,14 @@ declare class CompressedTokenProgram {
|
|
|
5911
5472
|
* @param mintSize Optional: mint size. Default: MINT_SIZE
|
|
5912
5473
|
*
|
|
5913
5474
|
* @returns [createMintAccountInstruction, initializeMintInstruction,
|
|
5914
|
-
*
|
|
5475
|
+
* createSplInterfaceInstruction]
|
|
5915
5476
|
*
|
|
5916
|
-
* Note that `
|
|
5477
|
+
* Note that `createSplInterfaceInstruction` must be executed after
|
|
5917
5478
|
* `initializeMintInstruction`.
|
|
5918
5479
|
*/
|
|
5919
|
-
static createMint({
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
authority,
|
|
5923
|
-
freezeAuthority,
|
|
5924
|
-
decimals,
|
|
5925
|
-
rentExemptBalance,
|
|
5926
|
-
tokenProgramId,
|
|
5927
|
-
mintSize,
|
|
5928
|
-
}: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
5929
|
-
/**
|
|
5930
|
-
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
5480
|
+
static createMint({ feePayer, mint, authority, freezeAuthority, decimals, rentExemptBalance, tokenProgramId, mintSize, }: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
5481
|
+
/**
|
|
5482
|
+
* Create SPL interface (omnibus account) for an existing SPL mint.
|
|
5931
5483
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
5932
5484
|
*
|
|
5933
5485
|
* @param feePayer Fee payer.
|
|
@@ -5935,16 +5487,16 @@ declare class CompressedTokenProgram {
|
|
|
5935
5487
|
* @param tokenProgramId Optional: Token program ID. Default: SPL
|
|
5936
5488
|
* Token Program ID
|
|
5937
5489
|
*
|
|
5938
|
-
* @returns The
|
|
5490
|
+
* @returns The createSplInterface instruction
|
|
5491
|
+
*/
|
|
5492
|
+
static createSplInterface({ feePayer, mint, tokenProgramId, }: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5493
|
+
/**
|
|
5494
|
+
* @deprecated Use {@link createSplInterface} instead.
|
|
5939
5495
|
*/
|
|
5940
|
-
static createTokenPool(
|
|
5941
|
-
feePayer,
|
|
5942
|
-
mint,
|
|
5943
|
-
tokenProgramId,
|
|
5944
|
-
}: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5496
|
+
static createTokenPool(params: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5945
5497
|
/**
|
|
5946
5498
|
* Add a token pool to an existing SPL mint. For new mints, use
|
|
5947
|
-
* {@link
|
|
5499
|
+
* {@link createSplInterface}.
|
|
5948
5500
|
*
|
|
5949
5501
|
* @param feePayer Fee payer.
|
|
5950
5502
|
* @param mint SPL Mint address.
|
|
@@ -5954,12 +5506,7 @@ declare class CompressedTokenProgram {
|
|
|
5954
5506
|
*
|
|
5955
5507
|
* @returns The addTokenPool instruction
|
|
5956
5508
|
*/
|
|
5957
|
-
static addTokenPool({
|
|
5958
|
-
feePayer,
|
|
5959
|
-
mint,
|
|
5960
|
-
poolIndex,
|
|
5961
|
-
tokenProgramId,
|
|
5962
|
-
}: AddSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5509
|
+
static addTokenPool({ feePayer, mint, poolIndex, tokenProgramId, }: AddSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5963
5510
|
/**
|
|
5964
5511
|
* Construct mintTo instruction for compressed tokens
|
|
5965
5512
|
*
|
|
@@ -5973,15 +5520,7 @@ declare class CompressedTokenProgram {
|
|
|
5973
5520
|
*
|
|
5974
5521
|
* @returns The mintTo instruction
|
|
5975
5522
|
*/
|
|
5976
|
-
static mintTo({
|
|
5977
|
-
feePayer,
|
|
5978
|
-
mint,
|
|
5979
|
-
authority,
|
|
5980
|
-
toPubkey,
|
|
5981
|
-
amount,
|
|
5982
|
-
outputStateTreeInfo,
|
|
5983
|
-
tokenPoolInfo,
|
|
5984
|
-
}: MintToParams): Promise<TransactionInstruction>;
|
|
5523
|
+
static mintTo({ feePayer, mint, authority, toPubkey, amount, outputStateTreeInfo, tokenPoolInfo, }: MintToParams): Promise<TransactionInstruction>;
|
|
5985
5524
|
/**
|
|
5986
5525
|
* Mint tokens from registered SPL mint account to a compressed account
|
|
5987
5526
|
*
|
|
@@ -5997,16 +5536,7 @@ declare class CompressedTokenProgram {
|
|
|
5997
5536
|
*
|
|
5998
5537
|
* @returns The mintTo instruction
|
|
5999
5538
|
*/
|
|
6000
|
-
static approveAndMintTo({
|
|
6001
|
-
feePayer,
|
|
6002
|
-
mint,
|
|
6003
|
-
authority,
|
|
6004
|
-
authorityTokenAccount,
|
|
6005
|
-
toPubkey,
|
|
6006
|
-
amount,
|
|
6007
|
-
outputStateTreeInfo,
|
|
6008
|
-
tokenPoolInfo,
|
|
6009
|
-
}: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
5539
|
+
static approveAndMintTo({ feePayer, mint, authority, authorityTokenAccount, toPubkey, amount, outputStateTreeInfo, tokenPoolInfo, }: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
6010
5540
|
/**
|
|
6011
5541
|
* Construct transfer instruction for compressed tokens.
|
|
6012
5542
|
*
|
|
@@ -6021,14 +5551,7 @@ declare class CompressedTokenProgram {
|
|
|
6021
5551
|
*
|
|
6022
5552
|
* @returns The transfer instruction
|
|
6023
5553
|
*/
|
|
6024
|
-
static transfer({
|
|
6025
|
-
payer,
|
|
6026
|
-
inputCompressedTokenAccounts,
|
|
6027
|
-
toAddress,
|
|
6028
|
-
amount,
|
|
6029
|
-
recentValidityProof,
|
|
6030
|
-
recentInputStateRootIndices,
|
|
6031
|
-
}: TransferParams): Promise<TransactionInstruction>;
|
|
5554
|
+
static transfer({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, }: TransferParams): Promise<TransactionInstruction>;
|
|
6032
5555
|
/**
|
|
6033
5556
|
* Create lookup table instructions for the token program's default
|
|
6034
5557
|
* accounts.
|
|
@@ -6041,13 +5564,7 @@ declare class CompressedTokenProgram {
|
|
|
6041
5564
|
*
|
|
6042
5565
|
* @returns [createInstruction, extendInstruction, option(extendInstruction2)]
|
|
6043
5566
|
*/
|
|
6044
|
-
static createTokenProgramLookupTable({
|
|
6045
|
-
payer,
|
|
6046
|
-
authority,
|
|
6047
|
-
mints,
|
|
6048
|
-
recentSlot,
|
|
6049
|
-
remainingAccounts,
|
|
6050
|
-
}: CreateTokenProgramLookupTableParams): Promise<{
|
|
5567
|
+
static createTokenProgramLookupTable({ payer, authority, mints, recentSlot, remainingAccounts, }: CreateTokenProgramLookupTableParams): Promise<{
|
|
6051
5568
|
instructions: TransactionInstruction[];
|
|
6052
5569
|
address: PublicKey;
|
|
6053
5570
|
}>;
|
|
@@ -6065,16 +5582,7 @@ declare class CompressedTokenProgram {
|
|
|
6065
5582
|
*
|
|
6066
5583
|
* @returns The compress instruction
|
|
6067
5584
|
*/
|
|
6068
|
-
static compress({
|
|
6069
|
-
payer,
|
|
6070
|
-
owner,
|
|
6071
|
-
source,
|
|
6072
|
-
toAddress,
|
|
6073
|
-
amount,
|
|
6074
|
-
mint,
|
|
6075
|
-
outputStateTreeInfo,
|
|
6076
|
-
tokenPoolInfo,
|
|
6077
|
-
}: CompressParams): Promise<TransactionInstruction>;
|
|
5585
|
+
static compress({ payer, owner, source, toAddress, amount, mint, outputStateTreeInfo, tokenPoolInfo, }: CompressParams): Promise<TransactionInstruction>;
|
|
6078
5586
|
/**
|
|
6079
5587
|
* Construct decompress instruction
|
|
6080
5588
|
*
|
|
@@ -6089,15 +5597,7 @@ declare class CompressedTokenProgram {
|
|
|
6089
5597
|
*
|
|
6090
5598
|
* @returns The decompress instruction
|
|
6091
5599
|
*/
|
|
6092
|
-
static decompress({
|
|
6093
|
-
payer,
|
|
6094
|
-
inputCompressedTokenAccounts,
|
|
6095
|
-
toAddress,
|
|
6096
|
-
amount,
|
|
6097
|
-
recentValidityProof,
|
|
6098
|
-
recentInputStateRootIndices,
|
|
6099
|
-
tokenPoolInfos,
|
|
6100
|
-
}: DecompressParams): Promise<TransactionInstruction>;
|
|
5600
|
+
static decompress({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, tokenPoolInfos, }: DecompressParams): Promise<TransactionInstruction>;
|
|
6101
5601
|
/**
|
|
6102
5602
|
* Create `mergeTokenAccounts` instruction.
|
|
6103
5603
|
*
|
|
@@ -6110,14 +5610,7 @@ declare class CompressedTokenProgram {
|
|
|
6110
5610
|
* @param recentInputStateRootIndices Recent state root indices.
|
|
6111
5611
|
* @returns instruction
|
|
6112
5612
|
*/
|
|
6113
|
-
static mergeTokenAccounts({
|
|
6114
|
-
payer,
|
|
6115
|
-
owner,
|
|
6116
|
-
inputCompressedTokenAccounts,
|
|
6117
|
-
mint,
|
|
6118
|
-
recentValidityProof,
|
|
6119
|
-
recentInputStateRootIndices,
|
|
6120
|
-
}: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
5613
|
+
static mergeTokenAccounts({ payer, owner, inputCompressedTokenAccounts, mint, recentValidityProof, recentInputStateRootIndices, }: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
6121
5614
|
/**
|
|
6122
5615
|
* Create `compressSplTokenAccount` instruction
|
|
6123
5616
|
*
|
|
@@ -6131,15 +5624,7 @@ declare class CompressedTokenProgram {
|
|
|
6131
5624
|
*
|
|
6132
5625
|
* @returns instruction
|
|
6133
5626
|
*/
|
|
6134
|
-
static compressSplTokenAccount({
|
|
6135
|
-
feePayer,
|
|
6136
|
-
authority,
|
|
6137
|
-
tokenAccount,
|
|
6138
|
-
mint,
|
|
6139
|
-
remainingAmount,
|
|
6140
|
-
outputStateTreeInfo,
|
|
6141
|
-
tokenPoolInfo,
|
|
6142
|
-
}: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
5627
|
+
static compressSplTokenAccount({ feePayer, authority, tokenAccount, mint, remainingAmount, outputStateTreeInfo, tokenPoolInfo, }: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
6143
5628
|
/**
|
|
6144
5629
|
* Get the program ID for a mint
|
|
6145
5630
|
*
|
|
@@ -6148,10 +5633,7 @@ declare class CompressedTokenProgram {
|
|
|
6148
5633
|
*
|
|
6149
5634
|
* @returns program ID
|
|
6150
5635
|
*/
|
|
6151
|
-
static getMintProgramId(
|
|
6152
|
-
mint: PublicKey,
|
|
6153
|
-
connection: Connection,
|
|
6154
|
-
): Promise<PublicKey | undefined>;
|
|
5636
|
+
static getMintProgramId(mint: PublicKey, connection: Connection): Promise<PublicKey | undefined>;
|
|
6155
5637
|
/**
|
|
6156
5638
|
* Create `approve` instruction to delegate compressed tokens.
|
|
6157
5639
|
*
|
|
@@ -6164,14 +5646,7 @@ declare class CompressedTokenProgram {
|
|
|
6164
5646
|
*
|
|
6165
5647
|
* @returns instruction
|
|
6166
5648
|
*/
|
|
6167
|
-
static approve({
|
|
6168
|
-
payer,
|
|
6169
|
-
inputCompressedTokenAccounts,
|
|
6170
|
-
toAddress,
|
|
6171
|
-
amount,
|
|
6172
|
-
recentValidityProof,
|
|
6173
|
-
recentInputStateRootIndices,
|
|
6174
|
-
}: ApproveParams): Promise<TransactionInstruction>;
|
|
5649
|
+
static approve({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, }: ApproveParams): Promise<TransactionInstruction>;
|
|
6175
5650
|
/**
|
|
6176
5651
|
* Create `revoke` instruction to revoke delegation of compressed tokens.
|
|
6177
5652
|
*
|
|
@@ -6182,14 +5657,39 @@ declare class CompressedTokenProgram {
|
|
|
6182
5657
|
*
|
|
6183
5658
|
* @returns instruction
|
|
6184
5659
|
*/
|
|
6185
|
-
static revoke({
|
|
6186
|
-
payer,
|
|
6187
|
-
inputCompressedTokenAccounts,
|
|
6188
|
-
recentValidityProof,
|
|
6189
|
-
recentInputStateRootIndices,
|
|
6190
|
-
}: RevokeParams): Promise<TransactionInstruction>;
|
|
5660
|
+
static revoke({ payer, inputCompressedTokenAccounts, recentValidityProof, recentInputStateRootIndices, }: RevokeParams): Promise<TransactionInstruction>;
|
|
6191
5661
|
}
|
|
6192
5662
|
|
|
5663
|
+
/** Solana maximum transaction size in bytes. */
|
|
5664
|
+
declare const MAX_TRANSACTION_SIZE = 1232;
|
|
5665
|
+
/**
|
|
5666
|
+
* Conservative size budget for a combined batch (load + transfer + ATA).
|
|
5667
|
+
* Leaves headroom below MAX_TRANSACTION_SIZE for edge-case key counts.
|
|
5668
|
+
*/
|
|
5669
|
+
declare const MAX_COMBINED_BATCH_BYTES = 900;
|
|
5670
|
+
/**
|
|
5671
|
+
* Conservative size budget for a load-only or setup-only batch.
|
|
5672
|
+
*/
|
|
5673
|
+
declare const MAX_LOAD_ONLY_BATCH_BYTES = 1000;
|
|
5674
|
+
/**
|
|
5675
|
+
* Estimate the serialized byte size of a V0 VersionedTransaction built from
|
|
5676
|
+
* the given instructions and signer count.
|
|
5677
|
+
*
|
|
5678
|
+
* The estimate accounts for Solana's account-key deduplication: all unique
|
|
5679
|
+
* pubkeys across every instruction (keys + programIds) are collected into a
|
|
5680
|
+
* single set, matching the behaviour of
|
|
5681
|
+
* `TransactionMessage.compileToV0Message`.
|
|
5682
|
+
*
|
|
5683
|
+
* This intentionally does NOT use address lookup tables, so the result is an
|
|
5684
|
+
* upper bound. If lookup tables are used at send time the actual size will be
|
|
5685
|
+
* smaller.
|
|
5686
|
+
*
|
|
5687
|
+
* @param instructions The instructions that will be included in the tx.
|
|
5688
|
+
* @param numSigners Number of signers (determines signature count).
|
|
5689
|
+
* @returns Estimated byte size of the serialized transaction.
|
|
5690
|
+
*/
|
|
5691
|
+
declare function estimateTransactionSize(instructions: TransactionInstruction[], numSigners: number): number;
|
|
5692
|
+
|
|
6193
5693
|
/**
|
|
6194
5694
|
* Retrieve associated token account for a given owner and mint.
|
|
6195
5695
|
*
|
|
@@ -6201,33 +5701,20 @@ declare class CompressedTokenProgram {
|
|
|
6201
5701
|
* @param programId Optional program ID
|
|
6202
5702
|
* @returns AccountInterface with ATA metadata
|
|
6203
5703
|
*/
|
|
6204
|
-
declare function getAtaInterface(
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
*
|
|
6214
|
-
*
|
|
6215
|
-
* @
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
* @param mint Mint public key
|
|
6219
|
-
* @param payer Fee payer (defaults to owner)
|
|
6220
|
-
* @param options Optional load options
|
|
6221
|
-
* @returns Array of instructions (empty if nothing to load)
|
|
6222
|
-
*/
|
|
6223
|
-
declare function createLoadAtaInstructions(
|
|
6224
|
-
rpc: Rpc,
|
|
6225
|
-
ata: PublicKey,
|
|
6226
|
-
owner: PublicKey,
|
|
6227
|
-
mint: PublicKey,
|
|
6228
|
-
payer?: PublicKey,
|
|
6229
|
-
options?: InterfaceOptions,
|
|
6230
|
-
): Promise<TransactionInstruction[]>;
|
|
5704
|
+
declare function getAtaInterface(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
|
|
5705
|
+
/**
|
|
5706
|
+
* Create instruction batches for loading token balances into an ATA.
|
|
5707
|
+
* Returns batches of instructions, each batch is one transaction.
|
|
5708
|
+
*
|
|
5709
|
+
* @param rpc RPC connection
|
|
5710
|
+
* @param ata Associated token address
|
|
5711
|
+
* @param owner Owner public key
|
|
5712
|
+
* @param mint Mint public key
|
|
5713
|
+
* @param payer Fee payer (defaults to owner)
|
|
5714
|
+
* @param options Optional load options
|
|
5715
|
+
* @returns Instruction batches - each inner array is one transaction
|
|
5716
|
+
*/
|
|
5717
|
+
declare function createLoadAtaInstructions(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, payer?: PublicKey, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
|
|
6231
5718
|
/**
|
|
6232
5719
|
* Load token balances into a c-token ATA.
|
|
6233
5720
|
*
|
|
@@ -6240,225 +5727,6 @@ declare function createLoadAtaInstructions(
|
|
|
6240
5727
|
* @param interfaceOptions Optional interface options
|
|
6241
5728
|
* @returns Transaction signature, or null if nothing to load
|
|
6242
5729
|
*/
|
|
6243
|
-
declare function loadAta(
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
owner: Signer,
|
|
6247
|
-
mint: PublicKey,
|
|
6248
|
-
payer?: Signer,
|
|
6249
|
-
confirmOptions?: ConfirmOptions,
|
|
6250
|
-
interfaceOptions?: InterfaceOptions,
|
|
6251
|
-
): Promise<TransactionSignature | null>;
|
|
6252
|
-
|
|
6253
|
-
export {
|
|
6254
|
-
ADD_TOKEN_POOL_DISCRIMINATOR,
|
|
6255
|
-
APPROVE_DISCRIMINATOR,
|
|
6256
|
-
type AccountInterface,
|
|
6257
|
-
Action,
|
|
6258
|
-
type AddSplInterfaceParams,
|
|
6259
|
-
type AddTokenPoolParams,
|
|
6260
|
-
type ApproveAndMintToParams,
|
|
6261
|
-
type ApproveParams,
|
|
6262
|
-
BATCH_COMPRESS_DISCRIMINATOR,
|
|
6263
|
-
type BaseMint,
|
|
6264
|
-
type BatchCompressInstructionData,
|
|
6265
|
-
COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR,
|
|
6266
|
-
CPI_AUTHORITY_SEED,
|
|
6267
|
-
CREATE_TOKEN_POOL_DISCRIMINATOR,
|
|
6268
|
-
type CTokenConfig,
|
|
6269
|
-
type CompressParams,
|
|
6270
|
-
type CompressSplTokenAccountInstructionData,
|
|
6271
|
-
type CompressSplTokenAccountParams,
|
|
6272
|
-
type CompressedMint,
|
|
6273
|
-
type CompressedTokenInstructionDataApprove,
|
|
6274
|
-
CompressedTokenInstructionDataApproveLayout,
|
|
6275
|
-
type CompressedTokenInstructionDataRevoke,
|
|
6276
|
-
CompressedTokenInstructionDataRevokeLayout,
|
|
6277
|
-
type CompressedTokenInstructionDataTransfer,
|
|
6278
|
-
CompressedTokenInstructionDataTransferLayout,
|
|
6279
|
-
CompressedTokenProgram,
|
|
6280
|
-
type CompressibleAccountInput,
|
|
6281
|
-
type CompressibleConfig,
|
|
6282
|
-
type CompressibleLoadParams,
|
|
6283
|
-
CpiContextLayout,
|
|
6284
|
-
type CreateAssociatedCTokenAccountParams,
|
|
6285
|
-
type CreateMintParams,
|
|
6286
|
-
type CreateSplInterfaceParams,
|
|
6287
|
-
type CreateTokenPoolParams,
|
|
6288
|
-
type CreateTokenProgramLookupTableParams,
|
|
6289
|
-
DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR,
|
|
6290
|
-
type DecompressParams,
|
|
6291
|
-
type DelegatedTransfer,
|
|
6292
|
-
DelegatedTransferLayout,
|
|
6293
|
-
ERROR_MIXED_TREE_TYPES,
|
|
6294
|
-
ERROR_NO_ACCOUNTS_FOUND,
|
|
6295
|
-
ExtensionType,
|
|
6296
|
-
IDL,
|
|
6297
|
-
type InputTokenDataWithContext,
|
|
6298
|
-
type InterfaceOptions,
|
|
6299
|
-
type LightCompressedToken,
|
|
6300
|
-
type LoadResult,
|
|
6301
|
-
MINT_TO_DISCRIMINATOR,
|
|
6302
|
-
type MergeTokenAccountsParams,
|
|
6303
|
-
type MintContext,
|
|
6304
|
-
type MintExtension,
|
|
6305
|
-
type MintInterface,
|
|
6306
|
-
type MintToInstructionData,
|
|
6307
|
-
type MintToParams,
|
|
6308
|
-
type OffChainTokenMetadata,
|
|
6309
|
-
type OffChainTokenMetadataJson,
|
|
6310
|
-
POOL_SEED,
|
|
6311
|
-
type PackCompressedTokenAccountsParams,
|
|
6312
|
-
type PackedCompressedAccount,
|
|
6313
|
-
type PackedTokenTransferOutputData,
|
|
6314
|
-
type ParsedAccountInfoInterface,
|
|
6315
|
-
REVOKE_DISCRIMINATOR,
|
|
6316
|
-
type RevokeParams,
|
|
6317
|
-
SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,
|
|
6318
|
-
type SelectInputAccountsOptions,
|
|
6319
|
-
type SelectedAccountsResult,
|
|
6320
|
-
type SplInterfaceActivity,
|
|
6321
|
-
type SplInterfaceInfo,
|
|
6322
|
-
TRANSFER_DISCRIMINATOR,
|
|
6323
|
-
type TokenAccountSource,
|
|
6324
|
-
type TokenData,
|
|
6325
|
-
TokenDataVersion,
|
|
6326
|
-
type TokenMetadata,
|
|
6327
|
-
type TokenMetadataInstructionData,
|
|
6328
|
-
type TokenPoolActivity,
|
|
6329
|
-
type TokenPoolInfo,
|
|
6330
|
-
type TokenTransferOutputData,
|
|
6331
|
-
type TransferParams,
|
|
6332
|
-
addSplInterfaces,
|
|
6333
|
-
addTokenPoolAccountsLayout,
|
|
6334
|
-
type addTokenPoolAccountsLayoutParams,
|
|
6335
|
-
addTokenPools,
|
|
6336
|
-
approve,
|
|
6337
|
-
approveAccountsLayout,
|
|
6338
|
-
type approveAccountsLayoutParams,
|
|
6339
|
-
approveAndMintTo,
|
|
6340
|
-
batchCompressLayout,
|
|
6341
|
-
calculateCompressibleLoadComputeUnits,
|
|
6342
|
-
checkMint,
|
|
6343
|
-
checkSplInterfaceInfo,
|
|
6344
|
-
checkTokenPoolInfo,
|
|
6345
|
-
compress,
|
|
6346
|
-
compressSplTokenAccount,
|
|
6347
|
-
compressSplTokenAccountInstructionDataLayout,
|
|
6348
|
-
convertTokenDataToAccount,
|
|
6349
|
-
createAssociatedCTokenAccountIdempotentInstruction,
|
|
6350
|
-
createAssociatedCTokenAccountInstruction,
|
|
6351
|
-
createAssociatedTokenAccountInterfaceIdempotentInstruction,
|
|
6352
|
-
createAssociatedTokenAccountInterfaceInstruction,
|
|
6353
|
-
createAtaInterface,
|
|
6354
|
-
createAtaInterfaceIdempotent,
|
|
6355
|
-
createAtaInterfaceIdempotentInstruction,
|
|
6356
|
-
createCTokenTransferInstruction,
|
|
6357
|
-
createDecompressInterfaceInstruction,
|
|
6358
|
-
createDecompressOutputState,
|
|
6359
|
-
createLoadAccountsParams,
|
|
6360
|
-
createLoadAtaInstructions,
|
|
6361
|
-
createLoadAtaInstructionsFromInterface,
|
|
6362
|
-
createMint,
|
|
6363
|
-
createMintInstruction,
|
|
6364
|
-
createMintInterface,
|
|
6365
|
-
createMintToCompressedInstruction,
|
|
6366
|
-
createMintToInstruction,
|
|
6367
|
-
createMintToInterfaceInstruction,
|
|
6368
|
-
createRemoveMetadataKeyInstruction,
|
|
6369
|
-
createSplInterface,
|
|
6370
|
-
createTokenMetadata,
|
|
6371
|
-
createTokenPool,
|
|
6372
|
-
createTokenPoolAccountsLayout,
|
|
6373
|
-
type createTokenPoolAccountsLayoutParams,
|
|
6374
|
-
createTokenProgramLookupTable,
|
|
6375
|
-
createTransferInterfaceInstruction,
|
|
6376
|
-
createTransferOutputState,
|
|
6377
|
-
createUpdateFreezeAuthorityInstruction,
|
|
6378
|
-
createUpdateMetadataAuthorityInstruction,
|
|
6379
|
-
createUpdateMetadataFieldInstruction,
|
|
6380
|
-
createUpdateMintAuthorityInstruction,
|
|
6381
|
-
createWrapInstruction,
|
|
6382
|
-
decodeApproveInstructionData,
|
|
6383
|
-
decodeBatchCompressInstructionData,
|
|
6384
|
-
decodeCompressSplTokenAccountInstructionData,
|
|
6385
|
-
decodeMintToInstructionData,
|
|
6386
|
-
decodeRevokeInstructionData,
|
|
6387
|
-
decodeTokenMetadata,
|
|
6388
|
-
decodeTransferInstructionData,
|
|
6389
|
-
decompress,
|
|
6390
|
-
decompressDelegated,
|
|
6391
|
-
decompressInterface,
|
|
6392
|
-
deriveSplInterfaceInfo,
|
|
6393
|
-
deriveTokenPoolInfo,
|
|
6394
|
-
deserializeMint,
|
|
6395
|
-
encodeApproveInstructionData,
|
|
6396
|
-
encodeBatchCompressInstructionData,
|
|
6397
|
-
encodeCompressSplTokenAccountInstructionData,
|
|
6398
|
-
encodeMintToInstructionData,
|
|
6399
|
-
encodeRevokeInstructionData,
|
|
6400
|
-
encodeTokenMetadata,
|
|
6401
|
-
encodeTransferInstructionData,
|
|
6402
|
-
extractTokenMetadata,
|
|
6403
|
-
freezeAccountsLayout,
|
|
6404
|
-
type freezeAccountsLayoutParams,
|
|
6405
|
-
getAccountInterface,
|
|
6406
|
-
getAssociatedTokenAddressInterface,
|
|
6407
|
-
getAtaInterface,
|
|
6408
|
-
getMintInterface,
|
|
6409
|
-
getOrCreateAtaInterface,
|
|
6410
|
-
getSplInterfaceInfos,
|
|
6411
|
-
getTokenPoolInfos,
|
|
6412
|
-
groupAccountsByTreeType,
|
|
6413
|
-
isSingleSplInterfaceInfo,
|
|
6414
|
-
isSingleTokenPoolInfo,
|
|
6415
|
-
loadAta,
|
|
6416
|
-
mergeTokenAccounts,
|
|
6417
|
-
mintTo,
|
|
6418
|
-
mintToAccountsLayout,
|
|
6419
|
-
type mintToAccountsLayoutParams,
|
|
6420
|
-
mintTo$1 as mintToCToken,
|
|
6421
|
-
mintToCompressed,
|
|
6422
|
-
mintToInterface,
|
|
6423
|
-
mintToLayout,
|
|
6424
|
-
packCompressedTokenAccounts,
|
|
6425
|
-
parseCTokenCold,
|
|
6426
|
-
parseCTokenHot,
|
|
6427
|
-
parseMaybeDelegatedTransfer,
|
|
6428
|
-
parseTokenData,
|
|
6429
|
-
removeMetadataKey,
|
|
6430
|
-
revoke,
|
|
6431
|
-
revokeAccountsLayout,
|
|
6432
|
-
type revokeAccountsLayoutParams,
|
|
6433
|
-
selectAccountsByPreferredTreeType,
|
|
6434
|
-
selectMinCompressedTokenAccountsForDecompression,
|
|
6435
|
-
selectMinCompressedTokenAccountsForTransfer,
|
|
6436
|
-
selectMinCompressedTokenAccountsForTransferOrPartial,
|
|
6437
|
-
selectSmartCompressedTokenAccountsForTransfer,
|
|
6438
|
-
selectSmartCompressedTokenAccountsForTransferOrPartial,
|
|
6439
|
-
selectSplInterfaceInfo,
|
|
6440
|
-
selectSplInterfaceInfosForDecompression,
|
|
6441
|
-
selectTokenAccountsForApprove,
|
|
6442
|
-
selectTokenPoolInfo,
|
|
6443
|
-
selectTokenPoolInfosForDecompression,
|
|
6444
|
-
serializeMint,
|
|
6445
|
-
sumUpTokenAmount,
|
|
6446
|
-
thawAccountsLayout,
|
|
6447
|
-
type thawAccountsLayoutParams,
|
|
6448
|
-
toAccountInfo,
|
|
6449
|
-
toOffChainMetadataJson,
|
|
6450
|
-
toTokenPoolInfo,
|
|
6451
|
-
transfer,
|
|
6452
|
-
transferAccountsLayout,
|
|
6453
|
-
type transferAccountsLayoutParams,
|
|
6454
|
-
transferDelegated,
|
|
6455
|
-
transferInterface,
|
|
6456
|
-
unpackMintData,
|
|
6457
|
-
unpackMintInterface,
|
|
6458
|
-
updateFreezeAuthority,
|
|
6459
|
-
updateMetadataAuthority,
|
|
6460
|
-
updateMetadataField,
|
|
6461
|
-
updateMintAuthority,
|
|
6462
|
-
validateSameTokenOwner,
|
|
6463
|
-
wrap,
|
|
6464
|
-
};
|
|
5730
|
+
declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKey, payer?: Signer, confirmOptions?: ConfirmOptions, interfaceOptions?: InterfaceOptions): Promise<TransactionSignature | null>;
|
|
5731
|
+
|
|
5732
|
+
export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, type AccountInterface, Action, type AddSplInterfaceParams, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BASE_RENT_PER_EPOCH, BATCH_COMPRESS_DISCRIMINATOR, type BaseMint, type BatchCompressInstructionData, COMPRESSIBLE_CTOKEN_ACCOUNT_SIZE, COMPRESSIBLE_CTOKEN_RENT_PER_EPOCH, COMPRESSION_COST, COMPRESSION_INCENTIVE, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CTokenConfig, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedMint, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, type CompressibleAccountInput, type CompressibleConfig, type CompressibleLoadParams, CpiContextLayout, type CreateAssociatedCTokenAccountParams, type CreateMintParams, type CreateSplInterfaceParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR, DEFAULT_COMPRESSIBLE_CONFIG, DEFAULT_PREPAY_EPOCHS, DEFAULT_WRITE_TOP_UP, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_MIXED_TREE_TYPES, ERROR_NO_ACCOUNTS_FOUND, ExtensionType, IDL, type InputTokenDataWithContext, type InterfaceOptions, LIGHT_TOKEN_CONFIG, LIGHT_TOKEN_RENT_SPONSOR, type LightCompressedToken, CompressedTokenProgram as LightTokenProgram, type LoadResult, MAX_COMBINED_BATCH_BYTES, MAX_LOAD_ONLY_BATCH_BYTES, MAX_TRANSACTION_SIZE, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintContext, type MintExtension, type MintInterface, type MintToInstructionData, type MintToParams, type OffChainTokenMetadata, type OffChainTokenMetadataJson, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedCompressedAccount, type PackedTokenTransferOutputData, type ParsedAccountInfoInterface, RENT_PER_BYTE_PER_EPOCH, REVOKE_DISCRIMINATOR, type RevokeParams, SLOTS_PER_RENT_EPOCH, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type SelectInputAccountsOptions, type SelectedAccountsResult, type SplInterfaceActivity, type SplInterfaceInfo, TOTAL_COMPRESSION_COST, TRANSFER_DISCRIMINATOR, type TokenAccountSource, type TokenData, TokenDataVersion, type TokenMetadata, type TokenMetadataInstructionData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferParams, addSplInterfaces, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, batchCompressLayout, calculateCompressibleLoadComputeUnits, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createAssociatedCTokenAccountIdempotentInstruction, createAssociatedCTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressInterfaceInstruction, createDecompressOutputState, createLightTokenTransferInstruction, createLoadAccountsParams, createLoadAtaInstructions, createLoadAtaInstructionsFromInterface, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstructions, createTransferOutputState, createUnwrapInstruction, createUnwrapInstructions, createUpdateFreezeAuthorityInstruction, createUpdateMetadataAuthorityInstruction, createUpdateMetadataFieldInstruction, createUpdateMintAuthorityInstruction, createWrapInstruction, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTokenMetadata, decodeTransferInstructionData, decompress, decompressDelegated, decompressInterface, deriveSplInterfaceInfo, deriveTokenPoolInfo, deserializeMint, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTokenMetadata, encodeTransferInstructionData, estimateTransactionSize, extractTokenMetadata, freezeAccountsLayout, type freezeAccountsLayoutParams, getAccountInterface, getAssociatedTokenAddressInterface, getAtaInterface, getMintInterface, getOrCreateAtaInterface, getSplInterfaceInfos, getTokenPoolInfos, groupAccountsByTreeType, isSingleSplInterfaceInfo, isSingleTokenPoolInfo, loadAta, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintTo$1 as mintToCToken, mintToCompressed, mintToInterface, mintToLayout, packCompressedTokenAccounts, parseCTokenCold, parseCTokenHot, parseMaybeDelegatedTransfer, parseTokenData, removeMetadataKey, rentPerEpoch, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, selectAccountsByPreferredTreeType, selectInputsForAmount, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectSplInterfaceInfo, selectSplInterfaceInfosForDecompression, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, serializeMint, sliceLast, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, unpackMintData, unpackMintInterface, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
|