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
635 stars 328 forks source link

signDirect return signed value, I need to get "chainId" field. #1499

Open luis360 opened 9 months ago

luis360 commented 9 months ago

signingcosmwasmclient.ts signDirect const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc); return TxRaw.fromPartial({ bodyBytes: signed.bodyBytes, authInfoBytes: signed.authInfoBytes, signatures: [fromBase64(signature.signature)], });

Is it possible to return signed? I need to get the "chainId" field. I need to deserialize the signed parameters, which is a very important risk control strategy

webmaster128 commented 8 months ago

The chain ID value is not exposed here. You'd need your own clone of signDirect to be able to access the value.

However, what's the use case for this? The chain would reject a transaction with the wrong chain ID anyways.