@lightprotocol/compressed-token 0.11.1 → 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 +3090 -2195
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +1273 -610
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +3017 -2158
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +303 -218
- package/package.json +23 -21
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: '
|
|
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
|
},
|
|
@@ -1151,12 +1165,6 @@ type LightCompressedToken = {
|
|
|
1151
1165
|
name: 'isCompress';
|
|
1152
1166
|
type: 'bool';
|
|
1153
1167
|
},
|
|
1154
|
-
{
|
|
1155
|
-
name: 'signerSeeds';
|
|
1156
|
-
type: {
|
|
1157
|
-
vec: 'bytes';
|
|
1158
|
-
};
|
|
1159
|
-
},
|
|
1160
1168
|
{
|
|
1161
1169
|
name: 'cpiContext';
|
|
1162
1170
|
type: {
|
|
@@ -1164,7 +1172,7 @@ type LightCompressedToken = {
|
|
|
1164
1172
|
defined: 'CompressedCpiContext';
|
|
1165
1173
|
};
|
|
1166
1174
|
};
|
|
1167
|
-
}
|
|
1175
|
+
},
|
|
1168
1176
|
];
|
|
1169
1177
|
};
|
|
1170
1178
|
},
|
|
@@ -1192,7 +1200,7 @@ type LightCompressedToken = {
|
|
|
1192
1200
|
{
|
|
1193
1201
|
name: 'nextMerkleTree';
|
|
1194
1202
|
type: 'publicKey';
|
|
1195
|
-
}
|
|
1203
|
+
},
|
|
1196
1204
|
];
|
|
1197
1205
|
};
|
|
1198
1206
|
},
|
|
@@ -1208,7 +1216,7 @@ type LightCompressedToken = {
|
|
|
1208
1216
|
{
|
|
1209
1217
|
name: 'seq';
|
|
1210
1218
|
type: 'u64';
|
|
1211
|
-
}
|
|
1219
|
+
},
|
|
1212
1220
|
];
|
|
1213
1221
|
};
|
|
1214
1222
|
},
|
|
@@ -1234,7 +1242,7 @@ type LightCompressedToken = {
|
|
|
1234
1242
|
{
|
|
1235
1243
|
name: 'addressMerkleTreeRootIndex';
|
|
1236
1244
|
type: 'u16';
|
|
1237
|
-
}
|
|
1245
|
+
},
|
|
1238
1246
|
];
|
|
1239
1247
|
};
|
|
1240
1248
|
},
|
|
@@ -1252,7 +1260,7 @@ type LightCompressedToken = {
|
|
|
1252
1260
|
{
|
|
1253
1261
|
name: 'merkleTreeIndex';
|
|
1254
1262
|
type: 'u8';
|
|
1255
|
-
}
|
|
1263
|
+
},
|
|
1256
1264
|
];
|
|
1257
1265
|
};
|
|
1258
1266
|
},
|
|
@@ -1276,17 +1284,17 @@ type LightCompressedToken = {
|
|
|
1276
1284
|
{
|
|
1277
1285
|
name: 'rootIndex';
|
|
1278
1286
|
docs: [
|
|
1279
|
-
'Index of root used in inclusion validity proof.'
|
|
1287
|
+
'Index of root used in inclusion validity proof.',
|
|
1280
1288
|
];
|
|
1281
1289
|
type: 'u16';
|
|
1282
1290
|
},
|
|
1283
1291
|
{
|
|
1284
1292
|
name: 'readOnly';
|
|
1285
1293
|
docs: [
|
|
1286
|
-
'Placeholder to mark accounts read-only unimplemented set to false.'
|
|
1294
|
+
'Placeholder to mark accounts read-only unimplemented set to false.',
|
|
1287
1295
|
];
|
|
1288
1296
|
type: 'bool';
|
|
1289
|
-
}
|
|
1297
|
+
},
|
|
1290
1298
|
];
|
|
1291
1299
|
};
|
|
1292
1300
|
},
|
|
@@ -1311,14 +1319,14 @@ type LightCompressedToken = {
|
|
|
1311
1319
|
name: 'queueIndex';
|
|
1312
1320
|
docs: [
|
|
1313
1321
|
'Index of leaf in queue. Placeholder of batched Merkle tree updates',
|
|
1314
|
-
'currently unimplemented.'
|
|
1322
|
+
'currently unimplemented.',
|
|
1315
1323
|
];
|
|
1316
1324
|
type: {
|
|
1317
1325
|
option: {
|
|
1318
1326
|
defined: 'QueueIndex';
|
|
1319
1327
|
};
|
|
1320
1328
|
};
|
|
1321
|
-
}
|
|
1329
|
+
},
|
|
1322
1330
|
];
|
|
1323
1331
|
};
|
|
1324
1332
|
},
|
|
@@ -1348,12 +1356,12 @@ type LightCompressedToken = {
|
|
|
1348
1356
|
{
|
|
1349
1357
|
name: 'tlv';
|
|
1350
1358
|
docs: [
|
|
1351
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
1359
|
+
'Placeholder for TokenExtension tlv data (unimplemented)',
|
|
1352
1360
|
];
|
|
1353
1361
|
type: {
|
|
1354
1362
|
option: 'bytes';
|
|
1355
1363
|
};
|
|
1356
|
-
}
|
|
1364
|
+
},
|
|
1357
1365
|
];
|
|
1358
1366
|
};
|
|
1359
1367
|
},
|
|
@@ -1427,7 +1435,7 @@ type LightCompressedToken = {
|
|
|
1427
1435
|
type: {
|
|
1428
1436
|
option: 'bytes';
|
|
1429
1437
|
};
|
|
1430
|
-
}
|
|
1438
|
+
},
|
|
1431
1439
|
];
|
|
1432
1440
|
};
|
|
1433
1441
|
},
|
|
@@ -1445,7 +1453,7 @@ type LightCompressedToken = {
|
|
|
1445
1453
|
name: 'index';
|
|
1446
1454
|
docs: ['Index of compressed account hash in queue.'];
|
|
1447
1455
|
type: 'u16';
|
|
1448
|
-
}
|
|
1456
|
+
},
|
|
1449
1457
|
];
|
|
1450
1458
|
};
|
|
1451
1459
|
},
|
|
@@ -1463,14 +1471,14 @@ type LightCompressedToken = {
|
|
|
1463
1471
|
name: 'rolloverFee';
|
|
1464
1472
|
docs: [
|
|
1465
1473
|
'This fee is used for rent for the next account.',
|
|
1466
|
-
'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',
|
|
1467
1475
|
];
|
|
1468
1476
|
type: 'u64';
|
|
1469
1477
|
},
|
|
1470
1478
|
{
|
|
1471
1479
|
name: 'rolloverThreshold';
|
|
1472
1480
|
docs: [
|
|
1473
|
-
'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).',
|
|
1474
1482
|
];
|
|
1475
1483
|
type: 'u64';
|
|
1476
1484
|
},
|
|
@@ -1482,7 +1490,7 @@ type LightCompressedToken = {
|
|
|
1482
1490
|
{
|
|
1483
1491
|
name: 'rolledoverSlot';
|
|
1484
1492
|
docs: [
|
|
1485
|
-
'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.',
|
|
1486
1494
|
];
|
|
1487
1495
|
type: 'u64';
|
|
1488
1496
|
},
|
|
@@ -1491,7 +1499,7 @@ type LightCompressedToken = {
|
|
|
1491
1499
|
docs: [
|
|
1492
1500
|
'If current slot is greater than rolledover_slot + close_threshold and',
|
|
1493
1501
|
"the account is empty it can be closed. No 'close' functionality has been",
|
|
1494
|
-
'implemented yet.'
|
|
1502
|
+
'implemented yet.',
|
|
1495
1503
|
];
|
|
1496
1504
|
type: 'u64';
|
|
1497
1505
|
},
|
|
@@ -1499,10 +1507,10 @@ type LightCompressedToken = {
|
|
|
1499
1507
|
name: 'additionalBytes';
|
|
1500
1508
|
docs: [
|
|
1501
1509
|
'Placeholder for bytes of additional accounts which are tied to the',
|
|
1502
|
-
'Merkle trees operation and need to be rolled over as well.'
|
|
1510
|
+
'Merkle trees operation and need to be rolled over as well.',
|
|
1503
1511
|
];
|
|
1504
1512
|
type: 'u64';
|
|
1505
|
-
}
|
|
1513
|
+
},
|
|
1506
1514
|
];
|
|
1507
1515
|
};
|
|
1508
1516
|
},
|
|
@@ -1530,7 +1538,7 @@ type LightCompressedToken = {
|
|
|
1530
1538
|
name: 'delegate';
|
|
1531
1539
|
docs: [
|
|
1532
1540
|
'If `delegate` is `Some` then `delegated_amount` represents',
|
|
1533
|
-
'the amount authorized by the delegate'
|
|
1541
|
+
'the amount authorized by the delegate',
|
|
1534
1542
|
];
|
|
1535
1543
|
type: {
|
|
1536
1544
|
option: 'publicKey';
|
|
@@ -1546,142 +1554,37 @@ type LightCompressedToken = {
|
|
|
1546
1554
|
{
|
|
1547
1555
|
name: 'tlv';
|
|
1548
1556
|
docs: [
|
|
1549
|
-
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
1557
|
+
'Placeholder for TokenExtension tlv data (unimplemented)',
|
|
1550
1558
|
];
|
|
1551
1559
|
type: {
|
|
1552
1560
|
option: 'bytes';
|
|
1553
1561
|
};
|
|
1554
|
-
}
|
|
1562
|
+
},
|
|
1555
1563
|
];
|
|
1556
1564
|
};
|
|
1557
|
-
}
|
|
1565
|
+
},
|
|
1558
1566
|
];
|
|
1559
1567
|
errors: [
|
|
1560
1568
|
{
|
|
1561
1569
|
code: 6000;
|
|
1562
|
-
name: '
|
|
1563
|
-
msg: '
|
|
1570
|
+
name: 'SignerCheckFailed';
|
|
1571
|
+
msg: 'Signer check failed';
|
|
1564
1572
|
},
|
|
1565
1573
|
{
|
|
1566
1574
|
code: 6001;
|
|
1567
|
-
name: '
|
|
1568
|
-
msg: '
|
|
1575
|
+
name: 'CreateTransferInstructionFailed';
|
|
1576
|
+
msg: 'Create transfer instruction failed';
|
|
1569
1577
|
},
|
|
1570
1578
|
{
|
|
1571
1579
|
code: 6002;
|
|
1572
|
-
name: '
|
|
1573
|
-
msg: '
|
|
1580
|
+
name: 'AccountNotFound';
|
|
1581
|
+
msg: 'Account not found';
|
|
1574
1582
|
},
|
|
1575
1583
|
{
|
|
1576
1584
|
code: 6003;
|
|
1577
|
-
name: '
|
|
1578
|
-
msg: '
|
|
1579
|
-
},
|
|
1580
|
-
{
|
|
1581
|
-
code: 6004;
|
|
1582
|
-
name: 'ComputeDecompressSumFailed';
|
|
1583
|
-
msg: 'ComputeDecompressSumFailed';
|
|
1584
|
-
},
|
|
1585
|
-
{
|
|
1586
|
-
code: 6005;
|
|
1587
|
-
name: 'SumCheckFailed';
|
|
1588
|
-
msg: 'SumCheckFailed';
|
|
1589
|
-
},
|
|
1590
|
-
{
|
|
1591
|
-
code: 6006;
|
|
1592
|
-
name: 'DecompressRecipientUndefinedForDecompress';
|
|
1593
|
-
msg: 'DecompressRecipientUndefinedForDecompress';
|
|
1594
|
-
},
|
|
1595
|
-
{
|
|
1596
|
-
code: 6007;
|
|
1597
|
-
name: 'CompressedPdaUndefinedForDecompress';
|
|
1598
|
-
msg: 'CompressedPdaUndefinedForDecompress';
|
|
1599
|
-
},
|
|
1600
|
-
{
|
|
1601
|
-
code: 6008;
|
|
1602
|
-
name: 'DeCompressAmountUndefinedForDecompress';
|
|
1603
|
-
msg: 'DeCompressAmountUndefinedForDecompress';
|
|
1604
|
-
},
|
|
1605
|
-
{
|
|
1606
|
-
code: 6009;
|
|
1607
|
-
name: 'CompressedPdaUndefinedForCompress';
|
|
1608
|
-
msg: 'CompressedPdaUndefinedForCompress';
|
|
1609
|
-
},
|
|
1610
|
-
{
|
|
1611
|
-
code: 6010;
|
|
1612
|
-
name: 'DeCompressAmountUndefinedForCompress';
|
|
1613
|
-
msg: 'DeCompressAmountUndefinedForCompress';
|
|
1614
|
-
},
|
|
1615
|
-
{
|
|
1616
|
-
code: 6011;
|
|
1617
|
-
name: 'DelegateSignerCheckFailed';
|
|
1618
|
-
msg: 'DelegateSignerCheckFailed';
|
|
1585
|
+
name: 'SerializationError';
|
|
1586
|
+
msg: 'Serialization error';
|
|
1619
1587
|
},
|
|
1620
|
-
{
|
|
1621
|
-
code: 6012;
|
|
1622
|
-
name: 'MintTooLarge';
|
|
1623
|
-
msg: 'Minted amount greater than u64::MAX';
|
|
1624
|
-
},
|
|
1625
|
-
{
|
|
1626
|
-
code: 6013;
|
|
1627
|
-
name: 'SplTokenSupplyMismatch';
|
|
1628
|
-
msg: 'SplTokenSupplyMismatch';
|
|
1629
|
-
},
|
|
1630
|
-
{
|
|
1631
|
-
code: 6014;
|
|
1632
|
-
name: 'HeapMemoryCheckFailed';
|
|
1633
|
-
msg: 'HeapMemoryCheckFailed';
|
|
1634
|
-
},
|
|
1635
|
-
{
|
|
1636
|
-
code: 6015;
|
|
1637
|
-
name: 'InstructionNotCallable';
|
|
1638
|
-
msg: 'The instruction is not callable';
|
|
1639
|
-
},
|
|
1640
|
-
{
|
|
1641
|
-
code: 6016;
|
|
1642
|
-
name: 'ArithmeticUnderflow';
|
|
1643
|
-
msg: 'ArithmeticUnderflow';
|
|
1644
|
-
},
|
|
1645
|
-
{
|
|
1646
|
-
code: 6017;
|
|
1647
|
-
name: 'HashToFieldError';
|
|
1648
|
-
msg: 'HashToFieldError';
|
|
1649
|
-
},
|
|
1650
|
-
{
|
|
1651
|
-
code: 6018;
|
|
1652
|
-
name: 'InvalidAuthorityMint';
|
|
1653
|
-
msg: 'Expected the authority to be also a mint authority';
|
|
1654
|
-
},
|
|
1655
|
-
{
|
|
1656
|
-
code: 6019;
|
|
1657
|
-
name: 'InvalidFreezeAuthority';
|
|
1658
|
-
msg: 'Provided authority is not the freeze authority';
|
|
1659
|
-
},
|
|
1660
|
-
{
|
|
1661
|
-
code: 6020;
|
|
1662
|
-
name: 'InvalidDelegateIndex';
|
|
1663
|
-
},
|
|
1664
|
-
{
|
|
1665
|
-
code: 6021;
|
|
1666
|
-
name: 'TokenPoolPdaUndefined';
|
|
1667
|
-
},
|
|
1668
|
-
{
|
|
1669
|
-
code: 6022;
|
|
1670
|
-
name: 'IsTokenPoolPda';
|
|
1671
|
-
msg: 'Compress or decompress recipient is the same account as the token pool pda.';
|
|
1672
|
-
},
|
|
1673
|
-
{
|
|
1674
|
-
code: 6023;
|
|
1675
|
-
name: 'InvalidTokenPoolPda';
|
|
1676
|
-
},
|
|
1677
|
-
{
|
|
1678
|
-
code: 6024;
|
|
1679
|
-
name: 'NoInputTokenAccountsProvided';
|
|
1680
|
-
},
|
|
1681
|
-
{
|
|
1682
|
-
code: 6025;
|
|
1683
|
-
name: 'NoInputsProvided';
|
|
1684
|
-
}
|
|
1685
1588
|
];
|
|
1686
1589
|
};
|
|
1687
1590
|
declare const IDL: LightCompressedToken;
|
|
@@ -1841,7 +1744,9 @@ type PackCompressedTokenAccountsParams = {
|
|
|
1841
1744
|
/**
|
|
1842
1745
|
* Packs Compressed Token Accounts.
|
|
1843
1746
|
*/
|
|
1844
|
-
declare function packCompressedTokenAccounts(
|
|
1747
|
+
declare function packCompressedTokenAccounts(
|
|
1748
|
+
params: PackCompressedTokenAccountsParams,
|
|
1749
|
+
): {
|
|
1845
1750
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
1846
1751
|
remainingAccountMetas: AccountMeta[];
|
|
1847
1752
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -1980,6 +1885,39 @@ type CreateMintParams = {
|
|
|
1980
1885
|
*/
|
|
1981
1886
|
rentExemptBalance: number;
|
|
1982
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
|
+
};
|
|
1983
1921
|
/**
|
|
1984
1922
|
* Create compressed token accounts
|
|
1985
1923
|
*/
|
|
@@ -2087,7 +2025,9 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
2087
2025
|
/**
|
|
2088
2026
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
2089
2027
|
*/
|
|
2090
|
-
declare const parseTokenData: (
|
|
2028
|
+
declare const parseTokenData: (
|
|
2029
|
+
compressedTokenAccounts: ParsedTokenAccount[],
|
|
2030
|
+
) => {
|
|
2091
2031
|
mint: PublicKey;
|
|
2092
2032
|
currentOwner: PublicKey;
|
|
2093
2033
|
delegate: PublicKey | null;
|
|
@@ -2100,7 +2040,11 @@ declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) =>
|
|
|
2100
2040
|
* @returns Output token data for the transfer
|
|
2101
2041
|
* instruction
|
|
2102
2042
|
*/
|
|
2103
|
-
declare function createTransferOutputState(
|
|
2043
|
+
declare function createTransferOutputState(
|
|
2044
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
2045
|
+
toAddress: PublicKey,
|
|
2046
|
+
amount: number | BN,
|
|
2047
|
+
): TokenTransferOutputData$1[];
|
|
2104
2048
|
/**
|
|
2105
2049
|
* Create the output state for a compress transaction.
|
|
2106
2050
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -2108,7 +2052,10 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
|
|
|
2108
2052
|
* @returns Output token data for the compress
|
|
2109
2053
|
* instruction
|
|
2110
2054
|
*/
|
|
2111
|
-
declare function createDecompressOutputState(
|
|
2055
|
+
declare function createDecompressOutputState(
|
|
2056
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
2057
|
+
amount: number | BN,
|
|
2058
|
+
): TokenTransferOutputData$1[];
|
|
2112
2059
|
declare class CompressedTokenProgram {
|
|
2113
2060
|
/**
|
|
2114
2061
|
* @internal
|
|
@@ -2133,12 +2080,16 @@ declare class CompressedTokenProgram {
|
|
|
2133
2080
|
/**
|
|
2134
2081
|
* Construct createMint instruction for compressed tokens
|
|
2135
2082
|
*/
|
|
2136
|
-
static createMint(
|
|
2083
|
+
static createMint(
|
|
2084
|
+
params: CreateMintParams,
|
|
2085
|
+
): Promise<TransactionInstruction[]>;
|
|
2137
2086
|
/**
|
|
2138
2087
|
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
2139
2088
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
2140
2089
|
*/
|
|
2141
|
-
static createTokenPool(
|
|
2090
|
+
static createTokenPool(
|
|
2091
|
+
params: RegisterMintParams,
|
|
2092
|
+
): Promise<TransactionInstruction>;
|
|
2142
2093
|
/**
|
|
2143
2094
|
* Construct mintTo instruction for compressed tokens
|
|
2144
2095
|
*/
|
|
@@ -2146,7 +2097,9 @@ declare class CompressedTokenProgram {
|
|
|
2146
2097
|
/**
|
|
2147
2098
|
* Mint tokens from registed SPL mint account to a compressed account
|
|
2148
2099
|
*/
|
|
2149
|
-
static approveAndMintTo(
|
|
2100
|
+
static approveAndMintTo(
|
|
2101
|
+
params: ApproveAndMintToParams,
|
|
2102
|
+
): Promise<TransactionInstruction[]>;
|
|
2150
2103
|
/**
|
|
2151
2104
|
* Construct transfer instruction for compressed tokens
|
|
2152
2105
|
*/
|
|
@@ -2154,7 +2107,9 @@ declare class CompressedTokenProgram {
|
|
|
2154
2107
|
/**
|
|
2155
2108
|
* Create lookup table instructions for the token program's default accounts.
|
|
2156
2109
|
*/
|
|
2157
|
-
static createTokenProgramLookupTable(
|
|
2110
|
+
static createTokenProgramLookupTable(
|
|
2111
|
+
params: CreateTokenProgramLookupTableParams,
|
|
2112
|
+
): Promise<{
|
|
2158
2113
|
instructions: TransactionInstruction[];
|
|
2159
2114
|
address: PublicKey;
|
|
2160
2115
|
}>;
|
|
@@ -2166,7 +2121,12 @@ declare class CompressedTokenProgram {
|
|
|
2166
2121
|
/**
|
|
2167
2122
|
* Construct decompress instruction
|
|
2168
2123
|
*/
|
|
2169
|
-
static decompress(
|
|
2124
|
+
static decompress(
|
|
2125
|
+
params: DecompressParams,
|
|
2126
|
+
): Promise<TransactionInstruction>;
|
|
2127
|
+
static mergeTokenAccounts(
|
|
2128
|
+
params: MergeTokenAccountsParams,
|
|
2129
|
+
): Promise<TransactionInstruction[]>;
|
|
2170
2130
|
}
|
|
2171
2131
|
|
|
2172
2132
|
/**
|
|
@@ -2184,7 +2144,16 @@ declare class CompressedTokenProgram {
|
|
|
2184
2144
|
*
|
|
2185
2145
|
* @return Signature of the confirmed transaction
|
|
2186
2146
|
*/
|
|
2187
|
-
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>;
|
|
2188
2157
|
|
|
2189
2158
|
/**
|
|
2190
2159
|
* Compress SPL tokens
|
|
@@ -2204,7 +2173,17 @@ declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, dest
|
|
|
2204
2173
|
*
|
|
2205
2174
|
* @return Signature of the confirmed transaction
|
|
2206
2175
|
*/
|
|
2207
|
-
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>;
|
|
2208
2187
|
|
|
2209
2188
|
/**
|
|
2210
2189
|
* Decompress compressed tokens
|
|
@@ -2224,7 +2203,16 @@ declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
|
|
|
2224
2203
|
*
|
|
2225
2204
|
* @return Signature of the confirmed transaction
|
|
2226
2205
|
*/
|
|
2227
|
-
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>;
|
|
2228
2216
|
|
|
2229
2217
|
/**
|
|
2230
2218
|
* Create and initialize a new compressed token mint
|
|
@@ -2238,7 +2226,14 @@ declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: nu
|
|
|
2238
2226
|
*
|
|
2239
2227
|
* @return Address of the new mint and the transaction signature
|
|
2240
2228
|
*/
|
|
2241
|
-
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<{
|
|
2242
2237
|
mint: PublicKey;
|
|
2243
2238
|
transactionSignature: TransactionSignature;
|
|
2244
2239
|
}>;
|
|
@@ -2260,7 +2255,38 @@ declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, d
|
|
|
2260
2255
|
*
|
|
2261
2256
|
* @return Signature of the confirmed transaction
|
|
2262
2257
|
*/
|
|
2263
|
-
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>;
|
|
2264
2290
|
|
|
2265
2291
|
/**
|
|
2266
2292
|
* Register an existing mint with the CompressedToken program
|
|
@@ -2273,7 +2299,12 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
|
|
|
2273
2299
|
*
|
|
2274
2300
|
* @return transaction signature
|
|
2275
2301
|
*/
|
|
2276
|
-
declare function createTokenPool(
|
|
2302
|
+
declare function createTokenPool(
|
|
2303
|
+
rpc: Rpc,
|
|
2304
|
+
payer: Signer,
|
|
2305
|
+
mintAddress: PublicKey,
|
|
2306
|
+
confirmOptions?: ConfirmOptions,
|
|
2307
|
+
): Promise<TransactionSignature>;
|
|
2277
2308
|
|
|
2278
2309
|
/**
|
|
2279
2310
|
* Transfer compressed tokens from one owner to another
|
|
@@ -2292,7 +2323,16 @@ declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey
|
|
|
2292
2323
|
*
|
|
2293
2324
|
* @return Signature of the confirmed transaction
|
|
2294
2325
|
*/
|
|
2295
|
-
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>;
|
|
2296
2336
|
/**
|
|
2297
2337
|
* Selects the minimal number of compressed token accounts for a transfer.
|
|
2298
2338
|
*
|
|
@@ -2300,10 +2340,13 @@ declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
|
|
|
2300
2340
|
* 2. Accumulates the amount until it is greater than or equal to the transfer
|
|
2301
2341
|
* amount
|
|
2302
2342
|
*/
|
|
2303
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
2343
|
+
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
2344
|
+
accounts: ParsedTokenAccount[],
|
|
2345
|
+
transferAmount: BN,
|
|
2346
|
+
): [
|
|
2304
2347
|
selectedAccounts: ParsedTokenAccount[],
|
|
2305
2348
|
total: BN,
|
|
2306
|
-
totalLamports: BN | null
|
|
2349
|
+
totalLamports: BN | null,
|
|
2307
2350
|
];
|
|
2308
2351
|
|
|
2309
2352
|
/**
|
|
@@ -2319,9 +2362,51 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
|
|
|
2319
2362
|
*
|
|
2320
2363
|
* @return Transaction signatures and the address of the created lookup table
|
|
2321
2364
|
*/
|
|
2322
|
-
declare function createTokenProgramLookupTable(
|
|
2365
|
+
declare function createTokenProgramLookupTable(
|
|
2366
|
+
rpc: Rpc,
|
|
2367
|
+
payer: Signer,
|
|
2368
|
+
authority: Signer,
|
|
2369
|
+
mints?: PublicKey[],
|
|
2370
|
+
additionalAccounts?: PublicKey[],
|
|
2371
|
+
): Promise<{
|
|
2323
2372
|
txIds: TransactionSignature[];
|
|
2324
2373
|
address: PublicKey;
|
|
2325
2374
|
}>;
|
|
2326
2375
|
|
|
2327
|
-
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
|
+
};
|