@fuel-ts/account 0.0.0-pr-2017-20240411102836 → 0.0.0-pr-2017-20240411112034

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.

@@ -31764,6 +31764,7 @@ This unreleased fuel-core build may include features and updates not yet support
31764
31764
  const padding = new Uint8Array(WORD_SIZE - encoded.length % WORD_SIZE);
31765
31765
  return concatBytes2([encoded, padding]);
31766
31766
  };
31767
+ var isUint8Array = (value) => value instanceof Uint8Array;
31767
31768
  var ArrayCoder = class extends Coder {
31768
31769
  coder;
31769
31770
  length;
@@ -32305,8 +32306,11 @@ This unreleased fuel-core build may include features and updates not yet support
32305
32306
  this.coder = coder;
32306
32307
  }
32307
32308
  encode(value) {
32308
- if (!Array.isArray(value)) {
32309
- throw new FuelError(ErrorCode.ENCODE_ERROR, `Expected array value.`);
32309
+ if (!Array.isArray(value) && !isUint8Array(value)) {
32310
+ throw new FuelError(
32311
+ ErrorCode.ENCODE_ERROR,
32312
+ `Expected array value, or a Uint8Array. You can use arrayify to convert a value to a Uint8Array.`
32313
+ );
32310
32314
  }
32311
32315
  const parts = [];
32312
32316
  const pointer = new BigNumberCoder("u64").encode(BASE_VECTOR_OFFSET);
@@ -33225,6 +33229,15 @@ This unreleased fuel-core build may include features and updates not yet support
33225
33229
  });
33226
33230
  return coder.decode(bytes3, 0);
33227
33231
  }
33232
+ /**
33233
+ * Checks if the function is read-only i.e. it only reads from storage, does not write to it.
33234
+ *
33235
+ * @returns True if the function is read-only or pure, false otherwise.
33236
+ */
33237
+ isReadOnly() {
33238
+ const storageAttribute = this.attributes.find((attr) => attr.name === "storage");
33239
+ return !storageAttribute?.arguments.includes("write");
33240
+ }
33228
33241
  };
33229
33242
  var Interface = class {
33230
33243
  functions;
@@ -33288,7 +33301,8 @@ This unreleased fuel-core build may include features and updates not yet support
33288
33301
  }
33289
33302
  return AbiCoder.encode(this.jsonAbi, configurable.configurableType, value, {
33290
33303
  isRightPadded: true,
33291
- encoding: this.jsonAbi.encoding
33304
+ // TODO: Review support for configurables in v1 encoding when it becomes available
33305
+ encoding: ENCODING_V0
33292
33306
  });
33293
33307
  }
33294
33308
  getTypeById(typeId) {
@@ -39759,8 +39773,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39759
39773
  assetId,
39760
39774
  txPointer: "0x00000000000000000000000000000000",
39761
39775
  witnessIndex,
39762
- predicate: predicate?.bytes,
39763
- predicateData: predicate?.predicateDataBytes
39776
+ predicate: predicate?.bytes
39764
39777
  };
39765
39778
  this.pushInput(input);
39766
39779
  this.addChangeOutput(owner, assetId);
@@ -39792,8 +39805,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39792
39805
  recipient: recipient.toB256(),
39793
39806
  amount,
39794
39807
  witnessIndex,
39795
- predicate: predicate?.bytes,
39796
- predicateData: predicate?.predicateDataBytes
39808
+ predicate: predicate?.bytes
39797
39809
  };
39798
39810
  this.pushInput(input);
39799
39811
  this.addChangeOutput(recipient, assetId);
@@ -47785,7 +47797,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47785
47797
  // src/predicate/predicate.ts
47786
47798
  var Predicate = class extends Account {
47787
47799
  bytes;
47788
- predicateDataBytes = Uint8Array.from([]);
47789
47800
  predicateData = [];
47790
47801
  interface;
47791
47802
  /**