This may be a bug or may just be something we should document more. Below is a little snippet that shows an address working and returning a balance on TestNet. On MainNet this code throws an exception apparently because there's no balance. Is this expected or should it return the correct token info + a 0 balance?
const [_ignore1, mainNetRpcEndpoint] = await asyncWrap(api.neonDB.getRPCEndpoint("MainNet"))
const mainNetRpxScriptHash = 'ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9'
const addressWithRpxTestNetOnly = 'ALq7AWrhAueN6mJNqk6FHJjnsEoPRytLdW'
const [mainNetErr, mainNetTokenResults] = await asyncWrap(api.nep5.getToken(mainNetRpcEndpoint, mainNetRpxScriptHash, addressWithRpxTestNetOnly))
if (mainNetErr) {
console.log('We get here because on MainNet balance is empty')
}
const [_ignore2, testNetRpcEndpoint] = await asyncWrap(api.neonDB.getRPCEndpoint("TestNet"))
const testNetRpxScriptHash = '5b7074e873973a6ed3708862f219a6fbf4d1c411'
const [testNetErr, testNetTokenResults] = await asyncWrap(api.nep5.getToken(testNetRpcEndpoint, testNetRpxScriptHash, addressWithRpxTestNetOnly))
if (testNetErr) {
console.log('We DO NOT get here because on TestNet we have a balance')
}
This may be a bug or may just be something we should document more. Below is a little snippet that shows an address working and returning a balance on TestNet. On MainNet this code throws an exception apparently because there's no balance. Is this expected or should it return the correct token info + a 0 balance?