@lightprotocol/compressed-token 0.23.0-beta.4 → 0.23.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser/index.cjs +1 -218
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/types-C7ZeGpIm.cjs +2 -0
- package/dist/cjs/browser/types-C7ZeGpIm.cjs.map +1 -0
- package/dist/cjs/browser/unified/index.cjs +1 -379
- package/dist/cjs/browser/unified/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +1 -219
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/types-BGRaX3tR.cjs +2 -0
- package/dist/cjs/node/types-BGRaX3tR.cjs.map +1 -0
- package/dist/cjs/node/unified/index.cjs +1 -380
- package/dist/cjs/node/unified/index.cjs.map +1 -1
- package/dist/es/browser/index.js +1 -166
- package/dist/es/browser/index.js.map +1 -1
- package/dist/es/browser/types-BvBzUhrt.js +2 -0
- package/dist/es/browser/types-BvBzUhrt.js.map +1 -0
- package/dist/es/browser/unified/index.js +1 -284
- package/dist/es/browser/unified/index.js.map +1 -1
- package/dist/types/index.d.ts +611 -1343
- package/dist/types/unified/index.d.ts +779 -1636
- package/package.json +4 -3
- package/dist/cjs/browser/types-qZMOMIxa.cjs +0 -11351
- package/dist/cjs/browser/types-qZMOMIxa.cjs.map +0 -1
- package/dist/cjs/node/types-BsKbElnz.cjs +0 -10113
- package/dist/cjs/node/types-BsKbElnz.cjs.map +0 -1
- package/dist/es/browser/types-pblNXos5.js +0 -10454
- package/dist/es/browser/types-pblNXos5.js.map +0 -1
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
PublicKey,
|
|
5
|
-
AccountInfo,
|
|
6
|
-
Commitment,
|
|
7
|
-
TransactionInstruction,
|
|
8
|
-
Signer,
|
|
9
|
-
AccountMeta,
|
|
10
|
-
Keypair,
|
|
11
|
-
ConfirmOptions,
|
|
12
|
-
TransactionSignature,
|
|
13
|
-
Connection,
|
|
14
|
-
} from '@solana/web3.js';
|
|
15
|
-
import {
|
|
16
|
-
MerkleContext,
|
|
17
|
-
CompressedAccountWithMerkleContext,
|
|
18
|
-
Rpc,
|
|
19
|
-
ValidityProofWithContext,
|
|
20
|
-
AddressTreeInfo,
|
|
21
|
-
TreeInfo,
|
|
22
|
-
ParsedTokenAccount,
|
|
23
|
-
ValidityProof,
|
|
24
|
-
TreeType,
|
|
25
|
-
PackedMerkleContextLegacy,
|
|
26
|
-
CompressedCpiContext,
|
|
27
|
-
InputTokenDataWithContext as InputTokenDataWithContext$1,
|
|
28
|
-
CompressedProof,
|
|
29
|
-
} from '@lightprotocol/stateless.js';
|
|
2
|
+
import { PublicKey, AccountInfo, Commitment, TransactionInstruction, AccountMeta, Signer, Keypair, ConfirmOptions, TransactionSignature, Connection } from '@solana/web3.js';
|
|
3
|
+
import { MerkleContext, CompressedAccountWithMerkleContext, Rpc, ValidityProofWithContext, AddressTreeInfo, TreeInfo, ParsedTokenAccount, ValidityProof, TreeType, PackedMerkleContextLegacy, CompressedCpiContext, InputTokenDataWithContext as InputTokenDataWithContext$1, CompressedProof } from '@lightprotocol/stateless.js';
|
|
30
4
|
export { ParsedTokenAccount } from '@lightprotocol/stateless.js';
|
|
31
5
|
import { Account, Mint } from '@solana/spl-token';
|
|
32
6
|
export { AccountState } from '@solana/spl-token';
|
|
33
7
|
|
|
34
8
|
declare namespace BN {
|
|
35
|
-
type Endianness =
|
|
36
|
-
type IPrimeName =
|
|
9
|
+
type Endianness = "le" | "be";
|
|
10
|
+
type IPrimeName = "k256" | "p224" | "p192" | "p25519";
|
|
37
11
|
|
|
38
12
|
interface MPrime {
|
|
39
13
|
name: string;
|
|
@@ -55,7 +29,7 @@ declare class BN {
|
|
|
55
29
|
|
|
56
30
|
constructor(
|
|
57
31
|
number: bigint | number | string | number[] | Uint8Array | Buffer | BN,
|
|
58
|
-
base?: number |
|
|
32
|
+
base?: number | "hex",
|
|
59
33
|
endian?: BN.Endianness,
|
|
60
34
|
);
|
|
61
35
|
constructor(
|
|
@@ -101,7 +75,7 @@ declare class BN {
|
|
|
101
75
|
/**
|
|
102
76
|
* @description convert to base-string and pad with zeroes
|
|
103
77
|
*/
|
|
104
|
-
toString(base?: number |
|
|
78
|
+
toString(base?: number | "hex", length?: number): string;
|
|
105
79
|
|
|
106
80
|
/**
|
|
107
81
|
* @description convert to Javascript Number (limited to 53 bits)
|
|
@@ -361,11 +335,7 @@ declare class BN {
|
|
|
361
335
|
/**
|
|
362
336
|
* @description division with remainder
|
|
363
337
|
*/
|
|
364
|
-
divmod(
|
|
365
|
-
b: BN,
|
|
366
|
-
mode?: 'div' | 'mod',
|
|
367
|
-
positive?: boolean,
|
|
368
|
-
): { div: BN; mod: BN };
|
|
338
|
+
divmod(b: BN, mode?: "div" | "mod", positive?: boolean): { div: BN; mod: BN };
|
|
369
339
|
|
|
370
340
|
/**
|
|
371
341
|
* @description reduct
|
|
@@ -629,54 +599,18 @@ declare class RedBN extends BN {
|
|
|
629
599
|
}
|
|
630
600
|
|
|
631
601
|
declare class Buffer$1 extends Uint8Array {
|
|
632
|
-
length: number
|
|
633
|
-
write(
|
|
634
|
-
string: string,
|
|
635
|
-
offset?: number,
|
|
636
|
-
length?: number,
|
|
637
|
-
encoding?: string,
|
|
638
|
-
): number;
|
|
602
|
+
length: number
|
|
603
|
+
write(string: string, offset?: number, length?: number, encoding?: string): number;
|
|
639
604
|
toString(encoding?: string, start?: number, end?: number): string;
|
|
640
|
-
toJSON(): { type: 'Buffer'
|
|
605
|
+
toJSON(): { type: 'Buffer', data: any[] };
|
|
641
606
|
equals(otherBuffer: Buffer$1): boolean;
|
|
642
|
-
compare(
|
|
643
|
-
|
|
644
|
-
targetStart?: number,
|
|
645
|
-
targetEnd?: number,
|
|
646
|
-
sourceStart?: number,
|
|
647
|
-
sourceEnd?: number,
|
|
648
|
-
): number;
|
|
649
|
-
copy(
|
|
650
|
-
targetBuffer: Buffer$1,
|
|
651
|
-
targetStart?: number,
|
|
652
|
-
sourceStart?: number,
|
|
653
|
-
sourceEnd?: number,
|
|
654
|
-
): number;
|
|
607
|
+
compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
608
|
+
copy(targetBuffer: Buffer$1, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
655
609
|
slice(start?: number, end?: number): Buffer$1;
|
|
656
|
-
writeUIntLE(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
noAssert?: boolean,
|
|
661
|
-
): number;
|
|
662
|
-
writeUIntBE(
|
|
663
|
-
value: number,
|
|
664
|
-
offset: number,
|
|
665
|
-
byteLength: number,
|
|
666
|
-
noAssert?: boolean,
|
|
667
|
-
): number;
|
|
668
|
-
writeIntLE(
|
|
669
|
-
value: number,
|
|
670
|
-
offset: number,
|
|
671
|
-
byteLength: number,
|
|
672
|
-
noAssert?: boolean,
|
|
673
|
-
): number;
|
|
674
|
-
writeIntBE(
|
|
675
|
-
value: number,
|
|
676
|
-
offset: number,
|
|
677
|
-
byteLength: number,
|
|
678
|
-
noAssert?: boolean,
|
|
679
|
-
): number;
|
|
610
|
+
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
611
|
+
writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
612
|
+
writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
613
|
+
writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
|
680
614
|
readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
|
681
615
|
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
|
682
616
|
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
|
@@ -722,21 +656,9 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
722
656
|
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
|
|
723
657
|
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
|
|
724
658
|
fill(value: any, offset?: number, end?: number): this;
|
|
725
|
-
indexOf(
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
encoding?: string,
|
|
729
|
-
): number;
|
|
730
|
-
lastIndexOf(
|
|
731
|
-
value: string | number | Buffer$1,
|
|
732
|
-
byteOffset?: number,
|
|
733
|
-
encoding?: string,
|
|
734
|
-
): number;
|
|
735
|
-
includes(
|
|
736
|
-
value: string | number | Buffer$1,
|
|
737
|
-
byteOffset?: number,
|
|
738
|
-
encoding?: string,
|
|
739
|
-
): boolean;
|
|
659
|
+
indexOf(value: string | number | Buffer$1, byteOffset?: number, encoding?: string): number;
|
|
660
|
+
lastIndexOf(value: string | number | Buffer$1, byteOffset?: number, encoding?: string): number;
|
|
661
|
+
includes(value: string | number | Buffer$1, byteOffset?: number, encoding?: string): boolean;
|
|
740
662
|
|
|
741
663
|
/**
|
|
742
664
|
* Allocates a new buffer containing the given {str}.
|
|
@@ -744,19 +666,19 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
744
666
|
* @param str String to store in buffer.
|
|
745
667
|
* @param encoding encoding to use, optional. Default is 'utf8'
|
|
746
668
|
*/
|
|
747
|
-
constructor(str: string, encoding?: string);
|
|
669
|
+
constructor (str: string, encoding?: string);
|
|
748
670
|
/**
|
|
749
671
|
* Allocates a new buffer of {size} octets.
|
|
750
672
|
*
|
|
751
673
|
* @param size count of octets to allocate.
|
|
752
674
|
*/
|
|
753
|
-
constructor(size: number);
|
|
675
|
+
constructor (size: number);
|
|
754
676
|
/**
|
|
755
677
|
* Allocates a new buffer containing the given {array} of octets.
|
|
756
678
|
*
|
|
757
679
|
* @param array The octets to store.
|
|
758
680
|
*/
|
|
759
|
-
constructor(array: Uint8Array);
|
|
681
|
+
constructor (array: Uint8Array);
|
|
760
682
|
/**
|
|
761
683
|
* Produces a Buffer backed by the same allocated memory as
|
|
762
684
|
* the given {ArrayBuffer}.
|
|
@@ -764,19 +686,19 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
764
686
|
*
|
|
765
687
|
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
|
766
688
|
*/
|
|
767
|
-
constructor(arrayBuffer: ArrayBuffer);
|
|
689
|
+
constructor (arrayBuffer: ArrayBuffer);
|
|
768
690
|
/**
|
|
769
691
|
* Allocates a new buffer containing the given {array} of octets.
|
|
770
692
|
*
|
|
771
693
|
* @param array The octets to store.
|
|
772
694
|
*/
|
|
773
|
-
constructor(array: any[]);
|
|
695
|
+
constructor (array: any[]);
|
|
774
696
|
/**
|
|
775
697
|
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
|
776
698
|
*
|
|
777
699
|
* @param buffer The buffer to copy.
|
|
778
700
|
*/
|
|
779
|
-
constructor(buffer: Buffer$1);
|
|
701
|
+
constructor (buffer: Buffer$1);
|
|
780
702
|
prototype: Buffer$1;
|
|
781
703
|
/**
|
|
782
704
|
* Allocates a new Buffer using an {array} of octets.
|
|
@@ -794,11 +716,7 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
794
716
|
* @param byteOffset
|
|
795
717
|
* @param length
|
|
796
718
|
*/
|
|
797
|
-
static from(
|
|
798
|
-
arrayBuffer: ArrayBuffer,
|
|
799
|
-
byteOffset?: number,
|
|
800
|
-
length?: number,
|
|
801
|
-
): Buffer$1;
|
|
719
|
+
static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer$1;
|
|
802
720
|
/**
|
|
803
721
|
* Copies the passed {buffer} data onto a new Buffer instance.
|
|
804
722
|
*
|
|
@@ -858,11 +776,7 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
858
776
|
* If parameter is omitted, buffer will be filled with zeros.
|
|
859
777
|
* @param encoding encoding used for call to buf.fill while initializing
|
|
860
778
|
*/
|
|
861
|
-
static alloc(
|
|
862
|
-
size: number,
|
|
863
|
-
fill?: string | Buffer$1 | number,
|
|
864
|
-
encoding?: string,
|
|
865
|
-
): Buffer$1;
|
|
779
|
+
static alloc(size: number, fill?: string | Buffer$1 | number, encoding?: string): Buffer$1;
|
|
866
780
|
/**
|
|
867
781
|
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
|
|
868
782
|
* of the newly created Buffer are unknown and may contain sensitive data.
|
|
@@ -880,15 +794,14 @@ declare class Buffer$1 extends Uint8Array {
|
|
|
880
794
|
}
|
|
881
795
|
|
|
882
796
|
declare const TokenAccountSourceType: {
|
|
883
|
-
readonly Spl:
|
|
884
|
-
readonly Token2022:
|
|
885
|
-
readonly SplCold:
|
|
886
|
-
readonly Token2022Cold:
|
|
887
|
-
readonly CTokenHot:
|
|
888
|
-
readonly CTokenCold:
|
|
797
|
+
readonly Spl: "spl";
|
|
798
|
+
readonly Token2022: "token2022";
|
|
799
|
+
readonly SplCold: "spl-cold";
|
|
800
|
+
readonly Token2022Cold: "token2022-cold";
|
|
801
|
+
readonly CTokenHot: "ctoken-hot";
|
|
802
|
+
readonly CTokenCold: "ctoken-cold";
|
|
889
803
|
};
|
|
890
|
-
type TokenAccountSourceTypeValue =
|
|
891
|
-
(typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
|
|
804
|
+
type TokenAccountSourceTypeValue = (typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
|
|
892
805
|
/** @internal */
|
|
893
806
|
interface TokenAccountSource {
|
|
894
807
|
type: TokenAccountSourceTypeValue;
|
|
@@ -915,36 +828,25 @@ interface AccountInterface {
|
|
|
915
828
|
_mint?: PublicKey;
|
|
916
829
|
}
|
|
917
830
|
/** @internal */
|
|
918
|
-
declare function convertTokenDataToAccount(
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
tlv: Buffer$1 | null;
|
|
927
|
-
},
|
|
928
|
-
): Account;
|
|
831
|
+
declare function convertTokenDataToAccount(address: PublicKey, tokenData: {
|
|
832
|
+
mint: PublicKey;
|
|
833
|
+
owner: PublicKey;
|
|
834
|
+
amount: BN;
|
|
835
|
+
delegate: PublicKey | null;
|
|
836
|
+
state: number;
|
|
837
|
+
tlv: Buffer$1 | null;
|
|
838
|
+
}): Account;
|
|
929
839
|
/** Convert compressed account to AccountInfo */
|
|
930
|
-
declare function toAccountInfo(
|
|
931
|
-
compressedAccount: CompressedAccountWithMerkleContext,
|
|
932
|
-
): AccountInfo<Buffer$1>;
|
|
840
|
+
declare function toAccountInfo(compressedAccount: CompressedAccountWithMerkleContext): AccountInfo<Buffer$1>;
|
|
933
841
|
/** @internal */
|
|
934
|
-
declare function parseCTokenHot(
|
|
935
|
-
address: PublicKey,
|
|
936
|
-
accountInfo: AccountInfo<Buffer$1>,
|
|
937
|
-
): {
|
|
842
|
+
declare function parseCTokenHot(address: PublicKey, accountInfo: AccountInfo<Buffer$1>): {
|
|
938
843
|
accountInfo: AccountInfo<Buffer$1>;
|
|
939
844
|
loadContext: undefined;
|
|
940
845
|
parsed: Account;
|
|
941
846
|
isCold: false;
|
|
942
847
|
};
|
|
943
848
|
/** @internal */
|
|
944
|
-
declare function parseCTokenCold(
|
|
945
|
-
address: PublicKey,
|
|
946
|
-
compressedAccount: CompressedAccountWithMerkleContext,
|
|
947
|
-
): {
|
|
849
|
+
declare function parseCTokenCold(address: PublicKey, compressedAccount: CompressedAccountWithMerkleContext): {
|
|
948
850
|
accountInfo: AccountInfo<Buffer$1>;
|
|
949
851
|
loadContext: MerkleContext;
|
|
950
852
|
parsed: Account;
|
|
@@ -960,12 +862,230 @@ declare function parseCTokenCold(
|
|
|
960
862
|
*
|
|
961
863
|
* @return Token account information with compression context if applicable
|
|
962
864
|
*/
|
|
963
|
-
declare function getAccountInterface(
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
865
|
+
declare function getAccountInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* SPL interface PDA info.
|
|
869
|
+
*/
|
|
870
|
+
type SplInterfaceInfo = {
|
|
871
|
+
/**
|
|
872
|
+
* The mint of the SPL interface
|
|
873
|
+
*/
|
|
874
|
+
mint: PublicKey;
|
|
875
|
+
/**
|
|
876
|
+
* The SPL interface address
|
|
877
|
+
*/
|
|
878
|
+
splInterfacePda: PublicKey;
|
|
879
|
+
/**
|
|
880
|
+
* The token program of the SPL interface
|
|
881
|
+
*/
|
|
882
|
+
tokenProgram: PublicKey;
|
|
883
|
+
/**
|
|
884
|
+
* count of txs and volume in the past 60 seconds.
|
|
885
|
+
*/
|
|
886
|
+
activity?: {
|
|
887
|
+
txs: number;
|
|
888
|
+
amountAdded: BN;
|
|
889
|
+
amountRemoved: BN;
|
|
890
|
+
};
|
|
891
|
+
/**
|
|
892
|
+
* Whether the SPL interface is initialized
|
|
893
|
+
*/
|
|
894
|
+
isInitialized: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* The balance of the SPL interface
|
|
897
|
+
*/
|
|
898
|
+
balance: BN;
|
|
899
|
+
/**
|
|
900
|
+
* The index of the SPL interface
|
|
901
|
+
*/
|
|
902
|
+
poolIndex: number;
|
|
903
|
+
/**
|
|
904
|
+
* The bump used to derive the SPL interface PDA
|
|
905
|
+
*/
|
|
906
|
+
bump: number;
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* @deprecated Use {@link SplInterfaceInfo} instead.
|
|
910
|
+
* This type maintains backward compatibility by including both tokenPoolPda and splInterfacePda.
|
|
911
|
+
* Both properties point to the same PublicKey value.
|
|
912
|
+
*/
|
|
913
|
+
type TokenPoolInfo = {
|
|
914
|
+
/**
|
|
915
|
+
* The mint of the SPL interface
|
|
916
|
+
*/
|
|
917
|
+
mint: PublicKey;
|
|
918
|
+
/**
|
|
919
|
+
* @deprecated Use splInterfacePda instead.
|
|
920
|
+
*/
|
|
921
|
+
tokenPoolPda: PublicKey;
|
|
922
|
+
/**
|
|
923
|
+
* The SPL interface address (new name).
|
|
924
|
+
* For backward compatibility, tokenPoolPda is also available.
|
|
925
|
+
*/
|
|
926
|
+
splInterfacePda: PublicKey;
|
|
927
|
+
/**
|
|
928
|
+
* The token program of the SPL interface
|
|
929
|
+
*/
|
|
930
|
+
tokenProgram: PublicKey;
|
|
931
|
+
/**
|
|
932
|
+
* count of txs and volume in the past 60 seconds.
|
|
933
|
+
*/
|
|
934
|
+
activity?: {
|
|
935
|
+
txs: number;
|
|
936
|
+
amountAdded: BN;
|
|
937
|
+
amountRemoved: BN;
|
|
938
|
+
};
|
|
939
|
+
/**
|
|
940
|
+
* Whether the SPL interface is initialized
|
|
941
|
+
*/
|
|
942
|
+
isInitialized: boolean;
|
|
943
|
+
/**
|
|
944
|
+
* The balance of the SPL interface
|
|
945
|
+
*/
|
|
946
|
+
balance: BN;
|
|
947
|
+
/**
|
|
948
|
+
* The index of the SPL interface
|
|
949
|
+
*/
|
|
950
|
+
poolIndex: number;
|
|
951
|
+
/**
|
|
952
|
+
* The bump used to derive the SPL interface PDA
|
|
953
|
+
*/
|
|
954
|
+
bump: number;
|
|
955
|
+
};
|
|
956
|
+
/**
|
|
957
|
+
* Convert SplInterfaceInfo to TokenPoolInfo for backward compatibility.
|
|
958
|
+
* @internal
|
|
959
|
+
*/
|
|
960
|
+
declare function toTokenPoolInfo(info: SplInterfaceInfo): TokenPoolInfo;
|
|
961
|
+
/**
|
|
962
|
+
* Derive SplInterfaceInfo for an SPL interface that will be initialized in the
|
|
963
|
+
* same transaction. Use this when you need to create an SPL interface and
|
|
964
|
+
* compress in a single transaction.
|
|
965
|
+
*
|
|
966
|
+
* @param mint The mint of the SPL interface
|
|
967
|
+
* @param tokenProgramId The token program (TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID)
|
|
968
|
+
* @param poolIndex The pool index. Default 0.
|
|
969
|
+
*
|
|
970
|
+
* @returns SplInterfaceInfo for the to-be-initialized interface
|
|
971
|
+
*/
|
|
972
|
+
declare function deriveSplInterfaceInfo(mint: PublicKey, tokenProgramId: PublicKey, poolIndex?: number): SplInterfaceInfo;
|
|
973
|
+
/**
|
|
974
|
+
* Check if the SPL interface info is initialized and has a balance.
|
|
975
|
+
* @param mint The mint of the SPL interface
|
|
976
|
+
* @param splInterfaceInfo The SPL interface info (or TokenPoolInfo for backward compatibility)
|
|
977
|
+
* @returns True if the SPL interface info is initialized and has a balance
|
|
978
|
+
*/
|
|
979
|
+
declare function checkSplInterfaceInfo(splInterfaceInfo: SplInterfaceInfo | TokenPoolInfo, mint: PublicKey): boolean;
|
|
980
|
+
/**
|
|
981
|
+
* Get the SPL interface infos for a given mint.
|
|
982
|
+
* @param rpc The RPC client
|
|
983
|
+
* @param mint The mint of the SPL interface
|
|
984
|
+
* @param commitment The commitment to use
|
|
985
|
+
*
|
|
986
|
+
* @returns The SPL interface infos
|
|
987
|
+
*/
|
|
988
|
+
declare function getSplInterfaceInfos(rpc: Rpc, mint: PublicKey, commitment?: Commitment): Promise<SplInterfaceInfo[]>;
|
|
989
|
+
type SplInterfaceActivity = {
|
|
990
|
+
signature: string;
|
|
991
|
+
amount: BN;
|
|
992
|
+
action: Action;
|
|
993
|
+
};
|
|
994
|
+
/**
|
|
995
|
+
* @internal
|
|
996
|
+
*/
|
|
997
|
+
declare enum Action {
|
|
998
|
+
Compress = 1,
|
|
999
|
+
Decompress = 2,
|
|
1000
|
+
Transfer = 3
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* For `compress` and `mintTo` instructions only.
|
|
1004
|
+
* Select a random SPL interface info from the SPL interface infos.
|
|
1005
|
+
*
|
|
1006
|
+
* For `decompress`, use {@link selectSplInterfaceInfosForDecompression} instead.
|
|
1007
|
+
*
|
|
1008
|
+
* @param infos The SPL interface infos
|
|
1009
|
+
*
|
|
1010
|
+
* @returns A random SPL interface info
|
|
1011
|
+
*/
|
|
1012
|
+
declare function selectSplInterfaceInfo(infos: SplInterfaceInfo[]): SplInterfaceInfo;
|
|
1013
|
+
/**
|
|
1014
|
+
* Select one or multiple SPL interface infos from the SPL interface infos.
|
|
1015
|
+
*
|
|
1016
|
+
* Use this function for `decompress`.
|
|
1017
|
+
*
|
|
1018
|
+
* For `compress`, `mintTo` use {@link selectSplInterfaceInfo} instead.
|
|
1019
|
+
*
|
|
1020
|
+
* @param infos The SPL interface infos
|
|
1021
|
+
* @param decompressAmount The amount of tokens to withdraw
|
|
1022
|
+
*
|
|
1023
|
+
* @returns Array with one or more SPL interface infos.
|
|
1024
|
+
*/
|
|
1025
|
+
declare function selectSplInterfaceInfosForDecompression(infos: SplInterfaceInfo[], decompressAmount: number | BN): SplInterfaceInfo[];
|
|
1026
|
+
/**
|
|
1027
|
+
* @deprecated Use {@link SplInterfaceActivity} instead.
|
|
1028
|
+
*/
|
|
1029
|
+
type TokenPoolActivity = SplInterfaceActivity;
|
|
1030
|
+
/**
|
|
1031
|
+
* @deprecated Use {@link deriveSplInterfaceInfo} instead.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function deriveTokenPoolInfo(mint: PublicKey, tokenProgramId: PublicKey, poolIndex?: number): TokenPoolInfo;
|
|
1034
|
+
/**
|
|
1035
|
+
* @deprecated Use {@link checkSplInterfaceInfo} instead.
|
|
1036
|
+
*/
|
|
1037
|
+
declare function checkTokenPoolInfo(tokenPoolInfo: TokenPoolInfo, mint: PublicKey): boolean;
|
|
1038
|
+
/**
|
|
1039
|
+
* @deprecated Use {@link getSplInterfaceInfos} instead.
|
|
1040
|
+
*/
|
|
1041
|
+
declare function getTokenPoolInfos(rpc: Rpc, mint: PublicKey, commitment?: Commitment): Promise<TokenPoolInfo[]>;
|
|
1042
|
+
/**
|
|
1043
|
+
* @deprecated Use {@link selectSplInterfaceInfo} instead.
|
|
1044
|
+
*/
|
|
1045
|
+
declare function selectTokenPoolInfo(infos: TokenPoolInfo[]): TokenPoolInfo;
|
|
1046
|
+
/**
|
|
1047
|
+
* @deprecated Use {@link selectSplInterfaceInfosForDecompression} instead.
|
|
1048
|
+
*/
|
|
1049
|
+
declare function selectTokenPoolInfosForDecompression(infos: TokenPoolInfo[], decompressAmount: number | BN): TokenPoolInfo[];
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Options for interface operations (load, transfer)
|
|
1053
|
+
*/
|
|
1054
|
+
interface InterfaceOptions {
|
|
1055
|
+
/** SPL interface infos (fetched if not provided) */
|
|
1056
|
+
splInterfaceInfos?: SplInterfaceInfo[];
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Options for createTransferInterfaceInstructions.
|
|
1060
|
+
*/
|
|
1061
|
+
interface TransferOptions extends InterfaceOptions {
|
|
1062
|
+
/** Include SPL/T22 wrapping to c-token ATA (unified path). Default: false. */
|
|
1063
|
+
wrap?: boolean;
|
|
1064
|
+
/** Token program ID. Default: LIGHT_TOKEN_PROGRAM_ID. */
|
|
1065
|
+
programId?: PublicKey;
|
|
1066
|
+
/**
|
|
1067
|
+
* Include an idempotent recipient ATA creation instruction in the
|
|
1068
|
+
* transfer transaction. No extra RPC fetch -- uses
|
|
1069
|
+
* createAssociatedTokenAccountInterfaceIdempotentInstruction which is
|
|
1070
|
+
* a no-op on-chain if the ATA already exists (~200 CU overhead).
|
|
1071
|
+
* Default: true.
|
|
1072
|
+
*/
|
|
1073
|
+
ensureRecipientAta?: boolean;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Splits the last element from an array.
|
|
1077
|
+
*
|
|
1078
|
+
* Useful for separating load transactions (parallel) from the final transfer
|
|
1079
|
+
* transaction (sequential) returned by `createTransferInterfaceInstructions`.
|
|
1080
|
+
*
|
|
1081
|
+
* @returns `{ rest, last }` where `rest` is everything before the last
|
|
1082
|
+
* element and `last` is the last element.
|
|
1083
|
+
* @throws if the input array is empty.
|
|
1084
|
+
*/
|
|
1085
|
+
declare function sliceLast<T>(items: T[]): {
|
|
1086
|
+
rest: T[];
|
|
1087
|
+
last: T;
|
|
1088
|
+
};
|
|
969
1089
|
|
|
970
1090
|
interface LayoutObject {
|
|
971
1091
|
[key: string]: any;
|
|
@@ -1115,13 +1235,7 @@ interface TokenMetadataInstructionData {
|
|
|
1115
1235
|
updateAuthority?: PublicKey | null;
|
|
1116
1236
|
additionalMetadata: AdditionalMetadata[] | null;
|
|
1117
1237
|
}
|
|
1118
|
-
declare function createTokenMetadata(
|
|
1119
|
-
name: string,
|
|
1120
|
-
symbol: string,
|
|
1121
|
-
uri: string,
|
|
1122
|
-
updateAuthority?: PublicKey | null,
|
|
1123
|
-
additionalMetadata?: AdditionalMetadata[] | null,
|
|
1124
|
-
): TokenMetadataInstructionData;
|
|
1238
|
+
declare function createTokenMetadata(name: string, symbol: string, uri: string, updateAuthority?: PublicKey | null, additionalMetadata?: AdditionalMetadata[] | null): TokenMetadataInstructionData;
|
|
1125
1239
|
/**
|
|
1126
1240
|
* Create instruction for initializing a c-token mint.
|
|
1127
1241
|
*
|
|
@@ -1135,17 +1249,7 @@ declare function createTokenMetadata(
|
|
|
1135
1249
|
* @param outputStateTreeInfo Output state tree info.
|
|
1136
1250
|
* @param metadata Optional token metadata.
|
|
1137
1251
|
*/
|
|
1138
|
-
declare function createMintInstruction(
|
|
1139
|
-
mintSigner: PublicKey,
|
|
1140
|
-
decimals: number,
|
|
1141
|
-
mintAuthority: PublicKey,
|
|
1142
|
-
freezeAuthority: PublicKey | null,
|
|
1143
|
-
payer: PublicKey,
|
|
1144
|
-
validityProof: ValidityProofWithContext,
|
|
1145
|
-
addressTreeInfo: AddressTreeInfo,
|
|
1146
|
-
outputStateTreeInfo: TreeInfo,
|
|
1147
|
-
metadata?: TokenMetadataInstructionData,
|
|
1148
|
-
): TransactionInstruction;
|
|
1252
|
+
declare function createMintInstruction(mintSigner: PublicKey, decimals: number, mintAuthority: PublicKey, freezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext, addressTreeInfo: AddressTreeInfo, outputStateTreeInfo: TreeInfo, metadata?: TokenMetadataInstructionData): TransactionInstruction;
|
|
1149
1253
|
|
|
1150
1254
|
/**
|
|
1151
1255
|
* SPL-compatible base mint structure
|
|
@@ -1279,7 +1383,7 @@ declare function serializeMint(mint: CompressedMint): Buffer$1;
|
|
|
1279
1383
|
* Extension type constants
|
|
1280
1384
|
*/
|
|
1281
1385
|
declare enum ExtensionType {
|
|
1282
|
-
TokenMetadata = 19
|
|
1386
|
+
TokenMetadata = 19
|
|
1283
1387
|
}
|
|
1284
1388
|
/**
|
|
1285
1389
|
* Decode TokenMetadata from raw extension data using Borsh layout
|
|
@@ -1297,9 +1401,7 @@ declare function encodeTokenMetadata(metadata: TokenMetadata): Buffer$1;
|
|
|
1297
1401
|
* @param extensions - Array of raw extensions
|
|
1298
1402
|
* @returns Parsed TokenMetadata or null if not found
|
|
1299
1403
|
*/
|
|
1300
|
-
declare function extractTokenMetadata(
|
|
1301
|
-
extensions: MintExtension[] | null,
|
|
1302
|
-
): TokenMetadata | null;
|
|
1404
|
+
declare function extractTokenMetadata(extensions: MintExtension[] | null): TokenMetadata | null;
|
|
1303
1405
|
/**
|
|
1304
1406
|
* Metadata portion of MintInstructionData
|
|
1305
1407
|
* Used for instruction encoding when metadata extension is present
|
|
@@ -1350,12 +1452,7 @@ interface MintInterface {
|
|
|
1350
1452
|
* @returns Object with mint, optional merkleContext, mintContext, and
|
|
1351
1453
|
* tokenMetadata
|
|
1352
1454
|
*/
|
|
1353
|
-
declare function getMintInterface(
|
|
1354
|
-
rpc: Rpc,
|
|
1355
|
-
address: PublicKey,
|
|
1356
|
-
commitment?: Commitment,
|
|
1357
|
-
programId?: PublicKey,
|
|
1358
|
-
): Promise<MintInterface>;
|
|
1455
|
+
declare function getMintInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<MintInterface>;
|
|
1359
1456
|
/**
|
|
1360
1457
|
* Unpack mint info from raw account data for SPL/T22/c-token.
|
|
1361
1458
|
*
|
|
@@ -1364,11 +1461,7 @@ declare function getMintInterface(
|
|
|
1364
1461
|
* @param programId Token program ID. Default c-token.
|
|
1365
1462
|
* @returns Object with mint, optional mintContext and tokenMetadata.
|
|
1366
1463
|
*/
|
|
1367
|
-
declare function unpackMintInterface(
|
|
1368
|
-
address: PublicKey,
|
|
1369
|
-
data: Buffer$1 | Uint8Array | AccountInfo<Buffer$1>,
|
|
1370
|
-
programId?: PublicKey,
|
|
1371
|
-
): Omit<MintInterface, 'merkleContext'>;
|
|
1464
|
+
declare function unpackMintInterface(address: PublicKey, data: Buffer$1 | Uint8Array | AccountInfo<Buffer$1>, programId?: PublicKey): Omit<MintInterface, 'merkleContext'>;
|
|
1372
1465
|
/**
|
|
1373
1466
|
* Unpack c-token mint context and metadata from raw account data
|
|
1374
1467
|
*
|
|
@@ -1383,22 +1476,18 @@ declare function unpackMintData(data: Buffer$1 | Uint8Array): {
|
|
|
1383
1476
|
|
|
1384
1477
|
/**
|
|
1385
1478
|
* Create instruction for updating a compressed mint's mint authority.
|
|
1479
|
+
* Works for both compressed and decompressed mints.
|
|
1386
1480
|
*
|
|
1387
1481
|
* @param mintInterface MintInterface from getMintInterface() - must have merkleContext
|
|
1388
1482
|
* @param currentMintAuthority Current mint authority public key (must sign)
|
|
1389
1483
|
* @param newMintAuthority New mint authority (or null to revoke)
|
|
1390
1484
|
* @param payer Fee payer public key
|
|
1391
|
-
* @param validityProof Validity proof for the compressed mint
|
|
1485
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
1392
1486
|
*/
|
|
1393
|
-
declare function createUpdateMintAuthorityInstruction(
|
|
1394
|
-
mintInterface: MintInterface,
|
|
1395
|
-
currentMintAuthority: PublicKey,
|
|
1396
|
-
newMintAuthority: PublicKey | null,
|
|
1397
|
-
payer: PublicKey,
|
|
1398
|
-
validityProof: ValidityProofWithContext,
|
|
1399
|
-
): TransactionInstruction;
|
|
1487
|
+
declare function createUpdateMintAuthorityInstruction(mintInterface: MintInterface, currentMintAuthority: PublicKey, newMintAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null): TransactionInstruction;
|
|
1400
1488
|
/**
|
|
1401
1489
|
* Create instruction for updating a compressed mint's freeze authority.
|
|
1490
|
+
* Works for both compressed and decompressed mints.
|
|
1402
1491
|
*
|
|
1403
1492
|
* Output queue is automatically derived from mintInterface.merkleContext.treeInfo
|
|
1404
1493
|
* (preferring nextTreeInfo.queue if available for rollover support).
|
|
@@ -1407,15 +1496,9 @@ declare function createUpdateMintAuthorityInstruction(
|
|
|
1407
1496
|
* @param currentFreezeAuthority Current freeze authority public key (must sign)
|
|
1408
1497
|
* @param newFreezeAuthority New freeze authority (or null to revoke)
|
|
1409
1498
|
* @param payer Fee payer public key
|
|
1410
|
-
* @param validityProof Validity proof for the compressed mint
|
|
1499
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
1411
1500
|
*/
|
|
1412
|
-
declare function createUpdateFreezeAuthorityInstruction(
|
|
1413
|
-
mintInterface: MintInterface,
|
|
1414
|
-
currentFreezeAuthority: PublicKey,
|
|
1415
|
-
newFreezeAuthority: PublicKey | null,
|
|
1416
|
-
payer: PublicKey,
|
|
1417
|
-
validityProof: ValidityProofWithContext,
|
|
1418
|
-
): TransactionInstruction;
|
|
1501
|
+
declare function createUpdateFreezeAuthorityInstruction(mintInterface: MintInterface, currentFreezeAuthority: PublicKey, newFreezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null): TransactionInstruction;
|
|
1419
1502
|
|
|
1420
1503
|
/**
|
|
1421
1504
|
* Create instruction for updating a compressed mint's metadata field.
|
|
@@ -1426,22 +1509,13 @@ declare function createUpdateFreezeAuthorityInstruction(
|
|
|
1426
1509
|
* @param mintInterface MintInterface from getMintInterface() - must have merkleContext and tokenMetadata
|
|
1427
1510
|
* @param authority Metadata update authority public key (must sign)
|
|
1428
1511
|
* @param payer Fee payer public key
|
|
1429
|
-
* @param validityProof Validity proof for the compressed mint
|
|
1512
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
1430
1513
|
* @param fieldType Field to update: 'name', 'symbol', 'uri', or 'custom'
|
|
1431
1514
|
* @param value New value for the field
|
|
1432
1515
|
* @param customKey Custom key name (required if fieldType is 'custom')
|
|
1433
1516
|
* @param extensionIndex Extension index (default: 0)
|
|
1434
1517
|
*/
|
|
1435
|
-
declare function createUpdateMetadataFieldInstruction(
|
|
1436
|
-
mintInterface: MintInterface,
|
|
1437
|
-
authority: PublicKey,
|
|
1438
|
-
payer: PublicKey,
|
|
1439
|
-
validityProof: ValidityProofWithContext,
|
|
1440
|
-
fieldType: 'name' | 'symbol' | 'uri' | 'custom',
|
|
1441
|
-
value: string,
|
|
1442
|
-
customKey?: string,
|
|
1443
|
-
extensionIndex?: number,
|
|
1444
|
-
): TransactionInstruction;
|
|
1518
|
+
declare function createUpdateMetadataFieldInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number): TransactionInstruction;
|
|
1445
1519
|
/**
|
|
1446
1520
|
* Create instruction for updating a compressed mint's metadata authority.
|
|
1447
1521
|
*
|
|
@@ -1452,17 +1526,10 @@ declare function createUpdateMetadataFieldInstruction(
|
|
|
1452
1526
|
* @param currentAuthority Current metadata update authority public key (must sign)
|
|
1453
1527
|
* @param newAuthority New metadata update authority public key
|
|
1454
1528
|
* @param payer Fee payer public key
|
|
1455
|
-
* @param validityProof Validity proof for the compressed mint
|
|
1529
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
1456
1530
|
* @param extensionIndex Extension index (default: 0)
|
|
1457
1531
|
*/
|
|
1458
|
-
declare function createUpdateMetadataAuthorityInstruction(
|
|
1459
|
-
mintInterface: MintInterface,
|
|
1460
|
-
currentAuthority: PublicKey,
|
|
1461
|
-
newAuthority: PublicKey,
|
|
1462
|
-
payer: PublicKey,
|
|
1463
|
-
validityProof: ValidityProofWithContext,
|
|
1464
|
-
extensionIndex?: number,
|
|
1465
|
-
): TransactionInstruction;
|
|
1532
|
+
declare function createUpdateMetadataAuthorityInstruction(mintInterface: MintInterface, currentAuthority: PublicKey, newAuthority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, extensionIndex?: number): TransactionInstruction;
|
|
1466
1533
|
/**
|
|
1467
1534
|
* Create instruction for removing a metadata key from a compressed mint.
|
|
1468
1535
|
*
|
|
@@ -1472,20 +1539,12 @@ declare function createUpdateMetadataAuthorityInstruction(
|
|
|
1472
1539
|
* @param mintInterface MintInterface from getMintInterface() - must have merkleContext and tokenMetadata
|
|
1473
1540
|
* @param authority Metadata update authority public key (must sign)
|
|
1474
1541
|
* @param payer Fee payer public key
|
|
1475
|
-
* @param validityProof Validity proof for the compressed mint
|
|
1542
|
+
* @param validityProof Validity proof for the compressed mint (null for decompressed mints)
|
|
1476
1543
|
* @param key Metadata key to remove
|
|
1477
1544
|
* @param idempotent If true, don't error if key doesn't exist (default: false)
|
|
1478
1545
|
* @param extensionIndex Extension index (default: 0)
|
|
1479
1546
|
*/
|
|
1480
|
-
declare function createRemoveMetadataKeyInstruction(
|
|
1481
|
-
mintInterface: MintInterface,
|
|
1482
|
-
authority: PublicKey,
|
|
1483
|
-
payer: PublicKey,
|
|
1484
|
-
validityProof: ValidityProofWithContext,
|
|
1485
|
-
key: string,
|
|
1486
|
-
idempotent?: boolean,
|
|
1487
|
-
extensionIndex?: number,
|
|
1488
|
-
): TransactionInstruction;
|
|
1547
|
+
declare function createRemoveMetadataKeyInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, key: string, idempotent?: boolean, extensionIndex?: number): TransactionInstruction;
|
|
1489
1548
|
|
|
1490
1549
|
interface CompressToPubkey {
|
|
1491
1550
|
bump: number;
|
|
@@ -1495,456 +1554,260 @@ interface CompressToPubkey {
|
|
|
1495
1554
|
interface CompressibleConfig {
|
|
1496
1555
|
tokenAccountVersion: number;
|
|
1497
1556
|
rentPayment: number;
|
|
1498
|
-
hasTopUp: number;
|
|
1499
1557
|
compressionOnly: number;
|
|
1500
1558
|
writeTopUp: number;
|
|
1501
1559
|
compressToAccountPubkey?: CompressToPubkey | null;
|
|
1502
1560
|
}
|
|
1503
1561
|
interface CreateAssociatedCTokenAccountParams {
|
|
1504
|
-
|
|
1505
|
-
compressibleConfig?: CompressibleConfig;
|
|
1562
|
+
compressibleConfig?: CompressibleConfig | null;
|
|
1506
1563
|
}
|
|
1507
1564
|
/**
|
|
1508
|
-
*
|
|
1565
|
+
* Default compressible config for c-token ATAs - matches Rust SDK defaults.
|
|
1509
1566
|
*
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* @param rentPayerPda Optional rent payer PDA.
|
|
1516
|
-
*/
|
|
1517
|
-
declare function createAssociatedCTokenAccountInstruction(
|
|
1518
|
-
feePayer: PublicKey,
|
|
1519
|
-
owner: PublicKey,
|
|
1520
|
-
mint: PublicKey,
|
|
1521
|
-
compressibleConfig?: CompressibleConfig,
|
|
1522
|
-
configAccount?: PublicKey,
|
|
1523
|
-
rentPayerPda?: PublicKey,
|
|
1524
|
-
): TransactionInstruction;
|
|
1525
|
-
/**
|
|
1526
|
-
* Create idempotent instruction for creating an associated compressed token account.
|
|
1567
|
+
* - tokenAccountVersion: 3 (ShaFlat) - latest hashing scheme
|
|
1568
|
+
* - rentPayment: 16 - prepay 16 epochs (~24 hours rent)
|
|
1569
|
+
* - compressionOnly: 1 - required for ATAs
|
|
1570
|
+
* - writeTopUp: 766 - per-write top-up (~2 epochs rent) when rent < 2 epochs
|
|
1571
|
+
* - compressToAccountPubkey: null - required for ATAs
|
|
1527
1572
|
*
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1530
|
-
*
|
|
1531
|
-
* @param compressibleConfig Optional compressible configuration.
|
|
1532
|
-
* @param configAccount Optional config account.
|
|
1533
|
-
* @param rentPayerPda Optional rent payer PDA.
|
|
1534
|
-
*/
|
|
1535
|
-
declare function createAssociatedCTokenAccountIdempotentInstruction(
|
|
1536
|
-
feePayer: PublicKey,
|
|
1537
|
-
owner: PublicKey,
|
|
1538
|
-
mint: PublicKey,
|
|
1539
|
-
compressibleConfig?: CompressibleConfig,
|
|
1540
|
-
configAccount?: PublicKey,
|
|
1541
|
-
rentPayerPda?: PublicKey,
|
|
1542
|
-
): TransactionInstruction;
|
|
1543
|
-
|
|
1544
|
-
/**
|
|
1545
|
-
* c-token-specific config for createAssociatedTokenAccountInterfaceInstruction
|
|
1546
|
-
*/
|
|
1547
|
-
interface CTokenConfig {
|
|
1548
|
-
compressibleConfig?: CompressibleConfig;
|
|
1549
|
-
configAccount?: PublicKey;
|
|
1550
|
-
rentPayerPda?: PublicKey;
|
|
1551
|
-
}
|
|
1552
|
-
/**
|
|
1553
|
-
* Create instruction for creating an associated token account (SPL, Token-2022,
|
|
1554
|
-
* or c-token). Follows SPL Token API signature with optional c-token config at the
|
|
1555
|
-
* end.
|
|
1573
|
+
* Cost breakdown at ATA creation:
|
|
1574
|
+
* - Rent sponsor PDA (LIGHT_TOKEN_RENT_SPONSOR) pays: rent exemption (~890,880 lamports)
|
|
1575
|
+
* - Fee payer pays: compression_cost (11K) + 16 epochs rent (~6,400) = ~17,400 lamports + tx fees
|
|
1556
1576
|
*
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
* @param mint Mint address.
|
|
1561
|
-
* @param programId Token program ID (default: TOKEN_PROGRAM_ID).
|
|
1562
|
-
* @param associatedTokenProgramId Associated token program ID.
|
|
1563
|
-
* @param ctokenConfig Optional c-token-specific configuration.
|
|
1564
|
-
*/
|
|
1565
|
-
declare function createAssociatedTokenAccountInterfaceInstruction(
|
|
1566
|
-
payer: PublicKey,
|
|
1567
|
-
associatedToken: PublicKey,
|
|
1568
|
-
owner: PublicKey,
|
|
1569
|
-
mint: PublicKey,
|
|
1570
|
-
programId?: PublicKey,
|
|
1571
|
-
associatedTokenProgramId?: PublicKey,
|
|
1572
|
-
ctokenConfig?: CTokenConfig,
|
|
1573
|
-
): TransactionInstruction;
|
|
1574
|
-
/**
|
|
1575
|
-
* Create idempotent instruction for creating an associated token account (SPL,
|
|
1576
|
-
* Token-2022, or c-token). Follows SPL Token API signature with optional c-token
|
|
1577
|
-
* config at the end.
|
|
1577
|
+
* Per-write top-up (transfers):
|
|
1578
|
+
* - When account rent is below 2 epochs, fee payer pays 766 lamports top-up
|
|
1579
|
+
* - This keeps the account perpetually funded when actively used
|
|
1578
1580
|
*
|
|
1579
|
-
*
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1583
|
-
* @param programId Token program ID (default: TOKEN_PROGRAM_ID).
|
|
1584
|
-
* @param associatedTokenProgramId Associated token program ID.
|
|
1585
|
-
* @param ctokenConfig Optional c-token-specific configuration.
|
|
1586
|
-
*/
|
|
1587
|
-
declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(
|
|
1588
|
-
payer: PublicKey,
|
|
1589
|
-
associatedToken: PublicKey,
|
|
1590
|
-
owner: PublicKey,
|
|
1591
|
-
mint: PublicKey,
|
|
1592
|
-
programId?: PublicKey,
|
|
1593
|
-
associatedTokenProgramId?: PublicKey,
|
|
1594
|
-
ctokenConfig?: CTokenConfig,
|
|
1595
|
-
): TransactionInstruction;
|
|
1596
|
-
/**
|
|
1597
|
-
* Short alias for createAssociatedTokenAccountInterfaceIdempotentInstruction.
|
|
1598
|
-
*/
|
|
1599
|
-
declare const createAtaInterfaceIdempotentInstruction: typeof createAssociatedTokenAccountInterfaceIdempotentInstruction;
|
|
1600
|
-
|
|
1601
|
-
/**
|
|
1602
|
-
* Create instruction for minting compressed tokens to an onchain token account.
|
|
1581
|
+
* Rent calculation (272-byte compressible ctoken account):
|
|
1582
|
+
* - rent_per_epoch = base_rent (128) + bytes * rent_per_byte (272 * 1) = 400 lamports
|
|
1583
|
+
* - 16 epochs = 16 * 400 = 6,400 lamports (24 hours)
|
|
1584
|
+
* - 2 epochs = 2 * 400 = 800 lamports (~3 hours, writeTopUp = 766 is conservative)
|
|
1603
1585
|
*
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1609
|
-
*
|
|
1610
|
-
*
|
|
1611
|
-
*
|
|
1586
|
+
* Account size breakdown (272 bytes):
|
|
1587
|
+
* - 165 bytes: SPL token base layout
|
|
1588
|
+
* - 1 byte: account_type discriminator
|
|
1589
|
+
* - 1 byte: Option discriminator for extensions
|
|
1590
|
+
* - 4 bytes: Vec length prefix
|
|
1591
|
+
* - 1 byte: extension type discriminant
|
|
1592
|
+
* - 4 bytes: CompressibleExtension header (decimals_option, decimals, compression_only, is_ata)
|
|
1593
|
+
* - 96 bytes: CompressionInfo struct
|
|
1612
1594
|
*/
|
|
1613
|
-
declare
|
|
1614
|
-
authority: PublicKey,
|
|
1615
|
-
payer: PublicKey,
|
|
1616
|
-
validityProof: ValidityProofWithContext,
|
|
1617
|
-
merkleContext: MerkleContext,
|
|
1618
|
-
mintData: MintInstructionData,
|
|
1619
|
-
outputStateTreeInfo: TreeInfo,
|
|
1620
|
-
recipientAccount: PublicKey,
|
|
1621
|
-
amount: number | bigint,
|
|
1622
|
-
): TransactionInstruction;
|
|
1623
|
-
|
|
1595
|
+
declare const DEFAULT_COMPRESSIBLE_CONFIG: CompressibleConfig;
|
|
1624
1596
|
/**
|
|
1625
|
-
*
|
|
1626
|
-
*
|
|
1627
|
-
*/
|
|
1628
|
-
declare enum TokenDataVersion {
|
|
1629
|
-
/** V1: Poseidon hash with little-endian amount, discriminator [2,0,0,0,0,0,0,0] */
|
|
1630
|
-
V1 = 1,
|
|
1631
|
-
/** V2: Poseidon hash with big-endian amount, discriminator [0,0,0,0,0,0,0,3] */
|
|
1632
|
-
V2 = 2,
|
|
1633
|
-
/** ShaFlat: SHA256 hash of borsh-serialized data, discriminator [0,0,0,0,0,0,0,4] */
|
|
1634
|
-
ShaFlat = 3,
|
|
1635
|
-
}
|
|
1636
|
-
declare const POOL_SEED: Buffer$1<ArrayBuffer>;
|
|
1637
|
-
declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
|
|
1638
|
-
declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
|
|
1639
|
-
declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1640
|
-
declare const MINT_TO_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1641
|
-
declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1642
|
-
declare const TRANSFER_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1643
|
-
declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1644
|
-
declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1645
|
-
declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1646
|
-
declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1647
|
-
declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1648
|
-
|
|
1649
|
-
/**
|
|
1650
|
-
* Create instruction for minting tokens from a c-mint to compressed accounts.
|
|
1651
|
-
* To mint to onchain token accounts across SPL/T22/c-mints, use
|
|
1652
|
-
* {@link createMintToInterfaceInstruction} instead.
|
|
1653
|
-
*
|
|
1654
|
-
* @param authority Mint authority public key.
|
|
1655
|
-
* @param payer Fee payer public key.
|
|
1656
|
-
* @param validityProof Validity proof for the compressed mint.
|
|
1657
|
-
* @param merkleContext Merkle context of the compressed mint.
|
|
1658
|
-
* @param mintData Mint instruction data.
|
|
1659
|
-
* @param recipients Array of recipients with amounts.
|
|
1660
|
-
* @param outputStateTreeInfo Optional output state tree info. Uses merkle
|
|
1661
|
-
* context queue if not provided.
|
|
1662
|
-
* @param tokenAccountVersion Token account version (default:
|
|
1663
|
-
* TokenDataVersion.ShaFlat).
|
|
1664
|
-
*/
|
|
1665
|
-
declare function createMintToCompressedInstruction(
|
|
1666
|
-
authority: PublicKey,
|
|
1667
|
-
payer: PublicKey,
|
|
1668
|
-
validityProof: ValidityProofWithContext,
|
|
1669
|
-
merkleContext: MerkleContext,
|
|
1670
|
-
mintData: MintInstructionData,
|
|
1671
|
-
recipients: Array<{
|
|
1672
|
-
recipient: PublicKey;
|
|
1673
|
-
amount: number | bigint;
|
|
1674
|
-
}>,
|
|
1675
|
-
outputStateTreeInfo?: TreeInfo,
|
|
1676
|
-
tokenAccountVersion?: TokenDataVersion,
|
|
1677
|
-
): TransactionInstruction;
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* Create mint-to instruction for SPL, Token-2022, or compressed token mints.
|
|
1681
|
-
* This instruction ONLY mints to decompressed/onchain token accounts.
|
|
1682
|
-
*
|
|
1683
|
-
* @param mintInterface Mint interface (SPL, Token-2022, or compressed).
|
|
1684
|
-
* @param destination Destination onchain token account address.
|
|
1685
|
-
* @param authority Mint authority public key.
|
|
1686
|
-
* @param payer Fee payer public key.
|
|
1687
|
-
* @param amount Amount to mint.
|
|
1688
|
-
* @param validityProof Validity proof (required for compressed mints).
|
|
1689
|
-
* @param multiSigners Multi-signature signer public keys.
|
|
1690
|
-
*/
|
|
1691
|
-
declare function createMintToInterfaceInstruction(
|
|
1692
|
-
mintInterface: MintInterface,
|
|
1693
|
-
destination: PublicKey,
|
|
1694
|
-
authority: PublicKey,
|
|
1695
|
-
payer: PublicKey,
|
|
1696
|
-
amount: number | bigint,
|
|
1697
|
-
validityProof?: ValidityProofWithContext,
|
|
1698
|
-
multiSigners?: PublicKey[],
|
|
1699
|
-
): TransactionInstruction;
|
|
1700
|
-
|
|
1701
|
-
/**
|
|
1702
|
-
* Create a c-token transfer instruction.
|
|
1597
|
+
* Create instruction for creating an associated compressed token account.
|
|
1598
|
+
* Uses the default rent sponsor PDA by default.
|
|
1703
1599
|
*
|
|
1704
|
-
* @param
|
|
1705
|
-
* @param
|
|
1706
|
-
* @param
|
|
1707
|
-
* @param
|
|
1708
|
-
* @
|
|
1600
|
+
* @param feePayer Fee payer public key.
|
|
1601
|
+
* @param owner Owner of the associated token account.
|
|
1602
|
+
* @param mint Mint address.
|
|
1603
|
+
* @param compressibleConfig Compressible configuration (defaults to rent sponsor config).
|
|
1604
|
+
* @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
|
|
1605
|
+
* @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
|
|
1709
1606
|
*/
|
|
1710
|
-
declare function
|
|
1711
|
-
source: PublicKey,
|
|
1712
|
-
destination: PublicKey,
|
|
1713
|
-
owner: PublicKey,
|
|
1714
|
-
amount: number | bigint,
|
|
1715
|
-
): TransactionInstruction;
|
|
1607
|
+
declare function createAssociatedCTokenAccountInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
|
|
1716
1608
|
/**
|
|
1717
|
-
*
|
|
1718
|
-
*
|
|
1609
|
+
* Create idempotent instruction for creating an associated compressed token account.
|
|
1610
|
+
* Uses the default rent sponsor PDA by default.
|
|
1719
1611
|
*
|
|
1720
|
-
* @param
|
|
1721
|
-
* @param
|
|
1722
|
-
* @param
|
|
1723
|
-
* @param
|
|
1724
|
-
* @
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
owner: PublicKey,
|
|
1730
|
-
amount: number | bigint,
|
|
1731
|
-
multiSigners?: (Signer | PublicKey)[],
|
|
1732
|
-
programId?: PublicKey,
|
|
1733
|
-
): TransactionInstruction;
|
|
1734
|
-
|
|
1735
|
-
/**
|
|
1736
|
-
* SPL interface PDA info.
|
|
1737
|
-
*/
|
|
1738
|
-
type SplInterfaceInfo = {
|
|
1739
|
-
/**
|
|
1740
|
-
* The mint of the SPL interface
|
|
1741
|
-
*/
|
|
1742
|
-
mint: PublicKey;
|
|
1743
|
-
/**
|
|
1744
|
-
* The SPL interface address
|
|
1745
|
-
*/
|
|
1746
|
-
splInterfacePda: PublicKey;
|
|
1747
|
-
/**
|
|
1748
|
-
* The token program of the SPL interface
|
|
1749
|
-
*/
|
|
1750
|
-
tokenProgram: PublicKey;
|
|
1751
|
-
/**
|
|
1752
|
-
* count of txs and volume in the past 60 seconds.
|
|
1753
|
-
*/
|
|
1754
|
-
activity?: {
|
|
1755
|
-
txs: number;
|
|
1756
|
-
amountAdded: BN;
|
|
1757
|
-
amountRemoved: BN;
|
|
1758
|
-
};
|
|
1759
|
-
/**
|
|
1760
|
-
* Whether the SPL interface is initialized
|
|
1761
|
-
*/
|
|
1762
|
-
isInitialized: boolean;
|
|
1763
|
-
/**
|
|
1764
|
-
* The balance of the SPL interface
|
|
1765
|
-
*/
|
|
1766
|
-
balance: BN;
|
|
1767
|
-
/**
|
|
1768
|
-
* The index of the SPL interface
|
|
1769
|
-
*/
|
|
1770
|
-
poolIndex: number;
|
|
1771
|
-
/**
|
|
1772
|
-
* The bump used to derive the SPL interface PDA
|
|
1773
|
-
*/
|
|
1774
|
-
bump: number;
|
|
1775
|
-
};
|
|
1776
|
-
/**
|
|
1777
|
-
* @deprecated Use {@link SplInterfaceInfo} instead.
|
|
1778
|
-
* This type maintains backward compatibility by including both tokenPoolPda and splInterfacePda.
|
|
1779
|
-
* Both properties point to the same PublicKey value.
|
|
1780
|
-
*/
|
|
1781
|
-
type TokenPoolInfo = {
|
|
1782
|
-
/**
|
|
1783
|
-
* The mint of the SPL interface
|
|
1784
|
-
*/
|
|
1785
|
-
mint: PublicKey;
|
|
1786
|
-
/**
|
|
1787
|
-
* @deprecated Use splInterfacePda instead.
|
|
1788
|
-
*/
|
|
1789
|
-
tokenPoolPda: PublicKey;
|
|
1790
|
-
/**
|
|
1791
|
-
* The SPL interface address (new name).
|
|
1792
|
-
* For backward compatibility, tokenPoolPda is also available.
|
|
1793
|
-
*/
|
|
1794
|
-
splInterfacePda: PublicKey;
|
|
1795
|
-
/**
|
|
1796
|
-
* The token program of the SPL interface
|
|
1797
|
-
*/
|
|
1798
|
-
tokenProgram: PublicKey;
|
|
1799
|
-
/**
|
|
1800
|
-
* count of txs and volume in the past 60 seconds.
|
|
1801
|
-
*/
|
|
1802
|
-
activity?: {
|
|
1803
|
-
txs: number;
|
|
1804
|
-
amountAdded: BN;
|
|
1805
|
-
amountRemoved: BN;
|
|
1806
|
-
};
|
|
1807
|
-
/**
|
|
1808
|
-
* Whether the SPL interface is initialized
|
|
1809
|
-
*/
|
|
1810
|
-
isInitialized: boolean;
|
|
1811
|
-
/**
|
|
1812
|
-
* The balance of the SPL interface
|
|
1813
|
-
*/
|
|
1814
|
-
balance: BN;
|
|
1815
|
-
/**
|
|
1816
|
-
* The index of the SPL interface
|
|
1817
|
-
*/
|
|
1818
|
-
poolIndex: number;
|
|
1819
|
-
/**
|
|
1820
|
-
* The bump used to derive the SPL interface PDA
|
|
1821
|
-
*/
|
|
1822
|
-
bump: number;
|
|
1823
|
-
};
|
|
1612
|
+
* @param feePayer Fee payer public key.
|
|
1613
|
+
* @param owner Owner of the associated token account.
|
|
1614
|
+
* @param mint Mint address.
|
|
1615
|
+
* @param compressibleConfig Compressible configuration (defaults to rent sponsor config).
|
|
1616
|
+
* @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
|
|
1617
|
+
* @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
|
|
1618
|
+
*/
|
|
1619
|
+
declare function createAssociatedCTokenAccountIdempotentInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
|
|
1620
|
+
|
|
1824
1621
|
/**
|
|
1825
|
-
*
|
|
1826
|
-
* @internal
|
|
1622
|
+
* c-token-specific config for createAssociatedTokenAccountInterfaceInstruction
|
|
1827
1623
|
*/
|
|
1828
|
-
|
|
1624
|
+
interface CTokenConfig {
|
|
1625
|
+
compressibleConfig?: CompressibleConfig | null;
|
|
1626
|
+
configAccount?: PublicKey;
|
|
1627
|
+
rentPayerPda?: PublicKey;
|
|
1628
|
+
}
|
|
1829
1629
|
/**
|
|
1830
|
-
*
|
|
1831
|
-
*
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1834
|
-
* @param mint The mint of the SPL interface
|
|
1835
|
-
* @param tokenProgramId The token program (TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID)
|
|
1836
|
-
* @param poolIndex The pool index. Default 0.
|
|
1630
|
+
* Create instruction for creating an associated token account (SPL, Token-2022,
|
|
1631
|
+
* or c-token). Follows SPL Token API signature with optional c-token config at the
|
|
1632
|
+
* end.
|
|
1837
1633
|
*
|
|
1838
|
-
* @
|
|
1634
|
+
* @param payer Fee payer public key.
|
|
1635
|
+
* @param associatedToken Associated token account address.
|
|
1636
|
+
* @param owner Owner of the associated token account.
|
|
1637
|
+
* @param mint Mint address.
|
|
1638
|
+
* @param programId Token program ID (default: TOKEN_PROGRAM_ID).
|
|
1639
|
+
* @param associatedTokenProgramId Associated token program ID.
|
|
1640
|
+
* @param ctokenConfig Optional c-token-specific configuration.
|
|
1839
1641
|
*/
|
|
1840
|
-
declare function
|
|
1841
|
-
mint: PublicKey,
|
|
1842
|
-
tokenProgramId: PublicKey,
|
|
1843
|
-
poolIndex?: number,
|
|
1844
|
-
): SplInterfaceInfo;
|
|
1642
|
+
declare function createAssociatedTokenAccountInterfaceInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
|
|
1845
1643
|
/**
|
|
1846
|
-
*
|
|
1847
|
-
*
|
|
1848
|
-
*
|
|
1849
|
-
*
|
|
1644
|
+
* Create idempotent instruction for creating an associated token account (SPL,
|
|
1645
|
+
* Token-2022, or c-token). Follows SPL Token API signature with optional c-token
|
|
1646
|
+
* config at the end.
|
|
1647
|
+
*
|
|
1648
|
+
* @param payer Fee payer public key.
|
|
1649
|
+
* @param associatedToken Associated token account address.
|
|
1650
|
+
* @param owner Owner of the associated token account.
|
|
1651
|
+
* @param mint Mint address.
|
|
1652
|
+
* @param programId Token program ID (default: TOKEN_PROGRAM_ID).
|
|
1653
|
+
* @param associatedTokenProgramId Associated token program ID.
|
|
1654
|
+
* @param ctokenConfig Optional c-token-specific configuration.
|
|
1850
1655
|
*/
|
|
1851
|
-
declare function
|
|
1852
|
-
splInterfaceInfo: SplInterfaceInfo | TokenPoolInfo,
|
|
1853
|
-
mint: PublicKey,
|
|
1854
|
-
): boolean;
|
|
1656
|
+
declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
|
|
1855
1657
|
/**
|
|
1856
|
-
*
|
|
1857
|
-
* @param rpc The RPC client
|
|
1858
|
-
* @param mint The mint of the SPL interface
|
|
1859
|
-
* @param commitment The commitment to use
|
|
1860
|
-
*
|
|
1861
|
-
* @returns The SPL interface infos
|
|
1658
|
+
* Short alias for createAssociatedTokenAccountInterfaceIdempotentInstruction.
|
|
1862
1659
|
*/
|
|
1863
|
-
declare
|
|
1864
|
-
|
|
1865
|
-
mint: PublicKey,
|
|
1866
|
-
commitment?: Commitment,
|
|
1867
|
-
): Promise<SplInterfaceInfo[]>;
|
|
1868
|
-
type SplInterfaceActivity = {
|
|
1869
|
-
signature: string;
|
|
1870
|
-
amount: BN;
|
|
1871
|
-
action: Action;
|
|
1872
|
-
};
|
|
1660
|
+
declare const createAtaInterfaceIdempotentInstruction: typeof createAssociatedTokenAccountInterfaceIdempotentInstruction;
|
|
1661
|
+
|
|
1873
1662
|
/**
|
|
1874
|
-
*
|
|
1663
|
+
* Parameters for creating a MintTo instruction.
|
|
1875
1664
|
*/
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1665
|
+
interface CreateMintToInstructionParams {
|
|
1666
|
+
/** Mint account (CMint - decompressed compressed mint) */
|
|
1667
|
+
mint: PublicKey;
|
|
1668
|
+
/** Destination CToken account to mint to */
|
|
1669
|
+
destination: PublicKey;
|
|
1670
|
+
/** Amount of tokens to mint */
|
|
1671
|
+
amount: number | bigint;
|
|
1672
|
+
/** Mint authority (must be signer) */
|
|
1673
|
+
authority: PublicKey;
|
|
1674
|
+
/** Maximum lamports for rent and top-up combined. Transaction fails if exceeded. (0 = no limit) */
|
|
1675
|
+
maxTopUp?: number;
|
|
1676
|
+
/** Optional fee payer for rent top-ups. If not provided, authority pays. */
|
|
1677
|
+
feePayer?: PublicKey;
|
|
1880
1678
|
}
|
|
1881
1679
|
/**
|
|
1882
|
-
*
|
|
1883
|
-
* Select a random SPL interface info from the SPL interface infos.
|
|
1884
|
-
*
|
|
1885
|
-
* For `decompress`, use {@link selectSplInterfaceInfosForDecompression} instead.
|
|
1680
|
+
* Create instruction for minting tokens to a CToken account.
|
|
1886
1681
|
*
|
|
1887
|
-
*
|
|
1682
|
+
* This is a simple 3-4 account instruction for minting to decompressed CToken accounts.
|
|
1683
|
+
* Uses discriminator 7 (CTokenMintTo).
|
|
1888
1684
|
*
|
|
1889
|
-
* @
|
|
1685
|
+
* @param params - Mint instruction parameters
|
|
1686
|
+
* @returns TransactionInstruction for minting tokens
|
|
1890
1687
|
*/
|
|
1891
|
-
declare function
|
|
1892
|
-
|
|
1893
|
-
)
|
|
1688
|
+
declare function createMintToInstruction(params: CreateMintToInstructionParams): TransactionInstruction;
|
|
1689
|
+
|
|
1690
|
+
/** Default compressible config PDA (V1) */
|
|
1691
|
+
declare const LIGHT_TOKEN_CONFIG: PublicKey;
|
|
1692
|
+
/** Default rent sponsor PDA (V1) */
|
|
1693
|
+
declare const LIGHT_TOKEN_RENT_SPONSOR: PublicKey;
|
|
1894
1694
|
/**
|
|
1895
|
-
*
|
|
1896
|
-
*
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1695
|
+
* Token data version enum - mirrors Rust TokenDataVersion
|
|
1696
|
+
* Used for compressed token account hashing strategy
|
|
1697
|
+
*/
|
|
1698
|
+
declare enum TokenDataVersion {
|
|
1699
|
+
/** V1: Poseidon hash with little-endian amount, discriminator [2,0,0,0,0,0,0,0] */
|
|
1700
|
+
V1 = 1,
|
|
1701
|
+
/** V2: Poseidon hash with big-endian amount, discriminator [0,0,0,0,0,0,0,3] */
|
|
1702
|
+
V2 = 2,
|
|
1703
|
+
/** ShaFlat: SHA256 hash of borsh-serialized data, discriminator [0,0,0,0,0,0,0,4] */
|
|
1704
|
+
ShaFlat = 3
|
|
1705
|
+
}
|
|
1706
|
+
declare const POOL_SEED: Buffer$1<ArrayBuffer>;
|
|
1707
|
+
declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
|
|
1708
|
+
declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
|
|
1709
|
+
declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1710
|
+
declare const MINT_TO_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1711
|
+
declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1712
|
+
declare const TRANSFER_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1713
|
+
declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1714
|
+
declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1715
|
+
declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1716
|
+
declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1717
|
+
declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
1718
|
+
/**
|
|
1719
|
+
* Rent configuration constants for compressible ctoken accounts.
|
|
1720
|
+
* These match the Rust SDK defaults in program-libs/compressible/src/rent/config.rs
|
|
1905
1721
|
*/
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1722
|
+
/** Base rent per epoch (lamports) */
|
|
1723
|
+
declare const BASE_RENT_PER_EPOCH = 128;
|
|
1724
|
+
/** Rent per byte per epoch (lamports) */
|
|
1725
|
+
declare const RENT_PER_BYTE_PER_EPOCH = 1;
|
|
1726
|
+
/** Slots per rent epoch (1.5 hours) */
|
|
1727
|
+
declare const SLOTS_PER_RENT_EPOCH = 13500;
|
|
1728
|
+
/** Compression cost (lamports) - paid at account creation */
|
|
1729
|
+
declare const COMPRESSION_COST = 10000;
|
|
1730
|
+
/** Compression incentive (lamports) - paid at account creation */
|
|
1731
|
+
declare const COMPRESSION_INCENTIVE = 1000;
|
|
1732
|
+
/** Total compression cost (COMPRESSION_COST + COMPRESSION_INCENTIVE) */
|
|
1733
|
+
declare const TOTAL_COMPRESSION_COST: number;
|
|
1910
1734
|
/**
|
|
1911
|
-
*
|
|
1735
|
+
* Compressible ctoken account size in bytes.
|
|
1736
|
+
* = 165 (base SPL token) + 1 (account_type) + 1 (Option) + 4 (Vec len) + 1 (ext disc) + 4 (ext header) + 96 (CompressionInfo) = 272
|
|
1737
|
+
* Source: program-libs/token-interface/src/state/token/top_up.rs MIN_SIZE_WITH_COMPRESSIBLE
|
|
1912
1738
|
*/
|
|
1913
|
-
|
|
1739
|
+
declare const COMPRESSIBLE_CTOKEN_ACCOUNT_SIZE = 272;
|
|
1914
1740
|
/**
|
|
1915
|
-
*
|
|
1741
|
+
* Calculate rent per epoch for a given account size.
|
|
1742
|
+
* Formula: base_rent + (bytes * lamports_per_byte_per_epoch)
|
|
1916
1743
|
*/
|
|
1917
|
-
declare function
|
|
1918
|
-
mint: PublicKey,
|
|
1919
|
-
tokenProgramId: PublicKey,
|
|
1920
|
-
poolIndex?: number,
|
|
1921
|
-
): TokenPoolInfo;
|
|
1744
|
+
declare function rentPerEpoch(bytes: number): number;
|
|
1922
1745
|
/**
|
|
1923
|
-
*
|
|
1746
|
+
* Default rent per epoch for a compressible ctoken account (272 bytes).
|
|
1747
|
+
* = 128 + 272 = 400 lamports
|
|
1924
1748
|
*/
|
|
1925
|
-
declare
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
)
|
|
1749
|
+
declare const COMPRESSIBLE_CTOKEN_RENT_PER_EPOCH: number;
|
|
1750
|
+
/** Default prepaid epochs (24 hours = 16 epochs * 1.5h) */
|
|
1751
|
+
declare const DEFAULT_PREPAY_EPOCHS = 16;
|
|
1752
|
+
/** Default write top-up (lamports) - ~2 epochs rent */
|
|
1753
|
+
declare const DEFAULT_WRITE_TOP_UP = 766;
|
|
1929
1754
|
/**
|
|
1930
|
-
*
|
|
1755
|
+
* Calculate fee payer cost at ATA creation.
|
|
1756
|
+
* = compression_cost (11K) + (prepay_epochs * rent_per_epoch)
|
|
1931
1757
|
*/
|
|
1932
|
-
declare function
|
|
1933
|
-
|
|
1934
|
-
mint: PublicKey,
|
|
1935
|
-
commitment?: Commitment,
|
|
1936
|
-
): Promise<TokenPoolInfo[]>;
|
|
1758
|
+
declare function calculateFeePayerCostAtCreation(prepayEpochs?: number, accountBytes?: number): number;
|
|
1759
|
+
|
|
1937
1760
|
/**
|
|
1938
|
-
*
|
|
1761
|
+
* Create instruction for minting tokens from a c-mint to compressed accounts.
|
|
1762
|
+
* To mint to onchain token accounts across SPL/T22/c-mints, use
|
|
1763
|
+
* {@link createMintToInterfaceInstruction} instead.
|
|
1764
|
+
*
|
|
1765
|
+
* @param authority Mint authority public key.
|
|
1766
|
+
* @param payer Fee payer public key.
|
|
1767
|
+
* @param validityProof Validity proof for the compressed mint.
|
|
1768
|
+
* @param merkleContext Merkle context of the compressed mint.
|
|
1769
|
+
* @param mintData Mint instruction data.
|
|
1770
|
+
* @param recipients Array of recipients with amounts.
|
|
1771
|
+
* @param outputStateTreeInfo Optional output state tree info. Uses merkle
|
|
1772
|
+
* context queue if not provided.
|
|
1773
|
+
* @param tokenAccountVersion Token account version (default:
|
|
1774
|
+
* TokenDataVersion.ShaFlat).
|
|
1939
1775
|
*/
|
|
1940
|
-
declare function
|
|
1776
|
+
declare function createMintToCompressedInstruction(authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, merkleContext: MerkleContext, mintData: MintInstructionData, recipients: Array<{
|
|
1777
|
+
recipient: PublicKey;
|
|
1778
|
+
amount: number | bigint;
|
|
1779
|
+
}>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: TokenDataVersion): TransactionInstruction;
|
|
1780
|
+
|
|
1941
1781
|
/**
|
|
1942
|
-
*
|
|
1782
|
+
* Create mint-to instruction for SPL, Token-2022, or CToken mints.
|
|
1783
|
+
* This instruction ONLY mints to decompressed/onchain token accounts.
|
|
1784
|
+
*
|
|
1785
|
+
* For CToken mints, the mint must be decompressed first (CMint account must exist on-chain).
|
|
1786
|
+
*
|
|
1787
|
+
* @param mintInterface Mint interface (SPL, Token-2022, or CToken).
|
|
1788
|
+
* @param destination Destination onchain token account address.
|
|
1789
|
+
* @param authority Mint authority public key.
|
|
1790
|
+
* @param payer Fee payer public key.
|
|
1791
|
+
* @param amount Amount to mint.
|
|
1792
|
+
* @param validityProof Not used (legacy parameter, kept for compatibility).
|
|
1793
|
+
* @param multiSigners Multi-signature signer public keys (SPL/T22 only).
|
|
1794
|
+
*/
|
|
1795
|
+
declare function createMintToInterfaceInstruction(mintInterface: MintInterface, destination: PublicKey, authority: PublicKey, payer: PublicKey, amount: number | bigint, validityProof?: ValidityProofWithContext, multiSigners?: PublicKey[]): TransactionInstruction;
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* Create a Light token transfer instruction.
|
|
1799
|
+
*
|
|
1800
|
+
* For c-token accounts with compressible extension, the program needs
|
|
1801
|
+
* system_program and fee_payer to handle rent top-ups.
|
|
1802
|
+
*
|
|
1803
|
+
* @param source Source c-token account
|
|
1804
|
+
* @param destination Destination c-token account
|
|
1805
|
+
* @param owner Owner of the source account (signer, also pays for compressible extension top-ups)
|
|
1806
|
+
* @param amount Amount to transfer
|
|
1807
|
+
* @param feePayer Optional fee payer for top-ups (defaults to owner)
|
|
1808
|
+
* @returns Transaction instruction for Light token transfer
|
|
1943
1809
|
*/
|
|
1944
|
-
declare function
|
|
1945
|
-
infos: TokenPoolInfo[],
|
|
1946
|
-
decompressAmount: number | BN,
|
|
1947
|
-
): TokenPoolInfo[];
|
|
1810
|
+
declare function createLightTokenTransferInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
|
|
1948
1811
|
|
|
1949
1812
|
/**
|
|
1950
1813
|
* Create decompressInterface instruction using Transfer2.
|
|
@@ -1962,23 +1825,7 @@ declare function selectTokenPoolInfosForDecompression(
|
|
|
1962
1825
|
* @param decimals Mint decimals (required for SPL destinations)
|
|
1963
1826
|
* @returns TransactionInstruction
|
|
1964
1827
|
*/
|
|
1965
|
-
declare function createDecompressInterfaceInstruction(
|
|
1966
|
-
payer: PublicKey,
|
|
1967
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
1968
|
-
toAddress: PublicKey,
|
|
1969
|
-
amount: bigint,
|
|
1970
|
-
validityProof: ValidityProofWithContext,
|
|
1971
|
-
splInterfaceInfo: SplInterfaceInfo | undefined,
|
|
1972
|
-
decimals: number,
|
|
1973
|
-
): TransactionInstruction;
|
|
1974
|
-
|
|
1975
|
-
/**
|
|
1976
|
-
* Options for interface operations (load, transfer)
|
|
1977
|
-
*/
|
|
1978
|
-
interface InterfaceOptions {
|
|
1979
|
-
/** SPL interface infos (fetched if not provided) */
|
|
1980
|
-
splInterfaceInfos?: SplInterfaceInfo[];
|
|
1981
|
-
}
|
|
1828
|
+
declare function createDecompressInterfaceInstruction(payer: PublicKey, inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: bigint, validityProof: ValidityProofWithContext, splInterfaceInfo: SplInterfaceInfo | undefined, decimals: number): TransactionInstruction;
|
|
1982
1829
|
|
|
1983
1830
|
/**
|
|
1984
1831
|
* Account info interface for compressible accounts.
|
|
@@ -2070,7 +1917,7 @@ interface LoadResult {
|
|
|
2070
1917
|
* ```typescript
|
|
2071
1918
|
* const poolInfo = await myProgram.fetchPoolState(rpc, poolAddress);
|
|
2072
1919
|
* const vault0Ata = getAssociatedTokenAddressInterface(token0Mint, poolAddress);
|
|
2073
|
-
* const vault0Info = await getAtaInterface(rpc, vault0Ata, poolAddress, token0Mint, undefined,
|
|
1920
|
+
* const vault0Info = await getAtaInterface(rpc, vault0Ata, poolAddress, token0Mint, undefined, LIGHT_TOKEN_PROGRAM_ID);
|
|
2074
1921
|
* const userAta = getAssociatedTokenAddressInterface(tokenMint, userWallet);
|
|
2075
1922
|
* const userAtaInfo = await getAtaInterface(rpc, userAta, userWallet, tokenMint);
|
|
2076
1923
|
*
|
|
@@ -2099,21 +1946,11 @@ interface LoadResult {
|
|
|
2099
1946
|
* }
|
|
2100
1947
|
* ```
|
|
2101
1948
|
*/
|
|
2102
|
-
declare function createLoadAccountsParams(
|
|
2103
|
-
rpc: Rpc,
|
|
2104
|
-
payer: PublicKey,
|
|
2105
|
-
programId: PublicKey,
|
|
2106
|
-
programAccounts?: CompressibleAccountInput[],
|
|
2107
|
-
atas?: AccountInterface[],
|
|
2108
|
-
options?: InterfaceOptions,
|
|
2109
|
-
): Promise<LoadResult>;
|
|
1949
|
+
declare function createLoadAccountsParams(rpc: Rpc, payer: PublicKey, programId: PublicKey, programAccounts?: CompressibleAccountInput[], atas?: AccountInterface[], options?: InterfaceOptions): Promise<LoadResult>;
|
|
2110
1950
|
/**
|
|
2111
1951
|
* Calculate compute units for compressible load operation
|
|
2112
1952
|
*/
|
|
2113
|
-
declare function calculateCompressibleLoadComputeUnits(
|
|
2114
|
-
compressedAccountCount: number,
|
|
2115
|
-
hasValidityProof: boolean,
|
|
2116
|
-
): number;
|
|
1953
|
+
declare function calculateCompressibleLoadComputeUnits(compressedAccountCount: number, hasValidityProof: boolean): number;
|
|
2117
1954
|
|
|
2118
1955
|
/**
|
|
2119
1956
|
* Create a wrap instruction that moves tokens from an SPL/T22 account to a
|
|
@@ -2129,16 +1966,7 @@ declare function calculateCompressibleLoadComputeUnits(
|
|
|
2129
1966
|
* @param payer Fee payer (defaults to owner)
|
|
2130
1967
|
* @returns Instruction to wrap tokens
|
|
2131
1968
|
*/
|
|
2132
|
-
declare function createWrapInstruction(
|
|
2133
|
-
source: PublicKey,
|
|
2134
|
-
destination: PublicKey,
|
|
2135
|
-
owner: PublicKey,
|
|
2136
|
-
mint: PublicKey,
|
|
2137
|
-
amount: bigint,
|
|
2138
|
-
splInterfaceInfo: SplInterfaceInfo,
|
|
2139
|
-
decimals: number,
|
|
2140
|
-
payer?: PublicKey,
|
|
2141
|
-
): TransactionInstruction;
|
|
1969
|
+
declare function createWrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
|
|
2142
1970
|
|
|
2143
1971
|
/**
|
|
2144
1972
|
* Create an unwrap instruction that moves tokens from a c-token account to an
|
|
@@ -2154,16 +1982,7 @@ declare function createWrapInstruction(
|
|
|
2154
1982
|
* @param payer Fee payer (defaults to owner if not provided)
|
|
2155
1983
|
* @returns TransactionInstruction to unwrap tokens
|
|
2156
1984
|
*/
|
|
2157
|
-
declare function createUnwrapInstruction(
|
|
2158
|
-
source: PublicKey,
|
|
2159
|
-
destination: PublicKey,
|
|
2160
|
-
owner: PublicKey,
|
|
2161
|
-
mint: PublicKey,
|
|
2162
|
-
amount: bigint,
|
|
2163
|
-
splInterfaceInfo: SplInterfaceInfo,
|
|
2164
|
-
decimals: number,
|
|
2165
|
-
payer?: PublicKey,
|
|
2166
|
-
): TransactionInstruction;
|
|
1985
|
+
declare function createUnwrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
|
|
2167
1986
|
|
|
2168
1987
|
/**
|
|
2169
1988
|
* Create and initialize a new mint for SPL/T22/c-token.
|
|
@@ -2175,32 +1994,21 @@ declare function createUnwrapInstruction(
|
|
|
2175
1994
|
* @param decimals Location of the decimal place
|
|
2176
1995
|
* @param keypair Mint keypair (defaults to a random keypair)
|
|
2177
1996
|
* @param confirmOptions Confirm options
|
|
2178
|
-
* @param programId Token program ID (defaults to
|
|
1997
|
+
* @param programId Token program ID (defaults to LIGHT_TOKEN_PROGRAM_ID)
|
|
2179
1998
|
* @param tokenMetadata Optional token metadata (c-token mints only)
|
|
2180
1999
|
* @param outputStateTreeInfo Optional output state tree info (c-token mints only)
|
|
2181
2000
|
* @param addressTreeInfo Optional address tree info (c-token mints only)
|
|
2182
2001
|
*
|
|
2183
2002
|
* @returns Object with mint address and transaction signature
|
|
2184
2003
|
*/
|
|
2185
|
-
declare function createMintInterface(
|
|
2186
|
-
rpc: Rpc,
|
|
2187
|
-
payer: Signer,
|
|
2188
|
-
mintAuthority: PublicKey | Signer,
|
|
2189
|
-
freezeAuthority: PublicKey | Signer | null,
|
|
2190
|
-
decimals: number,
|
|
2191
|
-
keypair?: Keypair,
|
|
2192
|
-
confirmOptions?: ConfirmOptions,
|
|
2193
|
-
programId?: PublicKey,
|
|
2194
|
-
tokenMetadata?: TokenMetadataInstructionData,
|
|
2195
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2196
|
-
addressTreeInfo?: AddressTreeInfo,
|
|
2197
|
-
): Promise<{
|
|
2004
|
+
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<{
|
|
2198
2005
|
mint: PublicKey;
|
|
2199
2006
|
transactionSignature: TransactionSignature;
|
|
2200
2007
|
}>;
|
|
2201
2008
|
|
|
2202
2009
|
/**
|
|
2203
2010
|
* Update the mint authority of a compressed token mint.
|
|
2011
|
+
* Works for both compressed and decompressed mints.
|
|
2204
2012
|
*
|
|
2205
2013
|
* @param rpc RPC connection
|
|
2206
2014
|
* @param payer Fee payer (signer)
|
|
@@ -2209,16 +2017,10 @@ declare function createMintInterface(
|
|
|
2209
2017
|
* @param newMintAuthority New mint authority (or null to revoke)
|
|
2210
2018
|
* @param confirmOptions Optional confirm options
|
|
2211
2019
|
*/
|
|
2212
|
-
declare function updateMintAuthority(
|
|
2213
|
-
rpc: Rpc,
|
|
2214
|
-
payer: Signer,
|
|
2215
|
-
mint: PublicKey,
|
|
2216
|
-
currentMintAuthority: Signer,
|
|
2217
|
-
newMintAuthority: PublicKey | null,
|
|
2218
|
-
confirmOptions?: ConfirmOptions,
|
|
2219
|
-
): Promise<TransactionSignature>;
|
|
2020
|
+
declare function updateMintAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentMintAuthority: Signer, newMintAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2220
2021
|
/**
|
|
2221
2022
|
* Update the freeze authority of a compressed token mint.
|
|
2023
|
+
* Works for both compressed and decompressed mints.
|
|
2222
2024
|
*
|
|
2223
2025
|
* @param rpc RPC connection
|
|
2224
2026
|
* @param payer Fee payer (signer)
|
|
@@ -2227,17 +2029,11 @@ declare function updateMintAuthority(
|
|
|
2227
2029
|
* @param newFreezeAuthority New freeze authority (or null to revoke)
|
|
2228
2030
|
* @param confirmOptions Optional confirm options
|
|
2229
2031
|
*/
|
|
2230
|
-
declare function updateFreezeAuthority(
|
|
2231
|
-
rpc: Rpc,
|
|
2232
|
-
payer: Signer,
|
|
2233
|
-
mint: PublicKey,
|
|
2234
|
-
currentFreezeAuthority: Signer,
|
|
2235
|
-
newFreezeAuthority: PublicKey | null,
|
|
2236
|
-
confirmOptions?: ConfirmOptions,
|
|
2237
|
-
): Promise<TransactionSignature>;
|
|
2032
|
+
declare function updateFreezeAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentFreezeAuthority: Signer, newFreezeAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2238
2033
|
|
|
2239
2034
|
/**
|
|
2240
2035
|
* Update a metadata field on a compressed token mint.
|
|
2036
|
+
* Works for both compressed and decompressed mints.
|
|
2241
2037
|
*
|
|
2242
2038
|
* @param rpc RPC connection
|
|
2243
2039
|
* @param payer Fee payer (signer)
|
|
@@ -2249,19 +2045,10 @@ declare function updateFreezeAuthority(
|
|
|
2249
2045
|
* @param extensionIndex Extension index (default: 0)
|
|
2250
2046
|
* @param confirmOptions Optional confirm options
|
|
2251
2047
|
*/
|
|
2252
|
-
declare function updateMetadataField(
|
|
2253
|
-
rpc: Rpc,
|
|
2254
|
-
payer: Signer,
|
|
2255
|
-
mint: PublicKey,
|
|
2256
|
-
authority: Signer,
|
|
2257
|
-
fieldType: 'name' | 'symbol' | 'uri' | 'custom',
|
|
2258
|
-
value: string,
|
|
2259
|
-
customKey?: string,
|
|
2260
|
-
extensionIndex?: number,
|
|
2261
|
-
confirmOptions?: ConfirmOptions,
|
|
2262
|
-
): Promise<TransactionSignature>;
|
|
2048
|
+
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>;
|
|
2263
2049
|
/**
|
|
2264
2050
|
* Update the metadata authority of a compressed token mint.
|
|
2051
|
+
* Works for both compressed and decompressed mints.
|
|
2265
2052
|
*
|
|
2266
2053
|
* @param rpc RPC connection
|
|
2267
2054
|
* @param payer Fee payer (signer)
|
|
@@ -2271,17 +2058,10 @@ declare function updateMetadataField(
|
|
|
2271
2058
|
* @param extensionIndex Extension index (default: 0)
|
|
2272
2059
|
* @param confirmOptions Optional confirm options
|
|
2273
2060
|
*/
|
|
2274
|
-
declare function updateMetadataAuthority(
|
|
2275
|
-
rpc: Rpc,
|
|
2276
|
-
payer: Signer,
|
|
2277
|
-
mint: PublicKey,
|
|
2278
|
-
currentAuthority: Signer,
|
|
2279
|
-
newAuthority: PublicKey,
|
|
2280
|
-
extensionIndex?: number,
|
|
2281
|
-
confirmOptions?: ConfirmOptions,
|
|
2282
|
-
): Promise<TransactionSignature>;
|
|
2061
|
+
declare function updateMetadataAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentAuthority: Signer, newAuthority: PublicKey, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2283
2062
|
/**
|
|
2284
2063
|
* Remove a metadata key from a compressed token mint.
|
|
2064
|
+
* Works for both compressed and decompressed mints.
|
|
2285
2065
|
*
|
|
2286
2066
|
* @param rpc RPC connection
|
|
2287
2067
|
* @param payer Fee payer (signer)
|
|
@@ -2292,16 +2072,7 @@ declare function updateMetadataAuthority(
|
|
|
2292
2072
|
* @param extensionIndex Extension index (default: 0)
|
|
2293
2073
|
* @param confirmOptions Optional confirm options
|
|
2294
2074
|
*/
|
|
2295
|
-
declare function removeMetadataKey(
|
|
2296
|
-
rpc: Rpc,
|
|
2297
|
-
payer: Signer,
|
|
2298
|
-
mint: PublicKey,
|
|
2299
|
-
authority: Signer,
|
|
2300
|
-
key: string,
|
|
2301
|
-
idempotent?: boolean,
|
|
2302
|
-
extensionIndex?: number,
|
|
2303
|
-
confirmOptions?: ConfirmOptions,
|
|
2304
|
-
): Promise<TransactionSignature>;
|
|
2075
|
+
declare function removeMetadataKey(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, key: string, idempotent?: boolean, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2305
2076
|
|
|
2306
2077
|
/**
|
|
2307
2078
|
* Create an associated token account for SPL/T22/c-token. Defaults to c-token
|
|
@@ -2314,23 +2085,13 @@ declare function removeMetadataKey(
|
|
|
2314
2085
|
* @param allowOwnerOffCurve Allow owner to be a PDA (default: false)
|
|
2315
2086
|
* @param confirmOptions Options for confirming the transaction
|
|
2316
2087
|
* @param programId Token program ID (default:
|
|
2317
|
-
*
|
|
2088
|
+
* LIGHT_TOKEN_PROGRAM_ID)
|
|
2318
2089
|
* @param associatedTokenProgramId ATA program ID (auto-derived if not
|
|
2319
2090
|
* provided)
|
|
2320
2091
|
* @param ctokenConfig Optional rent config
|
|
2321
2092
|
* @returns Address of the new associated token account
|
|
2322
2093
|
*/
|
|
2323
|
-
declare function createAtaInterface(
|
|
2324
|
-
rpc: Rpc,
|
|
2325
|
-
payer: Signer,
|
|
2326
|
-
mint: PublicKey,
|
|
2327
|
-
owner: PublicKey,
|
|
2328
|
-
allowOwnerOffCurve?: boolean,
|
|
2329
|
-
confirmOptions?: ConfirmOptions,
|
|
2330
|
-
programId?: PublicKey,
|
|
2331
|
-
associatedTokenProgramId?: PublicKey,
|
|
2332
|
-
ctokenConfig?: CTokenConfig,
|
|
2333
|
-
): Promise<PublicKey>;
|
|
2094
|
+
declare function createAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
|
|
2334
2095
|
/**
|
|
2335
2096
|
* Create an associated token account idempotently for SPL/T22/c-token. Defaults
|
|
2336
2097
|
* to c-token program.
|
|
@@ -2344,35 +2105,32 @@ declare function createAtaInterface(
|
|
|
2344
2105
|
* @param allowOwnerOffCurve Allow owner to be a PDA (default: false)
|
|
2345
2106
|
* @param confirmOptions Options for confirming the transaction
|
|
2346
2107
|
* @param programId Token program ID (default:
|
|
2347
|
-
*
|
|
2108
|
+
* LIGHT_TOKEN_PROGRAM_ID)
|
|
2348
2109
|
* @param associatedTokenProgramId ATA program ID (auto-derived if not
|
|
2349
2110
|
* provided)
|
|
2350
2111
|
* @param ctokenConfig Optional c-token-specific configuration
|
|
2351
2112
|
*
|
|
2352
2113
|
* @returns Address of the associated token account
|
|
2353
2114
|
*/
|
|
2354
|
-
declare function createAtaInterfaceIdempotent(
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
)
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
outputQueue?: PublicKey,
|
|
2374
|
-
confirmOptions?: ConfirmOptions,
|
|
2375
|
-
): Promise<TransactionSignature>;
|
|
2115
|
+
declare function createAtaInterfaceIdempotent(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
|
|
2116
|
+
|
|
2117
|
+
/**
|
|
2118
|
+
* Mint tokens to a CToken account.
|
|
2119
|
+
*
|
|
2120
|
+
* This is a simple mint instruction for minting to decompressed CToken accounts.
|
|
2121
|
+
* The mint must be decompressed (CMint account must exist on-chain).
|
|
2122
|
+
*
|
|
2123
|
+
* @param rpc - RPC connection
|
|
2124
|
+
* @param payer - Fee payer (signer)
|
|
2125
|
+
* @param mint - Mint address (CMint account)
|
|
2126
|
+
* @param destination - Destination CToken account
|
|
2127
|
+
* @param authority - Mint authority (signer)
|
|
2128
|
+
* @param amount - Amount to mint
|
|
2129
|
+
* @param maxTopUp - Optional maximum lamports for rent top-up
|
|
2130
|
+
* @param confirmOptions - Optional confirm options
|
|
2131
|
+
* @returns Transaction signature
|
|
2132
|
+
*/
|
|
2133
|
+
declare function mintTo$1(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer, amount: number | bigint, maxTopUp?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2376
2134
|
|
|
2377
2135
|
/**
|
|
2378
2136
|
* Mint compressed tokens directly to compressed accounts.
|
|
@@ -2386,50 +2144,33 @@ declare function mintTo$1(
|
|
|
2386
2144
|
* @param tokenAccountVersion Token account version (default: 3)
|
|
2387
2145
|
* @param confirmOptions Optional confirm options
|
|
2388
2146
|
*/
|
|
2389
|
-
declare function mintToCompressed(
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
authority: Signer,
|
|
2394
|
-
recipients: Array<{
|
|
2395
|
-
recipient: PublicKey;
|
|
2396
|
-
amount: number | bigint;
|
|
2397
|
-
}>,
|
|
2398
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2399
|
-
tokenAccountVersion?: number,
|
|
2400
|
-
confirmOptions?: ConfirmOptions,
|
|
2401
|
-
): Promise<TransactionSignature>;
|
|
2147
|
+
declare function mintToCompressed(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, recipients: Array<{
|
|
2148
|
+
recipient: PublicKey;
|
|
2149
|
+
amount: number | bigint;
|
|
2150
|
+
}>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2402
2151
|
|
|
2403
2152
|
/**
|
|
2404
2153
|
* Mint tokens to a decompressed/onchain token account.
|
|
2405
|
-
* Works with SPL, Token-2022, and
|
|
2154
|
+
* Works with SPL, Token-2022, and CToken mints.
|
|
2406
2155
|
*
|
|
2407
2156
|
* This function ONLY mints to decompressed onchain token accounts, never to compressed accounts.
|
|
2157
|
+
* For CToken mints, the mint must be decompressed first (CMint account must exist on-chain).
|
|
2158
|
+
*
|
|
2408
2159
|
* The signature matches the standard SPL mintTo for simplicity and consistency.
|
|
2409
2160
|
*
|
|
2410
2161
|
* @param rpc - RPC connection to use
|
|
2411
2162
|
* @param payer - Transaction fee payer
|
|
2412
|
-
* @param mint - Mint address (SPL, Token-2022, or
|
|
2163
|
+
* @param mint - Mint address (SPL, Token-2022, or CToken mint)
|
|
2413
2164
|
* @param destination - Destination token account address (must be an existing onchain token account)
|
|
2414
2165
|
* @param authority - Mint authority (can be Signer or PublicKey if multiSigners provided)
|
|
2415
2166
|
* @param amount - Amount to mint
|
|
2416
2167
|
* @param multiSigners - Optional: Multi-signature signers (default: [])
|
|
2417
2168
|
* @param confirmOptions - Optional: Transaction confirmation options
|
|
2418
|
-
* @param programId - Optional: Token program ID
|
|
2169
|
+
* @param programId - Optional: Token program ID. If undefined, auto-detects.
|
|
2419
2170
|
*
|
|
2420
2171
|
* @returns Transaction signature
|
|
2421
2172
|
*/
|
|
2422
|
-
declare function mintToInterface(
|
|
2423
|
-
rpc: Rpc,
|
|
2424
|
-
payer: Signer,
|
|
2425
|
-
mint: PublicKey,
|
|
2426
|
-
destination: PublicKey,
|
|
2427
|
-
authority: Signer | PublicKey,
|
|
2428
|
-
amount: number | bigint,
|
|
2429
|
-
multiSigners?: Signer[],
|
|
2430
|
-
confirmOptions?: ConfirmOptions,
|
|
2431
|
-
programId?: PublicKey,
|
|
2432
|
-
): Promise<TransactionSignature>;
|
|
2173
|
+
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>;
|
|
2433
2174
|
|
|
2434
2175
|
/**
|
|
2435
2176
|
* Decompress compressed (cold) tokens to an on-chain token account.
|
|
@@ -2447,17 +2188,7 @@ declare function mintToInterface(
|
|
|
2447
2188
|
* @param confirmOptions Confirm options
|
|
2448
2189
|
* @returns Transaction signature, null if nothing to load.
|
|
2449
2190
|
*/
|
|
2450
|
-
declare function decompressInterface(
|
|
2451
|
-
rpc: Rpc,
|
|
2452
|
-
payer: Signer,
|
|
2453
|
-
owner: Signer,
|
|
2454
|
-
mint: PublicKey,
|
|
2455
|
-
amount?: number | bigint | BN,
|
|
2456
|
-
destinationAta?: PublicKey,
|
|
2457
|
-
destinationOwner?: PublicKey,
|
|
2458
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2459
|
-
confirmOptions?: ConfirmOptions,
|
|
2460
|
-
): Promise<TransactionSignature | null>;
|
|
2191
|
+
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>;
|
|
2461
2192
|
|
|
2462
2193
|
/**
|
|
2463
2194
|
* Wrap tokens from an SPL/T22 account to a c-token account.
|
|
@@ -2491,42 +2222,7 @@ declare function decompressInterface(
|
|
|
2491
2222
|
*
|
|
2492
2223
|
* @returns Transaction signature
|
|
2493
2224
|
*/
|
|
2494
|
-
declare function wrap(
|
|
2495
|
-
rpc: Rpc,
|
|
2496
|
-
payer: Signer,
|
|
2497
|
-
source: PublicKey,
|
|
2498
|
-
destination: PublicKey,
|
|
2499
|
-
owner: Signer,
|
|
2500
|
-
mint: PublicKey,
|
|
2501
|
-
amount: bigint,
|
|
2502
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2503
|
-
confirmOptions?: ConfirmOptions,
|
|
2504
|
-
): Promise<TransactionSignature>;
|
|
2505
|
-
|
|
2506
|
-
/**
|
|
2507
|
-
* Unwrap c-tokens to SPL tokens.
|
|
2508
|
-
*
|
|
2509
|
-
* @param rpc RPC connection
|
|
2510
|
-
* @param payer Fee payer
|
|
2511
|
-
* @param destination Destination SPL/T22 token account
|
|
2512
|
-
* @param owner Owner of the c-token (signer)
|
|
2513
|
-
* @param mint Mint address
|
|
2514
|
-
* @param amount Amount to unwrap (defaults to all)
|
|
2515
|
-
* @param splInterfaceInfo SPL interface info
|
|
2516
|
-
* @param confirmOptions Confirm options
|
|
2517
|
-
*
|
|
2518
|
-
* @returns Transaction signature
|
|
2519
|
-
*/
|
|
2520
|
-
declare function unwrap(
|
|
2521
|
-
rpc: Rpc,
|
|
2522
|
-
payer: Signer,
|
|
2523
|
-
destination: PublicKey,
|
|
2524
|
-
owner: Signer,
|
|
2525
|
-
mint: PublicKey,
|
|
2526
|
-
amount?: number | bigint | BN,
|
|
2527
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2528
|
-
confirmOptions?: ConfirmOptions,
|
|
2529
|
-
): Promise<TransactionSignature>;
|
|
2225
|
+
declare function wrap(rpc: Rpc, payer: Signer, source: PublicKey, destination: PublicKey, owner: Signer, mint: PublicKey, amount: bigint, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2530
2226
|
|
|
2531
2227
|
/**
|
|
2532
2228
|
* Create instructions to load an ATA from its AccountInterface.
|
|
@@ -2544,14 +2240,7 @@ declare function unwrap(
|
|
|
2544
2240
|
* @param targetAta Target ATA address (used for type detection in standard mode)
|
|
2545
2241
|
* @returns Array of instructions (empty if nothing to load)
|
|
2546
2242
|
*/
|
|
2547
|
-
declare function createLoadAtaInstructionsFromInterface(
|
|
2548
|
-
rpc: Rpc,
|
|
2549
|
-
payer: PublicKey,
|
|
2550
|
-
ata: AccountInterface,
|
|
2551
|
-
options?: InterfaceOptions,
|
|
2552
|
-
wrap?: boolean,
|
|
2553
|
-
targetAta?: PublicKey,
|
|
2554
|
-
): Promise<TransactionInstruction[]>;
|
|
2243
|
+
declare function createLoadAtaInstructionsFromInterface(rpc: Rpc, payer: PublicKey, ata: AccountInterface, options?: InterfaceOptions, wrap?: boolean, targetAta?: PublicKey): Promise<TransactionInstruction[]>;
|
|
2555
2244
|
|
|
2556
2245
|
/**
|
|
2557
2246
|
* Input for creating off-chain metadata JSON.
|
|
@@ -2609,17 +2298,12 @@ interface OffChainTokenMetadataJson {
|
|
|
2609
2298
|
* // Then use uri with createMint
|
|
2610
2299
|
* await createMint(rpc, payer, { ...params, uri });
|
|
2611
2300
|
*/
|
|
2612
|
-
declare function toOffChainMetadataJson(
|
|
2613
|
-
meta: OffChainTokenMetadata,
|
|
2614
|
-
): OffChainTokenMetadataJson;
|
|
2301
|
+
declare function toOffChainMetadataJson(meta: OffChainTokenMetadata): OffChainTokenMetadataJson;
|
|
2615
2302
|
|
|
2616
2303
|
/**
|
|
2617
2304
|
* Returns the compressed mint address as bytes.
|
|
2618
2305
|
*/
|
|
2619
|
-
declare function deriveCMintAddress(
|
|
2620
|
-
mintSeed: PublicKey,
|
|
2621
|
-
addressTreeInfo: TreeInfo,
|
|
2622
|
-
): number[];
|
|
2306
|
+
declare function deriveCMintAddress(mintSeed: PublicKey, addressTreeInfo: TreeInfo): number[];
|
|
2623
2307
|
declare const COMPRESSED_MINT_SEED: Buffer$1;
|
|
2624
2308
|
/**
|
|
2625
2309
|
* Finds the SPL mint PDA for a c-token mint.
|
|
@@ -2627,14 +2311,8 @@ declare const COMPRESSED_MINT_SEED: Buffer$1;
|
|
|
2627
2311
|
* @returns [PDA, bump]
|
|
2628
2312
|
*/
|
|
2629
2313
|
declare function findMintAddress(mintSigner: PublicKey): [PublicKey, number];
|
|
2630
|
-
declare function getAssociatedCTokenAddressAndBump(
|
|
2631
|
-
|
|
2632
|
-
mint: PublicKey,
|
|
2633
|
-
): [PublicKey, number];
|
|
2634
|
-
declare function getAssociatedCTokenAddress(
|
|
2635
|
-
owner: PublicKey,
|
|
2636
|
-
mint: PublicKey,
|
|
2637
|
-
): PublicKey;
|
|
2314
|
+
declare function getAssociatedCTokenAddressAndBump(owner: PublicKey, mint: PublicKey): [PublicKey, number];
|
|
2315
|
+
declare function getAssociatedCTokenAddress(owner: PublicKey, mint: PublicKey): PublicKey;
|
|
2638
2316
|
|
|
2639
2317
|
/**
|
|
2640
2318
|
* Approve a delegate to spend tokens
|
|
@@ -2649,15 +2327,7 @@ declare function getAssociatedCTokenAddress(
|
|
|
2649
2327
|
*
|
|
2650
2328
|
* @return Signature of the confirmed transaction
|
|
2651
2329
|
*/
|
|
2652
|
-
declare function approve(
|
|
2653
|
-
rpc: Rpc,
|
|
2654
|
-
payer: Signer,
|
|
2655
|
-
mint: PublicKey,
|
|
2656
|
-
amount: number | BN,
|
|
2657
|
-
owner: Signer,
|
|
2658
|
-
delegate: PublicKey,
|
|
2659
|
-
confirmOptions?: ConfirmOptions,
|
|
2660
|
-
): Promise<TransactionSignature>;
|
|
2330
|
+
declare function approve(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, delegate: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2661
2331
|
|
|
2662
2332
|
/**
|
|
2663
2333
|
* Mint compressed tokens to a solana address from an external mint authority
|
|
@@ -2676,17 +2346,7 @@ declare function approve(
|
|
|
2676
2346
|
*
|
|
2677
2347
|
* @return Signature of the confirmed transaction
|
|
2678
2348
|
*/
|
|
2679
|
-
declare function approveAndMintTo(
|
|
2680
|
-
rpc: Rpc,
|
|
2681
|
-
payer: Signer,
|
|
2682
|
-
mint: PublicKey,
|
|
2683
|
-
toPubkey: PublicKey,
|
|
2684
|
-
authority: Signer,
|
|
2685
|
-
amount: number | BN,
|
|
2686
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2687
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2688
|
-
confirmOptions?: ConfirmOptions,
|
|
2689
|
-
): Promise<TransactionSignature>;
|
|
2349
|
+
declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, toPubkey: PublicKey, authority: Signer, amount: number | BN, outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2690
2350
|
|
|
2691
2351
|
/**
|
|
2692
2352
|
* Compress SPL tokens
|
|
@@ -2706,18 +2366,7 @@ declare function approveAndMintTo(
|
|
|
2706
2366
|
*
|
|
2707
2367
|
* @return Signature of the confirmed transaction
|
|
2708
2368
|
*/
|
|
2709
|
-
declare function compress(
|
|
2710
|
-
rpc: Rpc,
|
|
2711
|
-
payer: Signer,
|
|
2712
|
-
mint: PublicKey,
|
|
2713
|
-
amount: number | BN | number[] | BN[],
|
|
2714
|
-
owner: Signer,
|
|
2715
|
-
sourceTokenAccount: PublicKey,
|
|
2716
|
-
toAddress: PublicKey | Array<PublicKey>,
|
|
2717
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2718
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2719
|
-
confirmOptions?: ConfirmOptions,
|
|
2720
|
-
): Promise<TransactionSignature>;
|
|
2369
|
+
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>;
|
|
2721
2370
|
|
|
2722
2371
|
/**
|
|
2723
2372
|
* Compress SPL tokens into compressed token format
|
|
@@ -2737,17 +2386,7 @@ declare function compress(
|
|
|
2737
2386
|
*
|
|
2738
2387
|
* @return Signature of the confirmed transaction
|
|
2739
2388
|
*/
|
|
2740
|
-
declare function compressSplTokenAccount(
|
|
2741
|
-
rpc: Rpc,
|
|
2742
|
-
payer: Signer,
|
|
2743
|
-
mint: PublicKey,
|
|
2744
|
-
owner: Signer,
|
|
2745
|
-
tokenAccount: PublicKey,
|
|
2746
|
-
remainingAmount?: BN,
|
|
2747
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2748
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2749
|
-
confirmOptions?: ConfirmOptions,
|
|
2750
|
-
): Promise<TransactionSignature>;
|
|
2389
|
+
declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, remainingAmount?: BN, outputStateTreeInfo?: TreeInfo, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2751
2390
|
|
|
2752
2391
|
/**
|
|
2753
2392
|
* Create and initialize a new SPL token mint
|
|
@@ -2767,16 +2406,7 @@ declare function compressSplTokenAccount(
|
|
|
2767
2406
|
*
|
|
2768
2407
|
* @return Object with mint address and transaction signature
|
|
2769
2408
|
*/
|
|
2770
|
-
declare function createMint(
|
|
2771
|
-
rpc: Rpc,
|
|
2772
|
-
payer: Signer,
|
|
2773
|
-
mintAuthority: PublicKey | Signer,
|
|
2774
|
-
decimals: number,
|
|
2775
|
-
keypair?: Keypair,
|
|
2776
|
-
confirmOptions?: ConfirmOptions,
|
|
2777
|
-
tokenProgramId?: PublicKey | boolean,
|
|
2778
|
-
freezeAuthority?: PublicKey | Signer | null,
|
|
2779
|
-
): Promise<{
|
|
2409
|
+
declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey | Signer, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey | boolean, freezeAuthority?: PublicKey | Signer | null): Promise<{
|
|
2780
2410
|
mint: PublicKey;
|
|
2781
2411
|
transactionSignature: TransactionSignature;
|
|
2782
2412
|
}>;
|
|
@@ -2793,13 +2423,7 @@ declare function createMint(
|
|
|
2793
2423
|
*
|
|
2794
2424
|
* @return transaction signature
|
|
2795
2425
|
*/
|
|
2796
|
-
declare function createSplInterface(
|
|
2797
|
-
rpc: Rpc,
|
|
2798
|
-
payer: Signer,
|
|
2799
|
-
mint: PublicKey,
|
|
2800
|
-
confirmOptions?: ConfirmOptions,
|
|
2801
|
-
tokenProgramId?: PublicKey,
|
|
2802
|
-
): Promise<TransactionSignature>;
|
|
2426
|
+
declare function createSplInterface(rpc: Rpc, payer: Signer, mint: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
2803
2427
|
/**
|
|
2804
2428
|
* @deprecated Use {@link createSplInterface} instead.
|
|
2805
2429
|
*/
|
|
@@ -2818,14 +2442,7 @@ declare const createTokenPool: typeof createSplInterface;
|
|
|
2818
2442
|
*
|
|
2819
2443
|
* @return transaction signature
|
|
2820
2444
|
*/
|
|
2821
|
-
declare function addSplInterfaces(
|
|
2822
|
-
rpc: Rpc,
|
|
2823
|
-
payer: Signer,
|
|
2824
|
-
mint: PublicKey,
|
|
2825
|
-
numMaxAdditionalPools: number,
|
|
2826
|
-
confirmOptions?: ConfirmOptions,
|
|
2827
|
-
tokenProgramId?: PublicKey,
|
|
2828
|
-
): Promise<string>;
|
|
2445
|
+
declare function addSplInterfaces(rpc: Rpc, payer: Signer, mint: PublicKey, numMaxAdditionalPools: number, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<string>;
|
|
2829
2446
|
/**
|
|
2830
2447
|
* @deprecated Use {@link addSplInterfaces} instead.
|
|
2831
2448
|
*/
|
|
@@ -2845,13 +2462,7 @@ declare const addTokenPools: typeof addSplInterfaces;
|
|
|
2845
2462
|
* @return Object with transaction signatures and the address of the created
|
|
2846
2463
|
* lookup table
|
|
2847
2464
|
*/
|
|
2848
|
-
declare function createTokenProgramLookupTable(
|
|
2849
|
-
rpc: Rpc,
|
|
2850
|
-
payer: Signer,
|
|
2851
|
-
authority: Signer,
|
|
2852
|
-
mints?: PublicKey[],
|
|
2853
|
-
additionalAccounts?: PublicKey[],
|
|
2854
|
-
): Promise<{
|
|
2465
|
+
declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
|
|
2855
2466
|
txIds: TransactionSignature[];
|
|
2856
2467
|
address: PublicKey;
|
|
2857
2468
|
}>;
|
|
@@ -2871,16 +2482,7 @@ declare function createTokenProgramLookupTable(
|
|
|
2871
2482
|
*
|
|
2872
2483
|
* @return confirmed transaction signature
|
|
2873
2484
|
*/
|
|
2874
|
-
declare function decompress(
|
|
2875
|
-
rpc: Rpc,
|
|
2876
|
-
payer: Signer,
|
|
2877
|
-
mint: PublicKey,
|
|
2878
|
-
amount: number | BN,
|
|
2879
|
-
owner: Signer,
|
|
2880
|
-
toAddress: PublicKey,
|
|
2881
|
-
splInterfaceInfos?: SplInterfaceInfo[],
|
|
2882
|
-
confirmOptions?: ConfirmOptions,
|
|
2883
|
-
): Promise<TransactionSignature>;
|
|
2485
|
+
declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, splInterfaceInfos?: SplInterfaceInfo[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2884
2486
|
|
|
2885
2487
|
/**
|
|
2886
2488
|
* Merge multiple compressed token accounts for a given mint into fewer
|
|
@@ -2900,13 +2502,7 @@ declare function decompress(
|
|
|
2900
2502
|
*
|
|
2901
2503
|
* @return confirmed transaction signature
|
|
2902
2504
|
*/
|
|
2903
|
-
declare function mergeTokenAccounts(
|
|
2904
|
-
rpc: Rpc,
|
|
2905
|
-
payer: Signer,
|
|
2906
|
-
mint: PublicKey,
|
|
2907
|
-
owner: Signer,
|
|
2908
|
-
confirmOptions?: ConfirmOptions,
|
|
2909
|
-
): Promise<TransactionSignature>;
|
|
2505
|
+
declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2910
2506
|
|
|
2911
2507
|
/**
|
|
2912
2508
|
* Mint compressed tokens to a solana address
|
|
@@ -2928,17 +2524,7 @@ declare function mergeTokenAccounts(
|
|
|
2928
2524
|
*
|
|
2929
2525
|
* @return Signature of the confirmed transaction
|
|
2930
2526
|
*/
|
|
2931
|
-
declare function mintTo(
|
|
2932
|
-
rpc: Rpc,
|
|
2933
|
-
payer: Signer,
|
|
2934
|
-
mint: PublicKey,
|
|
2935
|
-
toPubkey: PublicKey | PublicKey[],
|
|
2936
|
-
authority: Signer,
|
|
2937
|
-
amount: number | BN | number[] | BN[],
|
|
2938
|
-
outputStateTreeInfo?: TreeInfo,
|
|
2939
|
-
splInterfaceInfo?: SplInterfaceInfo,
|
|
2940
|
-
confirmOptions?: ConfirmOptions,
|
|
2941
|
-
): Promise<TransactionSignature>;
|
|
2527
|
+
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>;
|
|
2942
2528
|
|
|
2943
2529
|
/**
|
|
2944
2530
|
* Revoke one or more delegated token accounts
|
|
@@ -2952,13 +2538,7 @@ declare function mintTo(
|
|
|
2952
2538
|
*
|
|
2953
2539
|
* @return Signature of the confirmed transaction
|
|
2954
2540
|
*/
|
|
2955
|
-
declare function revoke(
|
|
2956
|
-
rpc: Rpc,
|
|
2957
|
-
payer: Signer,
|
|
2958
|
-
accounts: ParsedTokenAccount[],
|
|
2959
|
-
owner: Signer,
|
|
2960
|
-
confirmOptions?: ConfirmOptions,
|
|
2961
|
-
): Promise<TransactionSignature>;
|
|
2541
|
+
declare function revoke(rpc: Rpc, payer: Signer, accounts: ParsedTokenAccount[], owner: Signer, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2962
2542
|
|
|
2963
2543
|
/**
|
|
2964
2544
|
* Transfer compressed tokens from one owner to another.
|
|
@@ -2976,15 +2556,7 @@ declare function revoke(
|
|
|
2976
2556
|
*
|
|
2977
2557
|
* @return confirmed transaction signature
|
|
2978
2558
|
*/
|
|
2979
|
-
declare function transfer(
|
|
2980
|
-
rpc: Rpc,
|
|
2981
|
-
payer: Signer,
|
|
2982
|
-
mint: PublicKey,
|
|
2983
|
-
amount: number | BN,
|
|
2984
|
-
owner: Signer,
|
|
2985
|
-
toAddress: PublicKey,
|
|
2986
|
-
confirmOptions?: ConfirmOptions,
|
|
2987
|
-
): Promise<TransactionSignature>;
|
|
2559
|
+
declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2988
2560
|
|
|
2989
2561
|
/**
|
|
2990
2562
|
* Transfer delegated compressed tokens to another owner
|
|
@@ -2999,15 +2571,7 @@ declare function transfer(
|
|
|
2999
2571
|
*
|
|
3000
2572
|
* @return confirmed transaction signature
|
|
3001
2573
|
*/
|
|
3002
|
-
declare function transferDelegated(
|
|
3003
|
-
rpc: Rpc,
|
|
3004
|
-
payer: Signer,
|
|
3005
|
-
mint: PublicKey,
|
|
3006
|
-
amount: number | BN,
|
|
3007
|
-
owner: Signer,
|
|
3008
|
-
toAddress: PublicKey,
|
|
3009
|
-
confirmOptions?: ConfirmOptions,
|
|
3010
|
-
): Promise<TransactionSignature>;
|
|
2574
|
+
declare function transferDelegated(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
3011
2575
|
|
|
3012
2576
|
/**
|
|
3013
2577
|
* Decompress delegated compressed tokens. Remaining compressed tokens are
|
|
@@ -3025,21 +2589,10 @@ declare function transferDelegated(
|
|
|
3025
2589
|
*
|
|
3026
2590
|
* @return Signature of the confirmed transaction
|
|
3027
2591
|
*/
|
|
3028
|
-
declare function decompressDelegated(
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
amount: number | BN,
|
|
3033
|
-
owner: Signer,
|
|
3034
|
-
toAddress: PublicKey,
|
|
3035
|
-
splInterfaceInfos?: SplInterfaceInfo[],
|
|
3036
|
-
confirmOptions?: ConfirmOptions,
|
|
3037
|
-
): Promise<TransactionSignature>;
|
|
3038
|
-
|
|
3039
|
-
declare const ERROR_NO_ACCOUNTS_FOUND =
|
|
3040
|
-
'Could not find accounts to select for transfer.';
|
|
3041
|
-
declare const ERROR_MIXED_TREE_TYPES =
|
|
3042
|
-
'Cannot select accounts from different tree types (V1/V2) in the same batch. Filter accounts by tree type first.';
|
|
2592
|
+
declare function decompressDelegated(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, splInterfaceInfos?: SplInterfaceInfo[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2593
|
+
|
|
2594
|
+
declare const ERROR_NO_ACCOUNTS_FOUND = "Could not find accounts to select for transfer.";
|
|
2595
|
+
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.";
|
|
3043
2596
|
/**
|
|
3044
2597
|
* Options for input account selection
|
|
3045
2598
|
*/
|
|
@@ -3054,9 +2607,7 @@ interface SelectInputAccountsOptions {
|
|
|
3054
2607
|
/**
|
|
3055
2608
|
* Groups accounts by tree type for separate processing
|
|
3056
2609
|
*/
|
|
3057
|
-
declare function groupAccountsByTreeType(
|
|
3058
|
-
accounts: ParsedTokenAccount[],
|
|
3059
|
-
): Map<TreeType, ParsedTokenAccount[]>;
|
|
2610
|
+
declare function groupAccountsByTreeType(accounts: ParsedTokenAccount[]): Map<TreeType, ParsedTokenAccount[]>;
|
|
3060
2611
|
/**
|
|
3061
2612
|
* Result of selectAccountsByPreferredTreeType
|
|
3062
2613
|
*/
|
|
@@ -3081,10 +2632,7 @@ interface SelectedAccountsResult {
|
|
|
3081
2632
|
* @param requiredAmount Minimum amount needed (optional - if not provided, returns all from preferred type)
|
|
3082
2633
|
* @returns Selected accounts from a single tree type
|
|
3083
2634
|
*/
|
|
3084
|
-
declare function selectAccountsByPreferredTreeType(
|
|
3085
|
-
accounts: ParsedTokenAccount[],
|
|
3086
|
-
requiredAmount?: BN,
|
|
3087
|
-
): SelectedAccountsResult;
|
|
2635
|
+
declare function selectAccountsByPreferredTreeType(accounts: ParsedTokenAccount[], requiredAmount?: BN): SelectedAccountsResult;
|
|
3088
2636
|
/**
|
|
3089
2637
|
* Selects token accounts for approval, first trying to find an exact match, then falling back to minimum selection.
|
|
3090
2638
|
*
|
|
@@ -3103,16 +2651,11 @@ declare function selectAccountsByPreferredTreeType(
|
|
|
3103
2651
|
* - totalLamports: Total lamports from selected accounts.
|
|
3104
2652
|
* - maxPossibleAmount: Max approvable amount given maxInputs.
|
|
3105
2653
|
*/
|
|
3106
|
-
declare function selectTokenAccountsForApprove(
|
|
3107
|
-
accounts: ParsedTokenAccount[],
|
|
3108
|
-
approveAmount: BN,
|
|
3109
|
-
maxInputs?: number,
|
|
3110
|
-
options?: SelectInputAccountsOptions,
|
|
3111
|
-
): [
|
|
2654
|
+
declare function selectTokenAccountsForApprove(accounts: ParsedTokenAccount[], approveAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3112
2655
|
selectedAccounts: ParsedTokenAccount[],
|
|
3113
2656
|
total: BN,
|
|
3114
2657
|
totalLamports: BN | null,
|
|
3115
|
-
maxPossibleAmount: BN
|
|
2658
|
+
maxPossibleAmount: BN
|
|
3116
2659
|
];
|
|
3117
2660
|
/**
|
|
3118
2661
|
* Selects the minimum number of compressed token accounts required for a
|
|
@@ -3126,12 +2669,7 @@ declare function selectTokenAccountsForApprove(
|
|
|
3126
2669
|
*
|
|
3127
2670
|
* @returns Returns selected accounts and their totals.
|
|
3128
2671
|
*/
|
|
3129
|
-
declare function selectMinCompressedTokenAccountsForDecompression(
|
|
3130
|
-
accounts: ParsedTokenAccount[],
|
|
3131
|
-
amount: BN,
|
|
3132
|
-
maxInputs?: number,
|
|
3133
|
-
options?: SelectInputAccountsOptions,
|
|
3134
|
-
): {
|
|
2672
|
+
declare function selectMinCompressedTokenAccountsForDecompression(accounts: ParsedTokenAccount[], amount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): {
|
|
3135
2673
|
selectedAccounts: ParsedTokenAccount[];
|
|
3136
2674
|
total: BN;
|
|
3137
2675
|
totalLamports: BN | null;
|
|
@@ -3155,31 +2693,22 @@ declare function selectMinCompressedTokenAccountsForDecompression(
|
|
|
3155
2693
|
* maxPossibleAmount: BN
|
|
3156
2694
|
* ]
|
|
3157
2695
|
*/
|
|
3158
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
3159
|
-
accounts: ParsedTokenAccount[],
|
|
3160
|
-
transferAmount: BN,
|
|
3161
|
-
maxInputs?: number,
|
|
3162
|
-
options?: SelectInputAccountsOptions,
|
|
3163
|
-
): [
|
|
2696
|
+
declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3164
2697
|
selectedAccounts: ParsedTokenAccount[],
|
|
3165
2698
|
total: BN,
|
|
3166
2699
|
totalLamports: BN | null,
|
|
3167
|
-
maxPossibleAmount: BN
|
|
2700
|
+
maxPossibleAmount: BN
|
|
3168
2701
|
];
|
|
3169
2702
|
/**
|
|
3170
2703
|
* Executes {@link selectMinCompressedTokenAccountsForTransfer} strategy,
|
|
3171
2704
|
* returns partial amounts if insufficient accounts are found instead of
|
|
3172
2705
|
* throwing an error.
|
|
3173
2706
|
*/
|
|
3174
|
-
declare function selectMinCompressedTokenAccountsForTransferOrPartial(
|
|
3175
|
-
accounts: ParsedTokenAccount[],
|
|
3176
|
-
transferAmount: BN,
|
|
3177
|
-
maxInputs?: number,
|
|
3178
|
-
): [
|
|
2707
|
+
declare function selectMinCompressedTokenAccountsForTransferOrPartial(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
3179
2708
|
selectedAccounts: ParsedTokenAccount[],
|
|
3180
2709
|
total: BN,
|
|
3181
2710
|
totalLamports: BN | null,
|
|
3182
|
-
maxPossibleAmount: BN
|
|
2711
|
+
maxPossibleAmount: BN
|
|
3183
2712
|
];
|
|
3184
2713
|
/**
|
|
3185
2714
|
* Selects compressed token accounts for a transfer, ensuring one extra account
|
|
@@ -3222,31 +2751,22 @@ declare function selectMinCompressedTokenAccountsForTransferOrPartial(
|
|
|
3222
2751
|
* console.log(totalLamports!.toString()); // '15'
|
|
3223
2752
|
* console.log(maxPossibleAmount.toString()); // '150'
|
|
3224
2753
|
*/
|
|
3225
|
-
declare function selectSmartCompressedTokenAccountsForTransfer(
|
|
3226
|
-
accounts: ParsedTokenAccount[],
|
|
3227
|
-
transferAmount: BN,
|
|
3228
|
-
maxInputs?: number,
|
|
3229
|
-
options?: SelectInputAccountsOptions,
|
|
3230
|
-
): [
|
|
2754
|
+
declare function selectSmartCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number, options?: SelectInputAccountsOptions): [
|
|
3231
2755
|
selectedAccounts: ParsedTokenAccount[],
|
|
3232
2756
|
total: BN,
|
|
3233
2757
|
totalLamports: BN | null,
|
|
3234
|
-
maxPossibleAmount: BN
|
|
2758
|
+
maxPossibleAmount: BN
|
|
3235
2759
|
];
|
|
3236
2760
|
/**
|
|
3237
2761
|
* Executes {@link selectMinCompressedTokenAccountsForTransfer} strategy,
|
|
3238
2762
|
* returns partial amounts if insufficient accounts are found instead of
|
|
3239
2763
|
* throwing an error.
|
|
3240
2764
|
*/
|
|
3241
|
-
declare function selectSmartCompressedTokenAccountsForTransferOrPartial(
|
|
3242
|
-
accounts: ParsedTokenAccount[],
|
|
3243
|
-
transferAmount: BN,
|
|
3244
|
-
maxInputs?: number,
|
|
3245
|
-
): [
|
|
2765
|
+
declare function selectSmartCompressedTokenAccountsForTransferOrPartial(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
3246
2766
|
selectedAccounts: ParsedTokenAccount[],
|
|
3247
2767
|
total: BN,
|
|
3248
2768
|
totalLamports: BN | null,
|
|
3249
|
-
maxPossibleAmount: BN
|
|
2769
|
+
maxPossibleAmount: BN
|
|
3250
2770
|
];
|
|
3251
2771
|
|
|
3252
2772
|
type TokenTransferOutputData = {
|
|
@@ -3319,9 +2839,7 @@ type CompressSplTokenAccountInstructionData = {
|
|
|
3319
2839
|
remainingAmount: BN | null;
|
|
3320
2840
|
cpiContext: CompressedCpiContext | null;
|
|
3321
2841
|
};
|
|
3322
|
-
declare function isSingleSplInterfaceInfo(
|
|
3323
|
-
splInterfaceInfos: SplInterfaceInfo | SplInterfaceInfo[],
|
|
3324
|
-
): splInterfaceInfos is SplInterfaceInfo;
|
|
2842
|
+
declare function isSingleSplInterfaceInfo(splInterfaceInfos: SplInterfaceInfo | SplInterfaceInfo[]): splInterfaceInfos is SplInterfaceInfo;
|
|
3325
2843
|
/**
|
|
3326
2844
|
* @deprecated Use {@link isSingleSplInterfaceInfo} instead.
|
|
3327
2845
|
*/
|
|
@@ -3432,9 +2950,7 @@ type PackCompressedTokenAccountsParams = {
|
|
|
3432
2950
|
/**
|
|
3433
2951
|
* Packs Compressed Token Accounts.
|
|
3434
2952
|
*/
|
|
3435
|
-
declare function packCompressedTokenAccounts(
|
|
3436
|
-
params: PackCompressedTokenAccountsParams,
|
|
3437
|
-
): {
|
|
2953
|
+
declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
|
|
3438
2954
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
3439
2955
|
remainingAccountMetas: AccountMeta[];
|
|
3440
2956
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -3447,10 +2963,7 @@ declare function packCompressedTokenAccounts(
|
|
|
3447
2963
|
* @param mint The mint of the token pool
|
|
3448
2964
|
* @returns True if all input accounts belong to the same mint
|
|
3449
2965
|
*/
|
|
3450
|
-
declare function checkMint(
|
|
3451
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
3452
|
-
mint: PublicKey,
|
|
3453
|
-
): boolean;
|
|
2966
|
+
declare function checkMint(compressedTokenAccounts: ParsedTokenAccount[], mint: PublicKey): boolean;
|
|
3454
2967
|
|
|
3455
2968
|
type LightCompressedToken = {
|
|
3456
2969
|
version: '1.2.0';
|
|
@@ -3462,7 +2975,7 @@ type LightCompressedToken = {
|
|
|
3462
2975
|
'This instruction creates a token pool for a given mint. Every spl mint',
|
|
3463
2976
|
'can have one token pool. When a token is compressed the tokens are',
|
|
3464
2977
|
'transferrred to the token pool, and their compressed equivalent is',
|
|
3465
|
-
'minted into a Merkle tree.'
|
|
2978
|
+
'minted into a Merkle tree.'
|
|
3466
2979
|
];
|
|
3467
2980
|
accounts: [
|
|
3468
2981
|
{
|
|
@@ -3495,7 +3008,7 @@ type LightCompressedToken = {
|
|
|
3495
3008
|
name: 'cpiAuthorityPda';
|
|
3496
3009
|
isMut: false;
|
|
3497
3010
|
isSigner: false;
|
|
3498
|
-
}
|
|
3011
|
+
}
|
|
3499
3012
|
];
|
|
3500
3013
|
args: [];
|
|
3501
3014
|
},
|
|
@@ -3503,7 +3016,7 @@ type LightCompressedToken = {
|
|
|
3503
3016
|
name: 'addTokenPool';
|
|
3504
3017
|
docs: [
|
|
3505
3018
|
'This instruction creates an additional token pool for a given mint.',
|
|
3506
|
-
'The maximum number of token pools per mint is 5.'
|
|
3019
|
+
'The maximum number of token pools per mint is 5.'
|
|
3507
3020
|
];
|
|
3508
3021
|
accounts: [
|
|
3509
3022
|
{
|
|
@@ -3541,13 +3054,13 @@ type LightCompressedToken = {
|
|
|
3541
3054
|
name: 'cpiAuthorityPda';
|
|
3542
3055
|
isMut: false;
|
|
3543
3056
|
isSigner: false;
|
|
3544
|
-
}
|
|
3057
|
+
}
|
|
3545
3058
|
];
|
|
3546
3059
|
args: [
|
|
3547
3060
|
{
|
|
3548
3061
|
name: 'tokenPoolIndex';
|
|
3549
3062
|
type: 'u8';
|
|
3550
|
-
}
|
|
3063
|
+
}
|
|
3551
3064
|
];
|
|
3552
3065
|
},
|
|
3553
3066
|
{
|
|
@@ -3559,7 +3072,7 @@ type LightCompressedToken = {
|
|
|
3559
3072
|
'every amount and pubkey input pair. A constant amount of lamports can be',
|
|
3560
3073
|
'transferred to each output account to enable. A use case to add lamports',
|
|
3561
3074
|
'to a compressed token account is to prevent spam. This is the only way',
|
|
3562
|
-
'to add lamports to a compressed token account.'
|
|
3075
|
+
'to add lamports to a compressed token account.'
|
|
3563
3076
|
];
|
|
3564
3077
|
accounts: [
|
|
3565
3078
|
{
|
|
@@ -3639,7 +3152,7 @@ type LightCompressedToken = {
|
|
|
3639
3152
|
isMut: true;
|
|
3640
3153
|
isSigner: false;
|
|
3641
3154
|
isOptional: true;
|
|
3642
|
-
}
|
|
3155
|
+
}
|
|
3643
3156
|
];
|
|
3644
3157
|
args: [
|
|
3645
3158
|
{
|
|
@@ -3659,7 +3172,7 @@ type LightCompressedToken = {
|
|
|
3659
3172
|
type: {
|
|
3660
3173
|
option: 'u64';
|
|
3661
3174
|
};
|
|
3662
|
-
}
|
|
3175
|
+
}
|
|
3663
3176
|
];
|
|
3664
3177
|
},
|
|
3665
3178
|
{
|
|
@@ -3667,7 +3180,7 @@ type LightCompressedToken = {
|
|
|
3667
3180
|
docs: [
|
|
3668
3181
|
'Compresses the balance of an spl token account sub an optional remaining',
|
|
3669
3182
|
'amount. This instruction does not close the spl token account. To close',
|
|
3670
|
-
'the account bundle a close spl account instruction in your transaction.'
|
|
3183
|
+
'the account bundle a close spl account instruction in your transaction.'
|
|
3671
3184
|
];
|
|
3672
3185
|
accounts: [
|
|
3673
3186
|
{
|
|
@@ -3683,7 +3196,7 @@ type LightCompressedToken = {
|
|
|
3683
3196
|
docs: [
|
|
3684
3197
|
'Authority is verified through proof since both owner and delegate',
|
|
3685
3198
|
'are included in the token data hash, which is a public input to the',
|
|
3686
|
-
'validity proof.'
|
|
3199
|
+
'validity proof.'
|
|
3687
3200
|
];
|
|
3688
3201
|
},
|
|
3689
3202
|
{
|
|
@@ -3744,7 +3257,7 @@ type LightCompressedToken = {
|
|
|
3744
3257
|
name: 'systemProgram';
|
|
3745
3258
|
isMut: false;
|
|
3746
3259
|
isSigner: false;
|
|
3747
|
-
}
|
|
3260
|
+
}
|
|
3748
3261
|
];
|
|
3749
3262
|
args: [
|
|
3750
3263
|
{
|
|
@@ -3764,7 +3277,7 @@ type LightCompressedToken = {
|
|
|
3764
3277
|
defined: 'CompressedCpiContext';
|
|
3765
3278
|
};
|
|
3766
3279
|
};
|
|
3767
|
-
}
|
|
3280
|
+
}
|
|
3768
3281
|
];
|
|
3769
3282
|
},
|
|
3770
3283
|
{
|
|
@@ -3777,7 +3290,7 @@ type LightCompressedToken = {
|
|
|
3777
3290
|
'accounts specify less lamports than inputs the remaining lamports are',
|
|
3778
3291
|
'transferred to an output compressed account. Signer must be owner or',
|
|
3779
3292
|
'delegate. If a delegated token account is transferred the delegate is',
|
|
3780
|
-
'not preserved.'
|
|
3293
|
+
'not preserved.'
|
|
3781
3294
|
];
|
|
3782
3295
|
accounts: [
|
|
3783
3296
|
{
|
|
@@ -3793,7 +3306,7 @@ type LightCompressedToken = {
|
|
|
3793
3306
|
docs: [
|
|
3794
3307
|
'Authority is verified through proof since both owner and delegate',
|
|
3795
3308
|
'are included in the token data hash, which is a public input to the',
|
|
3796
|
-
'validity proof.'
|
|
3309
|
+
'validity proof.'
|
|
3797
3310
|
];
|
|
3798
3311
|
},
|
|
3799
3312
|
{
|
|
@@ -3854,13 +3367,13 @@ type LightCompressedToken = {
|
|
|
3854
3367
|
name: 'systemProgram';
|
|
3855
3368
|
isMut: false;
|
|
3856
3369
|
isSigner: false;
|
|
3857
|
-
}
|
|
3370
|
+
}
|
|
3858
3371
|
];
|
|
3859
3372
|
args: [
|
|
3860
3373
|
{
|
|
3861
3374
|
name: 'inputs';
|
|
3862
3375
|
type: 'bytes';
|
|
3863
|
-
}
|
|
3376
|
+
}
|
|
3864
3377
|
];
|
|
3865
3378
|
},
|
|
3866
3379
|
{
|
|
@@ -3871,7 +3384,7 @@ type LightCompressedToken = {
|
|
|
3871
3384
|
'be called by a delegate.',
|
|
3872
3385
|
'The instruction creates two output accounts:',
|
|
3873
3386
|
'1. one account with delegated amount',
|
|
3874
|
-
'2. one account with remaining(change) amount'
|
|
3387
|
+
'2. one account with remaining(change) amount'
|
|
3875
3388
|
];
|
|
3876
3389
|
accounts: [
|
|
3877
3390
|
{
|
|
@@ -3887,7 +3400,7 @@ type LightCompressedToken = {
|
|
|
3887
3400
|
docs: [
|
|
3888
3401
|
'Authority is verified through proof since both owner and delegate',
|
|
3889
3402
|
'are included in the token data hash, which is a public input to the',
|
|
3890
|
-
'validity proof.'
|
|
3403
|
+
'validity proof.'
|
|
3891
3404
|
];
|
|
3892
3405
|
},
|
|
3893
3406
|
{
|
|
@@ -3930,20 +3443,20 @@ type LightCompressedToken = {
|
|
|
3930
3443
|
name: 'systemProgram';
|
|
3931
3444
|
isMut: false;
|
|
3932
3445
|
isSigner: false;
|
|
3933
|
-
}
|
|
3446
|
+
}
|
|
3934
3447
|
];
|
|
3935
3448
|
args: [
|
|
3936
3449
|
{
|
|
3937
3450
|
name: 'inputs';
|
|
3938
3451
|
type: 'bytes';
|
|
3939
|
-
}
|
|
3452
|
+
}
|
|
3940
3453
|
];
|
|
3941
3454
|
},
|
|
3942
3455
|
{
|
|
3943
3456
|
name: 'revoke';
|
|
3944
3457
|
docs: [
|
|
3945
3458
|
'Revokes a delegation. The instruction merges all inputs into one output',
|
|
3946
|
-
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
3459
|
+
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
3947
3460
|
];
|
|
3948
3461
|
accounts: [
|
|
3949
3462
|
{
|
|
@@ -3959,7 +3472,7 @@ type LightCompressedToken = {
|
|
|
3959
3472
|
docs: [
|
|
3960
3473
|
'Authority is verified through proof since both owner and delegate',
|
|
3961
3474
|
'are included in the token data hash, which is a public input to the',
|
|
3962
|
-
'validity proof.'
|
|
3475
|
+
'validity proof.'
|
|
3963
3476
|
];
|
|
3964
3477
|
},
|
|
3965
3478
|
{
|
|
@@ -4002,20 +3515,20 @@ type LightCompressedToken = {
|
|
|
4002
3515
|
name: 'systemProgram';
|
|
4003
3516
|
isMut: false;
|
|
4004
3517
|
isSigner: false;
|
|
4005
|
-
}
|
|
3518
|
+
}
|
|
4006
3519
|
];
|
|
4007
3520
|
args: [
|
|
4008
3521
|
{
|
|
4009
3522
|
name: 'inputs';
|
|
4010
3523
|
type: 'bytes';
|
|
4011
|
-
}
|
|
3524
|
+
}
|
|
4012
3525
|
];
|
|
4013
3526
|
},
|
|
4014
3527
|
{
|
|
4015
3528
|
name: 'freeze';
|
|
4016
3529
|
docs: [
|
|
4017
3530
|
'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
|
|
4018
|
-
'many outputs as inputs. Balances and delegates are preserved.'
|
|
3531
|
+
'many outputs as inputs. Balances and delegates are preserved.'
|
|
4019
3532
|
];
|
|
4020
3533
|
accounts: [
|
|
4021
3534
|
{
|
|
@@ -4074,20 +3587,20 @@ type LightCompressedToken = {
|
|
|
4074
3587
|
name: 'mint';
|
|
4075
3588
|
isMut: false;
|
|
4076
3589
|
isSigner: false;
|
|
4077
|
-
}
|
|
3590
|
+
}
|
|
4078
3591
|
];
|
|
4079
3592
|
args: [
|
|
4080
3593
|
{
|
|
4081
3594
|
name: 'inputs';
|
|
4082
3595
|
type: 'bytes';
|
|
4083
|
-
}
|
|
3596
|
+
}
|
|
4084
3597
|
];
|
|
4085
3598
|
},
|
|
4086
3599
|
{
|
|
4087
3600
|
name: 'thaw';
|
|
4088
3601
|
docs: [
|
|
4089
3602
|
'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
|
|
4090
|
-
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
3603
|
+
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
4091
3604
|
];
|
|
4092
3605
|
accounts: [
|
|
4093
3606
|
{
|
|
@@ -4146,13 +3659,13 @@ type LightCompressedToken = {
|
|
|
4146
3659
|
name: 'mint';
|
|
4147
3660
|
isMut: false;
|
|
4148
3661
|
isSigner: false;
|
|
4149
|
-
}
|
|
3662
|
+
}
|
|
4150
3663
|
];
|
|
4151
3664
|
args: [
|
|
4152
3665
|
{
|
|
4153
3666
|
name: 'inputs';
|
|
4154
3667
|
type: 'bytes';
|
|
4155
|
-
}
|
|
3668
|
+
}
|
|
4156
3669
|
];
|
|
4157
3670
|
},
|
|
4158
3671
|
{
|
|
@@ -4160,7 +3673,7 @@ type LightCompressedToken = {
|
|
|
4160
3673
|
docs: [
|
|
4161
3674
|
'Burns compressed tokens and spl tokens from the pool account. Delegates',
|
|
4162
3675
|
'can burn tokens. The output compressed token account remains delegated.',
|
|
4163
|
-
'Creates one output compressed token account.'
|
|
3676
|
+
'Creates one output compressed token account.'
|
|
4164
3677
|
];
|
|
4165
3678
|
accounts: [
|
|
4166
3679
|
{
|
|
@@ -4176,7 +3689,7 @@ type LightCompressedToken = {
|
|
|
4176
3689
|
docs: [
|
|
4177
3690
|
'Authority is verified through proof since both owner and delegate',
|
|
4178
3691
|
'are included in the token data hash, which is a public input to the',
|
|
4179
|
-
'validity proof.'
|
|
3692
|
+
'validity proof.'
|
|
4180
3693
|
];
|
|
4181
3694
|
},
|
|
4182
3695
|
{
|
|
@@ -4233,13 +3746,13 @@ type LightCompressedToken = {
|
|
|
4233
3746
|
name: 'systemProgram';
|
|
4234
3747
|
isMut: false;
|
|
4235
3748
|
isSigner: false;
|
|
4236
|
-
}
|
|
3749
|
+
}
|
|
4237
3750
|
];
|
|
4238
3751
|
args: [
|
|
4239
3752
|
{
|
|
4240
3753
|
name: 'inputs';
|
|
4241
3754
|
type: 'bytes';
|
|
4242
|
-
}
|
|
3755
|
+
}
|
|
4243
3756
|
];
|
|
4244
3757
|
},
|
|
4245
3758
|
{
|
|
@@ -4247,7 +3760,7 @@ type LightCompressedToken = {
|
|
|
4247
3760
|
docs: [
|
|
4248
3761
|
'This function is a stub to allow Anchor to include the input types in',
|
|
4249
3762
|
'the IDL. It should not be included in production builds nor be called in',
|
|
4250
|
-
'practice.'
|
|
3763
|
+
'practice.'
|
|
4251
3764
|
];
|
|
4252
3765
|
accounts: [
|
|
4253
3766
|
{
|
|
@@ -4263,7 +3776,7 @@ type LightCompressedToken = {
|
|
|
4263
3776
|
docs: [
|
|
4264
3777
|
'Authority is verified through proof since both owner and delegate',
|
|
4265
3778
|
'are included in the token data hash, which is a public input to the',
|
|
4266
|
-
'validity proof.'
|
|
3779
|
+
'validity proof.'
|
|
4267
3780
|
];
|
|
4268
3781
|
},
|
|
4269
3782
|
{
|
|
@@ -4324,7 +3837,7 @@ type LightCompressedToken = {
|
|
|
4324
3837
|
name: 'systemProgram';
|
|
4325
3838
|
isMut: false;
|
|
4326
3839
|
isSigner: false;
|
|
4327
|
-
}
|
|
3840
|
+
}
|
|
4328
3841
|
];
|
|
4329
3842
|
args: [
|
|
4330
3843
|
{
|
|
@@ -4338,9 +3851,9 @@ type LightCompressedToken = {
|
|
|
4338
3851
|
type: {
|
|
4339
3852
|
defined: 'TokenData';
|
|
4340
3853
|
};
|
|
4341
|
-
}
|
|
3854
|
+
}
|
|
4342
3855
|
];
|
|
4343
|
-
}
|
|
3856
|
+
}
|
|
4344
3857
|
];
|
|
4345
3858
|
types: [
|
|
4346
3859
|
{
|
|
@@ -4353,7 +3866,7 @@ type LightCompressedToken = {
|
|
|
4353
3866
|
},
|
|
4354
3867
|
{
|
|
4355
3868
|
name: 'Frozen';
|
|
4356
|
-
}
|
|
3869
|
+
}
|
|
4357
3870
|
];
|
|
4358
3871
|
};
|
|
4359
3872
|
},
|
|
@@ -4385,7 +3898,7 @@ type LightCompressedToken = {
|
|
|
4385
3898
|
defined: 'CompressedAccountData';
|
|
4386
3899
|
};
|
|
4387
3900
|
};
|
|
4388
|
-
}
|
|
3901
|
+
}
|
|
4389
3902
|
];
|
|
4390
3903
|
};
|
|
4391
3904
|
},
|
|
@@ -4409,7 +3922,7 @@ type LightCompressedToken = {
|
|
|
4409
3922
|
type: {
|
|
4410
3923
|
array: ['u8', 32];
|
|
4411
3924
|
};
|
|
4412
|
-
}
|
|
3925
|
+
}
|
|
4413
3926
|
];
|
|
4414
3927
|
};
|
|
4415
3928
|
},
|
|
@@ -4422,7 +3935,7 @@ type LightCompressedToken = {
|
|
|
4422
3935
|
name: 'setContext';
|
|
4423
3936
|
docs: [
|
|
4424
3937
|
'Is set by the program that is invoking the CPI to signal that is should',
|
|
4425
|
-
'set the cpi context.'
|
|
3938
|
+
'set the cpi context.'
|
|
4426
3939
|
];
|
|
4427
3940
|
type: 'bool';
|
|
4428
3941
|
},
|
|
@@ -4430,17 +3943,17 @@ type LightCompressedToken = {
|
|
|
4430
3943
|
name: 'firstSetContext';
|
|
4431
3944
|
docs: [
|
|
4432
3945
|
'Is set to wipe the cpi context since someone could have set it before',
|
|
4433
|
-
'with unrelated data.'
|
|
3946
|
+
'with unrelated data.'
|
|
4434
3947
|
];
|
|
4435
3948
|
type: 'bool';
|
|
4436
3949
|
},
|
|
4437
3950
|
{
|
|
4438
3951
|
name: 'cpiContextAccountIndex';
|
|
4439
3952
|
docs: [
|
|
4440
|
-
'Index of cpi context account in remaining accounts.'
|
|
3953
|
+
'Index of cpi context account in remaining accounts.'
|
|
4441
3954
|
];
|
|
4442
3955
|
type: 'u8';
|
|
4443
|
-
}
|
|
3956
|
+
}
|
|
4444
3957
|
];
|
|
4445
3958
|
};
|
|
4446
3959
|
},
|
|
@@ -4466,7 +3979,7 @@ type LightCompressedToken = {
|
|
|
4466
3979
|
type: {
|
|
4467
3980
|
array: ['u8', 32];
|
|
4468
3981
|
};
|
|
4469
|
-
}
|
|
3982
|
+
}
|
|
4470
3983
|
];
|
|
4471
3984
|
};
|
|
4472
3985
|
},
|
|
@@ -4492,7 +4005,7 @@ type LightCompressedToken = {
|
|
|
4492
4005
|
docs: [
|
|
4493
4006
|
'Is required if the signer is delegate,',
|
|
4494
4007
|
'-> delegate is authority account,',
|
|
4495
|
-
'owner = Some(owner) is the owner of the token account.'
|
|
4008
|
+
'owner = Some(owner) is the owner of the token account.'
|
|
4496
4009
|
];
|
|
4497
4010
|
type: {
|
|
4498
4011
|
option: {
|
|
@@ -4539,7 +4052,7 @@ type LightCompressedToken = {
|
|
|
4539
4052
|
type: {
|
|
4540
4053
|
option: 'u8';
|
|
4541
4054
|
};
|
|
4542
|
-
}
|
|
4055
|
+
}
|
|
4543
4056
|
];
|
|
4544
4057
|
};
|
|
4545
4058
|
},
|
|
@@ -4579,7 +4092,7 @@ type LightCompressedToken = {
|
|
|
4579
4092
|
{
|
|
4580
4093
|
name: 'outputAccountMerkleTreeIndex';
|
|
4581
4094
|
type: 'u8';
|
|
4582
|
-
}
|
|
4095
|
+
}
|
|
4583
4096
|
];
|
|
4584
4097
|
};
|
|
4585
4098
|
},
|
|
@@ -4637,14 +4150,14 @@ type LightCompressedToken = {
|
|
|
4637
4150
|
type: {
|
|
4638
4151
|
option: 'u64';
|
|
4639
4152
|
};
|
|
4640
|
-
}
|
|
4153
|
+
}
|
|
4641
4154
|
];
|
|
4642
4155
|
};
|
|
4643
4156
|
},
|
|
4644
4157
|
{
|
|
4645
4158
|
name: 'DelegatedTransfer';
|
|
4646
4159
|
docs: [
|
|
4647
|
-
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
4160
|
+
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
4648
4161
|
];
|
|
4649
4162
|
type: {
|
|
4650
4163
|
kind: 'struct';
|
|
@@ -4659,12 +4172,12 @@ type LightCompressedToken = {
|
|
|
4659
4172
|
'Index of change compressed account in output compressed accounts. In',
|
|
4660
4173
|
"case that the delegate didn't spend the complete delegated compressed",
|
|
4661
4174
|
'account balance the change compressed account will be delegated to her',
|
|
4662
|
-
'as well.'
|
|
4175
|
+
'as well.'
|
|
4663
4176
|
];
|
|
4664
4177
|
type: {
|
|
4665
4178
|
option: 'u8';
|
|
4666
4179
|
};
|
|
4667
|
-
}
|
|
4180
|
+
}
|
|
4668
4181
|
];
|
|
4669
4182
|
};
|
|
4670
4183
|
},
|
|
@@ -4702,12 +4215,12 @@ type LightCompressedToken = {
|
|
|
4702
4215
|
{
|
|
4703
4216
|
name: 'tlv';
|
|
4704
4217
|
docs: [
|
|
4705
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4218
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4706
4219
|
];
|
|
4707
4220
|
type: {
|
|
4708
4221
|
option: 'bytes';
|
|
4709
4222
|
};
|
|
4710
|
-
}
|
|
4223
|
+
}
|
|
4711
4224
|
];
|
|
4712
4225
|
};
|
|
4713
4226
|
},
|
|
@@ -4763,7 +4276,7 @@ type LightCompressedToken = {
|
|
|
4763
4276
|
{
|
|
4764
4277
|
name: 'isCompress';
|
|
4765
4278
|
type: 'bool';
|
|
4766
|
-
}
|
|
4279
|
+
}
|
|
4767
4280
|
];
|
|
4768
4281
|
};
|
|
4769
4282
|
},
|
|
@@ -4827,7 +4340,7 @@ type LightCompressedToken = {
|
|
|
4827
4340
|
defined: 'CompressedCpiContext';
|
|
4828
4341
|
};
|
|
4829
4342
|
};
|
|
4830
|
-
}
|
|
4343
|
+
}
|
|
4831
4344
|
];
|
|
4832
4345
|
};
|
|
4833
4346
|
},
|
|
@@ -4843,7 +4356,7 @@ type LightCompressedToken = {
|
|
|
4843
4356
|
{
|
|
4844
4357
|
name: 'seq';
|
|
4845
4358
|
type: 'u64';
|
|
4846
|
-
}
|
|
4359
|
+
}
|
|
4847
4360
|
];
|
|
4848
4361
|
};
|
|
4849
4362
|
},
|
|
@@ -4869,7 +4382,7 @@ type LightCompressedToken = {
|
|
|
4869
4382
|
{
|
|
4870
4383
|
name: 'addressMerkleTreeRootIndex';
|
|
4871
4384
|
type: 'u16';
|
|
4872
|
-
}
|
|
4385
|
+
}
|
|
4873
4386
|
];
|
|
4874
4387
|
};
|
|
4875
4388
|
},
|
|
@@ -4887,7 +4400,7 @@ type LightCompressedToken = {
|
|
|
4887
4400
|
{
|
|
4888
4401
|
name: 'merkleTreeIndex';
|
|
4889
4402
|
type: 'u8';
|
|
4890
|
-
}
|
|
4403
|
+
}
|
|
4891
4404
|
];
|
|
4892
4405
|
};
|
|
4893
4406
|
},
|
|
@@ -4911,17 +4424,17 @@ type LightCompressedToken = {
|
|
|
4911
4424
|
{
|
|
4912
4425
|
name: 'rootIndex';
|
|
4913
4426
|
docs: [
|
|
4914
|
-
'Index of root used in inclusion validity proof.'
|
|
4427
|
+
'Index of root used in inclusion validity proof.'
|
|
4915
4428
|
];
|
|
4916
4429
|
type: 'u16';
|
|
4917
4430
|
},
|
|
4918
4431
|
{
|
|
4919
4432
|
name: 'readOnly';
|
|
4920
4433
|
docs: [
|
|
4921
|
-
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
4434
|
+
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
4922
4435
|
];
|
|
4923
4436
|
type: 'bool';
|
|
4924
|
-
}
|
|
4437
|
+
}
|
|
4925
4438
|
];
|
|
4926
4439
|
};
|
|
4927
4440
|
},
|
|
@@ -4945,7 +4458,7 @@ type LightCompressedToken = {
|
|
|
4945
4458
|
{
|
|
4946
4459
|
name: 'proveByIndex';
|
|
4947
4460
|
type: 'bool';
|
|
4948
|
-
}
|
|
4461
|
+
}
|
|
4949
4462
|
];
|
|
4950
4463
|
};
|
|
4951
4464
|
},
|
|
@@ -4975,12 +4488,12 @@ type LightCompressedToken = {
|
|
|
4975
4488
|
{
|
|
4976
4489
|
name: 'tlv';
|
|
4977
4490
|
docs: [
|
|
4978
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4491
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4979
4492
|
];
|
|
4980
4493
|
type: {
|
|
4981
4494
|
option: 'bytes';
|
|
4982
4495
|
};
|
|
4983
|
-
}
|
|
4496
|
+
}
|
|
4984
4497
|
];
|
|
4985
4498
|
};
|
|
4986
4499
|
},
|
|
@@ -5054,7 +4567,7 @@ type LightCompressedToken = {
|
|
|
5054
4567
|
type: {
|
|
5055
4568
|
option: 'bytes';
|
|
5056
4569
|
};
|
|
5057
|
-
}
|
|
4570
|
+
}
|
|
5058
4571
|
];
|
|
5059
4572
|
};
|
|
5060
4573
|
},
|
|
@@ -5072,7 +4585,7 @@ type LightCompressedToken = {
|
|
|
5072
4585
|
name: 'index';
|
|
5073
4586
|
docs: ['Index of compressed account hash in queue.'];
|
|
5074
4587
|
type: 'u16';
|
|
5075
|
-
}
|
|
4588
|
+
}
|
|
5076
4589
|
];
|
|
5077
4590
|
};
|
|
5078
4591
|
},
|
|
@@ -5100,7 +4613,7 @@ type LightCompressedToken = {
|
|
|
5100
4613
|
name: 'delegate';
|
|
5101
4614
|
docs: [
|
|
5102
4615
|
'If `delegate` is `Some` then `delegated_amount` represents',
|
|
5103
|
-
'the amount authorized by the delegate'
|
|
4616
|
+
'the amount authorized by the delegate'
|
|
5104
4617
|
];
|
|
5105
4618
|
type: {
|
|
5106
4619
|
option: 'publicKey';
|
|
@@ -5116,15 +4629,15 @@ type LightCompressedToken = {
|
|
|
5116
4629
|
{
|
|
5117
4630
|
name: 'tlv';
|
|
5118
4631
|
docs: [
|
|
5119
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
4632
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
5120
4633
|
];
|
|
5121
4634
|
type: {
|
|
5122
4635
|
option: 'bytes';
|
|
5123
4636
|
};
|
|
5124
|
-
}
|
|
4637
|
+
}
|
|
5125
4638
|
];
|
|
5126
4639
|
};
|
|
5127
|
-
}
|
|
4640
|
+
}
|
|
5128
4641
|
];
|
|
5129
4642
|
errors: [
|
|
5130
4643
|
{
|
|
@@ -5281,7 +4794,7 @@ type LightCompressedToken = {
|
|
|
5281
4794
|
{
|
|
5282
4795
|
code: 6032;
|
|
5283
4796
|
name: 'NoMatchingBumpFound';
|
|
5284
|
-
}
|
|
4797
|
+
}
|
|
5285
4798
|
];
|
|
5286
4799
|
};
|
|
5287
4800
|
declare const IDL: LightCompressedToken;
|
|
@@ -5292,30 +4805,14 @@ declare const CompressedTokenInstructionDataTransferLayout: Layout<unknown>;
|
|
|
5292
4805
|
declare const mintToLayout: Layout<unknown>;
|
|
5293
4806
|
declare const batchCompressLayout: Layout<unknown>;
|
|
5294
4807
|
declare const compressSplTokenAccountInstructionDataLayout: Layout<unknown>;
|
|
5295
|
-
declare function encodeMintToInstructionData(
|
|
5296
|
-
|
|
5297
|
-
): Buffer$1;
|
|
5298
|
-
declare function
|
|
5299
|
-
|
|
5300
|
-
):
|
|
5301
|
-
declare function
|
|
5302
|
-
|
|
5303
|
-
): Buffer$1;
|
|
5304
|
-
declare function decodeBatchCompressInstructionData(
|
|
5305
|
-
buffer: Buffer$1,
|
|
5306
|
-
): BatchCompressInstructionData;
|
|
5307
|
-
declare function encodeCompressSplTokenAccountInstructionData(
|
|
5308
|
-
data: CompressSplTokenAccountInstructionData,
|
|
5309
|
-
): Buffer$1;
|
|
5310
|
-
declare function decodeCompressSplTokenAccountInstructionData(
|
|
5311
|
-
buffer: Buffer$1,
|
|
5312
|
-
): CompressSplTokenAccountInstructionData;
|
|
5313
|
-
declare function encodeTransferInstructionData(
|
|
5314
|
-
data: CompressedTokenInstructionDataTransfer,
|
|
5315
|
-
): Buffer$1;
|
|
5316
|
-
declare function decodeTransferInstructionData(
|
|
5317
|
-
buffer: Buffer$1,
|
|
5318
|
-
): CompressedTokenInstructionDataTransfer;
|
|
4808
|
+
declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
|
|
4809
|
+
declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
|
|
4810
|
+
declare function encodeBatchCompressInstructionData(data: BatchCompressInstructionData): Buffer$1;
|
|
4811
|
+
declare function decodeBatchCompressInstructionData(buffer: Buffer$1): BatchCompressInstructionData;
|
|
4812
|
+
declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
|
|
4813
|
+
declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
|
|
4814
|
+
declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
|
|
4815
|
+
declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
|
|
5319
4816
|
interface BaseAccountsLayoutParams {
|
|
5320
4817
|
feePayer: PublicKey;
|
|
5321
4818
|
authority: PublicKey;
|
|
@@ -5357,44 +4854,20 @@ type freezeAccountsLayoutParams = BaseAccountsLayoutParams & {
|
|
|
5357
4854
|
mint: PublicKey;
|
|
5358
4855
|
};
|
|
5359
4856
|
type thawAccountsLayoutParams = freezeAccountsLayoutParams;
|
|
5360
|
-
declare const createTokenPoolAccountsLayout: (
|
|
5361
|
-
|
|
5362
|
-
) => AccountMeta[];
|
|
5363
|
-
declare const
|
|
5364
|
-
|
|
5365
|
-
) => AccountMeta[];
|
|
5366
|
-
declare const
|
|
5367
|
-
|
|
5368
|
-
) => AccountMeta[];
|
|
5369
|
-
declare const transferAccountsLayout: (
|
|
5370
|
-
accounts: transferAccountsLayoutParams,
|
|
5371
|
-
) => AccountMeta[];
|
|
5372
|
-
declare const approveAccountsLayout: (
|
|
5373
|
-
accounts: approveAccountsLayoutParams,
|
|
5374
|
-
) => AccountMeta[];
|
|
5375
|
-
declare const revokeAccountsLayout: (
|
|
5376
|
-
accounts: approveAccountsLayoutParams,
|
|
5377
|
-
) => AccountMeta[];
|
|
5378
|
-
declare const freezeAccountsLayout: (
|
|
5379
|
-
accounts: freezeAccountsLayoutParams,
|
|
5380
|
-
) => AccountMeta[];
|
|
5381
|
-
declare const thawAccountsLayout: (
|
|
5382
|
-
accounts: freezeAccountsLayoutParams,
|
|
5383
|
-
) => AccountMeta[];
|
|
4857
|
+
declare const createTokenPoolAccountsLayout: (accounts: createTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
4858
|
+
declare const addTokenPoolAccountsLayout: (accounts: addTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
4859
|
+
declare const mintToAccountsLayout: (accounts: mintToAccountsLayoutParams) => AccountMeta[];
|
|
4860
|
+
declare const transferAccountsLayout: (accounts: transferAccountsLayoutParams) => AccountMeta[];
|
|
4861
|
+
declare const approveAccountsLayout: (accounts: approveAccountsLayoutParams) => AccountMeta[];
|
|
4862
|
+
declare const revokeAccountsLayout: (accounts: approveAccountsLayoutParams) => AccountMeta[];
|
|
4863
|
+
declare const freezeAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
|
|
4864
|
+
declare const thawAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
|
|
5384
4865
|
declare const CompressedTokenInstructionDataApproveLayout: Layout<unknown>;
|
|
5385
4866
|
declare const CompressedTokenInstructionDataRevokeLayout: Layout<unknown>;
|
|
5386
|
-
declare function encodeApproveInstructionData(
|
|
5387
|
-
|
|
5388
|
-
): Buffer$1;
|
|
5389
|
-
declare function
|
|
5390
|
-
buffer: Buffer$1,
|
|
5391
|
-
): CompressedTokenInstructionDataApprove;
|
|
5392
|
-
declare function encodeRevokeInstructionData(
|
|
5393
|
-
data: CompressedTokenInstructionDataRevoke,
|
|
5394
|
-
): Buffer$1;
|
|
5395
|
-
declare function decodeRevokeInstructionData(
|
|
5396
|
-
buffer: Buffer$1,
|
|
5397
|
-
): CompressedTokenInstructionDataRevoke;
|
|
4867
|
+
declare function encodeApproveInstructionData(data: CompressedTokenInstructionDataApprove): Buffer$1;
|
|
4868
|
+
declare function decodeApproveInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataApprove;
|
|
4869
|
+
declare function encodeRevokeInstructionData(data: CompressedTokenInstructionDataRevoke): Buffer$1;
|
|
4870
|
+
declare function decodeRevokeInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataRevoke;
|
|
5398
4871
|
|
|
5399
4872
|
type CompressParams = {
|
|
5400
4873
|
/**
|
|
@@ -5488,11 +4961,7 @@ type DecompressParams = {
|
|
|
5488
4961
|
/**
|
|
5489
4962
|
* Token pool(s)
|
|
5490
4963
|
*/
|
|
5491
|
-
tokenPoolInfos:
|
|
5492
|
-
| TokenPoolInfo
|
|
5493
|
-
| TokenPoolInfo[]
|
|
5494
|
-
| SplInterfaceInfo
|
|
5495
|
-
| SplInterfaceInfo[];
|
|
4964
|
+
tokenPoolInfos: TokenPoolInfo | TokenPoolInfo[] | SplInterfaceInfo | SplInterfaceInfo[];
|
|
5496
4965
|
};
|
|
5497
4966
|
type TransferParams = {
|
|
5498
4967
|
/**
|
|
@@ -5777,17 +5246,12 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
5777
5246
|
/**
|
|
5778
5247
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
5779
5248
|
*/
|
|
5780
|
-
declare const parseTokenData: (
|
|
5781
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
5782
|
-
) => {
|
|
5249
|
+
declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
|
|
5783
5250
|
mint: PublicKey;
|
|
5784
5251
|
currentOwner: PublicKey;
|
|
5785
5252
|
delegate: PublicKey | null;
|
|
5786
5253
|
};
|
|
5787
|
-
declare const parseMaybeDelegatedTransfer: (
|
|
5788
|
-
inputs: ParsedTokenAccount[],
|
|
5789
|
-
outputs: TokenTransferOutputData[],
|
|
5790
|
-
) => {
|
|
5254
|
+
declare const parseMaybeDelegatedTransfer: (inputs: ParsedTokenAccount[], outputs: TokenTransferOutputData[]) => {
|
|
5791
5255
|
delegatedTransfer: DelegatedTransfer | null;
|
|
5792
5256
|
authority: PublicKey;
|
|
5793
5257
|
};
|
|
@@ -5799,11 +5263,7 @@ declare const parseMaybeDelegatedTransfer: (
|
|
|
5799
5263
|
* @returns Output token data for the transfer
|
|
5800
5264
|
* instruction
|
|
5801
5265
|
*/
|
|
5802
|
-
declare function createTransferOutputState(
|
|
5803
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
5804
|
-
toAddress: PublicKey,
|
|
5805
|
-
amount: number | BN,
|
|
5806
|
-
): TokenTransferOutputData[];
|
|
5266
|
+
declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData[];
|
|
5807
5267
|
/**
|
|
5808
5268
|
* Create the output state for a compress transaction.
|
|
5809
5269
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -5811,10 +5271,7 @@ declare function createTransferOutputState(
|
|
|
5811
5271
|
* @returns Output token data for the compress
|
|
5812
5272
|
* instruction
|
|
5813
5273
|
*/
|
|
5814
|
-
declare function createDecompressOutputState(
|
|
5815
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
5816
|
-
amount: number | BN,
|
|
5817
|
-
): TokenTransferOutputData[];
|
|
5274
|
+
declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData[];
|
|
5818
5275
|
declare class CompressedTokenProgram {
|
|
5819
5276
|
/**
|
|
5820
5277
|
* @internal
|
|
@@ -5852,17 +5309,11 @@ declare class CompressedTokenProgram {
|
|
|
5852
5309
|
*
|
|
5853
5310
|
* @returns The index and bump number.
|
|
5854
5311
|
*/
|
|
5855
|
-
static findSplInterfaceIndexAndBump(
|
|
5856
|
-
poolPda: PublicKey,
|
|
5857
|
-
mint: PublicKey,
|
|
5858
|
-
): [number, number];
|
|
5312
|
+
static findSplInterfaceIndexAndBump(poolPda: PublicKey, mint: PublicKey): [number, number];
|
|
5859
5313
|
/**
|
|
5860
5314
|
* @deprecated Use {@link findSplInterfaceIndexAndBump} instead.
|
|
5861
5315
|
*/
|
|
5862
|
-
static findTokenPoolIndexAndBump(
|
|
5863
|
-
poolPda: PublicKey,
|
|
5864
|
-
mint: PublicKey,
|
|
5865
|
-
): [number, number];
|
|
5316
|
+
static findTokenPoolIndexAndBump(poolPda: PublicKey, mint: PublicKey): [number, number];
|
|
5866
5317
|
/**
|
|
5867
5318
|
* Derive the SPL interface PDA with index.
|
|
5868
5319
|
*
|
|
@@ -5872,17 +5323,11 @@ declare class CompressedTokenProgram {
|
|
|
5872
5323
|
*
|
|
5873
5324
|
* @returns The SPL interface PDA and bump.
|
|
5874
5325
|
*/
|
|
5875
|
-
static deriveSplInterfacePdaWithIndex(
|
|
5876
|
-
mint: PublicKey,
|
|
5877
|
-
index: number,
|
|
5878
|
-
): [PublicKey, number];
|
|
5326
|
+
static deriveSplInterfacePdaWithIndex(mint: PublicKey, index: number): [PublicKey, number];
|
|
5879
5327
|
/**
|
|
5880
5328
|
* @deprecated Use {@link deriveSplInterfacePdaWithIndex} instead.
|
|
5881
5329
|
*/
|
|
5882
|
-
static deriveTokenPoolPdaWithIndex(
|
|
5883
|
-
mint: PublicKey,
|
|
5884
|
-
index: number,
|
|
5885
|
-
): [PublicKey, number];
|
|
5330
|
+
static deriveTokenPoolPdaWithIndex(mint: PublicKey, index: number): [PublicKey, number];
|
|
5886
5331
|
/** @internal */
|
|
5887
5332
|
static get deriveCpiAuthorityPda(): PublicKey;
|
|
5888
5333
|
/**
|
|
@@ -5898,23 +5343,14 @@ declare class CompressedTokenProgram {
|
|
|
5898
5343
|
* @param mintSize Optional: mint size. Default: MINT_SIZE
|
|
5899
5344
|
*
|
|
5900
5345
|
* @returns [createMintAccountInstruction, initializeMintInstruction,
|
|
5901
|
-
*
|
|
5346
|
+
* createSplInterfaceInstruction]
|
|
5902
5347
|
*
|
|
5903
|
-
* Note that `
|
|
5348
|
+
* Note that `createSplInterfaceInstruction` must be executed after
|
|
5904
5349
|
* `initializeMintInstruction`.
|
|
5905
5350
|
*/
|
|
5906
|
-
static createMint({
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
authority,
|
|
5910
|
-
freezeAuthority,
|
|
5911
|
-
decimals,
|
|
5912
|
-
rentExemptBalance,
|
|
5913
|
-
tokenProgramId,
|
|
5914
|
-
mintSize,
|
|
5915
|
-
}: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
5916
|
-
/**
|
|
5917
|
-
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
5351
|
+
static createMint({ feePayer, mint, authority, freezeAuthority, decimals, rentExemptBalance, tokenProgramId, mintSize, }: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
5352
|
+
/**
|
|
5353
|
+
* Create SPL interface (omnibus account) for an existing SPL mint.
|
|
5918
5354
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
5919
5355
|
*
|
|
5920
5356
|
* @param feePayer Fee payer.
|
|
@@ -5922,16 +5358,16 @@ declare class CompressedTokenProgram {
|
|
|
5922
5358
|
* @param tokenProgramId Optional: Token program ID. Default: SPL
|
|
5923
5359
|
* Token Program ID
|
|
5924
5360
|
*
|
|
5925
|
-
* @returns The
|
|
5361
|
+
* @returns The createSplInterface instruction
|
|
5362
|
+
*/
|
|
5363
|
+
static createSplInterface({ feePayer, mint, tokenProgramId, }: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5364
|
+
/**
|
|
5365
|
+
* @deprecated Use {@link createSplInterface} instead.
|
|
5926
5366
|
*/
|
|
5927
|
-
static createTokenPool(
|
|
5928
|
-
feePayer,
|
|
5929
|
-
mint,
|
|
5930
|
-
tokenProgramId,
|
|
5931
|
-
}: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5367
|
+
static createTokenPool(params: CreateSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5932
5368
|
/**
|
|
5933
5369
|
* Add a token pool to an existing SPL mint. For new mints, use
|
|
5934
|
-
* {@link
|
|
5370
|
+
* {@link createSplInterface}.
|
|
5935
5371
|
*
|
|
5936
5372
|
* @param feePayer Fee payer.
|
|
5937
5373
|
* @param mint SPL Mint address.
|
|
@@ -5941,12 +5377,7 @@ declare class CompressedTokenProgram {
|
|
|
5941
5377
|
*
|
|
5942
5378
|
* @returns The addTokenPool instruction
|
|
5943
5379
|
*/
|
|
5944
|
-
static addTokenPool({
|
|
5945
|
-
feePayer,
|
|
5946
|
-
mint,
|
|
5947
|
-
poolIndex,
|
|
5948
|
-
tokenProgramId,
|
|
5949
|
-
}: AddSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5380
|
+
static addTokenPool({ feePayer, mint, poolIndex, tokenProgramId, }: AddSplInterfaceParams): Promise<TransactionInstruction>;
|
|
5950
5381
|
/**
|
|
5951
5382
|
* Construct mintTo instruction for compressed tokens
|
|
5952
5383
|
*
|
|
@@ -5960,15 +5391,7 @@ declare class CompressedTokenProgram {
|
|
|
5960
5391
|
*
|
|
5961
5392
|
* @returns The mintTo instruction
|
|
5962
5393
|
*/
|
|
5963
|
-
static mintTo({
|
|
5964
|
-
feePayer,
|
|
5965
|
-
mint,
|
|
5966
|
-
authority,
|
|
5967
|
-
toPubkey,
|
|
5968
|
-
amount,
|
|
5969
|
-
outputStateTreeInfo,
|
|
5970
|
-
tokenPoolInfo,
|
|
5971
|
-
}: MintToParams): Promise<TransactionInstruction>;
|
|
5394
|
+
static mintTo({ feePayer, mint, authority, toPubkey, amount, outputStateTreeInfo, tokenPoolInfo, }: MintToParams): Promise<TransactionInstruction>;
|
|
5972
5395
|
/**
|
|
5973
5396
|
* Mint tokens from registered SPL mint account to a compressed account
|
|
5974
5397
|
*
|
|
@@ -5984,16 +5407,7 @@ declare class CompressedTokenProgram {
|
|
|
5984
5407
|
*
|
|
5985
5408
|
* @returns The mintTo instruction
|
|
5986
5409
|
*/
|
|
5987
|
-
static approveAndMintTo({
|
|
5988
|
-
feePayer,
|
|
5989
|
-
mint,
|
|
5990
|
-
authority,
|
|
5991
|
-
authorityTokenAccount,
|
|
5992
|
-
toPubkey,
|
|
5993
|
-
amount,
|
|
5994
|
-
outputStateTreeInfo,
|
|
5995
|
-
tokenPoolInfo,
|
|
5996
|
-
}: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
5410
|
+
static approveAndMintTo({ feePayer, mint, authority, authorityTokenAccount, toPubkey, amount, outputStateTreeInfo, tokenPoolInfo, }: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
5997
5411
|
/**
|
|
5998
5412
|
* Construct transfer instruction for compressed tokens.
|
|
5999
5413
|
*
|
|
@@ -6008,14 +5422,7 @@ declare class CompressedTokenProgram {
|
|
|
6008
5422
|
*
|
|
6009
5423
|
* @returns The transfer instruction
|
|
6010
5424
|
*/
|
|
6011
|
-
static transfer({
|
|
6012
|
-
payer,
|
|
6013
|
-
inputCompressedTokenAccounts,
|
|
6014
|
-
toAddress,
|
|
6015
|
-
amount,
|
|
6016
|
-
recentValidityProof,
|
|
6017
|
-
recentInputStateRootIndices,
|
|
6018
|
-
}: TransferParams): Promise<TransactionInstruction>;
|
|
5425
|
+
static transfer({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, }: TransferParams): Promise<TransactionInstruction>;
|
|
6019
5426
|
/**
|
|
6020
5427
|
* Create lookup table instructions for the token program's default
|
|
6021
5428
|
* accounts.
|
|
@@ -6028,13 +5435,7 @@ declare class CompressedTokenProgram {
|
|
|
6028
5435
|
*
|
|
6029
5436
|
* @returns [createInstruction, extendInstruction, option(extendInstruction2)]
|
|
6030
5437
|
*/
|
|
6031
|
-
static createTokenProgramLookupTable({
|
|
6032
|
-
payer,
|
|
6033
|
-
authority,
|
|
6034
|
-
mints,
|
|
6035
|
-
recentSlot,
|
|
6036
|
-
remainingAccounts,
|
|
6037
|
-
}: CreateTokenProgramLookupTableParams): Promise<{
|
|
5438
|
+
static createTokenProgramLookupTable({ payer, authority, mints, recentSlot, remainingAccounts, }: CreateTokenProgramLookupTableParams): Promise<{
|
|
6038
5439
|
instructions: TransactionInstruction[];
|
|
6039
5440
|
address: PublicKey;
|
|
6040
5441
|
}>;
|
|
@@ -6052,16 +5453,7 @@ declare class CompressedTokenProgram {
|
|
|
6052
5453
|
*
|
|
6053
5454
|
* @returns The compress instruction
|
|
6054
5455
|
*/
|
|
6055
|
-
static compress({
|
|
6056
|
-
payer,
|
|
6057
|
-
owner,
|
|
6058
|
-
source,
|
|
6059
|
-
toAddress,
|
|
6060
|
-
amount,
|
|
6061
|
-
mint,
|
|
6062
|
-
outputStateTreeInfo,
|
|
6063
|
-
tokenPoolInfo,
|
|
6064
|
-
}: CompressParams): Promise<TransactionInstruction>;
|
|
5456
|
+
static compress({ payer, owner, source, toAddress, amount, mint, outputStateTreeInfo, tokenPoolInfo, }: CompressParams): Promise<TransactionInstruction>;
|
|
6065
5457
|
/**
|
|
6066
5458
|
* Construct decompress instruction
|
|
6067
5459
|
*
|
|
@@ -6076,15 +5468,7 @@ declare class CompressedTokenProgram {
|
|
|
6076
5468
|
*
|
|
6077
5469
|
* @returns The decompress instruction
|
|
6078
5470
|
*/
|
|
6079
|
-
static decompress({
|
|
6080
|
-
payer,
|
|
6081
|
-
inputCompressedTokenAccounts,
|
|
6082
|
-
toAddress,
|
|
6083
|
-
amount,
|
|
6084
|
-
recentValidityProof,
|
|
6085
|
-
recentInputStateRootIndices,
|
|
6086
|
-
tokenPoolInfos,
|
|
6087
|
-
}: DecompressParams): Promise<TransactionInstruction>;
|
|
5471
|
+
static decompress({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, tokenPoolInfos, }: DecompressParams): Promise<TransactionInstruction>;
|
|
6088
5472
|
/**
|
|
6089
5473
|
* Create `mergeTokenAccounts` instruction.
|
|
6090
5474
|
*
|
|
@@ -6097,14 +5481,7 @@ declare class CompressedTokenProgram {
|
|
|
6097
5481
|
* @param recentInputStateRootIndices Recent state root indices.
|
|
6098
5482
|
* @returns instruction
|
|
6099
5483
|
*/
|
|
6100
|
-
static mergeTokenAccounts({
|
|
6101
|
-
payer,
|
|
6102
|
-
owner,
|
|
6103
|
-
inputCompressedTokenAccounts,
|
|
6104
|
-
mint,
|
|
6105
|
-
recentValidityProof,
|
|
6106
|
-
recentInputStateRootIndices,
|
|
6107
|
-
}: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
5484
|
+
static mergeTokenAccounts({ payer, owner, inputCompressedTokenAccounts, mint, recentValidityProof, recentInputStateRootIndices, }: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
6108
5485
|
/**
|
|
6109
5486
|
* Create `compressSplTokenAccount` instruction
|
|
6110
5487
|
*
|
|
@@ -6118,15 +5495,7 @@ declare class CompressedTokenProgram {
|
|
|
6118
5495
|
*
|
|
6119
5496
|
* @returns instruction
|
|
6120
5497
|
*/
|
|
6121
|
-
static compressSplTokenAccount({
|
|
6122
|
-
feePayer,
|
|
6123
|
-
authority,
|
|
6124
|
-
tokenAccount,
|
|
6125
|
-
mint,
|
|
6126
|
-
remainingAmount,
|
|
6127
|
-
outputStateTreeInfo,
|
|
6128
|
-
tokenPoolInfo,
|
|
6129
|
-
}: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
5498
|
+
static compressSplTokenAccount({ feePayer, authority, tokenAccount, mint, remainingAmount, outputStateTreeInfo, tokenPoolInfo, }: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
6130
5499
|
/**
|
|
6131
5500
|
* Get the program ID for a mint
|
|
6132
5501
|
*
|
|
@@ -6135,10 +5504,7 @@ declare class CompressedTokenProgram {
|
|
|
6135
5504
|
*
|
|
6136
5505
|
* @returns program ID
|
|
6137
5506
|
*/
|
|
6138
|
-
static getMintProgramId(
|
|
6139
|
-
mint: PublicKey,
|
|
6140
|
-
connection: Connection,
|
|
6141
|
-
): Promise<PublicKey | undefined>;
|
|
5507
|
+
static getMintProgramId(mint: PublicKey, connection: Connection): Promise<PublicKey | undefined>;
|
|
6142
5508
|
/**
|
|
6143
5509
|
* Create `approve` instruction to delegate compressed tokens.
|
|
6144
5510
|
*
|
|
@@ -6151,14 +5517,7 @@ declare class CompressedTokenProgram {
|
|
|
6151
5517
|
*
|
|
6152
5518
|
* @returns instruction
|
|
6153
5519
|
*/
|
|
6154
|
-
static approve({
|
|
6155
|
-
payer,
|
|
6156
|
-
inputCompressedTokenAccounts,
|
|
6157
|
-
toAddress,
|
|
6158
|
-
amount,
|
|
6159
|
-
recentValidityProof,
|
|
6160
|
-
recentInputStateRootIndices,
|
|
6161
|
-
}: ApproveParams): Promise<TransactionInstruction>;
|
|
5520
|
+
static approve({ payer, inputCompressedTokenAccounts, toAddress, amount, recentValidityProof, recentInputStateRootIndices, }: ApproveParams): Promise<TransactionInstruction>;
|
|
6162
5521
|
/**
|
|
6163
5522
|
* Create `revoke` instruction to revoke delegation of compressed tokens.
|
|
6164
5523
|
*
|
|
@@ -6169,14 +5528,16 @@ declare class CompressedTokenProgram {
|
|
|
6169
5528
|
*
|
|
6170
5529
|
* @returns instruction
|
|
6171
5530
|
*/
|
|
6172
|
-
static revoke({
|
|
6173
|
-
payer,
|
|
6174
|
-
inputCompressedTokenAccounts,
|
|
6175
|
-
recentValidityProof,
|
|
6176
|
-
recentInputStateRootIndices,
|
|
6177
|
-
}: RevokeParams): Promise<TransactionInstruction>;
|
|
5531
|
+
static revoke({ payer, inputCompressedTokenAccounts, recentValidityProof, recentInputStateRootIndices, }: RevokeParams): Promise<TransactionInstruction>;
|
|
6178
5532
|
}
|
|
6179
5533
|
|
|
5534
|
+
/**
|
|
5535
|
+
* Exports for @lightprotocol/compressed-token/unified
|
|
5536
|
+
*
|
|
5537
|
+
* Import from `/unified` to get a single unified ATA for SPL/T22 and c-token
|
|
5538
|
+
* mints.
|
|
5539
|
+
*/
|
|
5540
|
+
|
|
6180
5541
|
/**
|
|
6181
5542
|
* Get associated token account with unified balance
|
|
6182
5543
|
*
|
|
@@ -6188,18 +5549,11 @@ declare class CompressedTokenProgram {
|
|
|
6188
5549
|
* @param programId Optional program ID (omit for unified behavior)
|
|
6189
5550
|
* @returns AccountInterface with aggregated balance from all sources
|
|
6190
5551
|
*/
|
|
6191
|
-
declare function getAtaInterface(
|
|
6192
|
-
rpc: Rpc,
|
|
6193
|
-
ata: PublicKey,
|
|
6194
|
-
owner: PublicKey,
|
|
6195
|
-
mint: PublicKey,
|
|
6196
|
-
commitment?: Commitment,
|
|
6197
|
-
programId?: PublicKey,
|
|
6198
|
-
): Promise<AccountInterface>;
|
|
5552
|
+
declare function getAtaInterface(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
|
|
6199
5553
|
/**
|
|
6200
5554
|
* Derive the canonical token ATA for SPL/T22/c-token in the unified path.
|
|
6201
5555
|
*
|
|
6202
|
-
* Enforces
|
|
5556
|
+
* Enforces LIGHT_TOKEN_PROGRAM_ID.
|
|
6203
5557
|
*
|
|
6204
5558
|
* @param mint Mint public key
|
|
6205
5559
|
* @param owner Owner public key
|
|
@@ -6209,15 +5563,9 @@ declare function getAtaInterface(
|
|
|
6209
5563
|
* auto-detected.
|
|
6210
5564
|
* @returns Associated token address.
|
|
6211
5565
|
*/
|
|
6212
|
-
declare function getAssociatedTokenAddressInterface(
|
|
6213
|
-
mint: PublicKey,
|
|
6214
|
-
owner: PublicKey,
|
|
6215
|
-
allowOwnerOffCurve?: boolean,
|
|
6216
|
-
programId?: PublicKey,
|
|
6217
|
-
associatedTokenProgramId?: PublicKey,
|
|
6218
|
-
): PublicKey;
|
|
5566
|
+
declare function getAssociatedTokenAddressInterface(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): PublicKey;
|
|
6219
5567
|
/**
|
|
6220
|
-
* Create
|
|
5568
|
+
* Create instruction batches for loading ALL token balances into a c-token ATA.
|
|
6221
5569
|
*
|
|
6222
5570
|
* @param rpc RPC connection
|
|
6223
5571
|
* @param ata Associated token address
|
|
@@ -6225,16 +5573,9 @@ declare function getAssociatedTokenAddressInterface(
|
|
|
6225
5573
|
* @param mint Mint public key
|
|
6226
5574
|
* @param payer Fee payer (defaults to owner)
|
|
6227
5575
|
* @param options Optional interface options
|
|
6228
|
-
* @returns
|
|
5576
|
+
* @returns Instruction batches - each inner array is one transaction
|
|
6229
5577
|
*/
|
|
6230
|
-
declare function createLoadAtaInstructions(
|
|
6231
|
-
rpc: Rpc,
|
|
6232
|
-
ata: PublicKey,
|
|
6233
|
-
owner: PublicKey,
|
|
6234
|
-
mint: PublicKey,
|
|
6235
|
-
payer?: PublicKey,
|
|
6236
|
-
options?: InterfaceOptions,
|
|
6237
|
-
): Promise<_solana_web3_js.TransactionInstruction[]>;
|
|
5578
|
+
declare function createLoadAtaInstructions(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, payer?: PublicKey, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
|
|
6238
5579
|
/**
|
|
6239
5580
|
* Load all token balances into the c-token ATA.
|
|
6240
5581
|
*
|
|
@@ -6251,19 +5592,11 @@ declare function createLoadAtaInstructions(
|
|
|
6251
5592
|
* @param interfaceOptions Optional interface options
|
|
6252
5593
|
* @returns Transaction signature, or null if ATA exists and nothing to load
|
|
6253
5594
|
*/
|
|
6254
|
-
declare function loadAta(
|
|
6255
|
-
rpc: Rpc,
|
|
6256
|
-
ata: PublicKey,
|
|
6257
|
-
owner: Signer,
|
|
6258
|
-
mint: PublicKey,
|
|
6259
|
-
payer?: Signer,
|
|
6260
|
-
confirmOptions?: ConfirmOptions,
|
|
6261
|
-
interfaceOptions?: InterfaceOptions,
|
|
6262
|
-
): Promise<string | null>;
|
|
5595
|
+
declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKey, payer?: Signer, confirmOptions?: ConfirmOptions, interfaceOptions?: InterfaceOptions): Promise<string | null>;
|
|
6263
5596
|
/**
|
|
6264
5597
|
* Transfer tokens using the unified ata interface.
|
|
6265
5598
|
*
|
|
6266
|
-
*
|
|
5599
|
+
* Destination ATA must exist. Automatically wraps SPL/T22 to c-token ATA.
|
|
6267
5600
|
*
|
|
6268
5601
|
* @param rpc RPC connection
|
|
6269
5602
|
* @param payer Fee payer (signer)
|
|
@@ -6272,27 +5605,15 @@ declare function loadAta(
|
|
|
6272
5605
|
* @param destination Destination c-token ATA address (must exist)
|
|
6273
5606
|
* @param owner Source owner (signer)
|
|
6274
5607
|
* @param amount Amount to transfer
|
|
6275
|
-
* @param programId Token program ID (default: CTOKEN_PROGRAM_ID)
|
|
6276
5608
|
* @param confirmOptions Optional confirm options
|
|
6277
5609
|
* @param options Optional interface options
|
|
6278
5610
|
* @returns Transaction signature
|
|
6279
5611
|
*/
|
|
6280
|
-
declare function transferInterface(
|
|
6281
|
-
rpc: Rpc,
|
|
6282
|
-
payer: Signer,
|
|
6283
|
-
source: PublicKey,
|
|
6284
|
-
mint: PublicKey,
|
|
6285
|
-
destination: PublicKey,
|
|
6286
|
-
owner: Signer,
|
|
6287
|
-
amount: number | bigint | BN,
|
|
6288
|
-
programId?: PublicKey,
|
|
6289
|
-
confirmOptions?: ConfirmOptions,
|
|
6290
|
-
options?: InterfaceOptions,
|
|
6291
|
-
): Promise<string>;
|
|
5612
|
+
declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer, amount: number | bigint | BN, confirmOptions?: ConfirmOptions, options?: InterfaceOptions): Promise<string>;
|
|
6292
5613
|
/**
|
|
6293
5614
|
* Get or create c-token ATA with unified balance detection and auto-loading.
|
|
6294
5615
|
*
|
|
6295
|
-
* Enforces
|
|
5616
|
+
* Enforces LIGHT_TOKEN_PROGRAM_ID. Aggregates balances from:
|
|
6296
5617
|
* - c-token hot (on-chain) account
|
|
6297
5618
|
* - c-token cold (compressed) accounts
|
|
6298
5619
|
* - SPL token accounts (for unified wrapping)
|
|
@@ -6317,232 +5638,54 @@ declare function transferInterface(
|
|
|
6317
5638
|
* @param confirmOptions Optional confirm options
|
|
6318
5639
|
* @returns AccountInterface with unified balance and source breakdown
|
|
6319
5640
|
*/
|
|
6320
|
-
declare function getOrCreateAtaInterface(
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
ERROR_MIXED_TREE_TYPES,
|
|
6372
|
-
ERROR_NO_ACCOUNTS_FOUND,
|
|
6373
|
-
ExtensionType,
|
|
6374
|
-
IDL,
|
|
6375
|
-
type InputTokenDataWithContext,
|
|
6376
|
-
type InterfaceOptions,
|
|
6377
|
-
type LightCompressedToken,
|
|
6378
|
-
type LoadResult,
|
|
6379
|
-
MINT_TO_DISCRIMINATOR,
|
|
6380
|
-
type MergeTokenAccountsParams,
|
|
6381
|
-
type MintContext,
|
|
6382
|
-
type MintExtension,
|
|
6383
|
-
type MintInterface,
|
|
6384
|
-
type MintToInstructionData,
|
|
6385
|
-
type MintToParams,
|
|
6386
|
-
type OffChainTokenMetadata,
|
|
6387
|
-
type OffChainTokenMetadataJson,
|
|
6388
|
-
POOL_SEED,
|
|
6389
|
-
type PackCompressedTokenAccountsParams,
|
|
6390
|
-
type PackedCompressedAccount,
|
|
6391
|
-
type PackedTokenTransferOutputData,
|
|
6392
|
-
type ParsedAccountInfoInterface,
|
|
6393
|
-
REVOKE_DISCRIMINATOR,
|
|
6394
|
-
type RevokeParams,
|
|
6395
|
-
SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,
|
|
6396
|
-
type SelectInputAccountsOptions,
|
|
6397
|
-
type SelectedAccountsResult,
|
|
6398
|
-
type SplInterfaceActivity,
|
|
6399
|
-
type SplInterfaceInfo,
|
|
6400
|
-
TRANSFER_DISCRIMINATOR,
|
|
6401
|
-
type TokenAccountSource,
|
|
6402
|
-
type TokenData,
|
|
6403
|
-
TokenDataVersion,
|
|
6404
|
-
type TokenMetadata,
|
|
6405
|
-
type TokenMetadataInstructionData,
|
|
6406
|
-
type TokenPoolActivity,
|
|
6407
|
-
type TokenPoolInfo,
|
|
6408
|
-
type TokenTransferOutputData,
|
|
6409
|
-
type TransferParams,
|
|
6410
|
-
addSplInterfaces,
|
|
6411
|
-
addTokenPoolAccountsLayout,
|
|
6412
|
-
type addTokenPoolAccountsLayoutParams,
|
|
6413
|
-
addTokenPools,
|
|
6414
|
-
approve,
|
|
6415
|
-
approveAccountsLayout,
|
|
6416
|
-
type approveAccountsLayoutParams,
|
|
6417
|
-
approveAndMintTo,
|
|
6418
|
-
batchCompressLayout,
|
|
6419
|
-
calculateCompressibleLoadComputeUnits,
|
|
6420
|
-
checkMint,
|
|
6421
|
-
checkSplInterfaceInfo,
|
|
6422
|
-
checkTokenPoolInfo,
|
|
6423
|
-
compress,
|
|
6424
|
-
compressSplTokenAccount,
|
|
6425
|
-
compressSplTokenAccountInstructionDataLayout,
|
|
6426
|
-
convertTokenDataToAccount,
|
|
6427
|
-
createAssociatedCTokenAccountIdempotentInstruction,
|
|
6428
|
-
createAssociatedCTokenAccountInstruction,
|
|
6429
|
-
createAssociatedTokenAccountInterfaceIdempotentInstruction,
|
|
6430
|
-
createAssociatedTokenAccountInterfaceInstruction,
|
|
6431
|
-
createAtaInterface,
|
|
6432
|
-
createAtaInterfaceIdempotent,
|
|
6433
|
-
createAtaInterfaceIdempotentInstruction,
|
|
6434
|
-
createCTokenTransferInstruction,
|
|
6435
|
-
createDecompressInterfaceInstruction,
|
|
6436
|
-
createDecompressOutputState,
|
|
6437
|
-
createLoadAccountsParams,
|
|
6438
|
-
createLoadAtaInstructions,
|
|
6439
|
-
createLoadAtaInstructionsFromInterface,
|
|
6440
|
-
createMint,
|
|
6441
|
-
createMintInstruction,
|
|
6442
|
-
createMintInterface,
|
|
6443
|
-
createMintToCompressedInstruction,
|
|
6444
|
-
createMintToInstruction,
|
|
6445
|
-
createMintToInterfaceInstruction,
|
|
6446
|
-
createRemoveMetadataKeyInstruction,
|
|
6447
|
-
createSplInterface,
|
|
6448
|
-
createTokenMetadata,
|
|
6449
|
-
createTokenPool,
|
|
6450
|
-
createTokenPoolAccountsLayout,
|
|
6451
|
-
type createTokenPoolAccountsLayoutParams,
|
|
6452
|
-
createTokenProgramLookupTable,
|
|
6453
|
-
createTransferInterfaceInstruction,
|
|
6454
|
-
createTransferOutputState,
|
|
6455
|
-
createUnwrapInstruction,
|
|
6456
|
-
createUpdateFreezeAuthorityInstruction,
|
|
6457
|
-
createUpdateMetadataAuthorityInstruction,
|
|
6458
|
-
createUpdateMetadataFieldInstruction,
|
|
6459
|
-
createUpdateMintAuthorityInstruction,
|
|
6460
|
-
createWrapInstruction,
|
|
6461
|
-
decodeApproveInstructionData,
|
|
6462
|
-
decodeBatchCompressInstructionData,
|
|
6463
|
-
decodeCompressSplTokenAccountInstructionData,
|
|
6464
|
-
decodeMintToInstructionData,
|
|
6465
|
-
decodeRevokeInstructionData,
|
|
6466
|
-
decodeTokenMetadata,
|
|
6467
|
-
decodeTransferInstructionData,
|
|
6468
|
-
decompress,
|
|
6469
|
-
decompressDelegated,
|
|
6470
|
-
decompressInterface,
|
|
6471
|
-
deriveCMintAddress,
|
|
6472
|
-
deriveSplInterfaceInfo,
|
|
6473
|
-
deriveTokenPoolInfo,
|
|
6474
|
-
deserializeMint,
|
|
6475
|
-
encodeApproveInstructionData,
|
|
6476
|
-
encodeBatchCompressInstructionData,
|
|
6477
|
-
encodeCompressSplTokenAccountInstructionData,
|
|
6478
|
-
encodeMintToInstructionData,
|
|
6479
|
-
encodeRevokeInstructionData,
|
|
6480
|
-
encodeTokenMetadata,
|
|
6481
|
-
encodeTransferInstructionData,
|
|
6482
|
-
extractTokenMetadata,
|
|
6483
|
-
findMintAddress,
|
|
6484
|
-
freezeAccountsLayout,
|
|
6485
|
-
type freezeAccountsLayoutParams,
|
|
6486
|
-
getAccountInterface,
|
|
6487
|
-
getAssociatedCTokenAddress,
|
|
6488
|
-
getAssociatedCTokenAddressAndBump,
|
|
6489
|
-
getAssociatedTokenAddressInterface,
|
|
6490
|
-
getAtaInterface,
|
|
6491
|
-
getMintInterface,
|
|
6492
|
-
getOrCreateAtaInterface,
|
|
6493
|
-
getSplInterfaceInfos,
|
|
6494
|
-
getTokenPoolInfos,
|
|
6495
|
-
groupAccountsByTreeType,
|
|
6496
|
-
isSingleSplInterfaceInfo,
|
|
6497
|
-
isSingleTokenPoolInfo,
|
|
6498
|
-
loadAta,
|
|
6499
|
-
mergeTokenAccounts,
|
|
6500
|
-
mintTo,
|
|
6501
|
-
mintToAccountsLayout,
|
|
6502
|
-
type mintToAccountsLayoutParams,
|
|
6503
|
-
mintTo$1 as mintToCToken,
|
|
6504
|
-
mintToCompressed,
|
|
6505
|
-
mintToInterface,
|
|
6506
|
-
mintToLayout,
|
|
6507
|
-
packCompressedTokenAccounts,
|
|
6508
|
-
parseCTokenCold,
|
|
6509
|
-
parseCTokenHot,
|
|
6510
|
-
parseMaybeDelegatedTransfer,
|
|
6511
|
-
parseTokenData,
|
|
6512
|
-
removeMetadataKey,
|
|
6513
|
-
revoke,
|
|
6514
|
-
revokeAccountsLayout,
|
|
6515
|
-
type revokeAccountsLayoutParams,
|
|
6516
|
-
selectAccountsByPreferredTreeType,
|
|
6517
|
-
selectMinCompressedTokenAccountsForDecompression,
|
|
6518
|
-
selectMinCompressedTokenAccountsForTransfer,
|
|
6519
|
-
selectMinCompressedTokenAccountsForTransferOrPartial,
|
|
6520
|
-
selectSmartCompressedTokenAccountsForTransfer,
|
|
6521
|
-
selectSmartCompressedTokenAccountsForTransferOrPartial,
|
|
6522
|
-
selectSplInterfaceInfo,
|
|
6523
|
-
selectSplInterfaceInfosForDecompression,
|
|
6524
|
-
selectTokenAccountsForApprove,
|
|
6525
|
-
selectTokenPoolInfo,
|
|
6526
|
-
selectTokenPoolInfosForDecompression,
|
|
6527
|
-
serializeMint,
|
|
6528
|
-
sumUpTokenAmount,
|
|
6529
|
-
thawAccountsLayout,
|
|
6530
|
-
type thawAccountsLayoutParams,
|
|
6531
|
-
toAccountInfo,
|
|
6532
|
-
toOffChainMetadataJson,
|
|
6533
|
-
toTokenPoolInfo,
|
|
6534
|
-
transfer,
|
|
6535
|
-
transferAccountsLayout,
|
|
6536
|
-
type transferAccountsLayoutParams,
|
|
6537
|
-
transferDelegated,
|
|
6538
|
-
transferInterface,
|
|
6539
|
-
unpackMintData,
|
|
6540
|
-
unpackMintInterface,
|
|
6541
|
-
unwrap,
|
|
6542
|
-
updateFreezeAuthority,
|
|
6543
|
-
updateMetadataAuthority,
|
|
6544
|
-
updateMetadataField,
|
|
6545
|
-
updateMintAuthority,
|
|
6546
|
-
validateSameTokenOwner,
|
|
6547
|
-
wrap,
|
|
6548
|
-
};
|
|
5641
|
+
declare function getOrCreateAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey | Signer, allowOwnerOffCurve?: boolean, commitment?: Commitment, confirmOptions?: ConfirmOptions): Promise<AccountInterface>;
|
|
5642
|
+
/**
|
|
5643
|
+
* Create transfer instructions for a unified token transfer.
|
|
5644
|
+
*
|
|
5645
|
+
* Unified variant: always wraps SPL/T22 to c-token ATA.
|
|
5646
|
+
*
|
|
5647
|
+
* Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].
|
|
5648
|
+
* Use `sliceLast` to separate the parallel prefix from the final transfer.
|
|
5649
|
+
*
|
|
5650
|
+
* @see createTransferInterfaceInstructions in v3/actions/transfer-interface.ts
|
|
5651
|
+
*/
|
|
5652
|
+
declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, recipient: PublicKey, options?: Omit<TransferOptions, 'wrap'>): Promise<TransactionInstruction[][]>;
|
|
5653
|
+
/**
|
|
5654
|
+
* Build instruction batches for unwrapping c-tokens to SPL/T22.
|
|
5655
|
+
*
|
|
5656
|
+
* Unified variant: uses wrap=true for loading, so SPL/T22 balances are
|
|
5657
|
+
* consolidated before unwrapping.
|
|
5658
|
+
*
|
|
5659
|
+
* Returns `TransactionInstruction[][]`. Load batches (if any) come first,
|
|
5660
|
+
* followed by one final unwrap transaction.
|
|
5661
|
+
*
|
|
5662
|
+
* @param rpc RPC connection
|
|
5663
|
+
* @param destination Destination SPL/T22 token account (must exist)
|
|
5664
|
+
* @param owner Owner of the c-token
|
|
5665
|
+
* @param mint Mint address
|
|
5666
|
+
* @param amount Amount to unwrap (defaults to full balance)
|
|
5667
|
+
* @param payer Fee payer (defaults to owner)
|
|
5668
|
+
* @param splInterfaceInfo Optional: SPL interface info
|
|
5669
|
+
* @param interfaceOptions Optional: interface options for load
|
|
5670
|
+
* @returns Instruction batches - each inner array is one transaction
|
|
5671
|
+
*/
|
|
5672
|
+
declare function createUnwrapInstructions(rpc: Rpc, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount?: number | bigint | BN, payer?: PublicKey, splInterfaceInfo?: SplInterfaceInfo, interfaceOptions?: InterfaceOptions): Promise<TransactionInstruction[][]>;
|
|
5673
|
+
/**
|
|
5674
|
+
* Unwrap c-tokens to SPL tokens.
|
|
5675
|
+
*
|
|
5676
|
+
* Unified variant: loads all cold + SPL/T22 balances to c-token ATA first,
|
|
5677
|
+
* then unwraps to the destination SPL/T22 account.
|
|
5678
|
+
*
|
|
5679
|
+
* @param rpc RPC connection
|
|
5680
|
+
* @param payer Fee payer
|
|
5681
|
+
* @param destination Destination SPL/T22 token account
|
|
5682
|
+
* @param owner Owner of the c-token (signer)
|
|
5683
|
+
* @param mint Mint address
|
|
5684
|
+
* @param amount Amount to unwrap (defaults to all)
|
|
5685
|
+
* @param splInterfaceInfo SPL interface info
|
|
5686
|
+
* @param confirmOptions Confirm options
|
|
5687
|
+
* @returns Transaction signature of the unwrap transaction
|
|
5688
|
+
*/
|
|
5689
|
+
declare function unwrap(rpc: Rpc, payer: Signer, destination: PublicKey, owner: Signer, mint: PublicKey, amount?: number | bigint | BN, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<string>;
|
|
5690
|
+
|
|
5691
|
+
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, COMPRESSED_MINT_SEED, 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 TransferOptions, type TransferParams, addSplInterfaces, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, batchCompressLayout, calculateCompressibleLoadComputeUnits, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createAssociatedCTokenAccountIdempotentInstruction, createAssociatedCTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressInterfaceInstruction, createDecompressOutputState, createLightTokenTransferInstruction, createLoadAccountsParams, createLoadAtaInstructions, createLoadAtaInstructionsFromInterface, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstructions, createTransferOutputState, createUnwrapInstruction, createUnwrapInstructions, createUpdateFreezeAuthorityInstruction, createUpdateMetadataAuthorityInstruction, createUpdateMetadataFieldInstruction, createUpdateMintAuthorityInstruction, createWrapInstruction, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTokenMetadata, decodeTransferInstructionData, decompress, decompressDelegated, decompressInterface, deriveCMintAddress, deriveSplInterfaceInfo, deriveTokenPoolInfo, deserializeMint, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTokenMetadata, encodeTransferInstructionData, extractTokenMetadata, findMintAddress, freezeAccountsLayout, type freezeAccountsLayoutParams, getAccountInterface, getAssociatedCTokenAddress, getAssociatedCTokenAddressAndBump, 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, sliceLast, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, unpackMintData, unpackMintInterface, unwrap, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
|