Brahma Console Integration [for dApp developers]
An integration guide to ensure both general smart contract wallet support, as well as Brahma Connect support, an advanced dApp connection and execution workflow.
Last updated
An integration guide to ensure both general smart contract wallet support, as well as Brahma Connect support, an advanced dApp connection and execution workflow.
Last updated
The flagship connection method in Console is , which allows user to batch and chain multiple actions across dApps in a single transaction, loading them in a secure iFrame directly in Console thanks to simulating the state on a forked RPC. This method doesn't support the collection of signatures, and therefore it requires the dApp whitelisting Brahma Connect as a method to bypass it, see Additional Support for Brahma Connect [Ideal].
Wallet Connect is a backup connection method, which requires #id-1.-signature-support-for-smart-contract-wallets, as well as Wallet Connect as an available connection method in the dApp
As Consoles are Safe smart contract wallets, they do not support EIP-191 signatures, and even EIP-712 signatures are required to be transformed into a SafeMessage type to be compatible, which are then verified using EIP-1271 which is the smart contract signature verification standard. The digest generation & signing is handled by Console, but the integrating DApps must support EIP-1271 to verify these signatures
Below are some code snippets that can be used for the implementation. Alternatively, multiple npm packages make it easy for dApps to add support for EIP 1271.
Code Snippets for manual validation
Brahma Connect is a new dApp connection mechanism which allows users to perform multiple sequential interactions on a single or multiple dApps in a single interaction and transaction.
For example: approving > swapping and then LPing in a separate protocol, all in 1 txn
Brahma Connect is powered by a suite of forked nodes that propagate the simulated state to dApps. dApps that support connect allow Brahma users to perform operations and strategy with the best possible UX and increase the dApp usage. More on the Brahma Connect UX here.
Connect doesn’t support signatures, and therefore if a dApp has an authentication signature or similar signature steps, it needs to bypass the signature step for users connecting through Brahma Connect:
Add support for browser/injected wallet with a single line of code change
web3-onboard has 6963 support out of the box, but if disable6963Support
is set to true
on your project for any reason, refer to the following guide to add support for injected wallet: