@1sat/cli 0.0.73 → 0.0.76

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1sat/cli",
3
- "version": "0.0.73",
3
+ "version": "0.0.76",
4
4
  "description": "CLI for 1Sat Ordinals SDK",
5
5
  "type": "module",
6
6
  "main": "./src/cli.ts",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@1sat/actions": "0.0.169",
30
- "@1sat/client": "0.0.40",
29
+ "@1sat/actions": "0.0.174",
30
+ "@1sat/client": "0.0.42",
31
31
  "@1sat/types": "0.0.33",
32
- "@1sat/wallet-node": "0.0.54",
33
- "@1sat/wallet-server": "0.0.23",
32
+ "@1sat/wallet-node": "0.0.57",
33
+ "@1sat/wallet-server": "0.0.26",
34
34
  "@bsv/sdk": "^2.0.13",
35
- "@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@2.1.21-parity-fix.2",
35
+ "@bsv/wallet-toolbox": "2.1.24",
36
36
  "chalk": "^5.0.0",
37
37
  "@clack/prompts": "^0.8.0",
38
38
  "bitcoin-backup": "^0.0.11",
@@ -1,16 +1,13 @@
1
1
  /**
2
- * OpNS commands - register, deregister, lookup, mine.
2
+ * OpNS commands - register, deregister, lookup.
3
3
  *
4
- * Manage OpNS name identity bindings and paid mining jobs.
4
+ * Manage OpNS name identity bindings. Paid mining is product code on 1sat.name.
5
5
  */
6
6
 
7
7
  import {
8
8
  getDisplayValue,
9
9
  getOpnsNames,
10
10
  opnsDeregister as opnsDeregisterAction,
11
- opnsMine as opnsMineAction,
12
- opnsMineRefund as opnsMineRefundAction,
13
- opnsMineStatus as opnsMineStatusAction,
14
11
  opnsRegister as opnsRegisterAction,
15
12
  } from '@1sat/actions'
16
13
  import { confirm, isCancel } from '@clack/prompts'
@@ -34,12 +31,6 @@ export async function handleOpnsCommand(
34
31
  return opnsDeregister(rest, opts)
35
32
  case 'lookup':
36
33
  return opnsLookup(rest, opts)
37
- case 'mine':
38
- return opnsMine(rest, opts)
39
- case 'mine-status':
40
- return opnsMineStatus(rest, opts)
41
- case 'mine-refund':
42
- return opnsMineRefund(rest, opts)
43
34
  default:
44
35
  printCommandHelp('opns', opts.json)
45
36
  if (subcommand && subcommand !== 'help') {
@@ -135,113 +126,6 @@ async function opnsDeregister(
135
126
  }
136
127
  }
137
128
 
138
- async function opnsMine(args: string[], opts: GlobalFlags): Promise<void> {
139
- const name = extractFlag(args, '--name')
140
- const serviceUrl = extractFlag(args, '--service')
141
- const receiveAddress = extractFlag(args, '--receive-address')
142
- const timeout = extractFlag(args, '--timeout')
143
-
144
- if (!name) fatal('Missing --name <name>')
145
- if (!serviceUrl) fatal('Missing --service <url>')
146
-
147
- if (!opts.yes) {
148
- const ok = await confirm({
149
- message: `Pay ${serviceUrl} to mine "${name}"? The full price is charged upfront.`,
150
- })
151
- if (isCancel(ok) || !ok) {
152
- fatal('Mine cancelled.')
153
- }
154
- }
155
-
156
- const privateKey = await loadKey()
157
- const { ctx, destroy } = await loadContext(privateKey, {
158
- chain: opts.chain,
159
- })
160
-
161
- try {
162
- const result = await opnsMineAction.execute(ctx, {
163
- name,
164
- serviceUrl,
165
- receiveAddress: receiveAddress ?? undefined,
166
- timeoutMs: timeout ? Number.parseInt(timeout, 10) : undefined,
167
- })
168
- if (result.error && !result.jobId) {
169
- fatal(result.error)
170
- }
171
- output(
172
- opts.json
173
- ? result
174
- : {
175
- jobId: result.jobId,
176
- state: result.state,
177
- txid: result.txid,
178
- ...(result.error ? { error: result.error } : {}),
179
- },
180
- opts,
181
- )
182
- } finally {
183
- await destroy()
184
- }
185
- }
186
-
187
- async function opnsMineStatus(
188
- args: string[],
189
- opts: GlobalFlags,
190
- ): Promise<void> {
191
- const jobId = extractFlag(args, '--job')
192
- const serviceUrl = extractFlag(args, '--service')
193
-
194
- if (!jobId) fatal('Missing --job <paymentTxid>')
195
- if (!serviceUrl) fatal('Missing --service <url>')
196
-
197
- const privateKey = await loadKey()
198
- const { ctx, destroy } = await loadContext(privateKey, {
199
- chain: opts.chain,
200
- })
201
-
202
- try {
203
- const result = await opnsMineStatusAction.execute(ctx, {
204
- jobId,
205
- serviceUrl,
206
- })
207
- if (result.error && !result.state) {
208
- fatal(result.error)
209
- }
210
- output(result, opts)
211
- } finally {
212
- await destroy()
213
- }
214
- }
215
-
216
- async function opnsMineRefund(
217
- args: string[],
218
- opts: GlobalFlags,
219
- ): Promise<void> {
220
- const jobId = extractFlag(args, '--job')
221
- const serviceUrl = extractFlag(args, '--service')
222
-
223
- if (!jobId) fatal('Missing --job <paymentTxid>')
224
- if (!serviceUrl) fatal('Missing --service <url>')
225
-
226
- const privateKey = await loadKey()
227
- const { ctx, destroy } = await loadContext(privateKey, {
228
- chain: opts.chain,
229
- })
230
-
231
- try {
232
- const result = await opnsMineRefundAction.execute(ctx, {
233
- jobId,
234
- serviceUrl,
235
- })
236
- if (result.error) {
237
- fatal(result.error)
238
- }
239
- output(result, opts)
240
- } finally {
241
- await destroy()
242
- }
243
- }
244
-
245
129
  async function opnsLookup(_args: string[], opts: GlobalFlags): Promise<void> {
246
130
  const privateKey = await loadKey()
247
131
  const { ctx, destroy } = await loadContext(privateKey, {
package/src/help.ts CHANGED
@@ -503,32 +503,6 @@ export const COMMANDS: CommandSpec[] = [
503
503
  args: [{ flag: '--outpoint', values: '<txid.vout>', required: true }],
504
504
  },
505
505
  { name: 'lookup', description: 'List OpNS names from wallet' },
506
- {
507
- name: 'mine',
508
- description: 'Pay a mine service to mine a name into this wallet',
509
- args: [
510
- { flag: '--name', values: '<name>', required: true },
511
- { flag: '--service', values: '<url>', required: true },
512
- { flag: '--receive-address', values: '<addr>' },
513
- { flag: '--timeout', values: '<ms>' },
514
- ],
515
- },
516
- {
517
- name: 'mine-status',
518
- description: 'Check a mine job; internalize the name if complete',
519
- args: [
520
- { flag: '--job', values: '<paymentTxid>', required: true },
521
- { flag: '--service', values: '<url>', required: true },
522
- ],
523
- },
524
- {
525
- name: 'mine-refund',
526
- description: 'Claim the remaining funds of a failed mine job',
527
- args: [
528
- { flag: '--job', values: '<paymentTxid>', required: true },
529
- { flag: '--service', values: '<url>', required: true },
530
- ],
531
- },
532
506
  ],
533
507
  },
534
508