Skip to content

Releases: FuelLabs/fuels-ts

v0.97.0

15 Nov 13:17
537fdc2
Compare
Choose a tag to compare

Summary

In this release, we:

  • Implemented batch transfer to contracts
  • Optimized the getMessageByNonce provider endpoint
  • Upgraded fuel-core to v0.40.0
  • Optimize graphQL query for Provider.getTransactions
  • Limit pagination number for getTransactionsSummaries to 60
  • Upgraded forc to v0.66.4
  • Removed blockId property from responses when listing transactions
  • Upgraded forc to v0.66.2
  • Deprecate and fix multiple receipts properties
  • Optimized the getCoins provider endpoint
  • Revised our code snippets to use a WYSIWYG format

Breaking


Features

Fixes

Chores

Docs


Migration Notes

Features

#3383 - onDeploy fuels config supports all Sway program types

  • Changed the outputted data from the onDeploy callback method for the fuels.config.ts. Instead of just emitting the deployed contracts (as an array), it will now emit an object with contracts, predicates and scripts.
// Before (fuels.config.ts)
import { createConfig, FuelsConfig, DeployedContract } from 'fuels';

export default createConfig({
  output: 'dir/out',
  onDeploy: (config: FuelsConfig, deployedContracts: DeployedContract[]) => {
    console.log('contracts', deployedContracts);
  }
});
// After (fuels.config.ts)
import { createConfig, FuelsConfig, DeployedData } from 'fuels';

export default createConfig({
  output: 'dir/out',
  onDeploy: (config: FuelsConfig, deployed: DeployedData[]) => {
    console.log('contracts', deployed.contracts);
    console.log('predicates', deployed.predicates);
    console.log('scripts', deployed.scripts);
  }
});

Fixes

#3298 - Remove unnecessary nonce from message gql queries

  • Removed the nonce property from Provider.operations.getMessageByNonce(). This can still be retrieved by Provider.getMessageByNonce().

Chores

#3389 - Refactor predicate and script deployment

ContractFactory.deployAsBlobTxForScript has been removed in favor of Predicate.deploy and Script.deploy:

// before
const factory = new ContractFactory(scriptBytecode, scriptAbi, wallet);
const { waitForResult } = await factory.deployAsBlobTxForScript();
const { loaderBytecode, configurableOffsetDiff } = await waitForResult();

// after
const script = new Script(scriptBytecode, scriptAbi, wallet);
const { blobId, waitForResult } = await script.deploy(deployerWallet);
const loaderScript = await waitForResult();

const predicate = new Predicate({ bytecode, abi, provider });
const { blobId, waitForResult } = await predicate.deploy(deployerWallet);
const loaderPredicate = await waitForResult();

#3387 - Mandate abi in Predicate constructor

Instantiating a Predicate now requires providing its abi. If you want to use the Predicate as an Account, please instantiate it via the Account class

// before
const predicate = new Predicate({ provider, bytecode }); // worked even though abi is missing

// after
const predicate = new Predicate({ abi, provider, bytecode }); // abi is now mandatory

// predicate as account
const account = new Account(predicateAddress, provider);

#3336 - Optimize getTransactions query

The response format for Provider.getTransactions remains the same. However, the response format for the query Provider.operations.getTransactions has been modified.

// before
query getTransactions {
  id
  rawPayload
  status {
    ...
  }
}
// after
query getTransactions {
  rawPayload
}

#3400 - Limit TX pagination number for getTransactionsSummaries

The pagination number for getTransactionsSummaries is limited to 60 now

// before
const { transactions } = await getTransactionsSummaries({
  provider,
  filters: {
    owner: account.address.toB256(),
    first: 200,
  },
});
// after
const { transactions } = await getTransactionsSummaries({
  provider,
  filters: {
    owner: account.address.toB256(),
    first: 60, // Limit is 60 now. A higher value will result in an error
  },
});

#3379 - Remove blockId in transaction list responses

The blockId property has been removed from the following GraphQL queries used to list past transactions:

const { transactions } = await getTransactionsSummaries({ ... });

