Skip to content
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

feat!: fetch base asset ID from chain #1976

Merged
merged 231 commits into from Apr 25, 2024
Merged

Conversation

danielbate
Copy link
Contributor

@danielbate danielbate commented Mar 29, 2024

Closes #1948

Breaking Changes:

  • BaseAssetId is no longer exported by fuels. It must be fetched from the chain as it is configurable by the chain.
// Before
import { BaseAssetId } from `fuels`;

// After
const provider = await Provider.create(FUEL_NETWORK_URL);
const baseAssetId = provider.getBaseAssetId();
  • TransactionRequest.addCoinOutput now requires an assetId, it no longer defaults to the baseAssetId.
  • TransactionRequest.addChangeOutput now requires an assetId, it no longer defaults to the baseAssetId.
  • TransactionRequest.fundWithFakeUtxos now requires passing the baseAssetId as a function parameter. This is the only function that is base asset aware, so that it can be used specifically to estimate the transaction cost.
  • CoinQuantityLike now requires an AssetId. Previously most of it's usages would default to the BaseAssetId, as this must now be fetched, then it must be passed to the type.

@petertonysmith94
Copy link
Contributor

Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🍏

@petertonysmith94 petertonysmith94 dismissed Torres-ssf’s stale review April 25, 2024 17:55

Changes have been made - please re-review

Base automatically changed from db/chore/experimental-forc-in-all-projects to master April 25, 2024 18:01
Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wunderbar 🪄

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
79.89%(+0.02%) 70.04%(+0.04%) 77.53%(+0.03%) 80.03%(+0.02%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/account.ts 76.81%
(+0.3%)
55.22%
(+1.26%)
81.81%
(+0%)
76.81%
(+0.3%)
🔴 packages/account/src/predicate/predicate.ts 29.41%
(-0.59%)
34.48%
(-1.23%)
20%
(+0%)
29.41%
(-0.59%)
packages/account/src/providers/coin-quantity.ts 100%
(+0%)
100%
(+6.25%)
100%
(+0%)
100%
(+0%)
🔴 packages/account/src/providers/provider.ts 79.44%
(+0.22%)
64.74%
(+0%)
85.5%
(+0.21%)
80.06%
(+0.2%)
🔴 packages/account/src/providers/transaction-request/create-transaction-request.ts 58.82%
(+0%)
57.14%
(+3.81%)
37.5%
(+0%)
58.82%
(+0%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 85%
(-0.1%)
71.42%
(+1.98%)
86%
(+0%)
84.82%
(-0.11%)
🔴 packages/account/src/test-utils/launchNode.ts 100%
(+0%)
87.03%
(-1.43%)
64.7%
(+0%)
93.47%
(+0.07%)

@danielbate danielbate merged commit b026feb into master Apr 25, 2024
17 checks passed
@danielbate danielbate deleted the db/feat/dynamic-base-asset branch April 25, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic base asset ID
6 participants