@fuel-ts/account 0.88.1 → 0.89.0

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.

Files changed (33) hide show
  1. package/dist/account.d.ts +67 -48
  2. package/dist/account.d.ts.map +1 -1
  3. package/dist/index.global.js +303 -136
  4. package/dist/index.global.js.map +1 -1
  5. package/dist/index.js +257 -102
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +257 -102
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/predicate/predicate.d.ts.map +1 -1
  10. package/dist/providers/provider.d.ts +126 -72
  11. package/dist/providers/provider.d.ts.map +1 -1
  12. package/dist/providers/transaction-request/script-transaction-request.d.ts +7 -0
  13. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
  14. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  15. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
  16. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +1 -0
  17. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
  18. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
  19. package/dist/providers/transaction-summary/operations.d.ts +4 -2
  20. package/dist/providers/transaction-summary/operations.d.ts.map +1 -1
  21. package/dist/providers/transaction-summary/types.d.ts +1 -0
  22. package/dist/providers/transaction-summary/types.d.ts.map +1 -1
  23. package/dist/test-utils/launchNode.d.ts +3 -3
  24. package/dist/test-utils/launchNode.d.ts.map +1 -1
  25. package/dist/test-utils.global.js +454 -308
  26. package/dist/test-utils.global.js.map +1 -1
  27. package/dist/test-utils.js +250 -102
  28. package/dist/test-utils.js.map +1 -1
  29. package/dist/test-utils.mjs +250 -102
  30. package/dist/test-utils.mjs.map +1 -1
  31. package/dist/wallet/base-wallet-unlocked.d.ts +8 -0
  32. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  33. package/package.json +15 -15
@@ -9511,16 +9511,16 @@ spurious results.`);
9511
9511
  },
9512
9512
  // Document
9513
9513
  Document: {
9514
- leave: (node) => join3(node.definitions, "\n\n")
9514
+ leave: (node) => join2(node.definitions, "\n\n")
9515
9515
  },
9516
9516
  OperationDefinition: {
9517
9517
  leave(node) {
9518
- const varDefs = wrap2("(", join3(node.variableDefinitions, ", "), ")");
9519
- const prefix = join3(
9518
+ const varDefs = wrap2("(", join2(node.variableDefinitions, ", "), ")");
9519
+ const prefix = join2(
9520
9520
  [
9521
9521
  node.operation,
9522
- join3([node.name, varDefs]),
9523
- join3(node.directives, " ")
9522
+ join2([node.name, varDefs]),
9523
+ join2(node.directives, " ")
9524
9524
  ],
9525
9525
  " "
9526
9526
  );
@@ -9528,7 +9528,7 @@ spurious results.`);
9528
9528
  }
9529
9529
  },
9530
9530
  VariableDefinition: {
9531
- leave: ({ variable, type: type3, defaultValue, directives }) => variable + ": " + type3 + wrap2(" = ", defaultValue) + wrap2(" ", join3(directives, " "))
9531
+ leave: ({ variable, type: type3, defaultValue, directives }) => variable + ": " + type3 + wrap2(" = ", defaultValue) + wrap2(" ", join2(directives, " "))
9532
9532
  },
9533
9533
  SelectionSet: {
9534
9534
  leave: ({ selections }) => block2(selections)
@@ -9536,11 +9536,11 @@ spurious results.`);
9536
9536
  Field: {
9537
9537
  leave({ alias, name, arguments: args, directives, selectionSet }) {
9538
9538
  const prefix = wrap2("", alias, ": ") + name;
9539
- let argsLine = prefix + wrap2("(", join3(args, ", "), ")");
9539
+ let argsLine = prefix + wrap2("(", join2(args, ", "), ")");
9540
9540
  if (argsLine.length > MAX_LINE_LENGTH2) {
9541
- argsLine = prefix + wrap2("(\n", indent2(join3(args, "\n")), "\n)");
9541
+ argsLine = prefix + wrap2("(\n", indent2(join2(args, "\n")), "\n)");
9542
9542
  }
9543
- return join3([argsLine, join3(directives, " "), selectionSet], " ");
9543
+ return join2([argsLine, join2(directives, " "), selectionSet], " ");
9544
9544
  }
9545
9545
  },
9546
9546
  Argument: {
@@ -9548,14 +9548,14 @@ spurious results.`);
9548
9548
  },
9549
9549
  // Fragments
9550
9550
  FragmentSpread: {
9551
- leave: ({ name, directives }) => "..." + name + wrap2(" ", join3(directives, " "))
9551
+ leave: ({ name, directives }) => "..." + name + wrap2(" ", join2(directives, " "))
9552
9552
  },
9553
9553
  InlineFragment: {
9554
- leave: ({ typeCondition, directives, selectionSet }) => join3(
9554
+ leave: ({ typeCondition, directives, selectionSet }) => join2(
9555
9555
  [
9556
9556
  "...",
9557
9557
  wrap2("on ", typeCondition),
9558
- join3(directives, " "),
9558
+ join2(directives, " "),
9559
9559
  selectionSet
9560
9560
  ],
9561
9561
  " "
@@ -9564,7 +9564,7 @@ spurious results.`);
9564
9564
  FragmentDefinition: {
9565
9565
  leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => (
9566
9566
  // or removed in the future.
9567
- `fragment ${name}${wrap2("(", join3(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join3(directives, " "), " ")}` + selectionSet
9567
+ `fragment ${name}${wrap2("(", join2(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join2(directives, " "), " ")}` + selectionSet
9568
9568
  )
9569
9569
  },
9570
9570
  // Value
@@ -9587,17 +9587,17 @@ spurious results.`);
9587
9587
  leave: ({ value }) => value
9588
9588
  },
9589
9589
  ListValue: {
9590
- leave: ({ values }) => "[" + join3(values, ", ") + "]"
9590
+ leave: ({ values }) => "[" + join2(values, ", ") + "]"
9591
9591
  },
9592
9592
  ObjectValue: {
9593
- leave: ({ fields }) => "{" + join3(fields, ", ") + "}"
9593
+ leave: ({ fields }) => "{" + join2(fields, ", ") + "}"
9594
9594
  },
9595
9595
  ObjectField: {
9596
9596
  leave: ({ name, value }) => name + ": " + value
9597
9597
  },
9598
9598
  // Directive
9599
9599
  Directive: {
9600
- leave: ({ name, arguments: args }) => "@" + name + wrap2("(", join3(args, ", "), ")")
9600
+ leave: ({ name, arguments: args }) => "@" + name + wrap2("(", join2(args, ", "), ")")
9601
9601
  },
9602
9602
  // Type
9603
9603
  NamedType: {
@@ -9611,122 +9611,122 @@ spurious results.`);
9611
9611
  },
9612
9612
  // Type System Definitions
9613
9613
  SchemaDefinition: {
9614
- leave: ({ description, directives, operationTypes }) => wrap2("", description, "\n") + join3(["schema", join3(directives, " "), block2(operationTypes)], " ")
9614
+ leave: ({ description, directives, operationTypes }) => wrap2("", description, "\n") + join2(["schema", join2(directives, " "), block2(operationTypes)], " ")
9615
9615
  },
9616
9616
  OperationTypeDefinition: {
9617
9617
  leave: ({ operation, type: type3 }) => operation + ": " + type3
9618
9618
  },
9619
9619
  ScalarTypeDefinition: {
9620
- leave: ({ description, name, directives }) => wrap2("", description, "\n") + join3(["scalar", name, join3(directives, " ")], " ")
9620
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join2(["scalar", name, join2(directives, " ")], " ")
9621
9621
  },
9622
9622
  ObjectTypeDefinition: {
9623
- leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join3(
9623
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join2(
9624
9624
  [
9625
9625
  "type",
9626
9626
  name,
9627
- wrap2("implements ", join3(interfaces, " & ")),
9628
- join3(directives, " "),
9627
+ wrap2("implements ", join2(interfaces, " & ")),
9628
+ join2(directives, " "),
9629
9629
  block2(fields)
9630
9630
  ],
9631
9631
  " "
9632
9632
  )
9633
9633
  },
9634
9634
  FieldDefinition: {
9635
- leave: ({ description, name, arguments: args, type: type3, directives }) => wrap2("", description, "\n") + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + ": " + type3 + wrap2(" ", join3(directives, " "))
9635
+ leave: ({ description, name, arguments: args, type: type3, directives }) => wrap2("", description, "\n") + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join2(args, "\n")), "\n)") : wrap2("(", join2(args, ", "), ")")) + ": " + type3 + wrap2(" ", join2(directives, " "))
9636
9636
  },
9637
9637
  InputValueDefinition: {
9638
- leave: ({ description, name, type: type3, defaultValue, directives }) => wrap2("", description, "\n") + join3(
9639
- [name + ": " + type3, wrap2("= ", defaultValue), join3(directives, " ")],
9638
+ leave: ({ description, name, type: type3, defaultValue, directives }) => wrap2("", description, "\n") + join2(
9639
+ [name + ": " + type3, wrap2("= ", defaultValue), join2(directives, " ")],
9640
9640
  " "
9641
9641
  )
9642
9642
  },
9643
9643
  InterfaceTypeDefinition: {
9644
- leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join3(
9644
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join2(
9645
9645
  [
9646
9646
  "interface",
9647
9647
  name,
9648
- wrap2("implements ", join3(interfaces, " & ")),
9649
- join3(directives, " "),
9648
+ wrap2("implements ", join2(interfaces, " & ")),
9649
+ join2(directives, " "),
9650
9650
  block2(fields)
9651
9651
  ],
9652
9652
  " "
9653
9653
  )
9654
9654
  },
9655
9655
  UnionTypeDefinition: {
9656
- leave: ({ description, name, directives, types }) => wrap2("", description, "\n") + join3(
9657
- ["union", name, join3(directives, " "), wrap2("= ", join3(types, " | "))],
9656
+ leave: ({ description, name, directives, types }) => wrap2("", description, "\n") + join2(
9657
+ ["union", name, join2(directives, " "), wrap2("= ", join2(types, " | "))],
9658
9658
  " "
9659
9659
  )
9660
9660
  },
9661
9661
  EnumTypeDefinition: {
9662
- leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join3(["enum", name, join3(directives, " "), block2(values)], " ")
9662
+ leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join2(["enum", name, join2(directives, " "), block2(values)], " ")
9663
9663
  },
9664
9664
  EnumValueDefinition: {
9665
- leave: ({ description, name, directives }) => wrap2("", description, "\n") + join3([name, join3(directives, " ")], " ")
9665
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join2([name, join2(directives, " ")], " ")
9666
9666
  },
9667
9667
  InputObjectTypeDefinition: {
9668
- leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join3(["input", name, join3(directives, " "), block2(fields)], " ")
9668
+ leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join2(["input", name, join2(directives, " "), block2(fields)], " ")
9669
9669
  },
9670
9670
  DirectiveDefinition: {
9671
- leave: ({ description, name, arguments: args, repeatable, locations }) => wrap2("", description, "\n") + "directive @" + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join3(locations, " | ")
9671
+ leave: ({ description, name, arguments: args, repeatable, locations }) => wrap2("", description, "\n") + "directive @" + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join2(args, "\n")), "\n)") : wrap2("(", join2(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join2(locations, " | ")
9672
9672
  },
9673
9673
  SchemaExtension: {
9674
- leave: ({ directives, operationTypes }) => join3(
9675
- ["extend schema", join3(directives, " "), block2(operationTypes)],
9674
+ leave: ({ directives, operationTypes }) => join2(
9675
+ ["extend schema", join2(directives, " "), block2(operationTypes)],
9676
9676
  " "
9677
9677
  )
9678
9678
  },
9679
9679
  ScalarTypeExtension: {
9680
- leave: ({ name, directives }) => join3(["extend scalar", name, join3(directives, " ")], " ")
9680
+ leave: ({ name, directives }) => join2(["extend scalar", name, join2(directives, " ")], " ")
9681
9681
  },
9682
9682
  ObjectTypeExtension: {
9683
- leave: ({ name, interfaces, directives, fields }) => join3(
9683
+ leave: ({ name, interfaces, directives, fields }) => join2(
9684
9684
  [
9685
9685
  "extend type",
9686
9686
  name,
9687
- wrap2("implements ", join3(interfaces, " & ")),
9688
- join3(directives, " "),
9687
+ wrap2("implements ", join2(interfaces, " & ")),
9688
+ join2(directives, " "),
9689
9689
  block2(fields)
9690
9690
  ],
9691
9691
  " "
9692
9692
  )
9693
9693
  },
9694
9694
  InterfaceTypeExtension: {
9695
- leave: ({ name, interfaces, directives, fields }) => join3(
9695
+ leave: ({ name, interfaces, directives, fields }) => join2(
9696
9696
  [
9697
9697
  "extend interface",
9698
9698
  name,
9699
- wrap2("implements ", join3(interfaces, " & ")),
9700
- join3(directives, " "),
9699
+ wrap2("implements ", join2(interfaces, " & ")),
9700
+ join2(directives, " "),
9701
9701
  block2(fields)
9702
9702
  ],
9703
9703
  " "
9704
9704
  )
9705
9705
  },
9706
9706
  UnionTypeExtension: {
9707
- leave: ({ name, directives, types }) => join3(
9707
+ leave: ({ name, directives, types }) => join2(
9708
9708
  [
9709
9709
  "extend union",
9710
9710
  name,
9711
- join3(directives, " "),
9712
- wrap2("= ", join3(types, " | "))
9711
+ join2(directives, " "),
9712
+ wrap2("= ", join2(types, " | "))
9713
9713
  ],
9714
9714
  " "
9715
9715
  )
9716
9716
  },
9717
9717
  EnumTypeExtension: {
9718
- leave: ({ name, directives, values }) => join3(["extend enum", name, join3(directives, " "), block2(values)], " ")
9718
+ leave: ({ name, directives, values }) => join2(["extend enum", name, join2(directives, " "), block2(values)], " ")
9719
9719
  },
9720
9720
  InputObjectTypeExtension: {
9721
- leave: ({ name, directives, fields }) => join3(["extend input", name, join3(directives, " "), block2(fields)], " ")
9721
+ leave: ({ name, directives, fields }) => join2(["extend input", name, join2(directives, " "), block2(fields)], " ")
9722
9722
  }
9723
9723
  };
9724
- function join3(maybeArray, separator = "") {
9724
+ function join2(maybeArray, separator = "") {
9725
9725
  var _maybeArray$filter$jo;
9726
9726
  return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
9727
9727
  }
9728
9728
  function block2(array) {
9729
- return wrap2("{\n", indent2(join3(array, "\n")), "\n}");
9729
+ return wrap2("{\n", indent2(join2(array, "\n")), "\n}");
9730
9730
  }
9731
9731
  function wrap2(start, maybeString, end = "") {
9732
9732
  return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
@@ -32432,9 +32432,9 @@ spurious results.`);
32432
32432
  // ../versions/dist/index.mjs
32433
32433
  function getBuiltinVersions() {
32434
32434
  return {
32435
- FORC: "0.59.0",
32435
+ FORC: "0.60.0",
32436
32436
  FUEL_CORE: "0.26.0",
32437
- FUELS: "0.88.1"
32437
+ FUELS: "0.89.0"
32438
32438
  };
32439
32439
  }
32440
32440
  function parseVersion(version) {
@@ -32842,7 +32842,10 @@ This unreleased fuel-core build may include features and updates not yet support
32842
32842
  }
32843
32843
  return result;
32844
32844
  }
32845
- throw new FuelError(ErrorCode.INVALID_DATA, `invalid data - ${name || ""}`);
32845
+ const nameMessage = name ? ` ${name} -` : "";
32846
+ const message = `invalid data:${nameMessage} ${value}
32847
+ If you are attempting to transform a hex value, please make sure it is being passed as a string and wrapped in quotes.`;
32848
+ throw new FuelError(ErrorCode.INVALID_DATA, message);
32846
32849
  };
32847
32850
  var concatBytes2 = (arrays) => {
32848
32851
  const byteArrays = arrays.map((array) => {
@@ -32942,8 +32945,8 @@ This unreleased fuel-core build may include features and updates not yet support
32942
32945
  max_inputs: 255,
32943
32946
  max_outputs: 255,
32944
32947
  max_witnesses: 255,
32945
- max_gas_per_tx: 3e7,
32946
- max_size: 112640,
32948
+ max_gas_per_tx: 1e8,
32949
+ max_size: 262144,
32947
32950
  max_bytecode_subsections: 256
32948
32951
  }
32949
32952
  },
@@ -32952,7 +32955,7 @@ This unreleased fuel-core build may include features and updates not yet support
32952
32955
  max_predicate_length: 102400,
32953
32956
  max_predicate_data_length: 102400,
32954
32957
  max_message_data_length: 102400,
32955
- max_gas_per_predicate: 3e7
32958
+ max_gas_per_predicate: 1e8
32956
32959
  }
32957
32960
  },
32958
32961
  script_params: {
@@ -32963,7 +32966,7 @@ This unreleased fuel-core build may include features and updates not yet support
32963
32966
  },
32964
32967
  contract_params: {
32965
32968
  V1: {
32966
- contract_max_size: 102400,
32969
+ contract_max_size: 262144,
32967
32970
  max_storage_slots: 1760
32968
32971
  }
32969
32972
  },
@@ -32978,53 +32981,53 @@ This unreleased fuel-core build may include features and updates not yet support
32978
32981
  V1: {
32979
32982
  add: 2,
32980
32983
  addi: 2,
32981
- aloc: 1,
32984
+ aloc: 2,
32982
32985
  and: 2,
32983
32986
  andi: 2,
32984
- bal: 366,
32987
+ bal: 86,
32985
32988
  bhei: 2,
32986
32989
  bhsh: 2,
32987
- burn: 33949,
32990
+ burn: 25770,
32988
32991
  cb: 2,
32989
32992
  cfei: 2,
32990
32993
  cfsi: 2,
32991
32994
  div: 2,
32992
32995
  divi: 2,
32993
- eck1: 3347,
32994
- ecr1: 46165,
32995
- ed19: 4210,
32996
+ eck1: 3114,
32997
+ ecr1: 42270,
32998
+ ed19: 2878,
32996
32999
  eq: 2,
32997
33000
  exp: 2,
32998
33001
  expi: 2,
32999
33002
  flag: 1,
33000
33003
  gm: 2,
33001
33004
  gt: 2,
33002
- gtf: 16,
33005
+ gtf: 12,
33003
33006
  ji: 2,
33004
33007
  jmp: 2,
33005
33008
  jne: 2,
33006
33009
  jnei: 2,
33007
33010
  jnzi: 2,
33008
- jmpf: 2,
33009
- jmpb: 2,
33010
- jnzf: 2,
33011
- jnzb: 2,
33012
- jnef: 2,
33013
- jneb: 2,
33011
+ jmpf: 1,
33012
+ jmpb: 1,
33013
+ jnzf: 1,
33014
+ jnzb: 1,
33015
+ jnef: 1,
33016
+ jneb: 1,
33014
33017
  lb: 2,
33015
- log: 754,
33018
+ log: 165,
33016
33019
  lt: 2,
33017
33020
  lw: 2,
33018
- mint: 35718,
33021
+ mint: 29024,
33019
33022
  mlog: 2,
33020
- mod: 2,
33023
+ mod_op: 2,
33021
33024
  modi: 2,
33022
- move: 2,
33025
+ move_op: 2,
33023
33026
  movi: 2,
33024
- mroo: 5,
33027
+ mroo: 4,
33025
33028
  mul: 2,
33026
33029
  muli: 2,
33027
- mldv: 4,
33030
+ mldv: 3,
33028
33031
  noop: 1,
33029
33032
  not: 2,
33030
33033
  or: 2,
@@ -33033,168 +33036,168 @@ This unreleased fuel-core build may include features and updates not yet support
33033
33036
  popl: 3,
33034
33037
  pshh: 4,
33035
33038
  pshl: 4,
33036
- ret_contract: 733,
33037
- rvrt_contract: 722,
33039
+ ret: 134,
33040
+ rvrt: 153,
33038
33041
  sb: 2,
33039
33042
  sll: 2,
33040
33043
  slli: 2,
33041
33044
  srl: 2,
33042
33045
  srli: 2,
33043
- srw: 253,
33046
+ srw: 209,
33044
33047
  sub: 2,
33045
33048
  subi: 2,
33046
33049
  sw: 2,
33047
- sww: 29053,
33048
- time: 79,
33049
- tr: 46242,
33050
- tro: 33251,
33051
- wdcm: 3,
33050
+ sww: 22501,
33051
+ time: 50,
33052
+ tr: 33912,
33053
+ tro: 24294,
33054
+ wdcm: 2,
33052
33055
  wqcm: 3,
33053
33056
  wdop: 3,
33054
33057
  wqop: 3,
33055
33058
  wdml: 3,
33056
33059
  wqml: 4,
33057
33060
  wddv: 5,
33058
- wqdv: 7,
33059
- wdmd: 11,
33060
- wqmd: 18,
33061
+ wqdv: 6,
33062
+ wdmd: 10,
33063
+ wqmd: 17,
33061
33064
  wdam: 9,
33062
- wqam: 12,
33063
- wdmm: 11,
33064
- wqmm: 11,
33065
+ wqam: 11,
33066
+ wdmm: 10,
33067
+ wqmm: 10,
33065
33068
  xor: 2,
33066
33069
  xori: 2,
33067
33070
  call: {
33068
33071
  LightOperation: {
33069
- base: 21687,
33070
- units_per_gas: 4
33072
+ base: 18190,
33073
+ units_per_gas: 5
33071
33074
  }
33072
33075
  },
33073
33076
  ccp: {
33074
33077
  LightOperation: {
33075
- base: 59,
33076
- units_per_gas: 20
33078
+ base: 48,
33079
+ units_per_gas: 22
33077
33080
  }
33078
33081
  },
33079
33082
  croo: {
33080
33083
  LightOperation: {
33081
- base: 1,
33082
- units_per_gas: 1
33084
+ base: 131,
33085
+ units_per_gas: 2
33083
33086
  }
33084
33087
  },
33085
33088
  csiz: {
33086
33089
  LightOperation: {
33087
- base: 59,
33088
- units_per_gas: 195
33090
+ base: 45,
33091
+ units_per_gas: 237
33089
33092
  }
33090
33093
  },
33091
33094
  k256: {
33092
33095
  LightOperation: {
33093
- base: 282,
33096
+ base: 37,
33094
33097
  units_per_gas: 3
33095
33098
  }
33096
33099
  },
33097
33100
  ldc: {
33098
33101
  LightOperation: {
33099
- base: 45,
33100
- units_per_gas: 65
33102
+ base: 39,
33103
+ units_per_gas: 68
33101
33104
  }
33102
33105
  },
33103
33106
  logd: {
33104
33107
  LightOperation: {
33105
- base: 1134,
33108
+ base: 565,
33106
33109
  units_per_gas: 2
33107
33110
  }
33108
33111
  },
33109
33112
  mcl: {
33110
33113
  LightOperation: {
33111
33114
  base: 3,
33112
- units_per_gas: 523
33115
+ units_per_gas: 564
33113
33116
  }
33114
33117
  },
33115
33118
  mcli: {
33116
33119
  LightOperation: {
33117
33120
  base: 3,
33118
- units_per_gas: 526
33121
+ units_per_gas: 560
33119
33122
  }
33120
33123
  },
33121
33124
  mcp: {
33122
33125
  LightOperation: {
33123
- base: 3,
33124
- units_per_gas: 448
33126
+ base: 4,
33127
+ units_per_gas: 185
33125
33128
  }
33126
33129
  },
33127
33130
  mcpi: {
33128
33131
  LightOperation: {
33129
- base: 7,
33130
- units_per_gas: 585
33132
+ base: 9,
33133
+ units_per_gas: 455
33131
33134
  }
33132
33135
  },
33133
33136
  meq: {
33134
33137
  LightOperation: {
33135
- base: 11,
33136
- units_per_gas: 1097
33138
+ base: 3,
33139
+ units_per_gas: 766
33137
33140
  }
33138
33141
  },
33139
- retd_contract: {
33142
+ retd: {
33140
33143
  LightOperation: {
33141
- base: 1086,
33142
- units_per_gas: 2
33144
+ base: 485,
33145
+ units_per_gas: 3
33143
33146
  }
33144
33147
  },
33145
33148
  s256: {
33146
33149
  LightOperation: {
33147
- base: 45,
33150
+ base: 42,
33148
33151
  units_per_gas: 3
33149
33152
  }
33150
33153
  },
33151
33154
  scwq: {
33152
33155
  HeavyOperation: {
33153
- base: 30375,
33154
- gas_per_unit: 28628
33156
+ base: 21672,
33157
+ gas_per_unit: 22146
33155
33158
  }
33156
33159
  },
33157
33160
  smo: {
33158
33161
  LightOperation: {
33159
- base: 64196,
33162
+ base: 44437,
33160
33163
  units_per_gas: 1
33161
33164
  }
33162
33165
  },
33163
33166
  srwq: {
33164
33167
  HeavyOperation: {
33165
- base: 262,
33166
- gas_per_unit: 249
33168
+ base: 239,
33169
+ gas_per_unit: 234
33167
33170
  }
33168
33171
  },
33169
33172
  swwq: {
33170
33173
  HeavyOperation: {
33171
- base: 28484,
33172
- gas_per_unit: 26613
33174
+ base: 22724,
33175
+ gas_per_unit: 21231
33173
33176
  }
33174
33177
  },
33175
33178
  contract_root: {
33176
33179
  LightOperation: {
33177
- base: 45,
33178
- units_per_gas: 1
33180
+ base: 42,
33181
+ units_per_gas: 2
33179
33182
  }
33180
33183
  },
33181
33184
  state_root: {
33182
33185
  HeavyOperation: {
33183
- base: 350,
33184
- gas_per_unit: 176
33186
+ base: 323,
33187
+ gas_per_unit: 169
33185
33188
  }
33186
33189
  },
33187
33190
  new_storage_per_byte: 63,
33188
33191
  vm_initialization: {
33189
- LightOperation: {
33190
- base: 1645,
33191
- units_per_gas: 14
33192
+ HeavyOperation: {
33193
+ base: 5254820,
33194
+ gas_per_unit: 0
33192
33195
  }
33193
33196
  }
33194
33197
  }
33195
33198
  },
33196
- base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
33197
- block_gas_limit: 3e7,
33199
+ base_asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
33200
+ block_gas_limit: 1e8,
33198
33201
  privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
33199
33202
  }
33200
33203
  },
@@ -33221,7 +33224,7 @@ This unreleased fuel-core build may include features and updates not yet support
33221
33224
  tx_pointer_tx_idx: 0,
33222
33225
  owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
33223
33226
  amount: 18446744073709552e3,
33224
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33227
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33225
33228
  },
33226
33229
  {
33227
33230
  tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
@@ -33230,7 +33233,7 @@ This unreleased fuel-core build may include features and updates not yet support
33230
33233
  tx_pointer_tx_idx: 0,
33231
33234
  owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
33232
33235
  amount: 18446744073709552e3,
33233
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33236
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33234
33237
  },
33235
33238
  {
33236
33239
  tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
@@ -33257,7 +33260,7 @@ This unreleased fuel-core build may include features and updates not yet support
33257
33260
  tx_pointer_tx_idx: 0,
33258
33261
  owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
33259
33262
  amount: 18446744073709552e3,
33260
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33263
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33261
33264
  },
33262
33265
  {
33263
33266
  tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
@@ -33284,7 +33287,7 @@ This unreleased fuel-core build may include features and updates not yet support
33284
33287
  tx_pointer_tx_idx: 0,
33285
33288
  owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
33286
33289
  amount: 18446744073709552e3,
33287
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33290
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33288
33291
  },
33289
33292
  {
33290
33293
  tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
@@ -33311,7 +33314,7 @@ This unreleased fuel-core build may include features and updates not yet support
33311
33314
  tx_pointer_tx_idx: 0,
33312
33315
  owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
33313
33316
  amount: 18446744073709552e3,
33314
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33317
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33315
33318
  },
33316
33319
  {
33317
33320
  tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
@@ -33338,7 +33341,7 @@ This unreleased fuel-core build may include features and updates not yet support
33338
33341
  tx_pointer_tx_idx: 0,
33339
33342
  owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
33340
33343
  amount: 18446744073709552e3,
33341
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33344
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33342
33345
  },
33343
33346
  {
33344
33347
  tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
@@ -33365,7 +33368,7 @@ This unreleased fuel-core build may include features and updates not yet support
33365
33368
  tx_pointer_tx_idx: 0,
33366
33369
  owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
33367
33370
  amount: 18446744073709552e3,
33368
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33371
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33369
33372
  },
33370
33373
  {
33371
33374
  tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
@@ -33392,7 +33395,7 @@ This unreleased fuel-core build may include features and updates not yet support
33392
33395
  tx_pointer_tx_idx: 0,
33393
33396
  owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
33394
33397
  amount: 18446744073709552e3,
33395
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33398
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33396
33399
  },
33397
33400
  {
33398
33401
  tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
@@ -33419,7 +33422,7 @@ This unreleased fuel-core build may include features and updates not yet support
33419
33422
  tx_pointer_tx_idx: 0,
33420
33423
  owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
33421
33424
  amount: 18446744073709552e3,
33422
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33425
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33423
33426
  },
33424
33427
  {
33425
33428
  tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
@@ -33446,7 +33449,7 @@ This unreleased fuel-core build may include features and updates not yet support
33446
33449
  tx_pointer_tx_idx: 0,
33447
33450
  owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
33448
33451
  amount: 18446744073709552e3,
33449
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33452
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33450
33453
  },
33451
33454
  {
33452
33455
  tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
@@ -33473,7 +33476,7 @@ This unreleased fuel-core build may include features and updates not yet support
33473
33476
  tx_pointer_tx_idx: 0,
33474
33477
  owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
33475
33478
  amount: 18446744073709552e3,
33476
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33479
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33477
33480
  },
33478
33481
  {
33479
33482
  tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
@@ -33500,7 +33503,7 @@ This unreleased fuel-core build may include features and updates not yet support
33500
33503
  tx_pointer_tx_idx: 0,
33501
33504
  owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
33502
33505
  amount: 18446744073709552e3,
33503
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33506
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33504
33507
  },
33505
33508
  {
33506
33509
  tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
@@ -33527,7 +33530,7 @@ This unreleased fuel-core build may include features and updates not yet support
33527
33530
  tx_pointer_tx_idx: 0,
33528
33531
  owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
33529
33532
  amount: 18446744073709552e3,
33530
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33533
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33531
33534
  },
33532
33535
  {
33533
33536
  tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
@@ -33554,7 +33557,7 @@ This unreleased fuel-core build may include features and updates not yet support
33554
33557
  tx_pointer_tx_idx: 0,
33555
33558
  owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
33556
33559
  amount: 18446744073709552e3,
33557
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33560
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33558
33561
  },
