Closed nathanmukena closed 3 years ago
The error is probable here. What is w
that you are passing in?
This is an open wallet.
const w = await new wallet.Account(key)
are you providing the api
field of the configuration object? That is the API provider for it to retrieve the balance.
I am not providing the api field at the moment. Not sure I ever used this field. Can you provide an example?
Thanks. In this example, a variable is assigned to api. Can't seem to find what the value would look like. Is that supposed to be a node URL/ When reverting the neon-js version to 3.9.11, api doesn't seem to be necessary.
this should give a clearer picture if you are in v4.
Executing the following code is creating an issue for us when using react-native: import { api, wallet, u, nep5 } from '@cityofzion/neon-js'; . . . export const submitNeonStory = async (w, promoter_wallet, hex_wallet, hex_challenge) => { return api.doInvoke({ net: env.net, url: env.rpcEndpoint, account: w, script: { scriptHash: env.nodis_contract, operation: 'submit', args: [promoter_wallet, hex_wallet, hex_challenge] }, gas: 0 }) }
We're getting the following error: undefined is not an object (evaluating 't.api.getBalance')