signatureProvider.sign hangs while an error appears in scatter desktop console
Versions
- scatter desktop @12.0.0,
- [email protected],
- [email protected],
- [email protected]
In the scatter desktop I have a custom network configured and a single private key added. The key is linked to the network.
From the Node.js Scatter connection is established fine but whenever I do signatureProvider.sign, the app hangs and I'm getting an error in the scatter desktop console:
TypeError: fetching abi for eosaccnt: Cannot read property 'getRawAbi' of undefined
The code snippet is below. Some of the values need to be set. await feapi.signatureProvider.sign(signArgsFe) never returns.
const { Api, JsonRpc } = require('eosjs')
const fetch = require('node-fetch')
const { TextDecoder, TextEncoder } = require('util')
const ScatterJS = require('scatterjs-core').default
const ScatterEOS = require('scatterjs-plugin-eosjs2').default
ScatterJS.plugins(new ScatterEOS())
async function main () {
const opts = {
blocksBehind: 3,
expireSeconds: 60
}
const actions = [{
account: 'eosaccnt',
name: 'validate',
authorization: [{
actor: 'testuser1111',
permission: 'active'
}],
data: {
account: 'testuser1111'
}
}]
const { scatter } = ScatterJS
const connected = await scatter.connect('demo-app')
if (!connected) throw new Error('no scatter connection')
await scatter.forgetIdentity()
const network = {
blockchain: 'eos',
protocol: 'https',
host: 'node_address',
port: 443,
chainId: 'chain_id from v1/chain/get_info'
}
await scatter.suggestNetwork(network)
const hasAccount = await scatter.hasAccountFor(network)
if (!hasAccount) throw new Error('no account found')
await scatter.getIdentity({ accounts: [network] })
const feSignProvider = scatter.eosHook(network, null, true)
const ferpc = new JsonRpc('https://node_address', { fetch })
const feapi = new Api({
rpc: ferpc,
signatureProvider: feSignProvider,
textDecoder: new TextDecoder(),
textEncoder: new TextEncoder()
})
const { serializedTransaction } = await feapi.transact({ actions }, {
...opts,
broadcast: false,
sign: false
})
const feRequiredKeys = await feapi.signatureProvider.getAvailableKeys()
const signArgsFe = {
chainId: network.chainId,
requiredKeys: feRequiredKeys,
serializedTransaction,
abis: []
}
const fePushTransactionArgs = await feapi.signatureProvider.sign(signArgsFe)
console.log('done')
}
main().catch(console.error)
I get the same error
Versions
scatter desktop @12.1.1, [email protected], [email protected], [email protected]
Scatter not responding to sign action fePushTransactionArgs = await feapi.signatureProvider.sign(signArgsFe)