Vuex Solido allows to add @decent-bet/solido capabilities to vuex. It consist for now in an enhanced action that add three new parameters to every action created based on it.
setup(): recieve all the settings needed.
getContract(): return a contract instance of a class based on @decent-bet/solido.
currentConfig: an object that store the config initially passed to the setup method, check the interface SolidoProviderConfig.
npm i --save @decent-bet/vuex-solidoFollow the instructions to use the decorators from @decent-bet/solido.
Using the enhanced action
Frist of all you need to add some mutations to your store or module of your store:
- You should call
setup()before any access to
currentConfigor call to
- You should get all the settings needed to create a
;;;; // use your own state definitions; // use your own state definitions; // created using @decent-bet/solido.;// the solidoAction receive a type of the return, in this case Promise<void>,// the second param is a function and can be awaitable like in this case;
Access to the wallet info:
// get the wallet info, you only be able to access the currentConfig after call to setup() method;
Get a contract and call to a method:
// get any created contract based on @decent-bet/solido;