0

I'm trying to running this sell.js script to create a simple Sell Order via OpenSea API. I already installed web3, connected my wallet, downgraded Node to v8.11.2 and am using Alchemy.

const providerEngine = new Web3ProviderEngine();
providerEngine.addProvider(mnemonicWalletSubprovider);
providerEngine.addProvider(infuraRpcSubprovider);
providerEngine.start();

const seaport = new OpenSeaPort(
  providerEngine,
  {
    networkName:
      NETWORK === "mainnet" || NETWORK === "live"
        ? Network.Main
        : Network.Rinkeby,
    apiKey: API_KEY,
  },
  (arg) => console.log(arg)
);

async function main() {
  // Example: simple fixed-price sale of an item owned by a user.
  console.log("Auctioning an item for a fixed price...");
  try {
    const fixedPriceSellOrder = await seaport.createSellOrder({
      asset: {
        tokenId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        tokenAddress: NFT_CONTRACT_ADDRESS,
      },
      startAmount: 0.05,
      expirationTime: 0,
      accountAddress: OWNER_ADDRESS,
    });
    console.log(
      `Successfully created a fixed-price sell order! ${fixedPriceSellOrder.asset.openseaLink}\n`
    );
  } catch (e) {
      console.error(e);
  }
}

main();

However, when I run the code it throws the following fetch error:

FetchError: request to https://api.opensea.io/api/v1/asset/0xxxxxxxxxxxxxxxxxxxxxxxx/? failed, reason: certificate has expired

Any thought on how to fix this? Thanks!

Vasco Oliveira
  • 53
  • 1
  • 1
  • 4
  • 1
    That server is using a **LetsEncrypt cert with the 'compatibility' chain**, and your nodejs is apparently using OpenSSL 1.0.2 (or lower?) and a truststore (root list) containing the DST X3 root which expired two weeks ago. (0) See some of the dozen Qs already asked about this e.g. https://stackoverflow.com/questions/69400610/ (1) Request the server change to the ISRG-only chain. (2) Use a version of nodejs built with OpenSSL 1.1.0 up. (3) If you can, replace root list to remove the DST root (v8.0.0 up should contain ISRG root, unless you are already replacing it with an ancient or broken one) – dave_thompson_085 Oct 14 '21 at 17:21
  • Did you find a solution to this? – emorling Dec 02 '21 at 13:12

0 Answers0