@lightprotocol/compressed-token 0.23.0-beta.4 → 0.23.0-beta.5
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-txB3ZZWl.cjs +2 -0
- package/dist/cjs/browser/types-txB3ZZWl.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-ClkYErSH.cjs +2 -0
- package/dist/cjs/node/types-ClkYErSH.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-mr7N4aLT.js +2 -0
- package/dist/es/browser/types-mr7N4aLT.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 +352 -1279
- package/dist/types/unified/index.d.ts +357 -1315
- 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
|
*
|
|
@@ -704,13 +596,7 @@ declare function unpackMintData(data: Buffer$1 | Uint8Array): {
|
|
|
704
596
|
* @param payer Fee payer public key
|
|
705
597
|
* @param validityProof Validity proof for the compressed mint
|
|
706
598
|
*/
|
|
707
|
-
declare function createUpdateMintAuthorityInstruction(
|
|
708
|
-
mintInterface: MintInterface,
|
|
709
|
-
currentMintAuthority: PublicKey,
|
|
710
|
-
newMintAuthority: PublicKey | null,
|
|
711
|
-
payer: PublicKey,
|
|
712
|
-
validityProof: ValidityProofWithContext,
|
|
713
|
-
): TransactionInstruction;
|
|
599
|
+
declare function createUpdateMintAuthorityInstruction(mintInterface: MintInterface, currentMintAuthority: PublicKey, newMintAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext): TransactionInstruction;
|
|
714
600
|
/**
|
|
715
601
|
* Create instruction for updating a compressed mint's freeze authority.
|
|
716
602
|
*
|
|
@@ -723,13 +609,7 @@ declare function createUpdateMintAuthorityInstruction(
|
|
|
723
609
|
* @param payer Fee payer public key
|
|
724
610
|
* @param validityProof Validity proof for the compressed mint
|
|
725
611
|
*/
|
|
726
|
-
declare function createUpdateFreezeAuthorityInstruction(
|
|
727
|
-
mintInterface: MintInterface,
|
|
728
|
-
currentFreezeAuthority: PublicKey,
|
|
729
|
-
newFreezeAuthority: PublicKey | null,
|
|
730
|
-
payer: PublicKey,
|
|
731
|
-
validityProof: ValidityProofWithContext,
|
|
732
|
-
): TransactionInstruction;
|
|
612
|
+
declare function createUpdateFreezeAuthorityInstruction(mintInterface: MintInterface, currentFreezeAuthority: PublicKey, newFreezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext): TransactionInstruction;
|
|
733
613
|
|
|
734
614
|
/**
|
|
735
615
|
* Create instruction for updating a compressed mint's metadata field.
|
|
@@ -746,16 +626,7 @@ declare function createUpdateFreezeAuthorityInstruction(
|
|
|
746
626
|
* @param customKey Custom key name (required if fieldType is 'custom')
|
|
747
627
|
* @param extensionIndex Extension index (default: 0)
|
|
748
628
|
*/
|
|
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;
|
|
629
|
+
declare function createUpdateMetadataFieldInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number): TransactionInstruction;
|
|
759
630
|
/**
|
|
760
631
|
* Create instruction for updating a compressed mint's metadata authority.
|
|
761
632
|
*
|
|
@@ -769,14 +640,7 @@ declare function createUpdateMetadataFieldInstruction(
|
|
|
769
640
|
* @param validityProof Validity proof for the compressed mint
|
|
770
641
|
* @param extensionIndex Extension index (default: 0)
|
|
771
642
|
*/
|
|
772
|
-
declare function createUpdateMetadataAuthorityInstruction(
|
|
773
|
-
mintInterface: MintInterface,
|
|
774
|
-
currentAuthority: PublicKey,
|
|
775
|
-
newAuthority: PublicKey,
|
|
776
|
-
payer: PublicKey,
|
|
777
|
-
validityProof: ValidityProofWithContext,
|
|
778
|
-
extensionIndex?: number,
|
|
779
|
-
): TransactionInstruction;
|
|
643
|
+
declare function createUpdateMetadataAuthorityInstruction(mintInterface: MintInterface, currentAuthority: PublicKey, newAuthority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, extensionIndex?: number): TransactionInstruction;
|
|
780
644
|
/**
|
|
781
645
|
* Create instruction for removing a metadata key from a compressed mint.
|
|
782
646
|
*
|
|
@@ -791,15 +655,7 @@ declare function createUpdateMetadataAuthorityInstruction(
|
|
|
791
655
|
* @param idempotent If true, don't error if key doesn't exist (default: false)
|
|
792
656
|
* @param extensionIndex Extension index (default: 0)
|
|
793
657
|
*/
|
|
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;
|
|
658
|
+
declare function createRemoveMetadataKeyInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, key: string, idempotent?: boolean, extensionIndex?: number): TransactionInstruction;
|
|
803
659
|
|
|
804
660
|
interface CompressToPubkey {
|
|
805
661
|
bump: number;
|
|
@@ -809,7 +665,6 @@ interface CompressToPubkey {
|
|
|
809
665
|
interface CompressibleConfig {
|
|
810
666
|
tokenAccountVersion: number;
|
|
811
667
|
rentPayment: number;
|
|
812
|
-
hasTopUp: number;
|
|
813
668
|
compressionOnly: number;
|
|
814
669
|
writeTopUp: number;
|
|
815
670
|
compressToAccountPubkey?: CompressToPubkey | null;
|
|
@@ -818,42 +673,62 @@ interface CreateAssociatedCTokenAccountParams {
|
|
|
818
673
|
bump: number;
|
|
819
674
|
compressibleConfig?: CompressibleConfig;
|
|
820
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* Default compressible config for c-token ATAs - matches Rust SDK defaults.
|
|
678
|
+
*
|
|
679
|
+
* - tokenAccountVersion: 3 (ShaFlat) - latest hashing scheme
|
|
680
|
+
* - rentPayment: 16 - prepay 16 epochs (~24 hours rent)
|
|
681
|
+
* - compressionOnly: 1 - required for ATAs
|
|
682
|
+
* - writeTopUp: 766 - per-write top-up (~2 epochs rent) when rent < 2 epochs
|
|
683
|
+
* - compressToAccountPubkey: null - required for ATAs
|
|
684
|
+
*
|
|
685
|
+
* Cost breakdown at ATA creation:
|
|
686
|
+
* - Rent sponsor PDA (LIGHT_TOKEN_RENT_SPONSOR) pays: rent exemption (~890,880 lamports)
|
|
687
|
+
* - Fee payer pays: compression_cost (11K) + 16 epochs rent (~6,400) = ~17,400 lamports + tx fees
|
|
688
|
+
*
|
|
689
|
+
* Per-write top-up (transfers):
|
|
690
|
+
* - When account rent is below 2 epochs, fee payer pays 766 lamports top-up
|
|
691
|
+
* - This keeps the account perpetually funded when actively used
|
|
692
|
+
*
|
|
693
|
+
* Rent calculation (272-byte compressible ctoken account):
|
|
694
|
+
* - rent_per_epoch = base_rent (128) + bytes * rent_per_byte (272 * 1) = 400 lamports
|
|
695
|
+
* - 16 epochs = 16 * 400 = 6,400 lamports (24 hours)
|
|
696
|
+
* - 2 epochs = 2 * 400 = 800 lamports (~3 hours, writeTopUp = 766 is conservative)
|
|
697
|
+
*
|
|
698
|
+
* Account size breakdown (272 bytes):
|
|
699
|
+
* - 165 bytes: SPL token base layout
|
|
700
|
+
* - 1 byte: account_type discriminator
|
|
701
|
+
* - 1 byte: Option discriminator for extensions
|
|
702
|
+
* - 4 bytes: Vec length prefix
|
|
703
|
+
* - 1 byte: extension type discriminant
|
|
704
|
+
* - 4 bytes: CompressibleExtension header (decimals_option, decimals, compression_only, is_ata)
|
|
705
|
+
* - 96 bytes: CompressionInfo struct
|
|
706
|
+
*/
|
|
707
|
+
declare const DEFAULT_COMPRESSIBLE_CONFIG: CompressibleConfig;
|
|
821
708
|
/**
|
|
822
709
|
* Create instruction for creating an associated compressed token account.
|
|
710
|
+
* Uses the default rent sponsor PDA by default.
|
|
823
711
|
*
|
|
824
712
|
* @param feePayer Fee payer public key.
|
|
825
713
|
* @param owner Owner of the associated token account.
|
|
826
714
|
* @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;
|
|
715
|
+
* @param compressibleConfig Compressible configuration (defaults to rent sponsor config).
|
|
716
|
+
* @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
|
|
717
|
+
* @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
|
|
718
|
+
*/
|
|
719
|
+
declare function createAssociatedCTokenAccountInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
|
|
839
720
|
/**
|
|
840
721
|
* Create idempotent instruction for creating an associated compressed token account.
|
|
722
|
+
* Uses the default rent sponsor PDA by default.
|
|
841
723
|
*
|
|
842
724
|
* @param feePayer Fee payer public key.
|
|
843
725
|
* @param owner Owner of the associated token account.
|
|
844
726
|
* @param mint Mint address.
|
|
845
|
-
* @param compressibleConfig
|
|
846
|
-
* @param configAccount
|
|
847
|
-
* @param rentPayerPda
|
|
727
|
+
* @param compressibleConfig Compressible configuration (defaults to rent sponsor config).
|
|
728
|
+
* @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
|
|
729
|
+
* @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
|
|
848
730
|
*/
|
|
849
|
-
declare function createAssociatedCTokenAccountIdempotentInstruction(
|
|
850
|
-
feePayer: PublicKey,
|
|
851
|
-
owner: PublicKey,
|
|
852
|
-
mint: PublicKey,
|
|
853
|
-
compressibleConfig?: CompressibleConfig,
|
|
854
|
-
configAccount?: PublicKey,
|
|
855
|
-
rentPayerPda?: PublicKey,
|
|
856
|
-
): TransactionInstruction;
|
|
731
|
+
declare function createAssociatedCTokenAccountIdempotentInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
|
|
857
732
|
|
|
858
733
|
/**
|
|
859
734
|
* c-token-specific config for createAssociatedTokenAccountInterfaceInstruction
|
|
@@ -876,15 +751,7 @@ interface CTokenConfig {
|
|
|
876
751
|
* @param associatedTokenProgramId Associated token program ID.
|
|
877
752
|
* @param ctokenConfig Optional c-token-specific configuration.
|
|
878
753
|
*/
|
|
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;
|
|
754
|
+
declare function createAssociatedTokenAccountInterfaceInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
|
|
888
755
|
/**
|
|
889
756
|
* Create idempotent instruction for creating an associated token account (SPL,
|
|
890
757
|
* Token-2022, or c-token). Follows SPL Token API signature with optional c-token
|
|
@@ -898,15 +765,7 @@ declare function createAssociatedTokenAccountInterfaceInstruction(
|
|
|
898
765
|
* @param associatedTokenProgramId Associated token program ID.
|
|
899
766
|
* @param ctokenConfig Optional c-token-specific configuration.
|
|
900
767
|
*/
|
|
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;
|
|
768
|
+
declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
|
|
910
769
|
/**
|
|
911
770
|
* Short alias for createAssociatedTokenAccountInterfaceIdempotentInstruction.
|
|
912
771
|
*/
|
|
@@ -924,17 +783,12 @@ declare const createAtaInterfaceIdempotentInstruction: typeof createAssociatedTo
|
|
|
924
783
|
* @param recipientAccount Recipient onchain token account address.
|
|
925
784
|
* @param amount Amount to mint.
|
|
926
785
|
*/
|
|
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;
|
|
786
|
+
declare function createMintToInstruction(authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, merkleContext: MerkleContext, mintData: MintInstructionData, outputStateTreeInfo: TreeInfo, recipientAccount: PublicKey, amount: number | bigint): TransactionInstruction;
|
|
937
787
|
|
|
788
|
+
/** Default compressible config PDA (V1) */
|
|
789
|
+
declare const LIGHT_TOKEN_CONFIG: PublicKey;
|
|
790
|
+
/** Default rent sponsor PDA (V1) */
|
|
791
|
+
declare const LIGHT_TOKEN_RENT_SPONSOR: PublicKey;
|
|
938
792
|
/**
|
|
939
793
|
* Token data version enum - mirrors Rust TokenDataVersion
|
|
940
794
|
* Used for compressed token account hashing strategy
|
|
@@ -945,7 +799,7 @@ declare enum TokenDataVersion {
|
|
|
945
799
|
/** V2: Poseidon hash with big-endian amount, discriminator [0,0,0,0,0,0,0,3] */
|
|
946
800
|
V2 = 2,
|
|
947
801
|
/** ShaFlat: SHA256 hash of borsh-serialized data, discriminator [0,0,0,0,0,0,0,4] */
|
|
948
|
-
ShaFlat = 3
|
|
802
|
+
ShaFlat = 3
|
|
949
803
|
}
|
|
950
804
|
declare const POOL_SEED: Buffer$1<ArrayBuffer>;
|
|
951
805
|
declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
|
|
@@ -959,6 +813,47 @@ declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
|
959
813
|
declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
960
814
|
declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
961
815
|
declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
816
|
+
/**
|
|
817
|
+
* Rent configuration constants for compressible ctoken accounts.
|
|
818
|
+
* These match the Rust SDK defaults in program-libs/compressible/src/rent/config.rs
|
|
819
|
+
*/
|
|
820
|
+
/** Base rent per epoch (lamports) */
|
|
821
|
+
declare const BASE_RENT_PER_EPOCH = 128;
|
|
822
|
+
/** Rent per byte per epoch (lamports) */
|
|
823
|
+
declare const RENT_PER_BYTE_PER_EPOCH = 1;
|
|
824
|
+
/** Slots per rent epoch (1.5 hours) */
|
|
825
|
+
declare const SLOTS_PER_RENT_EPOCH = 13500;
|
|
826
|
+
/** Compression cost (lamports) - paid at account creation */
|
|
827
|
+
declare const COMPRESSION_COST = 10000;
|
|
828
|
+
/** Compression incentive (lamports) - paid at account creation */
|
|
829
|
+
declare const COMPRESSION_INCENTIVE = 1000;
|
|
830
|
+
/** Total compression cost (COMPRESSION_COST + COMPRESSION_INCENTIVE) */
|
|
831
|
+
declare const TOTAL_COMPRESSION_COST: number;
|
|
832
|
+
/**
|
|
833
|
+
* Compressible ctoken account size in bytes.
|
|
834
|
+
* = 165 (base SPL token) + 1 (account_type) + 1 (Option) + 4 (Vec len) + 1 (ext disc) + 4 (ext header) + 96 (CompressionInfo) = 272
|
|
835
|
+
* Source: program-libs/token-interface/src/state/token/top_up.rs MIN_SIZE_WITH_COMPRESSIBLE
|
|
836
|
+
*/
|
|
837
|
+
declare const COMPRESSIBLE_CTOKEN_ACCOUNT_SIZE = 272;
|
|
838
|
+
/**
|
|
839
|
+
* Calculate rent per epoch for a given account size.
|
|
840
|
+
* Formula: base_rent + (bytes * lamports_per_byte_per_epoch)
|
|
841
|
+
*/
|
|
842
|
+
declare function rentPerEpoch(bytes: number): number;
|
|
843
|
+
/**
|
|
844
|
+
* Default rent per epoch for a compressible ctoken account (272 bytes).
|
|
845
|
+
* = 128 + 272 = 400 lamports
|
|
846
|
+
*/
|
|
847
|
+
declare const COMPRESSIBLE_CTOKEN_RENT_PER_EPOCH: number;
|
|
848
|
+
/** Default prepaid epochs (24 hours = 16 epochs * 1.5h) */
|
|
849
|
+
declare const DEFAULT_PREPAY_EPOCHS = 16;
|
|
850
|
+
/** Default write top-up (lamports) - ~2 epochs rent */
|
|
851
|
+
declare const DEFAULT_WRITE_TOP_UP = 766;
|
|
852
|
+
/**
|
|
853
|
+
* Calculate fee payer cost at ATA creation.
|
|
854
|
+
* = compression_cost (11K) + (prepay_epochs * rent_per_epoch)
|
|
855
|
+
*/
|
|
856
|
+
declare function calculateFeePayerCostAtCreation(prepayEpochs?: number, accountBytes?: number): number;
|
|
962
857
|
|
|
963
858
|
/**
|
|
964
859
|
* Create instruction for minting tokens from a c-mint to compressed accounts.
|
|
@@ -976,19 +871,10 @@ declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer
|
|
|
976
871
|
* @param tokenAccountVersion Token account version (default:
|
|
977
872
|
* TokenDataVersion.ShaFlat).
|
|
978
873
|
*/
|
|
979
|
-
declare function createMintToCompressedInstruction(
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
merkleContext: MerkleContext,
|
|
984
|
-
mintData: MintInstructionData,
|
|
985
|
-
recipients: Array<{
|
|
986
|
-
recipient: PublicKey;
|
|
987
|
-
amount: number | bigint;
|
|
988
|
-
}>,
|
|
989
|
-
outputStateTreeInfo?: TreeInfo,
|
|
990
|
-
tokenAccountVersion?: TokenDataVersion,
|
|
991
|
-
): TransactionInstruction;
|
|
874
|
+
declare function createMintToCompressedInstruction(authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, merkleContext: MerkleContext, mintData: MintInstructionData, recipients: Array<{
|
|
875
|
+
recipient: PublicKey;
|
|
876
|
+
amount: number | bigint;
|
|
877
|
+
}>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: TokenDataVersion): TransactionInstruction;
|
|
992
878
|
|
|
993
879
|
/**
|
|
994
880
|
* Create mint-to instruction for SPL, Token-2022, or compressed token mints.
|
|
@@ -1002,31 +888,22 @@ declare function createMintToCompressedInstruction(
|
|
|
1002
888
|
* @param validityProof Validity proof (required for compressed mints).
|
|
1003
889
|
* @param multiSigners Multi-signature signer public keys.
|
|
1004
890
|
*/
|
|
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;
|
|
891
|
+
declare function createMintToInterfaceInstruction(mintInterface: MintInterface, destination: PublicKey, authority: PublicKey, payer: PublicKey, amount: number | bigint, validityProof?: ValidityProofWithContext, multiSigners?: PublicKey[]): TransactionInstruction;
|
|
1014
892
|
|
|
1015
893
|
/**
|
|
1016
894
|
* Create a c-token transfer instruction.
|
|
1017
895
|
*
|
|
896
|
+
* For c-token accounts with compressible extension, the program needs
|
|
897
|
+
* system_program and fee_payer to handle rent top-ups.
|
|
898
|
+
*
|
|
1018
899
|
* @param source Source c-token account
|
|
1019
900
|
* @param destination Destination c-token account
|
|
1020
901
|
* @param owner Owner of the source account (signer, also pays for compressible extension top-ups)
|
|
1021
902
|
* @param amount Amount to transfer
|
|
903
|
+
* @param feePayer Optional fee payer for top-ups (defaults to owner)
|
|
1022
904
|
* @returns Transaction instruction for c-token transfer
|
|
1023
905
|
*/
|
|
1024
|
-
declare function createCTokenTransferInstruction(
|
|
1025
|
-
source: PublicKey,
|
|
1026
|
-
destination: PublicKey,
|
|
1027
|
-
owner: PublicKey,
|
|
1028
|
-
amount: number | bigint,
|
|
1029
|
-
): TransactionInstruction;
|
|
906
|
+
declare function createCTokenTransferInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
|
|
1030
907
|
/**
|
|
1031
908
|
* Construct a transfer instruction for SPL/T22/c-token. Defaults to c-token
|
|
1032
909
|
* program. For cross-program transfers (SPL <> c-token), use `wrap`/`unwrap`.
|
|
@@ -1037,18 +914,11 @@ declare function createCTokenTransferInstruction(
|
|
|
1037
914
|
* @param amount Amount to transfer
|
|
1038
915
|
* @returns instruction for c-token transfer
|
|
1039
916
|
*/
|
|
1040
|
-
declare function createTransferInterfaceInstruction(
|
|
1041
|
-
source: PublicKey,
|
|
1042
|
-
destination: PublicKey,
|
|
1043
|
-
owner: PublicKey,
|
|
1044
|
-
amount: number | bigint,
|
|
1045
|
-
multiSigners?: (Signer | PublicKey)[],
|
|
1046
|
-
programId?: PublicKey,
|
|
1047
|
-
): TransactionInstruction;
|
|
917
|
+
declare function createTransferInterfaceInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, multiSigners?: (Signer | PublicKey)[], programId?: PublicKey): TransactionInstruction;
|
|
1048
918
|
|
|
1049
919
|
declare namespace BN {
|
|
1050
|
-
type Endianness =
|
|
1051
|
-
type IPrimeName =
|
|
920
|
+
type Endianness = "le" | "be";
|
|
921
|
+
type IPrimeName = "k256" | "p224" | "p192" | "p25519";
|
|
1052
922
|
|
|
1053
923
|
interface MPrime {
|
|
1054
924
|
name: string;
|
|
@@ -1070,7 +940,7 @@ declare class BN {
|
|
|
1070
940
|
|
|
1071
941
|
constructor(
|
|
1072
942
|
number: bigint | number | string | number[] | Uint8Array | Buffer | BN,
|
|
1073
|
-
base?: number |
|
|
943
|
+
base?: number | "hex",
|
|
1074
944
|
endian?: BN.Endianness,
|
|
1075
945
|
);
|
|
1076
946
|
constructor(
|
|
@@ -1116,7 +986,7 @@ declare class BN {
|
|
|
1116
986
|
/**
|
|
1117
987
|
* @description convert to base-string and pad with zeroes
|
|
1118
988
|
*/
|
|
1119
|
-
toString(base?: number |
|
|
989
|
+
toString(base?: number | "hex", length?: number): string;
|
|
1120
990
|
|
|
1121
991
|
/**
|
|
1122
992
|
* @description convert to Javascript Number (limited to 53 bits)
|
|
@@ -1376,11 +1246,7 @@ declare class BN {
|
|
|
1376
1246
|
/**
|
|
1377
1247
|
* @description division with remainder
|
|
1378
1248
|
*/
|
|
1379
|
-
divmod(
|
|
1380
|
-
b: BN,
|
|
1381
|
-
mode?: 'div' | 'mod',
|
|
1382
|
-
positive?: boolean,
|
|
1383
|
-
): { div: BN; mod: BN };
|
|
1249
|
+
divmod(b: BN, mode?: "div" | "mod", positive?: boolean): { div: BN; mod: BN };
|
|
1384
1250
|
|
|
1385
1251
|
/**
|
|
1386
1252
|
* @description reduct
|
|
@@ -1748,21 +1614,14 @@ declare function toTokenPoolInfo(info: SplInterfaceInfo): TokenPoolInfo;
|
|
|
1748
1614
|
*
|
|
1749
1615
|
* @returns SplInterfaceInfo for the to-be-initialized interface
|
|
1750
1616
|
*/
|
|
1751
|
-
declare function deriveSplInterfaceInfo(
|
|
1752
|
-
mint: PublicKey,
|
|
1753
|
-
tokenProgramId: PublicKey,
|
|
1754
|
-
poolIndex?: number,
|
|
1755
|
-
): SplInterfaceInfo;
|
|
1617
|
+
declare function deriveSplInterfaceInfo(mint: PublicKey, tokenProgramId: PublicKey, poolIndex?: number): SplInterfaceInfo;
|
|
1756
1618
|
/**
|
|
1757
1619
|
* Check if the SPL interface info is initialized and has a balance.
|
|
1758
1620
|
* @param mint The mint of the SPL interface
|
|
1759
1621
|
* @param splInterfaceInfo The SPL interface info (or TokenPoolInfo for backward compatibility)
|
|
1760
1622
|
* @returns True if the SPL interface info is initialized and has a balance
|
|
1761
1623
|
*/
|
|
1762
|
-
declare function checkSplInterfaceInfo(
|
|
1763
|
-
splInterfaceInfo: SplInterfaceInfo | TokenPoolInfo,
|
|
1764
|
-
mint: PublicKey,
|
|
1765
|
-
): boolean;
|
|
1624
|
+
declare function checkSplInterfaceInfo(splInterfaceInfo: SplInterfaceInfo | TokenPoolInfo, mint: PublicKey): boolean;
|
|
1766
1625
|
/**
|
|
1767
1626
|
* Get the SPL interface infos for a given mint.
|
|
1768
1627
|
* @param rpc The RPC client
|
|
@@ -1771,11 +1630,7 @@ declare function checkSplInterfaceInfo(
|
|
|
1771
1630
|
*
|
|
1772
1631
|
* @returns The SPL interface infos
|
|
1773
1632
|
*/
|
|
1774
|
-
declare function getSplInterfaceInfos(
|
|
1775
|
-
rpc: Rpc,
|
|
1776
|
-
mint: PublicKey,
|
|
1777
|
-
commitment?: Commitment,
|
|
1778
|
-
): Promise<SplInterfaceInfo[]>;
|
|
1633
|
+
declare function getSplInterfaceInfos(rpc: Rpc, mint: PublicKey, commitment?: Commitment): Promise<SplInterfaceInfo[]>;
|
|
1779
1634
|
type SplInterfaceActivity = {
|
|
1780
1635
|
signature: string;
|
|
1781
1636
|
amount: BN;
|
|
@@ -1787,7 +1642,7 @@ type SplInterfaceActivity = {
|
|
|
1787
1642
|
declare enum Action {
|
|
1788
1643
|
Compress = 1,
|
|
1789
1644
|
Decompress = 2,
|
|
1790
|
-
Transfer = 3
|
|
1645
|
+
Transfer = 3
|
|
1791
1646
|
}
|
|
1792
1647
|
/**
|
|
1793
1648
|
* For `compress` and `mintTo` instructions only.
|
|
@@ -1799,9 +1654,7 @@ declare enum Action {
|
|
|
1799
1654
|
*
|
|
1800
1655
|
* @returns A random SPL interface info
|
|
1801
1656
|
*/
|
|
1802
|
-
declare function selectSplInterfaceInfo(
|
|
1803
|
-
infos: SplInterfaceInfo[],
|
|
1804
|
-
): SplInterfaceInfo;
|
|
1657
|
+
declare function selectSplInterfaceInfo(infos: SplInterfaceInfo[]): SplInterfaceInfo;
|
|
1805
1658
|
/**
|
|
1806
1659
|
* Select one or multiple SPL interface infos from the SPL interface infos.
|
|
1807
1660
|
*
|
|
@@ -1814,10 +1667,7 @@ declare function selectSplInterfaceInfo(
|
|
|
1814
1667
|
*
|
|
1815
1668
|
* @returns Array with one or more SPL interface infos.
|
|
1816
1669
|
*/
|
|
1817
|
-
declare function selectSplInterfaceInfosForDecompression(
|
|
1818
|
-
infos: SplInterfaceInfo[],
|
|
1819
|
-
decompressAmount: number | BN,
|
|
1820
|
-
): SplInterfaceInfo[];
|
|
1670
|
+
declare function selectSplInterfaceInfosForDecompression(infos: SplInterfaceInfo[], decompressAmount: number | BN): SplInterfaceInfo[];
|
|
1821
1671
|
/**
|
|
1822
1672
|
* @deprecated Use {@link SplInterfaceActivity} instead.
|
|
1823
1673
|
*/
|
|
@@ -1825,26 +1675,15 @@ type TokenPoolActivity = SplInterfaceActivity;
|
|
|
1825
1675
|
/**
|
|
1826
1676
|
* @deprecated Use {@link deriveSplInterfaceInfo} instead.
|
|
1827
1677
|
*/
|
|
1828
|
-
declare function deriveTokenPoolInfo(
|
|
1829
|
-
mint: PublicKey,
|
|
1830
|
-
tokenProgramId: PublicKey,
|
|
1831
|
-
poolIndex?: number,
|
|
1832
|
-
): TokenPoolInfo;
|
|
1678
|
+
declare function deriveTokenPoolInfo(mint: PublicKey, tokenProgramId: PublicKey, poolIndex?: number): TokenPoolInfo;
|
|
1833
1679
|
/**
|
|
1834
1680
|
* @deprecated Use {@link checkSplInterfaceInfo} instead.
|
|
1835
1681
|
*/
|
|
1836
|
-
declare function checkTokenPoolInfo(
|
|
1837
|
-
tokenPoolInfo: TokenPoolInfo,
|
|
1838
|
-
mint: PublicKey,
|
|
1839
|
-
): boolean;
|
|
1682
|
+
declare function checkTokenPoolInfo(tokenPoolInfo: TokenPoolInfo, mint: PublicKey): boolean;
|
|
1840
1683
|
/**
|
|
1841
1684
|
* @deprecated Use {@link getSplInterfaceInfos} instead.
|
|
1842
1685
|
*/
|
|
1843
|
-
declare function getTokenPoolInfos(
|
|
1844
|
-
rpc: Rpc,
|
|
1845
|
-
mint: PublicKey,
|
|
1846
|
-
commitment?: Commitment,
|
|
1847
|
-
): Promise<TokenPoolInfo[]>;
|
|
1686
|
+
declare function getTokenPoolInfos(rpc: Rpc, mint: PublicKey, commitment?: Commitment): Promise<TokenPoolInfo[]>;
|
|
1848
1687
|
/**
|
|
1849
1688
|
* @deprecated Use {@link selectSplInterfaceInfo} instead.
|
|
1850
1689
|
*/
|
|
@@ -1852,10 +1691,7 @@ declare function selectTokenPoolInfo(infos: TokenPoolInfo[]): TokenPoolInfo;
|
|
|
1852
1691
|
/**
|
|
1853
1692
|
* @deprecated Use {@link selectSplInterfaceInfosForDecompression} instead.
|
|
1854
1693
|
*/
|
|
1855
|
-
declare function selectTokenPoolInfosForDecompression(
|
|
1856
|
-
infos: TokenPoolInfo[],
|
|
1857
|
-
decompressAmount: number | BN,
|
|
1858
|
-
): TokenPoolInfo[];
|
|
1694
|
+
declare function selectTokenPoolInfosForDecompression(infos: TokenPoolInfo[], decompressAmount: number | BN): TokenPoolInfo[];
|
|
1859
1695
|
|
|
1860
1696
|
/**
|
|
1861
1697
|
* Create decompressInterface instruction using Transfer2.
|
|
@@ -1873,26 +1709,17 @@ declare function selectTokenPoolInfosForDecompression(
|
|
|
1873
1709
|
* @param decimals Mint decimals (required for SPL destinations)
|
|
1874
1710
|
* @returns TransactionInstruction
|
|
1875
1711
|
*/
|
|
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;
|
|
1712
|
+
declare function createDecompressInterfaceInstruction(payer: PublicKey, inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: bigint, validityProof: ValidityProofWithContext, splInterfaceInfo: SplInterfaceInfo | undefined, decimals: number): TransactionInstruction;
|
|
1885
1713
|
|
|
1886
1714
|
declare const TokenAccountSourceType: {
|
|
1887
|
-
readonly Spl:
|
|
1888
|
-
readonly Token2022:
|
|
1889
|
-
readonly SplCold:
|
|
1890
|
-
readonly Token2022Cold:
|
|
1891
|
-
readonly CTokenHot:
|
|
1892
|
-
readonly CTokenCold:
|
|
1715
|
+
readonly Spl: "spl";
|
|
1716
|
+
readonly Token2022: "token2022";
|
|
1717
|
+
readonly SplCold: "spl-cold";
|
|
1718
|
+
readonly Token2022Cold: "token2022-cold";
|
|
1719
|
+
readonly CTokenHot: "ctoken-hot";
|
|
1720
|
+
readonly CTokenCold: "ctoken-cold";
|
|
1893
1721
|
};
|
|
1894
|
-
type TokenAccountSourceTypeValue =
|
|
1895
|
-
(typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
|
|
1722
|
+
type TokenAccountSourceTypeValue = (typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
|
|
1896
1723
|
/** @internal */
|
|
1897
1724
|
interface TokenAccountSource {
|
|
1898
1725
|
type: TokenAccountSourceTypeValue;
|
|
@@ -1919,36 +1746,25 @@ interface AccountInterface {
|
|
|
1919
1746
|
_mint?: PublicKey;
|
|
1920
1747
|
}
|
|
1921
1748
|
/** @internal */
|
|
1922
|
-
declare function convertTokenDataToAccount(
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
tlv: Buffer$1 | null;
|
|
1931
|
-
},
|
|
1932
|
-
): Account;
|
|
1749
|
+
declare function convertTokenDataToAccount(address: PublicKey, tokenData: {
|
|
1750
|
+
mint: PublicKey;
|
|
1751
|
+
owner: PublicKey;
|
|
1752
|
+
amount: BN;
|
|
1753
|
+
delegate: PublicKey | null;
|
|
1754
|
+
state: number;
|
|
1755
|
+
tlv: Buffer$1 | null;
|
|
1756
|
+
}): Account;
|
|
1933
1757
|
/** Convert compressed account to AccountInfo */
|
|
1934
|
-
declare function toAccountInfo(
|
|
1935
|
-
compressedAccount: CompressedAccountWithMerkleContext,
|
|
1936
|
-
): AccountInfo<Buffer$1>;
|
|
1758
|
+
declare function toAccountInfo(compressedAccount: CompressedAccountWithMerkleContext): AccountInfo<Buffer$1>;
|
|
1937
1759
|
/** @internal */
|
|
1938
|
-
declare function parseCTokenHot(
|
|
1939
|
-
address: PublicKey,
|
|
1940
|
-
accountInfo: AccountInfo<Buffer$1>,
|
|
1941
|
-
): {
|
|
1760
|
+
declare function parseCTokenHot(address: PublicKey, accountInfo: AccountInfo<Buffer$1>): {
|
|
1942
1761
|
accountInfo: AccountInfo<Buffer$1>;
|
|
1943
1762
|
loadContext: undefined;
|
|
1944
1763
|
parsed: Account;
|
|
1945
1764
|
isCold: false;
|
|
1946
1765
|
};
|
|
1947
1766
|
/** @internal */
|
|
1948
|
-
declare function parseCTokenCold(
|
|
1949
|
-
address: PublicKey,
|
|
1950
|
-
compressedAccount: CompressedAccountWithMerkleContext,
|
|
1951
|
-
): {
|
|
1767
|
+
declare function parseCTokenCold(address: PublicKey, compressedAccount: CompressedAccountWithMerkleContext): {
|
|
1952
1768
|
accountInfo: AccountInfo<Buffer$1>;
|
|
1953
1769
|
loadContext: MerkleContext;
|
|
1954
1770
|
parsed: Account;
|
|
@@ -1964,12 +1780,7 @@ declare function parseCTokenCold(
|
|
|
1964
1780
|
*
|
|
1965
1781
|
* @return Token account information with compression context if applicable
|
|
1966
1782
|
*/
|
|
1967
|
-
declare function getAccountInterface(
|
|
1968
|
-
rpc: Rpc,
|
|
1969
|
-
address: PublicKey,
|
|
1970
|
-
commitment?: Commitment,
|
|
1971
|
-
programId?: PublicKey,
|
|
1972
|
-
): Promise<AccountInterface>;
|
|
1783
|
+
declare function getAccountInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
|
|
1973
1784
|
|
|
1974
1785
|
/**
|
|
1975
1786
|
* Options for interface operations (load, transfer)
|
|
@@ -1996,19 +1807,7 @@ interface InterfaceOptions {
|
|
|
1996
1807
|
* @param wrap Include SPL/T22 wrapping (default: false)
|
|
1997
1808
|
* @returns Transaction signature
|
|
1998
1809
|
*/
|
|
1999
|
-
declare function transferInterface(
|
|
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>;
|
|
1810
|
+
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>;
|
|
2012
1811
|
|
|
2013
1812
|
/**
|
|
2014
1813
|
* Account info interface for compressible accounts.
|
|
@@ -2129,21 +1928,11 @@ interface LoadResult {
|
|
|
2129
1928
|
* }
|
|
2130
1929
|
* ```
|
|
2131
1930
|
*/
|
|
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>;
|
|
1931
|
+
declare function createLoadAccountsParams(rpc: Rpc, payer: PublicKey, programId: PublicKey, programAccounts?: CompressibleAccountInput[], atas?: AccountInterface[], options?: InterfaceOptions): Promise<LoadResult>;
|
|
2140
1932
|
/**
|
|
2141
1933
|
* Calculate compute units for compressible load operation
|
|
2142
1934
|
*/
|
|
2143
|
-
declare function calculateCompressibleLoadComputeUnits(
|
|
2144
|
-
compressedAccountCount: number,
|
|
2145
|
-
hasValidityProof: boolean,
|
|
2146
|
-
): number;
|
|
1935
|
+
declare function calculateCompressibleLoadComputeUnits(compressedAccountCount: number, hasValidityProof: boolean): number;
|
|
2147
1936
|
|
|
2148
1937
|
/**
|
|
2149
1938
|
* Create a wrap instruction that moves tokens from an SPL/T22 account to a
|
|
@@ -2159,16 +1948,7 @@ declare function calculateCompressibleLoadComputeUnits(
|
|
|
2159
1948
|
* @param payer Fee payer (defaults to owner)
|
|
2160
1949
|
* @returns Instruction to wrap tokens
|
|
2161
1950
|
*/
|
|
2162
|
-
declare function createWrapInstruction(
|
|
2163
|
-
source: PublicKey,
|
|
2164
|
-
destination: PublicKey,
|
|
2165
|
-
owner: PublicKey,
|
|
2166
|
-
mint: PublicKey,
|
|
2167
|
-
amount: bigint,
|
|
2168
|
-
splInterfaceInfo: SplInterfaceInfo,
|
|
2169
|
-
decimals: number,
|
|
2170
|
-
payer?: PublicKey,
|
|
2171
|
-
): TransactionInstruction;
|
|
1951
|
+
declare function createWrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
|
|
2172
1952
|
|
|
2173
1953
|
/**
|
|
2174
1954
|
* Create and initialize a new mint for SPL/T22/c-token.
|
|
@@ -2187,19 +1967,7 @@ declare function createWrapInstruction(
|
|
|
2187
1967
|
*
|
|
2188
1968
|
* @returns Object with mint address and transaction signature
|
|
2189
1969
|
*/
|
|
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<{
|
|
1970
|
+
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
1971
|
mint: PublicKey;
|
|
2204
1972
|
transactionSignature: TransactionSignature;
|
|
2205
1973
|
}>;
|
|
@@ -2214,14 +1982,7 @@ declare function createMintInterface(
|
|
|
2214
1982
|
* @param newMintAuthority New mint authority (or null to revoke)
|
|
2215
1983
|
* @param confirmOptions Optional confirm options
|
|
2216
1984
|
*/
|
|
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>;
|
|
1985
|
+
declare function updateMintAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentMintAuthority: Signer, newMintAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2225
1986
|
/**
|
|
2226
1987
|
* Update the freeze authority of a compressed token mint.
|
|
2227
1988
|
*
|
|
@@ -2232,14 +1993,7 @@ declare function updateMintAuthority(
|
|
|
2232
1993
|
* @param newFreezeAuthority New freeze authority (or null to revoke)
|
|
2233
1994
|
* @param confirmOptions Optional confirm options
|
|
2234
1995
|
*/
|
|
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>;
|
|
1996
|
+
declare function updateFreezeAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentFreezeAuthority: Signer, newFreezeAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2243
1997
|
|
|
2244
1998
|
/**
|
|
2245
1999
|
* Update a metadata field on a compressed token mint.
|
|
@@ -2254,17 +2008,7 @@ declare function updateFreezeAuthority(
|
|
|
2254
2008
|
* @param extensionIndex Extension index (default: 0)
|
|
2255
2009
|
* @param confirmOptions Optional confirm options
|
|
2256
2010
|
*/
|
|
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>;
|
|
2011
|
+
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
2012
|
/**
|
|
2269
2013
|
* Update the metadata authority of a compressed token mint.
|
|
2270
2014
|
*
|
|
@@ -2276,15 +2020,7 @@ declare function updateMetadataField(
|
|
|
2276
2020
|
* @param extensionIndex Extension index (default: 0)
|
|
2277
2021
|
* @param confirmOptions Optional confirm options
|
|
2278
2022
|
*/
|
|
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>;
|
|
2023
|
+
declare function updateMetadataAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentAuthority: Signer, newAuthority: PublicKey, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2288
2024
|
/**
|
|
2289
2025
|
* Remove a metadata key from a compressed token mint.
|
|
2290
2026
|
*
|
|
@@ -2297,16 +2033,7 @@ declare function updateMetadataAuthority(
|
|
|
2297
2033
|
* @param extensionIndex Extension index (default: 0)
|
|
2298
2034
|
* @param confirmOptions Optional confirm options
|
|
2299
2035
|
*/
|
|
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>;
|
|
2036
|
+
declare function removeMetadataKey(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, key: string, idempotent?: boolean, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2310
2037
|
|
|
2311
2038
|
/**
|
|
2312
2039
|
* Create an associated token account for SPL/T22/c-token. Defaults to c-token
|
|
@@ -2325,17 +2052,7 @@ declare function removeMetadataKey(
|
|
|
2325
2052
|
* @param ctokenConfig Optional rent config
|
|
2326
2053
|
* @returns Address of the new associated token account
|
|
2327
2054
|
*/
|
|
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>;
|
|
2055
|
+
declare function createAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
|
|
2339
2056
|
/**
|
|
2340
2057
|
* Create an associated token account idempotently for SPL/T22/c-token. Defaults
|
|
2341
2058
|
* to c-token program.
|
|
@@ -2356,28 +2073,9 @@ declare function createAtaInterface(
|
|
|
2356
2073
|
*
|
|
2357
2074
|
* @returns Address of the associated token account
|
|
2358
2075
|
*/
|
|
2359
|
-
declare function createAtaInterfaceIdempotent(
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
mint: PublicKey,
|
|
2363
|
-
owner: PublicKey,
|
|
2364
|
-
allowOwnerOffCurve?: boolean,
|
|
2365
|
-
confirmOptions?: ConfirmOptions,
|
|
2366
|
-
programId?: PublicKey,
|
|
2367
|
-
associatedTokenProgramId?: PublicKey,
|
|
2368
|
-
ctokenConfig?: CTokenConfig,
|
|
2369
|
-
): Promise<PublicKey>;
|
|
2370
|
-
|
|
2371
|
-
declare function mintTo$1(
|
|
2372
|
-
rpc: Rpc,
|
|
2373
|
-
payer: Signer,
|
|
2374
|
-
mint: PublicKey,
|
|
2375
|
-
recipientAccount: PublicKey,
|
|
2376
|
-
authority: Signer,
|
|
2377
|
-
amount: number | bigint,
|
|
2378
|
-
outputQueue?: PublicKey,
|
|
2379
|
-
confirmOptions?: ConfirmOptions,
|
|
2380
|
-
): Promise<TransactionSignature>;
|
|
2076
|
+
declare function createAtaInterfaceIdempotent(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
|
|
2077
|
+
|
|
2078
|
+
declare function mintTo$1(rpc: Rpc, payer: Signer, mint: PublicKey, recipientAccount: PublicKey, authority: Signer, amount: number | bigint, outputQueue?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2381
2079
|
|
|
2382
2080
|
/**
|
|
2383
2081
|
* Mint compressed tokens directly to compressed accounts.
|
|
@@ -2391,19 +2089,10 @@ declare function mintTo$1(
|
|
|
2391
2089
|
* @param tokenAccountVersion Token account version (default: 3)
|
|
2392
2090
|
* @param confirmOptions Optional confirm options
|
|
2393
2091
|
*/
|
|
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>;
|
|
2092
|
+
declare function mintToCompressed(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, recipients: Array<{
|
|
2093
|
+
recipient: PublicKey;
|
|
2094
|
+
amount: number | bigint;
|
|
2095
|
+
}>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2407
2096
|
|
|
2408
2097
|
/**
|
|
2409
2098
|
* Mint tokens to a decompressed/onchain token account.
|
|
@@ -2424,17 +2113,7 @@ declare function mintToCompressed(
|
|
|
2424
2113
|
*
|
|
2425
2114
|
* @returns Transaction signature
|
|
2426
2115
|
*/
|
|
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>;
|
|
2116
|
+
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
2117
|
|
|
2439
2118
|
/**
|
|
2440
2119
|
* Retrieve the associated token account, or create it if it doesn't exist.
|
|
@@ -2459,17 +2138,7 @@ declare function mintToInterface(
|
|
|
2459
2138
|
*
|
|
2460
2139
|
* @returns AccountInterface with aggregated balance and source breakdown
|
|
2461
2140
|
*/
|
|
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>;
|
|
2141
|
+
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
2142
|
|
|
2474
2143
|
/**
|
|
2475
2144
|
* Decompress compressed (cold) tokens to an on-chain token account.
|
|
@@ -2487,17 +2156,7 @@ declare function getOrCreateAtaInterface(
|
|
|
2487
2156
|
* @param confirmOptions Confirm options
|
|
2488
2157
|
* @returns Transaction signature, null if nothing to load.
|
|
2489
2158
|
*/
|
|
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>;
|
|
2159
|
+
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
2160
|
|
|
2502
2161
|
/**
|
|
2503
2162
|
* Wrap tokens from an SPL/T22 account to a c-token account.
|
|
@@ -2531,17 +2190,7 @@ declare function decompressInterface(
|
|
|
2531
2190
|
*
|
|
2532
2191
|
* @returns Transaction signature
|
|
2533
2192
|
*/
|
|
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>;
|
|
2193
|
+
declare function wrap(rpc: Rpc, payer: Signer, source: PublicKey, destination: PublicKey, owner: Signer, mint: PublicKey, amount: bigint, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2545
2194
|
|
|
2546
2195
|
/**
|
|
2547
2196
|
* Create instructions to load an ATA from its AccountInterface.
|
|
@@ -2559,14 +2208,7 @@ declare function wrap(
|
|
|
2559
2208
|
* @param targetAta Target ATA address (used for type detection in standard mode)
|
|
2560
2209
|
* @returns Array of instructions (empty if nothing to load)
|
|
2561
2210
|
*/
|
|
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[]>;
|
|
2211
|
+
declare function createLoadAtaInstructionsFromInterface(rpc: Rpc, payer: PublicKey, ata: AccountInterface, options?: InterfaceOptions, wrap?: boolean, targetAta?: PublicKey): Promise<TransactionInstruction[]>;
|
|
2570
2212
|
|
|
2571
2213
|
/**
|
|
2572
2214
|
* Derive the canonical associated token address for any of SPL/T22/c-token.
|
|
@@ -2581,13 +2223,7 @@ declare function createLoadAtaInstructionsFromInterface(
|
|
|
2581
2223
|
* auto-detected.
|
|
2582
2224
|
* @returns Associated token address.
|
|
2583
2225
|
*/
|
|
2584
|
-
declare function getAssociatedTokenAddressInterface(
|
|
2585
|
-
mint: PublicKey,
|
|
2586
|
-
owner: PublicKey,
|
|
2587
|
-
allowOwnerOffCurve?: boolean,
|
|
2588
|
-
programId?: PublicKey,
|
|
2589
|
-
associatedTokenProgramId?: PublicKey,
|
|
2590
|
-
): PublicKey;
|
|
2226
|
+
declare function getAssociatedTokenAddressInterface(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): PublicKey;
|
|
2591
2227
|
|
|
2592
2228
|
/**
|
|
2593
2229
|
* Input for creating off-chain metadata JSON.
|
|
@@ -2645,9 +2281,7 @@ interface OffChainTokenMetadataJson {
|
|
|
2645
2281
|
* // Then use uri with createMint
|
|
2646
2282
|
* await createMint(rpc, payer, { ...params, uri });
|
|
2647
2283
|
*/
|
|
2648
|
-
declare function toOffChainMetadataJson(
|
|
2649
|
-
meta: OffChainTokenMetadata,
|
|
2650
|
-
): OffChainTokenMetadataJson;
|
|
2284
|
+
declare function toOffChainMetadataJson(meta: OffChainTokenMetadata): OffChainTokenMetadataJson;
|
|
2651
2285
|
|
|
2652
2286
|
/**
|
|
2653
2287
|
* Approve a delegate to spend tokens
|
|
@@ -2662,15 +2296,7 @@ declare function toOffChainMetadataJson(
|
|
|
2662
2296
|
*
|
|
2663
2297
|
* @return Signature of the confirmed transaction
|
|
2664
2298
|
*/
|
|
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>;
|
|
2299
|
+
declare function approve(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, delegate: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2674
2300
|
|
|
2675
2301
|
/**
|
|
2676
2302
|
* Mint compressed tokens to a solana address from an external mint authority
|
|
@@ -2689,17 +2315,7 @@ declare function approve(
|
|
|
2689
2315
|
*
|
|
2690
2316
|
* @return Signature of the confirmed transaction
|
|
2691
2317
|
*/
|
|
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>;
|
|
2318
|
+
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
2319
|
|
|
2704
2320
|
/**
|
|
2705
2321
|
* Compress SPL tokens
|
|
@@ -2719,18 +2335,7 @@ declare function approveAndMintTo(
|
|
|
2719
2335
|
*
|
|
2720
2336
|
* @return Signature of the confirmed transaction
|
|
2721
2337
|
*/
|
|
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>;
|
|
2338
|
+
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
2339
|
|
|
2735
2340
|
/**
|
|
2736
2341
|
* Compress SPL tokens into compressed token format
|
|
@@ -2750,17 +2355,7 @@ declare function compress(
|
|
|
2750
2355
|
*
|
|
2751
2356
|
* @return Signature of the confirmed transaction
|
|
2752
2357
|
*/
|
|
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>;
|
|
2358
|
+
declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, remainingAmount?: BN, outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2764
2359
|
|
|
2765
2360
|
/**
|
|
2766
2361
|
* Create and initialize a new SPL token mint
|
|
@@ -2780,16 +2375,7 @@ declare function compressSplTokenAccount(
|
|
|
2780
2375
|
*
|
|
2781
2376
|
* @return Object with mint address and transaction signature
|
|
2782
2377
|
*/
|
|
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<{
|
|
2378
|
+
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
2379
|
mint: PublicKey;
|
|
2794
2380
|
transactionSignature: TransactionSignature;
|
|
2795
2381
|
}>;
|
|
@@ -2806,13 +2392,7 @@ declare function createMint(
|
|
|
2806
2392
|
*
|
|
2807
2393
|
* @return transaction signature
|
|
2808
2394
|
*/
|
|
2809
|
-
declare function createSplInterface(
|
|
2810
|
-
rpc: Rpc,
|
|
2811
|
-
payer: Signer,
|
|
2812
|
-
mint: PublicKey,
|
|
2813
|
-
confirmOptions?: ConfirmOptions,
|
|
2814
|
-
tokenProgramId?: PublicKey,
|
|
2815
|
-
): Promise<TransactionSignature>;
|
|
2395
|
+
declare function createSplInterface(rpc: Rpc, payer: Signer, mint: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
2816
2396
|
/**
|
|
2817
2397
|
* @deprecated Use {@link createSplInterface} instead.
|
|
2818
2398
|
*/
|
|
@@ -2831,14 +2411,7 @@ declare const createTokenPool: typeof createSplInterface;
|
|
|
2831
2411
|
*
|
|
2832
2412
|
* @return transaction signature
|
|
2833
2413
|
*/
|
|
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>;
|
|
2414
|
+
declare function addSplInterfaces(rpc: Rpc, payer: Signer, mint: PublicKey, numMaxAdditionalPools: number, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<string>;
|
|
2842
2415
|
/**
|
|
2843
2416
|
* @deprecated Use {@link addSplInterfaces} instead.
|
|
2844
2417
|
*/
|
|
@@ -2858,13 +2431,7 @@ declare const addTokenPools: typeof addSplInterfaces;
|
|
|
2858
2431
|
* @return Object with transaction signatures and the address of the created
|
|
2859
2432
|
* lookup table
|
|
2860
2433
|
*/
|
|
2861
|
-
declare function createTokenProgramLookupTable(
|
|
2862
|
-
rpc: Rpc,
|
|
2863
|
-
payer: Signer,
|
|
2864
|
-
authority: Signer,
|
|
2865
|
-
mints?: PublicKey[],
|
|
2866
|
-
additionalAccounts?: PublicKey[],
|
|
2867
|
-
): Promise<{
|
|
2434
|
+
declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
|
|
2868
2435
|
txIds: TransactionSignature[];
|
|
2869
2436
|
address: PublicKey;
|
|
2870
2437
|
}>;
|
|
@@ -2884,16 +2451,7 @@ declare function createTokenProgramLookupTable(
|
|
|
2884
2451
|
*
|
|
2885
2452
|
* @return confirmed transaction signature
|
|
2886
2453
|
*/
|
|
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>;
|
|
2454
|
+
declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, splInterfaceInfos?: SplInterfaceInfo[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2897
2455
|
|
|
2898
2456
|
/**
|
|
2899
2457
|
* Merge multiple compressed token accounts for a given mint into fewer
|
|
@@ -2913,13 +2471,7 @@ declare function decompress(
|
|
|
2913
2471
|
*
|
|
2914
2472
|
* @return confirmed transaction signature
|
|
2915
2473
|
*/
|
|
2916
|
-
declare function mergeTokenAccounts(
|
|
2917
|
-
rpc: Rpc,
|
|
2918
|
-
payer: Signer,
|
|
2919
|
-
mint: PublicKey,
|
|
2920
|
-
owner: Signer,
|
|
2921
|
-
confirmOptions?: ConfirmOptions,
|
|
2922
|
-
): Promise<TransactionSignature>;
|
|
2474
|
+
declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2923
2475
|
|
|
2924
2476
|
/**
|
|
2925
2477
|
* Mint compressed tokens to a solana address
|
|
@@ -2941,17 +2493,7 @@ declare function mergeTokenAccounts(
|
|
|
2941
2493
|
*
|
|
2942
2494
|
* @return Signature of the confirmed transaction
|
|
2943
2495
|
*/
|
|
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>;
|
|
2496
|
+
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
2497
|
|
|
2956
2498
|
/**
|
|
2957
2499
|
* Revoke one or more delegated token accounts
|
|
@@ -2965,13 +2507,7 @@ declare function mintTo(
|
|
|
2965
2507
|
*
|
|
2966
2508
|
* @return Signature of the confirmed transaction
|
|
2967
2509
|
*/
|
|
2968
|
-
declare function revoke(
|
|
2969
|
-
rpc: Rpc,
|
|
2970
|
-
payer: Signer,
|
|
2971
|
-
accounts: ParsedTokenAccount[],
|
|
2972
|
-
owner: Signer,
|
|
2973
|
-
confirmOptions?: ConfirmOptions,
|
|
2974
|
-
): Promise<TransactionSignature>;
|
|
2510
|
+
declare function revoke(rpc: Rpc, payer: Signer, accounts: ParsedTokenAccount[], owner: Signer, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2975
2511
|
|
|
2976
2512
|
/**
|
|
2977
2513
|
* Transfer compressed tokens from one owner to another.
|
|
@@ -2989,15 +2525,7 @@ declare function revoke(
|
|
|
2989
2525
|
*
|
|
2990
2526
|
* @return confirmed transaction signature
|
|
2991
2527
|
*/
|
|
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>;
|
|
2528
|
+
declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
3001
2529
|
|
|
3002
2530
|
/**
|
|
3003
2531
|
* Transfer delegated compressed tokens to another owner
|
|
@@ -3012,15 +2540,7 @@ declare function transfer(
|
|
|
3012
2540
|
*
|
|
3013
2541
|
* @return confirmed transaction signature
|
|
3014
2542
|
*/
|
|
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>;
|
|
2543
|
+
declare function transferDelegated(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
3024
2544
|
|
|
3025
2545
|
/**
|
|
3026
2546
|
* Decompress delegated compressed tokens. Remaining compressed tokens are
|
|
@@ -3038,21 +2558,10 @@ declare function transferDelegated(
|
|
|
3038
2558
|
*
|
|
3039
2559
|
* @return Signature of the confirmed transaction
|
|
3040
2560
|
*/
|
|
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.';
|
|
2561
|
+
declare function decompressDelegated(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, splInterfaceInfos?: SplInterfaceInfo[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2562
|
+
|
|
2563
|
+
declare const ERROR_NO_ACCOUNTS_FOUND = "Could not find accounts to select for transfer.";
|
|
2564
|
+
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
2565
|
/**
|
|
3057
2566
|
* Options for input account selection
|
|
3058
2567
|
*/
|
|
@@ -3067,9 +2576,7 @@ interface SelectInputAccountsOptions {
|
|
|
3067
2576
|
/**
|
|
3068
2577
|
* Groups accounts by tree type for separate processing
|
|
3069
2578
|
*/
|
|
3070
|
-
declare function groupAccountsByTreeType(
|
|
3071
|
-
accounts: ParsedTokenAccount[],
|
|
3072
|
-
): Map<TreeType, ParsedTokenAccount[]>;
|
|
2579
|
+
declare function groupAccountsByTreeType(accounts: ParsedTokenAccount[]): Map<TreeType, ParsedTokenAccount[]>;
|
|
3073
2580
|
/**
|
|
3074
2581
|
* Result of selectAccountsByPreferredTreeType
|
|
3075
2582
|
*/
|
|
@@ -3094,10 +2601,7 @@ interface SelectedAccountsResult {
|
|
|
3094
2601
|
* @param requiredAmount Minimum amount needed (optional - if not provided, returns all from preferred type)
|
|
3095
2602
|
* @returns Selected accounts from a single tree type
|
|
3096
2603
|
*/
|
|
3097
|
-
declare function selectAccountsByPreferredTreeType(
|
|
3098
|
-
accounts: ParsedTokenAccount[],
|
|
3099
|
-
requiredAmount?: BN,
|
|
3100
|
-
): SelectedAccountsResult;
|
|
2604
|
+
declare function selectAccountsByPreferredTreeType(accounts: ParsedTokenAccount[], requiredAmount?: BN): SelectedAccountsResult;
|
|
3101
2605
|
/**
|
|
3102
2606
|
* Selects token accounts for approval, first trying to find an exact match, then falling back to minimum selection.
|
|
3103
2607
|
*
|
|
@@ -3116,16 +2620,11 @@ declare function selectAccountsByPreferredTreeType(
|
|
|
3116
2620
|
* - totalLamports: Total lamports from selected accounts.
|
|
3117
2621
|
* - maxPossibleAmount: Max approvable amount given maxInputs.
|
|
3118
2622
|
*/
|
|
3119
|
-
declare function selectTokenAccountsForApprove(
|
|
3120
|
-
accounts: ParsedTokenAccount[],
|
|
3121
|
-
approveAmount: BN,
|
|
3122
|
-
maxInputs?: number,
|
|
3123
|
-
options?: SelectInputAccountsOptions,
|
|
3124
|
-
): [
|
|
2623
|
+
declare function selectTokenAccountsForApprove(accounts: ParsedTokenAccount[], approveAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3125
2624
|
selectedAccounts: ParsedTokenAccount[],
|
|
3126
2625
|
total: BN,
|
|
3127
2626
|
totalLamports: BN | null,
|
|
3128
|
-
maxPossibleAmount: BN
|
|
2627
|
+
maxPossibleAmount: BN
|
|
3129
2628
|
];
|
|
3130
2629
|
/**
|
|
3131
2630
|
* Selects the minimum number of compressed token accounts required for a
|
|
@@ -3139,12 +2638,7 @@ declare function selectTokenAccountsForApprove(
|
|
|
3139
2638
|
*
|
|
3140
2639
|
* @returns Returns selected accounts and their totals.
|
|
3141
2640
|
*/
|
|
3142
|
-
declare function selectMinCompressedTokenAccountsForDecompression(
|
|
3143
|
-
accounts: ParsedTokenAccount[],
|
|
3144
|
-
amount: BN,
|
|
3145
|
-
maxInputs?: number,
|
|
3146
|
-
options?: SelectInputAccountsOptions,
|
|
3147
|
-
): {
|
|
2641
|
+
declare function selectMinCompressedTokenAccountsForDecompression(accounts: ParsedTokenAccount[], amount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): {
|
|
3148
2642
|
selectedAccounts: ParsedTokenAccount[];
|
|
3149
2643
|
total: BN;
|
|
3150
2644
|
totalLamports: BN | null;
|
|
@@ -3168,31 +2662,22 @@ declare function selectMinCompressedTokenAccountsForDecompression(
|
|
|
3168
2662
|
* maxPossibleAmount: BN
|
|
3169
2663
|
* ]
|
|
3170
2664
|
*/
|
|
3171
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
3172
|
-
accounts: ParsedTokenAccount[],
|
|
3173
|
-
transferAmount: BN,
|
|
3174
|
-
maxInputs?: number,
|
|
3175
|
-
options?: SelectInputAccountsOptions,
|
|
3176
|
-
): [
|
|
2665
|
+
declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3177
2666
|
selectedAccounts: ParsedTokenAccount[],
|
|
3178
2667
|
total: BN,
|
|
3179
2668
|
totalLamports: BN | null,
|
|
3180
|
-
maxPossibleAmount: BN
|
|
2669
|
+
maxPossibleAmount: BN
|
|
3181
2670
|
];
|
|
3182
2671
|
/**
|
|
3183
2672
|
* Executes {@link selectMinCompressedTokenAccountsForTransfer} strategy,
|
|
3184
2673
|
* returns partial amounts if insufficient accounts are found instead of
|
|
3185
2674
|
* throwing an error.
|
|
3186
2675
|
*/
|
|
3187
|
-
declare function selectMinCompressedTokenAccountsForTransferOrPartial(
|
|
3188
|
-
accounts: ParsedTokenAccount[],
|
|
3189
|
-
transferAmount: BN,
|
|
3190
|
-
maxInputs?: number,
|
|
3191
|
-
): [
|
|
2676
|
+
declare function selectMinCompressedTokenAccountsForTransferOrPartial(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
3192
2677
|
selectedAccounts: ParsedTokenAccount[],
|
|
3193
2678
|
total: BN,
|
|
3194
2679
|
totalLamports: BN | null,
|
|
3195
|
-
maxPossibleAmount: BN
|
|
2680
|
+
maxPossibleAmount: BN
|
|
3196
2681
|
];
|
|
3197
2682
|
/**
|
|
3198
2683
|
* Selects compressed token accounts for a transfer, ensuring one extra account
|
|
@@ -3235,31 +2720,22 @@ declare function selectMinCompressedTokenAccountsForTransferOrPartial(
|
|
|
3235
2720
|
* console.log(totalLamports!.toString()); // '15'
|
|
3236
2721
|
* console.log(maxPossibleAmount.toString()); // '150'
|
|
3237
2722
|
*/
|
|
3238
|
-
declare function selectSmartCompressedTokenAccountsForTransfer(
|
|
3239
|
-
accounts: ParsedTokenAccount[],
|
|
3240
|
-
transferAmount: BN,
|
|
3241
|
-
maxInputs?: number,
|
|
3242
|
-
options?: SelectInputAccountsOptions,
|
|
3243
|
-
): [
|
|
2723
|
+
declare function selectSmartCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3244
2724
|
selectedAccounts: ParsedTokenAccount[],
|
|
3245
2725
|
total: BN,
|
|
3246
2726
|
totalLamports: BN | null,
|
|
3247
|
-
maxPossibleAmount: BN
|
|
2727
|
+
maxPossibleAmount: BN
|
|
3248
2728
|
];
|
|
3249
2729
|
/**
|
|
3250
2730
|
* Executes {@link selectMinCompressedTokenAccountsForTransfer} strategy,
|
|
3251
2731
|
* returns partial amounts if insufficient accounts are found instead of
|
|
3252
2732
|
* throwing an error.
|
|
3253
2733
|
*/
|
|
3254
|
-
declare function selectSmartCompressedTokenAccountsForTransferOrPartial(
|
|
3255
|
-
accounts: ParsedTokenAccount[],
|
|
3256
|
-
transferAmount: BN,
|
|
3257
|
-
maxInputs?: number,
|
|
3258
|
-
): [
|
|
2734
|
+
declare function selectSmartCompressedTokenAccountsForTransferOrPartial(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
3259
2735
|
selectedAccounts: ParsedTokenAccount[],
|
|
3260
2736
|
total: BN,
|
|
3261
2737
|
totalLamports: BN | null,
|
|
3262
|
-
maxPossibleAmount: BN
|
|
2738
|
+
maxPossibleAmount: BN
|
|
3263
2739
|
];
|
|
3264
2740
|
|
|
3265
2741
|
type TokenTransferOutputData = {
|
|
@@ -3332,9 +2808,7 @@ type CompressSplTokenAccountInstructionData = {
|
|
|
3332
2808
|
remainingAmount: BN | null;
|
|
3333
2809
|
cpiContext: CompressedCpiContext | null;
|
|
3334
2810
|
};
|
|
3335
|
-
declare function isSingleSplInterfaceInfo(
|
|
3336
|
-
splInterfaceInfos: SplInterfaceInfo | SplInterfaceInfo[],
|
|
3337
|
-
): splInterfaceInfos is SplInterfaceInfo;
|
|
2811
|
+
declare function isSingleSplInterfaceInfo(splInterfaceInfos: SplInterfaceInfo | SplInterfaceInfo[]): splInterfaceInfos is SplInterfaceInfo;
|
|
3338
2812
|
/**
|
|
3339
2813
|
* @deprecated Use {@link isSingleSplInterfaceInfo} instead.
|
|
3340
2814
|
*/
|
|
@@ -3445,9 +2919,7 @@ type PackCompressedTokenAccountsParams = {
|
|
|
3445
2919
|
/**
|
|
3446
2920
|
* Packs Compressed Token Accounts.
|
|
3447
2921
|
*/
|
|
3448
|
-
declare function packCompressedTokenAccounts(
|
|
3449
|
-
params: PackCompressedTokenAccountsParams,
|
|
3450
|
-
): {
|
|
2922
|
+
declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
|
|
3451
2923
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
3452
2924
|
remainingAccountMetas: AccountMeta[];
|
|
3453
2925
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -3460,10 +2932,7 @@ declare function packCompressedTokenAccounts(
|
|
|
3460
2932
|
* @param mint The mint of the token pool
|
|
3461
2933
|
* @returns True if all input accounts belong to the same mint
|
|
3462
2934
|
*/
|
|
3463
|
-
declare function checkMint(
|
|
3464
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
3465
|
-
mint: PublicKey,
|
|
3466
|
-
): boolean;
|
|
2935
|
+
declare function checkMint(compressedTokenAccounts: ParsedTokenAccount[], mint: PublicKey): boolean;
|
|
3467
2936
|
|
|
3468
2937
|
type LightCompressedToken = {
|
|
3469
2938
|
version: '1.2.0';
|
|
@@ -3475,7 +2944,7 @@ type LightCompressedToken = {
|
|
|
3475
2944
|
'This instruction creates a token pool for a given mint. Every spl mint',
|
|
3476
2945
|
'can have one token pool. When a token is compressed the tokens are',
|
|
3477
2946
|
'transferrred to the token pool, and their compressed equivalent is',
|
|
3478
|
-
'minted into a Merkle tree.'
|
|
2947
|
+
'minted into a Merkle tree.'
|
|
3479
2948
|
];
|
|
3480
2949
|
accounts: [
|
|
3481
2950
|
{
|
|
@@ -3508,7 +2977,7 @@ type LightCompressedToken = {
|
|
|
3508
2977
|
name: 'cpiAuthorityPda';
|
|
3509
2978
|
isMut: false;
|
|
3510
2979
|
isSigner: false;
|
|
3511
|
-
}
|
|
2980
|
+
}
|
|
3512
2981
|
];
|
|
3513
2982
|
args: [];
|
|
3514
2983
|
},
|
|
@@ -3516,7 +2985,7 @@ type LightCompressedToken = {
|
|
|
3516
2985
|
name: 'addTokenPool';
|
|
3517
2986
|
docs: [
|
|
3518
2987
|
'This instruction creates an additional token pool for a given mint.',
|
|
3519
|
-
'The maximum number of token pools per mint is 5.'
|
|
2988
|
+
'The maximum number of token pools per mint is 5.'
|
|
3520
2989
|
];
|
|
3521
2990
|
accounts: [
|
|
3522
2991
|
{
|
|
@@ -3554,13 +3023,13 @@ type LightCompressedToken = {
|
|
|
3554
3023
|
name: 'cpiAuthorityPda';
|
|
3555
3024
|
isMut: false;
|
|
3556
3025
|
isSigner: false;
|
|
3557
|
-
}
|
|
3026
|
+
}
|
|
3558
3027
|
];
|
|
3559
3028
|
args: [
|
|
3560
3029
|
{
|
|
3561
3030
|
name: 'tokenPoolIndex';
|
|
3562
3031
|
type: 'u8';
|
|
3563
|
-
}
|
|
3032
|
+
}
|
|
3564
3033
|
];
|
|
3565
3034
|
},
|
|
3566
3035
|
{
|
|
@@ -3572,7 +3041,7 @@ type LightCompressedToken = {
|
|
|
3572
3041
|
'every amount and pubkey input pair. A constant amount of lamports can be',
|
|
3573
3042
|
'transferred to each output account to enable. A use case to add lamports',
|
|
3574
3043
|
'to a compressed token account is to prevent spam. This is the only way',
|
|
3575
|
-
'to add lamports to a compressed token account.'
|
|
3044
|
+
'to add lamports to a compressed token account.'
|
|
3576
3045
|
];
|
|
3577
3046
|
accounts: [
|
|
3578
3047
|
{
|
|
@@ -3652,7 +3121,7 @@ type LightCompressedToken = {
|
|
|
3652
3121
|
isMut: true;
|
|
3653
3122
|
isSigner: false;
|
|
3654
3123
|
isOptional: true;
|
|
3655
|
-
}
|
|
3124
|
+
}
|
|
3656
3125
|
];
|
|
3657
3126
|
args: [
|
|
3658
3127
|
{
|
|
@@ -3672,7 +3141,7 @@ type LightCompressedToken = {
|
|
|
3672
3141
|
type: {
|
|
3673
3142
|
option: 'u64';
|
|
3674
3143
|
};
|
|
3675
|
-
}
|
|
3144
|
+
}
|
|
3676
3145
|
];
|
|
3677
3146
|
},
|
|
3678
3147
|
{
|
|
@@ -3680,7 +3149,7 @@ type LightCompressedToken = {
|
|
|
3680
3149
|
docs: [
|
|
3681
3150
|
'Compresses the balance of an spl token account sub an optional remaining',
|
|
3682
3151
|
'amount. This instruction does not close the spl token account. To close',
|
|
3683
|
-
'the account bundle a close spl account instruction in your transaction.'
|
|
3152
|
+
'the account bundle a close spl account instruction in your transaction.'
|
|
3684
3153
|
];
|
|
3685
3154
|
accounts: [
|
|
3686
3155
|
{
|
|
@@ -3696,7 +3165,7 @@ type LightCompressedToken = {
|
|
|
3696
3165
|
docs: [
|
|
3697
3166
|
'Authority is verified through proof since both owner and delegate',
|
|
3698
3167
|
'are included in the token data hash, which is a public input to the',
|
|
3699
|
-
'validity proof.'
|
|
3168
|
+
'validity proof.'
|
|
3700
3169
|
];
|
|
3701
3170
|
},
|
|
3702
3171
|
{
|
|
@@ -3757,7 +3226,7 @@ type LightCompressedToken = {
|
|
|
3757
3226
|
name: 'systemProgram';
|
|
3758
3227
|
isMut: false;
|
|
3759
3228
|
isSigner: false;
|
|
3760
|
-
}
|
|
3229
|
+
}
|
|
3761
3230
|
];
|
|
3762
3231
|
args: [
|
|
3763
3232
|
{
|
|
@@ -3777,7 +3246,7 @@ type LightCompressedToken = {
|
|
|
3777
3246
|
defined: 'CompressedCpiContext';
|
|
3778
3247
|
};
|
|
3779
3248
|
};
|
|
3780
|
-
}
|
|
3249
|
+
}
|
|
3781
3250
|
];
|
|
3782
3251
|
},
|
|
3783
3252
|
{
|
|
@@ -3790,7 +3259,7 @@ type LightCompressedToken = {
|
|
|
3790
3259
|
'accounts specify less lamports than inputs the remaining lamports are',
|
|
3791
3260
|
'transferred to an output compressed account. Signer must be owner or',
|
|
3792
3261
|
'delegate. If a delegated token account is transferred the delegate is',
|
|
3793
|
-
'not preserved.'
|
|
3262
|
+
'not preserved.'
|
|
3794
3263
|
];
|
|
3795
3264
|
accounts: [
|
|
3796
3265
|
{
|
|
@@ -3806,7 +3275,7 @@ type LightCompressedToken = {
|
|
|
3806
3275
|
docs: [
|
|
3807
3276
|
'Authority is verified through proof since both owner and delegate',
|
|
3808
3277
|
'are included in the token data hash, which is a public input to the',
|
|
3809
|
-
'validity proof.'
|
|
3278
|
+
'validity proof.'
|
|
3810
3279
|
];
|
|
3811
3280
|
},
|
|
3812
3281
|
{
|
|
@@ -3867,13 +3336,13 @@ type LightCompressedToken = {
|
|
|
3867
3336
|
name: 'systemProgram';
|
|
3868
3337
|
isMut: false;
|
|
3869
3338
|
isSigner: false;
|
|
3870
|
-
}
|
|
3339
|
+
}
|
|
3871
3340
|
];
|
|
3872
3341
|
args: [
|
|
3873
3342
|
{
|
|
3874
3343
|
name: 'inputs';
|
|
3875
3344
|
type: 'bytes';
|
|
3876
|
-
}
|
|
3345
|
+
}
|
|
3877
3346
|
];
|
|
3878
3347
|
},
|
|
3879
3348
|
{
|
|
@@ -3884,7 +3353,7 @@ type LightCompressedToken = {
|
|
|
3884
3353
|
'be called by a delegate.',
|
|
3885
3354
|
'The instruction creates two output accounts:',
|
|
3886
3355
|
'1. one account with delegated amount',
|
|
3887
|
-
'2. one account with remaining(change) amount'
|
|
3356
|
+
'2. one account with remaining(change) amount'
|
|
3888
3357
|
];
|
|
3889
3358
|
accounts: [
|
|
3890
3359
|
{
|
|
@@ -3900,7 +3369,7 @@ type LightCompressedToken = {
|
|
|
3900
3369
|
docs: [
|
|
3901
3370
|
'Authority is verified through proof since both owner and delegate',
|
|
3902
3371
|
'are included in the token data hash, which is a public input to the',
|
|
3903
|
-
'validity proof.'
|
|
3372
|
+
'validity proof.'
|
|
3904
3373
|
];
|
|
3905
3374
|
},
|
|
3906
3375
|
{
|
|
@@ -3943,20 +3412,20 @@ type LightCompressedToken = {
|
|
|
3943
3412
|
name: 'systemProgram';
|
|
3944
3413
|
isMut: false;
|
|
3945
3414
|
isSigner: false;
|
|
3946
|
-
}
|
|
3415
|
+
}
|
|
3947
3416
|
];
|
|
3948
3417
|
args: [
|
|
3949
3418
|
{
|
|
3950
3419
|
name: 'inputs';
|
|
3951
3420
|
type: 'bytes';
|
|
3952
|
-
}
|
|
3421
|
+
}
|
|
3953
3422
|
];
|
|
3954
3423
|
},
|
|
3955
3424
|
{
|
|
3956
3425
|
name: 'revoke';
|
|
3957
3426
|
docs: [
|
|
3958
3427
|
'Revokes a delegation. The instruction merges all inputs into one output',
|
|
3959
|
-
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
3428
|
+
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
3960
3429
|
];
|
|
3961
3430
|
accounts: [
|
|
3962
3431
|
{
|
|
@@ -3972,7 +3441,7 @@ type LightCompressedToken = {
|
|
|
3972
3441
|
docs: [
|
|
3973
3442
|
'Authority is verified through proof since both owner and delegate',
|
|
3974
3443
|
'are included in the token data hash, which is a public input to the',
|
|
3975
|
-
'validity proof.'
|
|
3444
|
+
'validity proof.'
|
|
3976
3445
|
];
|
|
3977
3446
|
},
|
|
3978
3447
|
{
|
|
@@ -4015,20 +3484,20 @@ type LightCompressedToken = {
|
|
|
4015
3484
|
name: 'systemProgram';
|
|
4016
3485
|
isMut: false;
|
|
4017
3486
|
isSigner: false;
|
|
4018
|
-
}
|
|
3487
|
+
}
|
|
4019
3488
|
];
|
|
4020
3489
|
args: [
|
|
4021
3490
|
{
|
|
4022
3491
|
name: 'inputs';
|
|
4023
3492
|
type: 'bytes';
|
|
4024
|
-
}
|
|
3493
|
+
}
|
|
4025
3494
|
];
|
|
4026
3495
|
},
|
|
4027
3496
|
{
|
|
4028
3497
|
name: 'freeze';
|
|
4029
3498
|
docs: [
|
|
4030
3499
|
'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
|
|
4031
|
-
'many outputs as inputs. Balances and delegates are preserved.'
|
|
3500
|
+
'many outputs as inputs. Balances and delegates are preserved.'
|
|
4032
3501
|
];
|
|
4033
3502
|
accounts: [
|
|
4034
3503
|
{
|
|
@@ -4087,20 +3556,20 @@ type LightCompressedToken = {
|
|
|
4087
3556
|
name: 'mint';
|
|
4088
3557
|
isMut: false;
|
|
4089
3558
|
isSigner: false;
|
|
4090
|
-
}
|
|
3559
|
+
}
|
|
4091
3560
|
];
|
|
4092
3561
|
args: [
|
|
4093
3562
|
{
|
|
4094
3563
|
name: 'inputs';
|
|
4095
3564
|
type: 'bytes';
|
|
4096
|
-
}
|
|
3565
|
+
}
|
|
4097
3566
|
];
|
|
4098
3567
|
},
|
|
4099
3568
|
{
|
|
4100
3569
|
name: 'thaw';
|
|
4101
3570
|
docs: [
|
|
4102
3571
|
'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
|
|
4103
|
-
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
3572
|
+
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
4104
3573
|
];
|
|
4105
3574
|
accounts: [
|
|
4106
3575
|
{
|
|
@@ -4159,13 +3628,13 @@ type LightCompressedToken = {
|
|
|
4159
3628
|
name: 'mint';
|
|
4160
3629
|
isMut: false;
|
|
4161
3630
|
isSigner: false;
|
|
4162
|
-
}
|
|
3631
|
+
}
|
|
4163
3632
|
];
|
|
4164
3633
|
args: [
|
|
4165
3634
|
{
|
|
4166
3635
|
name: 'inputs';
|
|
4167
3636
|
type: 'bytes';
|
|
4168
|
-
}
|
|
3637
|
+
}
|
|
4169
3638
|
];
|
|
4170
3639
|
},
|
|
4171
3640
|
{
|
|
@@ -4173,7 +3642,7 @@ type LightCompressedToken = {
|
|
|
4173
3642
|
docs: [
|
|
4174
3643
|
'Burns compressed tokens and spl tokens from the pool account. Delegates',
|
|
4175
3644
|
'can burn tokens. The output compressed token account remains delegated.',
|
|
4176
|
-
'Creates one output compressed token account.'
|
|
3645
|
+
'Creates one output compressed token account.'
|
|
4177
3646
|
];
|
|
4178
3647
|
accounts: [
|
|
4179
3648
|
{
|
|
@@ -4189,7 +3658,7 @@ type LightCompressedToken = {
|
|
|
4189
3658
|
docs: [
|
|
4190
3659
|
'Authority is verified through proof since both owner and delegate',
|
|
4191
3660
|
'are included in the token data hash, which is a public input to the',
|
|
4192
|
-
'validity proof.'
|
|
3661
|
+
'validity proof.'
|
|
4193
3662
|
];
|
|
4194
3663
|
},
|
|
4195
3664
|
{
|
|
@@ -4246,13 +3715,13 @@ type LightCompressedToken = {
|
|
|
4246
3715
|
name: 'systemProgram';
|
|
4247
3716
|
isMut: false;
|
|
4248
3717
|
isSigner: false;
|
|
4249
|
-
}
|
|
3718
|
+
}
|
|
4250
3719
|
];
|
|
4251
3720
|
args: [
|
|
4252
3721
|
{
|
|
4253
3722
|
name: 'inputs';
|
|
4254
3723
|
type: 'bytes';
|
|
4255
|
-
}
|
|
3724
|
+
}
|
|
4256
3725
|
];
|
|
4257
3726
|
},
|
|
4258
3727
|
{
|
|
@@ -4260,7 +3729,7 @@ type LightCompressedToken = {
|
|
|
4260
3729
|
docs: [
|
|
4261
3730
|
'This function is a stub to allow Anchor to include the input types in',
|
|
4262
3731
|
'the IDL. It should not be included in production builds nor be called in',
|
|
4263
|
-
'practice.'
|
|
3732
|
+
'practice.'
|
|
4264
3733
|
];
|
|
4265
3734
|
accounts: [
|
|
4266
3735
|
{
|
|
@@ -4276,7 +3745,7 @@ type LightCompressedToken = {
|
|
|
4276
3745
|
docs: [
|
|
4277
3746
|
'Authority is verified through proof since both owner and delegate',
|
|
4278
3747
|
'are included in the token data hash, which is a public input to the',
|
|
4279
|
-
'validity proof.'
|
|
3748
|
+
'validity proof.'
|
|
4280
3749
|
];
|
|
4281
3750
|
},
|
|
4282
3751
|
{
|
|
@@ -4337,7 +3806,7 @@ type LightCompressedToken = {
|
|
|
4337
3806
|
name: 'systemProgram';
|
|
4338
3807
|
isMut: false;
|
|
4339
3808
|
isSigner: false;
|
|
4340
|
-
}
|
|
3809
|
+
}
|
|
4341
3810
|
];
|
|
4342
3811
|
args: [
|
|
4343
3812
|
{
|
|
@@ -4351,9 +3820,9 @@ type LightCompressedToken = {
|
|
|
4351
3820
|
type: {
|
|
4352
3821
|
defined: 'TokenData';
|
|
4353
3822
|
};
|
|
4354
|
-
}
|
|
3823
|
+
}
|
|
4355
3824
|
];
|
|
4356
|
-
}
|
|
3825
|
+
}
|
|
4357
3826
|
];
|
|
4358
3827
|
types: [
|
|
4359
3828
|
{
|
|
@@ -4366,7 +3835,7 @@ type LightCompressedToken = {
|
|
|
4366
3835
|
},
|
|
4367
3836
|
{
|
|
4368
3837
|
name: 'Frozen';
|
|
4369
|
-
}
|
|
3838
|
+
}
|
|
4370
3839
|
];
|
|
4371
3840
|
};
|
|
4372
3841
|
},
|
|
@@ -4398,7 +3867,7 @@ type LightCompressedToken = {
|
|
|
4398
3867
|
defined: 'CompressedAccountData';
|
|
4399
3868
|
};
|
|
4400
3869
|
};
|
|
4401
|
-
}
|
|
3870
|
+
}
|
|
4402
3871
|
];
|
|
4403
3872
|
};
|
|
4404
3873
|
},
|
|
@@ -4422,7 +3891,7 @@ type LightCompressedToken = {
|
|
|
4422
3891
|
type: {
|
|
4423
3892
|
array: ['u8', 32];
|
|
4424
3893
|
};
|
|
4425
|
-
}
|
|
3894
|
+
}
|
|
4426
3895
|
];
|
|
4427
3896
|
};
|
|
4428
3897
|
},
|
|
@@ -4435,7 +3904,7 @@ type LightCompressedToken = {
|
|
|
4435
3904
|
name: 'setContext';
|
|
4436
3905
|
docs: [
|
|
4437
3906
|
'Is set by the program that is invoking the CPI to signal that is should',
|
|
4438
|
-
'set the cpi context.'
|
|
3907
|
+
'set the cpi context.'
|
|
4439
3908
|
];
|
|
4440
3909
|
type: 'bool';
|
|
4441
3910
|
},
|
|
@@ -4443,17 +3912,17 @@ type LightCompressedToken = {
|
|
|
4443
3912
|
name: 'firstSetContext';
|
|
4444
3913
|
docs: [
|
|
4445
3914
|
'Is set to wipe the cpi context since someone could have set it before',
|
|
4446
|
-
'with unrelated data.'
|
|
3915
|
+
'with unrelated data.'
|
|
4447
3916
|
];
|
|
4448
3917
|
type: 'bool';
|
|
4449
3918
|
},
|
|
4450
3919
|
{
|
|
4451
3920
|
name: 'cpiContextAccountIndex';
|
|
4452
3921
|
docs: [
|
|
4453
|
-
'Index of cpi context account in remaining accounts.'
|
|
3922
|
+
'Index of cpi context account in remaining accounts.'
|
|
4454
3923
|
];
|
|
4455
3924
|
type: 'u8';
|
|
4456
|
-
}
|
|
3925
|
+
}
|
|
4457
3926
|
];
|
|
4458
3927
|
};
|
|
4459
3928
|
},
|
|
@@ -4479,7 +3948,7 @@ type LightCompressedToken = {
|
|
|
4479
3948
|
type: {
|
|
4480
3949
|
array: ['u8', 32];
|
|
4481
3950
|
};
|
|
4482
|
-
}
|
|
3951
|
+
}
|
|
4483
3952
|
];
|
|
4484
3953
|
};
|
|
4485
3954
|
},
|
|
@@ -4505,7 +3974,7 @@ type LightCompressedToken = {
|
|
|
4505
3974
|
docs: [
|
|
4506
3975
|
'Is required if the signer is delegate,',
|
|
4507
3976
|
'-> delegate is authority account,',
|
|
4508
|
-
'owner = Some(owner) is the owner of the token account.'
|
|
3977
|
+
'owner = Some(owner) is the owner of the token account.'
|
|
4509
3978
|
];
|
|
4510
3979
|
type: {
|
|
4511
3980
|
option: {
|
|
@@ -4552,7 +4021,7 @@ type LightCompressedToken = {
|
|
|
4552
4021
|
type: {
|
|
4553
4022
|
option: 'u8';
|
|
4554
4023
|
};
|
|
4555
|
-
}
|
|
4024
|
+
}
|
|
4556
4025
|
];
|
|
4557
4026
|
};
|
|
4558
4027
|
},
|
|
@@ -4592,7 +4061,7 @@ type LightCompressedToken = {
|
|
|
4592
4061
|
{
|
|
4593
4062
|
name: 'outputAccountMerkleTreeIndex';
|
|
4594
4063
|
type: 'u8';
|
|
4595
|
-
}
|
|
4064
|
+
}
|
|
4596
4065
|
];
|
|
4597
4066
|
};
|
|
4598
4067
|
},
|
|
@@ -4650,14 +4119,14 @@ type LightCompressedToken = {
|
|
|
4650
4119
|
type: {
|
|
4651
4120
|
option: 'u64';
|
|
4652
4121
|
};
|
|
4653
|
-
}
|
|
4122
|
+
}
|
|
4654
4123
|
];
|
|
4655
4124
|
};
|
|
4656
4125
|
},
|
|
4657
4126
|
{
|
|
4658
4127
|
name: 'DelegatedTransfer';
|
|
4659
4128
|
docs: [
|
|
4660
|
-
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
4129
|
+
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
4661
4130
|
];
|
|
4662
4131
|
type: {
|
|
4663
4132
|
kind: 'struct';
|
|
@@ -4672,12 +4141,12 @@ type LightCompressedToken = {
|
|
|
4672
4141
|
'Index of change compressed account in output compressed accounts. In',
|
|
4673
4142
|
"case that the delegate didn't spend the complete delegated compressed",
|
|
4674
4143
|
'account balance the change compressed account will be delegated to her',
|
|
4675
|
-
'as well.'
|
|
4144
|
+
'as well.'
|
|
4676
4145
|
];
|
|
4677
4146
|
type: {
|
|
4678
4147
|
option: 'u8';
|
|
4679
4148
|
};
|
|
4680
|
-
}
|
|
4149
|
+
}
|
|
4681
4150
|
];
|
|
4682
4151
|
};
|
|
4683
4152
|
},
|
|
@@ -4715,12 +4184,12 @@ type LightCompressedToken = {
|
|
|
4715
4184
|
{
|
|
4716
4185
|
name: 'tlv';
|
|
4717
4186
|
docs: [
|
|
4718
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4187
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4719
4188
|
];
|
|
4720
4189
|
type: {
|
|
4721
4190
|
option: 'bytes';
|
|
4722
4191
|
};
|
|
4723
|
-
}
|
|
4192
|
+
}
|
|
4724
4193
|
];
|
|
4725
4194
|
};
|
|
4726
4195
|
},
|
|
@@ -4776,7 +4245,7 @@ type LightCompressedToken = {
|
|
|
4776
4245
|
{
|
|
4777
4246
|
name: 'isCompress';
|
|
4778
4247
|
type: 'bool';
|
|
4779
|
-
}
|
|
4248
|
+
}
|
|
4780
4249
|
];
|
|
4781
4250
|
};
|
|
4782
4251
|
},
|
|
@@ -4840,7 +4309,7 @@ type LightCompressedToken = {
|
|
|
4840
4309
|
defined: 'CompressedCpiContext';
|
|
4841
4310
|
};
|
|
4842
4311
|
};
|
|
4843
|
-
}
|
|
4312
|
+
}
|
|
4844
4313
|
];
|
|
4845
4314
|
};
|
|
4846
4315
|
},
|
|
@@ -4856,7 +4325,7 @@ type LightCompressedToken = {
|
|
|
4856
4325
|
{
|
|
4857
4326
|
name: 'seq';
|
|
4858
4327
|
type: 'u64';
|
|
4859
|
-
}
|
|
4328
|
+
}
|
|
4860
4329
|
];
|
|
4861
4330
|
};
|
|
4862
4331
|
},
|
|
@@ -4882,7 +4351,7 @@ type LightCompressedToken = {
|
|
|
4882
4351
|
{
|
|
4883
4352
|
name: 'addressMerkleTreeRootIndex';
|
|
4884
4353
|
type: 'u16';
|
|
4885
|
-
}
|
|
4354
|
+
}
|
|
4886
4355
|
];
|
|
4887
4356
|
};
|
|
4888
4357
|
},
|
|
@@ -4900,7 +4369,7 @@ type LightCompressedToken = {
|
|
|
4900
4369
|
{
|
|
4901
4370
|
name: 'merkleTreeIndex';
|
|
4902
4371
|
type: 'u8';
|
|
4903
|
-
}
|
|
4372
|
+
}
|
|
4904
4373
|
];
|
|
4905
4374
|
};
|
|
4906
4375
|
},
|
|
@@ -4924,17 +4393,17 @@ type LightCompressedToken = {
|
|
|
4924
4393
|
{
|
|
4925
4394
|
name: 'rootIndex';
|
|
4926
4395
|
docs: [
|
|
4927
|
-
'Index of root used in inclusion validity proof.'
|
|
4396
|
+
'Index of root used in inclusion validity proof.'
|
|
4928
4397
|
];
|
|
4929
4398
|
type: 'u16';
|
|
4930
4399
|
},
|
|
4931
4400
|
{
|
|
4932
4401
|
name: 'readOnly';
|
|
4933
4402
|
docs: [
|
|
4934
|
-
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
4403
|
+
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
4935
4404
|
];
|
|
4936
4405
|
type: 'bool';
|
|
4937
|
-
}
|
|
4406
|
+
}
|
|
4938
4407
|
];
|
|
4939
4408
|
};
|
|
4940
4409
|
},
|
|
@@ -4958,7 +4427,7 @@ type LightCompressedToken = {
|
|
|
4958
4427
|
{
|
|
4959
4428
|
name: 'proveByIndex';
|
|
4960
4429
|
type: 'bool';
|
|
4961
|
-
}
|
|
4430
|
+
}
|
|
4962
4431
|
];
|
|
4963
4432
|
};
|
|
4964
4433
|
},
|
|
@@ -4988,12 +4457,12 @@ type LightCompressedToken = {
|
|
|
4988
4457
|
{
|
|
4989
4458
|
name: 'tlv';
|
|
4990
4459
|
docs: [
|
|
4991
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4460
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4992
4461
|
];
|
|
4993
4462
|
type: {
|
|
4994
4463
|
option: 'bytes';
|
|
4995
4464
|
};
|
|
4996
|
-
}
|
|
4465
|
+
}
|
|
4997
4466
|
];
|
|
4998
4467
|
};
|
|
4999
4468
|
},
|
|
@@ -5067,7 +4536,7 @@ type LightCompressedToken = {
|
|
|
5067
4536
|
type: {
|
|
5068
4537
|
option: 'bytes';
|
|
5069
4538
|
};
|
|
5070
|
-
}
|
|
4539
|
+
}
|
|
5071
4540
|
];
|
|
5072
4541
|
};
|
|
5073
4542
|
},
|
|
@@ -5085,7 +4554,7 @@ type LightCompressedToken = {
|
|
|
5085
4554
|
name: 'index';
|
|
5086
4555
|
docs: ['Index of compressed account hash in queue.'];
|
|
5087
4556
|
type: 'u16';
|
|
5088
|
-
}
|
|
4557
|
+
}
|
|
5089
4558
|
];
|
|
5090
4559
|
};
|
|
5091
4560
|
},
|
|
@@ -5113,7 +4582,7 @@ type LightCompressedToken = {
|
|
|
5113
4582
|
name: 'delegate';
|
|
5114
4583
|
docs: [
|
|
5115
4584
|
'If `delegate` is `Some` then `delegated_amount` represents',
|
|
5116
|
-
'the amount authorized by the delegate'
|
|
4585
|
+
'the amount authorized by the delegate'
|
|
5117
4586
|
];
|
|
5118
4587
|
type: {
|
|
5119
4588
|
option: 'publicKey';
|
|
@@ -5129,15 +4598,15 @@ type LightCompressedToken = {
|
|
|
5129
4598
|
{
|
|
5130
4599
|
name: 'tlv';
|
|
5131
4600
|
docs: [
|
|
5132
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4601
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
5133
4602
|
];
|
|
5134
4603
|
type: {
|
|
5135
4604
|
option: 'bytes';
|
|
5136
4605
|
};
|
|
5137
|
-
}
|
|
4606
|
+
}
|
|
5138
4607
|
];
|
|
5139
4608
|
};
|
|
5140
|
-
}
|
|
4609
|
+
}
|
|
5141
4610
|
];
|
|
5142
4611
|
errors: [
|
|
5143
4612
|
{
|
|
@@ -5294,7 +4763,7 @@ type LightCompressedToken = {
|
|
|
5294
4763
|
{
|
|
5295
4764
|
code: 6032;
|
|
5296
4765
|
name: 'NoMatchingBumpFound';
|
|
5297
|
-
}
|
|
4766
|
+
}
|
|
5298
4767
|
];
|
|
5299
4768
|
};
|
|
5300
4769
|
declare const IDL: LightCompressedToken;
|
|
@@ -5305,30 +4774,14 @@ declare const CompressedTokenInstructionDataTransferLayout: Layout<unknown>;
|
|
|
5305
4774
|
declare const mintToLayout: Layout<unknown>;
|
|
5306
4775
|
declare const batchCompressLayout: Layout<unknown>;
|
|
5307
4776
|
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;
|
|
4777
|
+
declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
|
|
4778
|
+
declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
|
|
4779
|
+
declare function encodeBatchCompressInstructionData(data: BatchCompressInstructionData): Buffer$1;
|
|
4780
|
+
declare function decodeBatchCompressInstructionData(buffer: Buffer$1): BatchCompressInstructionData;
|
|
4781
|
+
declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
|
|
4782
|
+
declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
|
|
4783
|
+
declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
|
|
4784
|
+
declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
|
|
5332
4785
|
interface BaseAccountsLayoutParams {
|
|
5333
4786
|
feePayer: PublicKey;
|
|
5334
4787
|
authority: PublicKey;
|
|
@@ -5370,44 +4823,20 @@ type freezeAccountsLayoutParams = BaseAccountsLayoutParams & {
|
|
|
5370
4823
|
mint: PublicKey;
|
|
5371
4824
|
};
|
|
5372
4825
|
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[];
|
|
4826
|
+
declare const createTokenPoolAccountsLayout: (accounts: createTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
4827
|
+
declare const addTokenPoolAccountsLayout: (accounts: addTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
4828
|
+
declare const mintToAccountsLayout: (accounts: mintToAccountsLayoutParams) => AccountMeta[];
|
|
4829
|
+
declare const transferAccountsLayout: (accounts: transferAccountsLayoutParams) => AccountMeta[];
|
|
4830
|
+
declare const approveAccountsLayout: (accounts: approveAccountsLayoutParams) => AccountMeta[];
|
|
4831
|
+
declare const revokeAccountsLayout: (accounts: approveAccountsLayoutParams) => AccountMeta[];
|
|
4832
|
+
declare const freezeAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
|
|
4833
|
+
declare const thawAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
|
|
5397
4834
|
declare const CompressedTokenInstructionDataApproveLayout: Layout<unknown>;
|
|
5398
4835
|
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;
|
|
4836
|
+
declare function encodeApproveInstructionData(data: CompressedTokenInstructionDataApprove): Buffer$1;
|
|
4837
|
+
declare function decodeApproveInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataApprove;
|
|
4838
|
+
declare function encodeRevokeInstructionData(data: CompressedTokenInstructionDataRevoke): Buffer$1;
|
|
4839
|
+
declare function decodeRevokeInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataRevoke;
|
|
5411
4840
|
|
|
5412
4841
|
type CompressParams = {
|
|
5413
4842
|
/**
|
|
@@ -5501,11 +4930,7 @@ type DecompressParams = {
|
|
|
5501
4930
|
/**
|
|
5502
4931
|
* Token pool(s)
|
|
5503
4932
|
*/
|
|
5504
|
-
tokenPoolInfos:
|
|
5505
|
-
| TokenPoolInfo
|
|
5506
|
-
| TokenPoolInfo[]
|
|
5507
|
-
| SplInterfaceInfo
|
|
5508
|
-
| SplInterfaceInfo[];
|
|
4933
|
+
tokenPoolInfos: TokenPoolInfo | TokenPoolInfo[] | SplInterfaceInfo | SplInterfaceInfo[];
|
|
5509
4934
|
};
|
|
5510
4935
|
type TransferParams = {
|
|
5511
4936
|
/**
|
|
@@ -5790,17 +5215,12 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
5790
5215
|
/**
|
|
5791
5216
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
5792
5217
|
*/
|
|
5793
|
-
declare const parseTokenData: (
|
|
5794
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
5795
|
-
) => {
|
|
5218
|
+
declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
|
|
5796
5219
|
mint: PublicKey;
|
|
5797
5220
|
currentOwner: PublicKey;
|
|
5798
5221
|
delegate: PublicKey | null;
|
|
5799
5222
|
};
|
|
5800
|
-
declare const parseMaybeDelegatedTransfer: (
|
|
5801
|
-
inputs: ParsedTokenAccount[],
|
|
5802
|
-
outputs: TokenTransferOutputData[],
|
|
5803
|
-
) => {
|
|
5223
|
+
declare const parseMaybeDelegatedTransfer: (inputs: ParsedTokenAccount[], outputs: TokenTransferOutputData[]) => {
|
|
5804
5224
|
delegatedTransfer: DelegatedTransfer | null;
|
|
5805
5225
|
authority: PublicKey;
|
|
5806
5226
|
};
|
|
@@ -5812,11 +5232,7 @@ declare const parseMaybeDelegatedTransfer: (
|
|
|
5812
5232
|
* @returns Output token data for the transfer
|
|
5813
5233
|
* instruction
|
|
5814
5234
|
*/
|
|
5815
|
-
declare function createTransferOutputState(
|
|
5816
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
5817
|
-
toAddress: PublicKey,
|
|
5818
|
-
amount: number | BN,
|
|
5819
|
-
): TokenTransferOutputData[];
|
|
5235
|
+
declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData[];
|
|
5820
5236
|
/**
|
|
5821
5237
|
* Create the output state for a compress transaction.
|
|
5822
5238
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -5824,10 +5240,7 @@ declare function createTransferOutputState(
|
|
|
5824
5240
|
* @returns Output token data for the compress
|
|
5825
5241
|
* instruction
|
|
5826
5242
|
*/
|
|
5827
|
-
declare function createDecompressOutputState(
|
|
5828
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
5829
|
-
amount: number | BN,
|
|
5830
|
-
): TokenTransferOutputData[];
|
|
5243
|
+
declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData[];
|
|
5831
5244
|
declare class CompressedTokenProgram {
|
|
5832
5245
|
/**
|
|
5833
5246
|
* @internal
|
|
@@ -5865,17 +5278,11 @@ declare class CompressedTokenProgram {
|
|
|
5865
5278
|
*
|
|
5866
5279
|
* @returns The index and bump number.
|
|
5867
5280
|
*/
|
|
5868
|
-
static findSplInterfaceIndexAndBump(
|
|
5869
|
-
poolPda: PublicKey,
|
|
5870
|
-
mint: PublicKey,
|
|
5871
|
-
): [number, number];
|
|
5281
|
+
static findSplInterfaceIndexAndBump(poolPda: PublicKey, mint: PublicKey): [number, number];
|
|
5872
5282
|
/**
|
|
5873
5283
|
* @deprecated Use {@link findSplInterfaceIndexAndBump} instead.
|
|
5874
5284
|
*/
|
|
5875
|
-
static findTokenPoolIndexAndBump(
|
|
5876
|
-
poolPda: PublicKey,
|
|
5877
|
-
mint: PublicKey,
|
|
5878
|
-
): [number, number];
|
|
5285
|
+
static findTokenPoolIndexAndBump(poolPda: PublicKey, mint: PublicKey): [number, number];
|
|
5879
5286
|
/**
|
|
5880
5287
|
* Derive the SPL interface PDA with index.
|
|
5881
5288
|
*
|
|
@@ -5885,17 +5292,11 @@ declare class CompressedTokenProgram {
|
|
|
5885
5292
|
*
|
|
5886
5293
|
* @returns The SPL interface PDA and bump.
|
|
5887
5294
|
*/
|
|
5888
|
-
static deriveSplInterfacePdaWithIndex(
|
|
5889
|
-
mint: PublicKey,
|
|
5890
|
-
index: number,
|
|
5891
|
-
): [PublicKey, number];
|
|
5295
|
+
static deriveSplInterfacePdaWithIndex(mint: PublicKey, index: number): [PublicKey, number];
|
|
5892
5296
|
/**
|
|
5893
5297
|
* @deprecated Use {@link deriveSplInterfacePdaWithIndex} instead.
|
|
5894
5298
|
*/
|
|
5895
|
-
static deriveTokenPoolPdaWithIndex(
|
|
5896
|
-
mint: PublicKey,
|
|
5897
|
-
index: number,
|
|
5898
|
-
): [PublicKey, number];
|
|
5299
|
+
static deriveTokenPoolPdaWithIndex(mint: PublicKey, index: number): [PublicKey, number];
|
|
5899
5300
|
/** @internal */
|
|
5900
5301
|
static get deriveCpiAuthorityPda(): PublicKey;
|
|
5901
5302
|
/**
|
|
@@ -5916,16 +5317,7 @@ declare class CompressedTokenProgram {
|
|
|
5916
5317
|
* Note that `createTokenPoolInstruction` must be executed after
|
|
5917
5318
|
* `initializeMintInstruction`.
|
|
5918
5319
|
*/
|
|
5919
|
-
static createMint({
|
|
5920
|
-
feePayer,
|
|
5921
|
-
mint,
|
|
5922
|
-
authority,
|
|
5923
|
-
freezeAuthority,
|
|
5924
|
-
decimals,
|
|
5925
|
-
rentExemptBalance,
|
|
5926
|
-
tokenProgramId,
|
|
5927
|
-
mintSize,
|
|
5928
|
-
}: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
5320
|
+
static createMint({ feePayer, mint, authority, freezeAuthority, decimals, rentExemptBalance, tokenProgramId, mintSize, }: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
5929
5321
|
/**
|
|
5930
5322
|
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
5931
5323
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
@@ -5937,11 +5329,7 @@ declare class CompressedTokenProgram {
|
|
|
5937
5329
|
*
|
|
5938
5330
|
* @returns The createTokenPool instruction
|
|
5939
5331
|
*/
|
|
5940
|
-
static createTokenPool({
|
|
5941
|
-
feePayer,
|
|
5942
|
-
mint,
|
|
5943
|
-
tokenProgramId,
|
|
5944
|
-
}: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5332
|
+
static createTokenPool({ feePayer, mint, tokenProgramId, }: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5945
5333
|
/**
|
|
5946
5334
|
* Add a token pool to an existing SPL mint. For new mints, use
|
|
5947
5335
|
* {@link createTokenPool}.
|
|
@@ -5954,12 +5342,7 @@ declare class CompressedTokenProgram {
|
|
|
5954
5342
|
*
|
|
5955
5343
|
* @returns The addTokenPool instruction
|
|
5956
5344
|
*/
|
|
5957
|
-
static addTokenPool({
|
|
5958
|
-
feePayer,
|
|
5959
|
-
mint,
|
|
5960
|
-
poolIndex,
|
|
5961
|
-
tokenProgramId,
|
|
5962
|
-
}: AddSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5345
|
+
static addTokenPool({ feePayer, mint, poolIndex, tokenProgramId, }: AddSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5963
5346
|
/**
|
|
5964
5347
|
* Construct mintTo instruction for compressed tokens
|
|
5965
5348
|
*
|
|
@@ -5973,15 +5356,7 @@ declare class CompressedTokenProgram {
|
|
|
5973
5356
|
*
|
|
5974
5357
|
* @returns The mintTo instruction
|
|
5975
5358
|
*/
|
|
5976
|
-
static mintTo({
|
|
5977
|
-
feePayer,
|
|
5978
|
-
mint,
|
|
5979
|
-
authority,
|
|
5980
|
-
toPubkey,
|
|
5981
|
-
amount,
|
|
5982
|
-
outputStateTreeInfo,
|
|
5983
|
-
tokenPoolInfo,
|
|
5984
|
-
}: MintToParams): Promise<TransactionInstruction>;
|
|
5359
|
+
static mintTo({ feePayer, mint, authority, toPubkey, amount, outputStateTreeInfo, tokenPoolInfo, }: MintToParams): Promise<TransactionInstruction>;
|
|
5985
5360
|
/**
|
|
5986
5361
|
* Mint tokens from registered SPL mint account to a compressed account
|
|
5987
5362
|
*
|
|
@@ -5997,16 +5372,7 @@ declare class CompressedTokenProgram {
|
|
|
5997
5372
|
*
|
|
5998
5373
|
* @returns The mintTo instruction
|
|
5999
5374
|
*/
|
|
6000
|
-
static approveAndMintTo({
|
|
6001
|
-
feePayer,
|
|
6002
|
-
mint,
|
|
6003
|
-
authority,
|
|
6004
|
-
authorityTokenAccount,
|
|
6005
|
-
toPubkey,
|
|
6006
|
-
amount,
|
|
6007
|
-
outputStateTreeInfo,
|
|
6008
|
-
tokenPoolInfo,
|
|
6009
|
-
}: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
5375
|
+
static approveAndMintTo({ feePayer, mint, authority, authorityTokenAccount, toPubkey, amount, outputStateTreeInfo, tokenPoolInfo, }: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
6010
5376
|
/**
|
|
6011
5377
|
* Construct transfer instruction for compressed tokens.
|
|
6012
5378
|
*
|
|
@@ -6021,14 +5387,7 @@ declare class CompressedTokenProgram {
|
|
|
6021
5387
|
*
|
|
6022
5388
|
* @returns The transfer instruction
|
|
6023
5389
|
*/
|
|
6024
|
-
static transfer({
|
|
6025
|
-
payer,
|
|
6026
|
-
inputCompressedTokenAccounts,
|
|
6027
|
-
toAddress,
|
|
6028
|
-
amount,
|
|
6029
|
-
recentValidityProof,
|
|
6030
|
-
recentInputStateRootIndices,
|
|
6031
|
-
}: TransferParams): Promise<TransactionInstruction>;
|
|
5390
|
+
static transfer({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, }: TransferParams): Promise<TransactionInstruction>;
|
|
6032
5391
|
/**
|
|
6033
5392
|
* Create lookup table instructions for the token program's default
|
|
6034
5393
|
* accounts.
|
|
@@ -6041,13 +5400,7 @@ declare class CompressedTokenProgram {
|
|
|
6041
5400
|
*
|
|
6042
5401
|
* @returns [createInstruction, extendInstruction, option(extendInstruction2)]
|
|
6043
5402
|
*/
|
|
6044
|
-
static createTokenProgramLookupTable({
|
|
6045
|
-
payer,
|
|
6046
|
-
authority,
|
|
6047
|
-
mints,
|
|
6048
|
-
recentSlot,
|
|
6049
|
-
remainingAccounts,
|
|
6050
|
-
}: CreateTokenProgramLookupTableParams): Promise<{
|
|
5403
|
+
static createTokenProgramLookupTable({ payer, authority, mints, recentSlot, remainingAccounts, }: CreateTokenProgramLookupTableParams): Promise<{
|
|
6051
5404
|
instructions: TransactionInstruction[];
|
|
6052
5405
|
address: PublicKey;
|
|
6053
5406
|
}>;
|
|
@@ -6065,16 +5418,7 @@ declare class CompressedTokenProgram {
|
|
|
6065
5418
|
*
|
|
6066
5419
|
* @returns The compress instruction
|
|
6067
5420
|
*/
|
|
6068
|
-
static compress({
|
|
6069
|
-
payer,
|
|
6070
|
-
owner,
|
|
6071
|
-
source,
|
|
6072
|
-
toAddress,
|
|
6073
|
-
amount,
|
|
6074
|
-
mint,
|
|
6075
|
-
outputStateTreeInfo,
|
|
6076
|
-
tokenPoolInfo,
|
|
6077
|
-
}: CompressParams): Promise<TransactionInstruction>;
|
|
5421
|
+
static compress({ payer, owner, source, toAddress, amount, mint, outputStateTreeInfo, tokenPoolInfo, }: CompressParams): Promise<TransactionInstruction>;
|
|
6078
5422
|
/**
|
|
6079
5423
|
* Construct decompress instruction
|
|
6080
5424
|
*
|
|
@@ -6089,15 +5433,7 @@ declare class CompressedTokenProgram {
|
|
|
6089
5433
|
*
|
|
6090
5434
|
* @returns The decompress instruction
|
|
6091
5435
|
*/
|
|
6092
|
-
static decompress({
|
|
6093
|
-
payer,
|
|
6094
|
-
inputCompressedTokenAccounts,
|
|
6095
|
-
toAddress,
|
|
6096
|
-
amount,
|
|
6097
|
-
recentValidityProof,
|
|
6098
|
-
recentInputStateRootIndices,
|
|
6099
|
-
tokenPoolInfos,
|
|
6100
|
-
}: DecompressParams): Promise<TransactionInstruction>;
|
|
5436
|
+
static decompress({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, tokenPoolInfos, }: DecompressParams): Promise<TransactionInstruction>;
|
|
6101
5437
|
/**
|
|
6102
5438
|
* Create `mergeTokenAccounts` instruction.
|
|
6103
5439
|
*
|
|
@@ -6110,14 +5446,7 @@ declare class CompressedTokenProgram {
|
|
|
6110
5446
|
* @param recentInputStateRootIndices Recent state root indices.
|
|
6111
5447
|
* @returns instruction
|
|
6112
5448
|
*/
|
|
6113
|
-
static mergeTokenAccounts({
|
|
6114
|
-
payer,
|
|
6115
|
-
owner,
|
|
6116
|
-
inputCompressedTokenAccounts,
|
|
6117
|
-
mint,
|
|
6118
|
-
recentValidityProof,
|
|
6119
|
-
recentInputStateRootIndices,
|
|
6120
|
-
}: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
5449
|
+
static mergeTokenAccounts({ payer, owner, inputCompressedTokenAccounts, mint, recentValidityProof, recentInputStateRootIndices, }: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
6121
5450
|
/**
|
|
6122
5451
|
* Create `compressSplTokenAccount` instruction
|
|
6123
5452
|
*
|
|
@@ -6131,15 +5460,7 @@ declare class CompressedTokenProgram {
|
|
|
6131
5460
|
*
|
|
6132
5461
|
* @returns instruction
|
|
6133
5462
|
*/
|
|
6134
|
-
static compressSplTokenAccount({
|
|
6135
|
-
feePayer,
|
|
6136
|
-
authority,
|
|
6137
|
-
tokenAccount,
|
|
6138
|
-
mint,
|
|
6139
|
-
remainingAmount,
|
|
6140
|
-
outputStateTreeInfo,
|
|
6141
|
-
tokenPoolInfo,
|
|
6142
|
-
}: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
5463
|
+
static compressSplTokenAccount({ feePayer, authority, tokenAccount, mint, remainingAmount, outputStateTreeInfo, tokenPoolInfo, }: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
6143
5464
|
/**
|
|
6144
5465
|
* Get the program ID for a mint
|
|
6145
5466
|
*
|
|
@@ -6148,10 +5469,7 @@ declare class CompressedTokenProgram {
|
|
|
6148
5469
|
*
|
|
6149
5470
|
* @returns program ID
|
|
6150
5471
|
*/
|
|
6151
|
-
static getMintProgramId(
|
|
6152
|
-
mint: PublicKey,
|
|
6153
|
-
connection: Connection,
|
|
6154
|
-
): Promise<PublicKey | undefined>;
|
|
5472
|
+
static getMintProgramId(mint: PublicKey, connection: Connection): Promise<PublicKey | undefined>;
|
|
6155
5473
|
/**
|
|
6156
5474
|
* Create `approve` instruction to delegate compressed tokens.
|
|
6157
5475
|
*
|
|
@@ -6164,14 +5482,7 @@ declare class CompressedTokenProgram {
|
|
|
6164
5482
|
*
|
|
6165
5483
|
* @returns instruction
|
|
6166
5484
|
*/
|
|
6167
|
-
static approve({
|
|
6168
|
-
payer,
|
|
6169
|
-
inputCompressedTokenAccounts,
|
|
6170
|
-
toAddress,
|
|
6171
|
-
amount,
|
|
6172
|
-
recentValidityProof,
|
|
6173
|
-
recentInputStateRootIndices,
|
|
6174
|
-
}: ApproveParams): Promise<TransactionInstruction>;
|
|
5485
|
+
static approve({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, }: ApproveParams): Promise<TransactionInstruction>;
|
|
6175
5486
|
/**
|
|
6176
5487
|
* Create `revoke` instruction to revoke delegation of compressed tokens.
|
|
6177
5488
|
*
|
|
@@ -6182,12 +5493,7 @@ declare class CompressedTokenProgram {
|
|
|
6182
5493
|
*
|
|
6183
5494
|
* @returns instruction
|
|
6184
5495
|
*/
|
|
6185
|
-
static revoke({
|
|
6186
|
-
payer,
|
|
6187
|
-
inputCompressedTokenAccounts,
|
|
6188
|
-
recentValidityProof,
|
|
6189
|
-
recentInputStateRootIndices,
|
|
6190
|
-
}: RevokeParams): Promise<TransactionInstruction>;
|
|
5496
|
+
static revoke({ payer, inputCompressedTokenAccounts, recentValidityProof, recentInputStateRootIndices, }: RevokeParams): Promise<TransactionInstruction>;
|
|
6191
5497
|
}
|
|
6192
5498
|
|
|
6193
5499
|
/**
|
|
@@ -6201,14 +5507,7 @@ declare class CompressedTokenProgram {
|
|
|
6201
5507
|
* @param programId Optional program ID
|
|
6202
5508
|
* @returns AccountInterface with ATA metadata
|
|
6203
5509
|
*/
|
|
6204
|
-
declare function getAtaInterface(
|
|
6205
|
-
rpc: Rpc,
|
|
6206
|
-
ata: PublicKey,
|
|
6207
|
-
owner: PublicKey,
|
|
6208
|
-
mint: PublicKey,
|
|
6209
|
-
commitment?: Commitment,
|
|
6210
|
-
programId?: PublicKey,
|
|
6211
|
-
): Promise<AccountInterface>;
|
|
5510
|
+
declare function getAtaInterface(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
|
|
6212
5511
|
/**
|
|
6213
5512
|
* Create instructions to load token balances into a c-token ATA.
|
|
6214
5513
|
*
|
|
@@ -6220,14 +5519,7 @@ declare function getAtaInterface(
|
|
|
6220
5519
|
* @param options Optional load options
|
|
6221
5520
|
* @returns Array of instructions (empty if nothing to load)
|
|
6222
5521
|
*/
|
|
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[]>;
|
|
5522
|
+
declare function createLoadAtaInstructions(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, payer?: PublicKey, options?: InterfaceOptions): Promise<TransactionInstruction[]>;
|
|
6231
5523
|
/**
|
|
6232
5524
|
* Load token balances into a c-token ATA.
|
|
6233
5525
|
*
|
|
@@ -6240,225 +5532,6 @@ declare function createLoadAtaInstructions(
|
|
|
6240
5532
|
* @param interfaceOptions Optional interface options
|
|
6241
5533
|
* @returns Transaction signature, or null if nothing to load
|
|
6242
5534
|
*/
|
|
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
|
-
};
|
|
5535
|
+
declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKey, payer?: Signer, confirmOptions?: ConfirmOptions, interfaceOptions?: InterfaceOptions): Promise<TransactionSignature | null>;
|
|
5536
|
+
|
|
5537
|
+
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, type LoadResult, 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, createCTokenTransferInstruction, createDecompressInterfaceInstruction, createDecompressOutputState, createLoadAccountsParams, createLoadAtaInstructions, createLoadAtaInstructionsFromInterface, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstruction, createTransferOutputState, 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, 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, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectSplInterfaceInfo, selectSplInterfaceInfosForDecompression, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, serializeMint, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, unpackMintData, unpackMintInterface, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
|