Cosmos side (bank, staking, gov)
Native transfers, staking and governance are Cosmos messages, not EVM calls. The SDK includes the CometBFT/Cosmos client (the CosmJS fork) with ML-DSA-65 wallets.
Wallet and client
import {
DirectMldsa65HdWallet,
SigningStargateClient,
GasPrice,
calculateFee,
makeBkcRegistry,
} from "@bkc-network-lib/sdk";
const wallet = await DirectMldsa65HdWallet.fromMnemonic(mnemonic, { prefix: "bkc" });
const [{ address }] = await wallet.getAccounts();
const client = await SigningStargateClient.connectWithSigner(
"https://comet-rpc.bkc.network",
wallet,
{ registry: makeBkcRegistry() }, // registers /bkc.bkc.v1.* alongside the standard Cosmos types
);DirectMldsa65HdWallet derives keys from the mnemonic with BKC's HKDF scheme (see Accounts & keys); DirectMldsa65Wallet.fromSeed(seed, "bkc") takes a 32-byte seed.
Fees: always explicit
BKC cannot simulate transactions (it rejects SIGN_MODE_UNSPECIFIED), so "auto" gas does not work. Give every transaction a gas budget:
const gasPrice = GasPrice.fromString("5000000bkc");
const fee = calculateFee(300_000, gasPrice); // a send uses ~257k gasSend BKC
const result = await client.sendTokens(
address,
"bkc1recipient…",
[{ denom: "bkc", amount: "1000000000000000000" }], // 1 BKC (18 decimals)
fee,
);
console.log(result.transactionHash, result.code); // code 0 = successA bank MsgSend moves the same balance an EVM transfer does, but Blockscout indexes the EVM side: a Cosmos send does not get its own page on the explorer. For transfers users will look up, send over the EVM (signer.sendTransaction({ to, value })).
Staking
await client.delegateTokens(address, "bkcvaloper1…", { denom: "bkc", amount: "1000000000000000000" },
calculateFee(500_000, gasPrice));
await client.undelegateTokens(address, "bkcvaloper1…", { denom: "bkc", amount: "1000000000000000000" },
calculateFee(500_000, gasPrice)); // ~447k gas measured
await client.withdrawRewards(address, "bkcvaloper1…", calculateFee(400_000, gasPrice));Governance
Proposals and votes are standard x/gov messages, signed with the same client. Deposits on BKC are scaled for 18 decimals: the minimum deposit is 10 BKC (expedited: 50 BKC), and a proposal must be submitted with at least 25% of it.
Queries
Read-only queries need no signer:
import { StargateClient } from "@bkc-network-lib/sdk";
const ro = await StargateClient.connect("https://comet-rpc.bkc.network");
await ro.getBalance("bkc1…", "bkc");
await ro.getChainId(); // "bkc-testnet"or use the REST endpoint directly — see REST & gRPC.
Custom message types
To add a chain module of your own to the registry, follow CUSTOM_PROTOBUF_CODECS.md in packages/stargate of bkc-lib.
