@fuel-ts/account 0.75.0 → 0.76.1

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.

@@ -76,7 +76,7 @@ import {
76
76
  InputMessageCoder,
77
77
  TransactionCoder as TransactionCoder5
78
78
  } from "@fuel-ts/transactions";
79
- import { arrayify as arrayify11, hexlify as hexlify12 } from "@fuel-ts/utils";
79
+ import { arrayify as arrayify11, hexlify as hexlify12, DateTime as DateTime2 } from "@fuel-ts/utils";
80
80
  import { checkFuelCoreVersionCompatibility } from "@fuel-ts/versions";
81
81
  import { equalBytes } from "@noble/curves/abstract/utils";
82
82
  import { Network } from "ethers";
@@ -1483,9 +1483,6 @@ function sleep(time) {
1483
1483
  });
1484
1484
  }
1485
1485
 
1486
- // src/providers/utils/time.ts
1487
- var fromUnixToTai64 = (unixTimestampMs) => (BigInt(unixTimestampMs) + BigInt(2 ** 62) + BigInt(10)).toString();
1488
-
1489
1486
  // src/providers/transaction-request/errors.ts
1490
1487
  var NoWitnessAtIndexError = class extends Error {
1491
1488
  constructor(index) {
@@ -2421,7 +2418,7 @@ import { TransactionCoder as TransactionCoder4 } from "@fuel-ts/transactions";
2421
2418
  import { arrayify as arrayify10 } from "@fuel-ts/utils";
2422
2419
 
2423
2420
  // src/providers/transaction-summary/assemble-transaction-summary.ts
2424
- import { hexlify as hexlify11 } from "@fuel-ts/utils";
2421
+ import { DateTime, hexlify as hexlify11 } from "@fuel-ts/utils";
2425
2422
 
2426
2423
  // src/providers/transaction-summary/calculate-transaction-fee.ts
2427
2424
  import { bn as bn10 } from "@fuel-ts/math";
@@ -2496,13 +2493,6 @@ var calculateTransactionFee = (params) => {
2496
2493
  };
2497
2494
  };
2498
2495
 
2499
- // src/providers/transaction-summary/date.ts
2500
- import { TAI64 } from "tai64";
2501
- var fromTai64ToDate = (tai64Timestamp) => {
2502
- const timestamp = TAI64.fromString(tai64Timestamp, 10).toUnix();
2503
- return new Date(timestamp * 1e3);
2504
- };
2505
-
2506
2496
  // src/providers/transaction-summary/operations.ts
2507
2497
  import { ZeroBytes32 as ZeroBytes328 } from "@fuel-ts/address/configs";
2508
2498
  import { ErrorCode as ErrorCode8, FuelError as FuelError9 } from "@fuel-ts/errors";
@@ -3096,7 +3086,7 @@ function assembleTransactionSummary(params) {
3096
3086
  const burnedAssets = extractBurnedAssetsFromReceipts(receipts);
3097
3087
  let date;
3098
3088
  if (time) {
3099
- date = fromTai64ToDate(time);
3089
+ date = DateTime.fromTai64(time);
3100
3090
  }
3101
3091
  const transactionSummary = {
3102
3092
  id,
@@ -3269,7 +3259,7 @@ var TransactionResponse = class {
3269
3259
  };
3270
3260
 
3271
3261
  // src/providers/transaction-response/getDecodedLogs.ts
3272
- import { U64Coder } from "@fuel-ts/abi-coder";
3262
+ import { BigNumberCoder } from "@fuel-ts/abi-coder";
3273
3263
  import { ReceiptType as ReceiptType5 } from "@fuel-ts/transactions";
3274
3264
 
3275
3265
  // src/providers/utils/auto-retry-fetch.ts
@@ -4204,13 +4194,13 @@ var _Provider = class {
4204
4194
  * Lets you produce blocks with custom timestamps and the block number of the last block produced.
4205
4195
  *
4206
4196
  * @param amount - The amount of blocks to produce
4207
- * @param startTime - The UNIX timestamp to set for the first produced block
4197
+ * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block
4208
4198
  * @returns A promise that resolves to the block number of the last produced block.
4209
4199
  */
4210
4200
  async produceBlocks(amount, startTime) {
4211
4201
  const { produceBlocks: latestBlockHeight } = await this.operations.produceBlocks({
4212
4202
  blocksToProduce: bn14(amount).toString(10),
4213
- startTimestamp: startTime ? fromUnixToTai64(startTime) : void 0
4203
+ startTimestamp: startTime ? DateTime2.fromUnixMilliseconds(startTime).toTai64() : void 0
4214
4204
  });
4215
4205
  return bn14(latestBlockHeight);
4216
4206
  }
@@ -4286,13 +4276,13 @@ var assets = [
4286
4276
  ];
4287
4277
 
4288
4278
  // src/utils/formatTransferToContractScriptData.ts
4289
- import { U64Coder as U64Coder2 } from "@fuel-ts/abi-coder";
4279
+ import { BigNumberCoder as BigNumberCoder2 } from "@fuel-ts/abi-coder";
4290
4280
  import { BN as BN2 } from "@fuel-ts/math";
4291
4281
  import { arrayify as arrayify13 } from "@fuel-ts/utils";
4292
4282
  import * as asm from "@fuels/vm-asm";
4293
4283
  var formatTransferToContractScriptData = (params) => {
4294
4284
  const { assetId, amountToTransfer, hexlifiedContractId } = params;
4295
- const numberCoder = new U64Coder2();
4285
+ const numberCoder = new BigNumberCoder2("u64");
4296
4286
  const encoded = numberCoder.encode(new BN2(amountToTransfer).toNumber());
4297
4287
  const scriptData = Uint8Array.from([
4298
4288
  ...arrayify13(hexlifiedContractId),