Skip to content

Conversation

@danielbate
Copy link
Contributor

@danielbate danielbate commented Mar 12, 2025

Release notes

In this release, we:

  • Added the onBeforeAssembleTx hook to wallet connectors for quicker estimation
  • Enabled a snappier transaction summary generation flow for connectors

Summary

This PR introduces two approaches to enable more optimal transaction speeds from estimation to summary generation:

Connector Aware Estimation

Adds the onBeforeAssembleTx function to the connector interface. This allows for connector specific modifications to a transaction request to be added before the SDK assembles the transaction. A specific use case for this is the SVM/EVM connectors that fund a transaction using an associated predicate account.

Inverted Submission Flow

Utilises the change made to the connector.sendTransaction() signature in #3669 whereby we can now return a string | TransactionResponse.

sendTransaction(
address: string,
transaction: TransactionRequestLike,
params?: FuelConnectorSendTxParams
): Promise<string | TransactionResponse>;

This approach enables #3665 to allow connector transactions to submit and generate a transaction summary in apps in a single request.

Proof Of Concept

A demo using the above approaches can be seen in the connectors repo here. The result of which can be seen here:

Screen.Recording.2025-03-21.at.12.10.52.mov

Running against Devnet on fuel-core@0.42.0

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

petertonysmith94 and others added 30 commits February 24, 2025 15:40
* feat: implement flags for the transaction request

* chore: combine flags for `isEstimated` and `isFunded`

* chore: remove `isSigned` from witness updates

* changeset

* revert experimental changes

* Aligned to the new re-spec

* update to state

* Update state

* chore: fix connector test

* lintfix

* Apply suggestions from code review
* chore: moved chainInfo serialization

* chore: added serialize chain info

* move chain info helper

* add deprecation notice

* chore: added deserialize of nodeInfo

* Added the ability to restore the provider chain + node info cache

* consolidate serialization

* serialize provider cache

* pass serialized chain to connector

* lintfix

* lintfix

* changeset

* changeset

* lintfix
@github-actions
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
77.2%(+0.07%) 70.39%(+0.04%) 75.4%(+0.12%) 77.21%(+0.08%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/coin-quantity.ts 100%
(+0%)
90%
(-10%)
100%
(+0%)
100%
(+0%)
🔴 packages/account/src/providers/provider.ts 69.73%
(+1.23%)
64.35%
(+0.93%)
71.13%
(+2.06%)
69.46%
(+1.2%)
🔴 packages/account/src/providers/generated/operations.ts 93.29%
(+0.13%)
100%
(+0%)
80%
(+0.38%)
93.82%
(+0.15%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 87.91%
(+0%)
74.69%
(-1.21%)
84.31%
(+0%)
88.15%
(+0%)
🔴 packages/account/src/test-utils/launchNode.ts 94.87%
(+0.05%)
82.35%
(+0.54%)
90.9%
(+0%)
93.44%
(+0.06%)

@arboleya
Copy link
Contributor

Closing in favor of [the upcoming]:

@arboleya arboleya closed this Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:signed feat Issue is a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connector Aware Estimation

6 participants