@lightprotocol/compressed-token 0.15.3 → 0.16.0

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,19 @@
1
- import { CompressedProof, ParsedTokenAccount, TokenTransferOutputData as TokenTransferOutputData$1, InputTokenDataWithContext as InputTokenDataWithContext$1, Rpc } from '@lightprotocol/stateless.js';
2
- import { PublicKey, AccountMeta, TransactionInstruction, Signer, ConfirmOptions, TransactionSignature, Keypair } from '@solana/web3.js';
1
+ import {
2
+ CompressedProof,
3
+ ParsedTokenAccount,
4
+ TokenTransferOutputData as TokenTransferOutputData$1,
5
+ InputTokenDataWithContext as InputTokenDataWithContext$1,
6
+ Rpc,
7
+ } from '@lightprotocol/stateless.js';
8
+ import {
9
+ PublicKey,
10
+ AccountMeta,
11
+ TransactionInstruction,
12
+ Signer,
13
+ ConfirmOptions,
14
+ TransactionSignature,
15
+ Keypair,
16
+ } from '@solana/web3.js';
3
17
  import { BN, Program } from '@coral-xyz/anchor';
4
18
 
5
19
  type LightCompressedToken = {
@@ -12,7 +26,7 @@ type LightCompressedToken = {
12
26
  'This instruction creates a token pool for a given mint. Every spl mint',
13
27
  'can have one token pool. When a token is compressed the tokens are',
14
28
  'transferrred to the token pool, and their compressed equivalent is',
15
- 'minted into a Merkle tree.'
29
+ 'minted into a Merkle tree.',
16
30
  ];
17
31
  accounts: [
18
32
  {
@@ -45,7 +59,7 @@ type LightCompressedToken = {
45
59
  name: 'cpiAuthorityPda';
46
60
  isMut: false;
47
61
  isSigner: false;
48
- }
62
+ },
49
63
  ];
50
64
  args: [];
51
65
  },
@@ -58,7 +72,7 @@ type LightCompressedToken = {
58
72
  'every amount and pubkey input pair. A constant amount of lamports can be',
59
73
  'transferred to each output account to enable. A use case to add lamports',
60
74
  'to a compressed token account is to prevent spam. This is the only way',
61
- 'to add lamports to a compressed token account.'
75
+ 'to add lamports to a compressed token account.',
62
76
  ];
63
77
  accounts: [
64
78
  {
@@ -87,7 +101,7 @@ type LightCompressedToken = {
87
101
  isMut: true;
88
102
  isSigner: false;
89
103
  docs: [
90
- 'account to a token account of a different mint will fail'
104
+ 'account to a token account of a different mint will fail',
91
105
  ];
92
106
  },
93
107
  {
@@ -141,7 +155,7 @@ type LightCompressedToken = {
141
155
  isMut: true;
142
156
  isSigner: false;
143
157
  isOptional: true;
144
- }
158
+ },
145
159
  ];
146
160
  args: [
147
161
  {
@@ -161,7 +175,7 @@ type LightCompressedToken = {
161
175
  type: {
162
176
  option: 'u64';
163
177
  };
164
- }
178
+ },
165
179
  ];
166
180
  },
167
181
  {
@@ -180,7 +194,7 @@ type LightCompressedToken = {
180
194
  docs: [
181
195
  'Authority is verified through proof since both owner and delegate',
182
196
  'are included in the token data hash, which is a public input to the',
183
- 'validity proof.'
197
+ 'validity proof.',
184
198
  ];
185
199
  },
186
200
  {
@@ -241,7 +255,7 @@ type LightCompressedToken = {
241
255
  name: 'systemProgram';
242
256
  isMut: false;
243
257
  isSigner: false;
244
- }
258
+ },
245
259
  ];
246
260
  args: [
247
261
  {
@@ -261,7 +275,7 @@ type LightCompressedToken = {
261
275
  defined: 'CompressedCpiContext';
262
276
  };
263
277
  };
264
- }
278
+ },
265
279
  ];
266
280
  },
267
281
  {
@@ -274,7 +288,7 @@ type LightCompressedToken = {
274
288
  'accounts specify less lamports than inputs the remaining lamports are',
275
289
  'transferred to an output compressed account. Signer must be owner or',
276
290
  'delegate. If a delegated token account is transferred the delegate is',
277
- 'not preserved.'
291
+ 'not preserved.',
278
292
  ];
279
293
  accounts: [
280
294
  {
@@ -290,7 +304,7 @@ type LightCompressedToken = {
290
304
  docs: [
291
305
  'Authority is verified through proof since both owner and delegate',
292
306
  'are included in the token data hash, which is a public input to the',
293
- 'validity proof.'
307
+ 'validity proof.',
294
308
  ];
295
309
  },
296
310
  {
@@ -351,13 +365,13 @@ type LightCompressedToken = {
351
365
  name: 'systemProgram';
352
366
  isMut: false;
353
367
  isSigner: false;
354
- }
368
+ },
355
369
  ];
356
370
  args: [
357
371
  {
358
372
  name: 'inputs';
359
373
  type: 'bytes';
360
- }
374
+ },
361
375
  ];
362
376
  },
363
377
  {
@@ -368,7 +382,7 @@ type LightCompressedToken = {
368
382
  'be called by a delegate.',
369
383
  'The instruction creates two output accounts:',
370
384
  '1. one account with delegated amount',
371
- '2. one account with remaining(change) amount'
385
+ '2. one account with remaining(change) amount',
372
386
  ];
373
387
  accounts: [
374
388
  {
@@ -384,7 +398,7 @@ type LightCompressedToken = {
384
398
  docs: [
385
399
  'Authority is verified through proof since both owner and delegate',
386
400
  'are included in the token data hash, which is a public input to the',
387
- 'validity proof.'
401
+ 'validity proof.',
388
402
  ];
389
403
  },
390
404
  {
@@ -427,20 +441,20 @@ type LightCompressedToken = {
427
441
  name: 'systemProgram';
428
442
  isMut: false;
429
443
  isSigner: false;
430
- }
444
+ },
431
445
  ];
432
446
  args: [
433
447
  {
434
448
  name: 'inputs';
435
449
  type: 'bytes';
436
- }
450
+ },
437
451
  ];
438
452
  },
439
453
  {
440
454
  name: 'revoke';
441
455
  docs: [
442
456
  'Revokes a delegation. The instruction merges all inputs into one output',
443
- 'account. Cannot be called by a delegate. Delegates are not preserved.'
457
+ 'account. Cannot be called by a delegate. Delegates are not preserved.',
444
458
  ];
445
459
  accounts: [
446
460
  {
@@ -456,7 +470,7 @@ type LightCompressedToken = {
456
470
  docs: [
457
471
  'Authority is verified through proof since both owner and delegate',
458
472
  'are included in the token data hash, which is a public input to the',
459
- 'validity proof.'
473
+ 'validity proof.',
460
474
  ];
461
475
  },
462
476
  {
@@ -499,20 +513,20 @@ type LightCompressedToken = {
499
513
  name: 'systemProgram';
500
514
  isMut: false;
501
515
  isSigner: false;
502
- }
516
+ },
503
517
  ];
504
518
  args: [
505
519
  {
506
520
  name: 'inputs';
507
521
  type: 'bytes';
508
- }
522
+ },
509
523
  ];
510
524
  },
511
525
  {
512
526
  name: 'freeze';
513
527
  docs: [
514
528
  'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
515
- 'many outputs as inputs. Balances and delegates are preserved.'
529
+ 'many outputs as inputs. Balances and delegates are preserved.',
516
530
  ];
517
531
  accounts: [
518
532
  {
@@ -571,20 +585,20 @@ type LightCompressedToken = {
571
585
  name: 'mint';
572
586
  isMut: false;
573
587
  isSigner: false;
574
- }
588
+ },
575
589
  ];
576
590
  args: [
577
591
  {
578
592
  name: 'inputs';
579
593
  type: 'bytes';
580
- }
594
+ },
581
595
  ];
582
596
  },
583
597
  {
584
598
  name: 'thaw';
585
599
  docs: [
586
600
  'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
587
- 'as many outputs as inputs. Balances and delegates are preserved.'
601
+ 'as many outputs as inputs. Balances and delegates are preserved.',
588
602
  ];
589
603
  accounts: [
590
604
  {
@@ -643,13 +657,13 @@ type LightCompressedToken = {
643
657
  name: 'mint';
644
658
  isMut: false;
645
659
  isSigner: false;
646
- }
660
+ },
647
661
  ];
648
662
  args: [
649
663
  {
650
664
  name: 'inputs';
651
665
  type: 'bytes';
652
- }
666
+ },
653
667
  ];
654
668
  },
655
669
  {
@@ -657,7 +671,7 @@ type LightCompressedToken = {
657
671
  docs: [
658
672
  'Burns compressed tokens and spl tokens from the pool account. Delegates',
659
673
  'can burn tokens. The output compressed token account remains delegated.',
660
- 'Creates one output compressed token account.'
674
+ 'Creates one output compressed token account.',
661
675
  ];
662
676
  accounts: [
663
677
  {
@@ -673,7 +687,7 @@ type LightCompressedToken = {
673
687
  docs: [
674
688
  'Authority is verified through proof since both owner and delegate',
675
689
  'are included in the token data hash, which is a public input to the',
676
- 'validity proof.'
690
+ 'validity proof.',
677
691
  ];
678
692
  },
679
693
  {
@@ -730,13 +744,13 @@ type LightCompressedToken = {
730
744
  name: 'systemProgram';
731
745
  isMut: false;
732
746
  isSigner: false;
733
- }
747
+ },
734
748
  ];
735
749
  args: [
736
750
  {
737
751
  name: 'inputs';
738
752
  type: 'bytes';
739
- }
753
+ },
740
754
  ];
741
755
  },
742
756
  {
@@ -744,7 +758,7 @@ type LightCompressedToken = {
744
758
  docs: [
745
759
  'This function is a stub to allow Anchor to include the input types in',
746
760
  'the IDL. It should not be included in production builds nor be called in',
747
- 'practice.'
761
+ 'practice.',
748
762
  ];
749
763
  accounts: [
750
764
  {
@@ -760,7 +774,7 @@ type LightCompressedToken = {
760
774
  docs: [
761
775
  'Authority is verified through proof since both owner and delegate',
762
776
  'are included in the token data hash, which is a public input to the',
763
- 'validity proof.'
777
+ 'validity proof.',
764
778
  ];
765
779
  },
766
780
  {
@@ -821,7 +835,7 @@ type LightCompressedToken = {
821
835
  name: 'systemProgram';
822
836
  isMut: false;
823
837
  isSigner: false;
824
- }
838
+ },
825
839
  ];
826
840
  args: [
827
841
  {
@@ -835,9 +849,9 @@ type LightCompressedToken = {
835
849
  type: {
836
850
  defined: 'TokenData';
837
851
  };
838
- }
852
+ },
839
853
  ];
840
- }
854
+ },
841
855
  ];
842
856
  types: [
843
857
  {
@@ -853,7 +867,7 @@ type LightCompressedToken = {
853
867
  {
854
868
  name: 'programOwner';
855
869
  docs: [
856
- 'Program owner of the Merkle tree. This will be used for program owned Merkle trees.'
870
+ 'Program owner of the Merkle tree. This will be used for program owned Merkle trees.',
857
871
  ];
858
872
  type: 'publicKey';
859
873
  },
@@ -865,10 +879,10 @@ type LightCompressedToken = {
865
879
  'forested by light foresters. The variable is not used in the account',
866
880
  'compression program but the registry program. The registry program',
867
881
  'implements access control to prevent contention during forester. The',
868
- 'forester pubkey specified in this struct can bypass contention checks.'
882
+ 'forester pubkey specified in this struct can bypass contention checks.',
869
883
  ];
870
884
  type: 'publicKey';
871
- }
885
+ },
872
886
  ];
873
887
  };
874
888
  },
@@ -882,7 +896,7 @@ type LightCompressedToken = {
882
896
  },
883
897
  {
884
898
  name: 'Frozen';
885
- }
899
+ },
886
900
  ];
887
901
  };
888
902
  },
@@ -914,7 +928,7 @@ type LightCompressedToken = {
914
928
  defined: 'CompressedAccountData';
915
929
  };
916
930
  };
917
- }
931
+ },
918
932
  ];
919
933
  };
920
934
  },
@@ -938,7 +952,7 @@ type LightCompressedToken = {
938
952
  type: {
939
953
  array: ['u8', 32];
940
954
  };
941
- }
955
+ },
942
956
  ];
943
957
  };
944
958
  },
@@ -951,7 +965,7 @@ type LightCompressedToken = {
951
965
  name: 'setContext';
952
966
  docs: [
953
967
  'Is set by the program that is invoking the CPI to signal that is should',
954
- 'set the cpi context.'
968
+ 'set the cpi context.',
955
969
  ];
956
970
  type: 'bool';
957
971
  },
@@ -959,17 +973,17 @@ type LightCompressedToken = {
959
973
  name: 'firstSetContext';
960
974
  docs: [
961
975
  'Is set to wipe the cpi context since someone could have set it before',
962
- 'with unrelated data.'
976
+ 'with unrelated data.',
963
977
  ];
964
978
  type: 'bool';
965
979
  },
966
980
  {
967
981
  name: 'cpiContextAccountIndex';
968
982
  docs: [
969
- 'Index of cpi context account in remaining accounts.'
983
+ 'Index of cpi context account in remaining accounts.',
970
984
  ];
971
985
  type: 'u8';
972
- }
986
+ },
973
987
  ];
974
988
  };
975
989
  },
@@ -995,7 +1009,7 @@ type LightCompressedToken = {
995
1009
  type: {
996
1010
  array: ['u8', 32];
997
1011
  };
998
- }
1012
+ },
999
1013
  ];
1000
1014
  };
1001
1015
  },
@@ -1021,7 +1035,7 @@ type LightCompressedToken = {
1021
1035
  docs: [
1022
1036
  'Is required if the signer is delegate,',
1023
1037
  '-> delegate is authority account,',
1024
- 'owner = Some(owner) is the owner of the token account.'
1038
+ 'owner = Some(owner) is the owner of the token account.',
1025
1039
  ];
1026
1040
  type: {
1027
1041
  option: {
@@ -1068,14 +1082,14 @@ type LightCompressedToken = {
1068
1082
  type: {
1069
1083
  option: 'u8';
1070
1084
  };
1071
- }
1085
+ },
1072
1086
  ];
1073
1087
  };
1074
1088
  },
1075
1089
  {
1076
1090
  name: 'DelegatedTransfer';
1077
1091
  docs: [
1078
- 'Struct to provide the owner when the delegate is signer of the transaction.'
1092
+ 'Struct to provide the owner when the delegate is signer of the transaction.',
1079
1093
  ];
1080
1094
  type: {
1081
1095
  kind: 'struct';
@@ -1090,12 +1104,12 @@ type LightCompressedToken = {
1090
1104
  'Index of change compressed account in output compressed accounts. In',
1091
1105
  "case that the delegate didn't spend the complete delegated compressed",
1092
1106
  'account balance the change compressed account will be delegated to her',
1093
- 'as well.'
1107
+ 'as well.',
1094
1108
  ];
1095
1109
  type: {
1096
1110
  option: 'u8';
1097
1111
  };
1098
- }
1112
+ },
1099
1113
  ];
1100
1114
  };
1101
1115
  },
@@ -1133,12 +1147,12 @@ type LightCompressedToken = {
1133
1147
  {
1134
1148
  name: 'tlv';
1135
1149
  docs: [
1136
- 'Placeholder for TokenExtension tlv data (unimplemented)'
1150
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1137
1151
  ];
1138
1152
  type: {
1139
1153
  option: 'bytes';
1140
1154
  };
1141
- }
1155
+ },
1142
1156
  ];
1143
1157
  };
1144
1158
  },
@@ -1194,7 +1208,7 @@ type LightCompressedToken = {
1194
1208
  {
1195
1209
  name: 'isCompress';
1196
1210
  type: 'bool';
1197
- }
1211
+ },
1198
1212
  ];
1199
1213
  };
1200
1214
  },
@@ -1258,7 +1272,7 @@ type LightCompressedToken = {
1258
1272
  defined: 'CompressedCpiContext';
1259
1273
  };
1260
1274
  };
1261
- }
1275
+ },
1262
1276
  ];
1263
1277
  };
1264
1278
  },
@@ -1286,7 +1300,7 @@ type LightCompressedToken = {
1286
1300
  {
1287
1301
  name: 'nextMerkleTree';
1288
1302
  type: 'publicKey';
1289
- }
1303
+ },
1290
1304
  ];
1291
1305
  };
1292
1306
  },
@@ -1302,7 +1316,7 @@ type LightCompressedToken = {
1302
1316
  {
1303
1317
  name: 'seq';
1304
1318
  type: 'u64';
1305
- }
1319
+ },
1306
1320
  ];
1307
1321
  };
1308
1322
  },
@@ -1328,7 +1342,7 @@ type LightCompressedToken = {
1328
1342
  {
1329
1343
  name: 'addressMerkleTreeRootIndex';
1330
1344
  type: 'u16';
1331
- }
1345
+ },
1332
1346
  ];
1333
1347
  };
1334
1348
  },
@@ -1346,7 +1360,7 @@ type LightCompressedToken = {
1346
1360
  {
1347
1361
  name: 'merkleTreeIndex';
1348
1362
  type: 'u8';
1349
- }
1363
+ },
1350
1364
  ];
1351
1365
  };
1352
1366
  },
@@ -1370,17 +1384,17 @@ type LightCompressedToken = {
1370
1384
  {
1371
1385
  name: 'rootIndex';
1372
1386
  docs: [
1373
- 'Index of root used in inclusion validity proof.'
1387
+ 'Index of root used in inclusion validity proof.',
1374
1388
  ];
1375
1389
  type: 'u16';
1376
1390
  },
1377
1391
  {
1378
1392
  name: 'readOnly';
1379
1393
  docs: [
1380
- 'Placeholder to mark accounts read-only unimplemented set to false.'
1394
+ 'Placeholder to mark accounts read-only unimplemented set to false.',
1381
1395
  ];
1382
1396
  type: 'bool';
1383
- }
1397
+ },
1384
1398
  ];
1385
1399
  };
1386
1400
  },
@@ -1405,14 +1419,14 @@ type LightCompressedToken = {
1405
1419
  name: 'queueIndex';
1406
1420
  docs: [
1407
1421
  'Index of leaf in queue. Placeholder of batched Merkle tree updates',
1408
- 'currently unimplemented.'
1422
+ 'currently unimplemented.',
1409
1423
  ];
1410
1424
  type: {
1411
1425
  option: {
1412
1426
  defined: 'QueueIndex';
1413
1427
  };
1414
1428
  };
1415
- }
1429
+ },
1416
1430
  ];
1417
1431
  };
1418
1432
  },
@@ -1442,12 +1456,12 @@ type LightCompressedToken = {
1442
1456
  {
1443
1457
  name: 'tlv';
1444
1458
  docs: [
1445
- 'Placeholder for TokenExtension tlv data (unimplemented)'
1459
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1446
1460
  ];
1447
1461
  type: {
1448
1462
  option: 'bytes';
1449
1463
  };
1450
- }
1464
+ },
1451
1465
  ];
1452
1466
  };
1453
1467
  },
@@ -1521,7 +1535,7 @@ type LightCompressedToken = {
1521
1535
  type: {
1522
1536
  option: 'bytes';
1523
1537
  };
1524
- }
1538
+ },
1525
1539
  ];
1526
1540
  };
1527
1541
  },
@@ -1539,7 +1553,7 @@ type LightCompressedToken = {
1539
1553
  name: 'index';
1540
1554
  docs: ['Index of compressed account hash in queue.'];
1541
1555
  type: 'u16';
1542
- }
1556
+ },
1543
1557
  ];
1544
1558
  };
1545
1559
  },
@@ -1557,14 +1571,14 @@ type LightCompressedToken = {
1557
1571
  name: 'rolloverFee';
1558
1572
  docs: [
1559
1573
  'This fee is used for rent for the next account.',
1560
- 'It accumulates in the account so that once the corresponding Merkle tree account is full it can be rolled over'
1574
+ 'It accumulates in the account so that once the corresponding Merkle tree account is full it can be rolled over',
1561
1575
  ];
1562
1576
  type: 'u64';
1563
1577
  },
1564
1578
  {
1565
1579
  name: 'rolloverThreshold';
1566
1580
  docs: [
1567
- 'The threshold in percentage points when the account should be rolled over (95 corresponds to 95% filled).'
1581
+ 'The threshold in percentage points when the account should be rolled over (95 corresponds to 95% filled).',
1568
1582
  ];
1569
1583
  type: 'u64';
1570
1584
  },
@@ -1576,7 +1590,7 @@ type LightCompressedToken = {
1576
1590
  {
1577
1591
  name: 'rolledoverSlot';
1578
1592
  docs: [
1579
- 'The slot when the account was rolled over, a rolled over account should not be written to.'
1593
+ 'The slot when the account was rolled over, a rolled over account should not be written to.',
1580
1594
  ];
1581
1595
  type: 'u64';
1582
1596
  },
@@ -1585,7 +1599,7 @@ type LightCompressedToken = {
1585
1599
  docs: [
1586
1600
  'If current slot is greater than rolledover_slot + close_threshold and',
1587
1601
  "the account is empty it can be closed. No 'close' functionality has been",
1588
- 'implemented yet.'
1602
+ 'implemented yet.',
1589
1603
  ];
1590
1604
  type: 'u64';
1591
1605
  },
@@ -1593,10 +1607,10 @@ type LightCompressedToken = {
1593
1607
  name: 'additionalBytes';
1594
1608
  docs: [
1595
1609
  'Placeholder for bytes of additional accounts which are tied to the',
1596
- 'Merkle trees operation and need to be rolled over as well.'
1610
+ 'Merkle trees operation and need to be rolled over as well.',
1597
1611
  ];
1598
1612
  type: 'u64';
1599
- }
1613
+ },
1600
1614
  ];
1601
1615
  };
1602
1616
  },
@@ -1624,7 +1638,7 @@ type LightCompressedToken = {
1624
1638
  name: 'delegate';
1625
1639
  docs: [
1626
1640
  'If `delegate` is `Some` then `delegated_amount` represents',
1627
- 'the amount authorized by the delegate'
1641
+ 'the amount authorized by the delegate',
1628
1642
  ];
1629
1643
  type: {
1630
1644
  option: 'publicKey';
@@ -1640,15 +1654,15 @@ type LightCompressedToken = {
1640
1654
  {
1641
1655
  name: 'tlv';
1642
1656
  docs: [
1643
- 'Placeholder for TokenExtension tlv data (unimplemented)'
1657
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1644
1658
  ];
1645
1659
  type: {
1646
1660
  option: 'bytes';
1647
1661
  };
1648
- }
1662
+ },
1649
1663
  ];
1650
1664
  };
1651
- }
1665
+ },
1652
1666
  ];
1653
1667
  errors: [
1654
1668
  {
@@ -1670,7 +1684,7 @@ type LightCompressedToken = {
1670
1684
  code: 6003;
1671
1685
  name: 'SerializationError';
1672
1686
  msg: 'Serialization error';
1673
- }
1687
+ },
1674
1688
  ];
1675
1689
  };
1676
1690
  declare const IDL: LightCompressedToken;
@@ -1830,7 +1844,9 @@ type PackCompressedTokenAccountsParams = {
1830
1844
  /**
1831
1845
  * Packs Compressed Token Accounts.
1832
1846
  */
1833
- declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
1847
+ declare function packCompressedTokenAccounts(
1848
+ params: PackCompressedTokenAccountsParams,
1849
+ ): {
1834
1850
  inputTokenDataWithContext: InputTokenDataWithContext$1[];
1835
1851
  remainingAccountMetas: AccountMeta[];
1836
1852
  packedOutputTokenData: PackedTokenTransferOutputData[];
@@ -2135,7 +2151,9 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
2135
2151
  /**
2136
2152
  * Parse compressed token accounts to get the mint, current owner and delegate.
2137
2153
  */
2138
- declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
2154
+ declare const parseTokenData: (
2155
+ compressedTokenAccounts: ParsedTokenAccount[],
2156
+ ) => {
2139
2157
  mint: PublicKey;
2140
2158
  currentOwner: PublicKey;
2141
2159
  delegate: PublicKey | null;
@@ -2148,7 +2166,11 @@ declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) =>
2148
2166
  * @returns Output token data for the transfer
2149
2167
  * instruction
2150
2168
  */
2151
- declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData$1[];
2169
+ declare function createTransferOutputState(
2170
+ inputCompressedTokenAccounts: ParsedTokenAccount[],
2171
+ toAddress: PublicKey,
2172
+ amount: number | BN,
2173
+ ): TokenTransferOutputData$1[];
2152
2174
  /**
2153
2175
  * Create the output state for a compress transaction.
2154
2176
  * @param inputCompressedTokenAccounts Input state
@@ -2156,7 +2178,10 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
2156
2178
  * @returns Output token data for the compress
2157
2179
  * instruction
2158
2180
  */
2159
- declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData$1[];
2181
+ declare function createDecompressOutputState(
2182
+ inputCompressedTokenAccounts: ParsedTokenAccount[],
2183
+ amount: number | BN,
2184
+ ): TokenTransferOutputData$1[];
2160
2185
  declare class CompressedTokenProgram {
2161
2186
  /**
2162
2187
  * @internal
@@ -2188,12 +2213,16 @@ declare class CompressedTokenProgram {
2188
2213
  /**
2189
2214
  * Construct createMint instruction for compressed tokens
2190
2215
  */
2191
- static createMint(params: CreateMintParams): Promise<TransactionInstruction[]>;
2216
+ static createMint(
2217
+ params: CreateMintParams,
2218
+ ): Promise<TransactionInstruction[]>;
2192
2219
  /**
2193
2220
  * Enable compression for an existing SPL mint, creating an omnibus account.
2194
2221
  * For new mints, use `CompressedTokenProgram.createMint`.
2195
2222
  */
2196
- static createTokenPool(params: RegisterMintParams): Promise<TransactionInstruction>;
2223
+ static createTokenPool(
2224
+ params: RegisterMintParams,
2225
+ ): Promise<TransactionInstruction>;
2197
2226
  /**
2198
2227
  * Construct mintTo instruction for compressed tokens
2199
2228
  */
@@ -2201,7 +2230,9 @@ declare class CompressedTokenProgram {
2201
2230
  /**
2202
2231
  * Mint tokens from registed SPL mint account to a compressed account
2203
2232
  */
2204
- static approveAndMintTo(params: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
2233
+ static approveAndMintTo(
2234
+ params: ApproveAndMintToParams,
2235
+ ): Promise<TransactionInstruction[]>;
2205
2236
  /**
2206
2237
  * Construct transfer instruction for compressed tokens
2207
2238
  */
@@ -2209,7 +2240,9 @@ declare class CompressedTokenProgram {
2209
2240
  /**
2210
2241
  * Create lookup table instructions for the token program's default accounts.
2211
2242
  */
2212
- static createTokenProgramLookupTable(params: CreateTokenProgramLookupTableParams): Promise<{
2243
+ static createTokenProgramLookupTable(
2244
+ params: CreateTokenProgramLookupTableParams,
2245
+ ): Promise<{
2213
2246
  instructions: TransactionInstruction[];
2214
2247
  address: PublicKey;
2215
2248
  }>;
@@ -2221,9 +2254,15 @@ declare class CompressedTokenProgram {
2221
2254
  /**
2222
2255
  * Construct decompress instruction
2223
2256
  */
2224
- static decompress(params: DecompressParams): Promise<TransactionInstruction>;
2225
- static mergeTokenAccounts(params: MergeTokenAccountsParams): Promise<TransactionInstruction[]>;
2226
- static compressSplTokenAccount(params: CompressSplTokenAccountParams): Promise<TransactionInstruction>;
2257
+ static decompress(
2258
+ params: DecompressParams,
2259
+ ): Promise<TransactionInstruction>;
2260
+ static mergeTokenAccounts(
2261
+ params: MergeTokenAccountsParams,
2262
+ ): Promise<TransactionInstruction[]>;
2263
+ static compressSplTokenAccount(
2264
+ params: CompressSplTokenAccountParams,
2265
+ ): Promise<TransactionInstruction>;
2227
2266
  }
2228
2267
 
2229
2268
  /**
@@ -2241,7 +2280,16 @@ declare class CompressedTokenProgram {
2241
2280
  *
2242
2281
  * @return Signature of the confirmed transaction
2243
2282
  */
2244
- declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer, amount: number | BN, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2283
+ declare function approveAndMintTo(
2284
+ rpc: Rpc,
2285
+ payer: Signer,
2286
+ mint: PublicKey,
2287
+ destination: PublicKey,
2288
+ authority: Signer,
2289
+ amount: number | BN,
2290
+ merkleTree?: PublicKey,
2291
+ confirmOptions?: ConfirmOptions,
2292
+ ): Promise<TransactionSignature>;
2245
2293
 
2246
2294
  /**
2247
2295
  * Compress SPL tokens
@@ -2261,7 +2309,17 @@ declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, dest
2261
2309
  *
2262
2310
  * @return Signature of the confirmed transaction
2263
2311
  */
2264
- 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): Promise<TransactionSignature>;
2312
+ declare function compress(
2313
+ rpc: Rpc,
2314
+ payer: Signer,
2315
+ mint: PublicKey,
2316
+ amount: number | BN | number[] | BN[],
2317
+ owner: Signer,
2318
+ sourceTokenAccount: PublicKey,
2319
+ toAddress: PublicKey | Array<PublicKey>,
2320
+ merkleTree?: PublicKey,
2321
+ confirmOptions?: ConfirmOptions,
2322
+ ): Promise<TransactionSignature>;
2265
2323
 
2266
2324
  /**
2267
2325
  * Decompress compressed tokens
@@ -2281,7 +2339,16 @@ declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
2281
2339
  *
2282
2340
  * @return Signature of the confirmed transaction
2283
2341
  */
2284
- declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2342
+ declare function decompress(
2343
+ rpc: Rpc,
2344
+ payer: Signer,
2345
+ mint: PublicKey,
2346
+ amount: number | BN,
2347
+ owner: Signer,
2348
+ toAddress: PublicKey,
2349
+ merkleTree?: PublicKey,
2350
+ confirmOptions?: ConfirmOptions,
2351
+ ): Promise<TransactionSignature>;
2285
2352
 
2286
2353
  /**
2287
2354
  * Create and initialize a new compressed token mint
@@ -2295,7 +2362,14 @@ declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: nu
2295
2362
  *
2296
2363
  * @return Address of the new mint and the transaction signature
2297
2364
  */
2298
- declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions): Promise<{
2365
+ declare function createMint(
2366
+ rpc: Rpc,
2367
+ payer: Signer,
2368
+ mintAuthority: PublicKey,
2369
+ decimals: number,
2370
+ keypair?: Keypair,
2371
+ confirmOptions?: ConfirmOptions,
2372
+ ): Promise<{
2299
2373
  mint: PublicKey;
2300
2374
  transactionSignature: TransactionSignature;
2301
2375
  }>;
@@ -2317,7 +2391,16 @@ declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, d
2317
2391
  *
2318
2392
  * @return Signature of the confirmed transaction
2319
2393
  */
2320
- declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey | PublicKey[], authority: Signer, amount: number | BN | number[] | BN[], merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2394
+ declare function mintTo(
2395
+ rpc: Rpc,
2396
+ payer: Signer,
2397
+ mint: PublicKey,
2398
+ destination: PublicKey | PublicKey[],
2399
+ authority: Signer,
2400
+ amount: number | BN | number[] | BN[],
2401
+ merkleTree?: PublicKey,
2402
+ confirmOptions?: ConfirmOptions,
2403
+ ): Promise<TransactionSignature>;
2321
2404
 
2322
2405
  /**
2323
2406
  * Merge multiple compressed token accounts for a given mint into a single
@@ -2332,7 +2415,14 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
2332
2415
  *
2333
2416
  * @return Array of transaction signatures
2334
2417
  */
2335
- declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2418
+ declare function mergeTokenAccounts(
2419
+ rpc: Rpc,
2420
+ payer: Signer,
2421
+ mint: PublicKey,
2422
+ owner: Signer,
2423
+ merkleTree?: PublicKey,
2424
+ confirmOptions?: ConfirmOptions,
2425
+ ): Promise<TransactionSignature>;
2336
2426
 
2337
2427
  /**
2338
2428
  * Register an existing mint with the CompressedToken program
@@ -2345,7 +2435,12 @@ declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, ow
2345
2435
  *
2346
2436
  * @return transaction signature
2347
2437
  */
2348
- declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2438
+ declare function createTokenPool(
2439
+ rpc: Rpc,
2440
+ payer: Signer,
2441
+ mintAddress: PublicKey,
2442
+ confirmOptions?: ConfirmOptions,
2443
+ ): Promise<TransactionSignature>;
2349
2444
 
2350
2445
  /**
2351
2446
  * Transfer compressed tokens from one owner to another
@@ -2364,7 +2459,16 @@ declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey
2364
2459
  *
2365
2460
  * @return Signature of the confirmed transaction
2366
2461
  */
2367
- declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2462
+ declare function transfer(
2463
+ rpc: Rpc,
2464
+ payer: Signer,
2465
+ mint: PublicKey,
2466
+ amount: number | BN,
2467
+ owner: Signer,
2468
+ toAddress: PublicKey,
2469
+ merkleTree?: PublicKey,
2470
+ confirmOptions?: ConfirmOptions,
2471
+ ): Promise<TransactionSignature>;
2368
2472
  /**
2369
2473
  * Selects the minimal number of compressed token accounts for a transfer.
2370
2474
  *
@@ -2372,10 +2476,13 @@ declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
2372
2476
  * 2. Accumulates the amount until it is greater than or equal to the transfer
2373
2477
  * amount
2374
2478
  */
2375
- declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN): [
2479
+ declare function selectMinCompressedTokenAccountsForTransfer(
2480
+ accounts: ParsedTokenAccount[],
2481
+ transferAmount: BN,
2482
+ ): [
2376
2483
  selectedAccounts: ParsedTokenAccount[],
2377
2484
  total: BN,
2378
- totalLamports: BN | null
2485
+ totalLamports: BN | null,
2379
2486
  ];
2380
2487
 
2381
2488
  /**
@@ -2391,7 +2498,13 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
2391
2498
  *
2392
2499
  * @return Transaction signatures and the address of the created lookup table
2393
2500
  */
2394
- declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
2501
+ declare function createTokenProgramLookupTable(
2502
+ rpc: Rpc,
2503
+ payer: Signer,
2504
+ authority: Signer,
2505
+ mints?: PublicKey[],
2506
+ additionalAccounts?: PublicKey[],
2507
+ ): Promise<{
2395
2508
  txIds: TransactionSignature[];
2396
2509
  address: PublicKey;
2397
2510
  }>;
@@ -2410,6 +2523,55 @@ declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authorit
2410
2523
  *
2411
2524
  * @return Signature of the confirmed transaction
2412
2525
  */
2413
- declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, outputStateTree: PublicKey, remainingAmount?: BN, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2526
+ declare function compressSplTokenAccount(
2527
+ rpc: Rpc,
2528
+ payer: Signer,
2529
+ mint: PublicKey,
2530
+ owner: Signer,
2531
+ tokenAccount: PublicKey,
2532
+ outputStateTree: PublicKey,
2533
+ remainingAmount?: BN,
2534
+ confirmOptions?: ConfirmOptions,
2535
+ ): Promise<TransactionSignature>;
2414
2536
 
2415
- export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressParams, type CompressSplTokenAccountParams, type CompressedTokenInstructionDataInvoke, CompressedTokenProgram, type CreateMintParams, type CreateTokenProgramLookupTableParams, type DecompressParams, IDL, type InputTokenDataWithContext, type LightCompressedToken, type MergeTokenAccountsParams, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, compressSplTokenAccount, createDecompressOutputState, createMint, createTokenPool, createTokenProgramLookupTable, createTransferOutputState, decompress, mergeTokenAccounts, mintTo, packCompressedTokenAccounts, parseTokenData, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
2537
+ export {
2538
+ type ApproveAndMintToParams,
2539
+ CPI_AUTHORITY_SEED,
2540
+ type CompressParams,
2541
+ type CompressSplTokenAccountParams,
2542
+ type CompressedTokenInstructionDataInvoke,
2543
+ CompressedTokenProgram,
2544
+ type CreateMintParams,
2545
+ type CreateTokenProgramLookupTableParams,
2546
+ type DecompressParams,
2547
+ IDL,
2548
+ type InputTokenDataWithContext,
2549
+ type LightCompressedToken,
2550
+ type MergeTokenAccountsParams,
2551
+ type MintToParams,
2552
+ POOL_SEED,
2553
+ type PackCompressedTokenAccountsParams,
2554
+ type PackedTokenTransferOutputData,
2555
+ type RegisterMintParams,
2556
+ SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,
2557
+ type TokenData,
2558
+ type TokenTransferOutputData,
2559
+ type TransferParams,
2560
+ approveAndMintTo,
2561
+ compress,
2562
+ compressSplTokenAccount,
2563
+ createDecompressOutputState,
2564
+ createMint,
2565
+ createTokenPool,
2566
+ createTokenProgramLookupTable,
2567
+ createTransferOutputState,
2568
+ decompress,
2569
+ mergeTokenAccounts,
2570
+ mintTo,
2571
+ packCompressedTokenAccounts,
2572
+ parseTokenData,
2573
+ selectMinCompressedTokenAccountsForTransfer,
2574
+ sumUpTokenAmount,
2575
+ transfer,
2576
+ validateSameTokenOwner,
2577
+ };