@lightprotocol/stateless.js 0.15.3 → 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.
@@ -16957,13 +16957,13 @@ const tokenProgramId = new web3_js.PublicKey(
16957
16957
  * @param compressedAccount - The compressed account
16958
16958
  * @returns The parsed token data
16959
16959
  */
16960
- function parseTokenLayoutWithIdl(compressedAccount) {
16960
+ function parseTokenLayoutWithIdl(compressedAccount, programId = tokenProgramId) {
16961
16961
  if (compressedAccount.data === null)
16962
16962
  return null;
16963
16963
  const { data } = compressedAccount.data;
16964
16964
  if (data.length === 0)
16965
16965
  return null;
16966
- if (compressedAccount.owner.toBase58() !== tokenProgramId.toBase58()) {
16966
+ if (compressedAccount.owner.toBase58() !== programId.toBase58()) {
16967
16967
  throw new Error(`Invalid owner ${compressedAccount.owner.toBase58()} for token layout`);
16968
16968
  }
16969
16969
  const decodedLayout = new anchor.BorshCoder(IDL).types.decode('TokenData', Buffer.from(data));