Transactions flow
This page explains how to leverage the Brian API/SDK to prepare and execute blockchain transactions. The Brian API provides a flexible and agnostic approach to transaction handling, enabling developers to design workflows that best fit their application's architecture.
The Brian API and ts SDK are meant to be used on the backend to not expose the Brian API key!
The transaction flow consists of two main steps:
Transaction Request: Your application backend interacts with the Brian API/SDK to generate one or more transaction objects. These objects include all necessary details, such as recipient addresses, values, calldata, and additional metadata for frontend/backend purposes.
Transaction Execution: Transactions can be executed in several ways, depending on your use case. The API is agnostic about execution, enabling flexibility:
Backend Execution: Your server signs and broadcasts the transaction using a wallet private key.
Frontend Execution: The transaction is sent to your frontend for user signing and execution through a wallet.
Smart Contract Execution: The transaction is forwarded to a smart contract call that handles execution.
Example of Transaction Execution
The libraries and tools available for executing the transaction will depend on the type of chain you intend to use (EVM or Non-EVM, such as Solana/Starknet).
In any case, the transactions returned by the Brian API are compatible with the most common development tools, such as Viem, Wagmi, Ethers for EVM chains, starknet.js, Starknet React for Starknet, and, Solana-Web3.js for Solana.
Examples:
Last updated