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

Feature req: Queueing txs to send #60

Open
pi0neerpat opened this issue Jan 8, 2020 · 2 comments
Open

Feature req: Queueing txs to send #60

pi0neerpat opened this issue Jan 8, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@pi0neerpat
Copy link

pi0neerpat commented Jan 8, 2020

Hey guys it's me again, here to bother you. One feature that would be cool is the ability to queue up transactions that have already been signed by the user, and are waiting for a previous tx to confirm, before sending.

Scenario

user wants to call a contract function which will spend their DAI (such as rDAI mint). First they need to call approve on DAI, and wait for confirmation before submitting the mint.

Typical UX: sign, wait, sign, wait, done
Better UX if you batch the sigining: sign, sign, wait, done

Since we get all the signing out of the way first, it makes the experience much smoother, since there is only one "waiting" period for the user.

Options

Since the user may navigate away from the page, we need to store the second signed tx until the first one confirms. You can either send it to an external server to do this (booo, too centralized).
OR
We can store it in local storage using Subspace. Anytime the user is on any page, Subspace can check if there is a tx waiting to be confirmed, and submit the next sequential one if necessary.

contributing

I plan to implement this idea in my dapp anyways. Depending on your thoughts I'd be happy to share the code and maybe this is something worth contributing to.

@pi0neerpat pi0neerpat changed the title Feature request Feature req: Queueing txs to send Jan 8, 2020
@richard-ramos
Copy link
Member

Hey there, @pi0neerpat

This looks like an interesting idea, Currently Subspace is more of a tool to read the contract state, and query balances, but extending it's use to support async interactions with contracts as well would be a really nice addition!

If you don't mind, share your code, or feel free to send a PR this way! :) we'll probably discuss about this feature soon along with the 2020 roadmap for Subspace!

Thanks for the suggestion!

@richard-ramos richard-ramos added the enhancement New feature or request label Jan 30, 2020
@pi0neerpat
Copy link
Author

pi0neerpat commented Jan 31, 2020

I ended up just submitting both approve + mint at the same time, and just incrementing the nonce. I didn't end up needing anything fancy like this.

However storing tx and monitoring status would still be cool. I would use it to let users navigate away and come back, and I can still guide/handhold them through the dapp depending if their tx is "pending" (show waiting prompt) or "confirmed" (alert and take them to the proper page). I'm sure this is how BlockNative does this.

I guess this would be more of a limited feature set, since it's just a matter of making it easier for the dapp dev to subscribe to a specific tx, and adding callbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants