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
Connector Aware Estimation is the process of giving the SDK more awareness of the account level semantics earlier in the transaction flow to reduce round trips to the network.
Problem
Let's imagine the following transaction flow for non-native wallets:
In the first stage, the SDK estimates the transaction as normal.
Once it hands off to the connector, and we introduce the non-native account, we must add the predicate to the transaction. Therefore meaning the transaction must be re-prepared.
This is obvious redundancy that could be mitigated by giving the SDK the context earlier in the flow:
Potential Solution
Introduce a prepareTransaction function to the connector interface, that can alter a transaction request with any of it's own specifics, such as adding the non-native predicate.
/** * Modifies a transaction request with anything connector specific. * * @param transaction - The tx to prepare. * * @returns The prepared tx request */asyncprepareTransaction(transaction: TransactionRequestLike): Promise<TransactionRequest>;
Introduce connector.prepareTransaction() at the estimation and funding SDK entry points.
Remove connector level estimation and funding from within the connector.sendTransaction() calls.
Notes
Must be additive, allowing for gradual upgrade by the connectors
@petertonysmith94 I think I was overdoing it in our previous discussion, something simple like this would work by moving the connector level logic from submission -> preparation.
But have a look and see what you think, I will pick up any progress made next week :)
TLDR
Connector Aware Estimation is the process of giving the SDK more awareness of the account level semantics earlier in the transaction flow to reduce round trips to the network.
Problem
Let's imagine the following transaction flow for non-native wallets:
In the first stage, the SDK estimates the transaction as normal.
Once it hands off to the connector, and we introduce the non-native account, we must add the predicate to the transaction. Therefore meaning the transaction must be re-prepared.
This is obvious redundancy that could be mitigated by giving the SDK the context earlier in the flow:
Potential Solution
prepareTransaction
function to the connector interface, that can alter a transaction request with any of it's own specifics, such as adding the non-native predicate.connector.prepareTransaction()
at the estimation and funding SDK entry points.connector.sendTransaction()
calls.Notes
prepareForSend
- Inverted Submission Flow #3665The text was updated successfully, but these errors were encountered: