@lightprotocol/stateless.js 0.15.1 → 0.15.3
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 +111 -2
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +111 -2
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +107 -3
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +138 -5
- package/package.json +1 -1
|
@@ -10338,6 +10338,106 @@ const IDL = {
|
|
|
10338
10338
|
},
|
|
10339
10339
|
],
|
|
10340
10340
|
},
|
|
10341
|
+
{
|
|
10342
|
+
name: 'compressSplTokenAccount',
|
|
10343
|
+
accounts: [
|
|
10344
|
+
{
|
|
10345
|
+
name: 'feePayer',
|
|
10346
|
+
isMut: true,
|
|
10347
|
+
isSigner: true,
|
|
10348
|
+
docs: ['UNCHECKED: only pays fees.'],
|
|
10349
|
+
},
|
|
10350
|
+
{
|
|
10351
|
+
name: 'authority',
|
|
10352
|
+
isMut: false,
|
|
10353
|
+
isSigner: true,
|
|
10354
|
+
docs: [
|
|
10355
|
+
'Authority is verified through proof since both owner and delegate',
|
|
10356
|
+
'are included in the token data hash, which is a public input to the',
|
|
10357
|
+
'validity proof.',
|
|
10358
|
+
],
|
|
10359
|
+
},
|
|
10360
|
+
{
|
|
10361
|
+
name: 'cpiAuthorityPda',
|
|
10362
|
+
isMut: false,
|
|
10363
|
+
isSigner: false,
|
|
10364
|
+
},
|
|
10365
|
+
{
|
|
10366
|
+
name: 'lightSystemProgram',
|
|
10367
|
+
isMut: false,
|
|
10368
|
+
isSigner: false,
|
|
10369
|
+
},
|
|
10370
|
+
{
|
|
10371
|
+
name: 'registeredProgramPda',
|
|
10372
|
+
isMut: false,
|
|
10373
|
+
isSigner: false,
|
|
10374
|
+
},
|
|
10375
|
+
{
|
|
10376
|
+
name: 'noopProgram',
|
|
10377
|
+
isMut: false,
|
|
10378
|
+
isSigner: false,
|
|
10379
|
+
},
|
|
10380
|
+
{
|
|
10381
|
+
name: 'accountCompressionAuthority',
|
|
10382
|
+
isMut: false,
|
|
10383
|
+
isSigner: false,
|
|
10384
|
+
},
|
|
10385
|
+
{
|
|
10386
|
+
name: 'accountCompressionProgram',
|
|
10387
|
+
isMut: false,
|
|
10388
|
+
isSigner: false,
|
|
10389
|
+
},
|
|
10390
|
+
{
|
|
10391
|
+
name: 'selfProgram',
|
|
10392
|
+
isMut: false,
|
|
10393
|
+
isSigner: false,
|
|
10394
|
+
docs: ['this program is the signer of the cpi.'],
|
|
10395
|
+
},
|
|
10396
|
+
{
|
|
10397
|
+
name: 'tokenPoolPda',
|
|
10398
|
+
isMut: true,
|
|
10399
|
+
isSigner: false,
|
|
10400
|
+
isOptional: true,
|
|
10401
|
+
},
|
|
10402
|
+
{
|
|
10403
|
+
name: 'compressOrDecompressTokenAccount',
|
|
10404
|
+
isMut: true,
|
|
10405
|
+
isSigner: false,
|
|
10406
|
+
isOptional: true,
|
|
10407
|
+
},
|
|
10408
|
+
{
|
|
10409
|
+
name: 'tokenProgram',
|
|
10410
|
+
isMut: false,
|
|
10411
|
+
isSigner: false,
|
|
10412
|
+
isOptional: true,
|
|
10413
|
+
},
|
|
10414
|
+
{
|
|
10415
|
+
name: 'systemProgram',
|
|
10416
|
+
isMut: false,
|
|
10417
|
+
isSigner: false,
|
|
10418
|
+
},
|
|
10419
|
+
],
|
|
10420
|
+
args: [
|
|
10421
|
+
{
|
|
10422
|
+
name: 'owner',
|
|
10423
|
+
type: 'publicKey',
|
|
10424
|
+
},
|
|
10425
|
+
{
|
|
10426
|
+
name: 'remainingAmount',
|
|
10427
|
+
type: {
|
|
10428
|
+
option: 'u64',
|
|
10429
|
+
},
|
|
10430
|
+
},
|
|
10431
|
+
{
|
|
10432
|
+
name: 'cpiContext',
|
|
10433
|
+
type: {
|
|
10434
|
+
option: {
|
|
10435
|
+
defined: 'CompressedCpiContext',
|
|
10436
|
+
},
|
|
10437
|
+
},
|
|
10438
|
+
},
|
|
10439
|
+
],
|
|
10440
|
+
},
|
|
10341
10441
|
{
|
|
10342
10442
|
name: 'transfer',
|
|
10343
10443
|
docs: [
|
|
@@ -12615,7 +12715,7 @@ async function getCompressedTokenAccountsByOwnerOrDelegate(rpc, ownerOrDelegate,
|
|
|
12615
12715
|
var _a;
|
|
12616
12716
|
const _account = item.account;
|
|
12617
12717
|
const _tokenData = item.tokenData;
|
|
12618
|
-
const compressedAccount = createCompressedAccountWithMerkleContext(createMerkleContext(_account.tree, mockNullifierQueue, _account.hash.toArray('be', 32), _account.leafIndex),
|
|
12718
|
+
const compressedAccount = createCompressedAccountWithMerkleContext(createMerkleContext(_account.tree, mockNullifierQueue, _account.hash.toArray('be', 32), _account.leafIndex), _account.owner, bn(_account.lamports), _account.data ? parseAccountData(_account.data) : undefined, _account.address || undefined);
|
|
12619
12719
|
const parsed = {
|
|
12620
12720
|
mint: _tokenData.mint,
|
|
12621
12721
|
owner: _tokenData.owner,
|
|
@@ -16852,7 +16952,11 @@ async function getCompressedAccountsForTest(rpc) {
|
|
|
16852
16952
|
const tokenProgramId = new web3_js.PublicKey(
|
|
16853
16953
|
// TODO: can add check to ensure its consistent with the idl
|
|
16854
16954
|
'cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m');
|
|
16855
|
-
/**
|
|
16955
|
+
/**
|
|
16956
|
+
* Manually parse the compressed token layout for a given compressed account.
|
|
16957
|
+
* @param compressedAccount - The compressed account
|
|
16958
|
+
* @returns The parsed token data
|
|
16959
|
+
*/
|
|
16856
16960
|
function parseTokenLayoutWithIdl(compressedAccount) {
|
|
16857
16961
|
if (compressedAccount.data === null)
|
|
16858
16962
|
return null;
|
|
@@ -17526,6 +17630,10 @@ exports.deriveAddress = deriveAddress;
|
|
|
17526
17630
|
exports.deriveAddressSeed = deriveAddressSeed;
|
|
17527
17631
|
exports.encodeBN254toBase58 = encodeBN254toBase58;
|
|
17528
17632
|
exports.getAccountCompressionAuthority = getAccountCompressionAuthority;
|
|
17633
|
+
exports.getCompressedTokenAccountByHashTest = getCompressedTokenAccountByHashTest;
|
|
17634
|
+
exports.getCompressedTokenAccounts = getCompressedTokenAccounts;
|
|
17635
|
+
exports.getCompressedTokenAccountsByDelegateTest = getCompressedTokenAccountsByDelegateTest;
|
|
17636
|
+
exports.getCompressedTokenAccountsByOwnerTest = getCompressedTokenAccountsByOwnerTest;
|
|
17529
17637
|
exports.getConnection = getConnection;
|
|
17530
17638
|
exports.getIndexOrAdd = getIndexOrAdd;
|
|
17531
17639
|
exports.getParsedEvents = getParsedEvents;
|
|
@@ -17548,6 +17656,7 @@ exports.padOutputStateMerkleTrees = padOutputStateMerkleTrees;
|
|
|
17548
17656
|
exports.parseAccountData = parseAccountData;
|
|
17549
17657
|
exports.parseEvents = parseEvents;
|
|
17550
17658
|
exports.parsePublicTransactionEventWithIdl = parsePublicTransactionEventWithIdl;
|
|
17659
|
+
exports.parseTokenLayoutWithIdl = parseTokenLayoutWithIdl;
|
|
17551
17660
|
exports.pipe = pipe;
|
|
17552
17661
|
exports.placeholderValidityProof = placeholderValidityProof;
|
|
17553
17662
|
exports.proofFromJsonStruct = proofFromJsonStruct;
|