@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.
@@ -13977,13 +13977,13 @@ const tokenProgramId = new web3_js.PublicKey(
13977
13977
  * @param compressedAccount - The compressed account
13978
13978
  * @returns The parsed token data
13979
13979
  */
13980
- function parseTokenLayoutWithIdl(compressedAccount) {
13980
+ function parseTokenLayoutWithIdl(compressedAccount, programId = tokenProgramId) {
13981
13981
  if (compressedAccount.data === null)
13982
13982
  return null;
13983
13983
  const { data } = compressedAccount.data;
13984
13984
  if (data.length === 0)
13985
13985
  return null;
13986
- if (compressedAccount.owner.toBase58() !== tokenProgramId.toBase58()) {
13986
+ if (compressedAccount.owner.toBase58() !== programId.toBase58()) {
13987
13987
  throw new Error(`Invalid owner ${compressedAccount.owner.toBase58()} for token layout`);
13988
13988
  }
13989
13989
  const decodedLayout = new anchor.BorshCoder(IDL).types.decode('TokenData', Buffer.from(data));