@fuel-ts/account 0.0.0-rc-2143-20240517135655 → 0.0.0-rc-2329-20240517140938

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.

@@ -6,7 +6,7 @@ export type LaunchNodeOptions = {
6
6
  ip?: string;
7
7
  port?: string;
8
8
  args?: string[];
9
- fuelCorePath?: string;
9
+ useSystemFuelCore?: boolean;
10
10
  loggingEnabled?: boolean;
11
11
  debugEnabled?: boolean;
12
12
  basePath?: string;
@@ -31,12 +31,12 @@ export declare const killNode: (params: KillNodeParams) => void;
31
31
  * @param ip - the ip to bind to. (optional, defaults to 0.0.0.0)
32
32
  * @param port - the port to bind to. (optional, defaults to 4000 or the next available port)
33
33
  * @param args - additional arguments to pass to fuel-core.
34
- * @param fuelCorePath - the path to the fuel-core binary. (optional, defaults to 'fuel-core')
34
+ * @param useSystemFuelCore - whether to use the system fuel-core binary or the one provided by the \@fuel-ts/fuel-core package.
35
35
  * @param loggingEnabled - whether the node should output logs. (optional, defaults to true)
36
36
  * @param debugEnabled - whether the node should log debug messages. (optional, defaults to false)
37
37
  * @param basePath - the base path to use for the temporary folder. (optional, defaults to os.tmpdir())
38
38
  * */
39
- export declare const launchNode: ({ ip, port, args, fuelCorePath, loggingEnabled, debugEnabled, basePath, }: LaunchNodeOptions) => LaunchNodeResult;
39
+ export declare const launchNode: ({ ip, port, args, useSystemFuelCore, loggingEnabled, debugEnabled, basePath, }: LaunchNodeOptions) => LaunchNodeResult;
40
40
  export type LaunchNodeAndGetWalletsResult = Promise<{
41
41
  wallets: WalletUnlocked[];
42
42
  stop: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"launchNode.d.ts","sourceRoot":"","sources":["../../src/test-utils/launchNode.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AASpE,OAAO,EAAE,QAAQ,EA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CAAC"}
@@ -9511,16 +9511,16 @@ spurious results.`);
9511
9511
  },
9512
9512
  // Document
9513
9513
  Document: {
9514
- leave: (node) => join2(node.definitions, "\n\n")
9514
+ leave: (node) => join3(node.definitions, "\n\n")
9515
9515
  },
9516
9516
  OperationDefinition: {
9517
9517
  leave(node) {
9518
- const varDefs = wrap2("(", join2(node.variableDefinitions, ", "), ")");
9519
- const prefix = join2(
9518
+ const varDefs = wrap2("(", join3(node.variableDefinitions, ", "), ")");
9519
+ const prefix = join3(
9520
9520
  [
9521
9521
  node.operation,
9522
- join2([node.name, varDefs]),
9523
- join2(node.directives, " ")
9522
+ join3([node.name, varDefs]),
9523
+ join3(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(" ", join2(directives, " "))
9531
+ leave: ({ variable, type: type3, defaultValue, directives }) => variable + ": " + type3 + wrap2(" = ", defaultValue) + wrap2(" ", join3(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("(", join2(args, ", "), ")");
9539
+ let argsLine = prefix + wrap2("(", join3(args, ", "), ")");
9540
9540
  if (argsLine.length > MAX_LINE_LENGTH2) {
9541
- argsLine = prefix + wrap2("(\n", indent2(join2(args, "\n")), "\n)");
9541
+ argsLine = prefix + wrap2("(\n", indent2(join3(args, "\n")), "\n)");
9542
9542
  }
9543
- return join2([argsLine, join2(directives, " "), selectionSet], " ");
9543
+ return join3([argsLine, join3(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(" ", join2(directives, " "))
9551
+ leave: ({ name, directives }) => "..." + name + wrap2(" ", join3(directives, " "))
9552
9552
  },
9553
9553
  InlineFragment: {
9554
- leave: ({ typeCondition, directives, selectionSet }) => join2(
9554
+ leave: ({ typeCondition, directives, selectionSet }) => join3(
9555
9555
  [
9556
9556
  "...",
9557
9557
  wrap2("on ", typeCondition),
9558
- join2(directives, " "),
9558
+ join3(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("(", join2(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join2(directives, " "), " ")}` + selectionSet
9567
+ `fragment ${name}${wrap2("(", join3(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join3(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 }) => "[" + join2(values, ", ") + "]"
9590
+ leave: ({ values }) => "[" + join3(values, ", ") + "]"
9591
9591
  },
9592
9592
  ObjectValue: {
9593
- leave: ({ fields }) => "{" + join2(fields, ", ") + "}"
9593
+ leave: ({ fields }) => "{" + join3(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("(", join2(args, ", "), ")")
9600
+ leave: ({ name, arguments: args }) => "@" + name + wrap2("(", join3(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") + join2(["schema", join2(directives, " "), block2(operationTypes)], " ")
9614
+ leave: ({ description, directives, operationTypes }) => wrap2("", description, "\n") + join3(["schema", join3(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") + join2(["scalar", name, join2(directives, " ")], " ")
9620
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join3(["scalar", name, join3(directives, " ")], " ")
9621
9621
  },
9622
9622
  ObjectTypeDefinition: {
9623
- leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join2(
9623
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join3(
9624
9624
  [
9625
9625
  "type",
9626
9626
  name,
9627
- wrap2("implements ", join2(interfaces, " & ")),
9628
- join2(directives, " "),
9627
+ wrap2("implements ", join3(interfaces, " & ")),
9628
+ join3(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(join2(args, "\n")), "\n)") : wrap2("(", join2(args, ", "), ")")) + ": " + type3 + wrap2(" ", join2(directives, " "))
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, " "))
9636
9636
  },
9637
9637
  InputValueDefinition: {
9638
- leave: ({ description, name, type: type3, defaultValue, directives }) => wrap2("", description, "\n") + join2(
9639
- [name + ": " + type3, wrap2("= ", defaultValue), join2(directives, " ")],
9638
+ leave: ({ description, name, type: type3, defaultValue, directives }) => wrap2("", description, "\n") + join3(
9639
+ [name + ": " + type3, wrap2("= ", defaultValue), join3(directives, " ")],
9640
9640
  " "
9641
9641
  )
9642
9642
  },
9643
9643
  InterfaceTypeDefinition: {
9644
- leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join2(
9644
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join3(
9645
9645
  [
9646
9646
  "interface",
9647
9647
  name,
9648
- wrap2("implements ", join2(interfaces, " & ")),
9649
- join2(directives, " "),
9648
+ wrap2("implements ", join3(interfaces, " & ")),
9649
+ join3(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") + join2(
9657
- ["union", name, join2(directives, " "), wrap2("= ", join2(types, " | "))],
9656
+ leave: ({ description, name, directives, types }) => wrap2("", description, "\n") + join3(
9657
+ ["union", name, join3(directives, " "), wrap2("= ", join3(types, " | "))],
9658
9658
  " "
9659
9659
  )
9660
9660
  },
9661
9661
  EnumTypeDefinition: {
9662
- leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join2(["enum", name, join2(directives, " "), block2(values)], " ")
9662
+ leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join3(["enum", name, join3(directives, " "), block2(values)], " ")
9663
9663
  },
9664
9664
  EnumValueDefinition: {
9665
- leave: ({ description, name, directives }) => wrap2("", description, "\n") + join2([name, join2(directives, " ")], " ")
9665
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join3([name, join3(directives, " ")], " ")
9666
9666
  },
9667
9667
  InputObjectTypeDefinition: {
9668
- leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join2(["input", name, join2(directives, " "), block2(fields)], " ")
9668
+ leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join3(["input", name, join3(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(join2(args, "\n")), "\n)") : wrap2("(", join2(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join2(locations, " | ")
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, " | ")
9672
9672
  },
9673
9673
  SchemaExtension: {
9674
- leave: ({ directives, operationTypes }) => join2(
9675
- ["extend schema", join2(directives, " "), block2(operationTypes)],
9674
+ leave: ({ directives, operationTypes }) => join3(
9675
+ ["extend schema", join3(directives, " "), block2(operationTypes)],
9676
9676
  " "
9677
9677
  )
9678
9678
  },
9679
9679
  ScalarTypeExtension: {
9680
- leave: ({ name, directives }) => join2(["extend scalar", name, join2(directives, " ")], " ")
9680
+ leave: ({ name, directives }) => join3(["extend scalar", name, join3(directives, " ")], " ")
9681
9681
  },
9682
9682
  ObjectTypeExtension: {
9683
- leave: ({ name, interfaces, directives, fields }) => join2(
9683
+ leave: ({ name, interfaces, directives, fields }) => join3(
9684
9684
  [
9685
9685
  "extend type",
9686
9686
  name,
9687
- wrap2("implements ", join2(interfaces, " & ")),
9688
- join2(directives, " "),
9687
+ wrap2("implements ", join3(interfaces, " & ")),
9688
+ join3(directives, " "),
9689
9689
  block2(fields)
9690
9690
  ],
9691
9691
  " "
9692
9692
  )
9693
9693
  },
9694
9694
  InterfaceTypeExtension: {
9695
- leave: ({ name, interfaces, directives, fields }) => join2(
9695
+ leave: ({ name, interfaces, directives, fields }) => join3(
9696
9696
  [
9697
9697
  "extend interface",
9698
9698
  name,
9699
- wrap2("implements ", join2(interfaces, " & ")),
9700
- join2(directives, " "),
9699
+ wrap2("implements ", join3(interfaces, " & ")),
9700
+ join3(directives, " "),
9701
9701
  block2(fields)
9702
9702
  ],
9703
9703
  " "
9704
9704
  )
9705
9705
  },
9706
9706
  UnionTypeExtension: {
9707
- leave: ({ name, directives, types }) => join2(
9707
+ leave: ({ name, directives, types }) => join3(
9708
9708
  [
9709
9709
  "extend union",
9710
9710
  name,
9711
- join2(directives, " "),
9712
- wrap2("= ", join2(types, " | "))
9711
+ join3(directives, " "),
9712
+ wrap2("= ", join3(types, " | "))
9713
9713
  ],
9714
9714
  " "
9715
9715
  )
9716
9716
  },
9717
9717
  EnumTypeExtension: {
9718
- leave: ({ name, directives, values }) => join2(["extend enum", name, join2(directives, " "), block2(values)], " ")
9718
+ leave: ({ name, directives, values }) => join3(["extend enum", name, join3(directives, " "), block2(values)], " ")
9719
9719
  },
9720
9720
  InputObjectTypeExtension: {
9721
- leave: ({ name, directives, fields }) => join2(["extend input", name, join2(directives, " "), block2(fields)], " ")
9721
+ leave: ({ name, directives, fields }) => join3(["extend input", name, join3(directives, " "), block2(fields)], " ")
9722
9722
  }
9723
9723
  };
9724
- function join2(maybeArray, separator = "") {
9724
+ function join3(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(join2(array, "\n")), "\n}");
9729
+ return wrap2("{\n", indent2(join3(array, "\n")), "\n}");
9730
9730
  }
9731
9731
  function wrap2(start, maybeString, end = "") {
9732
9732
  return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
@@ -32432,7 +32432,7 @@ spurious results.`);
32432
32432
  // ../versions/dist/index.mjs
32433
32433
  function getBuiltinVersions() {
32434
32434
  return {
32435
- FORC: "0.58.0",
32435
+ FORC: "0.59.0",
32436
32436
  FUEL_CORE: "0.26.0",
32437
32437
  FUELS: "0.87.0"
32438
32438
  };
@@ -43679,7 +43679,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43679
43679
  if (receipt.type === ReceiptType.LogData || receipt.type === ReceiptType.Log) {
43680
43680
  const interfaceToUse = new Interface(externalAbis[receipt.id] || mainAbi);
43681
43681
  const data = receipt.type === ReceiptType.Log ? new BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
43682
- const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
43682
+ const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toString());
43683
43683
  logs.push(decodedLog);
43684
43684
  }
43685
43685
  return logs;
@@ -49949,12 +49949,27 @@ Supported fuel-core version: ${supportedVersion}.`
49949
49949
  return wallet;
49950
49950
  };
49951
49951
 
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
+
49952
49967
  // src/test-utils/launchNode.ts
49953
49968
  var import_child_process = __require("child_process");
49954
49969
  var import_crypto19 = __require("crypto");
49955
- var import_fs = __require("fs");
49970
+ var import_fs2 = __require("fs");
49956
49971
  var import_os = __toESM(__require("os"));
49957
- var import_path7 = __toESM(__require("path"));
49972
+ var import_path8 = __toESM(__require("path"));
49958
49973
  var import_portfinder = __toESM(require_portfinder());
49959
49974
  var import_tree_kill = __toESM(require_tree_kill());
49960
49975
  var getFlagValueFromArgs = (args, flag) => {
@@ -49983,8 +49998,8 @@ Supported fuel-core version: ${supportedVersion}.`
49983
49998
  }
49984
49999
  child.stdout.removeAllListeners();
49985
50000
  child.stderr.removeAllListeners();
49986
- if ((0, import_fs.existsSync)(configPath)) {
49987
- (0, import_fs.rmSync)(configPath, { recursive: true });
50001
+ if ((0, import_fs2.existsSync)(configPath)) {
50002
+ (0, import_fs2.rmSync)(configPath, { recursive: true });
49988
50003
  }
49989
50004
  }
49990
50005
  };
@@ -49992,7 +50007,7 @@ Supported fuel-core version: ${supportedVersion}.`
49992
50007
  ip,
49993
50008
  port,
49994
50009
  args = [],
49995
- fuelCorePath = process.env.FUEL_CORE_PATH ?? void 0,
50010
+ useSystemFuelCore = false,
49996
50011
  loggingEnabled = true,
49997
50012
  debugEnabled = false,
49998
50013
  basePath
@@ -50012,7 +50027,8 @@ Supported fuel-core version: ${supportedVersion}.`
50012
50027
  const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
50013
50028
  const poaInstant = poaInstantFlagValue === "true" || poaInstantFlagValue === void 0;
50014
50029
  const graphQLStartSubstring = "Binding GraphQL provider to";
50015
- const command = fuelCorePath ?? "fuel-core";
50030
+ const binPath = findBinPath("fuels-core", __dirname);
50031
+ const command = useSystemFuelCore ? "fuel-core" : binPath;
50016
50032
  const ipToUse = ip || "0.0.0.0";
