@1sat/cli 0.0.127 → 0.0.129
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/README.md +1 -1
- package/dist/cli.js +18 -3
- package/package.json +9 -9
- package/src/commands/opns.ts +11 -2
- package/src/help.ts +6 -1
package/README.md
CHANGED
|
@@ -224,7 +224,7 @@ OpNS (Ordinals Name System) binds your BAP identity to an on-chain name inscript
|
|
|
224
224
|
|
|
225
225
|
```bash
|
|
226
226
|
1sat opns lookup # List OpNS names in your wallet
|
|
227
|
-
1sat opns register --
|
|
227
|
+
1sat opns register --id <id> --domain <host> # Bind your identity to a name
|
|
228
228
|
1sat opns deregister --outpoint <txid.vout> # Remove the identity binding
|
|
229
229
|
```
|
|
230
230
|
|
package/dist/cli.js
CHANGED
|
@@ -1362,7 +1362,12 @@ var init_help = __esm(() => {
|
|
|
1362
1362
|
{
|
|
1363
1363
|
name: "register",
|
|
1364
1364
|
description: "Register identity on an owned OpNS name",
|
|
1365
|
-
args: [
|
|
1365
|
+
args: [
|
|
1366
|
+
{ flag: "--id", values: "<tracking-id>", required: true },
|
|
1367
|
+
{ flag: "--domain", values: "<hostname>", required: true },
|
|
1368
|
+
{ flag: "--name", values: "<display name>" },
|
|
1369
|
+
{ flag: "--avatar", values: "<txid_vout>" }
|
|
1370
|
+
]
|
|
1366
1371
|
},
|
|
1367
1372
|
{
|
|
1368
1373
|
name: "deregister",
|
|
@@ -2700,9 +2705,19 @@ function requireId(args) {
|
|
|
2700
2705
|
}
|
|
2701
2706
|
async function opnsRegister(args, opts) {
|
|
2702
2707
|
const id = requireId(args);
|
|
2708
|
+
const domain = extractFlag(args, "--domain");
|
|
2709
|
+
if (!domain)
|
|
2710
|
+
fatal("Missing --domain <hostname> (e.g. 1sat.name)");
|
|
2711
|
+
const name = extractFlag(args, "--name");
|
|
2712
|
+
const avatar = extractFlag(args, "--avatar");
|
|
2713
|
+
const profile = {
|
|
2714
|
+
domain,
|
|
2715
|
+
...name ? { name } : {},
|
|
2716
|
+
...avatar ? { avatar } : {}
|
|
2717
|
+
};
|
|
2703
2718
|
if (!opts.yes) {
|
|
2704
2719
|
const ok = await confirm4({
|
|
2705
|
-
message: `Register identity on OpNS id ${id}?`
|
|
2720
|
+
message: `Register identity on OpNS id ${id} at ${domain}?`
|
|
2706
2721
|
});
|
|
2707
2722
|
if (isCancel5(ok) || !ok)
|
|
2708
2723
|
fatal("Registration cancelled.");
|
|
@@ -2710,7 +2725,7 @@ async function opnsRegister(args, opts) {
|
|
|
2710
2725
|
const privateKey = await loadKey();
|
|
2711
2726
|
const { ctx, destroy } = await loadContext(privateKey, { chain: opts.chain });
|
|
2712
2727
|
try {
|
|
2713
|
-
const result = await registerOpns.execute(ctx, { id });
|
|
2728
|
+
const result = await registerOpns.execute(ctx, { id, profile });
|
|
2714
2729
|
if (result.error)
|
|
2715
2730
|
fatal(result.error);
|
|
2716
2731
|
output(opts.json ? result : { txid: result.txid }, opts);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.129",
|
|
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.
|
|
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.231",
|
|
31
|
+
"@1sat/client": "0.0.60",
|
|
32
|
+
"@1sat/types": "0.0.51",
|
|
33
|
+
"@1sat/wallet": "0.0.117",
|
|
34
|
+
"@1sat/wallet-node": "0.0.84",
|
|
35
|
+
"@1sat/wallet-server": "0.0.62",
|
|
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.
|
|
39
|
-
"@bsv/wallet-toolbox-client": "npm:@bopen-io/wallet-toolbox-client@2.14.
|
|
38
|
+
"@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@2.14.6",
|
|
39
|
+
"@bsv/wallet-toolbox-client": "npm:@bopen-io/wallet-toolbox-client@2.14.6",
|
|
40
40
|
"@clack/prompts": "^0.8.0",
|
|
41
41
|
"bitcoin-backup": "^0.0.11",
|
|
42
42
|
"chalk": "^5.0.0",
|
package/src/commands/opns.ts
CHANGED
|
@@ -62,10 +62,19 @@ function requireId(args: string[]): string {
|
|
|
62
62
|
|
|
63
63
|
async function opnsRegister(args: string[], opts: GlobalFlags): Promise<void> {
|
|
64
64
|
const id = requireId(args)
|
|
65
|
+
const domain = extractFlag(args, '--domain')
|
|
66
|
+
if (!domain) fatal('Missing --domain <hostname> (e.g. 1sat.name)')
|
|
67
|
+
const name = extractFlag(args, '--name')
|
|
68
|
+
const avatar = extractFlag(args, '--avatar')
|
|
69
|
+
const profile = {
|
|
70
|
+
domain,
|
|
71
|
+
...(name ? { name } : {}),
|
|
72
|
+
...(avatar ? { avatar } : {}),
|
|
73
|
+
}
|
|
65
74
|
|
|
66
75
|
if (!opts.yes) {
|
|
67
76
|
const ok = await confirm({
|
|
68
|
-
message: `Register identity on OpNS id ${id}?`,
|
|
77
|
+
message: `Register identity on OpNS id ${id} at ${domain}?`,
|
|
69
78
|
})
|
|
70
79
|
if (isCancel(ok) || !ok) fatal('Registration cancelled.')
|
|
71
80
|
}
|
|
@@ -74,7 +83,7 @@ async function opnsRegister(args: string[], opts: GlobalFlags): Promise<void> {
|
|
|
74
83
|
const { ctx, destroy } = await loadContext(privateKey, { chain: opts.chain })
|
|
75
84
|
|
|
76
85
|
try {
|
|
77
|
-
const result = await registerOpns.execute(ctx, { id })
|
|
86
|
+
const result = await registerOpns.execute(ctx, { id, profile })
|
|
78
87
|
if (result.error) fatal(result.error)
|
|
79
88
|
output(opts.json ? result : { txid: result.txid }, opts)
|
|
80
89
|
} finally {
|
package/src/help.ts
CHANGED
|
@@ -607,7 +607,12 @@ export const COMMANDS: CommandSpec[] = [
|
|
|
607
607
|
{
|
|
608
608
|
name: 'register',
|
|
609
609
|
description: 'Register identity on an owned OpNS name',
|
|
610
|
-
args: [
|
|
610
|
+
args: [
|
|
611
|
+
{ flag: '--id', values: '<tracking-id>', required: true },
|
|
612
|
+
{ flag: '--domain', values: '<hostname>', required: true },
|
|
613
|
+
{ flag: '--name', values: '<display name>' },
|
|
614
|
+
{ flag: '--avatar', values: '<txid_vout>' },
|
|
615
|
+
],
|
|
611
616
|
},
|
|
612
617
|
{
|
|
613
618
|
name: 'deregister',
|