@1sat/cli 0.0.15 → 0.0.16
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/package.json +2 -2
- package/src/commands/sweep.ts +25 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "CLI for 1Sat Ordinals SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/cli.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"keywords": ["1sat", "bsv", "ordinals", "cli"],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@1sat/actions": "0.0.
|
|
19
|
+
"@1sat/actions": "0.0.70",
|
|
20
20
|
"@1sat/client": "0.0.17",
|
|
21
21
|
"@1sat/types": "0.0.14",
|
|
22
22
|
"@1sat/wallet-node": ">=0.0.13",
|
package/src/commands/sweep.ts
CHANGED
|
@@ -106,11 +106,29 @@ async function sweepScan(args: string[], opts: GlobalFlags): Promise<void> {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
console.log(
|
|
110
|
+
`\n ${formatLabel('RUN Tokens:')} ${result.run.length}`,
|
|
111
|
+
)
|
|
112
|
+
if (result.run.length > 0) {
|
|
113
|
+
const runSats = result.run.reduce((sum, r) => sum + r.satoshis, 0)
|
|
114
|
+
console.log(
|
|
115
|
+
` ${formatLabel('Total locked:')} ${formatValue(runSats)} satoshis (not sweepable)`,
|
|
116
|
+
)
|
|
117
|
+
for (const r of result.run) {
|
|
118
|
+
console.log(
|
|
119
|
+
` ${formatValue(r.outpoint)} ${formatLabel(`${r.satoshis} sats`)}`,
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
109
124
|
const total =
|
|
110
125
|
result.funding.length +
|
|
111
126
|
result.ordinals.length +
|
|
112
127
|
result.bsv21Tokens.reduce((n, t) => n + t.inputs.length, 0)
|
|
113
|
-
console.log(`\n ${total}
|
|
128
|
+
console.log(`\n ${total} sweepable UTXO(s) found.`)
|
|
129
|
+
if (result.run.length > 0) {
|
|
130
|
+
console.log(` ${result.run.length} RUN token output(s) excluded.`)
|
|
131
|
+
}
|
|
114
132
|
} finally {
|
|
115
133
|
await destroy()
|
|
116
134
|
}
|
|
@@ -147,6 +165,9 @@ async function sweepImport(args: string[], opts: GlobalFlags): Promise<void> {
|
|
|
147
165
|
const hasTokens = scan.bsv21Tokens.length > 0
|
|
148
166
|
|
|
149
167
|
if (!hasFunding && !hasOrdinals && !hasTokens) {
|
|
168
|
+
if (scan.run.length > 0) {
|
|
169
|
+
fatal(`No sweepable UTXOs found at ${address} (${scan.run.length} RUN token output(s) excluded)`)
|
|
170
|
+
}
|
|
150
171
|
fatal(`No UTXOs found at ${address}`)
|
|
151
172
|
}
|
|
152
173
|
|
|
@@ -162,6 +183,9 @@ async function sweepImport(args: string[], opts: GlobalFlags): Promise<void> {
|
|
|
162
183
|
)
|
|
163
184
|
}
|
|
164
185
|
}
|
|
186
|
+
if (scan.run.length > 0) {
|
|
187
|
+
parts.push(`${scan.run.length} RUN token output(s) excluded`)
|
|
188
|
+
}
|
|
165
189
|
|
|
166
190
|
if (!opts.yes) {
|
|
167
191
|
const ok = await confirm({
|