1

I was trying to LIST my single NFT on OpenSea using @opensea/seaport-js.I'm testing with Polygon Mumbai. I have @opensea/seaport-js": "2.0.2". This is my code:

const provider = new ethers.providers.JsonRpcProvider('ALCHEMY_PROVIDER');
const signer = new ethers.Wallet('MY_PK', provider);
const seaport = new Seaport(signer, {seaportVersion: '1.4'});

try {
    const {executeAllActions} = await seaport.createOrder(
        {
            offerer: '0x6928C327bf8B6...7Dc0dAE672',
            zone: "0x0000000000000000000000000000000000000000",
            zoneHash:
      "0x0000000000000000000000000000000000000000000000000000000000000000",
    startTime: Math.floor(new Date().getTime() / 1000).toString(),
    endTime: Math.floor(new Date().getTime() / 1000 + 90 * 90).toString(),
    orderType: 1,
            offer: [
              {
                itemType: 3,
                token: '0x28f43DebFfA....f08113ac10cf6BF0a897',
                identifier: '4',
              },
            ],
            consideration: [
              {
                amount: '975000000000000',   
                recipient: '0x6928C327bf8....27150A7Dc0dAE672',
              },
              {
                amount:  '25000000000000',
                recipient: "0x0000a26b00c1F0DF003000390027140000fAa719",
              },
            ],
            counter: 0,
          },
          '0x6928C327bf8B6...150A7Dc0dAE672'
        );
        

    const order = await executeAllActions();
    order.protocol_address = '0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC'        

    const options = {
        method: "POST",
        url: "https://testnets-api.opensea.io/v2/orders/mumbai/seaport/listings",
        headers: {
          accept: "application/json",
          "X-API-KEY": "OPENSEA-API-KEY", //not necessary for testnet
          "content-type": "application/json",
        },
        data: order,
      };

   const response = await axios.request(options);

Response will constantly return 'ERROR' bad request with no explanation what is wrong. I have also compared my order object with Metamask order object and made sure they are same. I would really appreciate if anyone can explain what's wrong or what is the alternative way to programmatically 'Complete Listing' of my NFT with an API call or SDK.

longleilei
  • 11
  • 1

0 Answers0