Skip to content

Get "Unmatched chain id with the offline signer" with last updates #131

Open
@zhmoly

Description

@zhmoly

I used secretjs alpha version before.
And used keplr wallet for query & broadcast transactions.
It was works fine before I updated secretjs version.
But when I update with v1.5, get this error: "Unmatched chain id with the offline signer".
Of course, set chainid as "pulsar-2" for both client side and wallet setting.

this.scrtSecretJs = new SecretNetworkClient({ url: env.grpcurl, chainId: env.CHAIN_ID, wallet: keplrOfflineSigner, walletAddress: this.scrtUsrPubkey, encryptionUtils: this.scrtKeplr.getEnigmaUtils(env.CHAIN_ID), });

After my own research, I find this issue related with parameter names.
For old version, there is _ for parameters. (ex: chain_id => chainId, code_id => codeId).
But names updated and some wallet sdk (not sure that) is just working with chain_id.

This one is what I find that error part in CosmJSOfflineSigner. (from chrome console, not from github source).
e.CosmJSOfflineSigner = class extends i { constructor(t, e) { super(t, e), this.chainId = t, this.keplr = e } signDirect(t, e) { return n(this, void 0, void 0, (function*() { if (this.chainId !== e.chainId) throw new Error("Unmatched chain id with the offline signer"); if ((yield this.keplr.getKey(e.chainId)).bech32Address !== t) throw new Error("Unknown signer address"); return yield this.keplr.signDirect(this.chainId, t, e) } )) } }

And this is chainId compare part.
image

So chainId is same, but name is different.
Is there any way to resolve this issue?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions