Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with a local chain and keplr #315

Closed
arthuryeti opened this issue Sep 7, 2023 · 2 comments
Closed

Issue with a local chain and keplr #315

arthuryeti opened this issue Sep 7, 2023 · 2 comments

Comments

@arthuryeti
Copy link

Hey there,

I was configuring cosmoskit with a local chain and I keep getting a weird error with keplr wallet.

Error: Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (3), sequence (3) and chain-id (local): unauthorized

and this is the config code.

const defaultConfig = {
  gasPrice: GasPrice.fromString("0.03ulocal"),
};

const signerOptions: SignerOptions = {
  signingStargate: (_chain: Chain) => {
    return {
      ...getSigningLocalClientOptions({
        defaultTypes: defaultRegistryTypes,
      }),
      gasPrice: defaultConfig.gasPrice,
    };
  },
  signingCosmwasm: (chain: Chain) => {
    switch (chain.chain_name) {
      case localChain.chain_name:
        return defaultConfig;
    }
  },
};

export const CosmosKitProvider = ({ children }: Props) => {
  return (
    <ChainProvider
      chains={[localChain]}
      assetLists={[localAssets]}
      wallets={wallets}
      signerOptions={signerOptions}
      endpointOptions={{
        isLazy: true,
        endpoints: {
          local: {
            rpc: [process.env.NEXT_PUBLIC_CHAIN_RPC_ENDPOINT],
            rest: [process.env.NEXT_PUBLIC_CHAIN_ENDPOINT],
          },
        },
      }}
    >
      {children}
    </ChainProvider>
  );
};

Do you have an idea why?

@webmaster128
Copy link

"signature verification failed" can have dozens of different reasons in the signing process.

What's your chain ID? Is it really "local"?

@arthuryeti
Copy link
Author

New update :)

it's working when I use "direct" instead of "amino" as a signerType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants