Signing Client (Recommended)

The BitBadgesSigningClient provides a streamlined, wallet-agnostic interface for signing and broadcasting transactions. It handles account info fetching, gas estimation, signing, and broadcasting in a single call.

When to Use

Use BitBadgesSigningClient when:

  • You want a simple, all-in-one signing solution

  • You don't need fine-grained control over the signing process

  • You want automatic gas estimation and sequence management

  • You want automatic retry on sequence mismatch errors

Use manual signing (Cosmos / Ethereum) when:

  • You need full control over the transaction lifecycle

  • You need to customize the signing flow (e.g., custom fee logic)

  • You need to handle simulation separately from signing

  • You're integrating with existing transaction management infrastructure

Installation

The signing client is included in the main SDK:

npm install bitbadgesjs-sdk

Quick Start

Cosmos Wallet (Keplr, Leap, etc.)

EVM Wallet (MetaMask, etc.)

Building an AI agent or bot? See the AI Agents & Bots section for end-to-end examples, testnet faucet, and MCP tool reference.

Server-side signing uses GenericEvmAdapter which connects to the EVM JSON-RPC endpoint and broadcasts via precompile calls. This is the recommended path for bots, agents, and backend services.

Server-Side Signing (Cosmos Path)

The Cosmos path uses GenericCosmosAdapter with Cosmos-derived addresses and standard signDirect broadcasting. This produces a different address from the same key (Cosmos derivation vs ETH derivation).

Note: The same mnemonic/private key produces different addresses depending on which adapter you use. EVM adapter uses keccak256 (ETH-style) with coin type 60 HD path (m/44'/60'/0'/0/0), while Cosmos adapter uses ripemd160/sha256 with coin type 118 HD path (m/44'/118'/0'/0/0). The default for Keplr and the Cosmos chain registry is coin type 118. Make sure you fund the correct address for your chosen adapter.

Client Options

Network Presets

The SDK provides built-in network configurations via NETWORK_CONFIGS:

Use network presets with optional overrides:

Sign and Broadcast Options

Broadcast Result

Wallet Adapters

GenericCosmosAdapter

For browser wallets (Keplr, Leap, etc.) and server-side Cosmos signing:

GenericEvmAdapter

For browser EVM wallets and server-side signing (recommended for bots/agents):

EVM adapters only support sendEvmTransaction β€” they do not support signDirect. The BitBadgesSigningClient handles routing automatically based on the adapter type.

EVM Chain ID Validation

You can validate that the wallet is connected to the correct EVM network:

Network Selection

Gas Estimation

By default, the client simulates transactions to estimate gas:

Sequence Management

The client automatically handles account sequence (nonce) management:

Account Info

Multiple Messages

Error Handling

Comparison with Manual Signing

Feature
BitBadgesSigningClient
Manual Signing

Complexity

Simple, all-in-one

More setup required

Control

Abstracted

Full control

Account Info

Auto-fetched & cached

Manual fetch

Gas Estimation

Built-in simulation

Manual simulation

Sequence Retry

Automatic

Manual handling

Broadcasting

Built-in

Separate step

Custom Flow

Limited

Fully customizable

See Also

Last updated