cosmos / cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
https://cosmos.github.io/cosmjs/
Apache License 2.0
645 stars 330 forks source link

ERROR Broadcasting transaction failed with code 7 (codespace: sdk). Log: at SigningStargateClient.broadcastTx #1471

Open lrlazy opened 1 year ago

lrlazy commented 1 year ago

use this code

import { calculateFee } from '@cosmjs/stargate';

...

const fee = calculateFee(100000, "0.1usei"); const amount = { amount: SEND_AMOUNT, denom: TOKEN_DENOM };

const sendResponse = await signingClient.sendTokens(SENDER_ADDRESS, DESTINATION_ADDRESS, [amount], fee);

webmaster128 commented 10 months ago

Can you share the full error message? Error sdk/7 is probably this one:

    // ErrInvalidAddress to doc
    ErrInvalidAddress = errorsmod.Register(RootCodespace, 7, "invalid address")

Not sure what it means in your case though