@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.
@@ -8308,6 +8308,106 @@ const IDL = {
8308
8308
  },
8309
8309
  ],
8310
8310
  },
8311
+ {
8312
+ name: 'compressSplTokenAccount',
8313
+ accounts: [
8314
+ {
8315
+ name: 'feePayer',
8316
+ isMut: true,
8317
+ isSigner: true,
8318
+ docs: ['UNCHECKED: only pays fees.'],
8319
+ },
8320
+ {
8321
+ name: 'authority',
8322
+ isMut: false,
8323
+ isSigner: true,
8324
+ docs: [
8325
+ 'Authority is verified through proof since both owner and delegate',
8326
+ 'are included in the token data hash, which is a public input to the',
8327
+ 'validity proof.',
8328
+ ],
8329
+ },
8330
+ {
8331
+ name: 'cpiAuthorityPda',
8332
+ isMut: false,
8333
+ isSigner: false,
8334
+ },
8335
+ {
8336
+ name: 'lightSystemProgram',
8337
+ isMut: false,
8338
+ isSigner: false,
8339
+ },
8340
+ {
8341
+ name: 'registeredProgramPda',
8342
+ isMut: false,
8343
+ isSigner: false,
8344
+ },
8345
+ {
8346
+ name: 'noopProgram',
8347
+ isMut: false,
8348
+ isSigner: false,
8349
+ },
8350
+ {
8351
+ name: 'accountCompressionAuthority',
8352
+ isMut: false,
8353
+ isSigner: false,
8354
+ },
8355
+ {
8356
+ name: 'accountCompressionProgram',
8357
+ isMut: false,
8358
+ isSigner: false,
8359
+ },
8360
+ {
8361
+ name: 'selfProgram',
8362
+ isMut: false,
8363
+ isSigner: false,
8364
+ docs: ['this program is the signer of the cpi.'],
8365
+ },
8366
+ {
8367
+ name: 'tokenPoolPda',
8368
+ isMut: true,
8369
+ isSigner: false,
8370
+ isOptional: true,
8371
+ },
8372
+ {
8373
+ name: 'compressOrDecompressTokenAccount',
8374
+ isMut: true,
8375
+ isSigner: false,
8376
+ isOptional: true,
8377
+ },
8378
+ {
8379
+ name: 'tokenProgram',
8380
+ isMut: false,
8381
+ isSigner: false,
8382
+ isOptional: true,
8383
+ },
8384
+ {
8385
+ name: 'systemProgram',
8386
+ isMut: false,
8387
+ isSigner: false,
8388
+ },
8389
+ ],
8390
+ args: [
8391
+ {
8392
+ name: 'owner',
8393
+ type: 'publicKey',
8394
+ },
8395
+ {
8396
+ name: 'remainingAmount',
8397
+ type: {
8398
+ option: 'u64',
8399
+ },
8400
+ },
8401
+ {
8402
+ name: 'cpiContext',
8403
+ type: {
8404
+ option: {
8405
+ defined: 'CompressedCpiContext',
8406
+ },
8407
+ },
8408
+ },
8409
+ ],
8410
+ },
8311
8411
  {
8312
8412
  name: 'transfer',
8313
8413
  docs: [
@@ -10585,7 +10685,7 @@ async function getCompressedTokenAccountsByOwnerOrDelegate(rpc, ownerOrDelegate,
10585
10685
  var _a;
10586
10686
  const _account = item.account;
10587
10687
  const _tokenData = item.tokenData;
10588
- const compressedAccount = createCompressedAccountWithMerkleContext(createMerkleContext(_account.tree, mockNullifierQueue, _account.hash.toArray('be', 32), _account.leafIndex), new web3_js.PublicKey('cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m'), bn(_account.lamports), _account.data ? parseAccountData(_account.data) : undefined, _account.address || undefined);
10688
+ 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);
10589
10689
  const parsed = {
10590
10690
  mint: _tokenData.mint,
10591
10691
  owner: _tokenData.owner,
@@ -13872,7 +13972,11 @@ async function getCompressedAccountsForTest(rpc) {
13872
13972
  const tokenProgramId = new web3_js.PublicKey(
13873
13973
  // TODO: can add check to ensure its consistent with the idl
13874
13974
  'cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m');
13875
- /** @internal */
13975
+ /**
13976
+ * Manually parse the compressed token layout for a given compressed account.
13977
+ * @param compressedAccount - The compressed account
13978
+ * @returns The parsed token data
13979
+ */
13876
13980
  function parseTokenLayoutWithIdl(compressedAccount) {
13877
13981
  if (compressedAccount.data === null)
13878
13982
  return null;
@@ -14546,6 +14650,10 @@ exports.deriveAddress = deriveAddress;
14546
14650
  exports.deriveAddressSeed = deriveAddressSeed;
14547
14651
  exports.encodeBN254toBase58 = encodeBN254toBase58;
14548
14652
  exports.getAccountCompressionAuthority = getAccountCompressionAuthority;
14653
+ exports.getCompressedTokenAccountByHashTest = getCompressedTokenAccountByHashTest;
14654
+ exports.getCompressedTokenAccounts = getCompressedTokenAccounts;
14655
+ exports.getCompressedTokenAccountsByDelegateTest = getCompressedTokenAccountsByDelegateTest;
14656
+ exports.getCompressedTokenAccountsByOwnerTest = getCompressedTokenAccountsByOwnerTest;
14549
14657
  exports.getConnection = getConnection;
14550
14658
  exports.getIndexOrAdd = getIndexOrAdd;
14551
14659
  exports.getParsedEvents = getParsedEvents;
@@ -14568,6 +14676,7 @@ exports.padOutputStateMerkleTrees = padOutputStateMerkleTrees;
14568
14676
  exports.parseAccountData = parseAccountData;
14569
14677
  exports.parseEvents = parseEvents;
14570
14678
  exports.parsePublicTransactionEventWithIdl = parsePublicTransactionEventWithIdl;
14679
+ exports.parseTokenLayoutWithIdl = parseTokenLayoutWithIdl;
14571
14680
  exports.pipe = pipe;
14572
14681
  exports.placeholderValidityProof = placeholderValidityProof;
14573
14682
  exports.proofFromJsonStruct = proofFromJsonStruct;