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
I gather my remarks on the transaction handling that we had in Pioneer and what we could do better.
First of all, our hook is too tied to the code used for modal creations so it is not worth porting 1:1.
From the UI perspective we needed:
handling transaction fee before gathering user input (we have useTransactionFee() checks that). Again, I don't see that's needed in a general library
automatic way of displaying transaction states (this was done using xstate because of the flows that were using machines anyway)
only extension signing (no built-in accounts)
What I see that's needed is this:
a simpler status (just a type returned from hook)
signing with multiple types of accounts requires different handling AFAIR and checking keyring if the account is injected or not. But the API might be simple. See this change of removing dev accounts)
Usually, there's a need to display the transaction fee (using paymentInfo) - but that requires signing address AFAIR. So the signer account might be passed to hook as well.
Usually, we want to get some information out of the events → recently I found getDataFromEvent() with proper types quite helpful
The batch transactions might fail but some of the transactions in the batch will pass → harder to set status PASS / FAIL
Transaction result will be queryable after 'inBlock' (confirmation comes a bit later 'finalized')
It would be worth investigating if using promise instead of observable could result in more readable code
The text was updated successfully, but these errors were encountered:
I gather my remarks on the transaction handling that we had in Pioneer and what we could do better.
First of all, our hook is too tied to the code used for modal creations so it is not worth porting 1:1.
From the UI perspective we needed:
useTransactionFee()
checks that). Again, I don't see that's needed in a general libraryxstate
because of the flows that were using machines anyway)What I see that's needed is this:
paymentInfo
) - but that requires signing address AFAIR. So the signer account might be passed to hook as well.getDataFromEvent()
with proper types quite helpfulThe text was updated successfully, but these errors were encountered: