@fuel-ts/account 0.0.0-pr-2017-20240410091814 → 0.0.0-pr-2017-20240411102002

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;
@@ -39759,8 +39772,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39759
39772
  assetId,
39760
39773
  txPointer: "0x00000000000000000000000000000000",
39761
39774
  witnessIndex,
39762
- predicate: predicate?.bytes,
39763
- predicateData: predicate?.predicateDataBytes
39775
+ predicate: predicate?.bytes
39764
39776
  };
39765
39777
  this.pushInput(input);
39766
39778
  this.addChangeOutput(owner, assetId);
@@ -39792,8 +39804,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39792
39804
  recipient: recipient.toB256(),
39793
39805
  amount,
39794
39806
  witnessIndex,
39795
- predicate: predicate?.bytes,
39796
- predicateData: predicate?.predicateDataBytes
39807
+ predicate: predicate?.bytes
39797
39808
  };
39798
39809
  this.pushInput(input);
39799
39810
  this.addChangeOutput(recipient, assetId);
@@ -47785,7 +47796,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47785
47796
  // src/predicate/predicate.ts
47786
47797
  var Predicate = class extends Account {
47787
47798
  bytes;
47788
- predicateDataBytes = Uint8Array.from([]);
47789
47799
  predicateData = [];
47790
47800
  interface;
47791
47801
  /**