@lightprotocol/compressed-token 0.20.3 → 0.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser/index.cjs +1 -5798
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +1 -4531
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/types/index.d.ts +159 -339
- package/package.json +4 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
CompressedProof,
|
|
4
|
-
ParsedTokenAccount,
|
|
5
|
-
InputTokenDataWithContext as InputTokenDataWithContext$1,
|
|
6
|
-
Rpc,
|
|
7
|
-
} from '@lightprotocol/stateless.js';
|
|
8
|
-
import {
|
|
9
|
-
PublicKey,
|
|
10
|
-
AccountMeta,
|
|
11
|
-
TransactionInstruction,
|
|
12
|
-
Connection,
|
|
13
|
-
Signer,
|
|
14
|
-
ConfirmOptions,
|
|
15
|
-
TransactionSignature,
|
|
16
|
-
Keypair,
|
|
17
|
-
} from '@solana/web3.js';
|
|
1
|
+
import { PackedMerkleContext, CompressedProof, ParsedTokenAccount, InputTokenDataWithContext as InputTokenDataWithContext$1, Rpc } from '@lightprotocol/stateless.js';
|
|
2
|
+
import { PublicKey, AccountMeta, TransactionInstruction, Connection, Signer, ConfirmOptions, TransactionSignature, Keypair } from '@solana/web3.js';
|
|
18
3
|
import BN from 'bn.js';
|
|
19
4
|
import * as buffer_layout from 'buffer-layout';
|
|
20
5
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
@@ -175,9 +160,7 @@ type PackCompressedTokenAccountsParams = {
|
|
|
175
160
|
/**
|
|
176
161
|
* Packs Compressed Token Accounts.
|
|
177
162
|
*/
|
|
178
|
-
declare function packCompressedTokenAccounts(
|
|
179
|
-
params: PackCompressedTokenAccountsParams,
|
|
180
|
-
): {
|
|
163
|
+
declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
|
|
181
164
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
182
165
|
remainingAccountMetas: AccountMeta[];
|
|
183
166
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -518,9 +501,7 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
518
501
|
/**
|
|
519
502
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
520
503
|
*/
|
|
521
|
-
declare const parseTokenData: (
|
|
522
|
-
compressedTokenAccounts: ParsedTokenAccount[],
|
|
523
|
-
) => {
|
|
504
|
+
declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
|
|
524
505
|
mint: PublicKey;
|
|
525
506
|
currentOwner: PublicKey;
|
|
526
507
|
delegate: PublicKey | null;
|
|
@@ -533,11 +514,7 @@ declare const parseTokenData: (
|
|
|
533
514
|
* @returns Output token data for the transfer
|
|
534
515
|
* instruction
|
|
535
516
|
*/
|
|
536
|
-
declare function createTransferOutputState(
|
|
537
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
538
|
-
toAddress: PublicKey,
|
|
539
|
-
amount: number | BN,
|
|
540
|
-
): TokenTransferOutputData[];
|
|
517
|
+
declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData[];
|
|
541
518
|
/**
|
|
542
519
|
* Create the output state for a compress transaction.
|
|
543
520
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -545,10 +522,7 @@ declare function createTransferOutputState(
|
|
|
545
522
|
* @returns Output token data for the compress
|
|
546
523
|
* instruction
|
|
547
524
|
*/
|
|
548
|
-
declare function createDecompressOutputState(
|
|
549
|
-
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
550
|
-
amount: number | BN,
|
|
551
|
-
): TokenTransferOutputData[];
|
|
525
|
+
declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData[];
|
|
552
526
|
declare class CompressedTokenProgram {
|
|
553
527
|
/**
|
|
554
528
|
* @internal
|
|
@@ -575,16 +549,12 @@ declare class CompressedTokenProgram {
|
|
|
575
549
|
*
|
|
576
550
|
* Note that `createTokenPoolInstruction` must be executed after `initializeMintInstruction`.
|
|
577
551
|
*/
|
|
578
|
-
static createMint(
|
|
579
|
-
params: CreateMintParams,
|
|
580
|
-
): Promise<TransactionInstruction[]>;
|
|
552
|
+
static createMint(params: CreateMintParams): Promise<TransactionInstruction[]>;
|
|
581
553
|
/**
|
|
582
554
|
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
583
555
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
584
556
|
*/
|
|
585
|
-
static createTokenPool(
|
|
586
|
-
params: RegisterMintParams,
|
|
587
|
-
): Promise<TransactionInstruction>;
|
|
557
|
+
static createTokenPool(params: RegisterMintParams): Promise<TransactionInstruction>;
|
|
588
558
|
/**
|
|
589
559
|
* Construct mintTo instruction for compressed tokens
|
|
590
560
|
*/
|
|
@@ -592,9 +562,7 @@ declare class CompressedTokenProgram {
|
|
|
592
562
|
/**
|
|
593
563
|
* Mint tokens from registered SPL mint account to a compressed account
|
|
594
564
|
*/
|
|
595
|
-
static approveAndMintTo(
|
|
596
|
-
params: ApproveAndMintToParams,
|
|
597
|
-
): Promise<TransactionInstruction[]>;
|
|
565
|
+
static approveAndMintTo(params: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
|
|
598
566
|
/**
|
|
599
567
|
* Construct transfer instruction for compressed tokens
|
|
600
568
|
*/
|
|
@@ -602,9 +570,7 @@ declare class CompressedTokenProgram {
|
|
|
602
570
|
/**
|
|
603
571
|
* Create lookup table instructions for the token program's default accounts.
|
|
604
572
|
*/
|
|
605
|
-
static createTokenProgramLookupTable(
|
|
606
|
-
params: CreateTokenProgramLookupTableParams,
|
|
607
|
-
): Promise<{
|
|
573
|
+
static createTokenProgramLookupTable(params: CreateTokenProgramLookupTableParams): Promise<{
|
|
608
574
|
instructions: TransactionInstruction[];
|
|
609
575
|
address: PublicKey;
|
|
610
576
|
}>;
|
|
@@ -616,19 +582,10 @@ declare class CompressedTokenProgram {
|
|
|
616
582
|
/**
|
|
617
583
|
* Construct decompress instruction
|
|
618
584
|
*/
|
|
619
|
-
static decompress(
|
|
620
|
-
|
|
621
|
-
): Promise<TransactionInstruction>;
|
|
622
|
-
static
|
|
623
|
-
params: MergeTokenAccountsParams,
|
|
624
|
-
): Promise<TransactionInstruction[]>;
|
|
625
|
-
static compressSplTokenAccount(
|
|
626
|
-
params: CompressSplTokenAccountParams,
|
|
627
|
-
): Promise<TransactionInstruction>;
|
|
628
|
-
static get_mint_program_id(
|
|
629
|
-
mint: PublicKey,
|
|
630
|
-
connection: Connection,
|
|
631
|
-
): Promise<PublicKey | undefined>;
|
|
585
|
+
static decompress(params: DecompressParams): Promise<TransactionInstruction>;
|
|
586
|
+
static mergeTokenAccounts(params: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
|
|
587
|
+
static compressSplTokenAccount(params: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
|
|
588
|
+
static get_mint_program_id(mint: PublicKey, connection: Connection): Promise<PublicKey | undefined>;
|
|
632
589
|
}
|
|
633
590
|
|
|
634
591
|
/**
|
|
@@ -646,17 +603,7 @@ declare class CompressedTokenProgram {
|
|
|
646
603
|
*
|
|
647
604
|
* @return Signature of the confirmed transaction
|
|
648
605
|
*/
|
|
649
|
-
declare function approveAndMintTo(
|
|
650
|
-
rpc: Rpc,
|
|
651
|
-
payer: Signer,
|
|
652
|
-
mint: PublicKey,
|
|
653
|
-
destination: PublicKey,
|
|
654
|
-
authority: Signer,
|
|
655
|
-
amount: number | BN,
|
|
656
|
-
merkleTree?: PublicKey,
|
|
657
|
-
confirmOptions?: ConfirmOptions,
|
|
658
|
-
tokenProgramId?: PublicKey,
|
|
659
|
-
): Promise<TransactionSignature>;
|
|
606
|
+
declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer, amount: number | BN, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
660
607
|
|
|
661
608
|
/**
|
|
662
609
|
* Compress SPL tokens
|
|
@@ -676,18 +623,7 @@ declare function approveAndMintTo(
|
|
|
676
623
|
*
|
|
677
624
|
* @return Signature of the confirmed transaction
|
|
678
625
|
*/
|
|
679
|
-
declare function compress(
|
|
680
|
-
rpc: Rpc,
|
|
681
|
-
payer: Signer,
|
|
682
|
-
mint: PublicKey,
|
|
683
|
-
amount: number | BN | number[] | BN[],
|
|
684
|
-
owner: Signer,
|
|
685
|
-
sourceTokenAccount: PublicKey,
|
|
686
|
-
toAddress: PublicKey | Array<PublicKey>,
|
|
687
|
-
merkleTree?: PublicKey,
|
|
688
|
-
confirmOptions?: ConfirmOptions,
|
|
689
|
-
tokenProgramId?: PublicKey,
|
|
690
|
-
): Promise<TransactionSignature>;
|
|
626
|
+
declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN | number[] | BN[], owner: Signer, sourceTokenAccount: PublicKey, toAddress: PublicKey | Array<PublicKey>, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
691
627
|
|
|
692
628
|
/**
|
|
693
629
|
* Decompress compressed tokens
|
|
@@ -707,17 +643,7 @@ declare function compress(
|
|
|
707
643
|
*
|
|
708
644
|
* @return Signature of the confirmed transaction
|
|
709
645
|
*/
|
|
710
|
-
declare function decompress(
|
|
711
|
-
rpc: Rpc,
|
|
712
|
-
payer: Signer,
|
|
713
|
-
mint: PublicKey,
|
|
714
|
-
amount: number | BN,
|
|
715
|
-
owner: Signer,
|
|
716
|
-
toAddress: PublicKey,
|
|
717
|
-
merkleTree?: PublicKey,
|
|
718
|
-
confirmOptions?: ConfirmOptions,
|
|
719
|
-
tokenProgramId?: PublicKey,
|
|
720
|
-
): Promise<TransactionSignature>;
|
|
646
|
+
declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
721
647
|
|
|
722
648
|
/**
|
|
723
649
|
* Create and initialize a new compressed token mint
|
|
@@ -736,16 +662,7 @@ declare function decompress(
|
|
|
736
662
|
*
|
|
737
663
|
* @return Address of the new mint and the transaction signature
|
|
738
664
|
*/
|
|
739
|
-
declare function createMint(
|
|
740
|
-
rpc: Rpc,
|
|
741
|
-
payer: Signer,
|
|
742
|
-
mintAuthority: PublicKey,
|
|
743
|
-
decimals: number,
|
|
744
|
-
keypair?: Keypair,
|
|
745
|
-
confirmOptions?: ConfirmOptions,
|
|
746
|
-
tokenProgramId?: PublicKey | boolean,
|
|
747
|
-
freezeAuthority?: PublicKey,
|
|
748
|
-
): Promise<{
|
|
665
|
+
declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey | boolean, freezeAuthority?: PublicKey): Promise<{
|
|
749
666
|
mint: PublicKey;
|
|
750
667
|
transactionSignature: TransactionSignature;
|
|
751
668
|
}>;
|
|
@@ -767,17 +684,7 @@ declare function createMint(
|
|
|
767
684
|
*
|
|
768
685
|
* @return Signature of the confirmed transaction
|
|
769
686
|
*/
|
|
770
|
-
declare function mintTo(
|
|
771
|
-
rpc: Rpc,
|
|
772
|
-
payer: Signer,
|
|
773
|
-
mint: PublicKey,
|
|
774
|
-
destination: PublicKey | PublicKey[],
|
|
775
|
-
authority: Signer,
|
|
776
|
-
amount: number | BN | number[] | BN[],
|
|
777
|
-
merkleTree?: PublicKey,
|
|
778
|
-
confirmOptions?: ConfirmOptions,
|
|
779
|
-
tokenProgramId?: PublicKey,
|
|
780
|
-
): Promise<TransactionSignature>;
|
|
687
|
+
declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey | PublicKey[], authority: Signer, amount: number | BN | number[] | BN[], merkleTree?: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
781
688
|
|
|
782
689
|
/**
|
|
783
690
|
* Merge multiple compressed token accounts for a given mint into a single
|
|
@@ -792,14 +699,7 @@ declare function mintTo(
|
|
|
792
699
|
*
|
|
793
700
|
* @return Array of transaction signatures
|
|
794
701
|
*/
|
|
795
|
-
declare function mergeTokenAccounts(
|
|
796
|
-
rpc: Rpc,
|
|
797
|
-
payer: Signer,
|
|
798
|
-
mint: PublicKey,
|
|
799
|
-
owner: Signer,
|
|
800
|
-
merkleTree?: PublicKey,
|
|
801
|
-
confirmOptions?: ConfirmOptions,
|
|
802
|
-
): Promise<TransactionSignature>;
|
|
702
|
+
declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
803
703
|
|
|
804
704
|
/**
|
|
805
705
|
* Register an existing mint with the CompressedToken program
|
|
@@ -812,13 +712,7 @@ declare function mergeTokenAccounts(
|
|
|
812
712
|
*
|
|
813
713
|
* @return transaction signature
|
|
814
714
|
*/
|
|
815
|
-
declare function createTokenPool(
|
|
816
|
-
rpc: Rpc,
|
|
817
|
-
payer: Signer,
|
|
818
|
-
mint: PublicKey,
|
|
819
|
-
confirmOptions?: ConfirmOptions,
|
|
820
|
-
tokenProgramId?: PublicKey,
|
|
821
|
-
): Promise<TransactionSignature>;
|
|
715
|
+
declare function createTokenPool(rpc: Rpc, payer: Signer, mint: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
822
716
|
|
|
823
717
|
/**
|
|
824
718
|
* Transfer compressed tokens from one owner to another
|
|
@@ -837,31 +731,7 @@ declare function createTokenPool(
|
|
|
837
731
|
*
|
|
838
732
|
* @return Signature of the confirmed transaction
|
|
839
733
|
*/
|
|
840
|
-
declare function transfer(
|
|
841
|
-
rpc: Rpc,
|
|
842
|
-
payer: Signer,
|
|
843
|
-
mint: PublicKey,
|
|
844
|
-
amount: number | BN,
|
|
845
|
-
owner: Signer,
|
|
846
|
-
toAddress: PublicKey,
|
|
847
|
-
merkleTree?: PublicKey,
|
|
848
|
-
confirmOptions?: ConfirmOptions,
|
|
849
|
-
): Promise<TransactionSignature>;
|
|
850
|
-
/**
|
|
851
|
-
* Selects the minimal number of compressed token accounts for a transfer.
|
|
852
|
-
*
|
|
853
|
-
* 1. Sorts the accounts by amount in descending order
|
|
854
|
-
* 2. Accumulates the amount until it is greater than or equal to the transfer
|
|
855
|
-
* amount
|
|
856
|
-
*/
|
|
857
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
858
|
-
accounts: ParsedTokenAccount[],
|
|
859
|
-
transferAmount: BN,
|
|
860
|
-
): [
|
|
861
|
-
selectedAccounts: ParsedTokenAccount[],
|
|
862
|
-
total: BN,
|
|
863
|
-
totalLamports: BN | null,
|
|
864
|
-
];
|
|
734
|
+
declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
865
735
|
|
|
866
736
|
/**
|
|
867
737
|
* Create a lookup table for the token program's default accounts
|
|
@@ -876,13 +746,7 @@ declare function selectMinCompressedTokenAccountsForTransfer(
|
|
|
876
746
|
*
|
|
877
747
|
* @return Transaction signatures and the address of the created lookup table
|
|
878
748
|
*/
|
|
879
|
-
declare function createTokenProgramLookupTable(
|
|
880
|
-
rpc: Rpc,
|
|
881
|
-
payer: Signer,
|
|
882
|
-
authority: Signer,
|
|
883
|
-
mints?: PublicKey[],
|
|
884
|
-
additionalAccounts?: PublicKey[],
|
|
885
|
-
): Promise<{
|
|
749
|
+
declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
|
|
886
750
|
txIds: TransactionSignature[];
|
|
887
751
|
address: PublicKey;
|
|
888
752
|
}>;
|
|
@@ -901,41 +765,19 @@ declare function createTokenProgramLookupTable(
|
|
|
901
765
|
*
|
|
902
766
|
* @return Signature of the confirmed transaction
|
|
903
767
|
*/
|
|
904
|
-
declare function compressSplTokenAccount(
|
|
905
|
-
rpc: Rpc,
|
|
906
|
-
payer: Signer,
|
|
907
|
-
mint: PublicKey,
|
|
908
|
-
owner: Signer,
|
|
909
|
-
tokenAccount: PublicKey,
|
|
910
|
-
outputStateTree: PublicKey,
|
|
911
|
-
remainingAmount?: BN,
|
|
912
|
-
confirmOptions?: ConfirmOptions,
|
|
913
|
-
tokenProgramId?: PublicKey,
|
|
914
|
-
): Promise<TransactionSignature>;
|
|
768
|
+
declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, outputStateTree: PublicKey, remainingAmount?: BN, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
|
|
915
769
|
|
|
916
770
|
declare const DelegatedTransferLayout: buffer_layout.Layout<unknown>;
|
|
917
771
|
declare const CpiContextLayout: buffer_layout.Layout<unknown>;
|
|
918
772
|
declare const CompressedTokenInstructionDataTransferLayout: buffer_layout.Layout<unknown>;
|
|
919
773
|
declare const mintToLayout: buffer_layout.Layout<unknown>;
|
|
920
774
|
declare const compressSplTokenAccountInstructionDataLayout: buffer_layout.Layout<unknown>;
|
|
921
|
-
declare function encodeMintToInstructionData(
|
|
922
|
-
|
|
923
|
-
): Buffer$1;
|
|
924
|
-
declare function
|
|
925
|
-
|
|
926
|
-
):
|
|
927
|
-
declare function encodeCompressSplTokenAccountInstructionData(
|
|
928
|
-
data: CompressSplTokenAccountInstructionData,
|
|
929
|
-
): Buffer$1;
|
|
930
|
-
declare function decodeCompressSplTokenAccountInstructionData(
|
|
931
|
-
buffer: Buffer$1,
|
|
932
|
-
): CompressSplTokenAccountInstructionData;
|
|
933
|
-
declare function encodeTransferInstructionData(
|
|
934
|
-
data: CompressedTokenInstructionDataTransfer,
|
|
935
|
-
): Buffer$1;
|
|
936
|
-
declare function decodeTransferInstructionData(
|
|
937
|
-
buffer: Buffer$1,
|
|
938
|
-
): CompressedTokenInstructionDataTransfer;
|
|
775
|
+
declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
|
|
776
|
+
declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
|
|
777
|
+
declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
|
|
778
|
+
declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
|
|
779
|
+
declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
|
|
780
|
+
declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
|
|
939
781
|
interface BaseAccountsLayoutParams {
|
|
940
782
|
feePayer: PublicKey;
|
|
941
783
|
authority: PublicKey;
|
|
@@ -974,15 +816,9 @@ type freezeAccountsLayoutParams = BaseAccountsLayoutParams & {
|
|
|
974
816
|
mint: PublicKey;
|
|
975
817
|
};
|
|
976
818
|
type thawAccountsLayoutParams = freezeAccountsLayoutParams;
|
|
977
|
-
declare const createTokenPoolAccountsLayout: (
|
|
978
|
-
|
|
979
|
-
) => AccountMeta[];
|
|
980
|
-
declare const mintToAccountsLayout: (
|
|
981
|
-
accounts: mintToAccountsLayoutParams,
|
|
982
|
-
) => AccountMeta[];
|
|
983
|
-
declare const transferAccountsLayout: (
|
|
984
|
-
accounts: transferAccountsLayoutParams,
|
|
985
|
-
) => AccountMeta[];
|
|
819
|
+
declare const createTokenPoolAccountsLayout: (accounts: createTokenPoolAccountsLayoutParams) => AccountMeta[];
|
|
820
|
+
declare const mintToAccountsLayout: (accounts: mintToAccountsLayoutParams) => AccountMeta[];
|
|
821
|
+
declare const transferAccountsLayout: (accounts: transferAccountsLayoutParams) => AccountMeta[];
|
|
986
822
|
|
|
987
823
|
type LightCompressedToken = {
|
|
988
824
|
version: '1.2.0';
|
|
@@ -994,7 +830,7 @@ type LightCompressedToken = {
|
|
|
994
830
|
'This instruction creates a token pool for a given mint. Every spl mint',
|
|
995
831
|
'can have one token pool. When a token is compressed the tokens are',
|
|
996
832
|
'transferrred to the token pool, and their compressed equivalent is',
|
|
997
|
-
'minted into a Merkle tree.'
|
|
833
|
+
'minted into a Merkle tree.'
|
|
998
834
|
];
|
|
999
835
|
accounts: [
|
|
1000
836
|
{
|
|
@@ -1027,7 +863,7 @@ type LightCompressedToken = {
|
|
|
1027
863
|
name: 'cpiAuthorityPda';
|
|
1028
864
|
isMut: false;
|
|
1029
865
|
isSigner: false;
|
|
1030
|
-
}
|
|
866
|
+
}
|
|
1031
867
|
];
|
|
1032
868
|
args: [];
|
|
1033
869
|
},
|
|
@@ -1035,7 +871,7 @@ type LightCompressedToken = {
|
|
|
1035
871
|
name: 'addTokenPool';
|
|
1036
872
|
docs: [
|
|
1037
873
|
'This instruction creates an additional token pool for a given mint.',
|
|
1038
|
-
'The maximum number of token pools per mint is 5.'
|
|
874
|
+
'The maximum number of token pools per mint is 5.'
|
|
1039
875
|
];
|
|
1040
876
|
accounts: [
|
|
1041
877
|
{
|
|
@@ -1073,13 +909,13 @@ type LightCompressedToken = {
|
|
|
1073
909
|
name: 'cpiAuthorityPda';
|
|
1074
910
|
isMut: false;
|
|
1075
911
|
isSigner: false;
|
|
1076
|
-
}
|
|
912
|
+
}
|
|
1077
913
|
];
|
|
1078
914
|
args: [
|
|
1079
915
|
{
|
|
1080
916
|
name: 'tokenPoolIndex';
|
|
1081
917
|
type: 'u8';
|
|
1082
|
-
}
|
|
918
|
+
}
|
|
1083
919
|
];
|
|
1084
920
|
},
|
|
1085
921
|
{
|
|
@@ -1091,7 +927,7 @@ type LightCompressedToken = {
|
|
|
1091
927
|
'every amount and pubkey input pair. A constant amount of lamports can be',
|
|
1092
928
|
'transferred to each output account to enable. A use case to add lamports',
|
|
1093
929
|
'to a compressed token account is to prevent spam. This is the only way',
|
|
1094
|
-
'to add lamports to a compressed token account.'
|
|
930
|
+
'to add lamports to a compressed token account.'
|
|
1095
931
|
];
|
|
1096
932
|
accounts: [
|
|
1097
933
|
{
|
|
@@ -1171,7 +1007,7 @@ type LightCompressedToken = {
|
|
|
1171
1007
|
isMut: true;
|
|
1172
1008
|
isSigner: false;
|
|
1173
1009
|
isOptional: true;
|
|
1174
|
-
}
|
|
1010
|
+
}
|
|
1175
1011
|
];
|
|
1176
1012
|
args: [
|
|
1177
1013
|
{
|
|
@@ -1191,7 +1027,7 @@ type LightCompressedToken = {
|
|
|
1191
1027
|
type: {
|
|
1192
1028
|
option: 'u64';
|
|
1193
1029
|
};
|
|
1194
|
-
}
|
|
1030
|
+
}
|
|
1195
1031
|
];
|
|
1196
1032
|
},
|
|
1197
1033
|
{
|
|
@@ -1199,7 +1035,7 @@ type LightCompressedToken = {
|
|
|
1199
1035
|
docs: [
|
|
1200
1036
|
'Compresses the balance of an spl token account sub an optional remaining',
|
|
1201
1037
|
'amount. This instruction does not close the spl token account. To close',
|
|
1202
|
-
'the account bundle a close spl account instruction in your transaction.'
|
|
1038
|
+
'the account bundle a close spl account instruction in your transaction.'
|
|
1203
1039
|
];
|
|
1204
1040
|
accounts: [
|
|
1205
1041
|
{
|
|
@@ -1215,7 +1051,7 @@ type LightCompressedToken = {
|
|
|
1215
1051
|
docs: [
|
|
1216
1052
|
'Authority is verified through proof since both owner and delegate',
|
|
1217
1053
|
'are included in the token data hash, which is a public input to the',
|
|
1218
|
-
'validity proof.'
|
|
1054
|
+
'validity proof.'
|
|
1219
1055
|
];
|
|
1220
1056
|
},
|
|
1221
1057
|
{
|
|
@@ -1276,7 +1112,7 @@ type LightCompressedToken = {
|
|
|
1276
1112
|
name: 'systemProgram';
|
|
1277
1113
|
isMut: false;
|
|
1278
1114
|
isSigner: false;
|
|
1279
|
-
}
|
|
1115
|
+
}
|
|
1280
1116
|
];
|
|
1281
1117
|
args: [
|
|
1282
1118
|
{
|
|
@@ -1296,7 +1132,7 @@ type LightCompressedToken = {
|
|
|
1296
1132
|
defined: 'CompressedCpiContext';
|
|
1297
1133
|
};
|
|
1298
1134
|
};
|
|
1299
|
-
}
|
|
1135
|
+
}
|
|
1300
1136
|
];
|
|
1301
1137
|
},
|
|
1302
1138
|
{
|
|
@@ -1309,7 +1145,7 @@ type LightCompressedToken = {
|
|
|
1309
1145
|
'accounts specify less lamports than inputs the remaining lamports are',
|
|
1310
1146
|
'transferred to an output compressed account. Signer must be owner or',
|
|
1311
1147
|
'delegate. If a delegated token account is transferred the delegate is',
|
|
1312
|
-
'not preserved.'
|
|
1148
|
+
'not preserved.'
|
|
1313
1149
|
];
|
|
1314
1150
|
accounts: [
|
|
1315
1151
|
{
|
|
@@ -1325,7 +1161,7 @@ type LightCompressedToken = {
|
|
|
1325
1161
|
docs: [
|
|
1326
1162
|
'Authority is verified through proof since both owner and delegate',
|
|
1327
1163
|
'are included in the token data hash, which is a public input to the',
|
|
1328
|
-
'validity proof.'
|
|
1164
|
+
'validity proof.'
|
|
1329
1165
|
];
|
|
1330
1166
|
},
|
|
1331
1167
|
{
|
|
@@ -1386,13 +1222,13 @@ type LightCompressedToken = {
|
|
|
1386
1222
|
name: 'systemProgram';
|
|
1387
1223
|
isMut: false;
|
|
1388
1224
|
isSigner: false;
|
|
1389
|
-
}
|
|
1225
|
+
}
|
|
1390
1226
|
];
|
|
1391
1227
|
args: [
|
|
1392
1228
|
{
|
|
1393
1229
|
name: 'inputs';
|
|
1394
1230
|
type: 'bytes';
|
|
1395
|
-
}
|
|
1231
|
+
}
|
|
1396
1232
|
];
|
|
1397
1233
|
},
|
|
1398
1234
|
{
|
|
@@ -1403,7 +1239,7 @@ type LightCompressedToken = {
|
|
|
1403
1239
|
'be called by a delegate.',
|
|
1404
1240
|
'The instruction creates two output accounts:',
|
|
1405
1241
|
'1. one account with delegated amount',
|
|
1406
|
-
'2. one account with remaining(change) amount'
|
|
1242
|
+
'2. one account with remaining(change) amount'
|
|
1407
1243
|
];
|
|
1408
1244
|
accounts: [
|
|
1409
1245
|
{
|
|
@@ -1419,7 +1255,7 @@ type LightCompressedToken = {
|
|
|
1419
1255
|
docs: [
|
|
1420
1256
|
'Authority is verified through proof since both owner and delegate',
|
|
1421
1257
|
'are included in the token data hash, which is a public input to the',
|
|
1422
|
-
'validity proof.'
|
|
1258
|
+
'validity proof.'
|
|
1423
1259
|
];
|
|
1424
1260
|
},
|
|
1425
1261
|
{
|
|
@@ -1462,20 +1298,20 @@ type LightCompressedToken = {
|
|
|
1462
1298
|
name: 'systemProgram';
|
|
1463
1299
|
isMut: false;
|
|
1464
1300
|
isSigner: false;
|
|
1465
|
-
}
|
|
1301
|
+
}
|
|
1466
1302
|
];
|
|
1467
1303
|
args: [
|
|
1468
1304
|
{
|
|
1469
1305
|
name: 'inputs';
|
|
1470
1306
|
type: 'bytes';
|
|
1471
|
-
}
|
|
1307
|
+
}
|
|
1472
1308
|
];
|
|
1473
1309
|
},
|
|
1474
1310
|
{
|
|
1475
1311
|
name: 'revoke';
|
|
1476
1312
|
docs: [
|
|
1477
1313
|
'Revokes a delegation. The instruction merges all inputs into one output',
|
|
1478
|
-
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
1314
|
+
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
1479
1315
|
];
|
|
1480
1316
|
accounts: [
|
|
1481
1317
|
{
|
|
@@ -1491,7 +1327,7 @@ type LightCompressedToken = {
|
|
|
1491
1327
|
docs: [
|
|
1492
1328
|
'Authority is verified through proof since both owner and delegate',
|
|
1493
1329
|
'are included in the token data hash, which is a public input to the',
|
|
1494
|
-
'validity proof.'
|
|
1330
|
+
'validity proof.'
|
|
1495
1331
|
];
|
|
1496
1332
|
},
|
|
1497
1333
|
{
|
|
@@ -1534,20 +1370,20 @@ type LightCompressedToken = {
|
|
|
1534
1370
|
name: 'systemProgram';
|
|
1535
1371
|
isMut: false;
|
|
1536
1372
|
isSigner: false;
|
|
1537
|
-
}
|
|
1373
|
+
}
|
|
1538
1374
|
];
|
|
1539
1375
|
args: [
|
|
1540
1376
|
{
|
|
1541
1377
|
name: 'inputs';
|
|
1542
1378
|
type: 'bytes';
|
|
1543
|
-
}
|
|
1379
|
+
}
|
|
1544
1380
|
];
|
|
1545
1381
|
},
|
|
1546
1382
|
{
|
|
1547
1383
|
name: 'freeze';
|
|
1548
1384
|
docs: [
|
|
1549
1385
|
'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
|
|
1550
|
-
'many outputs as inputs. Balances and delegates are preserved.'
|
|
1386
|
+
'many outputs as inputs. Balances and delegates are preserved.'
|
|
1551
1387
|
];
|
|
1552
1388
|
accounts: [
|
|
1553
1389
|
{
|
|
@@ -1606,20 +1442,20 @@ type LightCompressedToken = {
|
|
|
1606
1442
|
name: 'mint';
|
|
1607
1443
|
isMut: false;
|
|
1608
1444
|
isSigner: false;
|
|
1609
|
-
}
|
|
1445
|
+
}
|
|
1610
1446
|
];
|
|
1611
1447
|
args: [
|
|
1612
1448
|
{
|
|
1613
1449
|
name: 'inputs';
|
|
1614
1450
|
type: 'bytes';
|
|
1615
|
-
}
|
|
1451
|
+
}
|
|
1616
1452
|
];
|
|
1617
1453
|
},
|
|
1618
1454
|
{
|
|
1619
1455
|
name: 'thaw';
|
|
1620
1456
|
docs: [
|
|
1621
1457
|
'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
|
|
1622
|
-
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
1458
|
+
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
1623
1459
|
];
|
|
1624
1460
|
accounts: [
|
|
1625
1461
|
{
|
|
@@ -1678,13 +1514,13 @@ type LightCompressedToken = {
|
|
|
1678
1514
|
name: 'mint';
|
|
1679
1515
|
isMut: false;
|
|
1680
1516
|
isSigner: false;
|
|
1681
|
-
}
|
|
1517
|
+
}
|
|
1682
1518
|
];
|
|
1683
1519
|
args: [
|
|
1684
1520
|
{
|
|
1685
1521
|
name: 'inputs';
|
|
1686
1522
|
type: 'bytes';
|
|
1687
|
-
}
|
|
1523
|
+
}
|
|
1688
1524
|
];
|
|
1689
1525
|
},
|
|
1690
1526
|
{
|
|
@@ -1692,7 +1528,7 @@ type LightCompressedToken = {
|
|
|
1692
1528
|
docs: [
|
|
1693
1529
|
'Burns compressed tokens and spl tokens from the pool account. Delegates',
|
|
1694
1530
|
'can burn tokens. The output compressed token account remains delegated.',
|
|
1695
|
-
'Creates one output compressed token account.'
|
|
1531
|
+
'Creates one output compressed token account.'
|
|
1696
1532
|
];
|
|
1697
1533
|
accounts: [
|
|
1698
1534
|
{
|
|
@@ -1708,7 +1544,7 @@ type LightCompressedToken = {
|
|
|
1708
1544
|
docs: [
|
|
1709
1545
|
'Authority is verified through proof since both owner and delegate',
|
|
1710
1546
|
'are included in the token data hash, which is a public input to the',
|
|
1711
|
-
'validity proof.'
|
|
1547
|
+
'validity proof.'
|
|
1712
1548
|
];
|
|
1713
1549
|
},
|
|
1714
1550
|
{
|
|
@@ -1765,13 +1601,13 @@ type LightCompressedToken = {
|
|
|
1765
1601
|
name: 'systemProgram';
|
|
1766
1602
|
isMut: false;
|
|
1767
1603
|
isSigner: false;
|
|
1768
|
-
}
|
|
1604
|
+
}
|
|
1769
1605
|
];
|
|
1770
1606
|
args: [
|
|
1771
1607
|
{
|
|
1772
1608
|
name: 'inputs';
|
|
1773
1609
|
type: 'bytes';
|
|
1774
|
-
}
|
|
1610
|
+
}
|
|
1775
1611
|
];
|
|
1776
1612
|
},
|
|
1777
1613
|
{
|
|
@@ -1779,7 +1615,7 @@ type LightCompressedToken = {
|
|
|
1779
1615
|
docs: [
|
|
1780
1616
|
'This function is a stub to allow Anchor to include the input types in',
|
|
1781
1617
|
'the IDL. It should not be included in production builds nor be called in',
|
|
1782
|
-
'practice.'
|
|
1618
|
+
'practice.'
|
|
1783
1619
|
];
|
|
1784
1620
|
accounts: [
|
|
1785
1621
|
{
|
|
@@ -1795,7 +1631,7 @@ type LightCompressedToken = {
|
|
|
1795
1631
|
docs: [
|
|
1796
1632
|
'Authority is verified through proof since both owner and delegate',
|
|
1797
1633
|
'are included in the token data hash, which is a public input to the',
|
|
1798
|
-
'validity proof.'
|
|
1634
|
+
'validity proof.'
|
|
1799
1635
|
];
|
|
1800
1636
|
},
|
|
1801
1637
|
{
|
|
@@ -1856,7 +1692,7 @@ type LightCompressedToken = {
|
|
|
1856
1692
|
name: 'systemProgram';
|
|
1857
1693
|
isMut: false;
|
|
1858
1694
|
isSigner: false;
|
|
1859
|
-
}
|
|
1695
|
+
}
|
|
1860
1696
|
];
|
|
1861
1697
|
args: [
|
|
1862
1698
|
{
|
|
@@ -1870,9 +1706,9 @@ type LightCompressedToken = {
|
|
|
1870
1706
|
type: {
|
|
1871
1707
|
defined: 'TokenData';
|
|
1872
1708
|
};
|
|
1873
|
-
}
|
|
1709
|
+
}
|
|
1874
1710
|
];
|
|
1875
|
-
}
|
|
1711
|
+
}
|
|
1876
1712
|
];
|
|
1877
1713
|
types: [
|
|
1878
1714
|
{
|
|
@@ -1885,7 +1721,7 @@ type LightCompressedToken = {
|
|
|
1885
1721
|
},
|
|
1886
1722
|
{
|
|
1887
1723
|
name: 'Frozen';
|
|
1888
|
-
}
|
|
1724
|
+
}
|
|
1889
1725
|
];
|
|
1890
1726
|
};
|
|
1891
1727
|
},
|
|
@@ -1917,7 +1753,7 @@ type LightCompressedToken = {
|
|
|
1917
1753
|
defined: 'CompressedAccountData';
|
|
1918
1754
|
};
|
|
1919
1755
|
};
|
|
1920
|
-
}
|
|
1756
|
+
}
|
|
1921
1757
|
];
|
|
1922
1758
|
};
|
|
1923
1759
|
},
|
|
@@ -1941,7 +1777,7 @@ type LightCompressedToken = {
|
|
|
1941
1777
|
type: {
|
|
1942
1778
|
array: ['u8', 32];
|
|
1943
1779
|
};
|
|
1944
|
-
}
|
|
1780
|
+
}
|
|
1945
1781
|
];
|
|
1946
1782
|
};
|
|
1947
1783
|
},
|
|
@@ -1954,7 +1790,7 @@ type LightCompressedToken = {
|
|
|
1954
1790
|
name: 'setContext';
|
|
1955
1791
|
docs: [
|
|
1956
1792
|
'Is set by the program that is invoking the CPI to signal that is should',
|
|
1957
|
-
'set the cpi context.'
|
|
1793
|
+
'set the cpi context.'
|
|
1958
1794
|
];
|
|
1959
1795
|
type: 'bool';
|
|
1960
1796
|
},
|
|
@@ -1962,17 +1798,17 @@ type LightCompressedToken = {
|
|
|
1962
1798
|
name: 'firstSetContext';
|
|
1963
1799
|
docs: [
|
|
1964
1800
|
'Is set to wipe the cpi context since someone could have set it before',
|
|
1965
|
-
'with unrelated data.'
|
|
1801
|
+
'with unrelated data.'
|
|
1966
1802
|
];
|
|
1967
1803
|
type: 'bool';
|
|
1968
1804
|
},
|
|
1969
1805
|
{
|
|
1970
1806
|
name: 'cpiContextAccountIndex';
|
|
1971
1807
|
docs: [
|
|
1972
|
-
'Index of cpi context account in remaining accounts.'
|
|
1808
|
+
'Index of cpi context account in remaining accounts.'
|
|
1973
1809
|
];
|
|
1974
1810
|
type: 'u8';
|
|
1975
|
-
}
|
|
1811
|
+
}
|
|
1976
1812
|
];
|
|
1977
1813
|
};
|
|
1978
1814
|
},
|
|
@@ -1998,7 +1834,7 @@ type LightCompressedToken = {
|
|
|
1998
1834
|
type: {
|
|
1999
1835
|
array: ['u8', 32];
|
|
2000
1836
|
};
|
|
2001
|
-
}
|
|
1837
|
+
}
|
|
2002
1838
|
];
|
|
2003
1839
|
};
|
|
2004
1840
|
},
|
|
@@ -2024,7 +1860,7 @@ type LightCompressedToken = {
|
|
|
2024
1860
|
docs: [
|
|
2025
1861
|
'Is required if the signer is delegate,',
|
|
2026
1862
|
'-> delegate is authority account,',
|
|
2027
|
-
'owner = Some(owner) is the owner of the token account.'
|
|
1863
|
+
'owner = Some(owner) is the owner of the token account.'
|
|
2028
1864
|
];
|
|
2029
1865
|
type: {
|
|
2030
1866
|
option: {
|
|
@@ -2071,14 +1907,14 @@ type LightCompressedToken = {
|
|
|
2071
1907
|
type: {
|
|
2072
1908
|
option: 'u8';
|
|
2073
1909
|
};
|
|
2074
|
-
}
|
|
1910
|
+
}
|
|
2075
1911
|
];
|
|
2076
1912
|
};
|
|
2077
1913
|
},
|
|
2078
1914
|
{
|
|
2079
1915
|
name: 'DelegatedTransfer';
|
|
2080
1916
|
docs: [
|
|
2081
|
-
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
1917
|
+
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
2082
1918
|
];
|
|
2083
1919
|
type: {
|
|
2084
1920
|
kind: 'struct';
|
|
@@ -2093,12 +1929,12 @@ type LightCompressedToken = {
|
|
|
2093
1929
|
'Index of change compressed account in output compressed accounts. In',
|
|
2094
1930
|
"case that the delegate didn't spend the complete delegated compressed",
|
|
2095
1931
|
'account balance the change compressed account will be delegated to her',
|
|
2096
|
-
'as well.'
|
|
1932
|
+
'as well.'
|
|
2097
1933
|
];
|
|
2098
1934
|
type: {
|
|
2099
1935
|
option: 'u8';
|
|
2100
1936
|
};
|
|
2101
|
-
}
|
|
1937
|
+
}
|
|
2102
1938
|
];
|
|
2103
1939
|
};
|
|
2104
1940
|
},
|
|
@@ -2136,12 +1972,12 @@ type LightCompressedToken = {
|
|
|
2136
1972
|
{
|
|
2137
1973
|
name: 'tlv';
|
|
2138
1974
|
docs: [
|
|
2139
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
1975
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
2140
1976
|
];
|
|
2141
1977
|
type: {
|
|
2142
1978
|
option: 'bytes';
|
|
2143
1979
|
};
|
|
2144
|
-
}
|
|
1980
|
+
}
|
|
2145
1981
|
];
|
|
2146
1982
|
};
|
|
2147
1983
|
},
|
|
@@ -2197,7 +2033,7 @@ type LightCompressedToken = {
|
|
|
2197
2033
|
{
|
|
2198
2034
|
name: 'isCompress';
|
|
2199
2035
|
type: 'bool';
|
|
2200
|
-
}
|
|
2036
|
+
}
|
|
2201
2037
|
];
|
|
2202
2038
|
};
|
|
2203
2039
|
},
|
|
@@ -2261,7 +2097,7 @@ type LightCompressedToken = {
|
|
|
2261
2097
|
defined: 'CompressedCpiContext';
|
|
2262
2098
|
};
|
|
2263
2099
|
};
|
|
2264
|
-
}
|
|
2100
|
+
}
|
|
2265
2101
|
];
|
|
2266
2102
|
};
|
|
2267
2103
|
},
|
|
@@ -2277,7 +2113,7 @@ type LightCompressedToken = {
|
|
|
2277
2113
|
{
|
|
2278
2114
|
name: 'seq';
|
|
2279
2115
|
type: 'u64';
|
|
2280
|
-
}
|
|
2116
|
+
}
|
|
2281
2117
|
];
|
|
2282
2118
|
};
|
|
2283
2119
|
},
|
|
@@ -2303,7 +2139,7 @@ type LightCompressedToken = {
|
|
|
2303
2139
|
{
|
|
2304
2140
|
name: 'addressMerkleTreeRootIndex';
|
|
2305
2141
|
type: 'u16';
|
|
2306
|
-
}
|
|
2142
|
+
}
|
|
2307
2143
|
];
|
|
2308
2144
|
};
|
|
2309
2145
|
},
|
|
@@ -2321,7 +2157,7 @@ type LightCompressedToken = {
|
|
|
2321
2157
|
{
|
|
2322
2158
|
name: 'merkleTreeIndex';
|
|
2323
2159
|
type: 'u8';
|
|
2324
|
-
}
|
|
2160
|
+
}
|
|
2325
2161
|
];
|
|
2326
2162
|
};
|
|
2327
2163
|
},
|
|
@@ -2345,17 +2181,17 @@ type LightCompressedToken = {
|
|
|
2345
2181
|
{
|
|
2346
2182
|
name: 'rootIndex';
|
|
2347
2183
|
docs: [
|
|
2348
|
-
'Index of root used in inclusion validity proof.'
|
|
2184
|
+
'Index of root used in inclusion validity proof.'
|
|
2349
2185
|
];
|
|
2350
2186
|
type: 'u16';
|
|
2351
2187
|
},
|
|
2352
2188
|
{
|
|
2353
2189
|
name: 'readOnly';
|
|
2354
2190
|
docs: [
|
|
2355
|
-
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
2191
|
+
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
2356
2192
|
];
|
|
2357
2193
|
type: 'bool';
|
|
2358
|
-
}
|
|
2194
|
+
}
|
|
2359
2195
|
];
|
|
2360
2196
|
};
|
|
2361
2197
|
},
|
|
@@ -2383,7 +2219,7 @@ type LightCompressedToken = {
|
|
|
2383
2219
|
defined: 'QueueIndex';
|
|
2384
2220
|
};
|
|
2385
2221
|
};
|
|
2386
|
-
}
|
|
2222
|
+
}
|
|
2387
2223
|
];
|
|
2388
2224
|
};
|
|
2389
2225
|
},
|
|
@@ -2413,12 +2249,12 @@ type LightCompressedToken = {
|
|
|
2413
2249
|
{
|
|
2414
2250
|
name: 'tlv';
|
|
2415
2251
|
docs: [
|
|
2416
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
2252
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
2417
2253
|
];
|
|
2418
2254
|
type: {
|
|
2419
2255
|
option: 'bytes';
|
|
2420
2256
|
};
|
|
2421
|
-
}
|
|
2257
|
+
}
|
|
2422
2258
|
];
|
|
2423
2259
|
};
|
|
2424
2260
|
},
|
|
@@ -2492,7 +2328,7 @@ type LightCompressedToken = {
|
|
|
2492
2328
|
type: {
|
|
2493
2329
|
option: 'bytes';
|
|
2494
2330
|
};
|
|
2495
|
-
}
|
|
2331
|
+
}
|
|
2496
2332
|
];
|
|
2497
2333
|
};
|
|
2498
2334
|
},
|
|
@@ -2510,7 +2346,7 @@ type LightCompressedToken = {
|
|
|
2510
2346
|
name: 'index';
|
|
2511
2347
|
docs: ['Index of compressed account hash in queue.'];
|
|
2512
2348
|
type: 'u16';
|
|
2513
|
-
}
|
|
2349
|
+
}
|
|
2514
2350
|
];
|
|
2515
2351
|
};
|
|
2516
2352
|
},
|
|
@@ -2538,7 +2374,7 @@ type LightCompressedToken = {
|
|
|
2538
2374
|
name: 'delegate';
|
|
2539
2375
|
docs: [
|
|
2540
2376
|
'If `delegate` is `Some` then `delegated_amount` represents',
|
|
2541
|
-
'the amount authorized by the delegate'
|
|
2377
|
+
'the amount authorized by the delegate'
|
|
2542
2378
|
];
|
|
2543
2379
|
type: {
|
|
2544
2380
|
option: 'publicKey';
|
|
@@ -2554,15 +2390,15 @@ type LightCompressedToken = {
|
|
|
2554
2390
|
{
|
|
2555
2391
|
name: 'tlv';
|
|
2556
2392
|
docs: [
|
|
2557
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
2393
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
2558
2394
|
];
|
|
2559
2395
|
type: {
|
|
2560
2396
|
option: 'bytes';
|
|
2561
2397
|
};
|
|
2562
|
-
}
|
|
2398
|
+
}
|
|
2563
2399
|
];
|
|
2564
2400
|
};
|
|
2565
|
-
}
|
|
2401
|
+
}
|
|
2566
2402
|
];
|
|
2567
2403
|
errors: [
|
|
2568
2404
|
{
|
|
@@ -2719,78 +2555,62 @@ type LightCompressedToken = {
|
|
|
2719
2555
|
{
|
|
2720
2556
|
code: 6032;
|
|
2721
2557
|
name: 'NoMatchingBumpFound';
|
|
2722
|
-
}
|
|
2558
|
+
}
|
|
2723
2559
|
];
|
|
2724
2560
|
};
|
|
2725
2561
|
declare const IDL: LightCompressedToken;
|
|
2726
2562
|
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
mergeTokenAccounts,
|
|
2782
|
-
mintTo,
|
|
2783
|
-
mintToAccountsLayout,
|
|
2784
|
-
type mintToAccountsLayoutParams,
|
|
2785
|
-
mintToLayout,
|
|
2786
|
-
packCompressedTokenAccounts,
|
|
2787
|
-
parseTokenData,
|
|
2788
|
-
type revokeAccountsLayoutParams,
|
|
2789
|
-
selectMinCompressedTokenAccountsForTransfer,
|
|
2790
|
-
sumUpTokenAmount,
|
|
2791
|
-
type thawAccountsLayoutParams,
|
|
2792
|
-
transfer,
|
|
2793
|
-
transferAccountsLayout,
|
|
2794
|
-
type transferAccountsLayoutParams,
|
|
2795
|
-
validateSameTokenOwner,
|
|
2796
|
-
};
|
|
2563
|
+
declare const ERROR_NO_ACCOUNTS_FOUND = "Could not find accounts to select for transfer.";
|
|
2564
|
+
/**
|
|
2565
|
+
* Selects the minimal number of compressed token accounts for a transfer.
|
|
2566
|
+
*
|
|
2567
|
+
* 1. Sorts accounts by amount (descending)
|
|
2568
|
+
* 2. Accumulates amount until it meets or exceeds transfer amount
|
|
2569
|
+
*/
|
|
2570
|
+
declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
2571
|
+
selectedAccounts: ParsedTokenAccount[],
|
|
2572
|
+
total: BN,
|
|
2573
|
+
totalLamports: BN | null,
|
|
2574
|
+
maxPossibleAmount: BN
|
|
2575
|
+
];
|
|
2576
|
+
/**
|
|
2577
|
+
* Selects the minimal number of compressed token accounts for a transfer idempotently.
|
|
2578
|
+
*
|
|
2579
|
+
* 1. Sorts accounts by amount (descending)
|
|
2580
|
+
* 2. Accumulates amount until it meets or exceeds transfer amount
|
|
2581
|
+
*/
|
|
2582
|
+
declare function selectMinCompressedTokenAccountsForTransferIdempotent(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
2583
|
+
selectedAccounts: ParsedTokenAccount[],
|
|
2584
|
+
total: BN,
|
|
2585
|
+
totalLamports: BN | null,
|
|
2586
|
+
maxPossibleAmount: BN
|
|
2587
|
+
];
|
|
2588
|
+
/**
|
|
2589
|
+
* Selects compressed token accounts for a transfer, ensuring one extra account
|
|
2590
|
+
* if possible, up to maxInputs.
|
|
2591
|
+
*
|
|
2592
|
+
* 1. Sorts accounts by amount (desc)
|
|
2593
|
+
* 2. Selects accounts until transfer amount is met or cap is reached
|
|
2594
|
+
*/
|
|
2595
|
+
declare function selectSmartCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
2596
|
+
selectedAccounts: ParsedTokenAccount[],
|
|
2597
|
+
total: BN,
|
|
2598
|
+
totalLamports: BN | null,
|
|
2599
|
+
maxPossibleAmount: BN
|
|
2600
|
+
];
|
|
2601
|
+
/**
|
|
2602
|
+
* Idempotently selects compressed token accounts for a transfer. Picks one more
|
|
2603
|
+
* account than needed, up to maxInputs, with the extra being the smallest.
|
|
2604
|
+
*
|
|
2605
|
+
* 1. Sorts accounts by amount (desc)
|
|
2606
|
+
* 2. Selects accounts until transfer amount is met, then adds the smallest
|
|
2607
|
+
* extra account if possible
|
|
2608
|
+
*/
|
|
2609
|
+
declare function selectSmartCompressedTokenAccountsForTransferIdempotent(accounts: ParsedTokenAccount[], transferAmount: BN, maxInputs?: number): [
|
|
2610
|
+
selectedAccounts: ParsedTokenAccount[],
|
|
2611
|
+
total: BN,
|
|
2612
|
+
totalLamports: BN | null,
|
|
2613
|
+
maxPossibleAmount: BN
|
|
2614
|
+
];
|
|
2615
|
+
|
|
2616
|
+
export { type ApproveAndMintToParams, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedCpiContext, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, CpiContextLayout, type CreateMintParams, type CreateTokenProgramLookupTableParams, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_NO_ACCOUNTS_FOUND, IDL, type InputTokenDataWithContext, type LightCompressedToken, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintToInstructionData, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, TRANSFER_DISCRIMINATOR, type TokenData, type TokenTransferOutputData, type TransferParams, type approveAccountsLayoutParams, approveAndMintTo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, createDecompressOutputState, createMint, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferOutputState, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeTransferInstructionData, decompress, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeTransferInstructionData, type freezeAccountsLayoutParams, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToLayout, packCompressedTokenAccounts, parseTokenData, type revokeAccountsLayoutParams, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferIdempotent, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferIdempotent, sumUpTokenAmount, type thawAccountsLayoutParams, transfer, transferAccountsLayout, type transferAccountsLayoutParams, validateSameTokenOwner };
|