Skip to content

Releases: FuelLabs/fuels-ts

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

v0.94.3

30 Aug 19:21
d19736b
Compare
Choose a tag to compare

Summary

In this release, we:

  • Added future-proofing to fail gracefully for different transaction types which may exist later on.
  • Added Solana connector to create-fuels template app
  • Added an embedded testnet faucet into the create-fuels template app
  • Made the create-fuels template app mobile-friendly
  • Upgraded to forc v0.63.3

Features

Fixes

Chores

v0.94.2

28 Aug 19:25
72026e6
Compare
Choose a tag to compare

Summary

In this release, we:

  • Fixed a potential race condition where the fuel connector may disconnect upon re-render
  • Introduced an init method for synchronous instantiation of a fuel-connectors object
  • Upgraded fuel-core to v0.34.0

Fixes

Chores

v0.94.1

22 Aug 14:03
2ddc35a
Compare
Choose a tag to compare

Summary

In this release, we:

  • Added a Vite template to create-fuels
  • Improved browser compatibility for typegen'd bytecode compression

Features

Fixes

Chores

v0.94.0

20 Aug 00:38
d64db24
Compare
Choose a tag to compare

Summary

In this release, we:

  • Cached Message resources upon transaction submission
  • Made typegen API more straightforward and ergonomic
  • Reduced required roundtrips & bandwidth for submitting TXs
  • Made ContractFactory.deployAsBlobTx a non-blocking call
  • Upgraded forc to v0.63.0 & v0.63.1
  • Added support for the new ABI spec (#596, #599)
  • Improved the bytecode compression for Typegen, making files 40%+ smaller
  • Improved the type handling for () and Option<T> types
  • Upgraded fuel-core to v0.32.1
  • Implemented deploying large contracts using blob transactions
  • Fixed forc and fuel-core version reporting on typegen-generated files
  • Fixed getInputFromAssetId so it returns the correct InputCoin and InputMessage
  • Upgraded fuel-core to v0.33.0
  • Added createAssetId function to create a native AssetId type
  • Added validation for max. input limit exceeded, as per the consensus parameters
  • Removed FUEL_NETWORK_URL and LOCAL_NETWORK_URL constants
  • Removed generateTestWallet, seedTestWallet and launchNodeAndGetWallets utilities
  • Renamed testing class AssetId to TestAssetId

Breaking


Features

Fixes

Chores


Migration Notes

Features

#2872 - Consider message on resources cache

The provider option flag cacheUtxo was renamed to resourceCacheTTL

// before
const provider = await Provider.create(FUEL_NETWORK_URL, {
  cacheUtxo: 5000,
});


using launched = await launchTestNode({
  providerOptions: {
    cacheUtxo: 5000,
  },
});
// after
const provider = await Provider.create(FUEL_NETWORK_URL, {
  resourceCacheTTL: 5000,
});

using launched = await launchTestNode({
  providerOptions: {
    resourceCacheTTL: 5000,
  },
});

#2824 - Prettify typegen api

Predicate class

  • Predicate class constructor parameters renamed: inputData > data
// before
import { Predicate } from 'fuels';

const predicate = new Predicate({
  ...unchangedParameters,
  inputData,
});
// after
import { Predicate } from 'fuels';

const predicate = new Predicate({
  ...unchangedParameters,
  data,
});
  • Typegen extended/generated Predicate now accepts a single parameter for initialization
// before
import { TestPredicateAbi__factory } from './typegend';

TestPredicateAbi__factory.createInstance(provider, data, configurableConstants);
// after
import { TestPredicate } from './typegen';

new TestPredicate({
  provider,
  data,
  configurableConstants
});

launchTestNode utility

  • Renamed contractsConfigs[].deployer to contractsConfigs[].factory
  • Removed contractsConfigs[].bytecode and .hex.ts file

The bytecode is now saved within the factory class, so you don't have to deal with it.

// before
import { TokenAbi__factory } from './typegend';
import TokenAbiHex from './typegend/contracts/TokenAbi.hex';

using launched = await launchTestNode({
  contractsConfigs: [{
    deployer: TokenAbi__factory,
    bytecode: TokenAbiHex
  }],
});
// after
import { TokenFactory } from './typegend';

using launched = await launchTestNode({
  contractsConfigs: [{
    factory: TokenFactory,
  }],
})

Renamed method deployContract to deploy

Removed the redundant suffix on the ContractFactory class method name.

// before
import { ContractFactory } from 'fuels';

const factory = new ContractFactory(wallet);

factory.deployContract();
// after
import { ContractFactory } from 'fuels';

const factory = new ContractFactory(wallet);

factory.deploy();

Typegen Contract template

  • Removed Abi__factory suffix from class names
  • The file <name>.hex was removed (access it via <Name>.bytecode)
  • The files <name>__factory.ts and <name>.d.dts were merged into <name>.ts
  • The class <Name> and the interface <Name>Abi are now just <Name>
  • Method <Name>Factory.deployContract() renamed to <Name>Factory.deploy()
  • You may need to remove the previously generated <typegenDir>/contracts/factories directory
// before
import { TestContractAbi, TestContract__factory } from './typegen'
import testContractBytecode from './typegen/contracts/TestContract.hex'

const instance = await TestContract__factory.connect(id, wallet);

const deploy = await TestContract__factory.deployContract(testContractBytecode, wallet);
const { c...
Read more

v0.93.0

30 Jul 14:20
bd1cbd9
Compare
Choose a tag to compare

Summary

In this release, we:

  • Limited deployment to contracts up to 100kb
  • Remove the awaitExecution flag and its associated functionality
  • Upgraded forc to v0.62.0
  • Refactored getTransactionCost method for Provider and Account
  • Expanded our documentation for connectors

Breaking


Features

Fixes

Chores

Docs


Migration Notes

Features

#2796 - Deploy contract validation

ErrorCode.INVALID_TRANSACTION_TYPE was migrated to ErrorCode.UNSUPPORTED_TRANSACTION_TYPE.

// before
const code = ErrorCode.INVALID_TRANSACTION_TYPE;
// after
const code = ErrorCode.UNSUPPORTED_TRANSACTION_TYPE;

Chores

#2820 - Remove awaitExecution functionality

It is no longer possible to submit transactions using the awaitExecution flag and wait for the transaction to be processed at submission:

// before
const response = await account.sendTransaction(transactionRequest, { awaitExecution: true }); 
// after
const submit = await account.sendTransaction(transactionRequest);

const response = await submit.waitForResult();

#2643 - Refactored the getTransactionCost method

Refactored functionality for Provider.getTransactionCost to Account.getTransactionCost and changed estimation parameter from quantitiesToContract to quantities.

// before
const provider = Provider.create(...);
const account = Wallet.generate({ ... }) || new Predicate(...);
const quantities: Array<CoinQuantityLike> = [
  { amount: 1000, assetId: provider.getBaseAssetId() }
];

const cost = provider.getTransactionCost(txRequest, {
  resourceOwner: account,
  quantitiesToContract: quantities,
})
// after
const provider = Provider.create(...);
const account = Wallet.generate({ ... }) || new Predicate(...);
const quantities: Array<CoinQuantityLike> = [
  { amount: 1000, assetId: provider.getBaseAssetId() }
];

const cost = account.getTransactionCost(txRequest, { quantities });

v0.92.1

18 Jul 13:33
d9d0573
Compare
Choose a tag to compare

Features

Fixes

  • #2756 - launchTestNode multiple contracts type inference, by @nedsalk

Chores

  • #2752 - Replace create-fuels hardcoded values with constants, by @Dhaiwat10

v0.92.0

11 Jul 11:12
77e910f
Compare
Choose a tag to compare

Summary

In this release, we:

  • Made the contract's call method a non-blocking call
  • Made the contract's deployContract method a non-blocking call
  • Added pagination support to Provider and Account classes
  • Added support for multiple new connectors in the create fuels template
  • Upgraded fuel-core to v0.31.0
  • Upgraded sway/forc to v0.61.2

Breaking


Features

Fixes

Chores


Migration Notes

Features

#2692 - Implement non-blocking contract call

The call method in the BaseInvocationScope class no longer waits for transaction execution, making it non-blocking. This change affects how transaction responses are handled.

// before
const { logs, value, transactionResult } = await contract.functions.xyz().call()
// after
const { transactionId, waitForResult } = await contract.functions.xyz().call();

const { logs, value, transactionResult } = await waitForResult();

#2597 - Made deployContract a non-blocking call

The deployContract method no longer returns the contract instance directly. Instead, it returns an object containing the transactionId , the contractId, and a waitForResult function.

// before
const factory = new ContractFactory(contractByteCode, contractAbi, wallet);

const contract = await factory.deployContract();

const { value } = await contract.functions.xyz().call();
// after
const factory = new ContractFactory(contractByteCode, contractAbi, wallet);

const { waitForResult, transactionId, contractId } = await factory.deployContract();

const { contract, transactionResult } = await waitForResult();

const { value } = await contract.functions.xyz().call();

#2408 - Implement pagination for Account methods

// before
const coins = await myWallet.getCoins(baseAssetId); 
const messages = await myWallet.getMessages();
const balances = await myWallet.getBalances();
const blocks = await provider.getBlocks();

// after
const { coins, pageInfo } = await myWallet.getCoins(baseAssetId); 
const { messages, pageInfo } = await myWallet.getMessages();
const { balances } = await myWallet.getBalances();
const { blocks, pageInfo } = await provider.getBlocks();

/*
The `pageInfo` object contains cursor pagination information one
can use to fetch subsequent pages selectively and on demand.
*/

Fixes

#2718 - launchNode.cleanup not killing node in last test of test group

The killNode and KillNodeParams functionality has been internalized and the method and interface have been deleted so they're no longer exported. It's marked as a breaking change for pedantic reasons and there shouldn't really be any affected users given that they kill nodes via cleanup which is unchanged, so no migration notes are necessary.

Chores

#2652 - Remove InvocationResult from program package

The classes FunctionInvocationResult, InvocationCallResult, and InvocationResult have been removed. This change will not affect most users as the response for a contract call or script call remains the same; only the type name has changed.

// before
const callResult: FunctionInvocationResult = await contract.functions.xyz().call()

const dryRunResult: InvocationCallResult = await contract.functions.xyz().get()
const dryRunResult: InvocationCallResult = await contract.functions.xyz().dryRun()
const dryRunResult: InvocationCallResult = await contract.functions.xyz().simulate()


// after
const callResult: FunctionResult = await contract.functions.xyz().call()

const dryRunResult: DryRunResult = await contract.functions.xyz().get()
const dryRunResult: DryRunResult = await contract.functions.xyz().dryRun()
const dryRunResult: DryRunResult = await contract.functions.xyz().simulate()

v0.91.0

03 Jul 15:30
799e871
Compare
Choose a tag to compare

Summary

In this release, we:

  • Upgraded to sway/forc @ v0.61.1
  • Added support for str slices
  • Updated create fuels template and added a fuel-toolchain.toml file to it
  • Made create fuels CLI easier to use with fewer options and smarter defaults
  • Improved tooling around fuels config file, allowing for selective event listening

Breaking

  • Features
  • Fixes
    • #2558 - Stop piping into process.stdout/stderr and use console.log, by @nedsalk
  • Chores

Features

Fixes

Chores

Docs