50017
50033
  const portToUse = port || (await (0, import_portfinder.getPortPromise)({
50018
50034
  port: 4e3,
@@ -50023,12 +50039,12 @@ Supported fuel-core version: ${supportedVersion}.`
50023
50039
  let snapshotDirToUse;
50024
50040
  const prefix = basePath || import_os.default.tmpdir();
50025
50041
  const suffix = basePath ? "" : (0, import_crypto19.randomUUID)();
50026
- const tempDirPath = import_path7.default.join(prefix, ".fuels", suffix, "snapshotDir");
50042
+ const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "snapshotDir");
50027
50043
  if (snapshotDir) {
50028
50044
  snapshotDirToUse = snapshotDir;
50029
50045
  } else {
50030
- if (!(0, import_fs.existsSync)(tempDirPath)) {
50031
- (0, import_fs.mkdirSync)(tempDirPath, { recursive: true });
50046
+ if (!(0, import_fs2.existsSync)(tempDirPath)) {
50047
+ (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
50032
50048
  }
50033
50049
  let { stateConfigJson } = defaultSnapshotConfigs;
50034
50050
  const { chainConfigJson, metadataJson } = defaultSnapshotConfigs;
@@ -50064,14 +50080,14 @@ Supported fuel-core version: ${supportedVersion}.`
50064
50080
  let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
50065
50081
  const regexMakeNumber = /("amount":)"(\d+)"/gm;
50066
50082
  fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
50067
- const chainConfigWritePath = import_path7.default.join(tempDirPath, "chainConfig.json");
50068
- const stateConfigWritePath = import_path7.default.join(tempDirPath, "stateConfig.json");
50069
- const metadataWritePath = import_path7.default.join(tempDirPath, "metadata.json");
50070
- const stateTransitionWritePath = import_path7.default.join(tempDirPath, "state_transition_bytecode.wasm");
50071
- (0, import_fs.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
50072
- (0, import_fs.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
50073
- (0, import_fs.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
50074
- (0, import_fs.writeFileSync)(stateTransitionWritePath, JSON.stringify(""));
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(""));
50075
50091
  snapshotDirToUse = tempDirPath;
50076
50092
  }
50077
50093
  const child = (0, import_child_process.spawn)(