@lightprotocol/compressed-token 0.12.0 → 0.13.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,9 +1,23 @@
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 = {
6
- version: '1.0.0';
20
+ version: '1.2.0';
7
21
  name: 'light_compressed_token';
8
22
  instructions: [
9
23
  {
@@ -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
  {
@@ -174,7 +188,7 @@ type LightCompressedToken = {
174
188
  'accounts specify less lamports than inputs the remaining lamports are',
175
189
  'transferred to an output compressed account. Signer must be owner or',
176
190
  'delegate. If a delegated token account is transferred the delegate is',
177
- 'not preserved.'
191
+ 'not preserved.',
178
192
  ];
179
193
  accounts: [
180
194
  {
@@ -190,7 +204,7 @@ type LightCompressedToken = {
190
204
  docs: [
191
205
  'Authority is verified through proof since both owner and delegate',
192
206
  'are included in the token data hash, which is a public input to the',
193
- 'validity proof.'
207
+ 'validity proof.',
194
208
  ];
195
209
  },
196
210
  {
@@ -251,13 +265,13 @@ type LightCompressedToken = {
251
265
  name: 'systemProgram';
252
266
  isMut: false;
253
267
  isSigner: false;
254
- }
268
+ },
255
269
  ];
256
270
  args: [
257
271
  {
258
272
  name: 'inputs';
259
273
  type: 'bytes';
260
- }
274
+ },
261
275
  ];
262
276
  },
263
277
  {
@@ -268,7 +282,7 @@ type LightCompressedToken = {
268
282
  'be called by a delegate.',
269
283
  'The instruction creates two output accounts:',
270
284
  '1. one account with delegated amount',
271
- '2. one account with remaining(change) amount'
285
+ '2. one account with remaining(change) amount',
272
286
  ];
273
287
  accounts: [
274
288
  {
@@ -284,7 +298,7 @@ type LightCompressedToken = {
284
298
  docs: [
285
299
  'Authority is verified through proof since both owner and delegate',
286
300
  'are included in the token data hash, which is a public input to the',
287
- 'validity proof.'
301
+ 'validity proof.',
288
302
  ];
289
303
  },
290
304
  {
@@ -327,20 +341,20 @@ type LightCompressedToken = {
327
341
  name: 'systemProgram';
328
342
  isMut: false;
329
343
  isSigner: false;
330
- }
344
+ },
331
345
  ];
332
346
  args: [
333
347
  {
334
348
  name: 'inputs';
335
349
  type: 'bytes';
336
- }
350
+ },
337
351
  ];
338
352
  },
339
353
  {
340
354
  name: 'revoke';
341
355
  docs: [
342
356
  'Revokes a delegation. The instruction merges all inputs into one output',
343
- 'account. Cannot be called by a delegate. Delegates are not preserved.'
357
+ 'account. Cannot be called by a delegate. Delegates are not preserved.',
344
358
  ];
345
359
  accounts: [
346
360
  {
@@ -356,7 +370,7 @@ type LightCompressedToken = {
356
370
  docs: [
357
371
  'Authority is verified through proof since both owner and delegate',
358
372
  'are included in the token data hash, which is a public input to the',
359
- 'validity proof.'
373
+ 'validity proof.',
360
374
  ];
361
375
  },
362
376
  {
@@ -399,20 +413,20 @@ type LightCompressedToken = {
399
413
  name: 'systemProgram';
400
414
  isMut: false;
401
415
  isSigner: false;
402
- }
416
+ },
403
417
  ];
404
418
  args: [
405
419
  {
406
420
  name: 'inputs';
407
421
  type: 'bytes';
408
- }
422
+ },
409
423
  ];
410
424
  },
411
425
  {
412
426
  name: 'freeze';
413
427
  docs: [
414
428
  'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
415
- 'many outputs as inputs. Balances and delegates are preserved.'
429
+ 'many outputs as inputs. Balances and delegates are preserved.',
416
430
  ];
417
431
  accounts: [
418
432
  {
@@ -471,20 +485,20 @@ type LightCompressedToken = {
471
485
  name: 'mint';
472
486
  isMut: false;
473
487
  isSigner: false;
474
- }
488
+ },
475
489
  ];
476
490
  args: [
477
491
  {
478
492
  name: 'inputs';
479
493
  type: 'bytes';
480
- }
494
+ },
481
495
  ];
482
496
  },
483
497
  {
484
498
  name: 'thaw';
485
499
  docs: [
486
500
  'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
487
- 'as many outputs as inputs. Balances and delegates are preserved.'
501
+ 'as many outputs as inputs. Balances and delegates are preserved.',
488
502
  ];
489
503
  accounts: [
490
504
  {
@@ -543,13 +557,13 @@ type LightCompressedToken = {
543
557
  name: 'mint';
544
558
  isMut: false;
545
559
  isSigner: false;
546
- }
560
+ },
547
561
  ];
548
562
  args: [
549
563
  {
550
564
  name: 'inputs';
551
565
  type: 'bytes';
552
- }
566
+ },
553
567
  ];
554
568
  },
555
569
  {
@@ -557,7 +571,7 @@ type LightCompressedToken = {
557
571
  docs: [
558
572
  'Burns compressed tokens and spl tokens from the pool account. Delegates',
559
573
  'can burn tokens. The output compressed token account remains delegated.',
560
- 'Creates one output compressed token account.'
574
+ 'Creates one output compressed token account.',
561
575
  ];
562
576
  accounts: [
563
577
  {
@@ -573,7 +587,7 @@ type LightCompressedToken = {
573
587
  docs: [
574
588
  'Authority is verified through proof since both owner and delegate',
575
589
  'are included in the token data hash, which is a public input to the',
576
- 'validity proof.'
590
+ 'validity proof.',
577
591
  ];
578
592
  },
579
593
  {
@@ -630,13 +644,13 @@ type LightCompressedToken = {
630
644
  name: 'systemProgram';
631
645
  isMut: false;
632
646
  isSigner: false;
633
- }
647
+ },
634
648
  ];
635
649
  args: [
636
650
  {
637
651
  name: 'inputs';
638
652
  type: 'bytes';
639
- }
653
+ },
640
654
  ];
641
655
  },
642
656
  {
@@ -644,7 +658,7 @@ type LightCompressedToken = {
644
658
  docs: [
645
659
  'This function is a stub to allow Anchor to include the input types in',
646
660
  'the IDL. It should not be included in production builds nor be called in',
647
- 'practice.'
661
+ 'practice.',
648
662
  ];
649
663
  accounts: [
650
664
  {
@@ -660,7 +674,7 @@ type LightCompressedToken = {
660
674
  docs: [
661
675
  'Authority is verified through proof since both owner and delegate',
662
676
  'are included in the token data hash, which is a public input to the',
663
- 'validity proof.'
677
+ 'validity proof.',
664
678
  ];
665
679
  },
666
680
  {
@@ -721,7 +735,7 @@ type LightCompressedToken = {
721
735
  name: 'systemProgram';
722
736
  isMut: false;
723
737
  isSigner: false;
724
- }
738
+ },
725
739
  ];
726
740
  args: [
727
741
  {
@@ -735,9 +749,9 @@ type LightCompressedToken = {
735
749
  type: {
736
750
  defined: 'TokenData';
737
751
  };
738
- }
752
+ },
739
753
  ];
740
- }
754
+ },
741
755
  ];
742
756
  types: [
743
757
  {
@@ -753,7 +767,7 @@ type LightCompressedToken = {
753
767
  {
754
768
  name: 'programOwner';
755
769
  docs: [
756
- 'Program owner of the Merkle tree. This will be used for program owned Merkle trees.'
770
+ 'Program owner of the Merkle tree. This will be used for program owned Merkle trees.',
757
771
  ];
758
772
  type: 'publicKey';
759
773
  },
@@ -765,10 +779,10 @@ type LightCompressedToken = {
765
779
  'forested by light foresters. The variable is not used in the account',
766
780
  'compression program but the registry program. The registry program',
767
781
  'implements access control to prevent contention during forester. The',
768
- 'forester pubkey specified in this struct can bypass contention checks.'
782
+ 'forester pubkey specified in this struct can bypass contention checks.',
769
783
  ];
770
784
  type: 'publicKey';
771
- }
785
+ },
772
786
  ];
773
787
  };
774
788
  },
@@ -782,7 +796,7 @@ type LightCompressedToken = {
782
796
  },
783
797
  {
784
798
  name: 'Frozen';
785
- }
799
+ },
786
800
  ];
787
801
  };
788
802
  },
@@ -814,7 +828,7 @@ type LightCompressedToken = {
814
828
  defined: 'CompressedAccountData';
815
829
  };
816
830
  };
817
- }
831
+ },
818
832
  ];
819
833
  };
820
834
  },
@@ -838,7 +852,7 @@ type LightCompressedToken = {
838
852
  type: {
839
853
  array: ['u8', 32];
840
854
  };
841
- }
855
+ },
842
856
  ];
843
857
  };
844
858
  },
@@ -851,7 +865,7 @@ type LightCompressedToken = {
851
865
  name: 'setContext';
852
866
  docs: [
853
867
  'Is set by the program that is invoking the CPI to signal that is should',
854
- 'set the cpi context.'
868
+ 'set the cpi context.',
855
869
  ];
856
870
  type: 'bool';
857
871
  },
@@ -859,17 +873,17 @@ type LightCompressedToken = {
859
873
  name: 'firstSetContext';
860
874
  docs: [
861
875
  'Is set to wipe the cpi context since someone could have set it before',
862
- 'with unrelated data.'
876
+ 'with unrelated data.',
863
877
  ];
864
878
  type: 'bool';
865
879
  },
866
880
  {
867
881
  name: 'cpiContextAccountIndex';
868
882
  docs: [
869
- 'Index of cpi context account in remaining accounts.'
883
+ 'Index of cpi context account in remaining accounts.',
870
884
  ];
871
885
  type: 'u8';
872
- }
886
+ },
873
887
  ];
874
888
  };
875
889
  },
@@ -895,7 +909,7 @@ type LightCompressedToken = {
895
909
  type: {
896
910
  array: ['u8', 32];
897
911
  };
898
- }
912
+ },
899
913
  ];
900
914
  };
901
915
  },
@@ -921,7 +935,7 @@ type LightCompressedToken = {
921
935
  docs: [
922
936
  'Is required if the signer is delegate,',
923
937
  '-> delegate is authority account,',
924
- 'owner = Some(owner) is the owner of the token account.'
938
+ 'owner = Some(owner) is the owner of the token account.',
925
939
  ];
926
940
  type: {
927
941
  option: {
@@ -968,14 +982,14 @@ type LightCompressedToken = {
968
982
  type: {
969
983
  option: 'u8';
970
984
  };
971
- }
985
+ },
972
986
  ];
973
987
  };
974
988
  },
975
989
  {
976
990
  name: 'DelegatedTransfer';
977
991
  docs: [
978
- 'Struct to provide the owner when the delegate is signer of the transaction.'
992
+ 'Struct to provide the owner when the delegate is signer of the transaction.',
979
993
  ];
980
994
  type: {
981
995
  kind: 'struct';
@@ -990,12 +1004,12 @@ type LightCompressedToken = {
990
1004
  'Index of change compressed account in output compressed accounts. In',
991
1005
  "case that the delegate didn't spend the complete delegated compressed",
992
1006
  'account balance the change compressed account will be delegated to her',
993
- 'as well.'
1007
+ 'as well.',
994
1008
  ];
995
1009
  type: {
996
1010
  option: 'u8';
997
1011
  };
998
- }
1012
+ },
999
1013
  ];
1000
1014
  };
1001
1015
  },
@@ -1033,12 +1047,12 @@ type LightCompressedToken = {
1033
1047
  {
1034
1048
  name: 'tlv';
1035
1049
  docs: [
1036
- 'Placeholder for TokenExtension tlv data (unimplemented)'
1050
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1037
1051
  ];
1038
1052
  type: {
1039
1053
  option: 'bytes';
1040
1054
  };
1041
- }
1055
+ },
1042
1056
  ];
1043
1057
  };
1044
1058
  },
@@ -1094,7 +1108,7 @@ type LightCompressedToken = {
1094
1108
  {
1095
1109
  name: 'isCompress';
1096
1110
  type: 'bool';
1097
- }
1111
+ },
1098
1112
  ];
1099
1113
  };
1100
1114
  },
@@ -1158,7 +1172,7 @@ type LightCompressedToken = {
1158
1172
  defined: 'CompressedCpiContext';
1159
1173
  };
1160
1174
  };
1161
- }
1175
+ },
1162
1176
  ];
1163
1177
  };
1164
1178
  },
@@ -1186,7 +1200,7 @@ type LightCompressedToken = {
1186
1200
  {
1187
1201
  name: 'nextMerkleTree';
1188
1202
  type: 'publicKey';
1189
- }
1203
+ },
1190
1204
  ];
1191
1205
  };
1192
1206
  },
@@ -1202,7 +1216,7 @@ type LightCompressedToken = {
1202
1216
  {
1203
1217
  name: 'seq';
1204
1218
  type: 'u64';
1205
- }
1219
+ },
1206
1220
  ];
1207
1221
  };
1208
1222
  },
@@ -1228,7 +1242,7 @@ type LightCompressedToken = {
1228
1242
  {
1229
1243
  name: 'addressMerkleTreeRootIndex';
1230
1244
  type: 'u16';
1231
- }
1245
+ },
1232
1246
  ];
1233
1247
  };
1234
1248
  },
@@ -1246,7 +1260,7 @@ type LightCompressedToken = {
1246
1260
  {
1247
1261
  name: 'merkleTreeIndex';
1248
1262
  type: 'u8';
1249
- }
1263
+ },
1250
1264
  ];
1251
1265
  };
1252
1266
  },
@@ -1270,17 +1284,17 @@ type LightCompressedToken = {
1270
1284
  {
1271
1285
  name: 'rootIndex';
1272
1286
  docs: [
1273
- 'Index of root used in inclusion validity proof.'
1287
+ 'Index of root used in inclusion validity proof.',
1274
1288
  ];
1275
1289
  type: 'u16';
1276
1290
  },
1277
1291
  {
1278
1292
  name: 'readOnly';
1279
1293
  docs: [
1280
- 'Placeholder to mark accounts read-only unimplemented set to false.'
1294
+ 'Placeholder to mark accounts read-only unimplemented set to false.',
1281
1295
  ];
1282
1296
  type: 'bool';
1283
- }
1297
+ },
1284
1298
  ];
1285
1299
  };
1286
1300
  },
@@ -1305,14 +1319,14 @@ type LightCompressedToken = {
1305
1319
  name: 'queueIndex';
1306
1320
  docs: [
1307
1321
  'Index of leaf in queue. Placeholder of batched Merkle tree updates',
1308
- 'currently unimplemented.'
1322
+ 'currently unimplemented.',
1309
1323
  ];
1310
1324
  type: {
1311
1325
  option: {
1312
1326
  defined: 'QueueIndex';
1313
1327
  };
1314
1328
  };
1315
- }
1329
+ },
1316
1330
  ];
1317
1331
  };
1318
1332
  },
@@ -1342,12 +1356,12 @@ type LightCompressedToken = {
1342
1356
  {
1343
1357
  name: 'tlv';
1344
1358
  docs: [
1345
- 'Placeholder for TokenExtension tlv data (unimplemented)'
1359
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1346
1360
  ];
1347
1361
  type: {
1348
1362
  option: 'bytes';
1349
1363
  };
1350
- }
1364
+ },
1351
1365
  ];
1352
1366
  };
1353
1367
  },
@@ -1421,7 +1435,7 @@ type LightCompressedToken = {
1421
1435
  type: {
1422
1436
  option: 'bytes';
1423
1437
  };
1424
- }
1438
+ },
1425
1439
  ];
1426
1440
  };
1427
1441
  },
@@ -1439,7 +1453,7 @@ type LightCompressedToken = {
1439
1453
  name: 'index';
1440
1454
  docs: ['Index of compressed account hash in queue.'];
1441
1455
  type: 'u16';
1442
- }
1456
+ },
1443
1457
  ];
1444
1458
  };
1445
1459
  },
@@ -1457,14 +1471,14 @@ type LightCompressedToken = {
1457
1471
  name: 'rolloverFee';
1458
1472
  docs: [
1459
1473
  'This fee is used for rent for the next account.',
1460
- 'It accumulates in the account so that once the corresponding Merkle tree account is full it can be rolled over'
1474
+ 'It accumulates in the account so that once the corresponding Merkle tree account is full it can be rolled over',
1461
1475
  ];
1462
1476
  type: 'u64';
1463
1477
  },
1464
1478
  {
1465
1479
  name: 'rolloverThreshold';
1466
1480
  docs: [
1467
- 'The threshold in percentage points when the account should be rolled over (95 corresponds to 95% filled).'
1481
+ 'The threshold in percentage points when the account should be rolled over (95 corresponds to 95% filled).',
1468
1482
  ];
1469
1483
  type: 'u64';
1470
1484
  },
@@ -1476,7 +1490,7 @@ type LightCompressedToken = {
1476
1490
  {
1477
1491
  name: 'rolledoverSlot';
1478
1492
  docs: [
1479
- 'The slot when the account was rolled over, a rolled over account should not be written to.'
1493
+ 'The slot when the account was rolled over, a rolled over account should not be written to.',
1480
1494
  ];
1481
1495
  type: 'u64';
1482
1496
  },
@@ -1485,7 +1499,7 @@ type LightCompressedToken = {
1485
1499
  docs: [
1486
1500
  'If current slot is greater than rolledover_slot + close_threshold and',
1487
1501
  "the account is empty it can be closed. No 'close' functionality has been",
1488
- 'implemented yet.'
1502
+ 'implemented yet.',
1489
1503
  ];
1490
1504
  type: 'u64';
1491
1505
  },
@@ -1493,10 +1507,10 @@ type LightCompressedToken = {
1493
1507
  name: 'additionalBytes';
1494
1508
  docs: [
1495
1509
  'Placeholder for bytes of additional accounts which are tied to the',
1496
- 'Merkle trees operation and need to be rolled over as well.'
1510
+ 'Merkle trees operation and need to be rolled over as well.',
1497
1511
  ];
1498
1512
  type: 'u64';
1499
- }
1513
+ },
1500
1514
  ];
1501
1515
  };
1502
1516
  },
@@ -1524,7 +1538,7 @@ type LightCompressedToken = {
1524
1538
  name: 'delegate';
1525
1539
  docs: [
1526
1540
  'If `delegate` is `Some` then `delegated_amount` represents',
1527
- 'the amount authorized by the delegate'
1541
+ 'the amount authorized by the delegate',
1528
1542
  ];
1529
1543
  type: {
1530
1544
  option: 'publicKey';
@@ -1540,15 +1554,15 @@ type LightCompressedToken = {
1540
1554
  {
1541
1555
  name: 'tlv';
1542
1556
  docs: [
1543
- 'Placeholder for TokenExtension tlv data (unimplemented)'
1557
+ 'Placeholder for TokenExtension tlv data (unimplemented)',
1544
1558
  ];
1545
1559
  type: {
1546
1560
  option: 'bytes';
1547
1561
  };
1548
- }
1562
+ },
1549
1563
  ];
1550
1564
  };
1551
- }
1565
+ },
1552
1566
  ];
1553
1567
  errors: [
1554
1568
  {
@@ -1675,7 +1689,7 @@ type LightCompressedToken = {
1675
1689
  {
1676
1690
  code: 6025;
1677
1691
  name: 'NoInputsProvided';
1678
- }
1692
+ },
1679
1693
  ];
1680
1694
  };
1681
1695
  declare const IDL: LightCompressedToken;
@@ -1835,7 +1849,9 @@ type PackCompressedTokenAccountsParams = {
1835
1849
  /**
1836
1850
  * Packs Compressed Token Accounts.
1837
1851
  */
1838
- declare function packCompressedTokenAccounts(params: PackCompressedTokenAccountsParams): {
1852
+ declare function packCompressedTokenAccounts(
1853
+ params: PackCompressedTokenAccountsParams,
1854
+ ): {
1839
1855
  inputTokenDataWithContext: InputTokenDataWithContext$1[];
1840
1856
  remainingAccountMetas: AccountMeta[];
1841
1857
  packedOutputTokenData: PackedTokenTransferOutputData[];
@@ -1974,6 +1990,39 @@ type CreateMintParams = {
1974
1990
  */
1975
1991
  rentExemptBalance: number;
1976
1992
  };
1993
+ /**
1994
+ * Parameters for merging compressed token accounts
1995
+ */
1996
+ type MergeTokenAccountsParams = {
1997
+ /**
1998
+ * Tx feepayer
1999
+ */
2000
+ payer: PublicKey;
2001
+ /**
2002
+ * Owner of the token accounts to be merged
2003
+ */
2004
+ owner: PublicKey;
2005
+ /**
2006
+ * Mint public key
2007
+ */
2008
+ mint: PublicKey;
2009
+ /**
2010
+ * Array of compressed token accounts to merge
2011
+ */
2012
+ inputCompressedTokenAccounts: ParsedTokenAccount[];
2013
+ /**
2014
+ * Optional: Public key of the state tree to merge into
2015
+ */
2016
+ outputStateTree: PublicKey;
2017
+ /**
2018
+ * Optional: Recent validity proof for state inclusion
2019
+ */
2020
+ recentValidityProof: CompressedProof;
2021
+ /**
2022
+ * Optional: Recent state root indices of the input state
2023
+ */
2024
+ recentInputStateRootIndices: number[];
2025
+ };
1977
2026
  /**
1978
2027
  * Create compressed token accounts
1979
2028
  */
@@ -2081,7 +2130,9 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
2081
2130
  /**
2082
2131
  * Parse compressed token accounts to get the mint, current owner and delegate.
2083
2132
  */
2084
- declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) => {
2133
+ declare const parseTokenData: (
2134
+ compressedTokenAccounts: ParsedTokenAccount[],
2135
+ ) => {
2085
2136
  mint: PublicKey;
2086
2137
  currentOwner: PublicKey;
2087
2138
  delegate: PublicKey | null;
@@ -2094,7 +2145,11 @@ declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) =>
2094
2145
  * @returns Output token data for the transfer
2095
2146
  * instruction
2096
2147
  */
2097
- declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: number | BN): TokenTransferOutputData$1[];
2148
+ declare function createTransferOutputState(
2149
+ inputCompressedTokenAccounts: ParsedTokenAccount[],
2150
+ toAddress: PublicKey,
2151
+ amount: number | BN,
2152
+ ): TokenTransferOutputData$1[];
2098
2153
  /**
2099
2154
  * Create the output state for a compress transaction.
2100
2155
  * @param inputCompressedTokenAccounts Input state
@@ -2102,7 +2157,10 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
2102
2157
  * @returns Output token data for the compress
2103
2158
  * instruction
2104
2159
  */
2105
- declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData$1[];
2160
+ declare function createDecompressOutputState(
2161
+ inputCompressedTokenAccounts: ParsedTokenAccount[],
2162
+ amount: number | BN,
2163
+ ): TokenTransferOutputData$1[];
2106
2164
  declare class CompressedTokenProgram {
2107
2165
  /**
2108
2166
  * @internal
@@ -2127,12 +2185,16 @@ declare class CompressedTokenProgram {
2127
2185
  /**
2128
2186
  * Construct createMint instruction for compressed tokens
2129
2187
  */
2130
- static createMint(params: CreateMintParams): Promise<TransactionInstruction[]>;
2188
+ static createMint(
2189
+ params: CreateMintParams,
2190
+ ): Promise<TransactionInstruction[]>;
2131
2191
  /**
2132
2192
  * Enable compression for an existing SPL mint, creating an omnibus account.
2133
2193
  * For new mints, use `CompressedTokenProgram.createMint`.
2134
2194
  */
2135
- static createTokenPool(params: RegisterMintParams): Promise<TransactionInstruction>;
2195
+ static createTokenPool(
2196
+ params: RegisterMintParams,
2197
+ ): Promise<TransactionInstruction>;
2136
2198
  /**
2137
2199
  * Construct mintTo instruction for compressed tokens
2138
2200
  */
@@ -2140,7 +2202,9 @@ declare class CompressedTokenProgram {
2140
2202
  /**
2141
2203
  * Mint tokens from registed SPL mint account to a compressed account
2142
2204
  */
2143
- static approveAndMintTo(params: ApproveAndMintToParams): Promise<TransactionInstruction[]>;
2205
+ static approveAndMintTo(
2206
+ params: ApproveAndMintToParams,
2207
+ ): Promise<TransactionInstruction[]>;
2144
2208
  /**
2145
2209
  * Construct transfer instruction for compressed tokens
2146
2210
  */
@@ -2148,7 +2212,9 @@ declare class CompressedTokenProgram {
2148
2212
  /**
2149
2213
  * Create lookup table instructions for the token program's default accounts.
2150
2214
  */
2151
- static createTokenProgramLookupTable(params: CreateTokenProgramLookupTableParams): Promise<{
2215
+ static createTokenProgramLookupTable(
2216
+ params: CreateTokenProgramLookupTableParams,
2217
+ ): Promise<{
2152
2218
  instructions: TransactionInstruction[];
2153
2219
  address: PublicKey;
2154
2220
  }>;
@@ -2160,7 +2226,12 @@ declare class CompressedTokenProgram {
2160
2226
  /**
2161
2227
  * Construct decompress instruction
2162
2228
  */
2163
- static decompress(params: DecompressParams): Promise<TransactionInstruction>;
2229
+ static decompress(
2230
+ params: DecompressParams,
2231
+ ): Promise<TransactionInstruction>;
2232
+ static mergeTokenAccounts(
2233
+ params: MergeTokenAccountsParams,
2234
+ ): Promise<TransactionInstruction[]>;
2164
2235
  }
2165
2236
 
2166
2237
  /**
@@ -2178,7 +2249,16 @@ declare class CompressedTokenProgram {
2178
2249
  *
2179
2250
  * @return Signature of the confirmed transaction
2180
2251
  */
2181
- declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer, amount: number | BN, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2252
+ declare function approveAndMintTo(
2253
+ rpc: Rpc,
2254
+ payer: Signer,
2255
+ mint: PublicKey,
2256
+ destination: PublicKey,
2257
+ authority: Signer,
2258
+ amount: number | BN,
2259
+ merkleTree?: PublicKey,
2260
+ confirmOptions?: ConfirmOptions,
2261
+ ): Promise<TransactionSignature>;
2182
2262
 
2183
2263
  /**
2184
2264
  * Compress SPL tokens
@@ -2198,7 +2278,17 @@ declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, dest
2198
2278
  *
2199
2279
  * @return Signature of the confirmed transaction
2200
2280
  */
2201
- 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>;
2281
+ declare function compress(
2282
+ rpc: Rpc,
2283
+ payer: Signer,
2284
+ mint: PublicKey,
2285
+ amount: number | BN | number[] | BN[],
2286
+ owner: Signer,
2287
+ sourceTokenAccount: PublicKey,
2288
+ toAddress: PublicKey | Array<PublicKey>,
2289
+ merkleTree?: PublicKey,
2290
+ confirmOptions?: ConfirmOptions,
2291
+ ): Promise<TransactionSignature>;
2202
2292
 
2203
2293
  /**
2204
2294
  * Decompress compressed tokens
@@ -2218,7 +2308,16 @@ declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
2218
2308
  *
2219
2309
  * @return Signature of the confirmed transaction
2220
2310
  */
2221
- declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2311
+ declare function decompress(
2312
+ rpc: Rpc,
2313
+ payer: Signer,
2314
+ mint: PublicKey,
2315
+ amount: number | BN,
2316
+ owner: Signer,
2317
+ toAddress: PublicKey,
2318
+ merkleTree?: PublicKey,
2319
+ confirmOptions?: ConfirmOptions,
2320
+ ): Promise<TransactionSignature>;
2222
2321
 
2223
2322
  /**
2224
2323
  * Create and initialize a new compressed token mint
@@ -2232,7 +2331,14 @@ declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: nu
2232
2331
  *
2233
2332
  * @return Address of the new mint and the transaction signature
2234
2333
  */
2235
- declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, decimals: number, keypair?: Keypair, confirmOptions?: ConfirmOptions): Promise<{
2334
+ declare function createMint(
2335
+ rpc: Rpc,
2336
+ payer: Signer,
2337
+ mintAuthority: PublicKey,
2338
+ decimals: number,
2339
+ keypair?: Keypair,
2340
+ confirmOptions?: ConfirmOptions,
2341
+ ): Promise<{
2236
2342
  mint: PublicKey;
2237
2343
  transactionSignature: TransactionSignature;
2238
2344
  }>;
@@ -2254,7 +2360,38 @@ declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, d
2254
2360
  *
2255
2361
  * @return Signature of the confirmed transaction
2256
2362
  */
2257
- 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>;
2363
+ declare function mintTo(
2364
+ rpc: Rpc,
2365
+ payer: Signer,
2366
+ mint: PublicKey,
2367
+ destination: PublicKey | PublicKey[],
2368
+ authority: Signer,
2369
+ amount: number | BN | number[] | BN[],
2370
+ merkleTree?: PublicKey,
2371
+ confirmOptions?: ConfirmOptions,
2372
+ ): Promise<TransactionSignature>;
2373
+
2374
+ /**
2375
+ * Merge multiple compressed token accounts for a given mint into a single
2376
+ * account
2377
+ *
2378
+ * @param rpc RPC to use
2379
+ * @param payer Payer of the transaction fees
2380
+ * @param mint Public key of the token's mint
2381
+ * @param owner Owner of the token accounts to be merged
2382
+ * @param merkleTree Optional merkle tree for compressed tokens
2383
+ * @param confirmOptions Options for confirming the transaction
2384
+ *
2385
+ * @return Array of transaction signatures
2386
+ */
2387
+ declare function mergeTokenAccounts(
2388
+ rpc: Rpc,
2389
+ payer: Signer,
2390
+ mint: PublicKey,
2391
+ owner: Signer,
2392
+ merkleTree?: PublicKey,
2393
+ confirmOptions?: ConfirmOptions,
2394
+ ): Promise<TransactionSignature>;
2258
2395
 
2259
2396
  /**
2260
2397
  * Register an existing mint with the CompressedToken program
@@ -2267,7 +2404,12 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
2267
2404
  *
2268
2405
  * @return transaction signature
2269
2406
  */
2270
- declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2407
+ declare function createTokenPool(
2408
+ rpc: Rpc,
2409
+ payer: Signer,
2410
+ mintAddress: PublicKey,
2411
+ confirmOptions?: ConfirmOptions,
2412
+ ): Promise<TransactionSignature>;
2271
2413
 
2272
2414
  /**
2273
2415
  * Transfer compressed tokens from one owner to another
@@ -2286,7 +2428,16 @@ declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey
2286
2428
  *
2287
2429
  * @return Signature of the confirmed transaction
2288
2430
  */
2289
- declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2431
+ declare function transfer(
2432
+ rpc: Rpc,
2433
+ payer: Signer,
2434
+ mint: PublicKey,
2435
+ amount: number | BN,
2436
+ owner: Signer,
2437
+ toAddress: PublicKey,
2438
+ merkleTree?: PublicKey,
2439
+ confirmOptions?: ConfirmOptions,
2440
+ ): Promise<TransactionSignature>;
2290
2441
  /**
2291
2442
  * Selects the minimal number of compressed token accounts for a transfer.
2292
2443
  *
@@ -2294,10 +2445,13 @@ declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
2294
2445
  * 2. Accumulates the amount until it is greater than or equal to the transfer
2295
2446
  * amount
2296
2447
  */
2297
- declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTokenAccount[], transferAmount: BN): [
2448
+ declare function selectMinCompressedTokenAccountsForTransfer(
2449
+ accounts: ParsedTokenAccount[],
2450
+ transferAmount: BN,
2451
+ ): [
2298
2452
  selectedAccounts: ParsedTokenAccount[],
2299
2453
  total: BN,
2300
- totalLamports: BN | null
2454
+ totalLamports: BN | null,
2301
2455
  ];
2302
2456
 
2303
2457
  /**
@@ -2313,9 +2467,51 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
2313
2467
  *
2314
2468
  * @return Transaction signatures and the address of the created lookup table
2315
2469
  */
2316
- declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authority: Signer, mints?: PublicKey[], additionalAccounts?: PublicKey[]): Promise<{
2470
+ declare function createTokenProgramLookupTable(
2471
+ rpc: Rpc,
2472
+ payer: Signer,
2473
+ authority: Signer,
2474
+ mints?: PublicKey[],
2475
+ additionalAccounts?: PublicKey[],
2476
+ ): Promise<{
2317
2477
  txIds: TransactionSignature[];
2318
2478
  address: PublicKey;
2319
2479
  }>;
2320
2480
 
2321
- export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressedTokenInstructionDataInvoke, CompressedTokenProgram, type CreateMintParams, type CreateTokenProgramLookupTableParams, IDL, type InputTokenDataWithContext, type LightCompressedToken, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, createDecompressOutputState, createMint, createTokenPool, createTokenProgramLookupTable, createTransferOutputState, decompress, mintTo, packCompressedTokenAccounts, parseTokenData, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
2481
+ export {
2482
+ type ApproveAndMintToParams,
2483
+ CPI_AUTHORITY_SEED,
2484
+ type CompressedTokenInstructionDataInvoke,
2485
+ CompressedTokenProgram,
2486
+ type CreateMintParams,
2487
+ type CreateTokenProgramLookupTableParams,
2488
+ IDL,
2489
+ type InputTokenDataWithContext,
2490
+ type LightCompressedToken,
2491
+ type MergeTokenAccountsParams,
2492
+ type MintToParams,
2493
+ POOL_SEED,
2494
+ type PackCompressedTokenAccountsParams,
2495
+ type PackedTokenTransferOutputData,
2496
+ type RegisterMintParams,
2497
+ SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,
2498
+ type TokenData,
2499
+ type TokenTransferOutputData,
2500
+ type TransferParams,
2501
+ approveAndMintTo,
2502
+ compress,
2503
+ createDecompressOutputState,
2504
+ createMint,
2505
+ createTokenPool,
2506
+ createTokenProgramLookupTable,
2507
+ createTransferOutputState,
2508
+ decompress,
2509
+ mergeTokenAccounts,
2510
+ mintTo,
2511
+ packCompressedTokenAccounts,
2512
+ parseTokenData,
2513
+ selectMinCompressedTokenAccountsForTransfer,
2514
+ sumUpTokenAmount,
2515
+ transfer,
2516
+ validateSameTokenOwner,
2517
+ };