neoline.invokeRead({
scriptHash: '0x96ef49bb4f67e25235a4cd4455d2f10779186ab2',
operation: 'balanceOf',
args: [
{
type: 'Address',
value: 'AY5xLg4RPZPcYoD1fW7j455PkAybbU2x42'
}
]
})
.then(result => {
console.log('Read invocation result: ' + JSON.stringify(result));
})
.catch((error) => {
const {type, description, data} = error;
switch(type) {
case 'NO_PROVIDER':
console.log('No provider available.');
break;
case 'CONNECTION_REFUSED':
console.log('Connection dApp not connected. Please call the "connect" function.');
break;
case 'RPC_ERROR':
console.log('There was an error when broadcasting this transaction to the network.');
break;
default:
// Not an expected error object. Just write the error to the console.
console.error(error);
break;
}
});