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.