-
Notifications
You must be signed in to change notification settings - Fork 106
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
Extension: return transaction hash on send #666
Comments
I will look into this properly later, but just to let you know there is the |
@emccorson any docs on how to catch that
probably this: import { useEventListener } from "@namada/hooks";
import { Events } from "@namada/types";
useEventListener(Events.TxCompleted, () => {
// ....
}); |
@emccorson looks like events don't work at all. Minimal code to reproduce window.addEventListener("namada-account-changed", function(e){
console.log("namada-account-changed", e);
});
window.addEventListener("namada-extension-locked", function(e){
console.log("namada-extension-locked", e);
}); |
@thousandsofthem Thanks for the report. I think you've uncovered a bug there. #670 |
@CroutonDigital Namada transactions have two hashes: a wrapper hash and an inner hash. Do you know offhand which one you need (or both)? I have the code to send the hash in the event (and to fix the events generally), but I just need to figure out how to get the hash from the transaction. |
@emccorson the one that can be displayed on explorer or anything like that. Something user can interact with. Let's go with both for now and figure out which is better later |
I asked around about this a bit more and I think the one we want is the inner tx hash. The PR is now ready for review so hopefully it will get merged soon 👍 I also think we can add better documentation for the extension events, so I've tracked it here: #672 |
I also have in mind that the events approach may not be sufficient for tracking multiple transactions e.g. if you submit two transactions at once, when the event comes back, how will you know which transaction it was that completed? There is another PR #658 that would solve this using promises, but it is not reviewed yet. This problem will need some thought... |
Hmm, very true. There has to be an identifier that exists until the transaction has gone through completely (probably For the event approach the client has to know upon a wallet interaction which Is there an event that triggers when one intiates a tx and does this return the |
At this moment namada-extension does not expose Transfer/Transaction status nor transaction hash after request was made.
It's not possible to build good UI without it, bare minimum would be status (sent successfully or rejected/error) and transaction hash in case of success
The text was updated successfully, but these errors were encountered: