Bako Safe SDK
The Bako Safe SDK is a TypeScript library for building multi-signature wallet applications on the Fuel Network (opens in a new tab). It provides a complete suite of tools for vault management, transaction handling, and secure authentication.
Key Features
- Multi-signature Vaults: Create and manage vaults requiring multiple signatures for transaction approval
- Multiple Authentication Methods: Support for Fuel Wallet, WebAuthn (Passkeys), EVM wallets, and API tokens
- Transaction Management: Full lifecycle management from creation to execution
- Predicate-based Security: Built on Fuel's predicate system for maximum security
- CLI Support: Programmatic access via API tokens for automation and CI/CD
Architecture
The SDK is organized into the following modules:
| Module | Description |
|---|---|
| Provider | BakoProvider - Main entry point for authentication and API communication |
| Vault | Vault creation, configuration, and management |
| Transactions | Transaction creation, signing, and sending |
| WebAuthn | Passkey-based authentication utilities |
| Coders | Signature encoding for different wallet types |
| Address | Address conversion and validation utilities |
Supported Wallet Types
| Type | Description |
|---|---|
FUEL | Native Fuel wallets (Fuel Wallet, Fuelet) |
WEB_AUTHN | WebAuthn/Passkey authentication |
EVM | Ethereum-compatible wallets (MetaMask, etc.) |
Installation
npm install bakosafe fuelsQuick Example
import { BakoProvider, Vault } from 'bakosafe';
// Authenticate with API token
const provider = await BakoProvider.create(
'https://mainnet.fuel.network/v1/graphql',
{ apiToken: 'your-api-token' }
);
// Create or recover a vault
const vault = await Vault.fromAddress('your-vault-address', provider);
// Create a transaction
const { tx, hashTxId } = await vault.transaction({
name: 'My Transfer',
assets: [{
assetId: '0x...',
amount: '1000000',
to: 'recipient-address'
}]
});