@1sat/cli 0.0.54 → 0.0.56
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 +6 -6
- package/src/commands/serve-messagebox.ts +11 -3
- package/src/config.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
4
4
|
"description": "CLI for 1Sat Ordinals SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/cli.ts",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@1sat/actions": "0.0.
|
|
29
|
-
"@1sat/client": "0.0.
|
|
30
|
-
"@1sat/types": "0.0.
|
|
31
|
-
"@1sat/wallet-node": "0.0.
|
|
32
|
-
"@1sat/wallet-server": "0.0.
|
|
28
|
+
"@1sat/actions": "0.0.132",
|
|
29
|
+
"@1sat/client": "0.0.28",
|
|
30
|
+
"@1sat/types": "0.0.21",
|
|
31
|
+
"@1sat/wallet-node": "0.0.45",
|
|
32
|
+
"@1sat/wallet-server": "0.0.14",
|
|
33
33
|
"@bsv/sdk": "^2.0.13",
|
|
34
34
|
"@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@2.1.21-parity-fix.2",
|
|
35
35
|
"chalk": "^5.0.0",
|
|
@@ -167,9 +167,6 @@ function resolveStorage(
|
|
|
167
167
|
const dataDir = ensureDataDir()
|
|
168
168
|
const filename =
|
|
169
169
|
messagebox.dbPath ?? join(dataDir, `messagebox-${chain}.db`)
|
|
170
|
-
// We pass `sqlite3` to satisfy the env-driven knexfile's alias check;
|
|
171
|
-
// the actual Client class is swapped in via ESM module mutation
|
|
172
|
-
// just before messagebox-server is imported.
|
|
173
170
|
return {
|
|
174
171
|
knexClient: 'sqlite3',
|
|
175
172
|
knexConnection: { filename },
|
|
@@ -177,6 +174,17 @@ function resolveStorage(
|
|
|
177
174
|
}
|
|
178
175
|
|
|
179
176
|
if (storage.provider === 'pg') {
|
|
177
|
+
// Prefer a dedicated messagebox database when configured (recommended:
|
|
178
|
+
// avoids `knex_migrations` table collisions with wallet-toolbox).
|
|
179
|
+
// Fall back to schema isolation against the wallet's database — note
|
|
180
|
+
// the `messagebox` schema must exist in that database for table
|
|
181
|
+
// creation to land there instead of `public`.
|
|
182
|
+
if (messagebox.dbUrl) {
|
|
183
|
+
return {
|
|
184
|
+
knexClient: 'pg',
|
|
185
|
+
knexConnection: { connectionString: messagebox.dbUrl },
|
|
186
|
+
}
|
|
187
|
+
}
|
|
180
188
|
const schema = messagebox.pgSchema ?? DEFAULT_PG_SCHEMA
|
|
181
189
|
return {
|
|
182
190
|
knexClient: 'pg',
|
package/src/config.ts
CHANGED
|
@@ -52,9 +52,15 @@ export interface ServerMessageboxConfig {
|
|
|
52
52
|
dbPath?: string
|
|
53
53
|
/**
|
|
54
54
|
* Postgres schema for messagebox tables. Used only when wallet storage
|
|
55
|
-
* is `pg
|
|
55
|
+
* is `pg` AND `dbUrl` is unset. Defaults to `messagebox`.
|
|
56
56
|
*/
|
|
57
57
|
pgSchema?: string
|
|
58
|
+
/**
|
|
59
|
+
* Override Postgres connection URL for messagebox storage. Use this
|
|
60
|
+
* to point messagebox at a separate Postgres database from the wallet
|
|
61
|
+
* (recommended — avoids `knex_migrations` table collisions).
|
|
62
|
+
*/
|
|
63
|
+
dbUrl?: string
|
|
58
64
|
/**
|
|
59
65
|
* Override the wallet storage URL messagebox calls for BRC-31/BRC-29
|
|
60
66
|
* operations. Defaults to the local wallet server URL (`http://<host>:<port>/`).
|