33559
33562
  {
33560
33563
  tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
@@ -33581,7 +33584,7 @@ This unreleased fuel-core build may include features and updates not yet support
33581
33584
  tx_pointer_tx_idx: 0,
33582
33585
  owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
33583
33586
  amount: 18446744073709552e3,
33584
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33587
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33585
33588
  },
33586
33589
  {
33587
33590
  tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
@@ -33608,7 +33611,7 @@ This unreleased fuel-core build may include features and updates not yet support
33608
33611
  tx_pointer_tx_idx: 0,
33609
33612
  owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
33610
33613
  amount: 18446744073709552e3,
33611
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33614
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33612
33615
  },
33613
33616
  {
33614
33617
  tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
@@ -33635,7 +33638,7 @@ This unreleased fuel-core build may include features and updates not yet support
33635
33638
  tx_pointer_tx_idx: 0,
33636
33639
  owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
33637
33640
  amount: 18446744073709552e3,
33638
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
33641
+ asset_id: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
33639
33642
  },
33640
33643
  {
33641
33644
  tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
@@ -34886,7 +34889,7 @@ This unreleased fuel-core build may include features and updates not yet support
34886
34889
  constructor(name, coders) {
34887
34890
  const caseIndexCoder = new BigNumberCoder("u64");
34888
34891
  const encodedValueSize = Object.values(coders).reduce(
34889
- (max, coder) => Math.max(max, coder.encodedLength),
34892
+ (min, coder) => Math.min(min, coder.encodedLength),
34890
34893
  0
34891
34894
  );
34892
34895
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -34923,7 +34926,7 @@ This unreleased fuel-core build may include features and updates not yet support
34923
34926
  return [caseKey, newOffset];
34924
34927
  }
34925
34928
  decode(data, offset) {
34926
- if (this.#shouldValidateLength && data.length < this.#encodedValueSize) {
34929
+ if (this.#shouldValidateLength && data.length < this.encodedLength) {
34927
34930
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid enum data size.`);
34928
34931
  }
34929
34932
  const caseBytes = new BigNumberCoder("u64").decode(data, offset)[0];
@@ -34936,7 +34939,10 @@ This unreleased fuel-core build may include features and updates not yet support
34936
34939
  );
34937
34940
  }
34938
34941
  const valueCoder = this.coders[caseKey];
34939
- const offsetAndCase = offset + WORD_SIZE;
34942
+ const offsetAndCase = offset + this.#caseIndexCoder.encodedLength;
34943
+ if (this.#shouldValidateLength && data.length < offsetAndCase + valueCoder.encodedLength) {
34944
+ throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid enum data size.`);
34945
+ }
34940
34946
  const [decoded, newOffset] = valueCoder.decode(data, offsetAndCase);
34941
34947
  if (isFullyNativeEnum(this.coders)) {
34942
34948
  return this.#decodeNativeEnum(caseKey, newOffset);
@@ -35280,14 +35286,20 @@ This unreleased fuel-core build may include features and updates not yet support
35280
35286
  constructor(abi, argument) {
35281
35287
  this.abi = abi;
35282
35288
  this.name = argument.name;
35283
- const type3 = findTypeById(abi, argument.type);
35284
- this.type = type3.type;
35289
+ const jsonABIType = findTypeById(abi, argument.type);
35290
+ if (jsonABIType.type.length > 256) {
35291
+ throw new FuelError(
35292
+ ErrorCode.INVALID_COMPONENT,
35293
+ `The provided ABI type is too long: ${jsonABIType.type}.`
35294
+ );
35295
+ }
35296
+ this.type = jsonABIType.type;
35285
35297
  this.originalTypeArguments = argument.typeArguments;
35286
35298
  this.components = ResolvedAbiType.getResolvedGenericComponents(
35287
35299
  abi,
35288
35300
  argument,
35289
- type3.components,
35290
- type3.typeParameters ?? ResolvedAbiType.getImplicitGenericTypeParameters(abi, type3.components)
35301
+ jsonABIType.components,
35302
+ jsonABIType.typeParameters ?? ResolvedAbiType.getImplicitGenericTypeParameters(abi, jsonABIType.components)
35291
35303
  );
35292
35304
  }
35293
35305
  static getResolvedGenericComponents(abi, arg, components, typeParameters) {
@@ -36783,10 +36795,10 @@ This unreleased fuel-core build may include features and updates not yet support
36783
36795
  encode(value) {
36784
36796
  const parts = [];
36785
36797
  parts.push(new UpgradePurposeCoder().encode(value.upgradePurpose));
36786
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
36787
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
36788
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
36789
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
36798
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
36799
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
36800
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
36801
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
36790
36802
  parts.push(new PoliciesCoder().encode(value.policies));
36791
36803
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
36792
36804
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -36798,13 +36810,13 @@ This unreleased fuel-core build may include features and updates not yet support
36798
36810
  let o = offset;
36799
36811
  [decoded, o] = new UpgradePurposeCoder().decode(data, o);
36800
36812
  const upgradePurpose = decoded;
36801
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36813
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
36802
36814
  const policyTypes = decoded;
36803
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36815
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36804
36816
  const inputsCount = decoded;
36805
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36817
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36806
36818
  const outputsCount = decoded;
36807
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36819
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36808
36820
  const witnessesCount = decoded;
36809
36821
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
36810
36822
  const policies = decoded;
@@ -36838,14 +36850,14 @@ This unreleased fuel-core build may include features and updates not yet support
36838
36850
  encode(value) {
36839
36851
  const parts = [];
36840
36852
  parts.push(new B256Coder().encode(value.root));
36841
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36842
- parts.push(new NumberCoder("u16").encode(value.subsectionIndex));
36843
- parts.push(new NumberCoder("u16").encode(value.subsectionsNumber));
36844
- parts.push(new NumberCoder("u16").encode(value.proofSetCount));
36845
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
36846
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
36847
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
36848
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
36853
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessIndex));
36854
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionIndex));
36855
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionsNumber));
36856
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.proofSetCount));
36857
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
36858
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
36859
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
36860
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
36849
36861
  parts.push(new ArrayCoder(new B256Coder(), value.proofSetCount).encode(value.proofSet));
36850
36862
  parts.push(new PoliciesCoder().encode(value.policies));
36851
36863
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
@@ -36858,21 +36870,21 @@ This unreleased fuel-core build may include features and updates not yet support
36858
36870
  let o = offset;
36859
36871
  [decoded, o] = new B256Coder().decode(data, o);
36860
36872
  const root = decoded;
36861
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36873
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36862
36874
  const witnessIndex = decoded;
36863
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36875
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36864
36876
  const subsectionIndex = decoded;
36865
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36877
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36866
36878
  const subsectionsNumber = decoded;
36867
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36879
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36868
36880
  const proofSetCount = decoded;
36869
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36881
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
36870
36882
  const policyTypes = decoded;
36871
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36883
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36872
36884
  const inputsCount = decoded;
36873
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36885
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36874
36886
  const outputsCount = decoded;
36875
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36887
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36876
36888
  const witnessesCount = decoded;
36877
36889
  [decoded, o] = new ArrayCoder(new B256Coder(), proofSetCount).decode(data, o);
36878
36890
  const proofSet = decoded;
@@ -42060,6 +42072,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42060
42072
  var isRequestInputCoin = (input) => input.type === InputType.Coin;
42061
42073
  var isRequestInputMessage = (input) => input.type === InputType.Message;
42062
42074
  var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
