@fuel-ts/account 0.0.0-rc-2322-20240517062704 → 0.0.0-rc-2272-20240517113706

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.

@@ -32434,7 +32434,7 @@ spurious results.`);
32434
32434
  return {
32435
32435
  FORC: "0.58.0",
32436
32436
  FUEL_CORE: "0.26.0",
32437
- FUELS: "0.86.0"
32437
+ FUELS: "0.87.0"
32438
32438
  };
32439
32439
  }
32440
32440
  function parseVersion(version) {
@@ -34677,16 +34677,34 @@ This unreleased fuel-core build may include features and updates not yet support
34677
34677
  WORD_SIZE + // Predicate size
34678
34678
  WORD_SIZE + // Predicate data size
34679
34679
  WORD_SIZE;
34680
+ var isUint8Array = (value) => value instanceof Uint8Array;
34681
+ var hasNestedOption = (coders) => {
34682
+ const array = Array.isArray(coders) ? coders : Object.values(coders);
34683
+ for (const node of array) {
34684
+ if (node.type === OPTION_CODER_TYPE) {
34685
+ return true;
34686
+ }
34687
+ if ("coder" in node && node.coder.type === OPTION_CODER_TYPE) {
34688
+ return true;
34689
+ }
34690
+ if ("coders" in node) {
34691
+ const child = hasNestedOption(node.coders);
34692
+ if (child) {
34693
+ return true;
34694
+ }
34695
+ }
34696
+ }
34697
+ return false;
34698
+ };
34680
34699
  var ArrayCoder = class extends Coder {
34681
34700
  coder;
34682
34701
  length;
34683
34702
  #hasNestedOption;
34684
34703
  constructor(coder, length) {
34685
- const hasNestedOption = coder.type === OPTION_CODER_TYPE;
34686
34704
  super("array", `[${coder.type}; ${length}]`, length * coder.encodedLength);
34687
34705
  this.coder = coder;
34688
34706
  this.length = length;
34689
- this.#hasNestedOption = hasNestedOption;
34707
+ this.#hasNestedOption = hasNestedOption([coder]);
34690
34708
  }
34691
34709
  encode(value) {
34692
34710
  if (!Array.isArray(value)) {
@@ -34866,7 +34884,6 @@ This unreleased fuel-core build may include features and updates not yet support
34866
34884
  #encodedValueSize;
34867
34885
  #hasNestedOption;
34868
34886
  constructor(name, coders) {
34869
- const hasNestedOption = Object.values(coders).some((coder) => coder.type === OPTION_CODER_TYPE);
34870
34887
  const caseIndexCoder = new BigNumberCoder("u64");
34871
34888
  const encodedValueSize = Object.values(coders).reduce(
34872
34889
  (max, coder) => Math.max(max, coder.encodedLength),
@@ -34877,7 +34894,7 @@ This unreleased fuel-core build may include features and updates not yet support
34877
34894
  this.coders = coders;
34878
34895
  this.#caseIndexCoder = caseIndexCoder;
34879
34896
  this.#encodedValueSize = encodedValueSize;
34880
- this.#hasNestedOption = hasNestedOption;
34897
+ this.#hasNestedOption = hasNestedOption(coders);
34881
34898
  }
34882
34899
  #encodeNativeEnum(value) {
34883
34900
  const valueCoder = this.coders[value];
@@ -35098,7 +35115,6 @@ This unreleased fuel-core build may include features and updates not yet support
35098
35115
  coders;
35099
35116
  #hasNestedOption;
35100
35117
  constructor(name, coders) {
35101
- const hasNestedOption = Object.values(coders).some((coder) => coder.type === OPTION_CODER_TYPE);
35102
35118
  const encodedLength = Object.values(coders).reduce(
35103
35119
  (acc, coder) => acc + coder.encodedLength,
35104
35120
  0
@@ -35106,7 +35122,7 @@ This unreleased fuel-core build may include features and updates not yet support
35106
35122
  super("struct", `struct ${name}`, encodedLength);
35107
35123
  this.name = name;
35108
35124
  this.coders = coders;
35109
- this.#hasNestedOption = hasNestedOption;
35125
+ this.#hasNestedOption = hasNestedOption(coders);
35110
35126
  }
35111
35127
  encode(value) {
35112
35128
  return concatBytes2(
@@ -35142,11 +35158,10 @@ This unreleased fuel-core build may include features and updates not yet support
35142
35158
  coders;
35143
35159
  #hasNestedOption;
35144
35160
  constructor(coders) {
35145
- const hasNestedOption = coders.some((coder) => coder.type === OPTION_CODER_TYPE);
35146
35161
  const encodedLength = coders.reduce((acc, coder) => acc + coder.encodedLength, 0);
35147
35162
  super("tuple", `(${coders.map((coder) => coder.type).join(", ")})`, encodedLength);
35148
35163
  this.coders = coders;
35149
- this.#hasNestedOption = hasNestedOption;
35164
+ this.#hasNestedOption = hasNestedOption(coders);
35150
35165
  }
35151
35166
  encode(value) {
35152
35167
  if (this.coders.length !== value.length) {
@@ -35167,14 +35182,13 @@ This unreleased fuel-core build may include features and updates not yet support
35167
35182
  return [decodedValue, newOffset];
35168
35183
  }
35169
35184
  };
35170
- var isUint8Array = (value) => value instanceof Uint8Array;
35171
35185
  var VecCoder = class extends Coder {
35172
35186
  coder;
35173
35187
  #hasNestedOption;
35174
35188
  constructor(coder) {
35175
35189
  super("struct", `struct Vec`, coder.encodedLength + WORD_SIZE);
35176
35190
  this.coder = coder;
35177
- this.#hasNestedOption = coder.type === OPTION_CODER_TYPE;
35191
+ this.#hasNestedOption = hasNestedOption([coder]);
35178
35192
  }
35179
35193
  encode(value) {
35180
35194
  if (!Array.isArray(value) && !isUint8Array(value)) {