@lightprotocol/compressed-token 0.14.0 → 0.14.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.
- package/dist/cjs/browser/index.cjs +3120 -2100
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +1303 -515
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +3047 -2062
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +361 -109
- package/package.json +5 -5
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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 = {
|
|
@@ -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,37 +1554,142 @@ 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: 'PublicKeyAmountMissmatch';
|
|
1571
|
+
msg: 'public keys and amounts must be of same length';
|
|
1558
1572
|
},
|
|
1559
1573
|
{
|
|
1560
1574
|
code: 6001;
|
|
1561
|
-
name: '
|
|
1562
|
-
msg: '
|
|
1575
|
+
name: 'ComputeInputSumFailed';
|
|
1576
|
+
msg: 'ComputeInputSumFailed';
|
|
1563
1577
|
},
|
|
1564
1578
|
{
|
|
1565
1579
|
code: 6002;
|
|
1566
|
-
name: '
|
|
1567
|
-
msg: '
|
|
1580
|
+
name: 'ComputeOutputSumFailed';
|
|
1581
|
+
msg: 'ComputeOutputSumFailed';
|
|
1568
1582
|
},
|
|
1569
1583
|
{
|
|
1570
1584
|
code: 6003;
|
|
1571
|
-
name: '
|
|
1572
|
-
msg: '
|
|
1573
|
-
}
|
|
1585
|
+
name: 'ComputeCompressSumFailed';
|
|
1586
|
+
msg: 'ComputeCompressSumFailed';
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
code: 6004;
|
|
1590
|
+
name: 'ComputeDecompressSumFailed';
|
|
1591
|
+
msg: 'ComputeDecompressSumFailed';
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
code: 6005;
|
|
1595
|
+
name: 'SumCheckFailed';
|
|
1596
|
+
msg: 'SumCheckFailed';
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
code: 6006;
|
|
1600
|
+
name: 'DecompressRecipientUndefinedForDecompress';
|
|
1601
|
+
msg: 'DecompressRecipientUndefinedForDecompress';
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
code: 6007;
|
|
1605
|
+
name: 'CompressedPdaUndefinedForDecompress';
|
|
1606
|
+
msg: 'CompressedPdaUndefinedForDecompress';
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
code: 6008;
|
|
1610
|
+
name: 'DeCompressAmountUndefinedForDecompress';
|
|
1611
|
+
msg: 'DeCompressAmountUndefinedForDecompress';
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
code: 6009;
|
|
1615
|
+
name: 'CompressedPdaUndefinedForCompress';
|
|
1616
|
+
msg: 'CompressedPdaUndefinedForCompress';
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
code: 6010;
|
|
1620
|
+
name: 'DeCompressAmountUndefinedForCompress';
|
|
1621
|
+
msg: 'DeCompressAmountUndefinedForCompress';
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
code: 6011;
|
|
1625
|
+
name: 'DelegateSignerCheckFailed';
|
|
1626
|
+
msg: 'DelegateSignerCheckFailed';
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
code: 6012;
|
|
1630
|
+
name: 'MintTooLarge';
|
|
1631
|
+
msg: 'Minted amount greater than u64::MAX';
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
code: 6013;
|
|
1635
|
+
name: 'SplTokenSupplyMismatch';
|
|
1636
|
+
msg: 'SplTokenSupplyMismatch';
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
code: 6014;
|
|
1640
|
+
name: 'HeapMemoryCheckFailed';
|
|
1641
|
+
msg: 'HeapMemoryCheckFailed';
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
code: 6015;
|
|
1645
|
+
name: 'InstructionNotCallable';
|
|
1646
|
+
msg: 'The instruction is not callable';
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
code: 6016;
|
|
1650
|
+
name: 'ArithmeticUnderflow';
|
|
1651
|
+
msg: 'ArithmeticUnderflow';
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
code: 6017;
|
|
1655
|
+
name: 'HashToFieldError';
|
|
1656
|
+
msg: 'HashToFieldError';
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
code: 6018;
|
|
1660
|
+
name: 'InvalidAuthorityMint';
|
|
1661
|
+
msg: 'Expected the authority to be also a mint authority';
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
code: 6019;
|
|
1665
|
+
name: 'InvalidFreezeAuthority';
|
|
1666
|
+
msg: 'Provided authority is not the freeze authority';
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
code: 6020;
|
|
1670
|
+
name: 'InvalidDelegateIndex';
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
code: 6021;
|
|
1674
|
+
name: 'TokenPoolPdaUndefined';
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
code: 6022;
|
|
1678
|
+
name: 'IsTokenPoolPda';
|
|
1679
|
+
msg: 'Compress or decompress recipient is the same account as the token pool pda.';
|
|
1680
|
+
},
|
|
1681
|
+
{
|
|
1682
|
+
code: 6023;
|
|
1683
|
+
name: 'InvalidTokenPoolPda';
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
code: 6024;
|
|
1687
|
+
name: 'NoInputTokenAccountsProvided';
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
code: 6025;
|
|
1691
|
+
name: 'NoInputsProvided';
|
|
1692
|
+
},
|
|
1574
1693
|
];
|
|
1575
1694
|
};
|
|
1576
1695
|
declare const IDL: LightCompressedToken;
|
|
@@ -1730,7 +1849,9 @@ type PackCompressedTokenAccountsParams = {
|
|
|
1730
1849
|
/**
|
|
1731
1850
|
* Packs Compressed Token Accounts.
|
|
1732
1851
|
*/
|
|
1733
|
-
declare function packCompressedTokenAccounts(
|
|
1852
|
+
declare function packCompressedTokenAccounts(
|
|
1853
|
+
params: PackCompressedTokenAccountsParams,
|
|
1854
|
+
): {
|
|
1734
1855
|
inputTokenDataWithContext: InputTokenDataWithContext$1[];
|
|
1735
1856
|
remainingAccountMetas: AccountMeta[];
|
|
1736
1857
|
packedOutputTokenData: PackedTokenTransferOutputData[];
|
|
@@ -2009,7 +2130,9 @@ declare const validateSameTokenOwner: (accounts: ParsedTokenAccount[]) => void;
|
|
|
2009
2130
|
/**
|
|
2010
2131
|
* Parse compressed token accounts to get the mint, current owner and delegate.
|
|
2011
2132
|
*/
|
|
2012
|
-
declare const parseTokenData: (
|
|
2133
|
+
declare const parseTokenData: (
|
|
2134
|
+
compressedTokenAccounts: ParsedTokenAccount[],
|
|
2135
|
+
) => {
|
|
2013
2136
|
mint: PublicKey;
|
|
2014
2137
|
currentOwner: PublicKey;
|
|
2015
2138
|
delegate: PublicKey | null;
|
|
@@ -2022,7 +2145,11 @@ declare const parseTokenData: (compressedTokenAccounts: ParsedTokenAccount[]) =>
|
|
|
2022
2145
|
* @returns Output token data for the transfer
|
|
2023
2146
|
* instruction
|
|
2024
2147
|
*/
|
|
2025
|
-
declare function createTransferOutputState(
|
|
2148
|
+
declare function createTransferOutputState(
|
|
2149
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
2150
|
+
toAddress: PublicKey,
|
|
2151
|
+
amount: number | BN,
|
|
2152
|
+
): TokenTransferOutputData$1[];
|
|
2026
2153
|
/**
|
|
2027
2154
|
* Create the output state for a compress transaction.
|
|
2028
2155
|
* @param inputCompressedTokenAccounts Input state
|
|
@@ -2030,7 +2157,10 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
|
|
|
2030
2157
|
* @returns Output token data for the compress
|
|
2031
2158
|
* instruction
|
|
2032
2159
|
*/
|
|
2033
|
-
declare function createDecompressOutputState(
|
|
2160
|
+
declare function createDecompressOutputState(
|
|
2161
|
+
inputCompressedTokenAccounts: ParsedTokenAccount[],
|
|
2162
|
+
amount: number | BN,
|
|
2163
|
+
): TokenTransferOutputData$1[];
|
|
2034
2164
|
declare class CompressedTokenProgram {
|
|
2035
2165
|
/**
|
|
2036
2166
|
* @internal
|
|
@@ -2055,12 +2185,16 @@ declare class CompressedTokenProgram {
|
|
|
2055
2185
|
/**
|
|
2056
2186
|
* Construct createMint instruction for compressed tokens
|
|
2057
2187
|
*/
|
|
2058
|
-
static createMint(
|
|
2188
|
+
static createMint(
|
|
2189
|
+
params: CreateMintParams,
|
|
2190
|
+
): Promise<TransactionInstruction[]>;
|
|
2059
2191
|
/**
|
|
2060
2192
|
* Enable compression for an existing SPL mint, creating an omnibus account.
|
|
2061
2193
|
* For new mints, use `CompressedTokenProgram.createMint`.
|
|
2062
2194
|
*/
|
|
2063
|
-
static createTokenPool(
|
|
2195
|
+
static createTokenPool(
|
|
2196
|
+
params: RegisterMintParams,
|
|
2197
|
+
): Promise<TransactionInstruction>;
|
|
2064
2198
|
/**
|
|
2065
2199
|
* Construct mintTo instruction for compressed tokens
|
|
2066
2200
|
*/
|
|
@@ -2068,7 +2202,9 @@ declare class CompressedTokenProgram {
|
|
|
2068
2202
|
/**
|
|
2069
2203
|
* Mint tokens from registed SPL mint account to a compressed account
|
|
2070
2204
|
*/
|
|
2071
|
-
static approveAndMintTo(
|
|
2205
|
+
static approveAndMintTo(
|
|
2206
|
+
params: ApproveAndMintToParams,
|
|
2207
|
+
): Promise<TransactionInstruction[]>;
|
|
2072
2208
|
/**
|
|
2073
2209
|
* Construct transfer instruction for compressed tokens
|
|
2074
2210
|
*/
|
|
@@ -2076,7 +2212,9 @@ declare class CompressedTokenProgram {
|
|
|
2076
2212
|
/**
|
|
2077
2213
|
* Create lookup table instructions for the token program's default accounts.
|
|
2078
2214
|
*/
|
|
2079
|
-
static createTokenProgramLookupTable(
|
|
2215
|
+
static createTokenProgramLookupTable(
|
|
2216
|
+
params: CreateTokenProgramLookupTableParams,
|
|
2217
|
+
): Promise<{
|
|
2080
2218
|
instructions: TransactionInstruction[];
|
|
2081
2219
|
address: PublicKey;
|
|
2082
2220
|
}>;
|
|
@@ -2088,8 +2226,12 @@ declare class CompressedTokenProgram {
|
|
|
2088
2226
|
/**
|
|
2089
2227
|
* Construct decompress instruction
|
|
2090
2228
|
*/
|
|
2091
|
-
static decompress(
|
|
2092
|
-
|
|
2229
|
+
static decompress(
|
|
2230
|
+
params: DecompressParams,
|
|
2231
|
+
): Promise<TransactionInstruction>;
|
|
2232
|
+
static mergeTokenAccounts(
|
|
2233
|
+
params: MergeTokenAccountsParams,
|
|
2234
|
+
): Promise<TransactionInstruction[]>;
|
|
2093
2235
|
}
|
|
2094
2236
|
|
|
2095
2237
|
/**
|
|
@@ -2107,7 +2249,16 @@ declare class CompressedTokenProgram {
|
|
|
2107
2249
|
*
|
|
2108
2250
|
* @return Signature of the confirmed transaction
|
|
2109
2251
|
*/
|
|
2110
|
-
declare function approveAndMintTo(
|
|
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>;
|
|
2111
2262
|
|
|
2112
2263
|
/**
|
|
2113
2264
|
* Compress SPL tokens
|
|
@@ -2127,7 +2278,17 @@ declare function approveAndMintTo(rpc: Rpc, payer: Signer, mint: PublicKey, dest
|
|
|
2127
2278
|
*
|
|
2128
2279
|
* @return Signature of the confirmed transaction
|
|
2129
2280
|
*/
|
|
2130
|
-
declare function compress(
|
|
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>;
|
|
2131
2292
|
|
|
2132
2293
|
/**
|
|
2133
2294
|
* Decompress compressed tokens
|
|
@@ -2147,7 +2308,16 @@ declare function compress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
|
|
|
2147
2308
|
*
|
|
2148
2309
|
* @return Signature of the confirmed transaction
|
|
2149
2310
|
*/
|
|
2150
|
-
declare function decompress(
|
|
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>;
|
|
2151
2321
|
|
|
2152
2322
|
/**
|
|
2153
2323
|
* Create and initialize a new compressed token mint
|
|
@@ -2161,7 +2331,14 @@ declare function decompress(rpc: Rpc, payer: Signer, mint: PublicKey, amount: nu
|
|
|
2161
2331
|
*
|
|
2162
2332
|
* @return Address of the new mint and the transaction signature
|
|
2163
2333
|
*/
|
|
2164
|
-
declare function createMint(
|
|
2334
|
+
declare function createMint(
|
|
2335
|
+
rpc: Rpc,
|
|
2336
|
+
payer: Signer,
|
|
2337
|
+
mintAuthority: PublicKey,
|
|
2338
|
+
decimals: number,
|
|
2339
|
+
keypair?: Keypair,
|
|
2340
|
+
confirmOptions?: ConfirmOptions,
|
|
2341
|
+
): Promise<{
|
|
2165
2342
|
mint: PublicKey;
|
|
2166
2343
|
transactionSignature: TransactionSignature;
|
|
2167
2344
|
}>;
|
|
@@ -2183,7 +2360,16 @@ declare function createMint(rpc: Rpc, payer: Signer, mintAuthority: PublicKey, d
|
|
|
2183
2360
|
*
|
|
2184
2361
|
* @return Signature of the confirmed transaction
|
|
2185
2362
|
*/
|
|
2186
|
-
declare function mintTo(
|
|
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>;
|
|
2187
2373
|
|
|
2188
2374
|
/**
|
|
2189
2375
|
* Merge multiple compressed token accounts for a given mint into a single
|
|
@@ -2198,7 +2384,14 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
|
|
|
2198
2384
|
*
|
|
2199
2385
|
* @return Array of transaction signatures
|
|
2200
2386
|
*/
|
|
2201
|
-
declare function mergeTokenAccounts(
|
|
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>;
|
|
2202
2395
|
|
|
2203
2396
|
/**
|
|
2204
2397
|
* Register an existing mint with the CompressedToken program
|
|
@@ -2211,7 +2404,12 @@ declare function mergeTokenAccounts(rpc: Rpc, payer: Signer, mint: PublicKey, ow
|
|
|
2211
2404
|
*
|
|
2212
2405
|
* @return transaction signature
|
|
2213
2406
|
*/
|
|
2214
|
-
declare function createTokenPool(
|
|
2407
|
+
declare function createTokenPool(
|
|
2408
|
+
rpc: Rpc,
|
|
2409
|
+
payer: Signer,
|
|
2410
|
+
mintAddress: PublicKey,
|
|
2411
|
+
confirmOptions?: ConfirmOptions,
|
|
2412
|
+
): Promise<TransactionSignature>;
|
|
2215
2413
|
|
|
2216
2414
|
/**
|
|
2217
2415
|
* Transfer compressed tokens from one owner to another
|
|
@@ -2230,7 +2428,16 @@ declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey
|
|
|
2230
2428
|
*
|
|
2231
2429
|
* @return Signature of the confirmed transaction
|
|
2232
2430
|
*/
|
|
2233
|
-
declare function transfer(
|
|
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>;
|
|
2234
2441
|
/**
|
|
2235
2442
|
* Selects the minimal number of compressed token accounts for a transfer.
|
|
2236
2443
|
*
|
|
@@ -2238,10 +2445,13 @@ declare function transfer(rpc: Rpc, payer: Signer, mint: PublicKey, amount: numb
|
|
|
2238
2445
|
* 2. Accumulates the amount until it is greater than or equal to the transfer
|
|
2239
2446
|
* amount
|
|
2240
2447
|
*/
|
|
2241
|
-
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
2448
|
+
declare function selectMinCompressedTokenAccountsForTransfer(
|
|
2449
|
+
accounts: ParsedTokenAccount[],
|
|
2450
|
+
transferAmount: BN,
|
|
2451
|
+
): [
|
|
2242
2452
|
selectedAccounts: ParsedTokenAccount[],
|
|
2243
2453
|
total: BN,
|
|
2244
|
-
totalLamports: BN | null
|
|
2454
|
+
totalLamports: BN | null,
|
|
2245
2455
|
];
|
|
2246
2456
|
|
|
2247
2457
|
/**
|
|
@@ -2257,9 +2467,51 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
|
|
|
2257
2467
|
*
|
|
2258
2468
|
* @return Transaction signatures and the address of the created lookup table
|
|
2259
2469
|
*/
|
|
2260
|
-
declare function createTokenProgramLookupTable(
|
|
2470
|
+
declare function createTokenProgramLookupTable(
|
|
2471
|
+
rpc: Rpc,
|
|
2472
|
+
payer: Signer,
|
|
2473
|
+
authority: Signer,
|
|
2474
|
+
mints?: PublicKey[],
|
|
2475
|
+
additionalAccounts?: PublicKey[],
|
|
2476
|
+
): Promise<{
|
|
2261
2477
|
txIds: TransactionSignature[];
|
|
2262
2478
|
address: PublicKey;
|
|
2263
2479
|
}>;
|
|
2264
2480
|
|
|
2265
|
-
export {
|
|
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
|
+
};
|