42075
+ var getRequestInputResourceOwner = (input) => isRequestInputCoin(input) ? input.owner : input.recipient;
42076
+ var isRequestInputResourceFromOwner = (input, owner) => getRequestInputResourceOwner(input) === owner.toB256();
42063
42077
  var getAssetAmountInRequestInputs = (inputs, assetId, baseAsset) => inputs.filter(isRequestInputResource).reduce((acc, input) => {
42064
42078
  if (isRequestInputCoin(input) && input.assetId === assetId) {
42065
42079
  return acc.add(input.amount);
@@ -42321,7 +42335,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42321
42335
  * @param coin - Coin resource.
42322
42336
  */
42323
42337
  addCoinInput(coin) {
42324
- const { assetId, owner, amount, id, predicate } = coin;
42338
+ const { assetId, owner, amount, id, predicate, predicateData } = coin;
42325
42339
  let witnessIndex;
42326
42340
  if (coin.predicate) {
42327
42341
  witnessIndex = 0;
@@ -42339,7 +42353,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42339
42353
  assetId,
42340
42354
  txPointer: "0x00000000000000000000000000000000",
42341
42355
  witnessIndex,
42342
- predicate
42356
+ predicate,
42357
+ predicateData
42343
42358
  };
42344
42359
  this.pushInput(input);
42345
42360
  this.addChangeOutput(owner, assetId);
@@ -42351,7 +42366,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42351
42366
  * @param message - Message resource.
42352
42367
  */
42353
42368
  addMessageInput(message) {
42354
- const { recipient, sender, amount, predicate, nonce, assetId } = message;
42369
+ const { recipient, sender, amount, predicate, nonce, assetId, predicateData } = message;
42355
42370
  let witnessIndex;
42356
42371
  if (message.predicate) {
42357
42372
  witnessIndex = 0;
@@ -42368,7 +42383,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42368
42383
  recipient: recipient.toB256(),
42369
42384
  amount,
42370
42385
  witnessIndex,
42371
- predicate
42386
+ predicate,
42387
+ predicateData
42372
42388
  };
42373
42389
  this.pushInput(input);
42374
42390
  this.addChangeOutput(recipient, assetId);
@@ -42570,23 +42586,13 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42570
42586
  });
42571
42587
  }
42572
42588
  updatePredicateGasUsed(inputs) {
42573
- this.inputs.forEach((i) => {
42574
- let correspondingInput;
42575
- switch (i.type) {
42576
- case InputType.Coin:
42577
- correspondingInput = inputs.find((x) => x.type === InputType.Coin && x.owner === i.owner);
42578
- break;
42579
- case InputType.Message:
42580
- correspondingInput = inputs.find(
42581
- (x) => x.type === InputType.Message && x.sender === i.sender
42582
- );
42583
- break;
42584
- default:
42585
- return;
42586
- }
42589
+ const inputsToExtractGasUsed = inputs.filter(isRequestInputResource);
42590
+ this.inputs.filter(isRequestInputResource).forEach((i) => {
42591
+ const owner = getRequestInputResourceOwner(i);
42592
+ const correspondingInput = inputsToExtractGasUsed.find(
42593
+ (x) => isRequestInputResourceFromOwner(x, Address.fromString(String(owner)))
42594
+ );
42587
42595
  if (correspondingInput && "predicateGasUsed" in correspondingInput && bn(correspondingInput.predicateGasUsed).gt(0)) {
42588
- i.predicate = correspondingInput.predicate;
42589
- i.predicateData = correspondingInput.predicateData;
42590
42596
  i.predicateGasUsed = correspondingInput.predicateGasUsed;
42591
42597
  }
42592
42598
  });
@@ -42897,6 +42903,13 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42897
42903
  }
42898
42904
  return this.outputs.length - 1;
42899
42905
  }
42906
+ /**
42907
+ * Calculates the maximum gas for the transaction.
42908
+ *
42909
+ * @param chainInfo - The chain information.
42910
+ * @param minGas - The minimum gas.
42911
+ * @returns the maximum gas.
42912
+ */
42900
42913
  calculateMaxGas(chainInfo, minGas) {
42901
42914
  const { consensusParameters } = chainInfo;
42902
42915
  const {
@@ -43239,13 +43252,13 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43239
43252
  }
43240
43253
  function getWithdrawFromFuelOperations({
43241
43254
  inputs,
43242
- receipts
43255
+ receipts,
43256
+ baseAssetId
43243
43257
  }) {
43244
43258
  const messageOutReceipts = getReceiptsMessageOut(receipts);
43245
43259
  const withdrawFromFuelOperations = messageOutReceipts.reduce(
43246
43260
  (prevWithdrawFromFuelOps, receipt) => {
43247
- const assetId = "0x0000000000000000000000000000000000000000000000000000000000000000";
43248
- const input = getInputFromAssetId(inputs, assetId);
43261
+ const input = getInputFromAssetId(inputs, baseAssetId);
43249
43262
  if (input) {
43250
43263
  const inputAddress = getInputAccountAddress(input);
43251
43264
  const newWithdrawFromFuelOps = addOperation(prevWithdrawFromFuelOps, {
@@ -43262,7 +43275,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43262
43275
  assetsSent: [
43263
43276
  {
43264
43277
  amount: receipt.amount,
43265
- assetId
43278
+ assetId: baseAssetId
43266
43279
  }
43267
43280
  ]
43268
43281
  });
@@ -43458,7 +43471,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43458
43471
  receipts,
43459
43472
  abiMap,
43460
43473
  rawPayload,
43461
- maxInputs
43474
+ maxInputs,
43475
+ baseAssetId
43462
43476
  }) {
43463
43477
  if (isTypeCreate(transactionType)) {
43464
43478
  return [
@@ -43477,7 +43491,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43477
43491
  rawPayload,
43478
43492
  maxInputs
43479
43493
  }),
43480
- ...getWithdrawFromFuelOperations({ inputs, receipts })
43494
+ ...getWithdrawFromFuelOperations({ inputs, receipts, baseAssetId })
43481
43495
  ];
43482
43496
  }
43483
43497
  return [...getPayProducerOperations(outputs)];
@@ -43610,7 +43624,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43610
43624
  maxInputs,
43611
43625
  gasCosts,
43612
43626
  maxGasPerTx,
43613
- gasPrice
43627
+ gasPrice,
43628
+ baseAssetId
43614
43629
  } = params;
43615
43630
  const gasUsed = getGasUsedFromReceipts(receipts);
43616
43631
  const rawPayload = hexlify(transactionBytes);
@@ -43621,7 +43636,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43621
43636
  receipts,
43622
43637
  rawPayload,
43623
43638
  abiMap,
43624
- maxInputs
43639
+ maxInputs,
43640
+ baseAssetId
43625
43641
  });
43626
43642
  const typeName = getTransactionTypeName(transaction.type);
43627
43643
  const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
@@ -43779,6 +43795,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43779
43795
  const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
43780
43796
  const gasPrice = await this.provider.getLatestGasPrice();
43781
43797
  const maxInputs = this.provider.getChain().consensusParameters.txParameters.maxInputs;
43798
+ const baseAssetId = this.provider.getBaseAssetId();
43782
43799
  const transactionSummary = assembleTransactionSummary({
43783
43800
  id: this.id,
43784
43801
  receipts,
@@ -43791,7 +43808,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43791
43808
  maxInputs,
43792
43809
  gasCosts,
43793
43810
  maxGasPerTx,
43794
- gasPrice
43811
+ gasPrice,
43812
+ baseAssetId
43795
43813
  });
43796
43814
  return transactionSummary;
43797
43815
  }
@@ -43979,7 +43997,6 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43979
43997
  * Constructor to initialize a Provider.
43980
43998
  *
43981
43999
  * @param url - GraphQL endpoint of the Fuel node
43982
- * @param chainInfo - Chain info of the Fuel node
43983
44000
  * @param options - Additional options for the provider
43984
44001
  * @hidden
43985
44002
  */
@@ -44002,10 +44019,14 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44002
44019
  this.operations = this.createOperations();
44003
44020
  this.cache = options.cacheUtxo ? new MemoryCache(options.cacheUtxo) : void 0;
44004
44021
  }
44022
+ /** @hidden */
44005
44023
  static clearChainAndNodeCaches() {
44006
44024
  _Provider.nodeInfoCache = {};
44007
44025
  _Provider.chainInfoCache = {};
44008
44026
  }
