@fuel-ts/account 0.0.0-rc-2143-20240517152329 → 0.0.0-rc-1356-20240520081557

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.

@@ -29472,7 +29472,7 @@ spurious results.`);
29472
29472
  return {
29473
29473
  FORC: "0.59.0",
29474
29474
  FUEL_CORE: "0.26.0",
29475
- FUELS: "0.88.0"
29475
+ FUELS: "0.88.1"
29476
29476
  };
29477
29477
  }
29478
29478
  function parseVersion(version) {
@@ -29985,6 +29985,13 @@ This unreleased fuel-core build may include features and updates not yet support
29985
29985
  };
29986
29986
  var DateTime = _DateTime;
29987
29987
  __publicField3(DateTime, "TAI64_NULL", "");
29988
+ function sleep(time) {
29989
+ return new Promise((resolve) => {
29990
+ setTimeout(() => {
29991
+ resolve(true);
29992
+ }, time);
29993
+ });
29994
+ }
29988
29995
  function isDefined(value) {
29989
29996
  return value !== void 0;
29990
29997
  }
@@ -31175,7 +31182,7 @@ This unreleased fuel-core build may include features and updates not yet support
31175
31182
  coders;
31176
31183
  #caseIndexCoder;
31177
31184
  #encodedValueSize;
31178
- #hasNestedOption;
31185
+ #shouldValidateLength;
31179
31186
  constructor(name, coders) {
31180
31187
  const caseIndexCoder = new BigNumberCoder("u64");
31181
31188
  const encodedValueSize = Object.values(coders).reduce(
@@ -31187,7 +31194,7 @@ This unreleased fuel-core build may include features and updates not yet support
31187
31194
  this.coders = coders;
31188
31195
  this.#caseIndexCoder = caseIndexCoder;
31189
31196
  this.#encodedValueSize = encodedValueSize;
31190
- this.#hasNestedOption = hasNestedOption(coders);
31197
+ this.#shouldValidateLength = !(this.type === OPTION_CODER_TYPE || hasNestedOption(coders));
31191
31198
  }
31192
31199
  #encodeNativeEnum(value) {
31193
31200
  const valueCoder = this.coders[value];
@@ -31216,7 +31223,7 @@ This unreleased fuel-core build may include features and updates not yet support
31216
31223
  return [caseKey, newOffset];
31217
31224
  }
31218
31225
  decode(data, offset) {
31219
- if (!this.#hasNestedOption && data.length < this.#encodedValueSize) {
31226
+ if (this.#shouldValidateLength && data.length < this.#encodedValueSize) {
31220
31227
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid enum data size.`);
31221
31228
  }
31222
31229
  const caseBytes = new BigNumberCoder("u64").decode(data, offset)[0];
@@ -33076,10 +33083,10 @@ This unreleased fuel-core build may include features and updates not yet support
33076
33083
  encode(value) {
33077
33084
  const parts = [];
33078
33085
  parts.push(new UpgradePurposeCoder().encode(value.upgradePurpose));
33079
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
33080
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
33081
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
33082
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
33086
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
33087
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
33088
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
33089
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
33083
33090
  parts.push(new PoliciesCoder().encode(value.policies));
33084
33091
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
33085
33092
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -33091,13 +33098,13 @@ This unreleased fuel-core build may include features and updates not yet support
33091
33098
  let o = offset;
33092
33099
  [decoded, o] = new UpgradePurposeCoder().decode(data, o);
33093
33100
  const upgradePurpose = decoded;
33094
- [decoded, o] = new NumberCoder("u32").decode(data, o);
33101
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
33095
33102
  const policyTypes = decoded;
33096
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33103
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33097
33104
  const inputsCount = decoded;
33098
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33105
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33099
33106
  const outputsCount = decoded;
33100
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33107
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33101
33108
  const witnessesCount = decoded;
33102
33109
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
33103
33110
  const policies = decoded;
@@ -33131,14 +33138,14 @@ This unreleased fuel-core build may include features and updates not yet support
33131
33138
  encode(value) {
33132
33139
  const parts = [];
33133
33140
  parts.push(new B256Coder().encode(value.root));
33134
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
33135
- parts.push(new NumberCoder("u16").encode(value.subsectionIndex));
33136
- parts.push(new NumberCoder("u16").encode(value.subsectionsNumber));
33137
- parts.push(new NumberCoder("u16").encode(value.proofSetCount));
33138
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
33139
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
33140
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
33141
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
33141
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessIndex));
33142
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionIndex));
33143
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionsNumber));
33144
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.proofSetCount));
33145
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
33146
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
33147
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
33148
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
33142
33149
  parts.push(new ArrayCoder(new B256Coder(), value.proofSetCount).encode(value.proofSet));
33143
33150
  parts.push(new PoliciesCoder().encode(value.policies));
33144
33151
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
@@ -33151,21 +33158,21 @@ This unreleased fuel-core build may include features and updates not yet support
33151
33158
  let o = offset;
33152
33159
  [decoded, o] = new B256Coder().decode(data, o);
33153
33160
  const root = decoded;
33154
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33161
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33155
33162
  const witnessIndex = decoded;
33156
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33163
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33157
33164
  const subsectionIndex = decoded;
33158
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33165
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33159
33166
  const subsectionsNumber = decoded;
33160
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33167
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33161
33168
  const proofSetCount = decoded;
33162
- [decoded, o] = new NumberCoder("u32").decode(data, o);
33169
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
33163
33170
  const policyTypes = decoded;
33164
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33171
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33165
33172
  const inputsCount = decoded;
33166
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33173
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33167
33174
  const outputsCount = decoded;
33168
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33175
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33169
33176
  const witnessesCount = decoded;
33170
33177
  [decoded, o] = new ArrayCoder(new B256Coder(), proofSetCount).decode(data, o);
33171
33178
  const proofSet = decoded;
@@ -38327,15 +38334,6 @@ ${MessageCoinFragmentDoc}`;
38327
38334
  return normalize2(clone_default(root));
38328
38335
  }
38329
38336
 
38330
- // src/providers/utils/sleep.ts
38331
- function sleep(time) {
38332
- return new Promise((resolve) => {
38333
- setTimeout(() => {
38334
- resolve(true);
38335
- }, time);
38336
- });
38337
- }
38338
-
38339
38337
  // src/providers/utils/extract-tx-error.ts
38340
38338
  var assemblePanicError = (statusReason) => {
38341
38339
  let errorMessage = `The transaction reverted with reason: "${statusReason}".`;