You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the simulate function isn't available on the StargateClient, only the SigningStargateClient. But signing clients require access to the key, which isn't always practical or possible.
I've been able to hack together a key-less version based on the signing client's simulate method but official support in the StargateClient would be preferable.
constregistry=newRegistry([...defaultRegistryTypes, ...wasmTypes]);constencodedMsg=registry.encodeAsAny(message);constencodedPubkey=encodeSecp256k1Pubkey(Buffer.from(senderPubKey,'hex'));const{ sequence }=awaitstargateClient.getSequence(sender);const{ gasInfo }=awaitstargateClient// @ts-ignore force access to protected method.forceGetQueryClient().tx.simulate([encodedMsg],memo,encodedPubkey,sequence);constgasUnits=Uint53.fromString(gasInfo.gasUsed.toString()).toNumber();
The text was updated successfully, but these errors were encountered:
Currently, the simulate function isn't available on the
StargateClient
, only theSigningStargateClient
. But signing clients require access to the key, which isn't always practical or possible.I've been able to hack together a key-less version based on the signing client's simulate method but official support in the StargateClient would be preferable.
The text was updated successfully, but these errors were encountered: