@lightprotocol/compressed-token 0.20.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,20 @@
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';
1
+ import {
2
+ PackedMerkleContext,
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';
3
18
  import BN from 'bn.js';
4
19
  import * as buffer_layout from 'buffer-layout';
5
20
  import { Buffer as Buffer$1 } from 'buffer';
@@ -160,7 +175,9 @@ type PackCompressedTokenAccountsParams = {
160
175
  /**
161
176
  * Packs Compressed Token Accounts.
162
177
  */
163
- declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
178
+ declare function packCompressedTokenAccounts(
179
+ params: PackCompressedTokenAccountsParams,
180
+ ): {
164
181
  inputTokenDataWithContext: InputTokenDataWithContext$1[];
165
182
  remainingAccountMetas: AccountMeta[];
166
183
  packedOutputTokenData: PackedTokenTransferOutputData[];
@@ -501,7 +518,9 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
501
518
  /**
502
519
  * Parse compressed token accounts to get the mint, current owner and delegate.
503
520
  */
504
- declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
521
+ declare const parseTokenData: (
522
+ compressedTokenAccounts: ParsedTokenAccount[],
523
+ ) => {
505
524
  mint: PublicKey;
506
525
  currentOwner: PublicKey;
507
526
  delegate: PublicKey | null;
@@ -514,7 +533,11 @@ declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) =>
514
533
  * @returns Output token data for the transfer
515
534
  * instruction
516
535
  */
517
- declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData[];
536
+ declare function createTransferOutputState(
537
+ inputCompressedTokenAccounts: ParsedTokenAccount[],
538
+ toAddress: PublicKey,
539
+ amount: number | BN,
540
+ ): TokenTransferOutputData[];
518
541
  /**
519
542
  * Create the output state for a compress transaction.
520
543
  * @param inputCompressedTokenAccounts Input state
@@ -522,7 +545,10 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
522
545
  * @returns Output token data for the compress
523
546
  * instruction
524
547
  */
525
- declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData[];
548
+ declare function createDecompressOutputState(
549
+ inputCompressedTokenAccounts: ParsedTokenAccount[],
550
+ amount: number | BN,
551
+ ): TokenTransferOutputData[];
526
552
  declare class CompressedTokenProgram {
527
553
  /**
528
554
  * @internal
@@ -549,12 +575,16 @@ declare class CompressedTokenProgram {
549
575
  *
550
576
  * Note that `createTokenPoolInstruction` must be executed after `initializeMintInstruction`.
551
577
  */
552
- static createMint(params: CreateMintParams): Promise<TransactionInstruction[]>;
578
+ static createMint(
579
+ params: CreateMintParams,
580
+ ): Promise<TransactionInstruction[]>;
553
581
  /**
554
582
  * Enable compression for an existing SPL mint, creating an omnibus account.
555
583
  * For new mints, use `CompressedTokenProgram.createMint`.
556
584
  */
557
- static createTokenPool(params: RegisterMintParams): Promise<TransactionInstruction>;
585
+ static createTokenPool(
586
+ params: RegisterMintParams,
587
+ ): Promise<TransactionInstruction>;
558
588
  /**
559
589
  * Construct mintTo instruction for compressed tokens
560
590
  */
@@ -562,7 +592,9 @@ declare class CompressedTokenProgram {
562
592
  /**
563
593
  * Mint tokens from registered SPL mint account to a compressed account
564
594
  */
565
- static approveAndMintTo(params: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
595
+ static approveAndMintTo(
596
+ params: ApproveAndMintToParams,
597
+ ): Promise<TransactionInstruction[]>;
566
598
  /**
567
599
  * Construct transfer instruction for compressed tokens
568
600
  */
@@ -570,7 +602,9 @@ declare class CompressedTokenProgram {
570
602
  /**
571
603
  * Create lookup table instructions for the token program's default accounts.
572
604
  */
573
- static createTokenProgramLookupTable(params: CreateTokenProgramLookupTableParams): Promise<{
605
+ static createTokenProgramLookupTable(
606
+ params: CreateTokenProgramLookupTableParams,
607
+ ): Promise<{
574
608
  instructions: TransactionInstruction[];
575
609
  address: PublicKey;
576
610
  }>;
@@ -582,10 +616,19 @@ declare class CompressedTokenProgram {
582
616
  /**
583
617
  * Construct decompress instruction
584
618
  */
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>;
619
+ static decompress(
620
+ params: DecompressParams,
621
+ ): Promise<TransactionInstruction>;
622
+ static mergeTokenAccounts(
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>;
589
632
  }
590
633
 
591
634
  /**
@@ -603,7 +646,17 @@ declare class CompressedTokenProgram {
603
646
  *
604
647
  * @return Signature of the confirmed transaction
605
648
  */
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>;
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>;
607
660
 
608
661
  /**
609
662
  * Compress SPL tokens
@@ -623,7 +676,18 @@ declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, dest
623
676
  *
624
677
  * @return Signature of the confirmed transaction
625
678
  */
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>;
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>;
627
691
 
628
692
  /**
629
693
  * Decompress compressed tokens
@@ -643,7 +707,17 @@ declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
643
707
  *
644
708
  * @return Signature of the confirmed transaction
645
709
  */
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>;
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>;
647
721
 
648
722
  /**
649
723
  * Create and initialize a new compressed token mint
@@ -662,7 +736,16 @@ declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: nu
662
736
  *
663
737
  * @return Address of the new mint and the transaction signature
664
738
  */
665
- declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey | boolean, freezeAuthority?: PublicKey): Promise<{
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<{
666
749
  mint: PublicKey;
667
750
  transactionSignature: TransactionSignature;
668
751
  }>;
@@ -684,7 +767,17 @@ declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, d
684
767
  *
685
768
  * @return Signature of the confirmed transaction
686
769
  */
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>;
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>;
688
781
 
689
782
  /**
690
783
  * Merge multiple compressed token accounts for a given mint into a single
@@ -699,7 +792,14 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
699
792
  *
700
793
  * @return Array of transaction signatures
701
794
  */
702
- declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
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>;
703
803
 
704
804
  /**
705
805
  * Register an existing mint with the CompressedToken program
@@ -712,7 +812,13 @@ declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, ow
712
812
  *
713
813
  * @return transaction signature
714
814
  */
715
- declare function createTokenPool(rpc: Rpc, payer: Signer, mint: PublicKey, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
815
+ declare function createTokenPool(
816
+ rpc: Rpc,
817
+ payer: Signer,
818
+ mint: PublicKey,
819
+ confirmOptions?: ConfirmOptions,
820
+ tokenProgramId?: PublicKey,
821
+ ): Promise<TransactionSignature>;
716
822
 
717
823
  /**
718
824
  * Transfer compressed tokens from one owner to another
@@ -731,7 +837,16 @@ declare function createTokenPool(rpc: Rpc, payer: Signer, mint: PublicKey, confi
731
837
  *
732
838
  * @return Signature of the confirmed transaction
733
839
  */
734
- declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
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>;
735
850
  /**
736
851
  * Selects the minimal number of compressed token accounts for a transfer.
737
852
  *
@@ -739,10 +854,13 @@ declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
739
854
  * 2. Accumulates the amount until it is greater than or equal to the transfer
740
855
  * amount
741
856
  */
742
- declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN): [
857
+ declare function selectMinCompressedTokenAccountsForTransfer(
858
+ accounts: ParsedTokenAccount[],
859
+ transferAmount: BN,
860
+ ): [
743
861
  selectedAccounts: ParsedTokenAccount[],
744
862
  total: BN,
745
- totalLamports: BN | null
863
+ totalLamports: BN | null,
746
864
  ];
747
865
 
748
866
  /**
@@ -758,7 +876,13 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
758
876
  *
759
877
  * @return Transaction signatures and the address of the created lookup table
760
878
  */
761
- declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
879
+ declare function createTokenProgramLookupTable(
880
+ rpc: Rpc,
881
+ payer: Signer,
882
+ authority: Signer,
883
+ mints?: PublicKey[],
884
+ additionalAccounts?: PublicKey[],
885
+ ): Promise<{
762
886
  txIds: TransactionSignature[];
763
887
  address: PublicKey;
764
888
  }>;
@@ -777,19 +901,41 @@ declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authorit
777
901
  *
778
902
  * @return Signature of the confirmed transaction
779
903
  */
780
- declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, outputStateTree: PublicKey, remainingAmount?: BN, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
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>;
781
915
 
782
916
  declare const DelegatedTransferLayout: buffer_layout.Layout<unknown>;
783
917
  declare const CpiContextLayout: buffer_layout.Layout<unknown>;
784
918
  declare const CompressedTokenInstructionDataTransferLayout: buffer_layout.Layout<unknown>;
785
919
  declare const mintToLayout: buffer_layout.Layout<unknown>;
786
920
  declare const compressSplTokenAccountInstructionDataLayout: buffer_layout.Layout<unknown>;
787
- declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
788
- declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
789
- declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
790
- declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
791
- declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
792
- declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
921
+ declare function encodeMintToInstructionData(
922
+ data: MintToInstructionData,
923
+ ): Buffer$1;
924
+ declare function decodeMintToInstructionData(
925
+ buffer: Buffer$1,
926
+ ): MintToInstructionData;
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;
793
939
  interface BaseAccountsLayoutParams {
794
940
  feePayer: PublicKey;
795
941
  authority: PublicKey;
@@ -828,9 +974,15 @@ type freezeAccountsLayoutParams = BaseAccountsLayoutParams & {
828
974
  mint: PublicKey;
829
975
  };
830
976
  type thawAccountsLayoutParams = freezeAccountsLayoutParams;
831
- declare const createTokenPoolAccountsLayout: (accounts: createTokenPoolAccountsLayoutParams) => AccountMeta[];
832
- declare const mintToAccountsLayout: (accounts: mintToAccountsLayoutParams) => AccountMeta[];
833
- declare const transferAccountsLayout: (accounts: transferAccountsLayoutParams) => AccountMeta[];
977
+ declare const createTokenPoolAccountsLayout: (
978
+ accounts: createTokenPoolAccountsLayoutParams,
979
+ ) => AccountMeta[];
980
+ declare const mintToAccountsLayout: (
981
+ accounts: mintToAccountsLayoutParams,
982
+ ) => AccountMeta[];
983
+ declare const transferAccountsLayout: (
984
+ accounts: transferAccountsLayoutParams,
985
+ ) => AccountMeta[];
834
986
 
835
987
  type LightCompressedToken = {
836
988
  version: '1.2.0';
@@ -842,7 +994,7 @@ type LightCompressedToken = {
842
994
  'This instruction creates a token pool for a given mint. Every spl mint',
843
995
  'can have one token pool. When a token is compressed the tokens are',
844
996
  'transferrred to the token pool, and their compressed equivalent is',
845
- 'minted into a Merkle tree.'
997
+ 'minted into a Merkle tree.',
846
998
  ];
847
999
  accounts: [
848
1000
  {
@@ -875,7 +1027,7 @@ type LightCompressedToken = {
875
1027
  name: 'cpiAuthorityPda';
876
1028
  isMut: false;
877
1029
  isSigner: false;
878
- }
1030
+ },
879
1031
  ];
880
1032
  args: [];
881
1033
  },
@@ -883,7 +1035,7 @@ type LightCompressedToken = {
883
1035
  name: 'addTokenPool';
884
1036
  docs: [
885
1037
  'This instruction creates an additional token pool for a given mint.',
886
- 'The maximum number of token pools per mint is 5.'
1038
+ 'The maximum number of token pools per mint is 5.',
887
1039
  ];
888
1040
  accounts: [
889
1041
  {
@@ -921,13 +1073,13 @@ type LightCompressedToken = {
921
1073
  name: 'cpiAuthorityPda';
922
1074
  isMut: false;
923
1075
  isSigner: false;
924
- }
1076
+ },
925
1077
  ];
926
1078
  args: [
927
1079
  {
928
1080
  name: 'tokenPoolIndex';
929
1081
  type: 'u8';
930
- }
1082
+ },
931
1083
  ];
932
1084
  },
933
1085
  {
@@ -939,7 +1091,7 @@ type LightCompressedToken = {
939
1091
  'every amount and pubkey input pair. A constant amount of lamports can be',
940
1092
  'transferred to each output account to enable. A use case to add lamports',
941
1093
  'to a compressed token account is to prevent spam. This is the only way',
942
- 'to add lamports to a compressed token account.'
1094
+ 'to add lamports to a compressed token account.',
943
1095
  ];
944
1096
  accounts: [
945
1097
  {
@@ -1019,7 +1171,7 @@ type LightCompressedToken = {
1019
1171
  isMut: true;
1020
1172
  isSigner: false;
1021
1173
  isOptional: true;
1022
- }
1174
+ },
1023
1175
  ];
1024
1176
  args: [
1025
1177
  {
@@ -1039,7 +1191,7 @@ type LightCompressedToken = {
1039
1191
  type: {
1040
1192
  option: 'u64';
1041
1193
  };
1042
- }
1194
+ },
1043
1195
  ];
1044
1196
  },
1045
1197
  {
@@ -1047,7 +1199,7 @@ type LightCompressedToken = {
1047
1199
  docs: [
1048
1200
  'Compresses the balance of an spl token account sub an optional remaining',
1049
1201
  'amount. This instruction does not close the spl token account. To close',
1050
- 'the account bundle a close spl account instruction in your transaction.'
1202
+ 'the account bundle a close spl account instruction in your transaction.',
1051
1203
  ];
1052
1204
  accounts: [
1053
1205
  {
@@ -1063,7 +1215,7 @@ type LightCompressedToken = {
1063
1215
  docs: [
1064
1216
  'Authority is verified through proof since both owner and delegate',
1065
1217
  'are included in the token data hash, which is a public input to the',
1066
- 'validity proof.'
1218
+ 'validity proof.',
1067
1219
  ];
1068
1220
  },
1069
1221
  {
@@ -1124,7 +1276,7 @@ type LightCompressedToken = {
1124
1276
  name: 'systemProgram';
1125
1277
  isMut: false;
1126
1278
  isSigner: false;
1127
- }
1279
+ },
1128
1280
  ];
1129
1281
  args: [
1130
1282
  {
@@ -1144,7 +1296,7 @@ type LightCompressedToken = {
1144
1296
  defined: 'CompressedCpiContext';
1145
1297
  };
1146
1298
  };
1147
- }
1299
+ },
1148
1300
  ];
1149
1301
  },
1150
1302
  {
@@ -1157,7 +1309,7 @@ type LightCompressedToken = {
1157
1309
  'accounts specify less lamports than inputs the remaining lamports are',
1158
1310
  'transferred to an output compressed account. Signer must be owner or',
1159
1311
  'delegate. If a delegated token account is transferred the delegate is',
1160
- 'not preserved.'
1312
+ 'not preserved.',
1161
1313
  ];
1162
1314
  accounts: [
1163
1315
  {
@@ -1173,7 +1325,7 @@ type LightCompressedToken = {
1173
1325
  docs: [
1174
1326
  'Authority is verified through proof since both owner and delegate',
1175
1327
  'are included in the token data hash, which is a public input to the',
1176
- 'validity proof.'
1328
+ 'validity proof.',
1177
1329
  ];
1178
1330
  },
1179
1331
  {
@@ -1234,13 +1386,13 @@ type LightCompressedToken = {
1234
1386
  name: 'systemProgram';
1235
1387
  isMut: false;
1236
1388
  isSigner: false;
1237
- }
1389
+ },
1238
1390
  ];
1239
1391
  args: [
1240
1392
  {
1241
1393
  name: 'inputs';
1242
1394
  type: 'bytes';
1243
- }
1395
+ },
1244
1396
  ];
1245
1397
  },
1246
1398
  {
@@ -1251,7 +1403,7 @@ type LightCompressedToken = {
1251
1403
  'be called by a delegate.',
1252
1404
  'The instruction creates two output accounts:',
1253
1405
  '1. one account with delegated amount',
1254
- '2. one account with remaining(change) amount'
1406
+ '2. one account with remaining(change) amount',
1255
1407
  ];
1256
1408
  accounts: [
1257
1409
  {
@@ -1267,7 +1419,7 @@ type LightCompressedToken = {
1267
1419
  docs: [
1268
1420
  'Authority is verified through proof since both owner and delegate',
1269
1421
  'are included in the token data hash, which is a public input to the',
1270
- 'validity proof.'
1422
+ 'validity proof.',
1271
1423
  ];
1272
1424
  },
1273
1425
  {
@@ -1310,20 +1462,20 @@ type LightCompressedToken = {
1310
1462
  name: 'systemProgram';
1311
1463
  isMut: false;
1312
1464
  isSigner: false;
1313
- }
1465
+ },
1314
1466
  ];
1315
1467
  args: [
1316
1468
  {
1317
1469
  name: 'inputs';
1318
1470
  type: 'bytes';
1319
- }
1471
+ },
1320
1472
  ];
1321
1473
  },
1322
1474
  {
1323
1475
  name: 'revoke';
1324
1476
  docs: [
1325
1477
  'Revokes a delegation. The instruction merges all inputs into one output',
1326
- 'account. Cannot be called by a delegate. Delegates are not preserved.'
1478
+ 'account. Cannot be called by a delegate. Delegates are not preserved.',
1327
1479
  ];
1328
1480
  accounts: [
1329
1481
  {
@@ -1339,7 +1491,7 @@ type LightCompressedToken = {
1339
1491
  docs: [
1340
1492
  'Authority is verified through proof since both owner and delegate',
1341
1493
  'are included in the token data hash, which is a public input to the',
1342
- 'validity proof.'
1494
+ 'validity proof.',
1343
1495
  ];
1344
1496
  },
1345
1497
  {
@@ -1382,20 +1534,20 @@ type LightCompressedToken = {
1382
1534
  name: 'systemProgram';
1383
1535
  isMut: false;
1384
1536
  isSigner: false;
1385
- }
1537
+ },
1386
1538
  ];
1387
1539
  args: [
1388
1540
  {
1389
1541
  name: 'inputs';
1390
1542
  type: 'bytes';
1391
- }
1543
+ },
1392
1544
  ];
1393
1545
  },
1394
1546
  {
1395
1547
  name: 'freeze';
1396
1548
  docs: [
1397
1549
  'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
1398
- 'many outputs as inputs. Balances and delegates are preserved.'
1550
+ 'many outputs as inputs. Balances and delegates are preserved.',
1399
1551
  ];
1400
1552
  accounts: [
1401
1553
  {
@@ -1454,20 +1606,20 @@ type LightCompressedToken = {
1454
1606
  name: 'mint';
1455
1607
  isMut: false;
1456
1608
  isSigner: false;
1457
- }
1609
+ },
1458
1610
  ];
1459
1611
  args: [
1460
1612
  {
1461
1613
  name: 'inputs';
1462
1614
  type: 'bytes';
1463
- }
1615
+ },
1464
1616
  ];
1465
1617
  },
1466
1618
  {
1467
1619
  name: 'thaw';
1468
1620
  docs: [
1469
1621
  'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
1470
- 'as many outputs as inputs. Balances and delegates are preserved.'
1622
+ 'as many outputs as inputs. Balances and delegates are preserved.',
1471
1623
  ];
1472
1624
  accounts: [
1473
1625
  {
@@ -1526,13 +1678,13 @@ type LightCompressedToken = {
1526
1678
  name: 'mint';
1527
1679
  isMut: false;
1528
1680
  isSigner: false;
1529
- }
1681
+ },
1530
1682
  ];
1531
1683
  args: [
1532
1684
  {
1533
1685
  name: 'inputs';
1534
1686
  type: 'bytes';
1535
- }
1687
+ },
1536
1688
  ];
1537
1689
  },
1538
1690
  {
@@ -1540,7 +1692,7 @@ type LightCompressedToken = {
1540
1692
  docs: [
1541
1693
  'Burns compressed tokens and spl tokens from the pool account. Delegates',
1542
1694
  'can burn tokens. The output compressed token account remains delegated.',
1543
- 'Creates one output compressed token account.'
1695
+ 'Creates one output compressed token account.',
1544
1696
  ];
1545
1697
  accounts: [
1546
1698
  {
@@ -1556,7 +1708,7 @@ type LightCompressedToken = {
1556
1708
  docs: [
1557
1709
  'Authority is verified through proof since both owner and delegate',
1558
1710
  'are included in the token data hash, which is a public input to the',
1559
- 'validity proof.'
1711
+ 'validity proof.',
1560
1712
  ];
1561
1713
  },
1562
1714
  {
@@ -1613,13 +1765,13 @@ type LightCompressedToken = {
1613
1765
  name: 'systemProgram';
1614
1766
  isMut: false;
1615
1767
  isSigner: false;
1616
- }
1768
+ },
1617
1769
  ];
1618
1770
  args: [
1619
1771
  {
1620
1772
  name: 'inputs';
1621
1773
  type: 'bytes';
1622
- }
1774
+ },
1623
1775
  ];
1624
1776
  },
1625
1777
  {
@@ -1627,7 +1779,7 @@ type LightCompressedToken = {
1627
1779
  docs: [
1628
1780
  'This function is a stub to allow Anchor to include the input types in',
1629
1781
  'the IDL. It should not be included in production builds nor be called in',
1630
- 'practice.'
1782
+ 'practice.',
1631
1783
  ];
1632
1784
  accounts: [
1633
1785
  {
@@ -1643,7 +1795,7 @@ type LightCompressedToken = {
1643
1795
  docs: [
1644
1796
  'Authority is verified through proof since both owner and delegate',
1645
1797
  'are included in the token data hash, which is a public input to the',
1646
- 'validity proof.'
1798
+ 'validity proof.',
1647
1799
  ];
1648
1800
  },
1649
1801
  {
@@ -1704,7 +1856,7 @@ type LightCompressedToken = {
1704
1856
  name: 'systemProgram';
1705
1857
  isMut: false;
1706
1858
  isSigner: false;
1707
- }
1859
+ },
1708
1860
  ];
1709
1861
  args: [
1710
1862
  {
@@ -1718,9 +1870,9 @@ type LightCompressedToken = {
1718
1870
  type: {
1719
1871
  defined: 'TokenData';
1720
1872
  };
1721
- }
1873
+ },
1722
1874
  ];
1723
- }
1875
+ },
1724
1876
  ];
1725
1877
  types: [
1726
1878
  {
@@ -1733,7 +1885,7 @@ type LightCompressedToken = {
1733
1885
  },
1734
1886
  {
1735
1887
  name: 'Frozen';
1736
- }
1888
+ },
1737
1889
  ];
1738
1890
  };
1739
1891
  },
@@ -1765,7 +1917,7 @@ type LightCompressedToken = {
1765
1917
  defined: 'CompressedAccountData';
1766
1918
  };
1767
1919
  };
1768
- }
1920
+ },
1769
1921
  ];
1770
1922
  };
1771
1923
  },
@@ -1789,7 +1941,7 @@ type LightCompressedToken = {
1789
1941
  type: {
1790
1942
  array: ['u8', 32];
1791
1943
  };
1792
- }
1944
+ },
1793
1945
  ];
1794
1946
  };
1795
1947
  },
@@ -1802,7 +1954,7 @@ type LightCompressedToken = {
1802
1954
  name: 'setContext';
1803
1955
  docs: [
1804
1956
  'Is set by the program that is invoking the CPI to signal that is should',
1805
- 'set the cpi context.'
1957
+ 'set the cpi context.',
1806
1958
  ];
1807
1959
  type: 'bool';
1808
1960
  },
@@ -1810,17 +1962,17 @@ type LightCompressedToken = {
1810
1962
  name: 'firstSetContext';
1811
1963
  docs: [
1812
1964
  'Is set to wipe the cpi context since someone could have set it before',
1813
- 'with unrelated data.'
1965
+ 'with unrelated data.',
1814
1966
  ];
1815
1967
  type: 'bool';
1816
1968
  },
1817
1969
  {
1818
1970
  name: 'cpiContextAccountIndex';
1819
1971
  docs: [
1820
- 'Index of cpi context account in remaining accounts.'
1972
+ 'Index of cpi context account in remaining accounts.',
1821
1973
  ];
1822
1974
  type: 'u8';
1823
- }
1975
+ },
1824
1976
  ];
1825
1977
  };
1826
1978
  },
@@ -1846,7 +1998,7 @@ type LightCompressedToken = {
1846
1998
  type: {
1847
1999
  array: ['u8', 32];
1848
2000
  };
1849
- }
2001
+ },
1850
2002
  ];
1851
2003
  };
1852
2004
  },
@@ -1872,7 +2024,7 @@ type LightCompressedToken = {
1872
2024
  docs: [
1873
2025
  'Is required if the signer is delegate,',
1874
2026
  '-> delegate is authority account,',
1875
- 'owner = Some(owner) is the owner of the token account.'
2027
+ 'owner = Some(owner) is the owner of the token account.',
1876
2028
  ];
1877
2029
  type: {
1878
2030
  option: {
@@ -1919,14 +2071,14 @@ type LightCompressedToken = {
1919
2071
  type: {
1920
2072
  option: 'u8';
1921
2073
  };
1922
- }
2074
+ },
1923
2075
  ];
1924
2076
  };
1925
2077
  },
1926
2078
  {
1927
2079
  name: 'DelegatedTransfer';
1928
2080
  docs: [
1929
- 'Struct to provide the owner when the delegate is signer of the transaction.'
2081
+ 'Struct to provide the owner when the delegate is signer of the transaction.',
1930
2082
  ];
1931
2083
  type: {
1932
2084
  kind: 'struct';
@@ -1941,12 +2093,12 @@ type LightCompressedToken = {
1941
2093
  'Index of change compressed account in output compressed accounts. In',
1942
2094
  "case that the delegate didn't spend the complete delegated compressed",
1943
2095
  'account balance the change compressed account will be delegated to her',
1944
- 'as well.'
2096
+ 'as well.',
1945
2097
  ];
1946
2098
  type: {
1947
2099
  option: 'u8';
1948
2100
  };
1949
- }
2101
+ },
1950
2102
  ];
