dipcoin-cli 0.8.0 → 0.8.2
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.
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/utils/sdk-factory.d.ts.map +1 -1
- package/dist/cli.cjs +865 -708
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -48,8 +48,8 @@ function initSDKOptions(options) {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
const PACKAGE_VERSION = "1.45.
|
|
52
|
-
const TARGETED_RPC_VERSION = "1.
|
|
51
|
+
const PACKAGE_VERSION = "1.45.2";
|
|
52
|
+
const TARGETED_RPC_VERSION = "1.62.0";
|
|
53
53
|
|
|
54
54
|
const CODE_TO_ERROR_TYPE = {
|
|
55
55
|
"-32700": "ParseError",
|
|
@@ -2503,773 +2503,902 @@ class Experimental_BaseClient {
|
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
2505
|
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2506
|
+
//#region src/storages/globalConfig/globalConfig.ts
|
|
2507
|
+
let store$4;
|
|
2508
|
+
/**
|
|
2509
|
+
* Returns the global configuration.
|
|
2510
|
+
*
|
|
2511
|
+
* @param config The config to merge.
|
|
2512
|
+
*
|
|
2513
|
+
* @returns The configuration.
|
|
2514
|
+
*/
|
|
2515
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2516
|
+
function getGlobalConfig(config$1) {
|
|
2517
|
+
return {
|
|
2518
|
+
lang: config$1?.lang ?? store$4?.lang,
|
|
2519
|
+
message: config$1?.message,
|
|
2520
|
+
abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
|
|
2521
|
+
abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
|
|
2522
|
+
};
|
|
2517
2523
|
}
|
|
2518
2524
|
|
|
2519
|
-
|
|
2520
|
-
|
|
2525
|
+
//#endregion
|
|
2526
|
+
//#region src/storages/globalMessage/globalMessage.ts
|
|
2527
|
+
let store$3;
|
|
2528
|
+
/**
|
|
2529
|
+
* Returns a global error message.
|
|
2530
|
+
*
|
|
2531
|
+
* @param lang The language of the message.
|
|
2532
|
+
*
|
|
2533
|
+
* @returns The error message.
|
|
2534
|
+
*/
|
|
2535
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2521
2536
|
function getGlobalMessage(lang) {
|
|
2522
|
-
|
|
2537
|
+
return store$3?.get(lang);
|
|
2523
2538
|
}
|
|
2524
2539
|
|
|
2525
|
-
|
|
2526
|
-
|
|
2540
|
+
//#endregion
|
|
2541
|
+
//#region src/storages/schemaMessage/schemaMessage.ts
|
|
2542
|
+
let store$2;
|
|
2543
|
+
/**
|
|
2544
|
+
* Returns a schema error message.
|
|
2545
|
+
*
|
|
2546
|
+
* @param lang The language of the message.
|
|
2547
|
+
*
|
|
2548
|
+
* @returns The error message.
|
|
2549
|
+
*/
|
|
2550
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2527
2551
|
function getSchemaMessage(lang) {
|
|
2528
|
-
|
|
2552
|
+
return store$2?.get(lang);
|
|
2529
2553
|
}
|
|
2530
2554
|
|
|
2531
|
-
|
|
2532
|
-
|
|
2555
|
+
//#endregion
|
|
2556
|
+
//#region src/storages/specificMessage/specificMessage.ts
|
|
2557
|
+
let store$1;
|
|
2558
|
+
/**
|
|
2559
|
+
* Returns a specific error message.
|
|
2560
|
+
*
|
|
2561
|
+
* @param reference The identifier reference.
|
|
2562
|
+
* @param lang The language of the message.
|
|
2563
|
+
*
|
|
2564
|
+
* @returns The error message.
|
|
2565
|
+
*/
|
|
2566
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2533
2567
|
function getSpecificMessage(reference, lang) {
|
|
2534
|
-
|
|
2568
|
+
return store$1?.get(reference)?.get(lang);
|
|
2535
2569
|
}
|
|
2536
2570
|
|
|
2537
|
-
|
|
2571
|
+
//#endregion
|
|
2572
|
+
//#region src/utils/_stringify/_stringify.ts
|
|
2573
|
+
/**
|
|
2574
|
+
* Stringifies an unknown input to a literal or type string.
|
|
2575
|
+
*
|
|
2576
|
+
* @param input The unknown input.
|
|
2577
|
+
*
|
|
2578
|
+
* @returns A literal or type string.
|
|
2579
|
+
*
|
|
2580
|
+
* @internal
|
|
2581
|
+
*/
|
|
2582
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2538
2583
|
function _stringify(input) {
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
return `${input}`;
|
|
2545
|
-
}
|
|
2546
|
-
if (type === "object" || type === "function") {
|
|
2547
|
-
return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
2548
|
-
}
|
|
2549
|
-
return type;
|
|
2584
|
+
const type = typeof input;
|
|
2585
|
+
if (type === "string") return `"${input}"`;
|
|
2586
|
+
if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
|
|
2587
|
+
if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
2588
|
+
return type;
|
|
2550
2589
|
}
|
|
2551
2590
|
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2591
|
+
//#endregion
|
|
2592
|
+
//#region src/utils/_addIssue/_addIssue.ts
|
|
2593
|
+
/**
|
|
2594
|
+
* Adds an issue to the dataset.
|
|
2595
|
+
*
|
|
2596
|
+
* @param context The issue context.
|
|
2597
|
+
* @param label The issue label.
|
|
2598
|
+
* @param dataset The input dataset.
|
|
2599
|
+
* @param config The configuration.
|
|
2600
|
+
* @param other The optional props.
|
|
2601
|
+
*
|
|
2602
|
+
* @internal
|
|
2603
|
+
*/
|
|
2604
|
+
function _addIssue(context, label, dataset, config$1, other) {
|
|
2605
|
+
const input = other && "input" in other ? other.input : dataset.value;
|
|
2606
|
+
const expected = other?.expected ?? context.expects ?? null;
|
|
2607
|
+
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
2608
|
+
const issue = {
|
|
2609
|
+
kind: context.kind,
|
|
2610
|
+
type: context.type,
|
|
2611
|
+
input,
|
|
2612
|
+
expected,
|
|
2613
|
+
received,
|
|
2614
|
+
message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
|
|
2615
|
+
requirement: context.requirement,
|
|
2616
|
+
path: other?.path,
|
|
2617
|
+
issues: other?.issues,
|
|
2618
|
+
lang: config$1.lang,
|
|
2619
|
+
abortEarly: config$1.abortEarly,
|
|
2620
|
+
abortPipeEarly: config$1.abortPipeEarly
|
|
2621
|
+
};
|
|
2622
|
+
const isSchema = context.kind === "schema";
|
|
2623
|
+
const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
2624
|
+
if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
|
|
2625
|
+
if (isSchema) dataset.typed = false;
|
|
2626
|
+
if (dataset.issues) dataset.issues.push(issue);
|
|
2627
|
+
else dataset.issues = [issue];
|
|
2586
2628
|
}
|
|
2587
2629
|
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2630
|
+
//#endregion
|
|
2631
|
+
//#region src/utils/_getStandardProps/_getStandardProps.ts
|
|
2632
|
+
/**
|
|
2633
|
+
* Returns the Standard Schema properties.
|
|
2634
|
+
*
|
|
2635
|
+
* @param context The schema context.
|
|
2636
|
+
*
|
|
2637
|
+
* @returns The Standard Schema properties.
|
|
2638
|
+
*/
|
|
2639
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2640
|
+
function _getStandardProps(context) {
|
|
2641
|
+
return {
|
|
2642
|
+
version: 1,
|
|
2643
|
+
vendor: "valibot",
|
|
2644
|
+
validate(value$1) {
|
|
2645
|
+
return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
|
|
2646
|
+
}
|
|
2647
|
+
};
|
|
2591
2648
|
}
|
|
2592
2649
|
|
|
2593
|
-
|
|
2650
|
+
//#endregion
|
|
2651
|
+
//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts
|
|
2652
|
+
/**
|
|
2653
|
+
* Disallows inherited object properties and prevents object prototype
|
|
2654
|
+
* pollution by disallowing certain keys.
|
|
2655
|
+
*
|
|
2656
|
+
* @param object The object to check.
|
|
2657
|
+
* @param key The key to check.
|
|
2658
|
+
*
|
|
2659
|
+
* @returns Whether the key is allowed.
|
|
2660
|
+
*
|
|
2661
|
+
* @internal
|
|
2662
|
+
*/
|
|
2663
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2664
|
+
function _isValidObjectKey(object$1, key) {
|
|
2665
|
+
return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
//#endregion
|
|
2669
|
+
//#region src/utils/_joinExpects/_joinExpects.ts
|
|
2670
|
+
/**
|
|
2671
|
+
* Joins multiple `expects` values with the given separator.
|
|
2672
|
+
*
|
|
2673
|
+
* @param values The `expects` values.
|
|
2674
|
+
* @param separator The separator.
|
|
2675
|
+
*
|
|
2676
|
+
* @returns The joined `expects` property.
|
|
2677
|
+
*
|
|
2678
|
+
* @internal
|
|
2679
|
+
*/
|
|
2680
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2681
|
+
function _joinExpects(values$1, separator) {
|
|
2682
|
+
const list = [...new Set(values$1)];
|
|
2683
|
+
if (list.length > 1) return `(${list.join(` ${separator} `)})`;
|
|
2684
|
+
return list[0] ?? "never";
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
//#endregion
|
|
2688
|
+
//#region src/utils/ValiError/ValiError.ts
|
|
2689
|
+
/**
|
|
2690
|
+
* A Valibot error with useful information.
|
|
2691
|
+
*/
|
|
2594
2692
|
var ValiError = class extends Error {
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
super(issues[0].message);
|
|
2606
|
-
this.name = "ValiError";
|
|
2607
|
-
this.issues = issues;
|
|
2608
|
-
}
|
|
2693
|
+
/**
|
|
2694
|
+
* Creates a Valibot error with useful information.
|
|
2695
|
+
*
|
|
2696
|
+
* @param issues The error issues.
|
|
2697
|
+
*/
|
|
2698
|
+
constructor(issues) {
|
|
2699
|
+
super(issues[0].message);
|
|
2700
|
+
this.name = "ValiError";
|
|
2701
|
+
this.issues = issues;
|
|
2702
|
+
}
|
|
2609
2703
|
};
|
|
2610
2704
|
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2705
|
+
//#endregion
|
|
2706
|
+
//#region src/actions/check/check.ts
|
|
2707
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2708
|
+
function check(requirement, message$1) {
|
|
2709
|
+
return {
|
|
2710
|
+
kind: "validation",
|
|
2711
|
+
type: "check",
|
|
2712
|
+
reference: check,
|
|
2713
|
+
async: false,
|
|
2714
|
+
expects: null,
|
|
2715
|
+
requirement,
|
|
2716
|
+
message: message$1,
|
|
2717
|
+
"~run"(dataset, config$1) {
|
|
2718
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
|
|
2719
|
+
return dataset;
|
|
2720
|
+
}
|
|
2721
|
+
};
|
|
2628
2722
|
}
|
|
2629
2723
|
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2724
|
+
//#endregion
|
|
2725
|
+
//#region src/actions/integer/integer.ts
|
|
2726
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2727
|
+
function integer(message$1) {
|
|
2728
|
+
return {
|
|
2729
|
+
kind: "validation",
|
|
2730
|
+
type: "integer",
|
|
2731
|
+
reference: integer,
|
|
2732
|
+
async: false,
|
|
2733
|
+
expects: null,
|
|
2734
|
+
requirement: Number.isInteger,
|
|
2735
|
+
message: message$1,
|
|
2736
|
+
"~run"(dataset, config$1) {
|
|
2737
|
+
if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
|
|
2738
|
+
return dataset;
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2647
2741
|
}
|
|
2648
2742
|
|
|
2649
|
-
|
|
2743
|
+
//#endregion
|
|
2744
|
+
//#region src/actions/transform/transform.ts
|
|
2745
|
+
/**
|
|
2746
|
+
* Creates a custom transformation action.
|
|
2747
|
+
*
|
|
2748
|
+
* @param operation The transformation operation.
|
|
2749
|
+
*
|
|
2750
|
+
* @returns A transform action.
|
|
2751
|
+
*/
|
|
2752
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2650
2753
|
function transform(operation) {
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2754
|
+
return {
|
|
2755
|
+
kind: "transformation",
|
|
2756
|
+
type: "transform",
|
|
2757
|
+
reference: transform,
|
|
2758
|
+
async: false,
|
|
2759
|
+
operation,
|
|
2760
|
+
"~run"(dataset) {
|
|
2761
|
+
dataset.value = this.operation(dataset.value);
|
|
2762
|
+
return dataset;
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
2662
2765
|
}
|
|
2663
2766
|
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2767
|
+
//#endregion
|
|
2768
|
+
//#region src/methods/getFallback/getFallback.ts
|
|
2769
|
+
/**
|
|
2770
|
+
* Returns the fallback value of the schema.
|
|
2771
|
+
*
|
|
2772
|
+
* @param schema The schema to get it from.
|
|
2773
|
+
* @param dataset The output dataset if available.
|
|
2774
|
+
* @param config The config if available.
|
|
2775
|
+
*
|
|
2776
|
+
* @returns The fallback value.
|
|
2777
|
+
*/
|
|
2778
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2779
|
+
function getFallback(schema, dataset, config$1) {
|
|
2780
|
+
return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
|
|
2673
2781
|
}
|
|
2674
2782
|
|
|
2675
|
-
|
|
2783
|
+
//#endregion
|
|
2784
|
+
//#region src/methods/getDefault/getDefault.ts
|
|
2785
|
+
/**
|
|
2786
|
+
* Returns the default value of the schema.
|
|
2787
|
+
*
|
|
2788
|
+
* @param schema The schema to get it from.
|
|
2789
|
+
* @param dataset The input dataset if available.
|
|
2790
|
+
* @param config The config if available.
|
|
2791
|
+
*
|
|
2792
|
+
* @returns The default value.
|
|
2793
|
+
*/
|
|
2794
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2795
|
+
function getDefault(schema, dataset, config$1) {
|
|
2796
|
+
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
//#endregion
|
|
2800
|
+
//#region src/methods/is/is.ts
|
|
2801
|
+
/**
|
|
2802
|
+
* Checks if the input matches the schema. By using a type predicate, this
|
|
2803
|
+
* function can be used as a type guard.
|
|
2804
|
+
*
|
|
2805
|
+
* @param schema The schema to be used.
|
|
2806
|
+
* @param input The input to be tested.
|
|
2807
|
+
*
|
|
2808
|
+
* @returns Whether the input matches the schema.
|
|
2809
|
+
*/
|
|
2810
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2676
2811
|
function is(schema, input) {
|
|
2677
|
-
|
|
2812
|
+
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
2678
2813
|
}
|
|
2679
2814
|
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
}
|
|
2730
|
-
return dataset;
|
|
2731
|
-
}
|
|
2732
|
-
};
|
|
2815
|
+
//#endregion
|
|
2816
|
+
//#region src/schemas/array/array.ts
|
|
2817
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2818
|
+
function array(item, message$1) {
|
|
2819
|
+
return {
|
|
2820
|
+
kind: "schema",
|
|
2821
|
+
type: "array",
|
|
2822
|
+
reference: array,
|
|
2823
|
+
expects: "Array",
|
|
2824
|
+
async: false,
|
|
2825
|
+
item,
|
|
2826
|
+
message: message$1,
|
|
2827
|
+
get "~standard"() {
|
|
2828
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
2829
|
+
},
|
|
2830
|
+
"~run"(dataset, config$1) {
|
|
2831
|
+
const input = dataset.value;
|
|
2832
|
+
if (Array.isArray(input)) {
|
|
2833
|
+
dataset.typed = true;
|
|
2834
|
+
dataset.value = [];
|
|
2835
|
+
for (let key = 0; key < input.length; key++) {
|
|
2836
|
+
const value$1 = input[key];
|
|
2837
|
+
const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
|
|
2838
|
+
if (itemDataset.issues) {
|
|
2839
|
+
const pathItem = {
|
|
2840
|
+
type: "array",
|
|
2841
|
+
origin: "value",
|
|
2842
|
+
input,
|
|
2843
|
+
key,
|
|
2844
|
+
value: value$1
|
|
2845
|
+
};
|
|
2846
|
+
for (const issue of itemDataset.issues) {
|
|
2847
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
2848
|
+
else issue.path = [pathItem];
|
|
2849
|
+
dataset.issues?.push(issue);
|
|
2850
|
+
}
|
|
2851
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
2852
|
+
if (config$1.abortEarly) {
|
|
2853
|
+
dataset.typed = false;
|
|
2854
|
+
break;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
2858
|
+
dataset.value.push(itemDataset.value);
|
|
2859
|
+
}
|
|
2860
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
2861
|
+
return dataset;
|
|
2862
|
+
}
|
|
2863
|
+
};
|
|
2733
2864
|
}
|
|
2734
2865
|
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2866
|
+
//#endregion
|
|
2867
|
+
//#region src/schemas/bigint/bigint.ts
|
|
2868
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2869
|
+
function bigint(message$1) {
|
|
2870
|
+
return {
|
|
2871
|
+
kind: "schema",
|
|
2872
|
+
type: "bigint",
|
|
2873
|
+
reference: bigint,
|
|
2874
|
+
expects: "bigint",
|
|
2875
|
+
async: false,
|
|
2876
|
+
message: message$1,
|
|
2877
|
+
get "~standard"() {
|
|
2878
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
2879
|
+
},
|
|
2880
|
+
"~run"(dataset, config$1) {
|
|
2881
|
+
if (typeof dataset.value === "bigint") dataset.typed = true;
|
|
2882
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
2883
|
+
return dataset;
|
|
2884
|
+
}
|
|
2885
|
+
};
|
|
2753
2886
|
}
|
|
2754
2887
|
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2888
|
+
//#endregion
|
|
2889
|
+
//#region src/schemas/boolean/boolean.ts
|
|
2890
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2891
|
+
function boolean(message$1) {
|
|
2892
|
+
return {
|
|
2893
|
+
kind: "schema",
|
|
2894
|
+
type: "boolean",
|
|
2895
|
+
reference: boolean,
|
|
2896
|
+
expects: "boolean",
|
|
2897
|
+
async: false,
|
|
2898
|
+
message: message$1,
|
|
2899
|
+
get "~standard"() {
|
|
2900
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
2901
|
+
},
|
|
2902
|
+
"~run"(dataset, config$1) {
|
|
2903
|
+
if (typeof dataset.value === "boolean") dataset.typed = true;
|
|
2904
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
2905
|
+
return dataset;
|
|
2906
|
+
}
|
|
2907
|
+
};
|
|
2773
2908
|
}
|
|
2774
2909
|
|
|
2775
|
-
|
|
2910
|
+
//#endregion
|
|
2911
|
+
//#region src/schemas/lazy/lazy.ts
|
|
2912
|
+
/**
|
|
2913
|
+
* Creates a lazy schema.
|
|
2914
|
+
*
|
|
2915
|
+
* @param getter The schema getter.
|
|
2916
|
+
*
|
|
2917
|
+
* @returns A lazy schema.
|
|
2918
|
+
*/
|
|
2919
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2776
2920
|
function lazy(getter) {
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2921
|
+
return {
|
|
2922
|
+
kind: "schema",
|
|
2923
|
+
type: "lazy",
|
|
2924
|
+
reference: lazy,
|
|
2925
|
+
expects: "unknown",
|
|
2926
|
+
async: false,
|
|
2927
|
+
getter,
|
|
2928
|
+
get "~standard"() {
|
|
2929
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
2930
|
+
},
|
|
2931
|
+
"~run"(dataset, config$1) {
|
|
2932
|
+
return this.getter(dataset.value)["~run"](dataset, config$1);
|
|
2933
|
+
}
|
|
2934
|
+
};
|
|
2788
2935
|
}
|
|
2789
2936
|
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2937
|
+
//#endregion
|
|
2938
|
+
//#region src/schemas/literal/literal.ts
|
|
2939
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2940
|
+
function literal(literal_, message$1) {
|
|
2941
|
+
return {
|
|
2942
|
+
kind: "schema",
|
|
2943
|
+
type: "literal",
|
|
2944
|
+
reference: literal,
|
|
2945
|
+
expects: /* @__PURE__ */ _stringify(literal_),
|
|
2946
|
+
async: false,
|
|
2947
|
+
literal: literal_,
|
|
2948
|
+
message: message$1,
|
|
2949
|
+
get "~standard"() {
|
|
2950
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
2951
|
+
},
|
|
2952
|
+
"~run"(dataset, config$1) {
|
|
2953
|
+
if (dataset.value === this.literal) dataset.typed = true;
|
|
2954
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
2955
|
+
return dataset;
|
|
2956
|
+
}
|
|
2957
|
+
};
|
|
2809
2958
|
}
|
|
2810
2959
|
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
if (0 in args) {
|
|
2838
|
-
schema.default = args[0];
|
|
2839
|
-
}
|
|
2840
|
-
return schema;
|
|
2960
|
+
//#endregion
|
|
2961
|
+
//#region src/schemas/nullable/nullable.ts
|
|
2962
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2963
|
+
function nullable(wrapped, default_) {
|
|
2964
|
+
return {
|
|
2965
|
+
kind: "schema",
|
|
2966
|
+
type: "nullable",
|
|
2967
|
+
reference: nullable,
|
|
2968
|
+
expects: `(${wrapped.expects} | null)`,
|
|
2969
|
+
async: false,
|
|
2970
|
+
wrapped,
|
|
2971
|
+
default: default_,
|
|
2972
|
+
get "~standard"() {
|
|
2973
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
2974
|
+
},
|
|
2975
|
+
"~run"(dataset, config$1) {
|
|
2976
|
+
if (dataset.value === null) {
|
|
2977
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
2978
|
+
if (dataset.value === null) {
|
|
2979
|
+
dataset.typed = true;
|
|
2980
|
+
return dataset;
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
2984
|
+
}
|
|
2985
|
+
};
|
|
2841
2986
|
}
|
|
2842
2987
|
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
if (0 in args) {
|
|
2870
|
-
schema.default = args[0];
|
|
2871
|
-
}
|
|
2872
|
-
return schema;
|
|
2988
|
+
//#endregion
|
|
2989
|
+
//#region src/schemas/nullish/nullish.ts
|
|
2990
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2991
|
+
function nullish(wrapped, default_) {
|
|
2992
|
+
return {
|
|
2993
|
+
kind: "schema",
|
|
2994
|
+
type: "nullish",
|
|
2995
|
+
reference: nullish,
|
|
2996
|
+
expects: `(${wrapped.expects} | null | undefined)`,
|
|
2997
|
+
async: false,
|
|
2998
|
+
wrapped,
|
|
2999
|
+
default: default_,
|
|
3000
|
+
get "~standard"() {
|
|
3001
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3002
|
+
},
|
|
3003
|
+
"~run"(dataset, config$1) {
|
|
3004
|
+
if (dataset.value === null || dataset.value === void 0) {
|
|
3005
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
3006
|
+
if (dataset.value === null || dataset.value === void 0) {
|
|
3007
|
+
dataset.typed = true;
|
|
3008
|
+
return dataset;
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
3012
|
+
}
|
|
3013
|
+
};
|
|
2873
3014
|
}
|
|
2874
3015
|
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
3016
|
+
//#endregion
|
|
3017
|
+
//#region src/schemas/number/number.ts
|
|
3018
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3019
|
+
function number(message$1) {
|
|
3020
|
+
return {
|
|
3021
|
+
kind: "schema",
|
|
3022
|
+
type: "number",
|
|
3023
|
+
reference: number,
|
|
3024
|
+
expects: "number",
|
|
3025
|
+
async: false,
|
|
3026
|
+
message: message$1,
|
|
3027
|
+
get "~standard"() {
|
|
3028
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3029
|
+
},
|
|
3030
|
+
"~run"(dataset, config$1) {
|
|
3031
|
+
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
|
|
3032
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
3033
|
+
return dataset;
|
|
3034
|
+
}
|
|
3035
|
+
};
|
|
2893
3036
|
}
|
|
2894
3037
|
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
3038
|
+
//#endregion
|
|
3039
|
+
//#region src/schemas/object/object.ts
|
|
3040
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3041
|
+
function object(entries$1, message$1) {
|
|
3042
|
+
return {
|
|
3043
|
+
kind: "schema",
|
|
3044
|
+
type: "object",
|
|
3045
|
+
reference: object,
|
|
3046
|
+
expects: "Object",
|
|
3047
|
+
async: false,
|
|
3048
|
+
entries: entries$1,
|
|
3049
|
+
message: message$1,
|
|
3050
|
+
get "~standard"() {
|
|
3051
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3052
|
+
},
|
|
3053
|
+
"~run"(dataset, config$1) {
|
|
3054
|
+
const input = dataset.value;
|
|
3055
|
+
if (input && typeof input === "object") {
|
|
3056
|
+
dataset.typed = true;
|
|
3057
|
+
dataset.value = {};
|
|
3058
|
+
for (const key in this.entries) {
|
|
3059
|
+
const valueSchema = this.entries[key];
|
|
3060
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
3061
|
+
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
3062
|
+
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
3063
|
+
if (valueDataset.issues) {
|
|
3064
|
+
const pathItem = {
|
|
3065
|
+
type: "object",
|
|
3066
|
+
origin: "value",
|
|
3067
|
+
input,
|
|
3068
|
+
key,
|
|
3069
|
+
value: value$1
|
|
3070
|
+
};
|
|
3071
|
+
for (const issue of valueDataset.issues) {
|
|
3072
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
3073
|
+
else issue.path = [pathItem];
|
|
3074
|
+
dataset.issues?.push(issue);
|
|
3075
|
+
}
|
|
3076
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
3077
|
+
if (config$1.abortEarly) {
|
|
3078
|
+
dataset.typed = false;
|
|
3079
|
+
break;
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
3083
|
+
dataset.value[key] = valueDataset.value;
|
|
3084
|
+
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
3085
|
+
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
3086
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
3087
|
+
input: void 0,
|
|
3088
|
+
expected: `"${key}"`,
|
|
3089
|
+
path: [{
|
|
3090
|
+
type: "object",
|
|
3091
|
+
origin: "key",
|
|
3092
|
+
input,
|
|
3093
|
+
key,
|
|
3094
|
+
value: input[key]
|
|
3095
|
+
}]
|
|
3096
|
+
});
|
|
3097
|
+
if (config$1.abortEarly) break;
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
3101
|
+
return dataset;
|
|
3102
|
+
}
|
|
3103
|
+
};
|
|
2953
3104
|
}
|
|
2954
3105
|
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
if (0 in args) {
|
|
2982
|
-
schema.default = args[0];
|
|
2983
|
-
}
|
|
2984
|
-
return schema;
|
|
3106
|
+
//#endregion
|
|
3107
|
+
//#region src/schemas/optional/optional.ts
|
|
3108
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3109
|
+
function optional(wrapped, default_) {
|
|
3110
|
+
return {
|
|
3111
|
+
kind: "schema",
|
|
3112
|
+
type: "optional",
|
|
3113
|
+
reference: optional,
|
|
3114
|
+
expects: `(${wrapped.expects} | undefined)`,
|
|
3115
|
+
async: false,
|
|
3116
|
+
wrapped,
|
|
3117
|
+
default: default_,
|
|
3118
|
+
get "~standard"() {
|
|
3119
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3120
|
+
},
|
|
3121
|
+
"~run"(dataset, config$1) {
|
|
3122
|
+
if (dataset.value === void 0) {
|
|
3123
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
3124
|
+
if (dataset.value === void 0) {
|
|
3125
|
+
dataset.typed = true;
|
|
3126
|
+
return dataset;
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
3130
|
+
}
|
|
3131
|
+
};
|
|
2985
3132
|
}
|
|
2986
3133
|
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
}
|
|
3057
|
-
}
|
|
3058
|
-
if (!keyDataset.typed || !valueDataset.typed) {
|
|
3059
|
-
dataset.typed = false;
|
|
3060
|
-
}
|
|
3061
|
-
if (keyDataset.typed) {
|
|
3062
|
-
dataset.value[keyDataset.value] = valueDataset.value;
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
}
|
|
3066
|
-
} else {
|
|
3067
|
-
_addIssue(this, "type", dataset, config2);
|
|
3068
|
-
}
|
|
3069
|
-
return dataset;
|
|
3070
|
-
}
|
|
3071
|
-
};
|
|
3134
|
+
//#endregion
|
|
3135
|
+
//#region src/schemas/record/record.ts
|
|
3136
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3137
|
+
function record(key, value$1, message$1) {
|
|
3138
|
+
return {
|
|
3139
|
+
kind: "schema",
|
|
3140
|
+
type: "record",
|
|
3141
|
+
reference: record,
|
|
3142
|
+
expects: "Object",
|
|
3143
|
+
async: false,
|
|
3144
|
+
key,
|
|
3145
|
+
value: value$1,
|
|
3146
|
+
message: message$1,
|
|
3147
|
+
get "~standard"() {
|
|
3148
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3149
|
+
},
|
|
3150
|
+
"~run"(dataset, config$1) {
|
|
3151
|
+
const input = dataset.value;
|
|
3152
|
+
if (input && typeof input === "object") {
|
|
3153
|
+
dataset.typed = true;
|
|
3154
|
+
dataset.value = {};
|
|
3155
|
+
for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
|
|
3156
|
+
const entryValue = input[entryKey];
|
|
3157
|
+
const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
|
|
3158
|
+
if (keyDataset.issues) {
|
|
3159
|
+
const pathItem = {
|
|
3160
|
+
type: "object",
|
|
3161
|
+
origin: "key",
|
|
3162
|
+
input,
|
|
3163
|
+
key: entryKey,
|
|
3164
|
+
value: entryValue
|
|
3165
|
+
};
|
|
3166
|
+
for (const issue of keyDataset.issues) {
|
|
3167
|
+
issue.path = [pathItem];
|
|
3168
|
+
dataset.issues?.push(issue);
|
|
3169
|
+
}
|
|
3170
|
+
if (!dataset.issues) dataset.issues = keyDataset.issues;
|
|
3171
|
+
if (config$1.abortEarly) {
|
|
3172
|
+
dataset.typed = false;
|
|
3173
|
+
break;
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
|
|
3177
|
+
if (valueDataset.issues) {
|
|
3178
|
+
const pathItem = {
|
|
3179
|
+
type: "object",
|
|
3180
|
+
origin: "value",
|
|
3181
|
+
input,
|
|
3182
|
+
key: entryKey,
|
|
3183
|
+
value: entryValue
|
|
3184
|
+
};
|
|
3185
|
+
for (const issue of valueDataset.issues) {
|
|
3186
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
3187
|
+
else issue.path = [pathItem];
|
|
3188
|
+
dataset.issues?.push(issue);
|
|
3189
|
+
}
|
|
3190
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
3191
|
+
if (config$1.abortEarly) {
|
|
3192
|
+
dataset.typed = false;
|
|
3193
|
+
break;
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
|
|
3197
|
+
if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
|
|
3198
|
+
}
|
|
3199
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
3200
|
+
return dataset;
|
|
3201
|
+
}
|
|
3202
|
+
};
|
|
3072
3203
|
}
|
|
3073
3204
|
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3205
|
+
//#endregion
|
|
3206
|
+
//#region src/schemas/string/string.ts
|
|
3207
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3208
|
+
function string(message$1) {
|
|
3209
|
+
return {
|
|
3210
|
+
kind: "schema",
|
|
3211
|
+
type: "string",
|
|
3212
|
+
reference: string,
|
|
3213
|
+
expects: "string",
|
|
3214
|
+
async: false,
|
|
3215
|
+
message: message$1,
|
|
3216
|
+
get "~standard"() {
|
|
3217
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3218
|
+
},
|
|
3219
|
+
"~run"(dataset, config$1) {
|
|
3220
|
+
if (typeof dataset.value === "string") dataset.typed = true;
|
|
3221
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
3222
|
+
return dataset;
|
|
3223
|
+
}
|
|
3224
|
+
};
|
|
3092
3225
|
}
|
|
3093
3226
|
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
}
|
|
3144
|
-
} else {
|
|
3145
|
-
_addIssue(this, "type", dataset, config2);
|
|
3146
|
-
}
|
|
3147
|
-
return dataset;
|
|
3148
|
-
}
|
|
3149
|
-
};
|
|
3227
|
+
//#endregion
|
|
3228
|
+
//#region src/schemas/tuple/tuple.ts
|
|
3229
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3230
|
+
function tuple(items, message$1) {
|
|
3231
|
+
return {
|
|
3232
|
+
kind: "schema",
|
|
3233
|
+
type: "tuple",
|
|
3234
|
+
reference: tuple,
|
|
3235
|
+
expects: "Array",
|
|
3236
|
+
async: false,
|
|
3237
|
+
items,
|
|
3238
|
+
message: message$1,
|
|
3239
|
+
get "~standard"() {
|
|
3240
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3241
|
+
},
|
|
3242
|
+
"~run"(dataset, config$1) {
|
|
3243
|
+
const input = dataset.value;
|
|
3244
|
+
if (Array.isArray(input)) {
|
|
3245
|
+
dataset.typed = true;
|
|
3246
|
+
dataset.value = [];
|
|
3247
|
+
for (let key = 0; key < this.items.length; key++) {
|
|
3248
|
+
const value$1 = input[key];
|
|
3249
|
+
const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
|
|
3250
|
+
if (itemDataset.issues) {
|
|
3251
|
+
const pathItem = {
|
|
3252
|
+
type: "array",
|
|
3253
|
+
origin: "value",
|
|
3254
|
+
input,
|
|
3255
|
+
key,
|
|
3256
|
+
value: value$1
|
|
3257
|
+
};
|
|
3258
|
+
for (const issue of itemDataset.issues) {
|
|
3259
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
3260
|
+
else issue.path = [pathItem];
|
|
3261
|
+
dataset.issues?.push(issue);
|
|
3262
|
+
}
|
|
3263
|
+
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
3264
|
+
if (config$1.abortEarly) {
|
|
3265
|
+
dataset.typed = false;
|
|
3266
|
+
break;
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
if (!itemDataset.typed) dataset.typed = false;
|
|
3270
|
+
dataset.value.push(itemDataset.value);
|
|
3271
|
+
}
|
|
3272
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
3273
|
+
return dataset;
|
|
3274
|
+
}
|
|
3275
|
+
};
|
|
3150
3276
|
}
|
|
3151
3277
|
|
|
3152
|
-
|
|
3278
|
+
//#endregion
|
|
3279
|
+
//#region src/schemas/union/utils/_subIssues/_subIssues.ts
|
|
3280
|
+
/**
|
|
3281
|
+
* Returns the sub issues of the provided datasets for the union issue.
|
|
3282
|
+
*
|
|
3283
|
+
* @param datasets The datasets.
|
|
3284
|
+
*
|
|
3285
|
+
* @returns The sub issues.
|
|
3286
|
+
*
|
|
3287
|
+
* @internal
|
|
3288
|
+
*/
|
|
3289
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3153
3290
|
function _subIssues(datasets) {
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
issues.push(...dataset.issues);
|
|
3159
|
-
} else {
|
|
3160
|
-
issues = dataset.issues;
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
return issues;
|
|
3291
|
+
let issues;
|
|
3292
|
+
if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
|
|
3293
|
+
else issues = dataset.issues;
|
|
3294
|
+
return issues;
|
|
3165
3295
|
}
|
|
3166
3296
|
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
}
|
|
3208
|
-
if (typedDatasets) {
|
|
3209
|
-
if (typedDatasets.length === 1) {
|
|
3210
|
-
return typedDatasets[0];
|
|
3211
|
-
}
|
|
3212
|
-
_addIssue(this, "type", dataset, config2, {
|
|
3213
|
-
issues: _subIssues(typedDatasets)
|
|
3214
|
-
});
|
|
3215
|
-
dataset.typed = true;
|
|
3216
|
-
} else if (untypedDatasets?.length === 1) {
|
|
3217
|
-
return untypedDatasets[0];
|
|
3218
|
-
} else {
|
|
3219
|
-
_addIssue(this, "type", dataset, config2, {
|
|
3220
|
-
issues: _subIssues(untypedDatasets)
|
|
3221
|
-
});
|
|
3222
|
-
}
|
|
3223
|
-
return dataset;
|
|
3224
|
-
}
|
|
3225
|
-
};
|
|
3297
|
+
//#endregion
|
|
3298
|
+
//#region src/schemas/union/union.ts
|
|
3299
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3300
|
+
function union(options, message$1) {
|
|
3301
|
+
return {
|
|
3302
|
+
kind: "schema",
|
|
3303
|
+
type: "union",
|
|
3304
|
+
reference: union,
|
|
3305
|
+
expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
|
|
3306
|
+
async: false,
|
|
3307
|
+
options,
|
|
3308
|
+
message: message$1,
|
|
3309
|
+
get "~standard"() {
|
|
3310
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3311
|
+
},
|
|
3312
|
+
"~run"(dataset, config$1) {
|
|
3313
|
+
let validDataset;
|
|
3314
|
+
let typedDatasets;
|
|
3315
|
+
let untypedDatasets;
|
|
3316
|
+
for (const schema of this.options) {
|
|
3317
|
+
const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
|
|
3318
|
+
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
3319
|
+
else typedDatasets = [optionDataset];
|
|
3320
|
+
else {
|
|
3321
|
+
validDataset = optionDataset;
|
|
3322
|
+
break;
|
|
3323
|
+
}
|
|
3324
|
+
else if (untypedDatasets) untypedDatasets.push(optionDataset);
|
|
3325
|
+
else untypedDatasets = [optionDataset];
|
|
3326
|
+
}
|
|
3327
|
+
if (validDataset) return validDataset;
|
|
3328
|
+
if (typedDatasets) {
|
|
3329
|
+
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
3330
|
+
_addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
3331
|
+
dataset.typed = true;
|
|
3332
|
+
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
3333
|
+
else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
3334
|
+
return dataset;
|
|
3335
|
+
}
|
|
3336
|
+
};
|
|
3226
3337
|
}
|
|
3227
3338
|
|
|
3228
|
-
|
|
3339
|
+
//#endregion
|
|
3340
|
+
//#region src/schemas/unknown/unknown.ts
|
|
3341
|
+
/**
|
|
3342
|
+
* Creates a unknown schema.
|
|
3343
|
+
*
|
|
3344
|
+
* @returns A unknown schema.
|
|
3345
|
+
*/
|
|
3346
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3229
3347
|
function unknown() {
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3348
|
+
return {
|
|
3349
|
+
kind: "schema",
|
|
3350
|
+
type: "unknown",
|
|
3351
|
+
reference: unknown,
|
|
3352
|
+
expects: "unknown",
|
|
3353
|
+
async: false,
|
|
3354
|
+
get "~standard"() {
|
|
3355
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3356
|
+
},
|
|
3357
|
+
"~run"(dataset) {
|
|
3358
|
+
dataset.typed = true;
|
|
3359
|
+
return dataset;
|
|
3360
|
+
}
|
|
3361
|
+
};
|
|
3241
3362
|
}
|
|
3242
3363
|
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3364
|
+
//#endregion
|
|
3365
|
+
//#region src/methods/parse/parse.ts
|
|
3366
|
+
/**
|
|
3367
|
+
* Parses an unknown input based on a schema.
|
|
3368
|
+
*
|
|
3369
|
+
* @param schema The schema to be used.
|
|
3370
|
+
* @param input The input to be parsed.
|
|
3371
|
+
* @param config The parse configuration.
|
|
3372
|
+
*
|
|
3373
|
+
* @returns The parsed input.
|
|
3374
|
+
*/
|
|
3375
|
+
function parse(schema, input, config$1) {
|
|
3376
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
3377
|
+
if (dataset.issues) throw new ValiError(dataset.issues);
|
|
3378
|
+
return dataset.value;
|
|
3253
3379
|
}
|
|
3254
3380
|
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3381
|
+
//#endregion
|
|
3382
|
+
//#region src/methods/pipe/pipe.ts
|
|
3383
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3384
|
+
function pipe(...pipe$1) {
|
|
3385
|
+
return {
|
|
3386
|
+
...pipe$1[0],
|
|
3387
|
+
pipe: pipe$1,
|
|
3388
|
+
get "~standard"() {
|
|
3389
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
3390
|
+
},
|
|
3391
|
+
"~run"(dataset, config$1) {
|
|
3392
|
+
for (const item of pipe$1) if (item.kind !== "metadata") {
|
|
3393
|
+
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
3394
|
+
dataset.typed = false;
|
|
3395
|
+
break;
|
|
3396
|
+
}
|
|
3397
|
+
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
|
|
3398
|
+
}
|
|
3399
|
+
return dataset;
|
|
3400
|
+
}
|
|
3401
|
+
};
|
|
3273
3402
|
}
|
|
3274
3403
|
|
|
3275
3404
|
const SUI_NS_NAME_REGEX = /^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i;
|
|
@@ -3388,10 +3517,12 @@ function safeEnum(options) {
|
|
|
3388
3517
|
const unionOptions = Object.entries(options).map(([key, value]) => object({ [key]: value }));
|
|
3389
3518
|
return pipe(
|
|
3390
3519
|
union(unionOptions),
|
|
3391
|
-
transform(
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3520
|
+
transform(
|
|
3521
|
+
(value) => ({
|
|
3522
|
+
...value,
|
|
3523
|
+
$kind: Object.keys(value)[0]
|
|
3524
|
+
})
|
|
3525
|
+
)
|
|
3395
3526
|
);
|
|
3396
3527
|
}
|
|
3397
3528
|
const SuiAddress = pipe(
|
|
@@ -7677,6 +7808,7 @@ runPlugins_fn = async function(plugins, options) {
|
|
|
7677
7808
|
} finally {
|
|
7678
7809
|
__privateSet$4(this, _inputSection, __privateGet$4(this, _data$1).inputs.slice());
|
|
7679
7810
|
__privateSet$4(this, _commandSection, __privateGet$4(this, _data$1).commands.slice());
|
|
7811
|
+
__privateSet$4(this, _availableResults, new Set(__privateGet$4(this, _commandSection).map((_, i) => i)));
|
|
7680
7812
|
}
|
|
7681
7813
|
};
|
|
7682
7814
|
waitForPendingTasks_fn = async function() {
|
|
@@ -19291,9 +19423,18 @@ function deriveKeypairFromMnemonic(mnemonic, index) {
|
|
|
19291
19423
|
* Read and validate MNEMONIC from env.
|
|
19292
19424
|
*/
|
|
19293
19425
|
function getMnemonic() {
|
|
19294
|
-
const mnemonic = process.env.
|
|
19426
|
+
const mnemonic = process.env.DIPCOIN_MNEMONIC;
|
|
19295
19427
|
if (!mnemonic) {
|
|
19296
|
-
console.error(`Error:
|
|
19428
|
+
console.error(`Error: DIPCOIN_MNEMONIC not set.\n`);
|
|
19429
|
+
console.error(`Option 1 — Create a config file:\n`);
|
|
19430
|
+
console.error(` mkdir -p ~/.config/dipcoin`);
|
|
19431
|
+
console.error(` cat > ~/.config/dipcoin/env << 'EOF'`);
|
|
19432
|
+
console.error(`DIPCOIN_MNEMONIC=word1 word2 word3 ... word12`);
|
|
19433
|
+
console.error(`DIPCOIN_NETWORK=testnet`);
|
|
19434
|
+
console.error(`EOF\n`);
|
|
19435
|
+
console.error(`Option 2 — Export environment variables:\n`);
|
|
19436
|
+
console.error(` export DIPCOIN_MNEMONIC="word1 word2 word3 ... word12"`);
|
|
19437
|
+
console.error(` export DIPCOIN_NETWORK=testnet # or mainnet\n`);
|
|
19297
19438
|
process.exit(1);
|
|
19298
19439
|
}
|
|
19299
19440
|
return mnemonic;
|
|
@@ -19302,7 +19443,7 @@ function getMnemonic() {
|
|
|
19302
19443
|
* Get the network from env.
|
|
19303
19444
|
*/
|
|
19304
19445
|
function getNetwork() {
|
|
19305
|
-
return process.env.
|
|
19446
|
+
return process.env.DIPCOIN_NETWORK || "testnet";
|
|
19306
19447
|
}
|
|
19307
19448
|
/**
|
|
19308
19449
|
* Trading mode SDK: main keypair = index 0, sub keypair = index N.
|
|
@@ -19389,7 +19530,7 @@ function getGlobalVaultIndex(prog) {
|
|
|
19389
19530
|
return n;
|
|
19390
19531
|
}
|
|
19391
19532
|
// Fallback to DEFAULT_VAULT_INDEX env
|
|
19392
|
-
const envDefault = process.env.
|
|
19533
|
+
const envDefault = process.env.DIPCOIN_DEFAULT_VAULT_INDEX;
|
|
19393
19534
|
if (envDefault !== undefined) {
|
|
19394
19535
|
const n = Number(envDefault);
|
|
19395
19536
|
if (!isNaN(n) && n >= 0)
|
|
@@ -20490,11 +20631,27 @@ function registerBalanceCommand(program) {
|
|
|
20490
20631
|
});
|
|
20491
20632
|
}
|
|
20492
20633
|
|
|
20634
|
+
function getPackageVersion() {
|
|
20635
|
+
try {
|
|
20636
|
+
// Works in both ESM and CJS after bundling
|
|
20637
|
+
const pkgPath = path.resolve(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('cli.cjs', document.baseURI).href)))), "../package.json");
|
|
20638
|
+
return JSON.parse(fs.readFileSync(pkgPath, "utf-8")).version;
|
|
20639
|
+
}
|
|
20640
|
+
catch {
|
|
20641
|
+
try {
|
|
20642
|
+
// Fallback: resolve from cwd
|
|
20643
|
+
return JSON.parse(fs.readFileSync(path.resolve(process.cwd(), "package.json"), "utf-8")).version;
|
|
20644
|
+
}
|
|
20645
|
+
catch {
|
|
20646
|
+
return "0.0.0";
|
|
20647
|
+
}
|
|
20648
|
+
}
|
|
20649
|
+
}
|
|
20493
20650
|
const program = new commander.Command();
|
|
20494
20651
|
program
|
|
20495
20652
|
.name("dipcoin-cli")
|
|
20496
20653
|
.description("DipCoin Perpetual Trading CLI")
|
|
20497
|
-
.version(
|
|
20654
|
+
.version(getPackageVersion())
|
|
20498
20655
|
.option("--json", "Output in JSON format")
|
|
20499
20656
|
.option("--vault-index <n>", "Vault index (1+ for HD-derived sub-accounts)");
|
|
20500
20657
|
registerAccountCommands(program);
|