const { transactionsByOwner } = await provider.operations.getTransactionsByOwner({ ... });

If the blockId is required for a given transaction, it needs to be queried separately with getTransactionSummary helper:

import { getTransactionSummary } from 'fuels';

const transaction = await getTransactionSummary({
  id,
  provider,
});

Note: The blockId is still available in the result for a submitted transaction.

#3301 - Optimize coin gql queries

  • The Provider.operations.getCoins() and Provider.operations.getCoinsToSpend function no longer return the owner. These methods shouldn't be called directly but are used internally to formulate responses from the SDK.

  • Removed the property owner from the Provider.operations.getCoinsToSpend() function. Suggest to use the owner from the input parameters.

v0.96.1

14 Oct 02:29
9ebd6c2
Compare
Choose a tag to compare

Summary

In this release, we:

  • Improved Provider cache to self-clean on TX dry-run/estimation
  • Use a modifier of 20% for estimated gas
  • Fixed the listener setup for the current connector
  • Fixed a bug where bn.parseUnits wouldn't work as expected with units = 0
  • Upgraded fuel-core to 0.39.0

Features

Fixes

Chores

v0.96.0

13 Oct 02:32
48598be
Compare
Choose a tag to compare

Summary

In this release, we:

  • Fixed checksum utility to correctly remove 0x before hashing

Breaking


Migration Notes

Fixes

#3313 - Checksum method to remove 0x before hashing

We fixed the checksum utilities:

  • Address.toChecksum()
  • Address.isChecksumValid()

Now, we correctly remove the leading 0x before hashing the address.

Because of this, previous values were invalid, and the update is required.

v0.95.0

10 Oct 21:30
ffd3d6c
Compare
Choose a tag to compare

Summary

In this release, we:

  • Added new checksum utility to the Address class
  • Added Provider methods isUserAccount and getAddressType which indicate the type of the hex passed
  • Added a new header for GraphQL requests with the fuels version used
  • Added a limit of 30 transactions to the provider.getTransactions() method.
  • fixed an issue where formatting with 0 in the bn class returned an incorrect value
  • Fixed caching of chain and node data in Provider.
  • Fixed typegen template for ContractFactory
  • Updated to fuel-core@0.37.1
  • Updated to forc@0.65.1
  • Updated create-fuels toolchain file
  • Updated to forc@0.65.2
  • Made Address.toString and Address.valueOf returns the Address checksum
  • Updated fuel-core to 0.38.0
  • Optimised the provider balance queries
  • Optimize the getBlockWithTransactions query

Breaking


Features

Fixes

Chores


Migration Notes

Features

#3306 - Bump transaction pagination limit to 60

  • A limit was added of 60 transactions to the provider.getTransactions() method.

Chores

#3310 - Made Address toString and valueOf returns checksum

The return of both Address.toString() and Address.valueOf was modified to return the address checksum instead of the Bech32 string

// before
const address = new Address('fuel1elnmzsav56dqnp95sx4e2pckq36cvae9ser44m5zlvgtwxw49fmqd7e42e');

address.toString()
// fuel1elnmzsav56dqnp95sx4e2pckq36cvae9ser44m5zlvgtwxw49fmqd7e42e

address.valueOf()
// fuel1elnmzsav56dqnp95sx4e2pckq36cvae9ser44m5zlvgtwxw49fmqd7e42e
// after
const address = new Address('fuel1elnmzsav56dqnp95sx4e2pckq36cvae9ser44m5zlvgtwxw49fmqd7e42e');

address.toString()
// 0xEf86aFa9696Cf0dc6385e2C407A6e159A1103cEfB7E2Ae0636FB33d3cb2A9E4A

address.valueOf()
// 0xEf86aFa9696Cf0dc6385e2C407A6e159A1103cEfB7E2Ae0636FB33d3cb2A9E4A

