Safle
  • SafleID
    • About SafleID
      • Core Technical Components (1/3)
      • Core Technical Concepts (2/3)
      • Core Technical Concepts (3/3)
    • What SafleID does?
    • For Chains
      • Technical Breakdown (1/2)
      • Technical Breakdown (2/2)
    • For dApps
    • For Wallet Providers (Exchanges and independent wallets)
      • Why Integrate SafleID (1/2)
      • Why Integrate SafleID (2/2)
    • SafleID's Technology
      • Data Flow and Interactions
      • Resolving Functionalities (RegistrarMain Contract)
      • Auction Functionalities (Auction Contract)
    • Conclusion
    • Terminology
    • Technical Documentation
  • Safle Wallet
    • Onboarding
    • Buy Crypto with Fiat enabled via Transak
    • Safle Swaps
    • Transaction processing on multiple Chains
    • Annexure: Encryption Sequence
  • Safle Vault
    • Features
    • Blockchains Supported
    • Installation & Initialisation
    • Encryption/Decryption Module
    • Controllers
Powered by GitBook
On this page
  • Some controller examples
  • Guidelines for creating a controller
  • Integrations
  1. Safle Vault

Controllers

PreviousEncryption/Decryption Module

Last updated 10 months ago

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 :

  1. Generate wallet

  2. Add Account

  3. Get Accounts

  4. Sign Message

  5. Sign Transactions

  6. Broadcast Transaction

  7. Export Private Key

  8. 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

  1. 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.

Install by running npm install --save @getsafle/safle-vault.

Install the controller, import and export the controller in the chains directory like the examples given

Vault ETH Controller
Vault BSC Controller
Vault Polygon Controller
Vault Avalanche Controller
Vault Bitcoin Controller
safle-vault
here