1951
2103
  };
1952
2104
  },
@@ -1984,12 +2136,12 @@ type LightCompressedToken = {
1984
2136
  {
1985
2137
  name: 'tlv';
1986
2138
  docs: [
1987
- 'Placeholder for TokenExtension tlv data (unimplemented)'
2139
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1988
2140
  ];
1989
2141
  type: {
1990
2142
  option: 'bytes';
1991
2143
  };
1992
- }
2144
+ },
1993
2145
  ];
1994
2146
  };
1995
2147
  },
@@ -2045,7 +2197,7 @@ type LightCompressedToken = {
2045
2197
  {
2046
2198
  name: 'isCompress';
2047
2199
  type: 'bool';
2048
- }
2200
+ },
2049
2201
  ];
2050
2202
  };
2051
2203
  },
@@ -2109,7 +2261,7 @@ type LightCompressedToken = {
2109
2261
  defined: 'CompressedCpiContext';
2110
2262
  };
2111
2263
  };
2112
- }
2264
+ },
2113
2265
  ];
2114
2266
  };
2115
2267
  },
@@ -2125,7 +2277,7 @@ type LightCompressedToken = {
2125
2277
  {
2126
2278
  name: 'seq';
2127
2279
  type: 'u64';
2128
- }
2280
+ },
2129
2281
  ];
2130
2282
  };
2131
2283
  },
@@ -2151,7 +2303,7 @@ type LightCompressedToken = {
2151
2303
  {
2152
2304
  name: 'addressMerkleTreeRootIndex';
2153
2305
  type: 'u16';
2154
- }
2306
+ },
2155
2307
  ];
2156
2308
  };
2157
2309
  },
@@ -2169,7 +2321,7 @@ type LightCompressedToken = {
2169
2321
  {
2170
2322
  name: 'merkleTreeIndex';
2171
2323
  type: 'u8';
2172
- }
2324
+ },
2173
2325
  ];
2174
2326
  };
2175
2327
  },
@@ -2193,17 +2345,17 @@ type LightCompressedToken = {
2193
2345
  {
2194
2346
  name: 'rootIndex';
2195
2347
  docs: [
2196
- 'Index of root used in inclusion validity proof.'
2348
+ 'Index of root used in inclusion validity proof.',
2197
2349
  ];
2198
2350
  type: 'u16';
2199
2351
  },
2200
2352
  {
2201
2353
  name: 'readOnly';
2202
2354
  docs: [
2203
- 'Placeholder to mark accounts read-only unimplemented set to false.'
2355
+ 'Placeholder to mark accounts read-only unimplemented set to false.',
2204
2356
  ];
2205
2357
  type: 'bool';
2206
- }
2358
+ },
2207
2359
  ];
2208
2360
  };
2209
2361
  },
@@ -2231,7 +2383,7 @@ type LightCompressedToken = {
2231
2383
  defined: 'QueueIndex';
2232
2384
  };
2233
2385
  };
2234
- }
2386
+ },
2235
2387
  ];
2236
2388
  };
2237
2389
  },
@@ -2261,12 +2413,12 @@ type LightCompressedToken = {
2261
2413
  {
2262
2414
  name: 'tlv';
2263
2415
  docs: [
2264
- 'Placeholder for TokenExtension tlv data (unimplemented)'
2416
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
2265
2417
  ];
2266
2418
  type: {
2267
2419
  option: 'bytes';
2268
2420
  };
2269
- }
2421
+ },
2270
2422
  ];
2271
2423
  };
2272
2424
  },
@@ -2340,7 +2492,7 @@ type LightCompressedToken = {
2340
2492
  type: {
2341
2493
  option: 'bytes';
2342
2494
  };
2343
- }
2495
+ },
2344
2496
  ];
2345
2497
  };
2346
2498
  },
@@ -2358,7 +2510,7 @@ type LightCompressedToken = {
2358
2510
  name: 'index';
2359
2511
  docs: ['Index of compressed account hash in queue.'];
2360
2512
  type: 'u16';
2361
- }
2513
+ },
2362
2514
  ];
2363
2515
  };
2364
2516
  },
@@ -2386,7 +2538,7 @@ type LightCompressedToken = {
2386
2538
  name: 'delegate';
2387
2539
  docs: [
2388
2540
  'If `delegate` is `Some` then `delegated_amount` represents',
2389
- 'the amount authorized by the delegate'
2541
+ 'the amount authorized by the delegate',
2390
2542
  ];
2391
2543
  type: {
2392
2544
  option: 'publicKey';
@@ -2402,15 +2554,15 @@ type LightCompressedToken = {
2402
2554
  {
2403
2555
  name: 'tlv';
2404
2556
  docs: [
2405
- 'Placeholder for TokenExtension tlv data (unimplemented)'
2557
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
2406
2558
  ];
2407
2559
  type: {
2408
2560
  option: 'bytes';
2409
2561
  };
2410
- }
2562
+ },
2411
2563
  ];
2412
2564
  };
2413
- }
2565
+ },
2414
2566
  ];
2415
2567
  errors: [
2416
2568
  {
@@ -2567,9 +2719,78 @@ type LightCompressedToken = {
2567
2719
  {
2568
2720
  code: 6032;
2569
2721
  name: 'NoMatchingBumpFound';
2570
- }
2722
+ },
2571
2723
  ];
2572
2724
  };
