question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: API Error 400: You must approve assets #0 for trading before creating an order

See original GitHub issue

Hello, I use a new address. I want to use SDK to make offer for an asset. This error occurred when calling createBuyOrder. I guess it should be that I didn’t approve WETH to the Opensea contract.

API Error 400: You must approve assets #0 for trading before creating an order

I traced this problem and found that the executeAllActions method in the @opensea/seaport-js library uses the for () code, and the approve contract call of wet and the createOrder API call at the same time, but createOrder API validate the WETH is approved. So i think we should use for…of or for await to execute the approve first, and then execute the createOrder API call after success. Please confirm whether there is this problem? thx.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
Novenqingtangcommented, Jul 27, 2022

@Praveen-47 Maybe, you can validate the approve and send approve tx before invoke opensea-sdk.

1reaction
Novenqingtangcommented, Jul 27, 2022

@Praveen-47 It’s the problem of @opensea/seaport-js, it just await tx sending to node, but it not await the tx be included.

https://github.com/ProjectOpenSea/seaport-js/blob/main/src/utils/usecase.ts

image
Read more comments on GitHub >

github_iconTop Results From Across the Web

API Error 400 : r/opensea - Reddit
Full error message reads: API Error 400: ["Trading is not enabled for AssetContract(id=92, chain_identifier=ethereum, name=SuperRare, address= ...
Read more >
Listing NFT on OpenSea via JS API: Failed to extract transfer ...
You can find Token Standard in Details tab, on Opensea asset page : Failed to extract transfer calldata Error 400.
Read more >
Errors by Number - eBay Developers Program
Error number Severity Description 335 Serious Error 12311 Warning Short error: TUV Error Long error: TUV Error
Read more >
Tradier - Errors | Brokerage API Documentation
In this case, if you receive a 400 response, you can check the body of the response and find an error message that...
Read more >
TWS API v9.72+: Message Codes
Code TWS message Additional notes 106 Can't transmit order ID: 107 Cannot transmit incomplete order. Order is missing a required field. 114 Relative orders are valid...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found