@settlemint/sdk-cli 1.1.16-pr3067e493 → 1.1.16-pr5d8ed20a

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.
Files changed (3) hide show
  1. package/dist/cli.js +841 -842
  2. package/dist/cli.js.map +20 -20
  3. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -14516,8 +14516,8 @@ var require_printLocation = __commonJS((exports) => {
14516
14516
  const columnNum = sourceLocation.column + columnOffset;
14517
14517
  const locationStr = `${source.name}:${lineNum}:${columnNum}
14518
14518
  `;
14519
- const lines = body.split(/\r\n|[\n\r]/g);
14520
- const locationLine = lines[lineIndex];
14519
+ const lines2 = body.split(/\r\n|[\n\r]/g);
14520
+ const locationLine = lines2[lineIndex];
14521
14521
  if (locationLine.length > 120) {
14522
14522
  const subLineIndex = Math.floor(columnNum / 80);
14523
14523
  const subLineColumnNum = columnNum % 80;
@@ -14533,14 +14533,14 @@ var require_printLocation = __commonJS((exports) => {
14533
14533
  ]);
14534
14534
  }
14535
14535
  return locationStr + printPrefixedLines([
14536
- [`${lineNum - 1} |`, lines[lineIndex - 1]],
14536
+ [`${lineNum - 1} |`, lines2[lineIndex - 1]],
14537
14537
  [`${lineNum} |`, locationLine],
14538
14538
  ["|", "^".padStart(columnNum)],
14539
- [`${lineNum + 1} |`, lines[lineIndex + 1]]
14539
+ [`${lineNum + 1} |`, lines2[lineIndex + 1]]
14540
14540
  ]);
14541
14541
  }
14542
- function printPrefixedLines(lines) {
14543
- const existingLines = lines.filter(([_, line]) => line !== undefined);
14542
+ function printPrefixedLines(lines2) {
14543
+ const existingLines = lines2.filter(([_, line]) => line !== undefined);
14544
14544
  const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
14545
14545
  return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join(`
14546
14546
  `);
@@ -14953,14 +14953,14 @@ var require_blockString = __commonJS((exports) => {
14953
14953
  exports.isPrintableAsBlockString = isPrintableAsBlockString;
14954
14954
  exports.printBlockString = printBlockString;
14955
14955
  var _characterClasses = require_characterClasses();
14956
- function dedentBlockStringLines(lines) {
14956
+ function dedentBlockStringLines(lines2) {
14957
14957
  var _firstNonEmptyLine2;
14958
14958
  let commonIndent = Number.MAX_SAFE_INTEGER;
14959
14959
  let firstNonEmptyLine = null;
14960
14960
  let lastNonEmptyLine = -1;
14961
- for (let i = 0;i < lines.length; ++i) {
14961
+ for (let i = 0;i < lines2.length; ++i) {
14962
14962
  var _firstNonEmptyLine;
14963
- const line = lines[i];
14963
+ const line = lines2[i];
14964
14964
  const indent = leadingWhitespace(line);
14965
14965
  if (indent === line.length) {
14966
14966
  continue;
@@ -14971,7 +14971,7 @@ var require_blockString = __commonJS((exports) => {
14971
14971
  commonIndent = indent;
14972
14972
  }
14973
14973
  }
14974
- return lines.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice((_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== undefined ? _firstNonEmptyLine2 : 0, lastNonEmptyLine + 1);
14974
+ return lines2.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice((_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== undefined ? _firstNonEmptyLine2 : 0, lastNonEmptyLine + 1);
14975
14975
  }
14976
14976
  function leadingWhitespace(str) {
14977
14977
  let i = 0;
@@ -15033,9 +15033,9 @@ var require_blockString = __commonJS((exports) => {
15033
15033
  }
15034
15034
  function printBlockString(value, options) {
15035
15035
  const escapedValue = value.replace(/"""/g, '\\"""');
15036
- const lines = escapedValue.split(/\r\n|[\n\r]/g);
15037
- const isSingleLine = lines.length === 1;
15038
- const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every((line) => line.length === 0 || (0, _characterClasses.isWhiteSpace)(line.charCodeAt(0)));
15036
+ const lines2 = escapedValue.split(/\r\n|[\n\r]/g);
15037
+ const isSingleLine = lines2.length === 1;
15038
+ const forceLeadingNewLine = lines2.length > 1 && lines2.slice(1).every((line) => line.length === 0 || (0, _characterClasses.isWhiteSpace)(line.charCodeAt(0)));
15039
15039
  const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""');
15040
15040
  const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes;
15041
15041
  const hasTrailingSlash = value.endsWith("\\");
@@ -34095,9 +34095,9 @@ var require_commonjs4 = __commonJS((exports) => {
34095
34095
  this.#resolveCache = new ResolveCache2;
34096
34096
  this.#resolvePosixCache = new ResolveCache2;
34097
34097
  this.#children = new ChildrenCache2(childrenCacheSize);
34098
- const split = cwdPath.substring(this.rootPath.length).split(sep2);
34099
- if (split.length === 1 && !split[0]) {
34100
- split.pop();
34098
+ const split2 = cwdPath.substring(this.rootPath.length).split(sep2);
34099
+ if (split2.length === 1 && !split2[0]) {
34100
+ split2.pop();
34101
34101
  }
34102
34102
  if (nocase === undefined) {
34103
34103
  throw new TypeError("must provide nocase setting to PathScurryBase ctor");
@@ -34106,11 +34106,11 @@ var require_commonjs4 = __commonJS((exports) => {
34106
34106
  this.root = this.newRoot(this.#fs);
34107
34107
  this.roots[this.rootPath] = this.root;
34108
34108
  let prev = this.root;
34109
- let len = split.length - 1;
34109
+ let len = split2.length - 1;
34110
34110
  const joinSep = pathImpl.sep;
34111
34111
  let abs = this.rootPath;
34112
34112
  let sawFirst = false;
34113
- for (const part of split) {
34113
+ for (const part of split2) {
34114
34114
  const l = len--;
34115
34115
  prev = prev.child(part, {
34116
34116
  relative: new Array(l).fill("..").join(joinSep),
@@ -36562,9 +36562,9 @@ var require_ini = __commonJS((exports, module) => {
36562
36562
  let p = out;
36563
36563
  let section = null;
36564
36564
  const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
36565
- const lines = str.split(/[\r\n]+/g);
36565
+ const lines2 = str.split(/[\r\n]+/g);
36566
36566
  const duplicates = {};
36567
- for (const line of lines) {
36567
+ for (const line of lines2) {
36568
36568
  if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
36569
36569
  continue;
36570
36570
  }
@@ -38119,7 +38119,7 @@ var require_semver2 = __commonJS((exports, module) => {
38119
38119
  // ../../node_modules/@npmcli/git/lib/lines-to-revs.js
38120
38120
  var require_lines_to_revs = __commonJS((exports, module) => {
38121
38121
  var semver = require_semver2();
38122
- module.exports = (lines) => finish(lines.reduce(linesToRevsReducer, {
38122
+ module.exports = (lines2) => finish(lines2.reduce(linesToRevsReducer, {
38123
38123
  versions: {},
38124
38124
  "dist-tags": {},
38125
38125
  refs: {},
@@ -38180,12 +38180,12 @@ var require_lines_to_revs = __commonJS((exports, module) => {
38180
38180
  return "other";
38181
38181
  };
38182
38182
  var lineToRevDoc = (line) => {
38183
- const split = line.trim().split(/\s+/, 2);
38184
- if (split.length < 2) {
38183
+ const split2 = line.trim().split(/\s+/, 2);
38184
+ if (split2.length < 2) {
38185
38185
  return null;
38186
38186
  }
38187
- const sha = split[0].trim();
38188
- const rawRef = split[1].trim();
38187
+ const sha = split2[0].trim();
38188
+ const rawRef = split2[1].trim();
38189
38189
  const type2 = refType(rawRef);
38190
38190
  if (type2 === "tag") {
38191
38191
  const ref = rawRef.slice("refs/tags/".length);
@@ -40746,17 +40746,17 @@ var require_normalize_data = __commonJS((exports, module) => {
40746
40746
  };
40747
40747
  var isEmail = (str) => str.includes("@") && str.indexOf("@") < str.lastIndexOf(".");
40748
40748
  function extractDescription(description) {
40749
- const lines = description.trim().split(`
40749
+ const lines2 = description.trim().split(`
40750
40750
  `);
40751
40751
  let start = 0;
40752
- while (lines[start]?.trim().match(/^(#|$)/)) {
40752
+ while (lines2[start]?.trim().match(/^(#|$)/)) {
40753
40753
  start++;
40754
40754
  }
40755
40755
  let end = start + 1;
40756
- while (end < lines.length && lines[end].trim()) {
40756
+ while (end < lines2.length && lines2[end].trim()) {
40757
40757
  end++;
40758
40758
  }
40759
- return lines.slice(start, end).join(" ").trim();
40759
+ return lines2.slice(start, end).join(" ").trim();
40760
40760
  }
40761
40761
  function stringifyPerson(person) {
40762
40762
  if (typeof person !== "string") {
@@ -59469,9 +59469,9 @@ ${lanes.join(`
59469
59469
  return node.kind === 183 || node.kind === 233;
59470
59470
  }
59471
59471
  var MAX_SMI_X86 = 1073741823;
59472
- function guessIndentation(lines) {
59472
+ function guessIndentation(lines2) {
59473
59473
  let indentation = MAX_SMI_X86;
59474
- for (const line of lines) {
59474
+ for (const line of lines2) {
59475
59475
  if (!line.length) {
59476
59476
  continue;
59477
59477
  }
@@ -148028,8 +148028,8 @@ ${lanes.join(`
148028
148028
  if (node.comment) {
148029
148029
  const text = getTextOfJSDocComment(node.comment);
148030
148030
  if (text) {
148031
- const lines = text.split(/\r\n?|\n/);
148032
- for (const line of lines) {
148031
+ const lines2 = text.split(/\r\n?|\n/);
148032
+ for (const line of lines2) {
148033
148033
  writeLine();
148034
148034
  writeSpace();
148035
148035
  writePunctuation("*");
@@ -148673,9 +148673,9 @@ ${lanes.join(`
148673
148673
  if (getEmitFlags(parentNode) & 1) {
148674
148674
  writeSpace();
148675
148675
  } else if (preserveSourceNewlines) {
148676
- const lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode);
148677
- if (lines) {
148678
- writeLine(lines);
148676
+ const lines2 = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode);
148677
+ if (lines2) {
148678
+ writeLine(lines2);
148679
148679
  } else {
148680
148680
  writeSpace();
148681
148681
  }
@@ -148684,9 +148684,9 @@ ${lanes.join(`
148684
148684
  }
148685
148685
  }
148686
148686
  function writeLines(text) {
148687
- const lines = text.split(/\r\n?|\n/);
148688
- const indentation = guessIndentation(lines);
148689
- for (const lineText of lines) {
148687
+ const lines2 = text.split(/\r\n?|\n/);
148688
+ const indentation = guessIndentation(lines2);
148689
+ for (const lineText of lines2) {
148690
148690
  const line = indentation ? lineText.slice(indentation) : lineText;
148691
148691
  if (line.length) {
148692
148692
  writeLine();
@@ -148784,11 +148784,11 @@ ${lanes.join(`
148784
148784
  }
148785
148785
  function getEffectiveLines(getLineDifference) {
148786
148786
  Debug.assert(!!preserveSourceNewlines);
148787
- const lines = getLineDifference(true);
148788
- if (lines === 0) {
148787
+ const lines2 = getLineDifference(true);
148788
+ if (lines2 === 0) {
148789
148789
  return getLineDifference(false);
148790
148790
  }
148791
- return lines;
148791
+ return lines2;
148792
148792
  }
148793
148793
  function writeLineSeparatorsAndIndentBefore(node, parent2) {
148794
148794
  const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent2, node, 0);
@@ -159074,7 +159074,7 @@ ${lanes.join(`
159074
159074
  function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight) {
159075
159075
  var _a;
159076
159076
  const text = [];
159077
- const colors2 = createColors(sys2);
159077
+ const colors3 = createColors(sys2);
159078
159078
  const name2 = getDisplayNameTextOfOption(option);
159079
159079
  const valueCandidates = getValueCandidate(option);
159080
159080
  const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(option.defaultValueDescription, option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type);
@@ -159095,7 +159095,7 @@ ${lanes.join(`
159095
159095
  }
159096
159096
  text.push(sys2.newLine);
159097
159097
  } else {
159098
- text.push(colors2.blue(name2), sys2.newLine);
159098
+ text.push(colors3.blue(name2), sys2.newLine);
159099
159099
  if (option.description) {
159100
159100
  const description3 = getDiagnosticText(option.description);
159101
159101
  text.push(description3);
@@ -159140,7 +159140,7 @@ ${lanes.join(`
159140
159140
  if (isFirstLine) {
159141
159141
  curLeft = left.padStart(rightAlignOfLeft2);
159142
159142
  curLeft = curLeft.padEnd(leftAlignOfRight2);
159143
- curLeft = colorLeft ? colors2.blue(curLeft) : curLeft;
159143
+ curLeft = colorLeft ? colors3.blue(curLeft) : curLeft;
159144
159144
  } else {
159145
159145
  curLeft = "".padStart(leftAlignOfRight2);
159146
159146
  }
@@ -159209,15 +159209,15 @@ ${lanes.join(`
159209
159209
  }
159210
159210
  const rightAlignOfLeftPart = maxLength2 + 2;
159211
159211
  const leftAlignOfRightPart = rightAlignOfLeftPart + 2;
159212
- let lines = [];
159212
+ let lines2 = [];
159213
159213
  for (const option of optionsList) {
159214
159214
  const tmp = generateOptionOutput(sys2, option, rightAlignOfLeftPart, leftAlignOfRightPart);
159215
- lines = [...lines, ...tmp];
159215
+ lines2 = [...lines2, ...tmp];
159216
159216
  }
159217
- if (lines[lines.length - 2] !== sys2.newLine) {
159218
- lines.push(sys2.newLine);
159217
+ if (lines2[lines2.length - 2] !== sys2.newLine) {
159218
+ lines2.push(sys2.newLine);
159219
159219
  }
159220
- return lines;
159220
+ return lines2;
159221
159221
  }
159222
159222
  function generateSectionOptionsOutput(sys2, sectionName, options, subCategory, beforeOptionsDescription, afterOptionsDescription) {
159223
159223
  let res = [];
@@ -159252,9 +159252,9 @@ ${lanes.join(`
159252
159252
  return res;
159253
159253
  }
159254
159254
  function printEasyHelp(sys2, simpleOptions) {
159255
- const colors2 = createColors(sys2);
159255
+ const colors3 = createColors(sys2);
159256
159256
  let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
159257
- output.push(colors2.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
159257
+ output.push(colors3.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
159258
159258
  example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
159259
159259
  example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
159260
159260
  example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory);
@@ -159275,7 +159275,7 @@ ${lanes.join(`
159275
159275
  function example(ex, desc) {
159276
159276
  const examples = typeof ex === "string" ? [ex] : ex;
159277
159277
  for (const example2 of examples) {
159278
- output.push(" " + colors2.blue(example2) + sys2.newLine);
159278
+ output.push(" " + colors3.blue(example2) + sys2.newLine);
159279
159279
  }
159280
159280
  output.push(" " + getDiagnosticText(desc) + sys2.newLine + sys2.newLine);
159281
159281
  }
@@ -159298,12 +159298,12 @@ ${lanes.join(`
159298
159298
  }
159299
159299
  function getHeader(sys2, message) {
159300
159300
  var _a;
159301
- const colors2 = createColors(sys2);
159301
+ const colors3 = createColors(sys2);
159302
159302
  const header = [];
159303
159303
  const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? undefined : _a.call(sys2)) ?? 0;
159304
159304
  const tsIconLength = 5;
159305
- const tsIconFirstLine = colors2.blueBackground("".padStart(tsIconLength));
159306
- const tsIconSecondLine = colors2.blueBackground(colors2.brightWhite("TS ".padStart(tsIconLength)));
159305
+ const tsIconFirstLine = colors3.blueBackground("".padStart(tsIconLength));
159306
+ const tsIconSecondLine = colors3.blueBackground(colors3.brightWhite("TS ".padStart(tsIconLength)));
159307
159307
  if (terminalWidth >= message.length + tsIconLength) {
159308
159308
  const rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
159309
159309
  const leftAlign = rightAlign - tsIconLength;
@@ -211016,9 +211016,9 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
211016
211016
  insertedText = this.initialText + this.trailingText;
211017
211017
  }
211018
211018
  const lm = LineIndex.linesFromText(insertedText);
211019
- const lines = lm.lines;
211020
- if (lines.length > 1 && lines[lines.length - 1] === "") {
211021
- lines.pop();
211019
+ const lines2 = lm.lines;
211020
+ if (lines2.length > 1 && lines2[lines2.length - 1] === "") {
211021
+ lines2.pop();
211022
211022
  }
211023
211023
  let branchParent;
211024
211024
  let lastZeroCount;
@@ -211037,13 +211037,13 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
211037
211037
  branchParent.remove(lastZeroCount);
211038
211038
  }
211039
211039
  const leafNode = this.startPath[this.startPath.length - 1];
211040
- if (lines.length > 0) {
211041
- leafNode.text = lines[0];
211042
- if (lines.length > 1) {
211043
- let insertedNodes = new Array(lines.length - 1);
211040
+ if (lines2.length > 0) {
211041
+ leafNode.text = lines2[0];
211042
+ if (lines2.length > 1) {
211043
+ let insertedNodes = new Array(lines2.length - 1);
211044
211044
  let startNode2 = leafNode;
211045
- for (let i2 = 1;i2 < lines.length; i2++) {
211046
- insertedNodes[i2 - 1] = new LineLeaf(lines[i2]);
211045
+ for (let i2 = 1;i2 < lines2.length; i2++) {
211046
+ insertedNodes[i2 - 1] = new LineLeaf(lines2[i2]);
211047
211047
  }
211048
211048
  let pathIndex = this.startPath.length - 2;
211049
211049
  while (pathIndex >= 0) {
@@ -211313,11 +211313,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
211313
211313
  return { absolutePosition: this.root.charCount(), lineText: undefined };
211314
211314
  }
211315
211315
  }
211316
- load(lines) {
211317
- if (lines.length > 0) {
211316
+ load(lines2) {
211317
+ if (lines2.length > 0) {
211318
211318
  const leaves = [];
211319
- for (let i2 = 0;i2 < lines.length; i2++) {
211320
- leaves[i2] = new LineLeaf(lines[i2]);
211319
+ for (let i2 = 0;i2 < lines2.length; i2++) {
211320
+ leaves[i2] = new LineLeaf(lines2[i2]);
211321
211321
  }
211322
211322
  this.root = _LineIndex.buildTreeFromBottom(leaves);
211323
211323
  } else {
@@ -211420,18 +211420,18 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
211420
211420
  if (lineMap.length === 0) {
211421
211421
  return { lines: [], lineMap };
211422
211422
  }
211423
- const lines = new Array(lineMap.length);
211423
+ const lines2 = new Array(lineMap.length);
211424
211424
  const lc = lineMap.length - 1;
211425
211425
  for (let lmi = 0;lmi < lc; lmi++) {
211426
- lines[lmi] = text.substring(lineMap[lmi], lineMap[lmi + 1]);
211426
+ lines2[lmi] = text.substring(lineMap[lmi], lineMap[lmi + 1]);
211427
211427
  }
211428
211428
  const endText = text.substring(lineMap[lc]);
211429
211429
  if (endText.length > 0) {
211430
- lines[lc] = endText;
211430
+ lines2[lc] = endText;
211431
211431
  } else {
211432
- lines.pop();
211432
+ lines2.pop();
211433
211433
  }
211434
- return { lines, lineMap };
211434
+ return { lines: lines2, lineMap };
211435
211435
  }
211436
211436
  };
211437
211437
  var LineNode = class _LineNode {
@@ -212511,7 +212511,7 @@ async function* streamBody(e4) {
212511
212511
  }
212512
212512
  }
212513
212513
  }
212514
- async function* split(e4, r3) {
212514
+ async function* split2(e4, r3) {
212515
212515
  var a4 = "";
212516
212516
  var n3;
212517
212517
  for await (var t4 of e4) {
@@ -212545,7 +212545,7 @@ function makeFetchSource(e4, r3, a4) {
212545
212545
  var n5 = "--" + (a6 ? a6[1] : "-");
212546
212546
  var t5 = true;
212547
212547
  var i4;
212548
- for await (var o4 of split(streamBody(r5), `\r
212548
+ for await (var o4 of split2(streamBody(r5), `\r
212549
212549
  ` + n5)) {
212550
212550
  if (t5) {
212551
212551
  t5 = false;
@@ -212578,7 +212578,7 @@ function makeFetchSource(e4, r3, a4) {
212578
212578
  } else if (/text\/event-stream/i.test(o3)) {
212579
212579
  s2 = async function* parseEventStream(e6) {
212580
212580
  var r5;
212581
- for await (var a6 of split(streamBody(e6), `
212581
+ for await (var a6 of split2(streamBody(e6), `
212582
212582
 
212583
212583
  `)) {
212584
212584
  var n5 = a6.match(S);
@@ -259683,7 +259683,7 @@ function pruneCurrentEnv(currentEnv, env2) {
259683
259683
  var package_default = {
259684
259684
  name: "@settlemint/sdk-cli",
259685
259685
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
259686
- version: "1.1.16-pr3067e493",
259686
+ version: "1.1.16-pr5d8ed20a",
259687
259687
  type: "module",
259688
259688
  private: false,
259689
259689
  license: "FSL-1.1-MIT",
@@ -259727,12 +259727,12 @@ var package_default = {
259727
259727
  },
259728
259728
  devDependencies: {
259729
259729
  "@commander-js/extra-typings": "13.1.0",
259730
- "@inquirer/confirm": "5.1.6",
259731
- "@inquirer/input": "4.1.6",
259730
+ "@inquirer/confirm": "5.1.7",
259731
+ "@inquirer/input": "4.1.7",
259732
259732
  "@inquirer/password": "4.0.9",
259733
259733
  "@inquirer/select": "4.0.10",
259734
- "@settlemint/sdk-js": "1.1.16-pr3067e493",
259735
- "@settlemint/sdk-utils": "1.1.16-pr3067e493",
259734
+ "@settlemint/sdk-js": "1.1.16-pr5d8ed20a",
259735
+ "@settlemint/sdk-utils": "1.1.16-pr5d8ed20a",
259736
259736
  "@types/node": "22.13.10",
259737
259737
  "@types/semver": "7.5.8",
259738
259738
  "@types/which": "3.0.4",
@@ -259822,7 +259822,10 @@ var {
259822
259822
  } = import__.default;
259823
259823
 
259824
259824
  // ../../node_modules/@inquirer/core/dist/esm/lib/key.js
259825
+ var isUpKey = (key) => key.name === "up" || key.name === "k" || key.ctrl && key.name === "p";
259826
+ var isDownKey = (key) => key.name === "down" || key.name === "j" || key.ctrl && key.name === "n";
259825
259827
  var isBackspaceKey = (key) => key.name === "backspace";
259828
+ var isNumberKey = (key) => "123456789".includes(key.name);
259826
259829
  var isEnterKey = (key) => key.name === "enter" || key.name === "return";
259827
259830
  // ../../node_modules/@inquirer/core/dist/esm/lib/errors.js
259828
259831
  class AbortPromptError extends Error {
@@ -259992,7 +259995,7 @@ function useEffect(cb, depArray) {
259992
259995
  // ../../node_modules/@inquirer/core/dist/esm/lib/theme.js
259993
259996
  var import_yoctocolors_cjs = __toESM(require_yoctocolors_cjs(), 1);
259994
259997
 
259995
- // ../../node_modules/@inquirer/core/node_modules/@inquirer/figures/dist/esm/index.js
259998
+ // ../../node_modules/@inquirer/figures/dist/esm/index.js
259996
259999
  import process4 from "node:process";
259997
260000
  function isUnicodeSupported2() {
259998
260001
  if (process4.platform !== "win32") {
@@ -260357,11 +260360,22 @@ function usePrefix({ status = "idle", theme }) {
260357
260360
  const iconName = status === "loading" ? "idle" : status;
260358
260361
  return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
260359
260362
  }
260363
+ // ../../node_modules/@inquirer/core/dist/esm/lib/use-memo.js
260364
+ function useMemo(fn, dependencies) {
260365
+ return withPointer((pointer) => {
260366
+ const prev = pointer.get();
260367
+ if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
260368
+ const value = fn();
260369
+ pointer.set({ value, dependencies });
260370
+ return value;
260371
+ }
260372
+ return prev.value;
260373
+ });
260374
+ }
260360
260375
  // ../../node_modules/@inquirer/core/dist/esm/lib/use-ref.js
260361
260376
  function useRef(val) {
260362
260377
  return useState({ current: val })[0];
260363
260378
  }
260364
-
260365
260379
  // ../../node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
260366
260380
  function useKeypress(userHandler) {
260367
260381
  const signal = useRef(userHandler);
@@ -260393,6 +260407,95 @@ function readlineWidth() {
260393
260407
  return import_cli_width.default({ defaultWidth: 80, output: readline().output });
260394
260408
  }
260395
260409
 
260410
+ // ../../node_modules/@inquirer/core/dist/esm/lib/pagination/lines.js
260411
+ function split(content, width) {
260412
+ return breakLines(content, width).split(`
260413
+ `);
260414
+ }
260415
+ function rotate(count, items) {
260416
+ const max = items.length;
260417
+ const offset = (count % max + max) % max;
260418
+ return [...items.slice(offset), ...items.slice(0, offset)];
260419
+ }
260420
+ function lines({ items, width, renderItem, active, position: requested, pageSize }) {
260421
+ const layouts = items.map((item, index) => ({
260422
+ item,
260423
+ index,
260424
+ isActive: index === active
260425
+ }));
260426
+ const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
260427
+ const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split(renderItem(layoutsInPage[index]), width);
260428
+ const pageBuffer = Array.from({ length: pageSize });
260429
+ const activeItem = renderItemAt(requested).slice(0, pageSize);
260430
+ const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
260431
+ pageBuffer.splice(position, activeItem.length, ...activeItem);
260432
+ let bufferPointer = position + activeItem.length;
260433
+ let layoutPointer = requested + 1;
260434
+ while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
260435
+ for (const line of renderItemAt(layoutPointer)) {
260436
+ pageBuffer[bufferPointer++] = line;
260437
+ if (bufferPointer >= pageSize)
260438
+ break;
260439
+ }
260440
+ layoutPointer++;
260441
+ }
260442
+ bufferPointer = position - 1;
260443
+ layoutPointer = requested - 1;
260444
+ while (bufferPointer >= 0 && layoutPointer >= 0) {
260445
+ for (const line of renderItemAt(layoutPointer).reverse()) {
260446
+ pageBuffer[bufferPointer--] = line;
260447
+ if (bufferPointer < 0)
260448
+ break;
260449
+ }
260450
+ layoutPointer--;
260451
+ }
260452
+ return pageBuffer.filter((line) => typeof line === "string");
260453
+ }
260454
+
260455
+ // ../../node_modules/@inquirer/core/dist/esm/lib/pagination/position.js
260456
+ function finite({ active, pageSize, total }) {
260457
+ const middle = Math.floor(pageSize / 2);
260458
+ if (total <= pageSize || active < middle)
260459
+ return active;
260460
+ if (active >= total - middle)
260461
+ return active + pageSize - total;
260462
+ return middle;
260463
+ }
260464
+ function infinite({ active, lastActive, total, pageSize, pointer }) {
260465
+ if (total <= pageSize)
260466
+ return active;
260467
+ if (lastActive < active && active - lastActive < pageSize) {
260468
+ return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
260469
+ }
260470
+ return pointer;
260471
+ }
260472
+
260473
+ // ../../node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
260474
+ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
260475
+ const state = useRef({ position: 0, lastActive: 0 });
260476
+ const position = loop ? infinite({
260477
+ active,
260478
+ lastActive: state.current.lastActive,
260479
+ total: items.length,
260480
+ pageSize,
260481
+ pointer: state.current.position
260482
+ }) : finite({
260483
+ active,
260484
+ total: items.length,
260485
+ pageSize
260486
+ });
260487
+ state.current.position = position;
260488
+ state.current.lastActive = active;
260489
+ return lines({
260490
+ items,
260491
+ width: readlineWidth(),
260492
+ renderItem,
260493
+ active,
260494
+ position,
260495
+ pageSize
260496
+ }).join(`
260497
+ `);
260498
+ }
260396
260499
  // ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
260397
260500
  var import_mute_stream = __toESM(require_lib(), 1);
260398
260501
  import * as readline2 from "node:readline";
@@ -260624,12 +260727,11 @@ function cursorDown(n) {
260624
260727
  }
260625
260728
 
260626
260729
  class ScreenManager {
260627
- rl;
260628
260730
  height = 0;
260629
260731
  extraLinesUnderPrompt = 0;
260630
260732
  cursorPos;
260733
+ rl;
260631
260734
  constructor(rl) {
260632
- this.rl = rl;
260633
260735
  this.rl = rl;
260634
260736
  this.cursorPos = rl.getCursorPos();
260635
260737
  }
@@ -260699,22 +260801,22 @@ class PromisePolyfill extends Promise {
260699
260801
  // ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
260700
260802
  function getCallSites() {
260701
260803
  const _prepareStackTrace = Error.prepareStackTrace;
260804
+ let result = [];
260702
260805
  try {
260703
- let result = [];
260704
260806
  Error.prepareStackTrace = (_, callSites) => {
260705
260807
  const callSitesWithoutCurrent = callSites.slice(1);
260706
260808
  result = callSitesWithoutCurrent;
260707
260809
  return callSitesWithoutCurrent;
260708
260810
  };
260709
260811
  new Error().stack;
260812
+ } catch {
260710
260813
  return result;
260711
- } finally {
260712
- Error.prepareStackTrace = _prepareStackTrace;
260713
260814
  }
260815
+ Error.prepareStackTrace = _prepareStackTrace;
260816
+ return result;
260714
260817
  }
260715
260818
  function createPrompt(view) {
260716
260819
  const callSites = getCallSites();
260717
- const callerFilename = callSites[1]?.getFileName?.();
260718
260820
  const prompt = (config3, context = {}) => {
260719
260821
  const { input = process.stdin, signal } = context;
260720
260822
  const cleanups = new Set;
@@ -260753,6 +260855,7 @@ function createPrompt(view) {
260753
260855
  setImmediate(() => resolve(value));
260754
260856
  });
260755
260857
  if (nextView === undefined) {
260858
+ const callerFilename = callSites[1]?.getFileName?.();
260756
260859
  throw new Error(`Prompt functions must return a string.
260757
260860
  at ${callerFilename}`);
260758
260861
  }
@@ -260778,6 +260881,20 @@ function createPrompt(view) {
260778
260881
  };
260779
260882
  return prompt;
260780
260883
  }
260884
+ // ../../node_modules/@inquirer/core/dist/esm/lib/Separator.js
260885
+ var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
260886
+ class Separator {
260887
+ separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
260888
+ type = "separator";
260889
+ constructor(separator) {
260890
+ if (separator) {
260891
+ this.separator = separator;
260892
+ }
260893
+ }
260894
+ static isSeparator(choice) {
260895
+ return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
260896
+ }
260897
+ }
260781
260898
  // ../utils/dist/terminal.mjs
260782
260899
  import { spawn } from "node:child_process";
260783
260900
  var import_console_table_printer2 = __toESM(require_dist2(), 1);
@@ -265054,13 +265171,560 @@ async function subgraphNamePrompt({
265054
265171
  return sanitizeName(subgraphName);
265055
265172
  }
265056
265173
 
265057
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/key.js
265058
- var isUpKey = (key2) => key2.name === "up" || key2.name === "k" || key2.ctrl && key2.name === "p";
265059
- var isDownKey = (key2) => key2.name === "down" || key2.name === "j" || key2.ctrl && key2.name === "n";
265060
- var isBackspaceKey2 = (key2) => key2.name === "backspace";
265061
- var isNumberKey = (key2) => "123456789".includes(key2.name);
265174
+ // ../../node_modules/@inquirer/select/dist/esm/index.js
265175
+ var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
265176
+ var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
265177
+ var selectTheme = {
265178
+ icon: { cursor: esm_default.pointer },
265179
+ style: {
265180
+ disabled: (text2) => import_yoctocolors_cjs3.default.dim(`- ${text2}`),
265181
+ description: (text2) => import_yoctocolors_cjs3.default.cyan(text2)
265182
+ },
265183
+ helpMode: "auto"
265184
+ };
265185
+ function isSelectable(item) {
265186
+ return !Separator.isSeparator(item) && !item.disabled;
265187
+ }
265188
+ function normalizeChoices(choices) {
265189
+ return choices.map((choice) => {
265190
+ if (Separator.isSeparator(choice))
265191
+ return choice;
265192
+ if (typeof choice === "string") {
265193
+ return {
265194
+ value: choice,
265195
+ name: choice,
265196
+ short: choice,
265197
+ disabled: false
265198
+ };
265199
+ }
265200
+ const name3 = choice.name ?? String(choice.value);
265201
+ return {
265202
+ value: choice.value,
265203
+ name: name3,
265204
+ description: choice.description,
265205
+ short: choice.short ?? name3,
265206
+ disabled: choice.disabled ?? false
265207
+ };
265208
+ });
265209
+ }
265210
+ var esm_default3 = createPrompt((config3, done) => {
265211
+ const { loop = true, pageSize = 7 } = config3;
265212
+ const firstRender = useRef(true);
265213
+ const theme = makeTheme(selectTheme, config3.theme);
265214
+ const [status, setStatus] = useState("idle");
265215
+ const prefix = usePrefix({ status, theme });
265216
+ const searchTimeoutRef = useRef();
265217
+ const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
265218
+ const bounds = useMemo(() => {
265219
+ const first = items.findIndex(isSelectable);
265220
+ const last = items.findLastIndex(isSelectable);
265221
+ if (first === -1) {
265222
+ throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
265223
+ }
265224
+ return { first, last };
265225
+ }, [items]);
265226
+ const defaultItemIndex = useMemo(() => {
265227
+ if (!("default" in config3))
265228
+ return -1;
265229
+ return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
265230
+ }, [config3.default, items]);
265231
+ const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
265232
+ const selectedChoice = items[active];
265233
+ useKeypress((key2, rl) => {
265234
+ clearTimeout(searchTimeoutRef.current);
265235
+ if (isEnterKey(key2)) {
265236
+ setStatus("done");
265237
+ done(selectedChoice.value);
265238
+ } else if (isUpKey(key2) || isDownKey(key2)) {
265239
+ rl.clearLine(0);
265240
+ if (loop || isUpKey(key2) && active !== bounds.first || isDownKey(key2) && active !== bounds.last) {
265241
+ const offset = isUpKey(key2) ? -1 : 1;
265242
+ let next = active;
265243
+ do {
265244
+ next = (next + offset + items.length) % items.length;
265245
+ } while (!isSelectable(items[next]));
265246
+ setActive(next);
265247
+ }
265248
+ } else if (isNumberKey(key2)) {
265249
+ rl.clearLine(0);
265250
+ const position = Number(key2.name) - 1;
265251
+ const item = items[position];
265252
+ if (item != null && isSelectable(item)) {
265253
+ setActive(position);
265254
+ }
265255
+ } else if (isBackspaceKey(key2)) {
265256
+ rl.clearLine(0);
265257
+ } else {
265258
+ const searchTerm = rl.line.toLowerCase();
265259
+ const matchIndex = items.findIndex((item) => {
265260
+ if (Separator.isSeparator(item) || !isSelectable(item))
265261
+ return false;
265262
+ return item.name.toLowerCase().startsWith(searchTerm);
265263
+ });
265264
+ if (matchIndex !== -1) {
265265
+ setActive(matchIndex);
265266
+ }
265267
+ searchTimeoutRef.current = setTimeout(() => {
265268
+ rl.clearLine(0);
265269
+ }, 700);
265270
+ }
265271
+ });
265272
+ useEffect(() => () => {
265273
+ clearTimeout(searchTimeoutRef.current);
265274
+ }, []);
265275
+ const message = theme.style.message(config3.message, status);
265276
+ let helpTipTop = "";
265277
+ let helpTipBottom = "";
265278
+ if (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current) {
265279
+ firstRender.current = false;
265280
+ if (items.length > pageSize) {
265281
+ helpTipBottom = `
265282
+ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
265283
+ } else {
265284
+ helpTipTop = theme.style.help("(Use arrow keys)");
265285
+ }
265286
+ }
265287
+ const page = usePagination({
265288
+ items,
265289
+ active,
265290
+ renderItem({ item, isActive }) {
265291
+ if (Separator.isSeparator(item)) {
265292
+ return ` ${item.separator}`;
265293
+ }
265294
+ if (item.disabled) {
265295
+ const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
265296
+ return theme.style.disabled(`${item.name} ${disabledLabel}`);
265297
+ }
265298
+ const color = isActive ? theme.style.highlight : (x6) => x6;
265299
+ const cursor = isActive ? theme.icon.cursor : ` `;
265300
+ return color(`${cursor} ${item.name}`);
265301
+ },
265302
+ pageSize,
265303
+ loop
265304
+ });
265305
+ if (status === "done") {
265306
+ return `${prefix} ${message} ${theme.style.answer(selectedChoice.short)}`;
265307
+ }
265308
+ const choiceDescription = selectedChoice.description ? `
265309
+ ${theme.style.description(selectedChoice.description)}` : ``;
265310
+ return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
265311
+ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes2.default.cursorHide}`;
265312
+ });
265313
+
265314
+ // src/prompts/smart-contract-set/subgraph.prompt.ts
265315
+ var ALL = "All";
265316
+ var NEW = "New subgraph";
265317
+ async function subgraphPrompt({
265318
+ env: env2,
265319
+ accept,
265320
+ message,
265321
+ allowAll = false,
265322
+ allowNew = false,
265323
+ isCi = is_in_ci_default
265324
+ }) {
265325
+ const autoAccept = isCi || !!accept;
265326
+ const subgraphNames = env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.map((endpoint) => endpoint.split("/").pop()).filter(Boolean) ?? [];
265327
+ if (autoAccept) {
265328
+ return allowAll ? subgraphNames : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ? [env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH] : [];
265329
+ }
265330
+ if (subgraphNames.length === 0) {
265331
+ cancel2("No subgraphs found");
265332
+ }
265333
+ if (subgraphNames.length === 1) {
265334
+ return subgraphNames;
265335
+ }
265336
+ const choices = subgraphNames.slice().sort();
265337
+ if (allowAll) {
265338
+ choices.unshift(ALL);
265339
+ }
265340
+ if (allowNew) {
265341
+ choices.unshift(NEW);
265342
+ }
265343
+ let defaultChoice;
265344
+ if (allowAll) {
265345
+ defaultChoice = ALL;
265346
+ } else if (allowNew) {
265347
+ defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? NEW;
265348
+ } else {
265349
+ defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? subgraphNames[0];
265350
+ }
265351
+ const subgraphName = await esm_default3({
265352
+ message,
265353
+ choices: choices.map((name3) => ({
265354
+ name: name3,
265355
+ value: name3
265356
+ })),
265357
+ default: defaultChoice
265358
+ });
265359
+ if (!subgraphName) {
265360
+ cancel2("No subgraph selected");
265361
+ }
265362
+ if (subgraphName === NEW) {
265363
+ const newSubgraphName = await subgraphNamePrompt({
265364
+ defaultName: "",
265365
+ env: env2,
265366
+ accept: autoAccept
265367
+ });
265368
+ if (!newSubgraphName) {
265369
+ return [];
265370
+ }
265371
+ return [newSubgraphName];
265372
+ }
265373
+ return subgraphName === ALL ? subgraphNames : [subgraphName];
265374
+ }
265375
+
265376
+ // src/utils/commands/create-examples.ts
265377
+ function createExamples(examples) {
265378
+ return `
265379
+ Examples:
265380
+
265381
+ ${examples.map(({ description, command, commandPrefix }) => {
265382
+ return ` # ${description}
265383
+ $ ${commandPrefix ?? ""}settlemint ${command}`;
265384
+ }).join(`
265385
+
265386
+ `)}`;
265387
+ }
265388
+
265389
+ // src/commands/codegen/codegen-blockscout.ts
265390
+ import { rm as rm2, writeFile as writeFile6 } from "node:fs/promises";
265391
+ import { basename, resolve as resolve5 } from "node:path";
265392
+ var PACKAGE_NAME4 = "@settlemint/sdk-blockscout";
265393
+ async function codegenBlockscout(env2) {
265394
+ const endpoint = env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT;
265395
+ if (!endpoint) {
265396
+ return;
265397
+ }
265398
+ const accessToken = await getApplicationOrPersonalAccessToken({
265399
+ env: env2,
265400
+ instance: env2.SETTLEMINT_INSTANCE,
265401
+ prefer: "application"
265402
+ });
265403
+ if (!accessToken) {
265404
+ return;
265405
+ }
265406
+ const introspectionJsonPath = resolve5(process.cwd(), "__blockscout-introspection__.json");
265407
+ try {
265408
+ const data = await graphqlFetchWithRetry(endpoint, {
265409
+ method: "POST",
265410
+ headers: {
265411
+ "x-auth-token": accessToken,
265412
+ "Content-Type": "application/json"
265413
+ },
265414
+ body: JSON.stringify({
265415
+ query: `
265416
+ query IntrospectionQuery {
265417
+ __schema {
265418
+ queryType { name }
265419
+ mutationType { name }
265420
+ types {
265421
+ ...FullType
265422
+ }
265423
+ directives {
265424
+ name
265425
+ description
265426
+ locations
265427
+ args {
265428
+ ...InputValue
265429
+ }
265430
+ }
265431
+ }
265432
+ }
265433
+
265434
+ fragment FullType on __Type {
265435
+ kind
265436
+ name
265437
+ description
265438
+ fields(includeDeprecated: true) {
265439
+ name
265440
+ description
265441
+ args {
265442
+ ...InputValue
265443
+ }
265444
+ type {
265445
+ ...TypeRef
265446
+ }
265447
+ isDeprecated
265448
+ deprecationReason
265449
+ }
265450
+ inputFields {
265451
+ ...InputValue
265452
+ }
265453
+ interfaces {
265454
+ ...TypeRef
265455
+ }
265456
+ enumValues(includeDeprecated: true) {
265457
+ name
265458
+ description
265459
+ isDeprecated
265460
+ deprecationReason
265461
+ }
265462
+ possibleTypes {
265463
+ ...TypeRef
265464
+ }
265465
+ }
265466
+
265467
+ fragment InputValue on __InputValue {
265468
+ name
265469
+ description
265470
+ type { ...TypeRef }
265471
+ defaultValue
265472
+ }
265473
+
265474
+ fragment TypeRef on __Type {
265475
+ kind
265476
+ name
265477
+ ofType {
265478
+ kind
265479
+ name
265480
+ ofType {
265481
+ kind
265482
+ name
265483
+ ofType {
265484
+ kind
265485
+ name
265486
+ ofType {
265487
+ kind
265488
+ name
265489
+ ofType {
265490
+ kind
265491
+ name
265492
+ ofType {
265493
+ kind
265494
+ name
265495
+ ofType {
265496
+ kind
265497
+ name
265498
+ ofType {
265499
+ kind
265500
+ name
265501
+ ofType {
265502
+ kind
265503
+ name
265504
+ }
265505
+ }
265506
+ }
265507
+ }
265508
+ }
265509
+ }
265510
+ }
265511
+ }
265512
+ }
265513
+ }
265514
+ `
265515
+ })
265516
+ });
265517
+ await writeFile6(introspectionJsonPath, JSON.stringify(data));
265518
+ } catch (err) {
265519
+ const error5 = err;
265520
+ note(`GraphQL endpoint '${endpoint}' is not reachable: ${error5.message}`, "warn");
265521
+ return;
265522
+ }
265523
+ try {
265524
+ await generateSchema({
265525
+ input: basename(introspectionJsonPath),
265526
+ output: "blockscout-schema.graphql",
265527
+ tsconfig: undefined,
265528
+ headers: undefined
265529
+ });
265530
+ } finally {
265531
+ await rm2(introspectionJsonPath);
265532
+ }
265533
+ const template = `import { createBlockscoutClient } from "${PACKAGE_NAME4}";
265534
+ import type { introspection } from "@schemas/blockscout-env";
265535
+
265536
+ export const { client: blockscoutClient, graphql: blockscoutGraphql } = createBlockscoutClient<{
265537
+ introspection: introspection;
265538
+ disableMasking: true;
265539
+ scalars: {
265540
+ /** 40 hex characters (160 bits/20 bytes) derived from the public key, prefixed with 0x */
265541
+ AddressHash: string;
265542
+ /** Unpadded big-endian hexadecimal number where each byte pair maps to underlying binary */
265543
+ Data: string;
265544
+ /** ISO8601 formatted UTC datetime string */
265545
+ DateTime: string;
265546
+ /** String representation of a signed double-precision decimal value */
265547
+ Decimal: string;
265548
+ /** 32-byte KECCAK-256 hash */
265549
+ FullHash: string;
265550
+ /** Arbitrary JSON string data as UTF-8 */
265551
+ Json: string;
265552
+ /** 16 hex character (128 bits/8 bytes) nonce from Proof-of-Work */
265553
+ NonceHash: string;
265554
+ /** Smallest fractional unit of Ether, represented as a string for integer math */
265555
+ Wei: string;
265556
+ };
265557
+ }>({
265558
+ instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT!,
265559
+ accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!, // undefined in browser, by design to not leak the secrets
265560
+ });
265561
+
265562
+ export const blockscoutUiEndpoint = process.env.SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT!;`;
265563
+ await writeTemplate(template, "/lib/settlemint", "blockscout.ts");
265564
+ const projectDir = await projectRoot3();
265565
+ if (!await isPackageInstalled(PACKAGE_NAME4, projectDir)) {
265566
+ await installDependencies(PACKAGE_NAME4, projectDir);
265567
+ }
265568
+ }
265569
+
265570
+ // src/commands/codegen/codegen-ipfs.ts
265571
+ var PACKAGE_NAME5 = "@settlemint/sdk-ipfs";
265572
+ function shouldCodegenIpfs(env2) {
265573
+ return !!env2.SETTLEMINT_IPFS_API_ENDPOINT;
265574
+ }
265575
+ async function codegenIpfs(env2) {
265576
+ const endpoint = env2.SETTLEMINT_IPFS_API_ENDPOINT;
265577
+ if (!endpoint) {
265578
+ return;
265579
+ }
265580
+ const clientTemplate = `import { createServerIpfsClient } from "${PACKAGE_NAME5}";
265581
+
265582
+ export const { client } = createServerIpfsClient({
265583
+ instance: process.env.SETTLEMINT_IPFS_API_ENDPOINT!,
265584
+ accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
265585
+ });`;
265586
+ await writeTemplate(clientTemplate, "/lib/settlemint", "ipfs.ts");
265587
+ const projectDir = await projectRoot3();
265588
+ if (!await isPackageInstalled(PACKAGE_NAME5, projectDir)) {
265589
+ await installDependencies(PACKAGE_NAME5, projectDir);
265590
+ }
265591
+ }
265592
+
265593
+ // src/commands/codegen/codegen-minio.ts
265594
+ var PACKAGE_NAME6 = "@settlemint/sdk-minio";
265595
+ function shouldCodegenMinio(env2) {
265596
+ return !!(env2.SETTLEMINT_MINIO_ENDPOINT && env2.SETTLEMINT_MINIO_ACCESS_KEY && env2.SETTLEMINT_MINIO_SECRET_KEY);
265597
+ }
265598
+ async function codegenMinio(env2) {
265599
+ const endpoint = env2.SETTLEMINT_MINIO_ENDPOINT;
265600
+ if (!endpoint) {
265601
+ return;
265602
+ }
265603
+ const clientTemplate = `import { createServerMinioClient } from "${PACKAGE_NAME6}";
265604
+
265605
+ export const { client } = createServerMinioClient({
265606
+ instance: process.env.SETTLEMINT_MINIO_ENDPOINT!,
265607
+ accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
265608
+ accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY!,
265609
+ secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY!
265610
+ });`;
265611
+ await writeTemplate(clientTemplate, "/lib/settlemint", "minio.ts");
265612
+ const projectDir = await projectRoot3();
265613
+ if (!await isPackageInstalled(PACKAGE_NAME6, projectDir)) {
265614
+ await installDependencies(PACKAGE_NAME6, projectDir);
265615
+ }
265616
+ }
265617
+
265618
+ // src/commands/codegen.ts
265619
+ function codegenCommand() {
265620
+ return new Command("codegen").option("--prod", "Connect to your production environment").option("--thegraph-subgraph-names <subgraph-names...>", "The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)").description("Generate GraphQL and REST types and queries").usage(createExamples([
265621
+ {
265622
+ description: "Generate GraphQL types and queries for your dApp",
265623
+ command: "codegen"
265624
+ },
265625
+ {
265626
+ description: "Generate GraphQL types and queries for specific TheGraph subgraphs",
265627
+ command: "codegen --thegraph-subgraph-names subgraph1 subgraph2"
265628
+ }
265629
+ ])).action(async ({ prod, thegraphSubgraphNames }) => {
265630
+ intro("Generating GraphQL types and queries for your dApp");
265631
+ const env2 = await loadEnv(true, !!prod);
265632
+ if (!Array.isArray(thegraphSubgraphNames)) {
265633
+ thegraphSubgraphNames = await subgraphPrompt({
265634
+ env: env2,
265635
+ accept: true,
265636
+ message: "Which The Graph subgraph do you want to generate types for?",
265637
+ allowAll: true
265638
+ });
265639
+ }
265640
+ const { hasura, portal, thegraph, blockscout } = await spinner({
265641
+ startMessage: "Testing configured GraphQL schema",
265642
+ task: async () => {
265643
+ return codegenTsconfig(env2, thegraphSubgraphNames);
265644
+ },
265645
+ stopMessage: "Tested GraphQL schemas"
265646
+ });
265647
+ if (hasura) {
265648
+ note("Generating Hasura resources");
265649
+ await codegenHasura(env2);
265650
+ }
265651
+ if (portal) {
265652
+ note("Generating Portal resources");
265653
+ await codegenPortal(env2);
265654
+ }
265655
+ if (thegraph) {
265656
+ note("Generating TheGraph resources");
265657
+ await codegenTheGraph(env2, thegraphSubgraphNames);
265658
+ }
265659
+ if (blockscout) {
265660
+ note("Generating Blockscout resources");
265661
+ await codegenBlockscout(env2);
265662
+ }
265663
+ if (shouldCodegenMinio(env2)) {
265664
+ note("Generating Minio resources");
265665
+ await codegenMinio(env2);
265666
+ }
265667
+ if (shouldCodegenIpfs(env2)) {
265668
+ note("Generating IPFS resources");
265669
+ await codegenIpfs(env2);
265670
+ }
265671
+ if (hasura || portal || thegraph || blockscout) {
265672
+ await generateOutput({
265673
+ output: undefined,
265674
+ tsconfig: undefined
265675
+ });
265676
+ }
265677
+ outro("Codegen complete");
265678
+ });
265679
+ }
265680
+
265681
+ // ../../node_modules/@inquirer/confirm/dist/esm/index.js
265682
+ function getBooleanValue(value4, defaultValue) {
265683
+ let answer = defaultValue !== false;
265684
+ if (/^(y|yes)/i.test(value4))
265685
+ answer = true;
265686
+ else if (/^(n|no)/i.test(value4))
265687
+ answer = false;
265688
+ return answer;
265689
+ }
265690
+ function boolToString(value4) {
265691
+ return value4 ? "Yes" : "No";
265692
+ }
265693
+ var esm_default4 = createPrompt((config3, done) => {
265694
+ const { transformer = boolToString } = config3;
265695
+ const [status, setStatus] = useState("idle");
265696
+ const [value4, setValue] = useState("");
265697
+ const theme = makeTheme(config3.theme);
265698
+ const prefix = usePrefix({ status, theme });
265699
+ useKeypress((key2, rl) => {
265700
+ if (isEnterKey(key2)) {
265701
+ const answer = getBooleanValue(value4, config3.default);
265702
+ setValue(transformer(answer));
265703
+ setStatus("done");
265704
+ done(answer);
265705
+ } else if (key2.name === "tab") {
265706
+ const answer = boolToString(!getBooleanValue(value4, config3.default));
265707
+ rl.clearLine(0);
265708
+ rl.write(answer);
265709
+ setValue(answer);
265710
+ } else {
265711
+ setValue(rl.line);
265712
+ }
265713
+ });
265714
+ let formattedValue = value4;
265715
+ let defaultValue = "";
265716
+ if (status === "done") {
265717
+ formattedValue = theme.style.answer(value4);
265718
+ } else {
265719
+ defaultValue = ` ${theme.style.defaultAnswer(config3.default === false ? "y/N" : "Y/n")}`;
265720
+ }
265721
+ const message = theme.style.message(config3.message, status);
265722
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
265723
+ });
265724
+
265725
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/key.js
265062
265726
  var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
265063
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/errors.js
265727
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/errors.js
265064
265728
  class AbortPromptError2 extends Error {
265065
265729
  name = "AbortPromptError";
265066
265730
  message = "Prompt was aborted";
@@ -265086,10 +265750,10 @@ class HookError2 extends Error {
265086
265750
  class ValidationError2 extends Error {
265087
265751
  name = "ValidationError";
265088
265752
  }
265089
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
265753
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
265090
265754
  import { AsyncResource as AsyncResource5 } from "node:async_hooks";
265091
265755
 
265092
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
265756
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
265093
265757
  import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
265094
265758
  var hookStorage2 = new AsyncLocalStorage2;
265095
265759
  function createStore2(rl) {
@@ -265195,7 +265859,7 @@ var effectScheduler2 = {
265195
265859
  }
265196
265860
  };
265197
265861
 
265198
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-state.js
265862
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-state.js
265199
265863
  function useState2(defaultValue) {
265200
265864
  return withPointer2((pointer) => {
265201
265865
  const setFn = (newValue) => {
@@ -265213,7 +265877,7 @@ function useState2(defaultValue) {
265213
265877
  });
265214
265878
  }
265215
265879
 
265216
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
265880
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
265217
265881
  function useEffect2(cb, depArray) {
265218
265882
  withPointer2((pointer) => {
265219
265883
  const oldDeps = pointer.get();
@@ -265225,10 +265889,10 @@ function useEffect2(cb, depArray) {
265225
265889
  });
265226
265890
  }
265227
265891
 
265228
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/theme.js
265229
- var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
265892
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/theme.js
265893
+ var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
265230
265894
 
265231
- // ../../node_modules/@inquirer/figures/dist/esm/index.js
265895
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/node_modules/@inquirer/figures/dist/esm/index.js
265232
265896
  import process8 from "node:process";
265233
265897
  function isUnicodeSupported3() {
265234
265898
  if (process8.platform !== "win32") {
@@ -265511,31 +266175,31 @@ var fallbackSymbols2 = {
265511
266175
  };
265512
266176
  var shouldUseMain2 = isUnicodeSupported3();
265513
266177
  var figures2 = shouldUseMain2 ? mainSymbols2 : fallbackSymbols2;
265514
- var esm_default3 = figures2;
266178
+ var esm_default5 = figures2;
265515
266179
  var replacements2 = Object.entries(specialMainSymbols2);
265516
266180
 
265517
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/theme.js
266181
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/theme.js
265518
266182
  var defaultTheme2 = {
265519
266183
  prefix: {
265520
- idle: import_yoctocolors_cjs2.default.blue("?"),
265521
- done: import_yoctocolors_cjs2.default.green(esm_default3.tick)
266184
+ idle: import_yoctocolors_cjs4.default.blue("?"),
266185
+ done: import_yoctocolors_cjs4.default.green(esm_default5.tick)
265522
266186
  },
265523
266187
  spinner: {
265524
266188
  interval: 80,
265525
- frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs2.default.yellow(frame))
266189
+ frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs4.default.yellow(frame))
265526
266190
  },
265527
266191
  style: {
265528
- answer: import_yoctocolors_cjs2.default.cyan,
265529
- message: import_yoctocolors_cjs2.default.bold,
265530
- error: (text2) => import_yoctocolors_cjs2.default.red(`> ${text2}`),
265531
- defaultAnswer: (text2) => import_yoctocolors_cjs2.default.dim(`(${text2})`),
265532
- help: import_yoctocolors_cjs2.default.dim,
265533
- highlight: import_yoctocolors_cjs2.default.cyan,
265534
- key: (text2) => import_yoctocolors_cjs2.default.cyan(import_yoctocolors_cjs2.default.bold(`<${text2}>`))
266192
+ answer: import_yoctocolors_cjs4.default.cyan,
266193
+ message: import_yoctocolors_cjs4.default.bold,
266194
+ error: (text2) => import_yoctocolors_cjs4.default.red(`> ${text2}`),
266195
+ defaultAnswer: (text2) => import_yoctocolors_cjs4.default.dim(`(${text2})`),
266196
+ help: import_yoctocolors_cjs4.default.dim,
266197
+ highlight: import_yoctocolors_cjs4.default.cyan,
266198
+ key: (text2) => import_yoctocolors_cjs4.default.cyan(import_yoctocolors_cjs4.default.bold(`<${text2}>`))
265535
266199
  }
265536
266200
  };
265537
266201
 
265538
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
266202
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
265539
266203
  function isPlainObject3(value4) {
265540
266204
  if (typeof value4 !== "object" || value4 === null)
265541
266205
  return false;
@@ -265563,7 +266227,7 @@ function makeTheme2(...themes) {
265563
266227
  return deepMerge3(...themesToMerge);
265564
266228
  }
265565
266229
 
265566
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
266230
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
265567
266231
  function usePrefix2({ status = "idle", theme }) {
265568
266232
  const [showLoader, setShowLoader] = useState2(false);
265569
266233
  const [tick, setTick] = useState2(0);
@@ -265593,23 +266257,12 @@ function usePrefix2({ status = "idle", theme }) {
265593
266257
  const iconName = status === "loading" ? "idle" : status;
265594
266258
  return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
265595
266259
  }
265596
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
265597
- function useMemo(fn, dependencies) {
265598
- return withPointer2((pointer) => {
265599
- const prev = pointer.get();
265600
- if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i6) => dep !== dependencies[i6])) {
265601
- const value4 = fn();
265602
- pointer.set({ value: value4, dependencies });
265603
- return value4;
265604
- }
265605
- return prev.value;
265606
- });
265607
- }
265608
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
266260
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
265609
266261
  function useRef2(val) {
265610
266262
  return useState2({ current: val })[0];
265611
266263
  }
265612
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
266264
+
266265
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
265613
266266
  function useKeypress2(userHandler) {
265614
266267
  const signal = useRef2(userHandler);
265615
266268
  signal.current = userHandler;
@@ -265627,7 +266280,7 @@ function useKeypress2(userHandler) {
265627
266280
  };
265628
266281
  }, []);
265629
266282
  }
265630
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/utils.js
266283
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/utils.js
265631
266284
  var import_cli_width2 = __toESM(require_cli_width(), 1);
265632
266285
  var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
265633
266286
  function breakLines2(content, width) {
@@ -265640,117 +266293,29 @@ function readlineWidth2() {
265640
266293
  return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
265641
266294
  }
265642
266295
 
265643
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.js
265644
- function split2(content, width) {
265645
- return breakLines2(content, width).split(`
265646
- `);
265647
- }
265648
- function rotate(count, items) {
265649
- const max = items.length;
265650
- const offset = (count % max + max) % max;
265651
- return [...items.slice(offset), ...items.slice(0, offset)];
265652
- }
265653
- function lines({ items, width, renderItem, active, position: requested, pageSize }) {
265654
- const layouts = items.map((item, index) => ({
265655
- item,
265656
- index,
265657
- isActive: index === active
265658
- }));
265659
- const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
265660
- const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split2(renderItem(layoutsInPage[index]), width);
265661
- const pageBuffer = Array.from({ length: pageSize });
265662
- const activeItem = renderItemAt(requested).slice(0, pageSize);
265663
- const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
265664
- pageBuffer.splice(position, activeItem.length, ...activeItem);
265665
- let bufferPointer = position + activeItem.length;
265666
- let layoutPointer = requested + 1;
265667
- while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
265668
- for (const line of renderItemAt(layoutPointer)) {
265669
- pageBuffer[bufferPointer++] = line;
265670
- if (bufferPointer >= pageSize)
265671
- break;
265672
- }
265673
- layoutPointer++;
265674
- }
265675
- bufferPointer = position - 1;
265676
- layoutPointer = requested - 1;
265677
- while (bufferPointer >= 0 && layoutPointer >= 0) {
265678
- for (const line of renderItemAt(layoutPointer).reverse()) {
265679
- pageBuffer[bufferPointer--] = line;
265680
- if (bufferPointer < 0)
265681
- break;
265682
- }
265683
- layoutPointer--;
265684
- }
265685
- return pageBuffer.filter((line) => typeof line === "string");
265686
- }
265687
-
265688
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/position.js
265689
- function finite({ active, pageSize, total }) {
265690
- const middle = Math.floor(pageSize / 2);
265691
- if (total <= pageSize || active < middle)
265692
- return active;
265693
- if (active >= total - middle)
265694
- return active + pageSize - total;
265695
- return middle;
265696
- }
265697
- function infinite({ active, lastActive, total, pageSize, pointer }) {
265698
- if (total <= pageSize)
265699
- return active;
265700
- if (lastActive < active && active - lastActive < pageSize) {
265701
- return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
265702
- }
265703
- return pointer;
265704
- }
265705
-
265706
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
265707
- function usePagination({ items, active, renderItem, pageSize, loop = true }) {
265708
- const state = useRef2({ position: 0, lastActive: 0 });
265709
- const position = loop ? infinite({
265710
- active,
265711
- lastActive: state.current.lastActive,
265712
- total: items.length,
265713
- pageSize,
265714
- pointer: state.current.position
265715
- }) : finite({
265716
- active,
265717
- total: items.length,
265718
- pageSize
265719
- });
265720
- state.current.position = position;
265721
- state.current.lastActive = active;
265722
- return lines({
265723
- items,
265724
- width: readlineWidth2(),
265725
- renderItem,
265726
- active,
265727
- position,
265728
- pageSize
265729
- }).join(`
265730
- `);
265731
- }
265732
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
266296
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
265733
266297
  var import_mute_stream2 = __toESM(require_lib(), 1);
265734
266298
  import * as readline4 from "node:readline";
265735
266299
  import { AsyncResource as AsyncResource6 } from "node:async_hooks";
265736
266300
 
265737
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
265738
- var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
266301
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
266302
+ var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
265739
266303
  import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
265740
266304
  var height2 = (content) => content.split(`
265741
266305
  `).length;
265742
266306
  var lastLine2 = (content) => content.split(`
265743
266307
  `).pop() ?? "";
265744
266308
  function cursorDown2(n6) {
265745
- return n6 > 0 ? import_ansi_escapes2.default.cursorDown(n6) : "";
266309
+ return n6 > 0 ? import_ansi_escapes3.default.cursorDown(n6) : "";
265746
266310
  }
265747
266311
 
265748
266312
  class ScreenManager2 {
266313
+ rl;
265749
266314
  height = 0;
265750
266315
  extraLinesUnderPrompt = 0;
265751
266316
  cursorPos;
265752
- rl;
265753
266317
  constructor(rl) {
266318
+ this.rl = rl;
265754
266319
  this.rl = rl;
265755
266320
  this.cursorPos = rl.getCursorPos();
265756
266321
  }
@@ -265780,62 +266345,62 @@ class ScreenManager2 {
265780
266345
  const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
265781
266346
  const bottomContentHeight = promptLineUpDiff + (bottomContent ? height2(bottomContent) : 0);
265782
266347
  if (bottomContentHeight > 0)
265783
- output += import_ansi_escapes2.default.cursorUp(bottomContentHeight);
265784
- output += import_ansi_escapes2.default.cursorTo(this.cursorPos.cols);
265785
- this.write(cursorDown2(this.extraLinesUnderPrompt) + import_ansi_escapes2.default.eraseLines(this.height) + output);
266348
+ output += import_ansi_escapes3.default.cursorUp(bottomContentHeight);
266349
+ output += import_ansi_escapes3.default.cursorTo(this.cursorPos.cols);
266350
+ this.write(cursorDown2(this.extraLinesUnderPrompt) + import_ansi_escapes3.default.eraseLines(this.height) + output);
265786
266351
  this.extraLinesUnderPrompt = bottomContentHeight;
265787
266352
  this.height = height2(output);
265788
266353
  }
265789
266354
  checkCursorPos() {
265790
266355
  const cursorPos = this.rl.getCursorPos();
265791
266356
  if (cursorPos.cols !== this.cursorPos.cols) {
265792
- this.write(import_ansi_escapes2.default.cursorTo(cursorPos.cols));
266357
+ this.write(import_ansi_escapes3.default.cursorTo(cursorPos.cols));
265793
266358
  this.cursorPos = cursorPos;
265794
266359
  }
265795
266360
  }
265796
266361
  done({ clearContent }) {
265797
266362
  this.rl.setPrompt("");
265798
266363
  let output = cursorDown2(this.extraLinesUnderPrompt);
265799
- output += clearContent ? import_ansi_escapes2.default.eraseLines(this.height) : `
266364
+ output += clearContent ? import_ansi_escapes3.default.eraseLines(this.height) : `
265800
266365
  `;
265801
- output += import_ansi_escapes2.default.cursorShow;
266366
+ output += import_ansi_escapes3.default.cursorShow;
265802
266367
  this.write(output);
265803
266368
  this.rl.close();
265804
266369
  }
265805
266370
  }
265806
266371
 
265807
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
266372
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
265808
266373
  class PromisePolyfill2 extends Promise {
265809
266374
  static withResolver() {
265810
- let resolve5;
266375
+ let resolve6;
265811
266376
  let reject;
265812
266377
  const promise = new Promise((res, rej) => {
265813
- resolve5 = res;
266378
+ resolve6 = res;
265814
266379
  reject = rej;
265815
266380
  });
265816
- return { promise, resolve: resolve5, reject };
266381
+ return { promise, resolve: resolve6, reject };
265817
266382
  }
265818
266383
  }
265819
266384
 
265820
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
266385
+ // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
265821
266386
  function getCallSites2() {
265822
266387
  const _prepareStackTrace = Error.prepareStackTrace;
265823
- let result = [];
265824
266388
  try {
266389
+ let result = [];
265825
266390
  Error.prepareStackTrace = (_5, callSites) => {
265826
266391
  const callSitesWithoutCurrent = callSites.slice(1);
265827
266392
  result = callSitesWithoutCurrent;
265828
266393
  return callSitesWithoutCurrent;
265829
266394
  };
265830
266395
  new Error().stack;
265831
- } catch {
265832
266396
  return result;
266397
+ } finally {
266398
+ Error.prepareStackTrace = _prepareStackTrace;
265833
266399
  }
265834
- Error.prepareStackTrace = _prepareStackTrace;
265835
- return result;
265836
266400
  }
265837
266401
  function createPrompt2(view) {
265838
266402
  const callSites = getCallSites2();
266403
+ const callerFilename = callSites[1]?.getFileName?.();
265839
266404
  const prompt = (config3, context = {}) => {
265840
266405
  const { input = process.stdin, signal } = context;
265841
266406
  const cleanups = new Set;
@@ -265847,7 +266412,7 @@ function createPrompt2(view) {
265847
266412
  output
265848
266413
  });
265849
266414
  const screen = new ScreenManager2(rl);
265850
- const { promise, resolve: resolve5, reject } = PromisePolyfill2.withResolver();
266415
+ const { promise, resolve: resolve6, reject } = PromisePolyfill2.withResolver();
265851
266416
  const cancel3 = () => reject(new CancelPromptError2);
265852
266417
  if (signal) {
265853
266418
  const abort = () => reject(new AbortPromptError2({ cause: signal.reason }));
@@ -265871,10 +266436,9 @@ function createPrompt2(view) {
265871
266436
  cycle(() => {
265872
266437
  try {
265873
266438
  const nextView = view(config3, (value4) => {
265874
- setImmediate(() => resolve5(value4));
266439
+ setImmediate(() => resolve6(value4));
265875
266440
  });
265876
266441
  if (nextView === undefined) {
265877
- const callerFilename = callSites[1]?.getFileName?.();
265878
266442
  throw new Error(`Prompt functions must return a string.
265879
266443
  at ${callerFilename}`);
265880
266444
  }
@@ -265900,585 +266464,20 @@ function createPrompt2(view) {
265900
266464
  };
265901
266465
  return prompt;
265902
266466
  }
265903
- // ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/Separator.js
265904
- var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
265905
- class Separator {
265906
- separator = import_yoctocolors_cjs3.default.dim(Array.from({ length: 15 }).join(esm_default3.line));
265907
- type = "separator";
265908
- constructor(separator) {
265909
- if (separator) {
265910
- this.separator = separator;
265911
- }
265912
- }
265913
- static isSeparator(choice) {
265914
- return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
265915
- }
265916
- }
265917
- // ../../node_modules/@inquirer/select/dist/esm/index.js
265918
- var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
265919
- var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
265920
- var selectTheme = {
265921
- icon: { cursor: esm_default3.pointer },
265922
- style: {
265923
- disabled: (text2) => import_yoctocolors_cjs4.default.dim(`- ${text2}`),
265924
- description: (text2) => import_yoctocolors_cjs4.default.cyan(text2)
265925
- },
265926
- helpMode: "auto"
265927
- };
265928
- function isSelectable(item) {
265929
- return !Separator.isSeparator(item) && !item.disabled;
265930
- }
265931
- function normalizeChoices(choices) {
265932
- return choices.map((choice) => {
265933
- if (Separator.isSeparator(choice))
265934
- return choice;
265935
- if (typeof choice === "string") {
265936
- return {
265937
- value: choice,
265938
- name: choice,
265939
- short: choice,
265940
- disabled: false
265941
- };
265942
- }
265943
- const name3 = choice.name ?? String(choice.value);
265944
- return {
265945
- value: choice.value,
265946
- name: name3,
265947
- description: choice.description,
265948
- short: choice.short ?? name3,
265949
- disabled: choice.disabled ?? false
265950
- };
265951
- });
265952
- }
265953
- var esm_default4 = createPrompt2((config3, done) => {
265954
- const { loop = true, pageSize = 7 } = config3;
265955
- const firstRender = useRef2(true);
265956
- const theme = makeTheme2(selectTheme, config3.theme);
265957
- const [status, setStatus] = useState2("idle");
265958
- const prefix = usePrefix2({ status, theme });
265959
- const searchTimeoutRef = useRef2();
265960
- const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
265961
- const bounds = useMemo(() => {
265962
- const first = items.findIndex(isSelectable);
265963
- const last = items.findLastIndex(isSelectable);
265964
- if (first === -1) {
265965
- throw new ValidationError2("[select prompt] No selectable choices. All choices are disabled.");
265966
- }
265967
- return { first, last };
265968
- }, [items]);
265969
- const defaultItemIndex = useMemo(() => {
265970
- if (!("default" in config3))
265971
- return -1;
265972
- return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
265973
- }, [config3.default, items]);
265974
- const [active, setActive] = useState2(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
265975
- const selectedChoice = items[active];
265976
- useKeypress2((key3, rl) => {
265977
- clearTimeout(searchTimeoutRef.current);
265978
- if (isEnterKey2(key3)) {
265979
- setStatus("done");
265980
- done(selectedChoice.value);
265981
- } else if (isUpKey(key3) || isDownKey(key3)) {
265982
- rl.clearLine(0);
265983
- if (loop || isUpKey(key3) && active !== bounds.first || isDownKey(key3) && active !== bounds.last) {
265984
- const offset = isUpKey(key3) ? -1 : 1;
265985
- let next = active;
265986
- do {
265987
- next = (next + offset + items.length) % items.length;
265988
- } while (!isSelectable(items[next]));
265989
- setActive(next);
265990
- }
265991
- } else if (isNumberKey(key3)) {
265992
- rl.clearLine(0);
265993
- const position = Number(key3.name) - 1;
265994
- const item = items[position];
265995
- if (item != null && isSelectable(item)) {
265996
- setActive(position);
265997
- }
265998
- } else if (isBackspaceKey2(key3)) {
265999
- rl.clearLine(0);
266000
- } else {
266001
- const searchTerm = rl.line.toLowerCase();
266002
- const matchIndex = items.findIndex((item) => {
266003
- if (Separator.isSeparator(item) || !isSelectable(item))
266004
- return false;
266005
- return item.name.toLowerCase().startsWith(searchTerm);
266006
- });
266007
- if (matchIndex !== -1) {
266008
- setActive(matchIndex);
266009
- }
266010
- searchTimeoutRef.current = setTimeout(() => {
266011
- rl.clearLine(0);
266012
- }, 700);
266013
- }
266014
- });
266015
- useEffect2(() => () => {
266016
- clearTimeout(searchTimeoutRef.current);
266017
- }, []);
266018
- const message = theme.style.message(config3.message, status);
266019
- let helpTipTop = "";
266020
- let helpTipBottom = "";
266021
- if (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current) {
266022
- firstRender.current = false;
266023
- if (items.length > pageSize) {
266024
- helpTipBottom = `
266025
- ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
266026
- } else {
266027
- helpTipTop = theme.style.help("(Use arrow keys)");
266028
- }
266029
- }
266030
- const page = usePagination({
266031
- items,
266032
- active,
266033
- renderItem({ item, isActive }) {
266034
- if (Separator.isSeparator(item)) {
266035
- return ` ${item.separator}`;
266036
- }
266037
- if (item.disabled) {
266038
- const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
266039
- return theme.style.disabled(`${item.name} ${disabledLabel}`);
266040
- }
266041
- const color = isActive ? theme.style.highlight : (x6) => x6;
266042
- const cursor = isActive ? theme.icon.cursor : ` `;
266043
- return color(`${cursor} ${item.name}`);
266044
- },
266045
- pageSize,
266046
- loop
266047
- });
266048
- if (status === "done") {
266049
- return `${prefix} ${message} ${theme.style.answer(selectedChoice.short)}`;
266050
- }
266051
- const choiceDescription = selectedChoice.description ? `
266052
- ${theme.style.description(selectedChoice.description)}` : ``;
266053
- return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
266054
- ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`;
266055
- });
266056
-
266057
- // src/prompts/smart-contract-set/subgraph.prompt.ts
266058
- var ALL = "All";
266059
- var NEW = "New subgraph";
266060
- async function subgraphPrompt({
266061
- env: env2,
266062
- accept,
266063
- message,
266064
- allowAll = false,
266065
- allowNew = false,
266066
- isCi = is_in_ci_default
266067
- }) {
266068
- const autoAccept = isCi || !!accept;
266069
- const subgraphNames = env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.map((endpoint) => endpoint.split("/").pop()).filter(Boolean) ?? [];
266070
- if (autoAccept) {
266071
- return allowAll ? subgraphNames : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ? [env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH] : [];
266072
- }
266073
- if (subgraphNames.length === 0) {
266074
- cancel2("No subgraphs found");
266075
- }
266076
- if (subgraphNames.length === 1) {
266077
- return subgraphNames;
266078
- }
266079
- const choices = subgraphNames.slice().sort();
266080
- if (allowAll) {
266081
- choices.unshift(ALL);
266082
- }
266083
- if (allowNew) {
266084
- choices.unshift(NEW);
266085
- }
266086
- let defaultChoice;
266087
- if (allowAll) {
266088
- defaultChoice = ALL;
266089
- } else if (allowNew) {
266090
- defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? NEW;
266091
- } else {
266092
- defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? subgraphNames[0];
266093
- }
266094
- const subgraphName = await esm_default4({
266095
- message,
266096
- choices: choices.map((name3) => ({
266097
- name: name3,
266098
- value: name3
266099
- })),
266100
- default: defaultChoice
266101
- });
266102
- if (!subgraphName) {
266103
- cancel2("No subgraph selected");
266104
- }
266105
- if (subgraphName === NEW) {
266106
- const newSubgraphName = await subgraphNamePrompt({
266107
- defaultName: "",
266108
- env: env2,
266109
- accept: autoAccept
266110
- });
266111
- if (!newSubgraphName) {
266112
- return [];
266113
- }
266114
- return [newSubgraphName];
266115
- }
266116
- return subgraphName === ALL ? subgraphNames : [subgraphName];
266117
- }
266118
-
266119
- // src/utils/commands/create-examples.ts
266120
- function createExamples(examples) {
266121
- return `
266122
- Examples:
266123
-
266124
- ${examples.map(({ description, command, commandPrefix }) => {
266125
- return ` # ${description}
266126
- $ ${commandPrefix ?? ""}settlemint ${command}`;
266127
- }).join(`
266128
-
266129
- `)}`;
266130
- }
266131
-
266132
- // src/commands/codegen/codegen-blockscout.ts
266133
- import { rm as rm2, writeFile as writeFile6 } from "node:fs/promises";
266134
- import { basename, resolve as resolve5 } from "node:path";
266135
- var PACKAGE_NAME4 = "@settlemint/sdk-blockscout";
266136
- async function codegenBlockscout(env2) {
266137
- const endpoint = env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT;
266138
- if (!endpoint) {
266139
- return;
266140
- }
266141
- const accessToken = await getApplicationOrPersonalAccessToken({
266142
- env: env2,
266143
- instance: env2.SETTLEMINT_INSTANCE,
266144
- prefer: "application"
266145
- });
266146
- if (!accessToken) {
266147
- return;
266148
- }
266149
- const introspectionJsonPath = resolve5(process.cwd(), "__blockscout-introspection__.json");
266150
- try {
266151
- const data = await graphqlFetchWithRetry(endpoint, {
266152
- method: "POST",
266153
- headers: {
266154
- "x-auth-token": accessToken,
266155
- "Content-Type": "application/json"
266156
- },
266157
- body: JSON.stringify({
266158
- query: `
266159
- query IntrospectionQuery {
266160
- __schema {
266161
- queryType { name }
266162
- mutationType { name }
266163
- types {
266164
- ...FullType
266165
- }
266166
- directives {
266167
- name
266168
- description
266169
- locations
266170
- args {
266171
- ...InputValue
266172
- }
266173
- }
266174
- }
266175
- }
266176
-
266177
- fragment FullType on __Type {
266178
- kind
266179
- name
266180
- description
266181
- fields(includeDeprecated: true) {
266182
- name
266183
- description
266184
- args {
266185
- ...InputValue
266186
- }
266187
- type {
266188
- ...TypeRef
266189
- }
266190
- isDeprecated
266191
- deprecationReason
266192
- }
266193
- inputFields {
266194
- ...InputValue
266195
- }
266196
- interfaces {
266197
- ...TypeRef
266198
- }
266199
- enumValues(includeDeprecated: true) {
266200
- name
266201
- description
266202
- isDeprecated
266203
- deprecationReason
266204
- }
266205
- possibleTypes {
266206
- ...TypeRef
266207
- }
266208
- }
266209
-
266210
- fragment InputValue on __InputValue {
266211
- name
266212
- description
266213
- type { ...TypeRef }
266214
- defaultValue
266215
- }
266216
-
266217
- fragment TypeRef on __Type {
266218
- kind
266219
- name
266220
- ofType {
266221
- kind
266222
- name
266223
- ofType {
266224
- kind
266225
- name
266226
- ofType {
266227
- kind
266228
- name
266229
- ofType {
266230
- kind
266231
- name
266232
- ofType {
266233
- kind
266234
- name
266235
- ofType {
266236
- kind
266237
- name
266238
- ofType {
266239
- kind
266240
- name
266241
- ofType {
266242
- kind
266243
- name
266244
- ofType {
266245
- kind
266246
- name
266247
- }
266248
- }
266249
- }
266250
- }
266251
- }
266252
- }
266253
- }
266254
- }
266255
- }
266256
- }
266257
- `
266258
- })
266259
- });
266260
- await writeFile6(introspectionJsonPath, JSON.stringify(data));
266261
- } catch (err) {
266262
- const error5 = err;
266263
- note(`GraphQL endpoint '${endpoint}' is not reachable: ${error5.message}`, "warn");
266264
- return;
266265
- }
266266
- try {
266267
- await generateSchema({
266268
- input: basename(introspectionJsonPath),
266269
- output: "blockscout-schema.graphql",
266270
- tsconfig: undefined,
266271
- headers: undefined
266272
- });
266273
- } finally {
266274
- await rm2(introspectionJsonPath);
266275
- }
266276
- const template = `import { createBlockscoutClient } from "${PACKAGE_NAME4}";
266277
- import type { introspection } from "@schemas/blockscout-env";
266278
-
266279
- export const { client: blockscoutClient, graphql: blockscoutGraphql } = createBlockscoutClient<{
266280
- introspection: introspection;
266281
- disableMasking: true;
266282
- scalars: {
266283
- /** 40 hex characters (160 bits/20 bytes) derived from the public key, prefixed with 0x */
266284
- AddressHash: string;
266285
- /** Unpadded big-endian hexadecimal number where each byte pair maps to underlying binary */
266286
- Data: string;
266287
- /** ISO8601 formatted UTC datetime string */
266288
- DateTime: string;
266289
- /** String representation of a signed double-precision decimal value */
266290
- Decimal: string;
266291
- /** 32-byte KECCAK-256 hash */
266292
- FullHash: string;
266293
- /** Arbitrary JSON string data as UTF-8 */
266294
- Json: string;
266295
- /** 16 hex character (128 bits/8 bytes) nonce from Proof-of-Work */
266296
- NonceHash: string;
266297
- /** Smallest fractional unit of Ether, represented as a string for integer math */
266298
- Wei: string;
266299
- };
266300
- }>({
266301
- instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT!,
266302
- accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!, // undefined in browser, by design to not leak the secrets
266303
- });
266304
-
266305
- export const blockscoutUiEndpoint = process.env.SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT!;`;
266306
- await writeTemplate(template, "/lib/settlemint", "blockscout.ts");
266307
- const projectDir = await projectRoot3();
266308
- if (!await isPackageInstalled(PACKAGE_NAME4, projectDir)) {
266309
- await installDependencies(PACKAGE_NAME4, projectDir);
266310
- }
266311
- }
266312
-
266313
- // src/commands/codegen/codegen-ipfs.ts
266314
- var PACKAGE_NAME5 = "@settlemint/sdk-ipfs";
266315
- function shouldCodegenIpfs(env2) {
266316
- return !!env2.SETTLEMINT_IPFS_API_ENDPOINT;
266317
- }
266318
- async function codegenIpfs(env2) {
266319
- const endpoint = env2.SETTLEMINT_IPFS_API_ENDPOINT;
266320
- if (!endpoint) {
266321
- return;
266322
- }
266323
- const clientTemplate = `import { createServerIpfsClient } from "${PACKAGE_NAME5}";
266324
-
266325
- export const { client } = createServerIpfsClient({
266326
- instance: process.env.SETTLEMINT_IPFS_API_ENDPOINT!,
266327
- accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
266328
- });`;
266329
- await writeTemplate(clientTemplate, "/lib/settlemint", "ipfs.ts");
266330
- const projectDir = await projectRoot3();
266331
- if (!await isPackageInstalled(PACKAGE_NAME5, projectDir)) {
266332
- await installDependencies(PACKAGE_NAME5, projectDir);
266333
- }
266334
- }
266335
-
266336
- // src/commands/codegen/codegen-minio.ts
266337
- var PACKAGE_NAME6 = "@settlemint/sdk-minio";
266338
- function shouldCodegenMinio(env2) {
266339
- return !!(env2.SETTLEMINT_MINIO_ENDPOINT && env2.SETTLEMINT_MINIO_ACCESS_KEY && env2.SETTLEMINT_MINIO_SECRET_KEY);
266340
- }
266341
- async function codegenMinio(env2) {
266342
- const endpoint = env2.SETTLEMINT_MINIO_ENDPOINT;
266343
- if (!endpoint) {
266344
- return;
266345
- }
266346
- const clientTemplate = `import { createServerMinioClient } from "${PACKAGE_NAME6}";
266347
-
266348
- export const { client } = createServerMinioClient({
266349
- instance: process.env.SETTLEMINT_MINIO_ENDPOINT!,
266350
- accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
266351
- accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY!,
266352
- secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY!
266353
- });`;
266354
- await writeTemplate(clientTemplate, "/lib/settlemint", "minio.ts");
266355
- const projectDir = await projectRoot3();
266356
- if (!await isPackageInstalled(PACKAGE_NAME6, projectDir)) {
266357
- await installDependencies(PACKAGE_NAME6, projectDir);
266358
- }
266359
- }
266360
-
266361
- // src/commands/codegen.ts
266362
- function codegenCommand() {
266363
- return new Command("codegen").option("--prod", "Connect to your production environment").option("--thegraph-subgraph-names <subgraph-names...>", "The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)").description("Generate GraphQL and REST types and queries").usage(createExamples([
266364
- {
266365
- description: "Generate GraphQL types and queries for your dApp",
266366
- command: "codegen"
266367
- },
266368
- {
266369
- description: "Generate GraphQL types and queries for specific TheGraph subgraphs",
266370
- command: "codegen --thegraph-subgraph-names subgraph1 subgraph2"
266371
- }
266372
- ])).action(async ({ prod, thegraphSubgraphNames }) => {
266373
- intro("Generating GraphQL types and queries for your dApp");
266374
- const env2 = await loadEnv(true, !!prod);
266375
- if (!Array.isArray(thegraphSubgraphNames)) {
266376
- thegraphSubgraphNames = await subgraphPrompt({
266377
- env: env2,
266378
- accept: true,
266379
- message: "Which The Graph subgraph do you want to generate types for?",
266380
- allowAll: true
266381
- });
266382
- }
266383
- const { hasura, portal, thegraph, blockscout } = await spinner({
266384
- startMessage: "Testing configured GraphQL schema",
266385
- task: async () => {
266386
- return codegenTsconfig(env2, thegraphSubgraphNames);
266387
- },
266388
- stopMessage: "Tested GraphQL schemas"
266389
- });
266390
- if (hasura) {
266391
- note("Generating Hasura resources");
266392
- await codegenHasura(env2);
266393
- }
266394
- if (portal) {
266395
- note("Generating Portal resources");
266396
- await codegenPortal(env2);
266397
- }
266398
- if (thegraph) {
266399
- note("Generating TheGraph resources");
266400
- await codegenTheGraph(env2, thegraphSubgraphNames);
266401
- }
266402
- if (blockscout) {
266403
- note("Generating Blockscout resources");
266404
- await codegenBlockscout(env2);
266405
- }
266406
- if (shouldCodegenMinio(env2)) {
266407
- note("Generating Minio resources");
266408
- await codegenMinio(env2);
266409
- }
266410
- if (shouldCodegenIpfs(env2)) {
266411
- note("Generating IPFS resources");
266412
- await codegenIpfs(env2);
266413
- }
266414
- if (hasura || portal || thegraph || blockscout) {
266415
- await generateOutput({
266416
- output: undefined,
266417
- tsconfig: undefined
266418
- });
266419
- }
266420
- outro("Codegen complete");
266421
- });
266422
- }
266423
-
266424
- // ../../node_modules/@inquirer/confirm/dist/esm/index.js
266425
- function getBooleanValue(value4, defaultValue) {
266426
- let answer = defaultValue !== false;
266427
- if (/^(y|yes)/i.test(value4))
266428
- answer = true;
266429
- else if (/^(n|no)/i.test(value4))
266430
- answer = false;
266431
- return answer;
266432
- }
266433
- function boolToString(value4) {
266434
- return value4 ? "Yes" : "No";
266435
- }
266436
- var esm_default5 = createPrompt((config3, done) => {
266437
- const { transformer = boolToString } = config3;
266438
- const [status, setStatus] = useState("idle");
266439
- const [value4, setValue] = useState("");
266440
- const theme = makeTheme(config3.theme);
266441
- const prefix = usePrefix({ status, theme });
266442
- useKeypress((key3, rl) => {
266443
- if (isEnterKey(key3)) {
266444
- const answer = getBooleanValue(value4, config3.default);
266445
- setValue(transformer(answer));
266446
- setStatus("done");
266447
- done(answer);
266448
- } else if (key3.name === "tab") {
266449
- const answer = boolToString(!getBooleanValue(value4, config3.default));
266450
- rl.clearLine(0);
266451
- rl.write(answer);
266452
- setValue(answer);
266453
- } else {
266454
- setValue(rl.line);
266455
- }
266456
- });
266457
- let formattedValue = value4;
266458
- let defaultValue = "";
266459
- if (status === "done") {
266460
- formattedValue = theme.style.answer(value4);
266461
- } else {
266462
- defaultValue = ` ${theme.style.defaultAnswer(config3.default === false ? "y/N" : "Y/n")}`;
266463
- }
266464
- const message = theme.style.message(config3.message, status);
266465
- return `${prefix} ${message}${defaultValue} ${formattedValue}`;
266466
- });
266467
-
266468
266467
  // ../../node_modules/@inquirer/password/dist/esm/index.js
266469
266468
  var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
266470
- var esm_default6 = createPrompt((config3, done) => {
266469
+ var esm_default6 = createPrompt2((config3, done) => {
266471
266470
  const { validate: validate3 = () => true } = config3;
266472
- const theme = makeTheme(config3.theme);
266473
- const [status, setStatus] = useState("idle");
266474
- const [errorMsg, setError] = useState();
266475
- const [value4, setValue] = useState("");
266476
- const prefix = usePrefix({ status, theme });
266477
- useKeypress(async (key3, rl) => {
266471
+ const theme = makeTheme2(config3.theme);
266472
+ const [status, setStatus] = useState2("idle");
266473
+ const [errorMsg, setError] = useState2();
266474
+ const [value4, setValue] = useState2("");
266475
+ const prefix = usePrefix2({ status, theme });
266476
+ useKeypress2(async (key3, rl) => {
266478
266477
  if (status !== "idle") {
266479
266478
  return;
266480
266479
  }
266481
- if (isEnterKey(key3)) {
266480
+ if (isEnterKey2(key3)) {
266482
266481
  const answer = value4;
266483
266482
  setStatus("loading");
266484
266483
  const isValid2 = await validate3(answer);
@@ -266525,7 +266524,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
266525
266524
  return defaultAccessToken;
266526
266525
  }
266527
266526
  if (defaultAccessToken) {
266528
- const keep = await esm_default5({
266527
+ const keep = await esm_default4({
266529
266528
  message: "Do you want to use the existing application access token?",
266530
266529
  default: true
266531
266530
  });
@@ -266533,7 +266532,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
266533
266532
  return defaultAccessToken;
266534
266533
  }
266535
266534
  }
266536
- const create2 = await esm_default5({
266535
+ const create2 = await esm_default4({
266537
266536
  message: "Do you want to create a new application access token?",
266538
266537
  default: false
266539
266538
  });
@@ -266634,7 +266633,7 @@ async function applicationPrompt(env2, applications, accept) {
266634
266633
  if (is_in_ci_default) {
266635
266634
  nothingSelectedError("application");
266636
266635
  }
266637
- const application = await esm_default4({
266636
+ const application = await esm_default3({
266638
266637
  message: "Which application do you want to connect to?",
266639
266638
  choices: applications.map((applications2) => ({
266640
266639
  name: `${applications2.name} (${applications2.uniqueName})`,
@@ -266707,7 +266706,7 @@ async function blockchainNodePrompt({
266707
266706
  isRequired,
266708
266707
  defaultHandler: async ({ defaultService: defaultNode, choices }) => {
266709
266708
  const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
266710
- return esm_default4({
266709
+ return esm_default3({
266711
266710
  message: promptMessage ?? "Which blockchain node do you want to connect to?",
266712
266711
  choices: filteredChoices,
266713
266712
  default: defaultNode
@@ -266732,7 +266731,7 @@ async function blockscoutPrompt({
266732
266731
  envKey: "SETTLEMINT_BLOCKSCOUT",
266733
266732
  isRequired,
266734
266733
  defaultHandler: async ({ defaultService: defaultBlockscout, choices }) => {
266735
- return esm_default4({
266734
+ return esm_default3({
266736
266735
  message: "Which blockscout instance do you want to connect to?",
266737
266736
  choices,
266738
266737
  default: defaultBlockscout
@@ -266755,7 +266754,7 @@ async function customDeploymentPrompt({
266755
266754
  envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
266756
266755
  isRequired,
266757
266756
  defaultHandler: async ({ defaultService: defaultCustomDeployment, choices }) => {
266758
- return esm_default4({
266757
+ return esm_default3({
266759
266758
  message: "Which Custom Deployment do you want to connect to?",
266760
266759
  choices,
266761
266760
  default: defaultCustomDeployment
@@ -266779,7 +266778,7 @@ async function hasuraPrompt({
266779
266778
  envKey: "SETTLEMINT_HASURA",
266780
266779
  isRequired,
266781
266780
  defaultHandler: async ({ defaultService: defaultHasura, choices }) => {
266782
- return esm_default4({
266781
+ return esm_default3({
266783
266782
  message: "Which Hasura instance do you want to connect to?",
266784
266783
  choices,
266785
266784
  default: defaultHasura
@@ -266803,7 +266802,7 @@ async function hdPrivateKeyPrompt({
266803
266802
  envKey: "SETTLEMINT_HD_PRIVATE_KEY",
266804
266803
  isRequired,
266805
266804
  defaultHandler: async ({ defaultService: defaultPrivateKey, choices }) => {
266806
- return esm_default4({
266805
+ return esm_default3({
266807
266806
  message: "Which HD Private Key do you want to use?",
266808
266807
  choices,
266809
266808
  default: defaultPrivateKey
@@ -266827,7 +266826,7 @@ async function ipfsPrompt({
266827
266826
  envKey: "SETTLEMINT_IPFS",
266828
266827
  isRequired,
266829
266828
  defaultHandler: async ({ defaultService: defaultStorage, choices }) => {
266830
- return esm_default4({
266829
+ return esm_default3({
266831
266830
  message: "Which IPFS instance do you want to connect to?",
266832
266831
  choices,
266833
266832
  default: defaultStorage
@@ -266851,7 +266850,7 @@ async function minioPrompt({
266851
266850
  envKey: "SETTLEMINT_MINIO",
266852
266851
  isRequired,
266853
266852
  defaultHandler: async ({ defaultService: defaultStorage, choices }) => {
266854
- return esm_default4({
266853
+ return esm_default3({
266855
266854
  message: "Which MinIO instance do you want to connect to?",
266856
266855
  choices,
266857
266856
  default: defaultStorage
@@ -266875,7 +266874,7 @@ async function portalPrompt({
266875
266874
  envKey: "SETTLEMINT_PORTAL",
266876
266875
  isRequired,
266877
266876
  defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
266878
- return esm_default4({
266877
+ return esm_default3({
266879
266878
  message: "Which Smart Contract Portal instance do you want to connect to?",
266880
266879
  choices,
266881
266880
  default: defaultMiddleware
@@ -266904,7 +266903,7 @@ async function theGraphPrompt({
266904
266903
  isRequired,
266905
266904
  defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
266906
266905
  const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => middleware === undefined || middleware?.status === "COMPLETED") : choices;
266907
- return esm_default4({
266906
+ return esm_default3({
266908
266907
  message: "Which The Graph instance do you want to connect to?",
266909
266908
  choices: filteredChoices,
266910
266909
  default: defaultMiddleware
@@ -266960,7 +266959,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
266960
266959
  if (knownInstances.length === 1) {
266961
266960
  return sanitizeInstanceUrl(knownInstances[0]);
266962
266961
  }
266963
- return esm_default4({
266962
+ return esm_default3({
266964
266963
  message: "What SettleMint instance do you want to connect to?",
266965
266964
  choices: [
266966
266965
  ...knownInstances.map((instance) => ({
@@ -266986,7 +266985,7 @@ async function workspacePrompt(env2, workspaces, accept) {
266986
266985
  if (is_in_ci_default) {
266987
266986
  nothingSelectedError("workspace");
266988
266987
  }
266989
- const workspace = await esm_default4({
266988
+ const workspace = await esm_default3({
266990
266989
  message: "Which workspace do you want to connect to?",
266991
266990
  choices: workspaces.map((workspace2) => ({
266992
266991
  name: `${workspace2.name} (${workspace2.uniqueName})`,
@@ -267372,7 +267371,7 @@ async function templatePrompt(platformConfig, argument) {
267372
267371
  }
267373
267372
  return template2;
267374
267373
  }
267375
- const template = await esm_default4({
267374
+ const template = await esm_default3({
267376
267375
  message: "Which template do you want to use?",
267377
267376
  choices: [
267378
267377
  ...kits.map((template2) => ({
@@ -270646,7 +270645,7 @@ function createCommand2() {
270646
270645
  await mkdir6(projectDir, { recursive: true });
270647
270646
  }
270648
270647
  if (!await isEmpty(projectDir)) {
270649
- const confirmEmpty = await esm_default5({
270648
+ const confirmEmpty = await esm_default4({
270650
270649
  message: `The folder ${projectDir} already exists. Do you want to empty it?`,
270651
270650
  default: false
270652
270651
  });
@@ -270680,7 +270679,7 @@ async function personalAccessTokenPrompt(env2, instance, accept) {
270680
270679
  return defaultPersonalAccessToken;
270681
270680
  }
270682
270681
  if (existingConfig && defaultPersonalAccessToken) {
270683
- const useExisting = await esm_default5({
270682
+ const useExisting = await esm_default4({
270684
270683
  message: `Do you want to use your existing personal access token for ${instance}?`,
270685
270684
  default: true
270686
270685
  });
@@ -270788,7 +270787,7 @@ function logoutCommand() {
270788
270787
  }
270789
270788
  const env2 = await loadEnv(false, false);
270790
270789
  const defaultInstance = env2.SETTLEMINT_INSTANCE;
270791
- const instance = await esm_default4({
270790
+ const instance = await esm_default3({
270792
270791
  message: "Select the instance to logout from:",
270793
270792
  choices: instances.map((instance2) => ({
270794
270793
  value: instance2,
@@ -271004,7 +271003,7 @@ async function providerPrompt(platformConfig, argument) {
271004
271003
  if (possibleProviders.length === 1) {
271005
271004
  return possibleProviders[0];
271006
271005
  }
271007
- const provider = await esm_default4({
271006
+ const provider = await esm_default3({
271008
271007
  message: "Which provider do you want to use?",
271009
271008
  choices: platformConfig.deploymentEngineTargets.map((target) => ({
271010
271009
  name: target.name,
@@ -271035,7 +271034,7 @@ async function regionPrompt(provider, argument) {
271035
271034
  if (possibleRegions.length === 1) {
271036
271035
  return possibleRegions[0];
271037
271036
  }
271038
- const region = await esm_default4({
271037
+ const region = await esm_default3({
271039
271038
  message: "Which region do you want to use?",
271040
271039
  choices: provider.clusters.map((cluster) => ({
271041
271040
  name: cluster.name,
@@ -271523,7 +271522,7 @@ async function blockchainNetworkPrompt({
271523
271522
  envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
271524
271523
  isRequired,
271525
271524
  defaultHandler: async ({ defaultService: defaultNetwork, choices }) => {
271526
- return esm_default4({
271525
+ return esm_default3({
271527
271526
  message: "Which blockchain network do you want to connect to?",
271528
271527
  choices,
271529
271528
  default: defaultNetwork
@@ -273121,7 +273120,7 @@ async function useCasePrompt(platformConfig, argument) {
273121
273120
  if (selectableUseCases.length === 1) {
273122
273121
  return selectableUseCases[0];
273123
273122
  }
273124
- const useCase = await esm_default4({
273123
+ const useCase = await esm_default3({
273125
273124
  message: "Which use case do you want to use?",
273126
273125
  choices: selectableUseCases.map((useCase2) => ({
273127
273126
  name: formatUseCaseName(useCase2.name),
@@ -273171,7 +273170,7 @@ function createCommand4() {
273171
273170
  const targetDir = formatTargetDir(name3);
273172
273171
  const projectDir = join10(process.cwd(), targetDir);
273173
273172
  if (await exists3(projectDir) && !await isEmpty(projectDir)) {
273174
- const confirmEmpty = await esm_default5({
273173
+ const confirmEmpty = await esm_default4({
273175
273174
  message: `The folder ${projectDir} already exists. Do you want to delete it?`,
273176
273175
  default: false
273177
273176
  });
@@ -273412,7 +273411,7 @@ async function addressPrompt({
273412
273411
  note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
273413
273412
  Please select another key or activate this key on the node and try again.`, "warn");
273414
273413
  }
273415
- const address = await esm_default4({
273414
+ const address = await esm_default3({
273416
273415
  message: "Which private key do you want to deploy from?",
273417
273416
  choices: possiblePrivateKeys.map(({ address: address2, name: name3 }) => ({
273418
273417
  name: name3,
@@ -274216,4 +274215,4 @@ async function sdkCliCommand(argv = process.argv) {
274216
274215
  // src/cli.ts
274217
274216
  sdkCliCommand();
274218
274217
 
274219
- //# debugId=DE30300DE392FD3764756E2164756E21
274218
+ //# debugId=1042845A2FDD16AF64756E2164756E21