@lightprotocol/compressed-token 0.6.0 → 0.8.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 +48 -26
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +48 -26
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +48 -26
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +46 -24
- package/package.json +9 -14
|
@@ -229,10 +229,7 @@ const IDL = {
|
|
|
229
229
|
name: 'selfProgram',
|
|
230
230
|
isMut: false,
|
|
231
231
|
isSigner: false,
|
|
232
|
-
docs: [
|
|
233
|
-
'(different program) checked in light system program to derive',
|
|
234
|
-
'cpi_authority_pda and check that this program is the signer of the cpi.',
|
|
235
|
-
],
|
|
232
|
+
docs: ['this program is the signer of the cpi.'],
|
|
236
233
|
},
|
|
237
234
|
{
|
|
238
235
|
name: 'tokenPoolPda',
|
|
@@ -326,10 +323,7 @@ const IDL = {
|
|
|
326
323
|
name: 'selfProgram',
|
|
327
324
|
isMut: false,
|
|
328
325
|
isSigner: false,
|
|
329
|
-
docs: [
|
|
330
|
-
'(different program) checked in light system program to derive',
|
|
331
|
-
'cpi_authority_pda and check that this program is the signer of the cpi.',
|
|
332
|
-
],
|
|
326
|
+
docs: ['this program is the signer of the cpi.'],
|
|
333
327
|
},
|
|
334
328
|
{
|
|
335
329
|
name: 'systemProgram',
|
|
@@ -401,10 +395,7 @@ const IDL = {
|
|
|
401
395
|
name: 'selfProgram',
|
|
402
396
|
isMut: false,
|
|
403
397
|
isSigner: false,
|
|
404
|
-
docs: [
|
|
405
|
-
'(different program) checked in light system program to derive',
|
|
406
|
-
'cpi_authority_pda and check that this program is the signer of the cpi.',
|
|
407
|
-
],
|
|
398
|
+
docs: ['this program is the signer of the cpi.'],
|
|
408
399
|
},
|
|
409
400
|
{
|
|
410
401
|
name: 'systemProgram',
|
|
@@ -471,10 +462,7 @@ const IDL = {
|
|
|
471
462
|
name: 'selfProgram',
|
|
472
463
|
isMut: false,
|
|
473
464
|
isSigner: false,
|
|
474
|
-
docs: [
|
|
475
|
-
'(different program) checked in light system program to derive',
|
|
476
|
-
'cpi_authority_pda and check that this program is the signer of the cpi.',
|
|
477
|
-
],
|
|
465
|
+
docs: ['that this program is the signer of the cpi.'],
|
|
478
466
|
},
|
|
479
467
|
{
|
|
480
468
|
name: 'systemProgram',
|
|
@@ -546,10 +534,7 @@ const IDL = {
|
|
|
546
534
|
name: 'selfProgram',
|
|
547
535
|
isMut: false,
|
|
548
536
|
isSigner: false,
|
|
549
|
-
docs: [
|
|
550
|
-
'(different program) checked in light system program to derive',
|
|
551
|
-
'cpi_authority_pda and check that this program is the signer of the cpi.',
|
|
552
|
-
],
|
|
537
|
+
docs: ['that this program is the signer of the cpi.'],
|
|
553
538
|
},
|
|
554
539
|
{
|
|
555
540
|
name: 'systemProgram',
|
|
@@ -714,10 +699,7 @@ const IDL = {
|
|
|
714
699
|
name: 'selfProgram',
|
|
715
700
|
isMut: false,
|
|
716
701
|
isSigner: false,
|
|
717
|
-
docs: [
|
|
718
|
-
'(different program) checked in light system program to derive',
|
|
719
|
-
'cpi_authority_pda and check that this program is the signer of the cpi.',
|
|
720
|
-
],
|
|
702
|
+
docs: ['this program is the signer of the cpi.'],
|
|
721
703
|
},
|
|
722
704
|
{
|
|
723
705
|
name: 'tokenPoolPda',
|
|
@@ -777,6 +759,18 @@ const IDL = {
|
|
|
777
759
|
],
|
|
778
760
|
type: 'publicKey',
|
|
779
761
|
},
|
|
762
|
+
{
|
|
763
|
+
name: 'forester',
|
|
764
|
+
docs: [
|
|
765
|
+
'Optional privileged forester pubkey, can be set for custom Merkle trees',
|
|
766
|
+
'without a network fee. Merkle trees without network fees are not',
|
|
767
|
+
'forested by light foresters. The variable is not used in the account',
|
|
768
|
+
'compression program but the registry program. The registry program',
|
|
769
|
+
'implements access control to prevent contention during forester. The',
|
|
770
|
+
'forester pubkey specified in this struct can bypass contention checks.',
|
|
771
|
+
],
|
|
772
|
+
type: 'publicKey',
|
|
773
|
+
},
|
|
780
774
|
],
|
|
781
775
|
},
|
|
782
776
|
},
|
|
@@ -1288,6 +1282,13 @@ const IDL = {
|
|
|
1288
1282
|
],
|
|
1289
1283
|
type: 'u16',
|
|
1290
1284
|
},
|
|
1285
|
+
{
|
|
1286
|
+
name: 'readOnly',
|
|
1287
|
+
docs: [
|
|
1288
|
+
'Placeholder to mark accounts read-only unimplemented set to false.',
|
|
1289
|
+
],
|
|
1290
|
+
type: 'bool',
|
|
1291
|
+
},
|
|
1291
1292
|
],
|
|
1292
1293
|
},
|
|
1293
1294
|
},
|
|
@@ -1496,6 +1497,14 @@ const IDL = {
|
|
|
1496
1497
|
],
|
|
1497
1498
|
type: 'u64',
|
|
1498
1499
|
},
|
|
1500
|
+
{
|
|
1501
|
+
name: 'additionalBytes',
|
|
1502
|
+
docs: [
|
|
1503
|
+
'Placeholder for bytes of additional accounts which are tied to the',
|
|
1504
|
+
'Merkle trees operation and need to be rolled over as well.',
|
|
1505
|
+
],
|
|
1506
|
+
type: 'u64',
|
|
1507
|
+
},
|
|
1499
1508
|
],
|
|
1500
1509
|
},
|
|
1501
1510
|
},
|
|
@@ -1654,6 +1663,19 @@ const IDL = {
|
|
|
1654
1663
|
code: 6020,
|
|
1655
1664
|
name: 'InvalidDelegateIndex',
|
|
1656
1665
|
},
|
|
1666
|
+
{
|
|
1667
|
+
code: 6021,
|
|
1668
|
+
name: 'TokenPoolPdaUndefined',
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
code: 6022,
|
|
1672
|
+
name: 'IsTokenPoolPda',
|
|
1673
|
+
msg: 'Compress or decompress recipient is the same account as the token pool pda.',
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
code: 6023,
|
|
1677
|
+
name: 'InvalidTokenPoolPda',
|
|
1678
|
+
},
|
|
1657
1679
|
],
|
|
1658
1680
|
};
|
|
1659
1681
|
|
|
@@ -7039,7 +7061,7 @@ merkleTree, confirmOptions) {
|
|
|
7039
7061
|
const compressedTokenAccounts = await rpc.getCompressedTokenAccountsByOwner(owner.publicKey, {
|
|
7040
7062
|
mint,
|
|
7041
7063
|
});
|
|
7042
|
-
const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(compressedTokenAccounts, amount);
|
|
7064
|
+
const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(compressedTokenAccounts.items, amount);
|
|
7043
7065
|
const proof = await rpc.getValidityProof(inputAccounts.map(account => stateless_js.bn(account.compressedAccount.hash)));
|
|
7044
7066
|
const ix = await CompressedTokenProgram.transfer({
|
|
7045
7067
|
payer: payer.publicKey,
|
|
@@ -7111,7 +7133,7 @@ merkleTree, confirmOptions) {
|
|
|
7111
7133
|
mint,
|
|
7112
7134
|
});
|
|
7113
7135
|
/// TODO: consider using a different selection algorithm
|
|
7114
|
-
const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(compressedTokenAccounts, amount);
|
|
7136
|
+
const [inputAccounts] = selectMinCompressedTokenAccountsForTransfer(compressedTokenAccounts.items, amount);
|
|
7115
7137
|
const proof = await rpc.getValidityProof(inputAccounts.map(account => stateless_js.bn(account.compressedAccount.hash)));
|
|
7116
7138
|
const ix = await CompressedTokenProgram.decompress({
|
|
7117
7139
|
payer: payer.publicKey,
|