Releases: FuelLabs/fuels-ts
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
graphql-request@6.1.0
, 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.
v0.95.0
Summary
In this release, we:
- Added new
checksum
utility to theAddress
class - Added Provider methods
isUserAccount
andgetAddressType
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 thebn
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
andAddress.valueOf
returns the Address checksum - Updated
fuel-core
to0.38.0
- Optimised the provider balance queries
- Optimize the
getBlockWithTransactions
query
Breaking
- Features
- #3306 - Bump transaction pagination limit to 60, by @danielbate
- Chores
- #3310 - Made Address
toString
andvalueOf
returns checksum, by @Torres-ssf - #3286 - Slim down
chainInfoFragment
andGasCostsFragment
, by @nedsalk - #3296 - Optimize balance queries, by @danielbate
- #3310 - Made Address
Features
- #3308 - Add checksum utils for address, by @luizstacio
- #3307 - Add feature to check if hex is an account, by @maschad
- #3282 - Add source request header, by @danielbate
- #3304 - Add pagination limit to
getTransactions
, by @petertonysmith94
Fixes
- #3300 - Correct
bn
formatting bug with 0 units, by @maschad - #3278 - Provider cache, by @Torres-ssf
- #3274 - Typegen factory template, by @arboleya
Chores
- #3265 -
fuel-core@0.37.1
,forc@0.65.1
, andcreate-fuels
toolchains, by @danielbate - #3271 - Update to
forc@0.65.2
, by @nedsalk - #3284 - Merge
chain
andnodeInfo
queries into one, by @nedsalk - #3272 - Update
fuel-core
to0.38.0
, by @Dhaiwat10 - #3309 - Optimize blockWithTransactions query, by @Torres-ssf
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 theChainInfo
return ofprovider.getChain()
. You can fetch it viaprovider.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 forgasCosts
for the additional data you need.
#3296 - Optimize balance queries
- Removed the
owner
andassetId
properties from the response ofProvider.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 ofProvider.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
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
- #3235 - Proxy deploy with storage, by @danielbate
Chores
- #3180 - Deprecate unused operation names, by @Torres-ssf
- #3166 - Run benchmarking utility in devnet environment, by @maschad
v0.94.8
v0.94.7
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 infuels 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
forfuels
templates
Features
- #3190 - Adding support for proxy contracts in
fuels deploy
, by @arboleya - #3016 - Support message types, by @Torres-ssf
- #3201 - Add flag to indicate if connector is external, by @arthurgeron
Fixes
- #3167 - Removed sepolia assets and adjust decimal config, by @LuizAsFight
- #3217 - Calling
prebuild
only if deps are installed, by @Torres-ssf - #3183 -
create fuels
not respecting toolchain file, by @Dhaiwat10 - #3175 - Generate types for
create fuels
users when extracted, by @Dhaiwat10 - #3156 - Add missing receipts properties, by @Torres-ssf
Chores
- #3187 - Upgrade to forc
0.63.6
, by @petertonysmith94 - #3210 - Fix deprecation on Commander method, by @Dhaiwat10
- #3108 - Inform users if their
fuels
version is outdated, by @Dhaiwat10 - #3182 - Upgraded to fuel-core 0.36.0, by @petertonysmith94
- #3216 - Fix exported types, by @danielbate
- #3214 - Upgrading
@fuels/vm-asm
to0.57.1
, by @arboleya - #3215 - Upgrade
forc@0.64.0
, by @danielbate
v0.94.6
Summary
In this release, we:
- Implemented
TransactionUpgrade
andTransactionUpload
- The
provider.url
now returns an authenticated URL - The
Provider
now accepts aheaders
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 fromFuelConnectorMethods
enum - The
selectNetwork
connector method now accepts eitherurl
orchainId
or both.
Features
- #3114 - Introduce upload and upgrade transaction request, by @luisburigo
- #3147 -
provider.url
now returns auth url, by @petertonysmith94 - #3104 - Add UI tests to
create fuels
template, by @Dhaiwat10
Fixes
- #3162 - Incorrect coder matching, by @petertonysmith94
- #3134 - Storage slots auto-load from typegen, by @petertonysmith94
Chores
- #3165 - Downgrade ora from
8.1.0
to5.4.1
, by @petertonysmith94 - #3152 - Include Ethereum asset in ETH Mainnet network, by @LuizAsFight
- #3107 - Deprecate network URLs, add asset ID and chain ID for mainnet, by @Dhaiwat10
- #3133 - Bump connectors package version, by @Dhaiwat10
- #3153 - Add new supported assets, by @LuizAsFight
- #3149 - Revert add
signTransaction
toFuelConnectorMethods
enum, by @Torres-ssf - #3160 - Made
selectNetwork
arguments more flexible, by @petertonysmith94 - #3144 - Update block explorer url, by @danielbate