@1sat/cli 0.0.123 → 0.0.124
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.js +0 -49
- package/package.json +7 -7
- package/src/commands/wallet.ts +0 -60
package/dist/cli.js
CHANGED
|
@@ -5482,8 +5482,6 @@ var init_tx = __esm(() => {
|
|
|
5482
5482
|
// src/commands/wallet.ts
|
|
5483
5483
|
import {
|
|
5484
5484
|
deriveDepositAddresses,
|
|
5485
|
-
migrateLegacyP1SatBaskets,
|
|
5486
|
-
moveBasketOutputs,
|
|
5487
5485
|
sendAllBsv,
|
|
5488
5486
|
sendBsv,
|
|
5489
5487
|
syncAddresses
|
|
@@ -5508,10 +5506,6 @@ async function handleWalletCommand(args, opts) {
|
|
|
5508
5506
|
return walletListOutputs(rest, opts);
|
|
5509
5507
|
case "relinquish-output":
|
|
5510
5508
|
return walletRelinquishOutput(rest, opts);
|
|
5511
|
-
case "move-basket":
|
|
5512
|
-
return walletMoveBasket(rest, opts);
|
|
5513
|
-
case "migrate-baskets":
|
|
5514
|
-
return walletMigrateBaskets(rest, opts);
|
|
5515
5509
|
case "list-actions":
|
|
5516
5510
|
return walletListActions(rest, opts);
|
|
5517
5511
|
case "create-action":
|
|
@@ -5841,49 +5835,6 @@ async function walletRelinquishOutput(args, opts) {
|
|
|
5841
5835
|
await destroy();
|
|
5842
5836
|
}
|
|
5843
5837
|
}
|
|
5844
|
-
async function walletMoveBasket(args, opts) {
|
|
5845
|
-
const from = extractFlag(args, "--from");
|
|
5846
|
-
const to = extractFlag(args, "--to");
|
|
5847
|
-
if (!from)
|
|
5848
|
-
fatal("Missing required --from <basket>");
|
|
5849
|
-
if (!to)
|
|
5850
|
-
fatal("Missing required --to <basket>");
|
|
5851
|
-
const privateKey = await loadKey();
|
|
5852
|
-
const { ctx, destroy } = await loadContext(privateKey, {
|
|
5853
|
-
chain: opts.chain
|
|
5854
|
-
});
|
|
5855
|
-
try {
|
|
5856
|
-
const result = await moveBasketOutputs(ctx.wallet, from, to);
|
|
5857
|
-
output(result, opts);
|
|
5858
|
-
} finally {
|
|
5859
|
-
await destroy();
|
|
5860
|
-
}
|
|
5861
|
-
}
|
|
5862
|
-
async function walletMigrateBaskets(args, opts) {
|
|
5863
|
-
const privateKey = await loadKey();
|
|
5864
|
-
const { ctx, destroy } = await loadContext(privateKey, {
|
|
5865
|
-
chain: opts.chain
|
|
5866
|
-
});
|
|
5867
|
-
try {
|
|
5868
|
-
const result = await migrateLegacyP1SatBaskets(ctx.wallet);
|
|
5869
|
-
if (opts.json) {
|
|
5870
|
-
output(result, opts);
|
|
5871
|
-
} else {
|
|
5872
|
-
console.log(`Moved ${result.totalMoved} output(s) across legacy baskets
|
|
5873
|
-
`);
|
|
5874
|
-
for (const r of result.results) {
|
|
5875
|
-
if (r.moved === 0 && r.errors.length === 0)
|
|
5876
|
-
continue;
|
|
5877
|
-
console.log(` ${r.from} → ${r.to}: moved ${r.moved}` + (r.skipped ? `, skipped ${r.skipped}` : ""));
|
|
5878
|
-
for (const e of r.errors) {
|
|
5879
|
-
console.log(` ! ${e.outpoint}: ${e.error}`);
|
|
5880
|
-
}
|
|
5881
|
-
}
|
|
5882
|
-
}
|
|
5883
|
-
} finally {
|
|
5884
|
-
await destroy();
|
|
5885
|
-
}
|
|
5886
|
-
}
|
|
5887
5838
|
async function walletListActions(args, opts) {
|
|
5888
5839
|
const labels = extractFlags(args, "--labels");
|
|
5889
5840
|
const limitStr = extractFlag(args, "--limit");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.124",
|
|
4
4
|
"description": "CLI for 1Sat Ordinals SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@1sat/actions": "0.0.
|
|
31
|
-
"@1sat/client": "0.0.
|
|
32
|
-
"@1sat/types": "0.0.
|
|
33
|
-
"@1sat/wallet": "0.0.
|
|
34
|
-
"@1sat/wallet-node": "0.0.
|
|
35
|
-
"@1sat/wallet-server": "0.0.
|
|
30
|
+
"@1sat/actions": "0.0.228",
|
|
31
|
+
"@1sat/client": "0.0.57",
|
|
32
|
+
"@1sat/types": "0.0.49",
|
|
33
|
+
"@1sat/wallet": "0.0.114",
|
|
34
|
+
"@1sat/wallet-node": "0.0.81",
|
|
35
|
+
"@1sat/wallet-server": "0.0.58",
|
|
36
36
|
"@bopen-io/messagebox-server": "^1.3.2",
|
|
37
37
|
"@bsv/sdk": "^2.6.0",
|
|
38
38
|
"@bsv/wallet-toolbox": "^2.14.4",
|
package/src/commands/wallet.ts
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
deriveDepositAddresses,
|
|
8
|
-
migrateLegacyP1SatBaskets,
|
|
9
|
-
moveBasketOutputs,
|
|
10
8
|
sendAllBsv,
|
|
11
9
|
sendBsv,
|
|
12
10
|
syncAddresses,
|
|
@@ -68,10 +66,6 @@ export async function handleWalletCommand(
|
|
|
68
66
|
return walletListOutputs(rest, opts)
|
|
69
67
|
case 'relinquish-output':
|
|
70
68
|
return walletRelinquishOutput(rest, opts)
|
|
71
|
-
case 'move-basket':
|
|
72
|
-
return walletMoveBasket(rest, opts)
|
|
73
|
-
case 'migrate-baskets':
|
|
74
|
-
return walletMigrateBaskets(rest, opts)
|
|
75
69
|
case 'list-actions':
|
|
76
70
|
return walletListActions(rest, opts)
|
|
77
71
|
case 'create-action':
|
|
@@ -491,60 +485,6 @@ async function walletRelinquishOutput(
|
|
|
491
485
|
}
|
|
492
486
|
}
|
|
493
487
|
|
|
494
|
-
async function walletMoveBasket(
|
|
495
|
-
args: string[],
|
|
496
|
-
opts: GlobalFlags,
|
|
497
|
-
): Promise<void> {
|
|
498
|
-
const from = extractFlag(args, '--from')
|
|
499
|
-
const to = extractFlag(args, '--to')
|
|
500
|
-
if (!from) fatal('Missing required --from <basket>')
|
|
501
|
-
if (!to) fatal('Missing required --to <basket>')
|
|
502
|
-
|
|
503
|
-
const privateKey = await loadKey()
|
|
504
|
-
const { ctx, destroy } = await loadContext(privateKey, {
|
|
505
|
-
chain: opts.chain,
|
|
506
|
-
})
|
|
507
|
-
try {
|
|
508
|
-
const result = await moveBasketOutputs(ctx.wallet, from, to)
|
|
509
|
-
output(result, opts)
|
|
510
|
-
} finally {
|
|
511
|
-
await destroy()
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
async function walletMigrateBaskets(
|
|
516
|
-
args: string[],
|
|
517
|
-
opts: GlobalFlags,
|
|
518
|
-
): Promise<void> {
|
|
519
|
-
void args
|
|
520
|
-
const privateKey = await loadKey()
|
|
521
|
-
const { ctx, destroy } = await loadContext(privateKey, {
|
|
522
|
-
chain: opts.chain,
|
|
523
|
-
})
|
|
524
|
-
try {
|
|
525
|
-
const result = await migrateLegacyP1SatBaskets(ctx.wallet)
|
|
526
|
-
if (opts.json) {
|
|
527
|
-
output(result, opts)
|
|
528
|
-
} else {
|
|
529
|
-
console.log(
|
|
530
|
-
`Moved ${result.totalMoved} output(s) across legacy baskets\n`,
|
|
531
|
-
)
|
|
532
|
-
for (const r of result.results) {
|
|
533
|
-
if (r.moved === 0 && r.errors.length === 0) continue
|
|
534
|
-
console.log(
|
|
535
|
-
` ${r.from} → ${r.to}: moved ${r.moved}` +
|
|
536
|
-
(r.skipped ? `, skipped ${r.skipped}` : ''),
|
|
537
|
-
)
|
|
538
|
-
for (const e of r.errors) {
|
|
539
|
-
console.log(` ! ${e.outpoint}: ${e.error}`)
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
} finally {
|
|
544
|
-
await destroy()
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
488
|
async function walletListActions(
|
|
549
489
|
args: string[],
|
|
550
490
|
opts: GlobalFlags,
|