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

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

Open muhtashimali opened this issue 4 years ago • 21 comments

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

Are you still having this issue?

esteban-OpenSea avatar Apr 18 '22 18:04 esteban-OpenSea

Yes It gives me same error whenever I try to createSellOrder or getAsset and that is minted on our platform smart contract but listed on opensea i.e. not on opensea smart contract.

muhtashimali avatar Apr 19 '22 14:04 muhtashimali

Are you still having this issue?

same error occured on createBuyOrder function when using paymentTokenAddress param. It seems like API can't convert token from address.

sunzheng1994 avatar Apr 23 '22 20:04 sunzheng1994

@esteban-OpenSea Can you guide me what's the work around to handle this?

muhtashimali avatar Apr 24 '22 17:04 muhtashimali

im facing the same issue as well , calling seaport.api.getAssets is working fine but seaport.api.getAsset on a specific asset returned 404. I tested the token id and contract address on the opensea api page it's working perfectly fine.

xiao81 avatar May 02 '22 10:05 xiao81

Is this happening with both testnet and mainnet?

esteban-OpenSea avatar Jun 10 '22 02:06 esteban-OpenSea

Is this happening with both testnet and mainnet?

Hello, I have the same problem in testnet, could you help please?

alex-bormotov avatar Jul 05 '22 17:07 alex-bormotov

It has to be said that there are many problems in the maintenance of opensea-js. It was the first time I had such a bad experience.

storyicon avatar Jul 31 '22 09:07 storyicon

Facing the same issue. Can anyone help?

dreygur avatar Aug 08 '22 12:08 dreygur

You have solutions ? Bug persist on testnet with last release of lib

Smeagolworms4 avatar Sep 21 '22 13:09 Smeagolworms4

Same issue here (tesntet)

Antomart12 avatar Sep 29 '22 12:09 Antomart12

Bump. Mainnet

nickyoung92 avatar Dec 28 '22 02:12 nickyoung92

same issue, did you guys able to find solution?

vmnfts avatar Jan 09 '23 09:01 vmnfts

Solved my side by creating instance of OpenSeaSDK rather than OpenSeaPort. Though they both are same, I don't know why it's working. I'm using 4.0.12 of opensea-js

dreygur avatar Jan 09 '23 09:01 dreygur

Solved my side by creating instance of OpenSeaSDK rather than OpenSeaPort. Though they both are same, I don't know why it's working. I'm using 4.0.12 of opensea-js

could you share small piece of code or something mate? this would be really helpful

vmnfts avatar Jan 09 '23 11:01 vmnfts

I made a class like this:

const opensea = require('opensea-js');
const Web3 = require('web3');
const HDWalletProvider = require('@truffle/hdwallet-provider');

class Opensea {
  constructor({ network, privateKey, apiKey, rpcUrl, accountAddress } = {}) {
    this.network = network;
    this.privateKey = privateKey;
    this.apiKey = apiKey;
    this.rpcUrl = rpcUrl;
    this.accountAddress = accountAddress;

    // Wallet Provider
    this.provider = new HDWalletProvider({
      privateKeys: [this.privateKey],
      providerOrUrl: this.rpcUrl,
      addressIndex: 0,
    });

    this.web3 = new Web3(this.provider);

    // Opensea API
    const options = {
      networkName: opensea.Network[this.network]
    }

    this.headers = {
      accept: 'application/json'
    }

    if (this.network.toLowerCase() === 'main') {
      options.apiKey = this.apiKey;
      this.headers['X-API-KEY'] = this.apiKey;
    }
    this.seaport = new opensea.OpenSeaSDK(this.provider, options);
   }
}

Solved my side by creating instance of OpenSeaSDK rather than OpenSeaPort. Though they both are same, I don't know why it's working. I'm using 4.0.12 of opensea-js

could you share small piece of code or something mate? this would be really helpful

dreygur avatar Jan 09 '23 11:01 dreygur

I made a class like this:

const opensea = require('opensea-js');
const Web3 = require('web3');
const HDWalletProvider = require('@truffle/hdwallet-provider');

class Opensea {
  constructor({ network, mnemonic, privateKey, apiKey, rpcUrl, accountAddress }) {
    this.network = network;
    this.mnemonic = mnemonic;
    this.privateKey = privateKey;
    this.apiKey = apiKey;
    this.rpcUrl = rpcUrl;
    this.accountAddress = accountAddress;

    // Wallet Provider
    this.provider = new HDWalletProvider({
      // mnemonic: this.mnemonic,
      privateKeys: [this.privateKey],
      providerOrUrl: this.rpcUrl,
      addressIndex: 0,
    });

    this.web3 = new Web3(this.provider);

    // Opensea API
    const options = {
      networkName: opensea.Network[this.network]
    }

    if (this.network.toLowerCase() === 'main') options.apiKey = this.apiKey;
    this.seaport = new opensea.OpenSeaSDK(this.provider, options);

    this.headers = {
      'X-API-KEY': this.apiKey,
      accept: 'application/json'
    }
    if (this.network.toLowerCase() !== 'main') delete this.headers['X-API-KEY'];
  }
}

Solved my side by creating instance of OpenSeaSDK rather than OpenSeaPort. Though they both are same, I don't know why it's working. I'm using 4.0.12 of opensea-js

could you share small piece of code or something mate? this would be really helpful

great thanks man :)

vmnfts avatar Jan 09 '23 11:01 vmnfts

I made a class like this:

Solved my side by creating instance of OpenSeaSDK rather than OpenSeaPort. Though they both are same, I don't know why it's working. I'm using 4.0.12 of opensea-js

could you share small piece of code or something mate? this would be really helpful

Hello, guys. Could you also share a call of the instance, please? I made it, but I still have the same result

import dotenv from 'dotenv';
dotenv.config();

import Web3 from 'web3';
import HDWalletProvider from "@truffle/hdwallet-provider";

import opensea from 'opensea-js';
//const { Network, opensea } = pkg;

class Opensea {
    constructor({ network, mnemonic, privateKey, apiKey, rpcUrl, accountAddress }) {
        this.network = network;
        this.mnemonic = mnemonic;
        this.privateKey = privateKey;
        this.apiKey = apiKey;
        this.rpcUrl = rpcUrl;
        this.accountAddress = accountAddress;

        console.log("Network= " + network + " Mnemonic= " + mnemonic + " PrivateKey= " + privateKey
            + " apiKey = " + apiKey + "rpcUrl= " + rpcUrl + " AccountAddress = " + accountAddress);

        // Wallet Provider
        this.provider = new HDWalletProvider({
            //mnemonic: this.mnemonic,
            privateKeys: [this.privateKey],
            providerOrUrl: this.rpcUrl,
            addressIndex: 0,
        });

        this.web3 = new Web3(this.provider);

        const options = {
            networkName: this.network,
            apiKey: this.apiKey,
        }

        this.seaport = new opensea.OpenSeaSDK(this.provider, options);
    }
}

const myOpenSea = new Opensea({
    network: "main",
    mnemonic: "myMnemonic",
    privateKey: process.env.PRIVATE_KEY,
    apiKey: process.env.OPENSEA_API_KEY,
    rpcUrl: process.env.ALCHEMY_URL,
    accountAddress: process.env.MY_WALLET,
});

const tokenId = 1844;
const collectionAddress = "0xe24e4d4535f504d6d7957356534e23b4e787289f";
const offerExpiration = 15;
const myWallet = process.env.MY_WALLET;


const offer = await myOpenSea.seaport.createBuyOrder({
    asset: {
        tokenId,
        collectionAddress,
    },
    myWallet,
    startAmount: 0.001,
}).then(function (offer) {
    console.log(`Offer placed, expires in ${offerExpiration}min`);
}).catch(function (error) {
    console.log('Offer failed', error);
});

myOpenSea.provider.engine.stop();

The result is

DEPRECATED: Please use providerUtils.standardizeOrThrow() instead
Offer failed Error: API Error 404: Not found. Full message was '{"success":false}'
    at OpenSeaAPI.<anonymous> (/Users/slava/JavaProjects/js-parser/node_modules/opensea-js/lib/api.js:583:31)
    at step (/Users/slava/JavaProjects/js-parser/node_modules/opensea-js/lib/api.js:63:23)
    at Object.next (/Users/slava/JavaProjects/js-parser/node_modules/opensea-js/lib/api.js:44:53)
    at fulfilled (/Users/slava/JavaProjects/js-parser/node_modules/opensea-js/lib/api.js:35:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

It's really a weird SDK 8))

slava239 avatar May 08 '23 18:05 slava239

@vmnfts @dreygur @storyicon @alex-bormotov Guys, have you found a solution? I've been stuck on this issue for too long time 8))

slava239 avatar May 12 '23 11:05 slava239