44027
+ /**
44028
+ * @hidden
44029
+ */
44009
44030
  static getFetchFn(options) {
44010
44031
  const { retryOptions, timeout } = options;
44011
44032
  return autoRetryFetch(async (...args) => {
@@ -44021,8 +44042,11 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44021
44042
  }
44022
44043
  /**
44023
44044
  * Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
44045
+ *
44024
44046
  * @param url - GraphQL endpoint of the Fuel node
44025
44047
  * @param options - Additional options for the provider
44048
+ *
44049
+ * @returns A promise that resolves to a Provider instance.
44026
44050
  */
44027
44051
  static async create(url, options = {}) {
44028
44052
  const provider = new _Provider(url, options);
@@ -44031,6 +44055,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44031
44055
  }
44032
44056
  /**
44033
44057
  * Returns the cached chainInfo for the current URL.
44058
+ *
44059
+ * @returns the chain information configuration.
44034
44060
  */
44035
44061
  getChain() {
44036
44062
  const chain = _Provider.chainInfoCache[this.url];
@@ -44044,6 +44070,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44044
44070
  }
44045
44071
  /**
44046
44072
  * Returns the cached nodeInfo for the current URL.
44073
+ *
44074
+ * @returns the node information configuration.
44047
44075
  */
44048
44076
  getNode() {
44049
44077
  const node = _Provider.nodeInfoCache[this.url];
@@ -44075,6 +44103,9 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44075
44103
  }
44076
44104
  /**
44077
44105
  * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.
44106
+ *
44107
+ * @param url - The URL to connect to.
44108
+ * @param options - Additional options for the provider.
44078
44109
  */
44079
44110
  async connect(url, options) {
44080
44111
  this.url = url;
@@ -44083,9 +44114,9 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44083
44114
  await this.fetchChainAndNodeInfo();
44084
44115
  }
44085
44116
  /**
44086
- * Fetches both the chain and node information, saves it to the cache, and return it.
44117
+ * Return the chain and node information.
44087
44118
  *
44088
- * @returns NodeInfo and Chain
44119
+ * @returns A promise that resolves to the Chain and NodeInfo.
44089
44120
  */
44090
44121
  async fetchChainAndNodeInfo() {
44091
44122
  const chain = await this.fetchChain();
@@ -44096,6 +44127,9 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
44096
44127
  nodeInfo
44097
44128
  };
44098
44129
  }
44130
+ /**
44131
+ * @hidden
44132
+ */
44099
44133
  static ensureClientVersionIsSupported(nodeInfo) {
44100
44134
  const { isMajorSupported, isMinorSupported, supportedVersion } = checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);
44101
44135
  if (!isMajorSupported || !isMinorSupported) {
@@ -44111,6 +44145,7 @@ Supported fuel-core version: ${supportedVersion}.`
44111
44145
  * Create GraphQL client and set operations.
44112
44146
  *
44113
44147
  * @returns The operation SDK object
44148
+ * @hidden
44114
44149
  */
44115
44150
  createOperations() {
44116
44151
  const fetchFn = _Provider.getFetchFn(this.options);
@@ -44155,18 +44190,18 @@ Supported fuel-core version: ${supportedVersion}.`
44155
44190
  return nodeVersion;
44156
44191
  }
44157
44192
  /**
44158
- * Returns the block number.
44193
+ * Returns the latest block number.
44159
44194
  *
44160
- * @returns A promise that resolves to the block number
44195
+ * @returns A promise that resolves to the latest block number.
44161
44196
  */
44162
44197
  async getBlockNumber() {
44163
44198
  const { chain } = await this.operations.getChain();
44164
44199
  return bn(chain.latestBlock.height, 10);
44165
44200
  }
44166
44201
  /**
44167
- * Returns the chain information.
44168
- * @param url - The URL of the Fuel node
44169
- * @returns NodeInfo object
44202
+ * Returns the node information for the current provider network.
44203
+ *
44204
+ * @returns a promise that resolves to the node information.
44170
44205
  */
44171
44206
  async fetchNode() {
44172
44207
  const { nodeInfo } = await this.operations.getNodeInfo();
@@ -44181,9 +44216,9 @@ Supported fuel-core version: ${supportedVersion}.`
44181
44216
  return processedNodeInfo;
44182
44217
  }
44183
44218
  /**
44184
- * Fetches the `chainInfo` for the given node URL.
44185
- * @param url - The URL of the Fuel node
44186
- * @returns ChainInfo object
44219
+ * Returns the chain information for the current provider network.
44220
+ *
44221
+ * @returns a promise that resolves to the chain information.
44187
44222
  */
44188
44223
  async fetchChain() {
44189
44224
  const { chain } = await this.operations.getChain();
@@ -44192,8 +44227,9 @@ Supported fuel-core version: ${supportedVersion}.`
44192
44227
  return processedChain;
44193
44228
  }
44194
44229
  /**
44195
- * Returns the chain ID
44196
- * @returns A promise that resolves to the chain ID number
44230
+ * Returns the chain ID for the current provider network.
44231
+ *
44232
+ * @returns A promise that resolves to the chain ID number.
44197
44233
  */
44198
44234
  getChainId() {
44199
44235
  const {
@@ -44202,9 +44238,9 @@ Supported fuel-core version: ${supportedVersion}.`
44202
44238
  return chainId.toNumber();
44203
44239
  }
44204
44240
  /**
44205
- * Returns the base asset ID for the current provider network
44241
+ * Returns the base asset ID for the current provider network.
44206
44242
  *
44207
- * @returns the base asset ID
44243
+ * @returns the base asset ID.
44208
44244
  */
44209
44245
  getBaseAssetId() {
44210
44246
  const {
@@ -44219,6 +44255,7 @@ Supported fuel-core version: ${supportedVersion}.`
44219
44255
  * the transaction will be mutated and those dependencies will be added.
44220
44256
  *
44221
44257
  * @param transactionRequestLike - The transaction request object.
44258
+ * @param sendTransactionParams - The provider send transaction parameters (optional).
44222
44259
  * @returns A promise that resolves to the transaction response object.
44223
44260
  */
44224
44261
  // #region Provider-sendTransaction
@@ -44263,7 +44300,7 @@ Supported fuel-core version: ${supportedVersion}.`
44263
44300
  * the transaction will be mutated and those dependencies will be added.
44264
44301
  *
44265
44302
  * @param transactionRequestLike - The transaction request object.
44266
- * @param utxoValidation - Additional provider call parameters.
44303
+ * @param sendTransactionParams - The provider call parameters (optional).
44267
44304
  * @returns A promise that resolves to the call result object.
44268
44305
  */
44269
44306
  async call(transactionRequestLike, { utxoValidation, estimateTxDependencies = true } = {}) {
@@ -44283,6 +44320,8 @@ Supported fuel-core version: ${supportedVersion}.`
44283
44320
  /**
44284
44321
  * Verifies whether enough gas is available to complete transaction.
44285
44322
  *
44323
+ * @template T - The type of the transaction request object.
44324
+ *
44286
44325
  * @param transactionRequest - The transaction request object.
44287
44326
  * @returns A promise that resolves to the estimated transaction request object.
44288
44327
  */
@@ -44317,9 +44356,8 @@ Supported fuel-core version: ${supportedVersion}.`
44317
44356
  * If there are missing variable outputs,
44318
44357
  * `addVariableOutputs` is called on the transaction.
44319
44358
  *
44320
- *
44321
44359
  * @param transactionRequest - The transaction request object.
44322
- * @returns A promise.
44360
+ * @returns A promise that resolves to the estimate transaction dependencies.
44323
44361
  */
44324
44362
  async estimateTxDependencies(transactionRequest) {
44325
44363
  if (transactionRequest.type === TransactionType.Create) {
@@ -44432,6 +44470,14 @@ Supported fuel-core version: ${supportedVersion}.`
44432
44470
  }
44433
44471
  return results;
44434
44472
  }
44473
+ /**
44474
+ * Dry runs multiple transactions.
44475
+ *
44476
+ * @param transactionRequests - Array of transaction request objects.
44477
+ * @param sendTransactionParams - The provider call parameters (optional).
44478
+ *
44479
+ * @returns A promise that resolves to an array of results for each transaction call.
44480
+ */
44435
44481
  async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
44436
44482
  if (estimateTxDependencies) {
44437
44483
  return this.estimateMultipleTxDependencies(transactionRequests);
@@ -44502,6 +44548,7 @@ Supported fuel-core version: ${supportedVersion}.`
44502
44548
  * the transaction will be mutated and those dependencies will be added
44503
44549
  *
44504
44550
  * @param transactionRequestLike - The transaction request object.
44551
+ * @param estimateTxParams - The estimate transaction params (optional).
44505
44552
  * @returns A promise that resolves to the call result object.
44506
44553
  */
44507
44554
  async simulate(transactionRequestLike, { estimateTxDependencies = true } = {}) {
@@ -44526,14 +44573,9 @@ Supported fuel-core version: ${supportedVersion}.`
44526
44573
  * to set gasLimit and also reserve balance amounts
44527
44574
  * on the the transaction.
44528
44575
  *
44529
- * @privateRemarks
44530
- * The tolerance is add on top of the gasUsed calculated
44531
- * from the node, this create a safe margin costs like
44532
- * change states on transfer that don't occur on the dryRun
44533
- * transaction. The default value is 0.2 or 20%
44534
- *
44535
44576
  * @param transactionRequestLike - The transaction request object.
44536
- * @param tolerance - The tolerance to add on top of the gasUsed.
44577
+ * @param transactionCostParams - The transaction cost parameters (optional).
44578
+ *
44537
44579
  * @returns A promise that resolves to the transaction cost object.
44538
44580
  */
44539
44581
  async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
@@ -44601,6 +44643,15 @@ Supported fuel-core version: ${supportedVersion}.`
44601
44643
  updateMaxFee
44602
44644
  };
44603
44645
  }
44646
+ /**
44647
+ * Get the required quantities and associated resources for a transaction.
44648
+ *
44649
+ * @param owner - address to add resources from.
44650
+ * @param transactionRequestLike - transaction request to populate resources for.
44651
+ * @param quantitiesToContract - quantities for the contract (optional).
44652
+ *
44653
+ * @returns a promise resolving to the required quantities for the transaction.
44654
+ */
44604
44655
  async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
44605
44656
  const ownerAddress = Address.fromAddressOrString(owner);
44606
44657
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
@@ -44622,6 +44673,12 @@ Supported fuel-core version: ${supportedVersion}.`
44622
44673
  }
44623
44674
  /**
44624
44675
  * Returns coins for the given owner.
44676
+ *
44677
+ * @param owner - The address to get coins for.
44678
+ * @param assetId - The asset ID of coins to get (optional).
44679
+ * @param paginationArgs - Pagination arguments (optional).
44680
+ *
44681
+ * @returns A promise that resolves to the coins.
44625
44682
  */
44626
44683
  async getCoins(owner, assetId, paginationArgs) {
44627
44684
  const ownerAddress = Address.fromAddressOrString(owner);
@@ -44644,8 +44701,8 @@ Supported fuel-core version: ${supportedVersion}.`
44644
44701
  * Returns resources for the given owner satisfying the spend query.
44645
44702
  *
44646
44703
  * @param owner - The address to get resources for.
44647
- * @param quantities - The quantities to get.
44648
- * @param excludedIds - IDs of excluded resources from the selection.
44704
+ * @param quantities - The coin quantities to get.
44705
+ * @param excludedIds - IDs of excluded resources from the selection (optional).
44649
44706
  * @returns A promise that resolves to the resources.
44650
44707
  */
44651
44708
  async getResourcesToSpend(owner, quantities, excludedIds) {
@@ -44700,7 +44757,7 @@ Supported fuel-core version: ${supportedVersion}.`
44700
44757
  * Returns block matching the given ID or height.
44701
44758
  *
44702
44759
  * @param idOrHeight - ID or height of the block.
44703
- * @returns A promise that resolves to the block.
44760
+ * @returns A promise that resolves to the block or null.
44704
44761
  */
44705
44762
  async getBlock(idOrHeight) {
44706
44763
  let variables;
@@ -44830,7 +44887,7 @@ Supported fuel-core version: ${supportedVersion}.`
44830
44887
  * Returns balances for the given owner.
44831
44888
  *
44832
44889
  * @param owner - The address to get coins for.
44833
- * @param paginationArgs - Pagination arguments.
44890
+ * @param paginationArgs - Pagination arguments (optional).
44834
44891
  * @returns A promise that resolves to the balances.
44835
44892
  */
44836
44893
  async getBalances(owner, paginationArgs) {
@@ -44849,7 +44906,7 @@ Supported fuel-core version: ${supportedVersion}.`
44849
44906
  * Returns message for the given address.
44850
44907
  *
44851
44908
  * @param address - The address to get message from.
44852
- * @param paginationArgs - Pagination arguments.
44909
+ * @param paginationArgs - Pagination arguments (optional).
44853
44910
  * @returns A promise that resolves to the messages.
44854
44911
  */
44855
44912
  async getMessages(address, paginationArgs) {
@@ -44880,8 +44937,8 @@ Supported fuel-core version: ${supportedVersion}.`
44880
44937
  *
44881
44938
  * @param transactionId - The transaction to get message from.
44882
44939
  * @param messageId - The message id from MessageOut receipt.
44883
- * @param commitBlockId - The commit block id.
44884
- * @param commitBlockHeight - The commit block height.
44940
+ * @param commitBlockId - The commit block id (optional).
44941
+ * @param commitBlockHeight - The commit block height (optional).
44885
44942
  * @returns A promise that resolves to the message proof.
44886
44943
  */
44887
44944
  async getMessageProof(transactionId, nonce, commitBlockId, commitBlockHeight) {
@@ -44969,10 +45026,21 @@ Supported fuel-core version: ${supportedVersion}.`
44969
45026
  data
44970
45027
  };
44971
45028
  }
45029
+ /**
45030
+ * Get the latest gas price from the node.
45031
+ *
45032
+ * @returns A promise that resolves to the latest gas price.
45033
+ */
44972
45034
  async getLatestGasPrice() {
44973
45035
  const { latestGasPrice } = await this.operations.getLatestGasPrice();
44974
45036
  return bn(latestGasPrice.gasPrice);
44975
45037
  }
45038
+ /**
45039
+ * Returns the estimate gas price for the given block horizon.
45040
+ *
45041
+ * @param blockHorizon - The block horizon to estimate gas price for.
45042
+ * @returns A promise that resolves to the estimated gas price.
45043
+ */
44976
45044
  async estimateGasPrice(blockHorizon) {
44977
45045
  const { estimateGasPrice } = await this.operations.estimateGasPrice({
44978
45046
  blockHorizon: String(blockHorizon)
@@ -44992,8 +45060,8 @@ Supported fuel-core version: ${supportedVersion}.`
44992
45060
  /**
44993
45061
  * Lets you produce blocks with custom timestamps and the block number of the last block produced.
44994
45062
  *
44995
- * @param amount - The amount of blocks to produce
44996
- * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block
45063
+ * @param amount - The amount of blocks to produce.
45064
+ * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block (optional).
44997
45065
  * @returns A promise that resolves to the block number of the last produced block.
44998
45066
  */
44999
45067
  async produceBlocks(amount, startTime) {
@@ -45003,6 +45071,12 @@ Supported fuel-core version: ${supportedVersion}.`
45003
45071
  });
45004
45072
  return bn(latestBlockHeight);
45005
45073
  }
45074
+ /**
45075
+ * Get the transaction response for the given transaction ID.
45076
+ *
45077
+ * @param transactionId - The transaction ID to get the response for.
45078
+ * @returns A promise that resolves to the transaction response.
45079
+ */
45006
45080
  // eslint-disable-next-line @typescript-eslint/require-await
45007
45081
  async getTransactionResponse(transactionId) {
45008
45082
  return new TransactionResponse(transactionId, this);
@@ -45011,7 +45085,7 @@ Supported fuel-core version: ${supportedVersion}.`
45011
45085
  * Returns Message for given nonce.
45012
45086
  *
45013
45087
  * @param nonce - The nonce of the message to retrieve.
45014
- * @returns A promise that resolves to the Message object.
45088
+ * @returns A promise that resolves to the Message object or null.
45015
45089
  */
45016
45090
  async getMessageByNonce(nonce) {
45017
45091
  const { message } = await this.operations.getMessageByNonce({ nonce });
@@ -45020,6 +45094,12 @@ Supported fuel-core version: ${supportedVersion}.`
45020
45094
  }
45021
45095
  return message;
45022
45096
  }
45097
+ /**
45098
+ * Get the relayed transaction for the given transaction ID.
45099
+ *
45100
+ * @param relayedTransactionId - The relayed transaction ID to get the response for.
45101
+ * @returns A promise that resolves to the relayed transaction.
45102
+ */
45023
45103
  async getRelayedTransactionStatus(relayedTransactionId) {
45024
45104
  const { relayedTransactionStatus } = await this.operations.getRelayedTransactionStatus({
45025
45105
  relayedTransactionId
@@ -45029,6 +45109,9 @@ Supported fuel-core version: ${supportedVersion}.`
45029
45109
  }
45030
45110
  return relayedTransactionStatus;
45031
45111
  }
45112
+ /**
45113
+ * @hidden
45114
+ */
45032
45115
  extractDryRunError(transactionRequest, receipts, dryRunStatus) {
45033
45116
  const status = dryRunStatus;
45034
45117
  let logs = [];
@@ -45058,7 +45141,9 @@ Supported fuel-core version: ${supportedVersion}.`
45058
45141
  }
45059
45142
  });
45060
45143
  };
