Controllers
Every chain which is integrated with the vault is created as a separate package.
This is done keeping the modularity aspect in mind along with the thought process of open source contribution. Any developer can contribute to our code base by creating a controller of a chain keeping the developer guidelines in mind and integrating the controller with the Vault SDK.
Some controller examples
Guidelines for creating a controller
Every controller needs to expose methods to :
Generate wallet
Add Account
Get Accounts
Sign Message
Sign Transactions
Broadcast Transaction
Export Private Key
Import wallet from the private key
Controllers should manage multiple accounts through a Keyring implementation and proper state management. Every new account should get generated within the same keyring.
Integrations
Once the chain specific wallet controller is complete, it can be integrated with the vault SDK in a few lines of code
Install safle-vault by running
npm install --save @getsafle/safle-vault
.Install the controller, import and export the controller in the chains directory like the examples given here
Now transactions can be signed and sent from the Keyless SDK by just calling the
signTransaction(rawTx, pin, chain)
function and passing the chain name as the parameter along with the raw transaction and pin.
Last updated