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.

createSellOrder() 429s

See original GitHub issue

Tried to do the following with:

  1. HD Truffle Wallet Provider
  2. The mnemonicWalletSubprovier + infuraRpcSubprovider as shown in examples.

const expirationTime = Math.round(Date.now() / 1000 + 3600)

  const listing = await seaport.createSellOrder({
    asset: asset,
    accountAddress: OWNER_ADDRESS,
    startAmount: .3,
    // If `endAmount` is specified, the order will decline in value to that amount until `expirationTime`. Otherwise, it's a fixed-price order:
    endAmount: 0.1,
    expirationTime:expirationTime
  }).catch( (err) => {
    console.log(err)
  })
  console.log(listing)

Just returns 429. This call allows me to approve the token on my wallet. But it doesn’t allow me to actually create the sell order, rendering it useless.

Error: API Error 429: Message: {"detail":"Request was throttled."}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

7reactions
avm70commented, Oct 3, 2021

Opensea API throttle part of requests. To prevent API from being overwhelmed by too many requests.

1reaction
azvastcommented, Oct 8, 2021

I also faced same error in createBuyOrder function call, so I fixed that with 1 min 20 s delay when I got the error.

My script in NodeJS.

const delay = t => new Promise(s => setTimeout(s, t * 1000));

const creatBuyOrder = async (tokenId, tokenAddress, reAuctionPrice, schemaName = "ERC721") => {
  try {
    const offer = await seaport.createBuyOrder({
      asset: {
        tokenId,
        tokenAddress,
        schemaName: schemaName
      },
      accountAddress: WALLET_ADDRESS,
      startAmount: reAuctionPrice / (10 ** 18),
      expirationTime: Math.round(Date.now() / 1000 + 60 * 60 * 24) // One day
    });
  
    console.log(chalk.yellow(`Your new auction was made successfully on ${tokenAddress}/${tokenId}`));
    console.log(chalk.yellow(`Hash code: ${offer.hash}`));
  } catch (error) {
    throw new Error(error);
  }
}

try {
      await creatBuyOrder(tokenId, tokenAddress, reAuctionPrice);
    } catch (error) {
      if (error.message.includes("429")) {
        console.log(chalk.yellow("Waiting 1 min 20s..."));  delay(80); // 1min 20s
        await creatBuyOrder(tokenId, tokenAddress, reAuctionPrice);
      } else if (error.message.includes("400")) {
        console.log("ERC1155 Contract Token.");
        console.log(chalk.yellow("Waiting 1 min 20s..."));  delay(80);  // 1min 20s
        await creatBuyOrder(tokenId, tokenAddress, reAuctionPrice, "ERC1155");
      } else {
        console.log(chalk.red("Buy Order Error: \t" + error.message));
      }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to create sell order with OpenSea SDK, but no errors ...
I'm learning how to use the OpenSea SDK in Node.js (found here) by referring to its example OpenSea Creatures. The SDK links to...
Read more >
Opensea JS SDK createSellOrder method doesn't seem to ...
The issue is after I run the script, the method createSellOrder seems to run because I get the following output on my terminal...
Read more >
opensea-js - bytemeta
createSellOrder() 429s · Server Error (500) In case of collection and order_by query param · Could not create buy order · CERT_HAS_EXPIRED.
Read more >
Error While sending Buy request to an Opensea NFT - Moralis
test.css'; function Ground() { const { Moralis, user, logout, authenticate, ... const createSellOrder = async () => { const expirationTime ...
Read more >
opensea-js - githubmemory
createSellOrder() - Unhandled Rejection (Error): API Error 404: Not found. angryDev67 ... createSellOrder() 429s. bkulcsar.
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