@1sat/cli 0.0.131 → 0.0.132

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 (2) hide show
  1. package/dist/cli.js +21 -28
  2. package/package.json +8 -8
package/dist/cli.js CHANGED
@@ -1,15 +1,7 @@
1
1
  #!/usr/bin/env node
2
- var __esm = (fn, res, err) => () => {
3
- if (fn)
4
- try {
5
- res = fn(fn = 0);
6
- } catch (e) {
7
- err = [e];
8
- }
9
- if (err)
10
- throw err[0];
11
- return res;
12
- };
2
+ import { createRequire } from "node:module";
3
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
4
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
13
5
 
14
6
  // src/args.ts
15
7
  function parseGlobalFlags(args) {
@@ -630,11 +622,11 @@ async function handleActionCommand(args, opts) {
630
622
  Registered actions:
631
623
  `);
632
624
  const grouped = new Map;
633
- for (const action of actions) {
634
- const cat = action.meta.category;
625
+ for (const action2 of actions) {
626
+ const cat = action2.meta.category;
635
627
  if (!grouped.has(cat))
636
628
  grouped.set(cat, []);
637
- grouped.get(cat).push(action);
629
+ grouped.get(cat).push(action2);
638
630
  }
639
631
  for (const [category, categoryActions] of grouped) {
640
632
  console.log(` ${category}:`);
@@ -1673,7 +1665,7 @@ function createApprovalAuth(wallet) {
1673
1665
  get(target, property) {
1674
1666
  if (property === "createAction")
1675
1667
  return async (...args) => {
1676
- const satoshis = args[0].outputs?.reduce((sum, output) => sum + output.satoshis, 0) ?? 0;
1668
+ const satoshis = args[0].outputs?.reduce((sum, output2) => sum + output2.satoshis, 0) ?? 0;
1677
1669
  if (!Number.isSafeInteger(satoshis) || satoshis <= 0)
1678
1670
  throw new Error("Invalid HTTP payment amount");
1679
1671
  if (approved === false)
@@ -2197,15 +2189,15 @@ async function handleInitCommand(_args, opts) {
2197
2189
  }
2198
2190
  let wif;
2199
2191
  if (keySource === "generate") {
2200
- const pk = PrivateKey2.fromRandom();
2201
- wif = pk.toWif();
2202
- const address = pk.toPublicKey().toAddress();
2192
+ const pk2 = PrivateKey2.fromRandom();
2193
+ wif = pk2.toWif();
2194
+ const address2 = pk2.toPublicKey().toAddress();
2203
2195
  console.log();
2204
2196
  console.log(formatWarning(" IMPORTANT: Back up your private key!"));
2205
2197
  console.log(formatWarning(" If you lose it, your funds are gone forever."));
2206
2198
  console.log();
2207
2199
  console.log(` ${formatValue("WIF:")} ${wif}`);
2208
- console.log(` ${formatValue("Address:")} ${address}`);
2200
+ console.log(` ${formatValue("Address:")} ${address2}`);
2209
2201
  console.log();
2210
2202
  const confirmed = await confirm2({
2211
2203
  message: "Have you saved your private key somewhere safe?"
@@ -3538,12 +3530,12 @@ async function permissionsRevoke(args, opts) {
3538
3530
  const originator = normalizeOriginator2(origin);
3539
3531
  const { store, path } = openStore(opts);
3540
3532
  if (hasFlag(args, "--all")) {
3541
- const removed = await store.deleteAllForOriginator(originator);
3533
+ const removed2 = await store.deleteAllForOriginator(originator);
3542
3534
  if (opts.json) {
3543
- output({ originator, removed, store: path }, opts);
3535
+ output({ originator, removed: removed2, store: path }, opts);
3544
3536
  return;
3545
3537
  }
3546
- output(`revoked ${removed} grant(s) for ${originator}`, opts);
3538
+ output(`revoked ${removed2} grant(s) for ${originator}`, opts);
3547
3539
  return;
3548
3540
  }
3549
3541
  let specs;
@@ -4739,11 +4731,11 @@ function selectedSweepClasses(only, skip) {
4739
4731
  throw new Error("--only and --skip are mutually exclusive");
4740
4732
  }
4741
4733
  if (only) {
4742
- const selected = parseSweepClasses(only, "--only");
4743
- if (selected.size === 0) {
4734
+ const selected2 = parseSweepClasses(only, "--only");
4735
+ if (selected2.size === 0) {
4744
4736
  throw new Error("--only requires at least one class");
4745
4737
  }
4746
- return selected;
4738
+ return selected2;
4747
4739
  }
4748
4740
  const selected = new Set(SWEEP_CLASSES);
4749
4741
  if (skip) {
@@ -5840,8 +5832,8 @@ async function walletListOutputs(args, opts) {
5840
5832
  ${result.totalOutputs} total outputs in basket '${basket}':
5841
5833
  `);
5842
5834
  for (const out of result.outputs) {
5843
- const tags = out.tags?.join(", ") || "none";
5844
- console.log(` ${out.outpoint} | ${out.satoshis} sats | tags: ${tags}`);
5835
+ const tags2 = out.tags?.join(", ") || "none";
5836
+ console.log(` ${out.outpoint} | ${out.satoshis} sats | tags: ${tags2}`);
5845
5837
  }
5846
5838
  console.log();
5847
5839
  }
@@ -6056,6 +6048,7 @@ var init_wallet = __esm(() => {
6056
6048
  });
6057
6049
 
6058
6050
  // src/main.ts
6051
+ var exports_main = {};
6059
6052
  import { existsSync as existsSync5 } from "node:fs";
6060
6053
  import { resolve } from "node:path";
6061
6054
  import { config as loadEnv } from "dotenv";
@@ -6199,4 +6192,4 @@ var init_main = __esm(() => {
6199
6192
 
6200
6193
  // src/cli.ts
6201
6194
  process.env.DOTENV_CONFIG_QUIET = "true";
6202
- await Promise.resolve().then(() => (init_main(), {}));
6195
+ await Promise.resolve().then(() => (init_main(), exports_main));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1sat/cli",
3
- "version": "0.0.131",
3
+ "version": "0.0.132",
4
4
  "description": "CLI for 1Sat Ordinals SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",
@@ -27,16 +27,16 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "@1sat/actions": "0.0.233",
31
- "@1sat/client": "0.0.62",
30
+ "@1sat/actions": "0.0.234",
31
+ "@1sat/client": "0.0.63",
32
32
  "@1sat/types": "0.0.52",
33
- "@1sat/wallet": "0.0.119",
34
- "@1sat/wallet-node": "0.0.86",
35
- "@1sat/wallet-server": "0.0.64",
33
+ "@1sat/wallet": "0.0.120",
34
+ "@1sat/wallet-node": "0.0.87",
35
+ "@1sat/wallet-server": "0.0.65",
36
36
  "@bopen-io/messagebox-server": "^1.3.2",
37
37
  "@bsv/sdk": "^2.6.0",
38
- "@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@2.14.7",
39
- "@bsv/wallet-toolbox-client": "npm:@bopen-io/wallet-toolbox-client@2.14.7",
38
+ "@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@2.14.8",
39
+ "@bsv/wallet-toolbox-client": "npm:@bopen-io/wallet-toolbox-client@2.14.8",
40
40
  "@clack/prompts": "^0.8.0",
41
41
  "bitcoin-backup": "^0.0.11",
42
42
  "chalk": "^5.0.0",