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
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
Introduce a transaction preparation function to be utilised by connectors, via the connector interface. The expected signature is as follows:
/** * Should perform all necessary operations (i.e estimation, * funding, signing) to prepare a tx so it can be submitted * at the app level. * * @param address - The address to sign the tx * @param transaction - The tx to prepare * * @returns The prepared tx request */asyncprepareForSend(address: string,transaction: TransactionRequestLike): Promise<TransactionRequest>;
Utilise the preparation method inside Account.sendTransaction so that the process is still obfuscated to consumers.
For EVM and SVM wallets, all logic is inside the connector, so we need to do only the following
Introduce the new preparation method inside the relevant connector, identical to sendTransaction however passing back the prepared tx rather than submitting
Native Wallets
Wallets such as Fuel Wallet and Bako, more of the logic is on the wallet side so would involve the following:
Introduce the preparation method inside the wallet itself, with a new event to trigger the flow
Introduce the method inside the connector, that submits the event
The text was updated successfully, but these errors were encountered:
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: