@lightprotocol/compressed-token 0.12.0 → 0.13.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.
- package/dist/cjs/browser/index.cjs +3059 -2187
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +1242 -602
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +2986 -2150
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +303 -212
- package/package.json +5 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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.
|
|
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,142 +1554,37 @@ 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
|
{
|
|
1555
1569
|
code: 6000;
|
|
1556
|
-
name: '
|
|
1557
|
-
msg: '
|
|
1570
|
+
name: 'SignerCheckFailed';
|
|
1571
|
+
msg: 'Signer check failed';
|
|
1558
1572
|
},
|
|
1559
1573
|
{
|
|
1560
1574
|
code: 6001;
|
|
1561
|
-
name: '
|
|
1562
|
-
msg: '
|
|
1575
|
+
name: 'CreateTransferInstructionFailed';
|
|
1576
|
+
msg: 'Create transfer instruction failed';
|
|
1563
1577
|
},
|
|
1564
1578
|
{
|
|
1565
1579
|
code: 6002;
|
|
1566
|
-
name: '
|
|
1567
|
-
msg: '
|
|
1580
|
+
name: 'AccountNotFound';
|
|
1581
|
+
msg: 'Account not found';
|
|
1568
1582
|
},
|
|
1569
1583
|
{
|
|
1570
1584
|
code: 6003;
|
|
1571
|
-
name: '
|
|
1572
|
-
msg: '
|
|
1573
|
-
},
|
|
1574
|
-
{
|
|
1575
|
-
code: 6004;
|
|
1576
|
-
name: 'ComputeDecompressSumFailed';
|
|
1577
|
-
msg: 'ComputeDecompressSumFailed';
|
|
1578
|
-
},
|
|
1579
|
-
{
|
|
1580
|
-
code: 6005;
|
|
1581
|
-
name: 'SumCheckFailed';
|
|
1582
|
-
msg: 'SumCheckFailed';
|
|
1583
|
-
},
|
|
1584
|
-
{
|
|
1585
|
-
code: 6006;
|
|
1586
|
-
name: 'DecompressRecipientUndefinedForDecompress';
|
|
1587
|
-
msg: 'DecompressRecipientUndefinedForDecompress';
|
|
1588
|
-
},
|
|
1589
|
-
{
|
|
1590
|
-
code: 6007;
|
|
1591
|
-
name: 'CompressedPdaUndefinedForDecompress';
|
|
1592
|
-
msg: 'CompressedPdaUndefinedForDecompress';
|
|
1593
|
-
},
|
|
1594
|
-
{
|
|
1595
|
-
code: 6008;
|
|
1596
|
-
name: 'DeCompressAmountUndefinedForDecompress';
|
|
1597
|
-
msg: 'DeCompressAmountUndefinedForDecompress';
|
|
1598
|
-
},
|
|
1599
|
-
{
|
|
1600
|
-
code: 6009;
|
|
1601
|
-
name: 'CompressedPdaUndefinedForCompress';
|
|
1602
|
-
msg: 'CompressedPdaUndefinedForCompress';
|
|
1603
|
-
},
|
|
1604
|
-
{
|
|
1605
|
-
code: 6010;
|
|
1606
|
-
name: 'DeCompressAmountUndefinedForCompress';
|
|
1607
|
-
msg: 'DeCompressAmountUndefinedForCompress';
|
|
1608
|
-
},
|
|
1609
|
-
{
|
|
1610
|
-
code: 6011;
|
|
1611
|
-
name: 'DelegateSignerCheckFailed';
|
|
1612
|
-
msg: 'DelegateSignerCheckFailed';
|
|
1613
|
-
},
|
|
1614
|
-
{
|
|
1615
|
-
code: 6012;
|
|
1616
|
-
name: 'MintTooLarge';
|
|
1617
|
-
msg: 'Minted amount greater than u64::MAX';
|
|
1585
|
+
name: 'SerializationError';
|
|
1586
|
+
msg: 'Serialization error';
|
|
1618
1587
|
},
|
|
1619
|
-
{
|
|
1620
|
-
code: 6013;
|
|
1621
|
-
name: 'SplTokenSupplyMismatch';
|
|
1622
|
-
msg: 'SplTokenSupplyMismatch';
|
|
1623
|
-
},
|
|
1624
|
-
{
|
|
1625
|
-
code: 6014;
|
|
1626
|
-
name: 'HeapMemoryCheckFailed';
|
|
1627
|
-
msg: 'HeapMemoryCheckFailed';
|
|
1628
|
-
},
|
|
1629
|
-
{
|
|
1630
|
-
code: 6015;
|
|
1631
|
-
name: 'InstructionNotCallable';
|
|
1632
|
-
msg: 'The instruction is not callable';
|
|
1633
|
-
},
|
|
1634
|
-
{
|
|
1635
|
-
code: 6016;
|
|
1636
|
-
name: 'ArithmeticUnderflow';
|
|
1637
|
-
msg: 'ArithmeticUnderflow';
|
|
1638
|
-
},
|
|
1639
|
-
{
|
|
1640
|
-
code: 6017;
|
|
1641
|
-
name: 'HashToFieldError';
|
|
1642
|
-
msg: 'HashToFieldError';
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
code: 6018;
|
|
1646
|
-
name: 'InvalidAuthorityMint';
|
|
1647
|
-
msg: 'Expected the authority to be also a mint authority';
|
|
1648
|
-
},
|
|
1649
|
-
{
|
|
1650
|
-
code: 6019;
|
|
1651
|
-
name: 'InvalidFreezeAuthority';
|
|
1652
|
-
msg: 'Provided authority is not the freeze authority';
|
|
1653
|
-
},
|
|
1654
|
-
{
|
|
1655
|
-
code: 6020;
|
|
1656
|
-
name: 'InvalidDelegateIndex';
|
|
1657
|
-
},
|
|
1658
|
-
{
|
|
1659
|
-
code: 6021;
|
|
1660
|
-
name: 'TokenPoolPdaUndefined';
|
|
1661
|
-
},
|
|
1662
|
-
{
|
|
1663
|
-
code: 6022;
|
|
1664
|
-
name: 'IsTokenPoolPda';
|
|
1665
|
-
msg: 'Compress or decompress recipient is the same account as the token pool pda.';
|
|
1666
|
-
},
|
|
1667
|
-
{
|
|
1668
|
-
code: 6023;
|
|
1669
|
-
name: 'InvalidTokenPoolPda';
|
|
1670
|
-
},
|
|
1671
|
-
{
|
|
1672
|
-
code: 6024;
|
|
1673
|
-
name: 'NoInputTokenAccountsProvided';
|
|
1674
|
-
},
|
|
1675
|
-
{
|
|
1676
|
-
code: 6025;
|
|
1677
|
-
name: 'NoInputsProvided';
|
|
1678
|
-
}
|
|
1679
1588
|
];
|
|
1680
1589
|
};
|
|
1681
1590
|
declare const IDL: LightCompressedToken;
|
|
@@ -1835,7 +1744,9 @@ type PackCompressedTokenAccountsParams = {
|
|
|
1835
1744
|
/**
|
|
1836
1745
|
* Packs Compressed Token Accounts.
|
|
1837
1746
|
*/
|
|
1838
|
-
declare function packCompressedTokenAccounts(
|
|
1747
|
+
declare function packCompressedTokenAccounts(
|
|
1748
|
+
params: PackCompressedTokenAccountsParams,
|
|
1749
|
+
): {
|
|
1839
1750
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
1840
1751
|
remainingAccountMetas: AccountMeta[];
|
|
1841
1752
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -1974,6 +1885,39 @@ type CreateMintParams = {
|
|
|
1974
1885
|
*/
|
|
1975
1886
|
rentExemptBalance: number;
|
|
1976
1887
|
};
|
|
1888
|
+
/**
|
|
1889
|
+
* Parameters for merging compressed token accounts
|
|
1890
|
+
*/
|
|
1891
|
+
type MergeTokenAccountsParams = {
|
|
1892
|
+
/**
|
|
1893
|
+
* Tx feepayer
|
|
1894
|
+
*/
|
|
1895
|
+
payer: PublicKey;
|
|
1896
|
+
/**
|
|
1897
|
+
* Owner of the token accounts to be merged
|
|
1898
|
+
*/
|
|
1899
|
+
owner: PublicKey;
|
|
1900
|
+
/**
|
|
1901
|
+
* Mint public key
|
|
1902
|
+
*/
|
|
1903
|
+
mint: PublicKey;
|
|
1904
|
+
/**
|
|
1905
|
+
* Array of compressed token accounts to merge
|
|
1906
|
+
*/
|
|
1907
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[];
|
|
1908
|
+
/**
|
|
1909
|
+
* Optional: Public key of the state tree to merge into
|
|
1910
|
+
*/
|
|
1911
|
+
outputStateTree: PublicKey;
|
|
1912
|
+
/**
|
|
1913
|
+
* Optional: Recent validity proof for state inclusion
|
|
1914
|
+
*/
|
|
1915
|
+
recentValidityProof: CompressedProof;
|
|
1916
|
+
/**
|
|
1917
|
+
* Optional: Recent state root indices of the input state
|
|
1918
|
+
*/
|
|
1919
|
+
recentInputStateRootIndices: number[];
|
|
1920
|
+
};
|
|
1977
1921
|
/**
|
|
1978
1922
|
* Create compressed token accounts
|
|
1979
1923
|
*/
|
|
@@ -2081,7 +2025,9 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
2081
2025
|
/**
|
|
2082
2026
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
2083
2027
|
*/
|
|
2084
|
-
declare const parseTokenData: (
|
|
2028
|
+
declare const parseTokenData: (
|
|
2029
|
+
compressedTokenAccounts: ParsedTokenAccount[],
|
|
2030
|
+
) => {
|
|
2085
2031
|
mint: PublicKey;
|
|
2086
2032
|
currentOwner: PublicKey;
|
|
2087
2033
|
delegate: PublicKey | null;
|
|
@@ -2094,7 +2040,11 @@ declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) =>
|
|
|
2094
2040
|
* @returns Output token data for the transfer
|
|
2095
2041
|
* instruction
|
|
2096
2042
|
*/
|
|
2097
|
-
declare function createTransferOutputState(
|
|
2043
|
+
declare function createTransferOutputState(
|
|
2044
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
2045
|
+
toAddress: PublicKey,
|
|
2046
|
+
amount: number | BN,
|
|
2047
|
+
): TokenTransferOutputData$1[];
|
|
2098
2048
|
/**
|
|
2099
2049
|
* Create the output state for a compress transaction.
|
|
2100
2050
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -2102,7 +2052,10 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
|
|
|
2102
2052
|
* @returns Output token data for the compress
|
|
2103
2053
|
* instruction
|
|
2104
2054
|
*/
|
|
2105
|
-
declare function createDecompressOutputState(
|
|
2055
|
+
declare function createDecompressOutputState(
|
|
2056
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
2057
|
+
amount: number | BN,
|
|
2058
|
+
): TokenTransferOutputData$1[];
|
|
2106
2059
|
declare class CompressedTokenProgram {
|
|
2107
2060
|
/**
|
|
2108
2061
|
* @internal
|
|
@@ -2127,12 +2080,16 @@ declare class CompressedTokenProgram {
|
|
|
2127
2080
|
/**
|
|
2128
2081
|
* Construct createMint instruction for compressed tokens
|
|
2129
2082
|
*/
|
|
2130
|
-
static createMint(
|
|
2083
|
+
static createMint(
|
|
2084
|
+
params: CreateMintParams,
|
|
2085
|
+
): Promise<TransactionInstruction[]>;
|
|
2131
2086
|
/**
|
|
2132
2087
|
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
2133
2088
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
2134
2089
|
*/
|
|
2135
|
-
static createTokenPool(
|
|
2090
|
+
static createTokenPool(
|
|
2091
|
+
params: RegisterMintParams,
|
|
2092
|
+
): Promise<TransactionInstruction>;
|
|
2136
2093
|
/**
|
|
2137
2094
|
* Construct mintTo instruction for compressed tokens
|
|
2138
2095
|
*/
|
|
@@ -2140,7 +2097,9 @@ declare class CompressedTokenProgram {
|
|
|
2140
2097
|
/**
|
|
2141
2098
|
* Mint tokens from registed SPL mint account to a compressed account
|
|
2142
2099
|
*/
|
|
2143
|
-
static approveAndMintTo(
|
|
2100
|
+
static approveAndMintTo(
|
|
2101
|
+
params: ApproveAndMintToParams,
|
|
2102
|
+
): Promise<TransactionInstruction[]>;
|
|
2144
2103
|
/**
|
|
2145
2104
|
* Construct transfer instruction for compressed tokens
|
|
2146
2105
|
*/
|
|
@@ -2148,7 +2107,9 @@ declare class CompressedTokenProgram {
|
|
|
2148
2107
|
/**
|
|
2149
2108
|
* Create lookup table instructions for the token program's default accounts.
|
|
2150
2109
|
*/
|
|
2151
|
-
static createTokenProgramLookupTable(
|
|
2110
|
+
static createTokenProgramLookupTable(
|
|
2111
|
+
params: CreateTokenProgramLookupTableParams,
|
|
2112
|
+
): Promise<{
|
|
2152
2113
|
instructions: TransactionInstruction[];
|
|
2153
2114
|
address: PublicKey;
|
|
2154
2115
|
}>;
|
|
@@ -2160,7 +2121,12 @@ declare class CompressedTokenProgram {
|
|
|
2160
2121
|
/**
|
|
2161
2122
|
* Construct decompress instruction
|
|
2162
2123
|
*/
|
|
2163
|
-
static decompress(
|
|
2124
|
+
static decompress(
|
|
2125
|
+
params: DecompressParams,
|
|
2126
|
+
): Promise<TransactionInstruction>;
|
|
2127
|
+
static mergeTokenAccounts(
|
|
2128
|
+
params: MergeTokenAccountsParams,
|
|
2129
|
+
): Promise<TransactionInstruction[]>;
|
|
2164
2130
|
}
|
|
2165
2131
|
|
|
2166
2132
|
/**
|
|
@@ -2178,7 +2144,16 @@ declare class CompressedTokenProgram {
|
|
|
2178
2144
|
*
|
|
2179
2145
|
* @return Signature of the confirmed transaction
|
|
2180
2146
|
*/
|
|
2181
|
-
declare function approveAndMintTo(
|
|
2147
|
+
declare function approveAndMintTo(
|
|
2148
|
+
rpc: Rpc,
|
|
2149
|
+
payer: Signer,
|
|
2150
|
+
mint: PublicKey,
|
|
2151
|
+
destination: PublicKey,
|
|
2152
|
+
authority: Signer,
|
|
2153
|
+
amount: number | BN,
|
|
2154
|
+
merkleTree?: PublicKey,
|
|
2155
|
+
confirmOptions?: ConfirmOptions,
|
|
2156
|
+
): Promise<TransactionSignature>;
|
|
2182
2157
|
|
|
2183
2158
|
/**
|
|
2184
2159
|
* Compress SPL tokens
|
|
@@ -2198,7 +2173,17 @@ declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, dest
|
|
|
2198
2173
|
*
|
|
2199
2174
|
* @return Signature of the confirmed transaction
|
|
2200
2175
|
*/
|
|
2201
|
-
declare function compress(
|
|
2176
|
+
declare function compress(
|
|
2177
|
+
rpc: Rpc,
|
|
2178
|
+
payer: Signer,
|
|
2179
|
+
mint: PublicKey,
|
|
2180
|
+
amount: number | BN | number[] | BN[],
|
|
2181
|
+
owner: Signer,
|
|
2182
|
+
sourceTokenAccount: PublicKey,
|
|
2183
|
+
toAddress: PublicKey | Array<PublicKey>,
|
|
2184
|
+
merkleTree?: PublicKey,
|
|
2185
|
+
confirmOptions?: ConfirmOptions,
|
|
2186
|
+
): Promise<TransactionSignature>;
|
|
2202
2187
|
|
|
2203
2188
|
/**
|
|
2204
2189
|
* Decompress compressed tokens
|
|
@@ -2218,7 +2203,16 @@ declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
|
|
|
2218
2203
|
*
|
|
2219
2204
|
* @return Signature of the confirmed transaction
|
|
2220
2205
|
*/
|
|
2221
|
-
declare function decompress(
|
|
2206
|
+
declare function decompress(
|
|
2207
|
+
rpc: Rpc,
|
|
2208
|
+
payer: Signer,
|
|
2209
|
+
mint: PublicKey,
|
|
2210
|
+
amount: number | BN,
|
|
2211
|
+
owner: Signer,
|
|
2212
|
+
toAddress: PublicKey,
|
|
2213
|
+
merkleTree?: PublicKey,
|
|
2214
|
+
confirmOptions?: ConfirmOptions,
|
|
2215
|
+
): Promise<TransactionSignature>;
|
|
2222
2216
|
|
|
2223
2217
|
/**
|
|
2224
2218
|
* Create and initialize a new compressed token mint
|
|
@@ -2232,7 +2226,14 @@ declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: nu
|
|
|
2232
2226
|
*
|
|
2233
2227
|
* @return Address of the new mint and the transaction signature
|
|
2234
2228
|
*/
|
|
2235
|
-
declare function createMint(
|
|
2229
|
+
declare function createMint(
|
|
2230
|
+
rpc: Rpc,
|
|
2231
|
+
payer: Signer,
|
|
2232
|
+
mintAuthority: PublicKey,
|
|
2233
|
+
decimals: number,
|
|
2234
|
+
keypair?: Keypair,
|
|
2235
|
+
confirmOptions?: ConfirmOptions,
|
|
2236
|
+
): Promise<{
|
|
2236
2237
|
mint: PublicKey;
|
|
2237
2238
|
transactionSignature: TransactionSignature;
|
|
2238
2239
|
}>;
|
|
@@ -2254,7 +2255,38 @@ declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, d
|
|
|
2254
2255
|
*
|
|
2255
2256
|
* @return Signature of the confirmed transaction
|
|
2256
2257
|
*/
|
|
2257
|
-
declare function mintTo(
|
|
2258
|
+
declare function mintTo(
|
|
2259
|
+
rpc: Rpc,
|
|
2260
|
+
payer: Signer,
|
|
2261
|
+
mint: PublicKey,
|
|
2262
|
+
destination: PublicKey | PublicKey[],
|
|
2263
|
+
authority: Signer,
|
|
2264
|
+
amount: number | BN | number[] | BN[],
|
|
2265
|
+
merkleTree?: PublicKey,
|
|
2266
|
+
confirmOptions?: ConfirmOptions,
|
|
2267
|
+
): Promise<TransactionSignature>;
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* Merge multiple compressed token accounts for a given mint into a single
|
|
2271
|
+
* account
|
|
2272
|
+
*
|
|
2273
|
+
* @param rpc RPC to use
|
|
2274
|
+
* @param payer Payer of the transaction fees
|
|
2275
|
+
* @param mint Public key of the token's mint
|
|
2276
|
+
* @param owner Owner of the token accounts to be merged
|
|
2277
|
+
* @param merkleTree Optional merkle tree for compressed tokens
|
|
2278
|
+
* @param confirmOptions Options for confirming the transaction
|
|
2279
|
+
*
|
|
2280
|
+
* @return Array of transaction signatures
|
|
2281
|
+
*/
|
|
2282
|
+
declare function mergeTokenAccounts(
|
|
2283
|
+
rpc: Rpc,
|
|
2284
|
+
payer: Signer,
|
|
2285
|
+
mint: PublicKey,
|
|
2286
|
+
owner: Signer,
|
|
2287
|
+
merkleTree?: PublicKey,
|
|
2288
|
+
confirmOptions?: ConfirmOptions,
|
|
2289
|
+
): Promise<TransactionSignature>;
|
|
2258
2290
|
|
|
2259
2291
|
/**
|
|
2260
2292
|
* Register an existing mint with the CompressedToken program
|
|
@@ -2267,7 +2299,12 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
|
|
|
2267
2299
|
*
|
|
2268
2300
|
* @return transaction signature
|
|
2269
2301
|
*/
|
|
2270
|
-
declare function createTokenPool(
|
|
2302
|
+
declare function createTokenPool(
|
|
2303
|
+
rpc: Rpc,
|
|
2304
|
+
payer: Signer,
|
|
2305
|
+
mintAddress: PublicKey,
|
|
2306
|
+
confirmOptions?: ConfirmOptions,
|
|
2307
|
+
): Promise<TransactionSignature>;
|
|
2271
2308
|
|
|
2272
2309
|
/**
|
|
2273
2310
|
* Transfer compressed tokens from one owner to another
|
|
@@ -2286,7 +2323,16 @@ declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey
|
|
|
2286
2323
|
*
|
|
2287
2324
|
* @return Signature of the confirmed transaction
|
|
2288
2325
|
*/
|
|
2289
|
-
declare function transfer(
|
|
2326
|
+
declare function transfer(
|
|
2327
|
+
rpc: Rpc,
|
|
2328
|
+
payer: Signer,
|
|
2329
|
+
mint: PublicKey,
|
|
2330
|
+
amount: number | BN,
|
|
2331
|
+
owner: Signer,
|
|
2332
|
+
toAddress: PublicKey,
|
|
2333
|
+
merkleTree?: PublicKey,
|
|
2334
|
+
confirmOptions?: ConfirmOptions,
|
|
2335
|
+
): Promise<TransactionSignature>;
|
|
2290
2336
|
/**
|
|
2291
2337
|
* Selects the minimal number of compressed token accounts for a transfer.
|
|
2292
2338
|
*
|
|
@@ -2294,10 +2340,13 @@ declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
|
|
|
2294
2340
|
* 2. Accumulates the amount until it is greater than or equal to the transfer
|
|
2295
2341
|
* amount
|
|
2296
2342
|
*/
|
|
2297
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
2343
|
+
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
2344
|
+
accounts: ParsedTokenAccount[],
|
|
2345
|
+
transferAmount: BN,
|
|
2346
|
+
): [
|
|
2298
2347
|
selectedAccounts: ParsedTokenAccount[],
|
|
2299
2348
|
total: BN,
|
|
2300
|
-
totalLamports: BN | null
|
|
2349
|
+
totalLamports: BN | null,
|
|
2301
2350
|
];
|
|
2302
2351
|
|
|
2303
2352
|
/**
|
|
@@ -2313,9 +2362,51 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
|
|
|
2313
2362
|
*
|
|
2314
2363
|
* @return Transaction signatures and the address of the created lookup table
|
|
2315
2364
|
*/
|
|
2316
|
-
declare function createTokenProgramLookupTable(
|
|
2365
|
+
declare function createTokenProgramLookupTable(
|
|
2366
|
+
rpc: Rpc,
|
|
2367
|
+
payer: Signer,
|
|
2368
|
+
authority: Signer,
|
|
2369
|
+
mints?: PublicKey[],
|
|
2370
|
+
additionalAccounts?: PublicKey[],
|
|
2371
|
+
): Promise<{
|
|
2317
2372
|
txIds: TransactionSignature[];
|
|
2318
2373
|
address: PublicKey;
|
|
2319
2374
|
}>;
|
|
2320
2375
|
|
|
2321
|
-
export {
|
|
2376
|
+
export {
|
|
2377
|
+
type ApproveAndMintToParams,
|
|
2378
|
+
CPI_AUTHORITY_SEED,
|
|
2379
|
+
type CompressedTokenInstructionDataInvoke,
|
|
2380
|
+
CompressedTokenProgram,
|
|
2381
|
+
type CreateMintParams,
|
|
2382
|
+
type CreateTokenProgramLookupTableParams,
|
|
2383
|
+
IDL,
|
|
2384
|
+
type InputTokenDataWithContext,
|
|
2385
|
+
type LightCompressedToken,
|
|
2386
|
+
type MergeTokenAccountsParams,
|
|
2387
|
+
type MintToParams,
|
|
2388
|
+
POOL_SEED,
|
|
2389
|
+
type PackCompressedTokenAccountsParams,
|
|
2390
|
+
type PackedTokenTransferOutputData,
|
|
2391
|
+
type RegisterMintParams,
|
|
2392
|
+
SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,
|
|
2393
|
+
type TokenData,
|
|
2394
|
+
type TokenTransferOutputData,
|
|
2395
|
+
type TransferParams,
|
|
2396
|
+
approveAndMintTo,
|
|
2397
|
+
compress,
|
|
2398
|
+
createDecompressOutputState,
|
|
2399
|
+
createMint,
|
|
2400
|
+
createTokenPool,
|
|
2401
|
+
createTokenProgramLookupTable,
|
|
2402
|
+
createTransferOutputState,
|
|
2403
|
+
decompress,
|
|
2404
|
+
mergeTokenAccounts,
|
|
2405
|
+
mintTo,
|
|
2406
|
+
packCompressedTokenAccounts,
|
|
2407
|
+
parseTokenData,
|
|
2408
|
+
selectMinCompressedTokenAccountsForTransfer,
|
|
2409
|
+
sumUpTokenAmount,
|
|
2410
|
+
transfer,
|
|
2411
|
+
validateSameTokenOwner,
|
|
2412
|
+
};
|