45144
+ /** @hidden */
45061
45145
  __publicField(Provider, "chainInfoCache", {});
45146
+ /** @hidden */
45062
45147
  __publicField(Provider, "nodeInfoCache", {});
45063
45148
 
45064
45149
  // src/providers/chains.ts
@@ -45176,12 +45261,16 @@ Supported fuel-core version: ${supportedVersion}.`
45176
45261
  * The provider used to interact with the network.
45177
45262
  */
45178
45263
  _provider;
45264
+ /**
45265
+ * The connector for use with external wallets
45266
+ */
45179
45267
  _connector;
45180
45268
  /**
45181
45269
  * Creates a new Account instance.
45182
45270
  *
45183
45271
  * @param address - The address of the account.
45184
45272
  * @param provider - A Provider instance (optional).
45273
+ * @param connector - A FuelConnector instance (optional).
45185
45274
  */
45186
45275
  constructor(address, provider, connector) {
45187
45276
  super();
@@ -45223,8 +45312,8 @@ Supported fuel-core version: ${supportedVersion}.`
45223
45312
  /**
45224
45313
  * Retrieves resources satisfying the spend query for the account.
45225
45314
  *
45226
- * @param quantities - IDs of coins to exclude.
45227
- * @param excludedIds - IDs of resources to be excluded from the query.
45315
+ * @param quantities - Quantities of resources to be obtained.
45316
+ * @param excludedIds - IDs of resources to be excluded from the query (optional).
45228
45317
  * @returns A promise that resolves to an array of Resources.
45229
45318
  */
45230
45319
  async getResourcesToSpend(quantities, excludedIds) {
@@ -45233,7 +45322,7 @@ Supported fuel-core version: ${supportedVersion}.`
45233
45322
  /**
45234
45323
  * Retrieves coins owned by the account.
45235
45324
  *
45236
- * @param assetId - The asset ID of the coins to retrieve.
45325
+ * @param assetId - The asset ID of the coins to retrieve (optional).
45237
45326
  * @returns A promise that resolves to an array of Coins.
45238
45327
  */
45239
45328
  async getCoins(assetId) {
@@ -45286,7 +45375,7 @@ Supported fuel-core version: ${supportedVersion}.`
45286
45375
  /**
45287
45376
  * Retrieves the balance of the account for the given asset.
45288
45377
  *
45289
- * @param assetId - The asset ID to check the balance for.
45378
+ * @param assetId - The asset ID to check the balance for (optional).
45290
45379
  * @returns A promise that resolves to the balance amount.
45291
45380
  */
45292
45381
  async getBalance(assetId) {
@@ -45326,7 +45415,7 @@ Supported fuel-core version: ${supportedVersion}.`
45326
45415
  * @typeParam T - The type of the TransactionRequest.
45327
45416
  * @param request - The transaction request to fund.
45328
45417
  * @param params - The estimated transaction parameters.
45329
- * @returns The funded transaction request.
45418
+ * @returns A promise that resolves to the funded transaction request.
45330
45419
  */
45331
45420
  async fund(request, params) {
45332
45421
  const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee } = params;
@@ -45419,25 +45508,14 @@ Supported fuel-core version: ${supportedVersion}.`
45419
45508
  *
45420
45509
  * @param destination - The address of the destination.
45421
45510
  * @param amount - The amount of coins to transfer.
45422
- * @param assetId - The asset ID of the coins to transfer.
45423
- * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
45511
+ * @param assetId - The asset ID of the coins to transfer (optional).
45512
+ * @param txParams - The transaction parameters (optional).
45424
45513
  * @returns A promise that resolves to the prepared transaction request.
45425
45514
  */
45426
45515
  async createTransfer(destination, amount, assetId, txParams = {}) {
45427
45516
  let request = new ScriptTransactionRequest(txParams);
45428
- const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
45429
- request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
45430
- const txCost = await this.provider.getTransactionCost(request, {
45431
- estimateTxDependencies: true,
45432
- resourcesOwner: this
45433
- });
45434
- request = this.validateGasLimitAndMaxFee({
45435
- transactionRequest: request,
45436
- gasUsed: txCost.gasUsed,
45437
- maxFee: txCost.maxFee,
45438
- txParams
45439
- });
45440
- await this.fund(request, txCost);
45517
+ request = this.addTransfer(request, { destination, amount, assetId });
45518
+ request = await this.estimateAndFundTransaction(request, txParams);
45441
45519
  return request;
45442
45520
  }
45443
45521
  /**
@@ -45445,28 +45523,69 @@ Supported fuel-core version: ${supportedVersion}.`
45445
45523
  *
45446
45524
  * @param destination - The address of the destination.
45447
45525
  * @param amount - The amount of coins to transfer.
45448
- * @param assetId - The asset ID of the coins to transfer.
45449
- * @param txParams - The transaction parameters (gasLimit, maturity).
45526
+ * @param assetId - The asset ID of the coins to transfer (optional).
45527
+ * @param txParams - The transaction parameters (optional).
45450
45528
  * @returns A promise that resolves to the transaction response.
45451
45529
  */
45452
45530
  async transfer(destination, amount, assetId, txParams = {}) {
45453
- if (bn(amount).lte(0)) {
45454
- throw new FuelError(
45455
- ErrorCode.INVALID_TRANSFER_AMOUNT,
45456
- "Transfer amount must be a positive number."
45457
- );
45458
- }
45459
- const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
45460
- const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
45531
+ const request = await this.createTransfer(destination, amount, assetId, txParams);
45461
45532
  return this.sendTransaction(request, { estimateTxDependencies: false });
45462
45533
  }
45534
+ /**
45535
+ * Transfers multiple amounts of a token to multiple recipients.
45536
+ *
45537
+ * @param transferParams - An array of `TransferParams` objects representing the transfers to be made.
45538
+ * @param txParams - Optional transaction parameters.
45539
+ * @returns A promise that resolves to a `TransactionResponse` object representing the transaction result.
45540
+ */
45541
+ async batchTransfer(transferParams, txParams = {}) {
45542
+ let request = new ScriptTransactionRequest(txParams);
45543
+ request = this.addBatchTransfer(request, transferParams);
45544
+ request = await this.estimateAndFundTransaction(request, txParams);
45545
+ return this.sendTransaction(request, { estimateTxDependencies: false });
45546
+ }
45547
+ /**
45548
+ * Adds a transfer to the given transaction request.
45549
+ *
45550
+ * @param request - The script transaction request to add transfers to.
45551
+ * @param transferParams - The object representing the transfer to be made.
45552
+ * @returns The updated transaction request with the added transfer.
45553
+ */
45554
+ addTransfer(request, transferParams) {
45555
+ const { destination, amount, assetId } = transferParams;
45556
+ this.validateTransferAmount(amount);
45557
+ request.addCoinOutput(
45558
+ Address.fromAddressOrString(destination),
45559
+ amount,
45560
+ assetId ?? this.provider.getBaseAssetId()
45561
+ );
45562
+ return request;
45563
+ }
45564
+ /**
45565
+ * Adds multiple transfers to a script transaction request.
45566
+ *
45567
+ * @param request - The script transaction request to add transfers to.
45568
+ * @param transferParams - An array of `TransferParams` objects representing the transfers to be made.
45569
+ * @returns The updated script transaction request.
45570
+ */
45571
+ addBatchTransfer(request, transferParams) {
45572
+ const baseAssetId = this.provider.getBaseAssetId();
45573
+ transferParams.forEach(({ destination, amount, assetId }) => {
45574
+ this.addTransfer(request, {
45575
+ destination,
45576
+ amount,
45577
+ assetId: assetId ?? baseAssetId
45578
+ });
45579
+ });
45580
+ return request;
45581
+ }
45463
45582
  /**
45464
45583
  * Transfers coins to a contract address.
45465
45584
  *
45466
45585
  * @param contractId - The address of the contract.
45467
45586
  * @param amount - The amount of coins to transfer.
45468
- * @param assetId - The asset ID of the coins to transfer.
45469
- * @param txParams - The optional transaction parameters.
45587
+ * @param assetId - The asset ID of the coins to transfer (optional).
45588
+ * @param txParams - The transaction parameters (optional).
45470
45589
  * @returns A promise that resolves to the transaction response.
45471
45590
  */
45472
45591
  async transferToContract(contractId, amount, assetId, txParams = {}) {
@@ -45507,7 +45626,7 @@ Supported fuel-core version: ${supportedVersion}.`
45507
45626
  *
45508
45627
  * @param recipient - Address of the recipient on the base chain.
45509
45628
  * @param amount - Amount of base asset.
45510
- * @param txParams - The optional transaction parameters.
45629
+ * @param txParams - The transaction parameters (optional).
45511
45630
  * @returns A promise that resolves to the transaction response.
45512
45631
  */
45513
45632
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
@@ -45537,6 +45656,14 @@ Supported fuel-core version: ${supportedVersion}.`
45537
45656
  await this.fund(request, txCost);
45538
45657
  return this.sendTransaction(request);
45539
45658
  }
45659
+ /**
45660
+ * Sign a message from the account via the connector.
45661
+ *
45662
+ * @param message - the message to sign.
45663
+ * @returns a promise that resolves to the signature.
45664
+ *
45665
+ * @hidden
45666
+ */
45540
45667
  async signMessage(message) {
45541
45668
  if (!this._connector) {
45542
45669
  throw new FuelError(ErrorCode.MISSING_CONNECTOR, "A connector is required to sign messages.");
@@ -45544,7 +45671,7 @@ Supported fuel-core version: ${supportedVersion}.`
45544
45671
  return this._connector.signMessage(this.address.toString(), message);
45545
45672
  }
45546
45673
  /**
45547
- * Signs a transaction with the wallet's private key.
45674
+ * Signs a transaction from the account via the connector..
45548
45675
  *
45549
45676
  * @param transactionRequestLike - The transaction request to sign.
45550
45677
  * @returns A promise that resolves to the signature of the transaction.
@@ -45562,6 +45689,7 @@ Supported fuel-core version: ${supportedVersion}.`
45562
45689
  * Sends a transaction to the network.
45563
45690
  *
45564
45691
  * @param transactionRequestLike - The transaction request to be sent.
45692
+ * @param sendTransactionParams - The provider send transaction parameters (optional).
45565
45693
  * @returns A promise that resolves to the transaction response.
45566
45694
  */
45567
45695
  async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
@@ -45583,6 +45711,7 @@ Supported fuel-core version: ${supportedVersion}.`
45583
45711
  * Simulates a transaction.
45584
45712
  *
45585
45713
  * @param transactionRequestLike - The transaction request to be simulated.
45714
+ * @param estimateTxParams - The estimate transaction params (optional).
45586
45715
  * @returns A promise that resolves to the call result.
45587
45716
  */
45588
45717
  async simulateTransaction(transactionRequestLike, { estimateTxDependencies = true } = {}) {
@@ -45592,6 +45721,31 @@ Supported fuel-core version: ${supportedVersion}.`
45592
45721
  }
45593
45722
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
45594
45723
  }
45724
+ /** @hidden * */
45725
+ validateTransferAmount(amount) {
45726
+ if (bn(amount).lte(0)) {
45727
+ throw new FuelError(
45728
+ ErrorCode.INVALID_TRANSFER_AMOUNT,
45729
+ "Transfer amount must be a positive number."
45730
+ );
45731
+ }
45732
+ }
45733
+ /** @hidden * */
45734
+ async estimateAndFundTransaction(transactionRequest, txParams) {
45735
+ let request = transactionRequest;
45736
+ const txCost = await this.provider.getTransactionCost(request, {
45737
+ resourcesOwner: this
45738
+ });
45739
+ request = this.validateGasLimitAndMaxFee({
45740
+ transactionRequest: request,
45741
+ gasUsed: txCost.gasUsed,
45742
+ maxFee: txCost.maxFee,
45743
+ txParams
45744
+ });
45745
+ request = await this.fund(request, txCost);
45746
+ return request;
45747
+ }
45748
+ /** @hidden * */
45595
45749
  validateGasLimitAndMaxFee({
45596
45750
  gasUsed,
45597
45751
  maxFee,
@@ -47196,6 +47350,8 @@ Supported fuel-core version: ${supportedVersion}.`
47196
47350
  * Populates the witness signature for a transaction and sends it to the network using `provider.sendTransaction`.
47197
47351
  *
47198
47352
  * @param transactionRequestLike - The transaction request to send.
47353
+ * @param estimateTxDependencies - Whether to estimate the transaction dependencies.
47354
+ * @param awaitExecution - Whether to wait for the transaction to be executed.
47199
47355
  * @returns A promise that resolves to the TransactionResponse object.
47200
47356
  */
47201
47357
  async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
@@ -47227,6 +47383,12 @@ Supported fuel-core version: ${supportedVersion}.`
47227
47383
  }
47228
47384
  );
47229
47385
  }
47386
+ /**
47387
+ * Encrypts an unlocked wallet with a password.
47388
+ *
47389
+ * @param password - the password to encrypt the wallet with.
47390
+ * @returns - the encrypted wallet.
47391
+ */
47230
47392
  async encrypt(password) {
47231
47393
  return encryptKeystoreWallet(this.privateKey, this.address, password);
47232
47394
  }
@@ -49949,27 +50111,12 @@ Supported fuel-core version: ${supportedVersion}.`
49949
50111
  return wallet;
49950
50112
  };
49951
50113
 
49952
- // ../utils/dist/cli-utils.mjs
49953
- var import_fs = __require("fs");
49954
- var import_path7 = __require("path");
49955
- var findBinPath = (binCommandName, startingDir) => {
49956
- const cmdPath = (0, import_path7.join)(startingDir, "node_modules", ".bin", binCommandName);
49957
- const parentDir = (0, import_path7.join)(startingDir, "..");
49958
- if ((0, import_fs.existsSync)(cmdPath)) {
49959
- return cmdPath;
49960
- }
49961
- if (parentDir === startingDir) {
49962
- throw new Error(`Command not found: ${binCommandName}`);
49963
- }
49964
- return findBinPath(binCommandName, parentDir);
49965
- };
49966
-
49967
50114
  // src/test-utils/launchNode.ts
49968
50115
  var import_child_process = __require("child_process");
49969
50116
  var import_crypto19 = __require("crypto");
49970
- var import_fs2 = __require("fs");
50117
+ var import_fs = __require("fs");
49971
50118
  var import_os = __toESM(__require("os"));
49972
- var import_path8 = __toESM(__require("path"));
50119
+ var import_path7 = __toESM(__require("path"));
49973
50120
  var import_portfinder = __toESM(require_portfinder());
49974
50121
  var import_tree_kill = __toESM(require_tree_kill());
49975
50122
  var getFlagValueFromArgs = (args, flag) => {
@@ -49998,8 +50145,8 @@ Supported fuel-core version: ${supportedVersion}.`
49998
50145
  }
49999
50146
  child.stdout.removeAllListeners();
50000
50147
  child.stderr.removeAllListeners();
50001
- if ((0, import_fs2.existsSync)(configPath)) {
50002
- (0, import_fs2.rmSync)(configPath, { recursive: true });
50148
+ if ((0, import_fs.existsSync)(configPath)) {
50149
+ (0, import_fs.rmSync)(configPath, { recursive: true });
50003
50150
  }
50004
50151
  }
50005
50152
  };
@@ -50007,7 +50154,7 @@ Supported fuel-core version: ${supportedVersion}.`
50007
50154
  ip,
50008
50155
  port,
50009
50156
  args = [],
50010
- useSystemFuelCore = false,
50157
+ fuelCorePath = process.env.FUEL_CORE_PATH ?? void 0,
50011
50158
  loggingEnabled = true,
50012
50159
  debugEnabled = false,
50013
50160
  basePath
@@ -50027,8 +50174,7 @@ Supported fuel-core version: ${supportedVersion}.`
50027
50174
  const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
50028
50175
  const poaInstant = poaInstantFlagValue === "true" || poaInstantFlagValue === void 0;
50029
50176
  const graphQLStartSubstring = "Binding GraphQL provider to";
50030
- const binPath = findBinPath("fuels-core", __dirname);
50031
- const command = useSystemFuelCore ? "fuel-core" : binPath;
50177
+ const command = fuelCorePath ?? "fuel-core";
50032
50178
  const ipToUse = ip || "0.0.0.0";
50033
50179
  const portToUse = port || (await (0, import_portfinder.getPortPromise)({
50034
50180
  port: 4e3,
@@ -50039,12 +50185,12 @@ Supported fuel-core version: ${supportedVersion}.`
50039
50185
  let snapshotDirToUse;
50040
50186
  const prefix = basePath || import_os.default.tmpdir();
50041
50187
  const suffix = basePath ? "" : (0, import_crypto19.randomUUID)();
50042
- const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "snapshotDir");
50188
+ const tempDirPath = import_path7.default.join(prefix, ".fuels", suffix, "snapshotDir");
50043
50189
  if (snapshotDir) {
50044
50190
  snapshotDirToUse = snapshotDir;
50045
50191
  } else {
50046
- if (!(0, import_fs2.existsSync)(tempDirPath)) {
50047
- (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
50192
+ if (!(0, import_fs.existsSync)(tempDirPath)) {
50193
+ (0, import_fs.mkdirSync)(tempDirPath, { recursive: true });
50048
50194
  }
50049
50195
  let { stateConfigJson } = defaultSnapshotConfigs;
50050
50196
  const { chainConfigJson, metadataJson } = defaultSnapshotConfigs;
@@ -50080,14 +50226,14 @@ Supported fuel-core version: ${supportedVersion}.`
50080
50226
  let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
50081
50227
  const regexMakeNumber = /("amount":)"(\d+)"/gm;
50082
50228
  fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
50083
- const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
50084
- const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
50085
- const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
50086
- const stateTransitionWritePath = import_path8.default.join(tempDirPath, "state_transition_bytecode.wasm");
50087
- (0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
50088
- (0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
50089
- (0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
50090
- (0, import_fs2.writeFileSync)(stateTransitionWritePath, JSON.stringify(""));
50229
+ const chainConfigWritePath = import_path7.default.join(tempDirPath, "chainConfig.json");
50230
+ const stateConfigWritePath = import_path7.default.join(tempDirPath, "stateConfig.json");
50231
+ const metadataWritePath = import_path7.default.join(tempDirPath, "metadata.json");
50232
+ const stateTransitionWritePath = import_path7.default.join(tempDirPath, "state_transition_bytecode.wasm");
50233
+ (0, import_fs.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
50234
+ (0, import_fs.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
50235
+ (0, import_fs.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
50236
+ (0, import_fs.writeFileSync)(stateTransitionWritePath, JSON.stringify(""));
50091
50237
  snapshotDirToUse = tempDirPath;
50092
50238
  }
50093
50239
  const child = (0, import_child_process.spawn)(