我无法使用moralis插件从opensea获取订单信息,我尝试了其他插件,但它们似乎都不起作用,所以我不确定我做错了什么。
这是我的代码:
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());
这是错误:
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