> For the complete documentation index, see [llms.txt](https://docs.safle.com/safleid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.safle.com/safleid/safle-vault/controllers.md).

# 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

1. [Vault ETH Controller](https://github.com/getsafle/vault-eth-controller)
2. [Vault BSC Controller](https://github.com/getsafle/bsc-wallet-controller)
3. [Vault Polygon Controller](https://github.com/getsafle/polygon-wallet-controller)
4. [Vault Avalanche Controller](https://github.com/getsafle/avalanche-wallet-controller)
5. [Vault Bitcoin Controller](https://github.com/getsafle/bitcoin-wallet-controller)

### 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. Install [safle-vault](https://www.npmjs.com/package/@getsafle/safle-vault) by running `npm install --save @getsafle/safle-vault`.
2. Install the controller, import and export the controller in the chains directory like the examples given [here](https://github.com/getsafle/safle-vault/blob/main/src/chains/index.js)
3. 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.safle.com/safleid/safle-vault/controllers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
