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

createBuyOrder API Error 404: Not found

Open kula0826 opened this issue 5 years ago • 8 comments

Error: API Error 404: Not found. Full message was '{"success":false}'

does anyone have a clue?

kula0826 avatar Nov 24 '21 09:11 kula0826

same problem

amzfcy avatar Jan 07 '22 05:01 amzfcy

I'm getting this with createSellOrder: API Error 404: Not found. Full message was '{"success":false}'

cre-mer avatar Jan 17 '22 14:01 cre-mer

Hey guys I've got this error, too, while calling createSellOrder.

After a little digging in, I found that it is (in my case) caused by some latency for OpenSea to fetch the asset's detail. So there is a workaround: put off the createSellOrder call until the asset is ready (we can check if the asset's ready with seaport.api.getAsset).

The workaround code is like this:

class {

  async waitForOpenseaAssetReady(seaport: OpenSeaPort, tokenAddress: string, tokenId: string) {
    while (true) {
      try {
        await seaport.api.getAsset({ tokenAddress, tokenId })
        break // the asset is ready, exit the loop
      } catch (e) {
        // `API Error 404 ...` means asset not ready
        if (!/API Error 404/.test(e + '')) throw e // If other errors found, that's not expected, just throw
        await delay(5) // retry after 5 seconds
      }
    }
  }

  async createOpenseaOrder(nft: NFTItemWithContract, account: string, price: number) {
    // prepare params...
    await this.waitForOpenseaAssetReady(seaport, tokenAddress, tokenId)
    return seaport.createSellOrder({ ... })
  }

}

nighca avatar Jan 18 '22 02:01 nighca

Hello, is everyone still having this issue? As a reminder, please use the latest version of the SDK and Node.

esteban-OpenSea avatar Apr 15 '22 16:04 esteban-OpenSea

@esteban-OpenSea Could u plz link here the related PR, which is expected to solve this issue.

nighca avatar Apr 18 '22 03:04 nighca

Getting this error on createSellOrder

Error: API Error 404: Not found. Full message was '{"success":false}'

const seaport = new OpenSeaPort(provider, { networkName: Network.Rinkeby, });

const listing = await seaport.createSellOrder({ asset: { tokenId, tokenAddress, }, quantity: 1, accountAddress, startAmount, expirationTime }); Log of object: { asset: { tokenId: '2252', tokenAddress: '0x230B03Af0e9917B89FDFECc4380E70c15371297b' }, quantity: 1, accountAddress: '0x1a7a4121d7527f9ccf538fa748a73455d8c5005a', startAmount: 0.5, expirationTime: 1650340141 }

muhtashimali avatar Apr 18 '22 04:04 muhtashimali

Hey guys I've got this error, too, while calling createSellOrder.

After a little digging in, I found that it is (in my case) caused by some latency for OpenSea to fetch the asset's detail. So there is a workaround: put off the createSellOrder call until the asset is ready (we can check if the asset's ready with seaport.api.getAsset).

The workaround code is like this:

class {

  async waitForOpenseaAssetReady(seaport: OpenSeaPort, tokenAddress: string, tokenId: string) {
    while (true) {
      try {
        await seaport.api.getAsset({ tokenAddress, tokenId })
        break // the asset is ready, exit the loop
      } catch (e) {
        // `API Error 404 ...` means asset not ready
        if (!/API Error 404/.test(e + '')) throw e // If other errors found, that's not expected, just throw
        await delay(5) // retry after 5 seconds
      }
    }
  }

  async createOpenseaOrder(nft: NFTItemWithContract, account: string, price: number) {
    // prepare params...
    await this.waitForOpenseaAssetReady(seaport, tokenAddress, tokenId)
    return seaport.createSellOrder({ ... })
  }

}

@nighca I'm getting the same error on fetching asset await seaport.api.getAsset({ tokenAddress, tokenId })

muhtashimali avatar Apr 18 '22 04:04 muhtashimali

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]