Skip to content
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

Support send with offline signature. #7

Closed
jnaviask opened this issue Jul 9, 2019 · 4 comments
Closed

Support send with offline signature. #7

jnaviask opened this issue Jul 9, 2019 · 4 comments

Comments

@jnaviask
Copy link

jnaviask commented Jul 9, 2019

Currently there is no way to easily perform the following workflow:

  1. Generate a transaction without a signature.
  2. Create a signature from the transaction via command line (offline).
  3. Construct the signed transaction.
  4. Broadcast the signed transaction.

Steps 1-3 are more or less doable, but there's no function to send a transaction signed offline.

The most obvious solution would be to refactor this piece into a separate "broadcastSignedTx()" function: https://github.com/luniehq/cosmos-api/blob/develop/src/send.js#L11 I can submit a PR if that would help. Thanks!

@faboweb
Copy link
Contributor

faboweb commented Jul 24, 2019

Hey! Sorry for the long delay. Simplest solution is to create an offlineSigner (() => ({ publicKey, signature })) function which just returns the signature. This then can be used in the send function (https://github.com/luniehq/cosmos-api/blob/develop/src/send.js#L7).

@faboweb
Copy link
Contributor

faboweb commented Jul 24, 2019

I am open to see your helper function if you think it will provide value!

@faboweb
Copy link
Contributor

faboweb commented Jul 24, 2019

Another question: If you are using the CLI to sign, why are you not using the CLI for generation of the tx and broadcasting it?

@jnaviask
Copy link
Author

Another question: If you are using the CLI to sign, why are you not using the CLI for generation of the tx and broadcasting it?

I'll look into whether that makes sense for us -- we're building a front-end, and I assumed we'd want to do as much as possible on it, but it may also make sense to direct users to the CLI for the entire transaction.

faboweb added a commit that referenced this issue May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants