Open francisblakewood opened 2 weeks ago
Following docs for setting up leap to be able to sign message crashes Leap wallet extension (version: "0.15.6").
** Aditionally - same code works with window.keplr
Reference imports:
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx"; import { Registry, } from "@cosmjs/proto-signing"; import { AminoTypes, createDefaultAminoConverters, defaultRegistryTypes, SigningStargateClient, } from "@cosmjs/stargate"; import { createWasmAminoConverters, wasmTypes, } from "@cosmjs/cosmwasm-stargate";
versions:
"@cosmjs/amino": "^0.32.4", "@cosmjs/cosmwasm-stargate": "^0.32.4", "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "0.32.4",
Reference code:
const leap = window.leap; if (!leap) { console.log("leap wallet not installed"); } else { await leap.enable(chainId); const signOptions = { preferNoSetFee: true, preferNoSetMemo: true, disableBalanceCheck: true, }; const offlineSigner = leap.getOfflineSigner( destinationChain.chainExternalId, signOptions ); const stargateClient = await SigningStargateClient.connectWithSigner( "rpc-url", offlineSigner, { registry: new Registry([ ...defaultRegistryTypes, ...wasmTypes, ]), aminoTypes: new AminoTypes(aminoConverters), } ); const account = await stargateClient.getAccount(account_address); const signerData = { accountNumber: account.accountNumber, chainId: destinationChain.chainExternalId, sequence: account.sequence, }; const messages = { typeUrl: messageData.typeUrl, value: { sender: messageData.value.sender, contract: messageData.value.contract, msg: encoding.encode(messageData.value.msg), funds: messageData.value.funds, }, }; const respoonse: TxRaw = await stargateClient.sign( account_address, messages, { amount: [], gas: "1000000", }, "", signerData ); }
Signing Stargate Client crashing while message signing
Summary:
Following docs for setting up leap to be able to sign message crashes Leap wallet extension (version: "0.15.6").
** Aditionally - same code works with window.keplr
Reference imports:
versions:
Reference code: