@lightprotocol/stateless.js 0.15.2 → 0.15.4

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.
@@ -17007,14 +17007,18 @@ async function getCompressedAccountsForTest(rpc) {
17007
17007
  const tokenProgramId = new PublicKey(
17008
17008
  // TODO: can add check to ensure its consistent with the idl
17009
17009
  'cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m');
17010
- /** @internal */
17011
- function parseTokenLayoutWithIdl(compressedAccount) {
17010
+ /**
17011
+ * Manually parse the compressed token layout for a given compressed account.
17012
+ * @param compressedAccount - The compressed account
17013
+ * @returns The parsed token data
17014
+ */
17015
+ function parseTokenLayoutWithIdl(compressedAccount, programId = tokenProgramId) {
17012
17016
  if (compressedAccount.data === null)
17013
17017
  return null;
17014
17018
  const { data } = compressedAccount.data;
17015
17019
  if (data.length === 0)
17016
17020
  return null;
17017
- if (compressedAccount.owner.toBase58() !== tokenProgramId.toBase58()) {
17021
+ if (compressedAccount.owner.toBase58() !== programId.toBase58()) {
17018
17022
  throw new Error(`Invalid owner ${compressedAccount.owner.toBase58()} for token layout`);
17019
17023
  }
17020
17024
  const decodedLayout = new BorshCoder(IDL).types.decode('TokenData', Buffer.from(data));
@@ -17592,5 +17596,5 @@ class TestRpc extends Connection {
17592
17596
  }
17593
17597
  }
17594
17598
 
17595
- export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, IDL$2 as AccountCompressionIDL, AccountProofResult, BOB, BalanceResult, CHARLIE, CompressedAccountResult, CompressedAccountsByOwnerResult, CompressedMintTokenHoldersResult, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, CompressedTransactionResult, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, FIELD_SIZE, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, HealthResult, IndexedArray, IndexedElement, IndexedElementBundle, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, IDL as LightCompressedTokenIDL, IDL$1 as LightRegistryIDL, IDL$3 as LightSystemIDL, LightSystemProgram, LookupTableError, LookupTableErrorCode, MerkeProofResult, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, NewAddressProofResult, ProofError, ProofErrorCode, Rpc, RpcError, RpcErrorCode, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, SlotResult, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, TokenDataResult, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decompress, dedupeSigner, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, deriveAddressSeed, encodeBN254toBase58, getAccountCompressionAuthority, getConnection, getIndexOrAdd, getParsedEvents, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray$1 as toArray, toCamelCase, toHex, toUnixTimestamp, transfer, useWallet, validateSameOwner, validateSufficientBalance };
17599
+ export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, IDL$2 as AccountCompressionIDL, AccountProofResult, BOB, BalanceResult, CHARLIE, CompressedAccountResult, CompressedAccountsByOwnerResult, CompressedMintTokenHoldersResult, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, CompressedTransactionResult, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, FIELD_SIZE, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, HealthResult, IndexedArray, IndexedElement, IndexedElementBundle, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, IDL as LightCompressedTokenIDL, IDL$1 as LightRegistryIDL, IDL$3 as LightSystemIDL, LightSystemProgram, LookupTableError, LookupTableErrorCode, MerkeProofResult, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, NewAddressProofResult, ProofError, ProofErrorCode, Rpc, RpcError, RpcErrorCode, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, SlotResult, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, TokenDataResult, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decompress, dedupeSigner, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, deriveAddressSeed, encodeBN254toBase58, getAccountCompressionAuthority, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getIndexOrAdd, getParsedEvents, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray$1 as toArray, toCamelCase, toHex, toUnixTimestamp, transfer, useWallet, validateSameOwner, validateSufficientBalance };
17596
17600
  //# sourceMappingURL=index.js.map