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!