So Iām following along the Zerion clone tutorial.
- I created a fresh server for Ethereum MainNet, it came out v0.0.235.
- Iāve copied the cloud function from the GitHub like so:
const Moralis = {}; // just to hide IDE errors
Moralis.Cloud.define("getTokens", async (request) => {
const { userAddress } = request.params;
if (!userAddress) {
return [];
}
const tokenQuery = new Moralis.Query("EthTokenBalance");
tokenQuery.equalTo("address", userAddress);
const tokenResult = await tokenQuery.find();
const results = tokenResult.map((token) => token.attributes);
const balQuery = new Moralis.Query("_EthAddress");
balQuery.equalTo("objectId", userAddress);
const balResult = await balQuery.first({ useMasterKey: true });
results.push({
name: "Ethereum",
symbol: "ETH",
balance: balResult.get("balanceEth"),
decimals: 18,
});
return results;
});
- And Iām just over on the console trying to run:
const userAddress = "<pasted from my MetaMask>";
const result = await Parse.Cloud.run("getTokens", {userAddress});
console.log(result);
And I get:
Near as I can figure reading that it choked on line 10 character 16 which is right in the middle of an āequalToā. Is it just āequalā? I tried changing that and got no change in the error message when I re-ran it.
Am I missing a step? Please advise.