我正在尝试运行此sell.js
脚本以通过 OpenSea API 创建一个简单的销售订单。我已经安装了 web3,连接了我的钱包,将 Node 降级到 v8.11.2,并且正在使用 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();
但是,当我运行代码时,它会引发以下提取错误:
FetchError: request to https://api.opensea.io/api/v1/asset/0xxxxxxxxxxxxxxxxxxxxxxxx/? failed, reason: certificate has expired
关于如何解决这个问题的任何想法?谢谢!