Releases: FuelLabs/fuels-ts
v0.100.2
Summary
In this release, we:
- Adjusted feature detection for balances indexation
Fixes
- #3824 - Adjust feature detection for balances, by @Torres-ssf
Chores
- #3811 - Upgrade
@fuels/connectors
to0.39.2
, by @petertonysmith94
v0.100.1
Summary
In this release, we:
- Avoid decoding logs from inter-called contracts without a JSON ABI
- Eliminated duplicate chain requests across multiple concurrent provider instances
Fixes
- #3790 - Skip decoding external contract logs without JSON ABI, by @Torres-ssf
Chores
- #3788 - Eliminate chain requests across concurrent provider instances, by @petertonysmith94
v0.100.0
Summary
In this release, we:
- Consider
assetId
onisUserAccount
andgetAddressType
methods - Enabled hashing + signing of bytes via
personalMessage
as per EIP-191 - Support customizing TX request from
BaseInvocationScope
- Improved JSON RPC interface between SDK and Connectors, reducing HTTP requests
- Added the corresponding receipt to the operation in the Tx summary
- Improved directory detection for
fuels init
- Introduced
decodeScriptData
to decode the the values from a contract call script - Merge gas price and predicate estimation on a single request
- Adapted
ResourceCache
to conform with newcoinsToSpend
limitations - Upgraded
fuel-core
to0.41.9
- Upgraded
fuel-core
to0.41.7
- Made
getBlockWithTransactions
andgetBlock
supports BN parameter - Upgraded
forc
to0.67.0
- Upgraded
forc
to0.66.7
Breaking
- Chores
- #3697 - Made
ResourceCache
consider resource owner, by @Torres-ssf - #3590 - Upgrade
fuel-core
to0.41.7
, by @Torres-ssf
- #3697 - Made
Features
- #3618 - Consider
assetId
in check account utility, by @Torres-ssf - #3720 - Enable arbitrary data signing, by @petertonysmith94
- #3773 - Support customizing TX request from
BaseInvocationScope
, by @Torres-ssf - #3735 - Improved connector JSON RPC interface, by @petertonysmith94
- #3658 - Add receipts with the operations summary, by @nelitow
Fixes
- #3776 - Ensure is possible to forward 0 amount to contract, by @Torres-ssf
- #3759 - Correct revert error name, by @Torres-ssf
- #3638 - Improve
fuels init
directory detection, by @petertonysmith94 - #3680 - Favour
.ts
over.d.ts
files in@fuel-ts/abi-typegen
, by @petertonysmith94 - #3704 - Contract operations in transaction summary, by @danielbate
Chores
- #3676 - Merge gas price and predicate estimation requests, by @Torres-ssf
- #3698 - Upgrade
vite
related dependencies, by @petertonysmith94 - #3772 - Revert "fix: ignored subscriptions not being read", by @nedsalk
- #3723 - Upgraded various dependencies, by @petertonysmith94
- #3756 - Bump
fuel-core
to0.41.9
, by @Torres-ssf - #3688 - Upgrade NPM package versions, by @petertonysmith94
- #3734 - Remove call ops in tx summary, by @danielbate
- #3713 - Add missing turbo cache, by @petertonysmith94
- #3700 - Support BN input in block fetch methods, by @Torres-ssf
- #3774 - Updated
forc
to0.67.0
, by @petertonysmith94 - #3673 - Upgrade
forc
to0.66.7
, by @petertonysmith94 - #3694 - Upgrade frontend dependencies, by @petertonysmith94
Migration Notes
Chores
#3697 - Made ResourceCache
consider resource owner
//before
provider.cache?.getActiveData();
provider.cache?.isCached(key);
//after
const owner = wallet.address.toB256();
provider.cache?.getActiveData(owner)
provider.cache?.isCached(owner, key);
#3590 - Upgrade fuel-core
to 0.41.7
Because of the latest fuel-core
changes, TS SDK does not throw the following error codes and messages anymore:
- NOT_ENOUGH_FUNDS
// before
"The account(s) sending the transaction don't have enough funds to cover the transaction."
// after
"Insufficient funds or too many small value coins. Consider combining UTXOs."
- MAX_COINS_REACHED
// before
"The account retrieving coins has exceeded the maximum number of coins per asset. Please consider combining your coins into a single UTXO."
// after
"Insufficient funds or too many small value coins. Consider combining UTXOs."
Both error codes were removed in favor of INSUFFICIENT_FUNDS_OR_MAX_COINS
v0.99.0
Summary
In this release, we:
- Upgraded
forc
to0.66.6
- Upgraded
fuel-core
to0.40.4
- Updated how we calculate Blob ID so that it mirrors Bytecode ID
- Introduced bytecode helpers to compute the Bytecode ID and Legacy Blob ID
- Removed
pageInfo
fromprovider.operations.getBalances
response - Fixed a de-structuring issue when calling
waitForResult
on a submitted transaction - Fixed incorrect offset usage for
Interface.decodeArguments()
function - Improved DX of the
Address
class constructor - Added methods to allow querying the Explorer Asset API
- Migrated CDN host from
cdn.fuel.network
toassets.fuel.network
- Fixed a bug where
fuels dev
would hang after a Sway compilation error - Enable
fuels
callbacks to be asynchronous - Embedded node incompatibility warnings in GQL errors
- Added
forc
tests to the template - Allowed passing
gasPrice
togetTransactionCost
functions to reduce possible network calls
Breaking
- Chores
- #3652 - Remove
pageInfo
fromgetBalances
GraphQl operations, by @Torres-ssf - #3570 - Remove
ContractUtils
namespaced export, by @danielbate
- #3652 - Remove
Features
- #3608 - Allow passing
gasPrice
togetTransactionCost
, by @danielbate - #3641 - Bytecode ID helpers, by @danielbate
- #3585 - Add
forc
tests to create fuels, by @petertonysmith94 - #3631 - Use configurable offset for blob ID, by @danielbate
- #3648 - Support Explorer Asset API, by @petertonysmith94
- #3637 - Enable
fuels
callbacks to be asynchronous, by @petertonysmith94
Fixes
- #3660 - Bind
waitForResult
inTransactionResponse
, by @danielbate - #3589 - Incorrect function coder offset usage, by @petertonysmith94
- #3643 - S3 publishing, by @mchristopher
- #3646 -
fuels dev
hangs after compilation errors, by @nedsalk - #3636 - Improve BN unsafe numbers error handling, by @Torres-ssf
Chores
- #3580 - Prepend version mismatch to GraphQL errors, by @petertonysmith94
- #3600 -
Address
constructor now accepts a range of inputs., by @petertonysmith94 - #3532 - Un-deprecated network URLs, by @petertonysmith94
- #3617 - Bump
forc
to0.66.6
, by @petertonysmith94 - #3594 - Update
amountPerCoin
prop inWalletConfig
to accept BN, by @Torres-ssf - #3619 - Organized
assets
in account package, by @petertonysmith94 - #3620 - Prevent naming collisions on typegen, by @Torres-ssf
- #3633 - Fix version resolutions, by @petertonysmith94
- #3626 - Upgrade
fuel-core
to0.40.4
, by @Torres-ssf - #3579 - Changed Tailwind config from JS to TS, by @petertonysmith94
Migration Notes
Chores
#3652 - Remove pageInfo
from getBalances
GraphQl operations
The pageInfo
field has been removed from the response of the provider.operations.getBalances
query.
// before
const { balances, pageInfo } = await provider.operations.getBalances({
first: 100,
filter: { owner: wallet.address.toB256() },
});
// after
const { balances } = await provider.operations.getBalances({
first: 100,
filter: { owner: wallet.address.toB256() },
});
The getBalances
method of the Provider class remains unchanged, as it never returned pageInfo:
// not affected
const { balances } = await provider.getBalances();
#3570 - Remove ContractUtils
namespaced export
ContractUtils
was removed and the underlying functions (getContractRoot()
,getContractStorageRoot()
,getContractId()
,hexlifyWithPrefix()
are now exported directly fromfuels
.
// before
import { ContractUtils } from 'fuels';
// after
import { getContractRoot, getContractStorageRoot, getContractId, hexlifyWithPrefix } from 'fuels';
v0.98.0
Summary
In this release, we:
- Added method
fromInstance
to thePredicate
class - Added auto-detection for the user's package manager of choice for
create fuels
- Made
Provider
constructorpublic
andsync
again - Added support for
--fuel-core-port
flag infuels init
command - Added the
autoCost
method to easily estimate and fund transactions - Migrated
fundWithRequiredCoins
->autoCost
for contract and script calls - Improved speed in assembling result for settled transactions
- Added a guard to
sendTransaction
to ensure that we prevent implicit asset burns - Fixed an issue when using multiple paths (or globals) in
fuels init
- Improved validation and handling of unsafe integers in
BigNumberCoder
- Upgraded
fuel-core
to0.40.2
- Removed unused operations from
OperationName
enum - Remove receipts deprecated properties
- Removed all receipt coders
- Removed all instances of
Bech32
address format in favour ofB256
- Removed the
AbstractAddress
in favour of theAddress
class - Improved
Getting Started
docs and repoREADME
, focusing on Mainnet - Added documentation on optimizing frontend apps through transaction pre-loading
Breaking
- Features
- #3514 - Making
provider
initializationsync
again, by @arboleya - #3539 -
autoCost
for transaction estimation and funding, by @danielbate - #3559 - Remove redundant gas price call for tx summary, by @danielbate
- #3540 - Prevent implicit asset burn, by @petertonysmith94
- #3514 - Making
- Chores
- #3553 - Remove unused operations, by @Torres-ssf
- #3552 - Remove receipts deprecated properties, by @Torres-ssf
- #3551 - Remove receipt coders, by @Torres-ssf
- #3548 - Remove deprecated
submitAndAwait
operation, by @nedsalk - #3493 - Remove Bech32 address, by @petertonysmith94
- #3492 - Redistributed the
@fuel-ts/interfaces
package, by @petertonysmith94
- Docs
- #3573 - Optimizing frontend apps, by @danielbate
Features
- #3432 - Added method to duplicate predicate, by @YaTut1901
- #3503 - Auto-detect package manager in
create fuels
, by @Dhaiwat10 - #3531 - Add support for
--fuel-core-port
flag infuels init
, by @nedsalk - #3487 - Added
onBeforeSend
hook to the connector interface, by @petertonysmith94
Fixes
- #3486 - Adjust test ui script in package's json, by @arboleya
- #3510 - Adjust paths and globals in
fuels init
, by @arboleya - #3491 - Validation and handling of unsafe integers, by @petertonysmith94
- #3537 - Resolve
punycode
deprecation notice, by @petertonysmith94 - #3528 - Usage of
providerUrl
infuels dev
command, by @nedsalk - #3508 - Unable to kill
fuels dev
withpnpm
, by @petertonysmith94
Chores
- #3511 - Bumped
@fuels/*
deps to0.36.1
, by @petertonysmith94 - #3449 - Dependency pinning and auditing, by @danielbate
- #3470 - Upgrade
fuel-core
to0.40.2
, by @Torres-ssf - #3550 - Added
useBaseAssetId
hook to templates, by @petertonysmith94 - #3556 - Removing obsolete
Provider.create
method, by @arboleya - #3554 - Remove unused deps + update knip config, by @maschad
Docs
Migration Notes
Features
#3514 - Making provider
initialization sync
again
1. Provider
Instantiation
- Going from
async
tosync
// before
const provider = await Provider.create(NETWORK_URL);
// after
const provider = new Provider(NETWORK_URL);
2. Provider
methods
- The following methods are now
async
// before
provider.getNode();
provider.getChain();
provider.getChainId();
provider.getBaseAssetId();
provider.getGasConfig();
provider.validateTransaction();
// after
await provider.getNode();
await provider.getChain();
await provider.getChainId();
await provider.getBaseAssetId();
await provider.getGasConfig();
await provider.validateTransaction();
3. TransferParams
and ContractTransferParams
- Property
assetId
is now required byTransferParams
andContractTransferParams
export type TransferParams = {
destination: string | AbstractAddress;
amount: BigNumberish;
- assetId?: BytesLike;
+ assetId: BytesLike;
};
export type ContractTransferParams = {
contractId: string | AbstractAddress;
amount: BigNumberish;
- assetId?: BytesLike;
+ assetId: BytesLike;
};
4. Transaction Response
- The constructor now requires a
chainId
// before
new TransactionResponse('0x..', provider);
// after
new TransactionResponse('0x..', provider, chainId);
#3539 - autoCost
for transaction estimation and funding
To be brought inline with autoCost
, funding a contract and script call has been migrated from fundWithRequiredCoins
to autoCost
:
// before
const request: ScriptTransactionRequest = contract.functions.add(1).fundWithRequiredCoins();
// after
const request: ScriptTransactionRequest = contract.functions.add(1).autoCost();
#3559 - Remove redundant gas price call for tx summary
calculateTXFeeForSummary
and subsequently theCalculateTXFeeForSummaryParams
no longer accept atotalFee
property. If you have thetotalFee
, then there is no need to call thecalculateTxFeeForSummary()
function.
// before
const totalFee = bn(..):
calculateTXFeeForSummary({ ..., totalFee } as CalculateTXFeeForSummaryParams);
// after
calculateTXFeeForSummary({ ... } as CalculateTXFeeForSummaryParams);
#3540 - Prevent implicit asset burn
// before
const transactionRequest = new ScriptTransactionRequest();
transactionRequest.inputs.push({ ... });
// since outputs weren't added, assets would be burned
await sender.sendTransaction(transactionRequest);
// after
const transactionRequest = new ScriptTransactionRequest();
transactionRequest.inputs.push({ ... });
// now, an error will be thrown unless `enableAssetBurn`is true,
// in which case, assets can still be burned
await sender.sendTransaction(transactionRequest, {
enableAssetBurn: true,
});
Chores
#3553 - Remove unused operations
The following operations have been removed from the OperationName
enum, as they were never used to assemble operations:
OperationName.mint
OperationName.predicatecall
OperationName.script
OperationName.sent
#3552 - Remove receipts deprecated properties
All receipts deprecated properties were removed:
// before
ReceiptCall.from
ReceiptLog.val0
ReceiptLog.val1
ReceiptLog.val2
ReceiptLog.val3
ReceiptLogData.val0
ReceiptLogData.val1
ReceiptTransfer.from
ReceiptTransferOut.from
// after
ReceiptCall.id
ReceiptLog.ra
ReceiptLog.rb
ReceiptLog.rc
ReceiptLog.rd
ReceiptLogData.ra
ReceiptLogData.rb
ReceiptTransfer.id
ReceiptTransferOut.id
#3551 - Remove receipt coders
All previously deprecated receipt co...
v0.97.2
Summary
In this release, we:
- Updated forc version to
0.66.5
Fixes
- #3477 - Vitest matcher integration, by @petertonysmith94
- #3475 - Specify versions in
create fuels
toolchain file, by @Dhaiwat10
Chores
- #3468 - Updated forc version to
0.66.5
, by @petertonysmith94 - #3425 - Integrate vitest matchers globally, by @starc007
- #3420 - Update internally used chain config, by @Dhaiwat10
v0.97.1
Summary
In this release, we:
- Improved
launchTestNode
and typegen'd contract factories integration - Fixed
transferToContract
andbatchTransferToContracts
to accept big number amounts. - Fixed issue with
fuel-core
node cleanup operation failing in Bun. - Deprecated the
bech32Address
type in favour of hexadecimal address format going forward. - Upgraded
fuel-core
to0.40.1
- Added a cookbook for deploying and manually upgrading by proxy contract
- Exported TypeScript recipes of Sway Programs
Features
Fixes
- #3396 - Typegen and storage slots integration, by @nedsalk
- #3458 -
transferToContract
method now allows big numbers, by @petertonysmith94 - #3438 - Enable
fuel-core
node cleanup to work in Bun, by @petertonysmith94
Chores
- #3442 - Upgrade
[email protected]
, by @danielbate - #3384 - Added noImplicitOverride option to config, by @YaTut1901
- #3411 - Deprecate bech32 addresses, by @maschad
- #3461 - Avoid re-estimate
gasPrice
atestimateTxDependencies
, by @Torres-ssf - #3423 - Bump
fuel-core
to0.40.1
, by @Torres-ssf - #3439 - Recipes build clean ups, by @danielbate
Docs
- #3253 - Proxy contract cookbook, by @danielbate
v0.97.0
Summary
In this release, we:
- Implemented batch transfer to contracts
- Optimized the
getMessageByNonce
provider endpoint - Upgraded
fuel-core
tov0.40.0
- Optimize graphQL query for
Provider.getTransactions
- Limit pagination number for
getTransactionsSummaries
to60
- Upgraded
forc
tov0.66.4
- Removed
blockId
property from responses when listing transactions - Upgraded
forc
tov0.66.2
- Deprecate and fix multiple receipts properties
- Optimized the
getCoins
provider endpoint - Revised our code snippets to use a WYSIWYG format
Breaking
- Features
- #3383 -
onDeploy
fuels config supports all Sway program types, by @YaTut1901
- #3383 -
- Fixes
- Chores
- #3389 - Refactor predicate and script deployment, by @nedsalk
- #3387 - Mandate
abi
inPredicate
constructor, by @nedsalk - #3336 - Optimize
getTransactions
query, by @Torres-ssf - #3400 - Limit TX pagination number for
getTransactionsSummaries
, by @Torres-ssf - #3379 - Remove
blockId
in transaction list responses, by @Torres-ssf - #3301 - Optimize coin gql queries, by @maschad
Features
- #3350 - Cache latest
fuels
version, by @Dhaiwat10 - #3335 - Implement batch transfer to contracts, by @Torres-ssf
Fixes
- #3354 - Moved
create-fuels
deps forfuels-ts
, by @petertonysmith94 - #3388 - Bump proxy contract versions, by @nedsalk
Chores
- #3332 - Upgrading
fuel-core
to0.40.0
, by @arboleya - #3342 - Exclude
node_modules
in template tests, by @danielbate - #3371 - Upgrading
forc
to0.66.4
, by @arboleya - #3337 - Upgrading
forc
to0.66.2
, by @petertonysmith94 - #3385 - Fix receipts properties and deprecate incorrect ones, by @Torres-ssf
Docs
- #3357 - Migrated
provider
docs snippets, by @petertonysmith94 - #3297 - Add further snippets with new infrastructure, by @maschad
Migration Notes
Features
#3383 - onDeploy
fuels config supports all Sway program types
- Changed the outputted data from the
onDeploy
callback method for thefuels.config.ts
. Instead of just emitting the deployed contracts (as an array), it will now emit an object withcontracts
,predicates
andscripts
.
// 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 fromProvider.operations.getMessageByNonce()
. This can still be retrieved byProvider.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()
andProvider.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 theProvider.operations.getCoinsToSpend()
function. Suggest to use the owner from the input parameters.
v0.96.1
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 withunits = 0
- Upgraded
fuel-core
to0.39.0
Features
- #3324 - Ensure that we fetch node info per estimation, by @maschad
- #3319 - Using gas modifier at
Provider.getTransactionCost
, by @Torres-ssf
Fixes
- #3318 - Setup listeners current connector, by @luizstacio
- #3320 -
parseUnits
bug with 0 units, by @Dhaiwat10
Chores
- #3327 - Upgrading
fuel-core
to0.39.0
, by @arboleya - #3329 - Use
FuelError
instead of JSError
, by @Torres-ssf - #3328 - Validate tx max number of inputs, by @Torres-ssf
v0.96.0
Summary
In this release, we:
- Fixed checksum utility to correctly remove
0x
before hashing
Breaking
- Fixes
- #3313 - Checksum method to remove
0x
before hashing, by @luizstacio
- #3313 - Checksum method to remove
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.