chainapsis / keplr-wallet

The most powerful wallet for the Cosmos ecosystem and the Interchain
https://www.keplr.app
Other
775 stars 463 forks source link

send tx like this,old version keplr is work good ,new version can not work . #737

Closed z497688734 closed 1 year ago

z497688734 commented 1 year ago
image

const pubk = Any.fromPartial({ typeUrl: "/ethermint.crypto.v1.ethsecp256k1.PubKey", value: PubKey.encode({ key: pubkeyBytes }).finish(), }) let sequence = 2 let gasLimit = 100000000 const authInfoBytes = makeAuthInfoBytes([{ pubkey: pubk, sequence }], "1000000000000000abc", gasLimit); console.log("authInfoBytes:",authInfoBytes) const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, 23); const { signature, signed } = await signer.signDirect(address, signDoc); console.log("signature:",signature) const a = TxRaw.encode({ bodyBytes: signed.bodyBytes, authInfoBytes: signed.authInfoBytes, signatures: [fromBase64(signature.signature)], }).finish()

Thunnini commented 1 year ago

Can you give me a webpage that I can use, or show me the "console" part in "Inspect" after right-clicking on the extension?

z497688734 commented 1 year ago

Can you give me a webpage that I can use, or show me the "console" part in "Inspect" after right-clicking on the extension?

Thank you for your reply. https://github.com/z497688734/glitter-wallet-keplr.git ,
this code can work well in previous version of keplr can can not work in new version(12)

image

you can down the code and run it . 1 npm install , 2 npm run dev . node14 or node18 is ok.

Thunnini commented 1 year ago

const authInfoBytes = makeAuthInfoBytes([{ pubkey: pubk, sequence }], "1000000000000000agli", gasLimit); If you look at this part, feeAmount is entered incorrectly. Perhaps [{denom:"agli", amount: "1000000000000000"}] was your intent. The difference between 1.0 and 2.0 comes from improvements in the logic, but it's not wrong that 2.0 throws an error because you asked for a signature in the wrong form.

z497688734 commented 1 year ago

const authInfoBytes = makeAuthInfoBytes([{ pubkey: pubk, sequence }], "1000000000000000agli", gasLimit); If you look at this part, feeAmount is entered incorrectly. Perhaps [{denom:"agli", amount: "1000000000000000"}] was your intent. The difference between 1.0 and 2.0 comes from improvements in the logic, but it's not wrong that 2.0 throws an error because you asked for a signature in the wrong form.

yes it work well now;thanks very much.