EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

How to update account permissions using new API? #438

Closed jsnathan closed 5 years ago

jsnathan commented 5 years ago

In issues #334 and #305 it is explained how to update account permissions using the eos.updateauth method. I cannot seem to find this method in the new eosjs API. What is the new best practice on how to update account permissions?

c0d3ster commented 5 years ago

The old version of eosjs provided some wrappers around common functionality for convenience; however, this led to confusion as to how everything works behind the scenes. In eosjs v20 you should be creating an instance of the Api then using api.transact(transaction, config) with the correct transaction format for an updateauth action. The reference for the structure of the updateauth action (along with the struct for authority) can be found here if you input "eosio" as the account_name

I'm closing this but let us know if you have any further issues with this and we'll address it appropriately.