Hey there,
I’m having trouble running a node.js script in the terminal where I want to executeFunction by private_key.
Here is the code:
const Moralis = require('moralis/node');
var ABI = ....;
const serverUrl = "...";
const appId = "...";
const masterKey = "...";
const rebase = async () => {
await Moralis.start({ serverUrl, appId, masterKey });
await Moralis.enableWeb3({
chainId: 0xa86a,
privateKey: "private_key",
});
readOptions = {
contractAddress: contract_address,
functionName: "rebase",
abi: ABI
};
const message = await Moralis.executeFunction(readOptions);
};
rebase();
and the error I’m getting is below:
if (!((_window = window) !== null && _window !== void 0 && _window.ethereum)) {
Is there to sign with private_key by not using Moralis.enableWeb3 ??