WDK logoWDK documentation

Cosmos wallet API reference

API reference for the independently maintained @base58-io/wdk-wallet-cosmos module.

This page summarizes the public API exposed by @base58-io/wdk-wallet-cosmos based on the package README, package.json, generated TypeScript declarations, and source files from commit b924dba.

This module is developed and maintained independently by a third-party contributor. Tether and the WDK team do not endorse or assume responsibility for its code, security, or maintenance. Review the package and use your own judgment before using it with real funds.

Package

FieldValue
Package@base58-io/wdk-wallet-cosmos
Repositorybase58-io/wdk-wallet-cosmos
Main entryindex.js
Bare entrybare.js
Typestypes/index.d.ts

Exports

ExportDescription
defaultWalletManagerCosmos
WalletAccountCosmosCosmos wallet account implementation
CosmosWalletConfigWallet configuration type
ResolvedChainConfigResolved chain configuration type
resolveChainConfig(config)Resolves chain config from chain-registry or custom fields
getAvailableChains()Returns chain names available through the bundled chain-registry data
isKnownChain(chainName)Returns whether a chain name exists in the registry data

CosmosWalletConfig

FieldRequiredDescription
chainNameNoChain name from chain-registry, such as cosmoshub, osmosis, or juno.
rpcEndpointsNoRPC endpoint URLs. If provided, they override registry endpoints.
retryCountNoMaximum retry rounds for RPC fallback. Default is 3.
retryDelayNoBase retry delay in milliseconds. Default is 150.
addressPrefixNoBech32 address prefix. Defaults to cosmos when not resolved from registry.
nativeDenomNoNative token denomination. Defaults to uatom when not resolved from registry.
coinTypeNoBIP-44 coin type. Defaults to 118 when not resolved from registry.
gasPriceNoGas price with denomination, such as 0.025uatom.
transferMaxFeeNoMaximum fee amount for transfer operations.
ibcChannelsNoIBC channel map keyed by destination Bech32 prefix.

WalletManagerCosmos

import WalletManagerCosmos from '@base58-io/wdk-wallet-cosmos'

const manager = new WalletManagerCosmos(seed, config)
Method or propertyDescription
constructor(seed, config)Creates a manager from a BIP-39 seed phrase or seed bytes.
getAccount(index = 0)Returns the Cosmos account at a BIP-44 index.
getAccountByPath(path)Returns the Cosmos account for a specific BIP-44 derivation suffix.
getFeeRates()Returns normal and fast fee rates from chain-registry fee tiers or configured gas price. Requires RPC configuration.
isDisposedReturns whether the manager has been disposed.
dispose()Disposes cached wallet accounts and clears manager state.

WalletAccountCosmos

Method or propertyDescription
static create(seed, path, config)Creates an account for a BIP-44 path.
getAddress()Returns the Bech32 account address.
getBalance(denom?)Returns a token balance in base units. Defaults to the configured native denomination.
getTokenBalance(denom)Returns a single token balance in base units.
getTokenBalances(denoms)Returns balances for multiple denominations.
transfer(options)Sends a token transfer and returns the transaction hash and fee.
quoteTransfer(options)Quotes a transfer fee without sending.
keyPairReturns the account key pair.
sign(message)Signs an arbitrary message using ADR-36.
verify(message, signature)Verifies an ADR-36 signature.
signTransaction(transaction)Signs a Cosmos transaction without broadcasting it.
sendTransaction(transaction)Signs and broadcasts a Cosmos transaction.
quoteSendTransaction(transaction)Quotes a Cosmos transaction fee.
getTransactionReceipt(hash)Looks up a transaction by hash through RPC.
indexAccount index parsed from the derivation path.
pathFull account derivation path.
isDisposedReturns whether the account has been disposed.
dispose()Erases sensitive account data from memory and prevents further use.

Transfer options

The module uses WDK TransferOptions for token transfers.

FieldRequiredDescription
tokenYesCosmos denomination, such as uatom.
recipientYesDestination Bech32 address.
amountYesAmount in base units.

Helper functions

FunctionDescription
resolveChainConfig(config)Resolves a chain config from chainName, custom config, and chain-registry metadata. Throws if chainName is unknown.
getAvailableChains()Returns known chain names from chain-registry.
isKnownChain(chainName)Returns true when chainName is available in chain-registry.

Limitations

  • RPC endpoints are required for balance reads, fee quotes, transfers, and receipt lookup.
  • toReadOnlyAccount() is present on the account class but throws because read-only accounts are not implemented.
  • transferMaxFee rejects transfer or send quotes when the estimated fee is greater than or equal to the configured limit.
  • IBC transfer support depends on ibcChannels configuration for the destination Bech32 prefix.

On this page