-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to obtain OfflineSigner? #17
Comments
Also, are there any plans for the |
Are you trying to broadcast transactions programmatically? If so, in v0.0.38, we have added the
Yes, but it's rather low priority at the moment since we do not have a use case for them. Do you require |
Hi @AaronCQL thanks for the response! I am working in a dApp context, so I do not have access to the wallet mnemonic, therefore I can't use For my use case, I only need |
@siddharth-leap specifically, you'd like to use the |
If you implement I want to understand why you are inclined towards implementing |
This library is meant to completely replace cosmjs, and is not meant to be compatible with cosmjs. We won't be able to use the same method signatures as cosmjs's In terms of structuring the API, having the sign methods within the What's your exact use case for having |
Okay I understand. The I have seen across various dApps that an OfflineSigner object is used to instantiate a const offlineSigner = window.leap.getOfflineSigner('osmosis-1');
const client = await SigningStargateClient.connectWithSigner(rpc, offlineSigner, {
registry: customRegistry,
broadcastTimeoutMs: 60_000
});
client.simulate()
client.sign()
client.broadcastTx() |
The A similar flow to your code can be done in cosmes as well: import { LeapController, WalletType } from "cosmes/wallet";
const WC_PROJECT_ID = "TODO";
const controller = new LeapController(WC_PROJECT_ID);
const wallets = await controller.connect(WalletType.EXTENSION, [
{
chainId: "osmosis-1",
rpc: "https://rpc.osmosis.zone",
gasPrice: {
amount: "0.0025",
denom: "uosmo",
},
},
]);
const wallet = wallets.get("osmosis-1");
wallet.estimateFee(...); // similar to `client.simulate()`
wallet.broadcastTxSync(...); // combines both `client.sign()` and `client.broadcastTx()` For our dapps' usecases, there is no need to separate the signing from the broadcasting, which is why cosmes combines them both into the same call. |
Thank you for the clarification. I can use these methods for my use case. I think exposing Thank you for your time! |
Hi @AaronCQL any updates on this? |
This PR changes the behaviour of all wallets such that the `signAndBroadcastTx` method will always broadcast via the user specified RPC, rather than broadcasted via the wallet extension. Unfortunately, Station mobile app does not support signing a tx without broadcasting it. Closes #17
@AaronCQL Thank you for implementing this feature! 🎉 |
Is there a way to get an
OfflineAminoSigner
(definition) orOfflineDirectSigner
(definition)?The text was updated successfully, but these errors were encountered: