opensea-js
opensea-js copied to clipboard
TypeError: Cannot read property 'toLowerCase' of undefined
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?
Solved. Needed to add key/values on the asset:
asset: {
tokenAddress: asset_contract_address,
tokenId: token_id,
},