-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Inverted Submission Flow #3665
Comments
In #3689 I introduced a I'm going to revert #3869 so it is not included in |
In #3669 we changed the fuels-ts/packages/account/src/connectors/fuel-connector.ts Lines 47 to 51 in e8494fa
Although this does not encourage connectors or wallets to return a prepared request to give full flexibility to the SDK, it does enable the single request submit -> summary flow. This may be enough for now and we can implement in the EVM/SVM connectors along with #3769. But as preferred by @LuizAsFight, the Wallet will likely remain with the same 3 request flow for now. I will prepare a draft PR to follow #3769 that supports this flow in docs/tests. |
@danielbate Two quick questions:
|
3 request flow from submission -> summary generation.
No the wallet will remain as it is and will not lose it's snappiness. Only the App/SDK can be made snappier from this change. |
Problem
When a transaction is submitted from a connector and approved in a user wallet, it takes 3 requests to submit a tx and build it's summary inside the application. Versus it only taking 1 request when submitting a tx from the SDK when we have the private key readily accessible.
The main reason for this is that as the wallet submits the tx, the application loses context of both the submission and finalised transaction, and therefore it must fetch both the raw tx and tx status to build it's summary.
This issue aims to bring parity to these 2 flows and enable single request submission and summary inside apps using connectors, as visualised below:
Solution
To enable the above flow, the app must take ownership of tx submission. With the wallet passing back the finalised tx, propagated via the connectors.
This would involve the following work:
SDK
Account.sendTransaction
so that the process is still obfuscated to consumers.fuels-ts/packages/account/src/account.ts
Lines 653 to 659 in 01375ce
Non Native Wallets
For EVM and SVM wallets, all logic is inside the connector, so we need to do only the following
sendTransaction
however passing back the prepared tx rather than submittingNative Wallets
Wallets such as Fuel Wallet and Bako, more of the logic is on the wallet side so would involve the following:
The text was updated successfully, but these errors were encountered: