0
votes

I can't get order information from opensea using the moralis plugin, i've tried other plugins and none of them seem to work so I'm not sure what I'm doing wrong.

Here's my code:

async function init(){
    const serverUrl = "https://j6elugauxtku.usemoralis.com:2053/server";
    const appId = "*****";
    await Moralis.start({serverUrl, appId});
    Moralis.initPlugins();
    console.log("Plugins intialised");
}

const collectionAddress = "0x0651132f094551f9d4e40de3e1e2f8b7ac149c3a";
const openseaAddress = "0x7be8076f4ea4a4ad08075c2508e481d6c946d12b"
const collectionName = "Brunks";
const collectionABI  = [{...}];

async function get_orders(){

    orders = await Moralis.Plugins.opensea.getAsset({
        network: 'mainnet',
        tokenAddress: collectionAddress,
        tokenId: 100,     
      });
    console.log(orders);
}

init()
    .then(result => get_orders());

And this is the error:

PS C:\Users\shini\Documents\GitHub\NFT coding projects> node guess_tracker_v2.js
Plugins intialised
C:\Users\shini\Documents\GitHub\NFT coding projects\node_modules\moralis\lib\node\MoralisWeb3.js:276
            throw new Error(`Something went wrong\n${error}`);
                  ^

Error: Something went wrong
{}
    at Object.allPlugins.<computed>.<computed> [as getAsset] (C:\Users\shini\Documents\GitHub\NFT coding projects\node_modules\moralis\lib\node\MoralisWeb3.js:276:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async get_orders (C:\Users\shini\Documents\GitHub\NFT coding projects\guess_tracker_v2.js:36:14)

Node.js v17.3.0