MyGit

v0.93.0

FuelLabs/fuels-ts

版本发布时间: 2024-07-30 22:20:38

FuelLabs/fuels-ts最新发布版本:v0.94.8(2024-09-27 23:46:29)

Summary

In this release, we:

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 });

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-07-30发行的版本