I am trying to call contract by scatter but i met with below error Error is Cannot read property 'find' of undefined
Any other way to call contract and suggestions appretiated!
function gets()
{ const scatter = window.scatter
const network = {
blockchain: 'eos',
host: 'http://jungle2.cryptolions.io',
port: 80
}
console.log("in gets");
scatter.getIdentity().then(identity => {
console.log(identity, "identityFound")
// do not assign to window in actual projects... only for learning.
window.identity = identity
}).catch(error => {
console.log(error, "identityCrisis!")
// User "Deny" action
})
const accountt = scatter.identity.accounts.find(x => x.blockchain === 'eos');
console.log(accountt);
// Contract calling code goes here.....
}