本文介绍了OpenSea通过opensa-js上市并不奏效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个NFT,并在OpenSea中列出。现在我正试着通过OpenSea-js SDK来创建我的商品的销售订单。不幸的是,这并不管用。不知道我在哪里搞错了。此外,我也不确定基本派生路径。以下是我创建卖出订单的代码。请帮我解决这个问题。

const opensea = require("opensea-js");
const OpenSeaPort = opensea.OpenSeaPort;
const Network = opensea.Network;
const MnemonicWalletSubprovider = require("@0x/subproviders")
  .MnemonicWalletSubprovider;
const RPCSubprovider = require("web3-provider-engine/subproviders/rpc");
const Web3ProviderEngine = require("web3-provider-engine");

const MNEMONIC = "accuse never ....";
const NFT_CONTRACT_ADDRESS = "0x6C317E7dE3e8823BBc308a2912Ba6F24587fc167";
const OWNER_ADDRESS = "0x589a1532AAaE84e38345b58C11CF4697Ea89A866";
API_KEY = "";

const infuraRpcSubprovider = new RPCSubprovider({
    rpcUrl: "https://rinkeby.infura.io/v3/c0e4482bdf9e4f539692666cd56ef6e4"
  });

  const BASE_DERIVATION_PATH = `44'/60'/0'/0`;

  const mnemonicWalletSubprovider = new MnemonicWalletSubprovider({
    mnemonic: MNEMONIC,
    baseDerivationPath: BASE_DERIVATION_PATH,
    chainId: 4
  });

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

  const seaport = new OpenSeaPort(
    providerEngine,
    {
      networkName: Network.Rinkeby,
      apiKey: API_KEY,
    },
    (arg) => console.log(arg)
  );


async function main() {

    console.log("Auctioning an item for a fixed price...");
  const fixedPriceSellOrder = await seaport.createSellOrder({
    asset: {
      tokenId: "3",
      tokenAddress: NFT_CONTRACT_ADDRESS,
    },
    startAmount: 0.0001,
    expirationTime: 0,
    accountAddress: OWNER_ADDRESS,
  }) ;
    console.log("fixedPriceSellOrder") ;
}


main();

推荐答案

此问题已解决。我已经将HDProvider更改为@truffle/hdwallet-Provider。现在,我可以通过OpenSea-js在createSellOrder之后查看OpenSea中的列表。

link帮助我解决了此问题

这篇关于OpenSea通过opensa-js上市并不奏效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 02:42