2573
2725
  declare const IDL: LightCompressedToken;
2574
2726
 
2575
- 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, 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, sumUpTokenAmount, type thawAccountsLayoutParams, transfer, transferAccountsLayout, type transferAccountsLayoutParams, validateSameTokenOwner };
2727
+ export {
2728
+ type ApproveAndMintToParams,
2729
+ COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR,
2730
+ CPI_AUTHORITY_SEED,
2731
+ CREATE_TOKEN_POOL_DISCRIMINATOR,
2732
+ type CompressParams,
2733
+ type CompressSplTokenAccountInstructionData,
2734
+ type CompressSplTokenAccountParams,
2735
+ type CompressedCpiContext,
2736
+ type CompressedTokenInstructionDataTransfer,
2737
+ CompressedTokenInstructionDataTransferLayout,
2738
+ CompressedTokenProgram,
2739
+ CpiContextLayout,
2740
+ type CreateMintParams,
2741
+ type CreateTokenProgramLookupTableParams,
2742
+ type DecompressParams,
2743
+ type DelegatedTransfer,
2744
+ DelegatedTransferLayout,
2745
+ IDL,
2746
+ type InputTokenDataWithContext,
2747
+ type LightCompressedToken,
2748
+ MINT_TO_DISCRIMINATOR,
2749
+ type MergeTokenAccountsParams,
2750
+ type MintToInstructionData,
2751
+ type MintToParams,
2752
+ POOL_SEED,
2753
+ type PackCompressedTokenAccountsParams,
2754
+ type PackedTokenTransferOutputData,
2755
+ type RegisterMintParams,
2756
+ SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,
2757
+ TRANSFER_DISCRIMINATOR,
2758
+ type TokenData,
2759
+ type TokenTransferOutputData,
2760
+ type TransferParams,
2761
+ type approveAccountsLayoutParams,
2762
+ approveAndMintTo,
2763
+ compress,
2764
+ compressSplTokenAccount,
2765
+ compressSplTokenAccountInstructionDataLayout,
2766
+ createDecompressOutputState,
2767
+ createMint,
2768
+ createTokenPool,
2769
+ createTokenPoolAccountsLayout,
2770
+ type createTokenPoolAccountsLayoutParams,
2771
+ createTokenProgramLookupTable,
2772
+ createTransferOutputState,
2773
+ decodeCompressSplTokenAccountInstructionData,
2774
+ decodeMintToInstructionData,
2775
+ decodeTransferInstructionData,
2776
+ decompress,
2777
+ encodeCompressSplTokenAccountInstructionData,
2778
+ encodeMintToInstructionData,
2779
+ encodeTransferInstructionData,
2780
+ type freezeAccountsLayoutParams,
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
+ };