This document explains how to configure wallets and networks for the Bako Vault CLI.
bako-vault-cli/
├── wallets/ # Wallet configuration files
│ ├── my-vault.json
│ └── team-vault.json
├── networks/ # Network configuration files
│ ├── mainnet.json
│ └── testnet.json
└── .pending-tx.json # Current pending transaction (auto-generated)
Network files define how to connect to a Fuel network.
networks/<network-name>.json
{
"url": "string", // Required: GraphQL endpoint
"explorerUrl": "string", // Optional: Block explorer URL
"chainId": "number", // Optional: Chain ID
"assets": {
"ETH": "string", // Required: ETH asset ID
"USDC": "string" // Optional: USDC asset ID
}
}networks/testnet.json:
{
"url": "https://testnet.fuel.network/v1/graphql",
"explorerUrl": "https://app-testnet.fuel.network",
"assets": {
"ETH": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
"USDC": "0x..."
}
}networks/mainnet.json:
{
"url": "https://mainnet.fuel.network/v1/graphql",
"explorerUrl": "https://app.fuel.network",
"assets": {
"ETH": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
"USDC": "0x..."
}
}Wallet files define the vault/predicate configuration.
wallets/<wallet-name>.json
{
"config": {
"SIGNATURES_COUNT": "number", // Required: Signatures needed
"SIGNERS": ["string"], // Required: Array of signer addresses
"HASH_PREDICATE": "string" // Optional: Predicate hash
},
"version": "string" // Required: Predicate bytecode version
}| Field | Description |
|---|---|
SIGNATURES_COUNT |
Number of signatures required to execute a transaction (threshold) |
SIGNERS |
Array of B256 addresses that can sign transactions |
HASH_PREDICATE |
Hash of the predicate for verification |
version |
Predicate bytecode version hash (from BakoSafe) |
wallets/personal.json:
{
"config": {
"SIGNATURES_COUNT": 1,
"SIGNERS": [
"0xed2b955f8bee5d1a0c01fcbdb6b20cd5420fdac05af1c13934af1a5fa0c632b9"
],
"HASH_PREDICATE": "0x9f41683cc077e7762fe3b8ef41f1677795218e831ddbc37c91e96c96c5e66cc6"
},
"version": "0x967aaa71b3db34acd8104ed1d7ff3900e67cff3d153a0ffa86d85957f579aa6a"
}wallets/team-vault.json:
{
"config": {
"SIGNATURES_COUNT": 2,
"SIGNERS": [
"0xabc123...",
"0xdef456...",
"0x789abc..."
],
"HASH_PREDICATE": "0x..."
},
"version": "0x..."
}- Open BakoSafe
- Navigate to your vault
- Go to Settings (gear icon)
- Click Export Wallet
- Save the exported JSON file to
wallets/<name>.json
The exported file contains all required fields (config, version) ready to use with this CLI.
import { Vault } from 'bakosafe';
const vault = new Vault(provider, {
SIGNATURES_COUNT: 2,
SIGNERS: ['0x...', '0x...'],
});
console.log('Address:', vault.address.toB256());
console.log('Version:', vault.version);import { Wallet } from 'fuels';
const wallet = Wallet.fromPrivateKey('0xYourPrivateKey');
console.log('Signer Address:', wallet.address.toB256());- Open Fuel Wallet
- Click on your account
- Copy the B256 address (starts with
0x, 66 characters)
urlis required and must be a valid URLassets.ETHis required
config.SIGNATURES_COUNTmust be at least 1config.SIGNERSmust have at leastSIGNATURES_COUNTnon-zero addressesversionis required
# Use testnet
networks/testnet.json
wallets/dev-wallet.json# Use mainnet
networks/mainnet.json
wallets/prod-wallet.json- Never commit private keys to version control
- Use
.gitignoreto exclude sensitive configuration:.pending-tx.json wallets/*.json # If contains sensitive data - Separate configurations for development and production
- Review signer addresses before creating transactions