@lightprotocol/compressed-token 0.3.3 → 0.4.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 +252 -156
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +252 -156
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +253 -157
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +257 -124
- package/package.json +5 -5
package/dist/types/index.d.ts
CHANGED
|
@@ -9,16 +9,17 @@ type LightCompressedToken = {
|
|
|
9
9
|
{
|
|
10
10
|
name: 'createTokenPool';
|
|
11
11
|
docs: [
|
|
12
|
-
'This instruction
|
|
13
|
-
'token
|
|
14
|
-
'
|
|
15
|
-
'
|
|
12
|
+
'This instruction creates a token pool for a given mint. Every spl mint',
|
|
13
|
+
'can have one token pool. When a token is compressed the tokens are',
|
|
14
|
+
'transferrred to the token pool, and their compressed equivalent is',
|
|
15
|
+
'minted into a Merkle tree.'
|
|
16
16
|
];
|
|
17
17
|
accounts: [
|
|
18
18
|
{
|
|
19
19
|
name: 'feePayer';
|
|
20
20
|
isMut: true;
|
|
21
21
|
isSigner: true;
|
|
22
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
name: 'tokenPoolPda';
|
|
@@ -54,13 +55,17 @@ type LightCompressedToken = {
|
|
|
54
55
|
'Mints tokens from an spl token mint to a list of compressed accounts.',
|
|
55
56
|
'Minted tokens are transferred to a pool account owned by the compressed',
|
|
56
57
|
'token program. The instruction creates one compressed output account for',
|
|
57
|
-
'every amount and pubkey input pair
|
|
58
|
+
'every amount and pubkey input pair. A constant amount of lamports can be',
|
|
59
|
+
'transferred to each output account to enable. A use case to add lamports',
|
|
60
|
+
'to a compressed token account is to prevent spam. This is the only way',
|
|
61
|
+
'to add lamports to a compressed token account.'
|
|
58
62
|
];
|
|
59
63
|
accounts: [
|
|
60
64
|
{
|
|
61
65
|
name: 'feePayer';
|
|
62
66
|
isMut: true;
|
|
63
67
|
isSigner: true;
|
|
68
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
64
69
|
},
|
|
65
70
|
{
|
|
66
71
|
name: 'authority';
|
|
@@ -81,6 +86,9 @@ type LightCompressedToken = {
|
|
|
81
86
|
name: 'tokenPoolPda';
|
|
82
87
|
isMut: true;
|
|
83
88
|
isSigner: false;
|
|
89
|
+
docs: [
|
|
90
|
+
'account to a token account of a different mint will fail'
|
|
91
|
+
];
|
|
84
92
|
},
|
|
85
93
|
{
|
|
86
94
|
name: 'tokenProgram';
|
|
@@ -101,6 +109,7 @@ type LightCompressedToken = {
|
|
|
101
109
|
name: 'noopProgram';
|
|
102
110
|
isMut: false;
|
|
103
111
|
isSigner: false;
|
|
112
|
+
docs: ['programs'];
|
|
104
113
|
},
|
|
105
114
|
{
|
|
106
115
|
name: 'accountCompressionAuthority';
|
|
@@ -126,6 +135,12 @@ type LightCompressedToken = {
|
|
|
126
135
|
name: 'systemProgram';
|
|
127
136
|
isMut: false;
|
|
128
137
|
isSigner: false;
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'solPoolPda';
|
|
141
|
+
isMut: true;
|
|
142
|
+
isSigner: false;
|
|
143
|
+
isOptional: true;
|
|
129
144
|
}
|
|
130
145
|
];
|
|
131
146
|
args: [
|
|
@@ -140,21 +155,43 @@ type LightCompressedToken = {
|
|
|
140
155
|
type: {
|
|
141
156
|
vec: 'u64';
|
|
142
157
|
};
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'lamports';
|
|
161
|
+
type: {
|
|
162
|
+
option: 'u64';
|
|
163
|
+
};
|
|
143
164
|
}
|
|
144
165
|
];
|
|
145
166
|
},
|
|
146
167
|
{
|
|
147
168
|
name: 'transfer';
|
|
169
|
+
docs: [
|
|
170
|
+
'Transfers compressed tokens from one account to another. All accounts',
|
|
171
|
+
'must be of the same mint. Additional spl tokens can be compressed or',
|
|
172
|
+
'decompressed. In one transaction only compression or decompression is',
|
|
173
|
+
'possible. Lamports can be transferred alongside tokens. If output token',
|
|
174
|
+
'accounts specify less lamports than inputs the remaining lamports are',
|
|
175
|
+
'transferred to an output compressed account. Signer must be owner or',
|
|
176
|
+
'delegate. If a delegated token account is transferred the delegate is',
|
|
177
|
+
'not preserved.'
|
|
178
|
+
];
|
|
148
179
|
accounts: [
|
|
149
180
|
{
|
|
150
181
|
name: 'feePayer';
|
|
151
182
|
isMut: true;
|
|
152
183
|
isSigner: true;
|
|
184
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
153
185
|
},
|
|
154
186
|
{
|
|
155
187
|
name: 'authority';
|
|
156
188
|
isMut: false;
|
|
157
189
|
isSigner: true;
|
|
190
|
+
docs: [
|
|
191
|
+
'Authority is verified through proof since both owner and delegate',
|
|
192
|
+
'are included in the token data hash, which is a public input to the',
|
|
193
|
+
'validity proof.'
|
|
194
|
+
];
|
|
158
195
|
},
|
|
159
196
|
{
|
|
160
197
|
name: 'cpiAuthorityPda';
|
|
@@ -190,6 +227,10 @@ type LightCompressedToken = {
|
|
|
190
227
|
name: 'selfProgram';
|
|
191
228
|
isMut: false;
|
|
192
229
|
isSigner: false;
|
|
230
|
+
docs: [
|
|
231
|
+
'(different program) checked in light system program to derive',
|
|
232
|
+
'cpi_authority_pda and check that this program is the signer of the cpi.'
|
|
233
|
+
];
|
|
193
234
|
},
|
|
194
235
|
{
|
|
195
236
|
name: 'tokenPoolPda';
|
|
@@ -224,16 +265,30 @@ type LightCompressedToken = {
|
|
|
224
265
|
},
|
|
225
266
|
{
|
|
226
267
|
name: 'approve';
|
|
268
|
+
docs: [
|
|
269
|
+
'Delegates an amount to a delegate. A compressed token account is either',
|
|
270
|
+
'completely delegated or not. Prior delegates are not preserved. Cannot',
|
|
271
|
+
'be called by a delegate.',
|
|
272
|
+
'The instruction creates two output accounts:',
|
|
273
|
+
'1. one account with delegated amount',
|
|
274
|
+
'2. one account with remaining(change) amount'
|
|
275
|
+
];
|
|
227
276
|
accounts: [
|
|
228
277
|
{
|
|
229
278
|
name: 'feePayer';
|
|
230
279
|
isMut: true;
|
|
231
280
|
isSigner: true;
|
|
281
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
232
282
|
},
|
|
233
283
|
{
|
|
234
284
|
name: 'authority';
|
|
235
285
|
isMut: false;
|
|
236
286
|
isSigner: true;
|
|
287
|
+
docs: [
|
|
288
|
+
'Authority is verified through proof since both owner and delegate',
|
|
289
|
+
'are included in the token data hash, which is a public input to the',
|
|
290
|
+
'validity proof.'
|
|
291
|
+
];
|
|
237
292
|
},
|
|
238
293
|
{
|
|
239
294
|
name: 'cpiAuthorityPda';
|
|
@@ -269,6 +324,10 @@ type LightCompressedToken = {
|
|
|
269
324
|
name: 'selfProgram';
|
|
270
325
|
isMut: false;
|
|
271
326
|
isSigner: false;
|
|
327
|
+
docs: [
|
|
328
|
+
'(different program) checked in light system program to derive',
|
|
329
|
+
'cpi_authority_pda and check that this program is the signer of the cpi.'
|
|
330
|
+
];
|
|
272
331
|
},
|
|
273
332
|
{
|
|
274
333
|
name: 'systemProgram';
|
|
@@ -285,16 +344,26 @@ type LightCompressedToken = {
|
|
|
285
344
|
},
|
|
286
345
|
{
|
|
287
346
|
name: 'revoke';
|
|
347
|
+
docs: [
|
|
348
|
+
'Revokes a delegation. The instruction merges all inputs into one output',
|
|
349
|
+
'account. Cannot be called by a delegate. Delegates are not preserved.'
|
|
350
|
+
];
|
|
288
351
|
accounts: [
|
|
289
352
|
{
|
|
290
353
|
name: 'feePayer';
|
|
291
354
|
isMut: true;
|
|
292
355
|
isSigner: true;
|
|
356
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
293
357
|
},
|
|
294
358
|
{
|
|
295
359
|
name: 'authority';
|
|
296
360
|
isMut: false;
|
|
297
361
|
isSigner: true;
|
|
362
|
+
docs: [
|
|
363
|
+
'Authority is verified through proof since both owner and delegate',
|
|
364
|
+
'are included in the token data hash, which is a public input to the',
|
|
365
|
+
'validity proof.'
|
|
366
|
+
];
|
|
298
367
|
},
|
|
299
368
|
{
|
|
300
369
|
name: 'cpiAuthorityPda';
|
|
@@ -330,6 +399,10 @@ type LightCompressedToken = {
|
|
|
330
399
|
name: 'selfProgram';
|
|
331
400
|
isMut: false;
|
|
332
401
|
isSigner: false;
|
|
402
|
+
docs: [
|
|
403
|
+
'(different program) checked in light system program to derive',
|
|
404
|
+
'cpi_authority_pda and check that this program is the signer of the cpi.'
|
|
405
|
+
];
|
|
333
406
|
},
|
|
334
407
|
{
|
|
335
408
|
name: 'systemProgram';
|
|
@@ -346,11 +419,16 @@ type LightCompressedToken = {
|
|
|
346
419
|
},
|
|
347
420
|
{
|
|
348
421
|
name: 'freeze';
|
|
422
|
+
docs: [
|
|
423
|
+
'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
|
|
424
|
+
'many outputs as inputs. Balances and delegates are preserved.'
|
|
425
|
+
];
|
|
349
426
|
accounts: [
|
|
350
427
|
{
|
|
351
428
|
name: 'feePayer';
|
|
352
429
|
isMut: true;
|
|
353
430
|
isSigner: true;
|
|
431
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
354
432
|
},
|
|
355
433
|
{
|
|
356
434
|
name: 'authority';
|
|
@@ -391,6 +469,10 @@ type LightCompressedToken = {
|
|
|
391
469
|
name: 'selfProgram';
|
|
392
470
|
isMut: false;
|
|
393
471
|
isSigner: false;
|
|
472
|
+
docs: [
|
|
473
|
+
'(different program) checked in light system program to derive',
|
|
474
|
+
'cpi_authority_pda and check that this program is the signer of the cpi.'
|
|
475
|
+
];
|
|
394
476
|
},
|
|
395
477
|
{
|
|
396
478
|
name: 'systemProgram';
|
|
@@ -412,11 +494,16 @@ type LightCompressedToken = {
|
|
|
412
494
|
},
|
|
413
495
|
{
|
|
414
496
|
name: 'thaw';
|
|
497
|
+
docs: [
|
|
498
|
+
'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
|
|
499
|
+
'as many outputs as inputs. Balances and delegates are preserved.'
|
|
500
|
+
];
|
|
415
501
|
accounts: [
|
|
416
502
|
{
|
|
417
503
|
name: 'feePayer';
|
|
418
504
|
isMut: true;
|
|
419
505
|
isSigner: true;
|
|
506
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
420
507
|
},
|
|
421
508
|
{
|
|
422
509
|
name: 'authority';
|
|
@@ -457,6 +544,10 @@ type LightCompressedToken = {
|
|
|
457
544
|
name: 'selfProgram';
|
|
458
545
|
isMut: false;
|
|
459
546
|
isSigner: false;
|
|
547
|
+
docs: [
|
|
548
|
+
'(different program) checked in light system program to derive',
|
|
549
|
+
'cpi_authority_pda and check that this program is the signer of the cpi.'
|
|
550
|
+
];
|
|
460
551
|
},
|
|
461
552
|
{
|
|
462
553
|
name: 'systemProgram';
|
|
@@ -478,22 +569,48 @@ type LightCompressedToken = {
|
|
|
478
569
|
},
|
|
479
570
|
{
|
|
480
571
|
name: 'burn';
|
|
572
|
+
docs: [
|
|
573
|
+
'Burns compressed tokens and spl tokens from the pool account. Delegates',
|
|
574
|
+
'can burn tokens. The output compressed token account remains delegated.',
|
|
575
|
+
'Creates one output compressed token account.'
|
|
576
|
+
];
|
|
481
577
|
accounts: [
|
|
482
578
|
{
|
|
483
579
|
name: 'feePayer';
|
|
484
580
|
isMut: true;
|
|
485
581
|
isSigner: true;
|
|
582
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
486
583
|
},
|
|
487
584
|
{
|
|
488
585
|
name: 'authority';
|
|
489
586
|
isMut: false;
|
|
490
587
|
isSigner: true;
|
|
588
|
+
docs: [
|
|
589
|
+
'Authority is verified through proof since both owner and delegate',
|
|
590
|
+
'are included in the token data hash, which is a public input to the',
|
|
591
|
+
'validity proof.'
|
|
592
|
+
];
|
|
491
593
|
},
|
|
492
594
|
{
|
|
493
595
|
name: 'cpiAuthorityPda';
|
|
494
596
|
isMut: false;
|
|
495
597
|
isSigner: false;
|
|
496
598
|
},
|
|
599
|
+
{
|
|
600
|
+
name: 'mint';
|
|
601
|
+
isMut: true;
|
|
602
|
+
isSigner: false;
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: 'tokenPoolPda';
|
|
606
|
+
isMut: true;
|
|
607
|
+
isSigner: false;
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
name: 'tokenProgram';
|
|
611
|
+
isMut: false;
|
|
612
|
+
isSigner: false;
|
|
613
|
+
},
|
|
497
614
|
{
|
|
498
615
|
name: 'lightSystemProgram';
|
|
499
616
|
isMut: false;
|
|
@@ -549,11 +666,17 @@ type LightCompressedToken = {
|
|
|
549
666
|
name: 'feePayer';
|
|
550
667
|
isMut: true;
|
|
551
668
|
isSigner: true;
|
|
669
|
+
docs: ['UNCHECKED: only pays fees.'];
|
|
552
670
|
},
|
|
553
671
|
{
|
|
554
672
|
name: 'authority';
|
|
555
673
|
isMut: false;
|
|
556
674
|
isSigner: true;
|
|
675
|
+
docs: [
|
|
676
|
+
'Authority is verified through proof since both owner and delegate',
|
|
677
|
+
'are included in the token data hash, which is a public input to the',
|
|
678
|
+
'validity proof.'
|
|
679
|
+
];
|
|
557
680
|
},
|
|
558
681
|
{
|
|
559
682
|
name: 'cpiAuthorityPda';
|
|
@@ -589,6 +712,10 @@ type LightCompressedToken = {
|
|
|
589
712
|
name: 'selfProgram';
|
|
590
713
|
isMut: false;
|
|
591
714
|
isSigner: false;
|
|
715
|
+
docs: [
|
|
716
|
+
'(different program) checked in light system program to derive',
|
|
717
|
+
'cpi_authority_pda and check that this program is the signer of the cpi.'
|
|
718
|
+
];
|
|
592
719
|
},
|
|
593
720
|
{
|
|
594
721
|
name: 'tokenPoolPda';
|
|
@@ -630,24 +757,6 @@ type LightCompressedToken = {
|
|
|
630
757
|
];
|
|
631
758
|
}
|
|
632
759
|
];
|
|
633
|
-
accounts: [
|
|
634
|
-
{
|
|
635
|
-
name: 'RegisteredProgram';
|
|
636
|
-
type: {
|
|
637
|
-
kind: 'struct';
|
|
638
|
-
fields: [
|
|
639
|
-
{
|
|
640
|
-
name: 'registeredProgramId';
|
|
641
|
-
type: 'publicKey';
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
name: 'groupAuthorityPda';
|
|
645
|
-
type: 'publicKey';
|
|
646
|
-
}
|
|
647
|
-
];
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
];
|
|
651
760
|
types: [
|
|
652
761
|
{
|
|
653
762
|
name: 'AccessMetadata';
|
|
@@ -662,7 +771,7 @@ type LightCompressedToken = {
|
|
|
662
771
|
{
|
|
663
772
|
name: 'programOwner';
|
|
664
773
|
docs: [
|
|
665
|
-
'
|
|
774
|
+
'Program owner of the Merkle tree. This will be used for program owned Merkle trees.'
|
|
666
775
|
];
|
|
667
776
|
type: 'publicKey';
|
|
668
777
|
}
|
|
@@ -746,10 +855,25 @@ type LightCompressedToken = {
|
|
|
746
855
|
fields: [
|
|
747
856
|
{
|
|
748
857
|
name: 'setContext';
|
|
858
|
+
docs: [
|
|
859
|
+
'Is set by the program that is invoking the CPI to signal that is should',
|
|
860
|
+
'set the cpi context.'
|
|
861
|
+
];
|
|
862
|
+
type: 'bool';
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
name: 'firstSetContext';
|
|
866
|
+
docs: [
|
|
867
|
+
'Is set to wipe the cpi context since someone could have set it before',
|
|
868
|
+
'with unrelated data.'
|
|
869
|
+
];
|
|
749
870
|
type: 'bool';
|
|
750
871
|
},
|
|
751
872
|
{
|
|
752
873
|
name: 'cpiContextAccountIndex';
|
|
874
|
+
docs: [
|
|
875
|
+
'Index of cpi context account in remaining accounts.'
|
|
876
|
+
];
|
|
753
877
|
type: 'u8';
|
|
754
878
|
}
|
|
755
879
|
];
|
|
@@ -801,9 +925,9 @@ type LightCompressedToken = {
|
|
|
801
925
|
{
|
|
802
926
|
name: 'delegatedTransfer';
|
|
803
927
|
docs: [
|
|
804
|
-
'
|
|
805
|
-
'
|
|
806
|
-
'
|
|
928
|
+
'Is required if the signer is delegate,',
|
|
929
|
+
'-> delegate is authority account,',
|
|
930
|
+
'owner = Some(owner) is the owner of the token account.'
|
|
807
931
|
];
|
|
808
932
|
type: {
|
|
809
933
|
option: {
|
|
@@ -844,12 +968,21 @@ type LightCompressedToken = {
|
|
|
844
968
|
defined: 'CompressedCpiContext';
|
|
845
969
|
};
|
|
846
970
|
};
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
name: 'lamportsChangeAccountMerkleTreeIndex';
|
|
974
|
+
type: {
|
|
975
|
+
option: 'u8';
|
|
976
|
+
};
|
|
847
977
|
}
|
|
848
978
|
];
|
|
849
979
|
};
|
|
850
980
|
},
|
|
851
981
|
{
|
|
852
982
|
name: 'DelegatedTransfer';
|
|
983
|
+
docs: [
|
|
984
|
+
'Struct to provide the owner when the delegate is signer of the transaction.'
|
|
985
|
+
];
|
|
853
986
|
type: {
|
|
854
987
|
kind: 'struct';
|
|
855
988
|
fields: [
|
|
@@ -859,7 +992,15 @@ type LightCompressedToken = {
|
|
|
859
992
|
},
|
|
860
993
|
{
|
|
861
994
|
name: 'delegateChangeAccountIndex';
|
|
862
|
-
|
|
995
|
+
docs: [
|
|
996
|
+
'Index of change compressed account in output compressed accounts. In',
|
|
997
|
+
"case that the delegate didn't spend the complete delegated compressed",
|
|
998
|
+
'account balance the change compressed account will be delegated to her',
|
|
999
|
+
'as well.'
|
|
1000
|
+
];
|
|
1001
|
+
type: {
|
|
1002
|
+
option: 'u8';
|
|
1003
|
+
};
|
|
863
1004
|
}
|
|
864
1005
|
];
|
|
865
1006
|
};
|
|
@@ -894,6 +1035,15 @@ type LightCompressedToken = {
|
|
|
894
1035
|
type: {
|
|
895
1036
|
option: 'u64';
|
|
896
1037
|
};
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
name: 'tlv';
|
|
1041
|
+
docs: [
|
|
1042
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
1043
|
+
];
|
|
1044
|
+
type: {
|
|
1045
|
+
option: 'bytes';
|
|
1046
|
+
};
|
|
897
1047
|
}
|
|
898
1048
|
];
|
|
899
1049
|
};
|
|
@@ -1155,6 +1305,18 @@ type LightCompressedToken = {
|
|
|
1155
1305
|
{
|
|
1156
1306
|
name: 'leafIndex';
|
|
1157
1307
|
type: 'u32';
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
name: 'queueIndex';
|
|
1311
|
+
docs: [
|
|
1312
|
+
'Index of leaf in queue. Placeholder of batched Merkle tree updates',
|
|
1313
|
+
'currently unimplemented.'
|
|
1314
|
+
];
|
|
1315
|
+
type: {
|
|
1316
|
+
option: {
|
|
1317
|
+
defined: 'QueueIndex';
|
|
1318
|
+
};
|
|
1319
|
+
};
|
|
1158
1320
|
}
|
|
1159
1321
|
];
|
|
1160
1322
|
};
|
|
@@ -1181,6 +1343,15 @@ type LightCompressedToken = {
|
|
|
1181
1343
|
{
|
|
1182
1344
|
name: 'merkleTreeIndex';
|
|
1183
1345
|
type: 'u8';
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
name: 'tlv';
|
|
1349
|
+
docs: [
|
|
1350
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
1351
|
+
];
|
|
1352
|
+
type: {
|
|
1353
|
+
option: 'bytes';
|
|
1354
|
+
};
|
|
1184
1355
|
}
|
|
1185
1356
|
];
|
|
1186
1357
|
};
|
|
@@ -1259,6 +1430,24 @@ type LightCompressedToken = {
|
|
|
1259
1430
|
];
|
|
1260
1431
|
};
|
|
1261
1432
|
},
|
|
1433
|
+
{
|
|
1434
|
+
name: 'QueueIndex';
|
|
1435
|
+
type: {
|
|
1436
|
+
kind: 'struct';
|
|
1437
|
+
fields: [
|
|
1438
|
+
{
|
|
1439
|
+
name: 'queueId';
|
|
1440
|
+
docs: ['Id of queue in queue account.'];
|
|
1441
|
+
type: 'u8';
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
name: 'index';
|
|
1445
|
+
docs: ['Index of compressed account hash in queue.'];
|
|
1446
|
+
type: 'u16';
|
|
1447
|
+
}
|
|
1448
|
+
];
|
|
1449
|
+
};
|
|
1450
|
+
},
|
|
1262
1451
|
{
|
|
1263
1452
|
name: 'RolloverMetadata';
|
|
1264
1453
|
type: {
|
|
@@ -1344,6 +1533,15 @@ type LightCompressedToken = {
|
|
|
1344
1533
|
type: {
|
|
1345
1534
|
defined: 'AccountState';
|
|
1346
1535
|
};
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
name: 'tlv';
|
|
1539
|
+
docs: [
|
|
1540
|
+
'Placeholder for TokenExtension tlv data (unimplemented)'
|
|
1541
|
+
];
|
|
1542
|
+
type: {
|
|
1543
|
+
option: 'bytes';
|
|
1544
|
+
};
|
|
1347
1545
|
}
|
|
1348
1546
|
];
|
|
1349
1547
|
};
|
|
@@ -1352,108 +1550,23 @@ type LightCompressedToken = {
|
|
|
1352
1550
|
errors: [
|
|
1353
1551
|
{
|
|
1354
1552
|
code: 6000;
|
|
1355
|
-
name: '
|
|
1356
|
-
msg: '
|
|
1553
|
+
name: 'SignerCheckFailed';
|
|
1554
|
+
msg: 'Signer check failed';
|
|
1357
1555
|
},
|
|
1358
1556
|
{
|
|
1359
1557
|
code: 6001;
|
|
1360
|
-
name: '
|
|
1361
|
-
msg: '
|
|
1558
|
+
name: 'CreateTransferInstructionFailed';
|
|
1559
|
+
msg: 'Create transfer instruction failed';
|
|
1362
1560
|
},
|
|
1363
1561
|
{
|
|
1364
1562
|
code: 6002;
|
|
1365
|
-
name: '
|
|
1366
|
-
msg: '
|
|
1563
|
+
name: 'AccountNotFound';
|
|
1564
|
+
msg: 'Account not found';
|
|
1367
1565
|
},
|
|
1368
1566
|
{
|
|
1369
1567
|
code: 6003;
|
|
1370
|
-
name: '
|
|
1371
|
-
msg: '
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
code: 6004;
|
|
1375
|
-
name: 'ComputeCompressSumFailed';
|
|
1376
|
-
msg: 'ComputeCompressSumFailed';
|
|
1377
|
-
},
|
|
1378
|
-
{
|
|
1379
|
-
code: 6005;
|
|
1380
|
-
name: 'ComputeDecompressSumFailed';
|
|
1381
|
-
msg: 'ComputeDecompressSumFailed';
|
|
1382
|
-
},
|
|
1383
|
-
{
|
|
1384
|
-
code: 6006;
|
|
1385
|
-
name: 'SumCheckFailed';
|
|
1386
|
-
msg: 'SumCheckFailed';
|
|
1387
|
-
},
|
|
1388
|
-
{
|
|
1389
|
-
code: 6007;
|
|
1390
|
-
name: 'DecompressRecipientUndefinedForDecompress';
|
|
1391
|
-
msg: 'DecompressRecipientUndefinedForDecompress';
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
code: 6008;
|
|
1395
|
-
name: 'CompressedPdaUndefinedForDecompress';
|
|
1396
|
-
msg: 'CompressedPdaUndefinedForDecompress';
|
|
1397
|
-
},
|
|
1398
|
-
{
|
|
1399
|
-
code: 6009;
|
|
1400
|
-
name: 'DeCompressAmountUndefinedForDecompress';
|
|
1401
|
-
msg: 'DeCompressAmountUndefinedForDecompress';
|
|
1402
|
-
},
|
|
1403
|
-
{
|
|
1404
|
-
code: 6010;
|
|
1405
|
-
name: 'CompressedPdaUndefinedForCompress';
|
|
1406
|
-
msg: 'CompressedPdaUndefinedForCompress';
|
|
1407
|
-
},
|
|
1408
|
-
{
|
|
1409
|
-
code: 6011;
|
|
1410
|
-
name: 'DeCompressAmountUndefinedForCompress';
|
|
1411
|
-
msg: 'DeCompressAmountUndefinedForCompress';
|
|
1412
|
-
},
|
|
1413
|
-
{
|
|
1414
|
-
code: 6012;
|
|
1415
|
-
name: 'DelegateUndefined';
|
|
1416
|
-
msg: 'DelegateUndefined while delegated amount is defined';
|
|
1417
|
-
},
|
|
1418
|
-
{
|
|
1419
|
-
code: 6013;
|
|
1420
|
-
name: 'DelegateSignerCheckFailed';
|
|
1421
|
-
msg: 'DelegateSignerCheckFailed';
|
|
1422
|
-
},
|
|
1423
|
-
{
|
|
1424
|
-
code: 6014;
|
|
1425
|
-
name: 'SplTokenSupplyMismatch';
|
|
1426
|
-
msg: 'SplTokenSupplyMismatch';
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
code: 6015;
|
|
1430
|
-
name: 'HeapMemoryCheckFailed';
|
|
1431
|
-
msg: 'HeapMemoryCheckFailed';
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
code: 6016;
|
|
1435
|
-
name: 'InstructionNotCallable';
|
|
1436
|
-
msg: 'The instruction is not callable';
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
code: 6017;
|
|
1440
|
-
name: 'ArithmeticUnderflow';
|
|
1441
|
-
msg: 'ArithmeticUnderflow';
|
|
1442
|
-
},
|
|
1443
|
-
{
|
|
1444
|
-
code: 6018;
|
|
1445
|
-
name: 'InvalidDelegate';
|
|
1446
|
-
msg: 'InvalidDelegate';
|
|
1447
|
-
},
|
|
1448
|
-
{
|
|
1449
|
-
code: 6019;
|
|
1450
|
-
name: 'HashToFieldError';
|
|
1451
|
-
msg: 'HashToFieldError';
|
|
1452
|
-
},
|
|
1453
|
-
{
|
|
1454
|
-
code: 6020;
|
|
1455
|
-
name: 'InvalidMint';
|
|
1456
|
-
msg: 'InvalidMint';
|
|
1568
|
+
name: 'SerializationError';
|
|
1569
|
+
msg: 'Serialization error';
|
|
1457
1570
|
}
|
|
1458
1571
|
];
|
|
1459
1572
|
};
|
|
@@ -1472,6 +1585,10 @@ type TokenTransferOutputData = {
|
|
|
1472
1585
|
* lamports associated with the output token account
|
|
1473
1586
|
*/
|
|
1474
1587
|
lamports: BN | null;
|
|
1588
|
+
/**
|
|
1589
|
+
* TokenExtension tlv
|
|
1590
|
+
*/
|
|
1591
|
+
tlv: Buffer | null;
|
|
1475
1592
|
};
|
|
1476
1593
|
type PackedTokenTransferOutputData = {
|
|
1477
1594
|
/**
|
|
@@ -1490,6 +1607,10 @@ type PackedTokenTransferOutputData = {
|
|
|
1490
1607
|
* Merkle tree pubkey index in remaining accounts
|
|
1491
1608
|
*/
|
|
1492
1609
|
merkleTreeIndex: number;
|
|
1610
|
+
/**
|
|
1611
|
+
* TokenExtension tlv
|
|
1612
|
+
*/
|
|
1613
|
+
tlv: Buffer | null;
|
|
1493
1614
|
};
|
|
1494
1615
|
type InputTokenDataWithContext = {
|
|
1495
1616
|
/**
|
|
@@ -1516,6 +1637,10 @@ type InputTokenDataWithContext = {
|
|
|
1516
1637
|
* Lamports in the input token account.
|
|
1517
1638
|
*/
|
|
1518
1639
|
lamports: BN | null;
|
|
1640
|
+
/**
|
|
1641
|
+
* TokenExtension tlv
|
|
1642
|
+
*/
|
|
1643
|
+
tlv: Buffer | null;
|
|
1519
1644
|
};
|
|
1520
1645
|
type CompressedTokenInstructionDataInvoke = {
|
|
1521
1646
|
/**
|
|
@@ -1548,6 +1673,10 @@ type CompressedTokenInstructionDataInvoke = {
|
|
|
1548
1673
|
* accounts'
|
|
1549
1674
|
*/
|
|
1550
1675
|
outputStateMerkleTreeAccountIndices: Buffer;
|
|
1676
|
+
/**
|
|
1677
|
+
* The index of the Merkle tree for a lamport change account.
|
|
1678
|
+
*/
|
|
1679
|
+
lamportsChangeAccountMerkleTreeIndex: number | null;
|
|
1551
1680
|
};
|
|
1552
1681
|
type TokenData = {
|
|
1553
1682
|
/**
|
|
@@ -1571,6 +1700,10 @@ type TokenData = {
|
|
|
1571
1700
|
* The account's state
|
|
1572
1701
|
*/
|
|
1573
1702
|
state: number;
|
|
1703
|
+
/**
|
|
1704
|
+
* TokenExtension tlv
|
|
1705
|
+
*/
|
|
1706
|
+
tlv: Buffer | null;
|
|
1574
1707
|
};
|
|
1575
1708
|
|
|
1576
1709
|
type PackCompressedTokenAccountsParams = {
|
|
@@ -1882,10 +2015,10 @@ declare class CompressedTokenProgram {
|
|
|
1882
2015
|
*/
|
|
1883
2016
|
static transfer(params: TransferParams): Promise<TransactionInstruction>;
|
|
1884
2017
|
/**
|
|
1885
|
-
* Construct
|
|
1886
|
-
* @returns
|
|
2018
|
+
* Construct compress instruction
|
|
2019
|
+
* @returns compressInstruction
|
|
1887
2020
|
*/
|
|
1888
|
-
static compress(params: CompressParams): Promise<TransactionInstruction
|
|
2021
|
+
static compress(params: CompressParams): Promise<TransactionInstruction>;
|
|
1889
2022
|
/**
|
|
1890
2023
|
* Construct decompress instruction
|
|
1891
2024
|
*/
|