SigningStargateClient works with EVM wallets without any special configuration.
When signing transactions, the client inspects the algo field from the wallet’s
AccountData and automatically selects the correct pubkey encoding.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Connecting SigningStargateClient with EVM wallets in CosmJS.
SigningStargateClient works with EVM wallets without any special configuration.
When signing transactions, the client inspects the algo field from the wallet’s
AccountData and automatically selects the correct pubkey encoding.
simulate()) always uses standard secp256k1 pubkey encoding
regardless of the wallet’s algo field. This means "auto" fees may produce
incorrect simulations with EVM wallets. Use explicit StdFee values instead of
"auto" when working with DirectEthSecp256k1HdWallet.import { SigningStargateClient, GasPrice, calculateFee } from "@cosmjs/stargate";
import { DirectEthSecp256k1HdWallet } from "@cosmjs/proto-signing";
const wallet = await DirectEthSecp256k1HdWallet.fromMnemonic(mnemonic, {
prefix: "cosmos",
});
const client = await SigningStargateClient.connectWithSigner(
"http://localhost:26661",
wallet,
{ gasPrice: GasPrice.fromString("0.025atest") },
);
const [{ address }] = await wallet.getAccounts();
// Use an explicit StdFee with EVM wallets — see the warning above.
const fee = calculateFee(200_000, GasPrice.fromString("0.025atest"));
const result = await client.sendTokens(
address,
"cosmos1recipient...",
[{ denom: "atest", amount: "1000000000000000000" }],
fee,
);
Was this page helpful?