#3286 - Slim down chainInfoFragment and GasCostsFragment

  • latestBlock is no longer part of the ChainInfo return of provider.getChain(). You can fetch it via provider.getBlock('latest').
  • ChainInfo['consensusParameters']['gasCosts'] has been slimmed down to only contain data necessary for the operation of the SDK. Up until now, the SDK was fetching more than it needed. If this change affects you, you will have to create a custom graphql query for gasCosts for the additional data you need.

#3296 - Optimize balance queries

  • Removed the owner and assetId properties from the response of Provider.operations.getBalance(). These properties are also required arguments to execute the function so are redundant in the response. Should you require these values, you should take them from the values that you passed to the function.
  • Removed the owner property from the response of Provider.operations.getBalances(). This property is a required argument to execute the function so is redundant in the response. Should you require this value, you should take it from the value that you passed to the function.

v0.94.9

07 Oct 02:39
1991f97
Compare
Choose a tag to compare

Summary

In this release, we:

  • Added support for deploying scripts and predicates
  • Upgraded to fuel-core@0.37.0
  • Upgraded to forc@0.65.1
  • Fixed contracts containing storage deployed with a proxy via fuels deploy

Features

Fixes

Chores

v0.94.8

27 Sep 15:46
8321098
Compare
Choose a tag to compare

Summary

In this release, we:

  • Revamped the UX for fuels default template

Features

Fixes

  • #3219 - Reduce flakiness by favoring port 0 over portfinder dependency, by @nedsalk

Chores

v0.94.7

27 Sep 09:23
e6f6965
Compare
Choose a tag to compare

Summary

In this release, we:

  • Upgraded fuel-core to v0.36.0
  • Upgraded forc to v0.63.6 and v0.64.0
  • Added support for SRC-14 proxy contracts in fuels deploy
  • Removed assets from sepolia / testnet network
  • Fixed decimals of some assets on fuel network side
  • Added flag to indicate whether a connector is external
  • Added a banner for users running an outdated fuels version
  • Fixed the usage of fuel-toolchain.toml for fuels templates

Features

Fixes

Chores

v0.94.6

13 Sep 15:18
53c137c
Compare
Choose a tag to compare

Summary

In this release, we:

  • Implemented TransactionUpgrade and TransactionUpload
  • The provider.url now returns an authenticated URL
  • The Provider now accepts a headers field
  • Added UI tests to the create fuels template app
  • Fixed coder matching for some namespaced libraries
  • Fixed issue with storage slots not being auto-loaded when deploying a contract
  • Add Ethereum asset on mainnet to the list of assets (Ethereum network side)
  • Deprecated the two network URLs, added asset ID and chain ID for mainnet
  • Fixed transactions failing when using Ethereum and Solana connectors in the create-fuels template app
  • Added new supported assets based on the points program
  • Removed signTransaction method from FuelConnectorMethods enum
  • The selectNetwork connector method now accepts either url or chainId or both.

Features

Fixes

Chores

v0.94.5

06 Sep 22:41
b063c6c
Compare
Choose a tag to compare

Summary

In this release, we:

  • Reduced number of requests for submitting a transaction
  • Fixed squeezed-out transactions not being notified to users
  • Fixed an issue where you couldn't call a loader contract via a proxy contract
  • Fixed error handling in Provider for when a node is offline
  • Deprecate all receipt coders
  • Upgraded forc to v0.63.4
  • Upgraded forc to v0.63.5

Features

  • #3101 - Use submitAndAwaitStatus to submit transactions, by @nedsalk

Fixes

Chores

v0.94.4

04 Sep 17:30
2caf1b1
Compare
Choose a tag to compare

Summary

In this release, we:

  • We now return a deep clone of the transaction request in the static from method
  • Reduced the cost of submitting blob contract deploys where a blob has already been uploaded
  • Made vite the default template for create-fuels
  • Mapped the 'not enough coins' error to a readable error message
  • Added support for URLs with BasicAuth credentials in Provider
  • Fixed TX estimation when an InputMessage contains data
  • Deprecate the method BaseTransactionRequest.fundWithFakeUtxos
  • Upgraded fuel-core to v0.35.0
  • Deprecated the error code HASHER_LOCKED
  • Fixed revert error message assembling

Features

Fixes

Chores