Bako Safe SDK
Overview

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:

ModuleDescription
ProviderBakoProvider - Main entry point for authentication and API communication
VaultVault creation, configuration, and management
TransactionsTransaction creation, signing, and sending
WebAuthnPasskey-based authentication utilities
CodersSignature encoding for different wallet types
AddressAddress conversion and validation utilities

Supported Wallet Types

TypeDescription
FUELNative Fuel wallets (Fuel Wallet, Fuelet)
WEB_AUTHNWebAuthn/Passkey authentication
EVMEthereum-compatible wallets (MetaMask, etc.)

Installation

npm install bakosafe fuels

Quick 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'
  }]
});

Resources