Iām trying to make the fulfillOrder command of the OpenSea plugin work in nodejs (without browser) but I keep getting errors. I even tried this old repo but Iām getting a 400 response from the server so I guess things changed on the Moralis server side. The getOrders works as expected and prints out the order.
import Moralis from 'moralis/node.js';
const serverUrl = '';
const appId = '';
const moralisSecret = '';
async function initiate() {
await Moralis.start({ serverUrl, appId, moralisSecret });
await Moralis.enableWeb3({
chainId: 1,
privateKey: '',
});
const order = await Moralis.Plugins.opensea.getOrders({
network: 'mainnet',
tokenAddress: '0x3110EF5f612208724CA51F5761A69081809F03B7',
tokenId: '370',
orderSide: '1',
page: 1, // pagination shows 20 orders each page
});
await Moralis.Plugins.opensea.fulfillOrder({
network: 'mainnet',
userAddress: '',
order: order.orders[0],
});
}
initiate();
The error Iām getting:
node_modules\moralis\lib\node\RESTController.js:423
error = new _ParseError.default(errorJSON.code, errorJSON.error);
^ 3
ParseError: [object Object]
It seems like a parse error but thereās little documentation to figure out where the parsing goes wrongā¦