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

TypeError: Cannot use 'in' operator to search for 'asset' in undefined : seaport.js

Open koinfox opened this issue 4 years ago • 6 comments

Facing the below issue while trying to call the fulfillOrder method of the Opensea sdk

opensea-js version 2.0.2

ERROR Error: Uncaught (in promise): TypeError: Cannot use 'in' operator to search for 'asset' in undefined TypeError: Cannot use 'in' operator to search for 'asset' in undefined at computeOrderParams (seaport.js:2615:1) at push.i51y.OpenSeaPort._makeMatchingOrder (seaport.js:2643:1) at OpenSeaPort.<anonymous> (seaport.js:951:1) at step (seaport.js:63:1) at Object.next (seaport.js:44:45) at seaport.js:38:1 at new ZoneAwarePromise (zone-evergreen.js:1387:1) at push.i51y.__awaiter (seaport.js:34:1) at push.i51y.OpenSeaPort.fulfillOrder (seaport.js:945:1)

const txnHash = await this.seaport_Client.fulfillOrder({ order: order, accountAddress: user });

Help would be appreciated. Thanks.

koinfox avatar Jun 13 '22 11:06 koinfox

@koinfox Can you upgrade to Version 3.0.4 and retest?

itsthedoom avatar Jun 13 '22 22:06 itsthedoom

Hi @itsthedoom ,

I have tried using the latest version, but I am working with node js version 12.16.1 and angular version 11.2.14 and version 3.0.4 is not supporting on these configurations Hence, cannot upgrade.

koinfox avatar Jun 14 '22 04:06 koinfox

@koinfox We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Execute nvm use, if you have Node Version Manager.

Please review the documentation to help get you up and running.

itsthedoom avatar Jun 14 '22 16:06 itsthedoom

Hi @itsthedoom

I got it fixed in version 2.0.2 also.

In the below code, const txnHash = await this.seaport_Client.fulfillOrder({ order: order, accountAddress: user });

order was undefined.

actual code to get order was const order = await openseaSDK.api.getOrder({ side: OrderSide.Sell, ... }) while I was using const { order, count } = await openseaSDK.api.getOrder({ side: OrderSide.Sell, ... })

That was the reason. Thanks for the help!

Though now I am facing another issue at next level. Uncaught (in promise): Error: Failed to validate buy order parameters. Make sure you're on the right network!

Please help me in this issue.

koinfox avatar Jun 15 '22 05:06 koinfox

@koinfox When I run the npm test I see that all the tests are passing, Can you share more info on the buy order you're validating?

Also, I would recommend joining our Discord where active members of the community are online and can help troubleshoot in realtime https://discord.gg/opensea

itsthedoom avatar Jun 15 '22 16:06 itsthedoom

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

github-actions[bot] avatar May 24 '23 04:05 github-actions[bot]