@fuel-ts/account 0.75.0 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

package/dist/index.js CHANGED
@@ -112,10 +112,6 @@ __export(src_exports, {
112
112
  english: () => english,
113
113
  extractBurnedAssetsFromReceipts: () => extractBurnedAssetsFromReceipts,
114
114
  extractMintedAssetsFromReceipts: () => extractMintedAssetsFromReceipts,
115
- fromDateToTai64: () => fromDateToTai64,
116
- fromTai64ToDate: () => fromTai64ToDate,
117
- fromTai64ToUnix: () => fromTai64ToUnix,
118
- fromUnixToTai64: () => fromUnixToTai64,
119
115
  gasUsedByInputs: () => gasUsedByInputs,
120
116
  getAssetEth: () => getAssetEth,
121
117
  getAssetFuel: () => getAssetFuel,
@@ -1690,10 +1686,6 @@ function sleep(time) {
1690
1686
  });
1691
1687
  }
1692
1688
 
1693
- // src/providers/utils/time.ts
1694
- var fromTai64ToUnix = (tai64Timestamp) => Number(BigInt(tai64Timestamp) - BigInt(2 ** 62) - BigInt(10));
1695
- var fromUnixToTai64 = (unixTimestampMs) => (BigInt(unixTimestampMs) + BigInt(2 ** 62) + BigInt(10)).toString();
1696
-
1697
1689
  // src/providers/transaction-request/errors.ts
1698
1690
  var ChangeOutputCollisionError = class extends Error {
1699
1691
  name = "ChangeOutputCollisionError";
@@ -2716,14 +2708,6 @@ var calculateTransactionFee = (params) => {
2716
2708
  };
2717
2709
  };
2718
2710
 
2719
- // src/providers/transaction-summary/date.ts
2720
- var import_tai64 = require("tai64");
2721
- var fromTai64ToDate = (tai64Timestamp) => {
2722
- const timestamp = import_tai64.TAI64.fromString(tai64Timestamp, 10).toUnix();
2723
- return new Date(timestamp * 1e3);
2724
- };
2725
- var fromDateToTai64 = (date) => import_tai64.TAI64.fromUnix(Math.floor(date.getTime() / 1e3)).toString(10);
2726
-
2727
2711
  // src/providers/transaction-summary/operations.ts
2728
2712
  var import_configs10 = require("@fuel-ts/address/configs");
2729
2713
  var import_errors10 = require("@fuel-ts/errors");
@@ -3364,7 +3348,7 @@ function assembleTransactionSummary(params) {
3364
3348
  const burnedAssets = extractBurnedAssetsFromReceipts(receipts);
3365
3349
  let date;
3366
3350
  if (time) {
3367
- date = fromTai64ToDate(time);
3351
+ date = import_utils19.DateTime.fromTai64(time);
3368
3352
  }
3369
3353
  const transactionSummary = {
3370
3354
  id,
@@ -3545,7 +3529,9 @@ function getDecodedLogs(receipts, abiInterface) {
3545
3529
  logs.push(abiInterface.decodeLog(r.data, r.val1.toNumber(), r.id)[0]);
3546
3530
  }
3547
3531
  if (r.type === import_transactions16.ReceiptType.Log) {
3548
- logs.push(abiInterface.decodeLog(new import_abi_coder3.U64Coder().encode(r.val0), r.val1.toNumber(), r.id)[0]);
3532
+ logs.push(
3533
+ abiInterface.decodeLog(new import_abi_coder3.BigNumberCoder("u64").encode(r.val0), r.val1.toNumber(), r.id)[0]
3534
+ );
3549
3535
  }
3550
3536
  return logs;
3551
3537
  }, []);
@@ -4483,13 +4469,13 @@ var _Provider = class {
4483
4469
  * Lets you produce blocks with custom timestamps and the block number of the last block produced.
4484
4470
  *
4485
4471
  * @param amount - The amount of blocks to produce
4486
- * @param startTime - The UNIX timestamp to set for the first produced block
4472
+ * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block
4487
4473
  * @returns A promise that resolves to the block number of the last produced block.
4488
4474
  */
4489
4475
  async produceBlocks(amount, startTime) {
4490
4476
  const { produceBlocks: latestBlockHeight } = await this.operations.produceBlocks({
4491
4477
  blocksToProduce: (0, import_math14.bn)(amount).toString(10),
4492
- startTimestamp: startTime ? fromUnixToTai64(startTime) : void 0
4478
+ startTimestamp: startTime ? import_utils22.DateTime.fromUnixMilliseconds(startTime).toTai64() : void 0
4493
4479
  });
4494
4480
  return (0, import_math14.bn)(latestBlockHeight);
4495
4481
  }
@@ -4737,7 +4723,7 @@ var import_utils26 = require("@fuel-ts/utils");
4737
4723
  var asm = __toESM(require("@fuels/vm-asm"));
4738
4724
  var formatTransferToContractScriptData = (params) => {
4739
4725
  const { assetId, amountToTransfer, hexlifiedContractId } = params;
4740
- const numberCoder = new import_abi_coder4.U64Coder();
4726
+ const numberCoder = new import_abi_coder4.BigNumberCoder("u64");
4741
4727
  const encoded = numberCoder.encode(new import_math16.BN(amountToTransfer).toNumber());
4742
4728
  const scriptData = Uint8Array.from([
4743
4729
  ...(0, import_utils26.arrayify)(hexlifiedContractId),
@@ -9530,10 +9516,6 @@ __publicField(Fuel, "defaultConfig", {});
9530
9516
  english,
9531
9517
  extractBurnedAssetsFromReceipts,
9532
9518
  extractMintedAssetsFromReceipts,
9533
- fromDateToTai64,
9534
- fromTai64ToDate,
9535
- fromTai64ToUnix,
9536
- fromUnixToTai64,
9537
9519
  gasUsedByInputs,
9538
9520
  getAssetEth,
9539
9521
  getAssetFuel,