opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

TypeError: Cannot read property 'toLowerCase' of undefined

Open ebertbm opened this issue 4 years ago • 1 comments

I'm getting the error:

TypeError: Cannot read property 'toLowerCase' of undefined at Object.getWyvernAsset (/home/ebertbm/web3Projects/opensea_api/javascript/opensea-sniper-bot/node_modules/opensea-js/src/utils/utils.ts:785:35)

I'm testing this function on testnets.opensea.io.

try {
  const offer = await seaport.createBuyOrder({
    asset: {
      token_id,
      asset_contract_address
    },
    accountAddress,
    // Value of the offer, in units of the payment token (or wrapped ETH if none is specified):
    startAmount: 0.1,
  })
  console.log(offer);
} catch(err) { 
  console.log(err);
}

Any idea why is this issue happening?

ebertbm avatar Jan 26 '22 21:01 ebertbm

Solved. Needed to add key/values on the asset:

    asset: {
      tokenAddress: asset_contract_address,
      tokenId: token_id,
    },

ebertbm avatar Jan 26 '22 22:01 ebertbm