eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

Eosjs with scatter - couldn't make use of signature from scatter while performing transactions

Open amolmaid opened this issue 8 years ago • 4 comments

I am trying to use eosjs along with scatter in my web Application with ReactJS, but I couldn't figure out how to use scatter signature in place of eosjs permission while performing transactions.

1. I tried following code snippet, but its giving me error code

But its giving me error, Failed for eosScatter transfer TypeError: t(...)[u] is not a function at Promise (inject.js:40) at new Promise (<anonymous>) at Proxy.n (inject.js:40) at CreateAccount.js:139

  1. I also used following code to bring the get permission for window, but still not working error code 2

and giving following error error account missing

could anyone guide me how to use scatter signature in eosjs apis with proper syntax, OR how to pop this get signature window and then perform transaction

3. Also I am getting error(TypeError: Cannot read property 'find' of undefined) while getting identity.accounts console.log("identity = ", scatter.identity); // it gives identity with {hash, key, name, publicKey} object const account = scatter.identity.accounts.find(account => account.blockchain === 'eos');

Please guide for above

amolmaid avatar Aug 08 '18 07:08 amolmaid

@nsjames may be able to help. I'm unfamiliar with scatter's signing but thought it handles sending the transaction for you as well.

chris-allnutt avatar Aug 08 '18 18:08 chris-allnutt

It would be really nice if he would! As I simply need to know how exactly I can get the permission from scatter to perform actions which needs authorization(like transfer or set contract); I need exact syntax as documentation is not in depth for me.

Thanks in advance.

amolmaid avatar Aug 09 '18 07:08 amolmaid

Hi, Actually I was able to find the solution with the help of scatter telegram group.

  1. Basically answer to my 1st and 2nd query was, I should pass account name on which I have published a contract rather than contract name in method eosScatter.contract() solution

  2. And answer to the third query is Scatter identity was not picking properly with actual account info, so to do that we need to create scatter object using network object along with the chainId added explicitly. -- Also don't forget to add chain id in network field of scatter plugin.

anyway Thanks though :)

amolmaid avatar Aug 10 '18 06:08 amolmaid

@amolmaid thx guy. similar issue stuck me many hours, that's really helps.

y001j avatar Aug 12 '18 04:08 y001j