shinjuku-shield 0.3.228 → 0.3.230
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 +18 -6
- package/manifest.json +6 -6
- package/package.json +3 -3
- package/shinjuku-seller.mjs +45 -25
- package/shinjuku-wallet.mjs +184 -147
package/README.md
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
# Shinjuku Shield
|
|
2
2
|
|
|
3
|
+
On Windows, type `npm.cmd`, `npx.cmd` and `shinjuku.cmd` where a line below says `npm`, `npx` or `shinjuku`
|
|
4
|
+
(they run in Command Prompt and in PowerShell). App start lines, app configs and `claude mcp add ... npx ...` lines stay as they are.
|
|
5
|
+
|
|
3
6
|
Shinjuku Shield is a private wallet on your own computer. It pays for paid
|
|
4
7
|
web services and AI answers from your private balance, so the payment does
|
|
5
8
|
not show who paid. It works inside your AI app (Claude, Cursor, Codex) and in
|
|
6
9
|
a terminal. Only you hold the keys: they never leave your computer.
|
|
7
10
|
|
|
8
|
-
This is version 0.3.
|
|
11
|
+
This is version 0.3.230. The command is `shinjuku`.
|
|
9
12
|
|
|
10
13
|
## Set up
|
|
11
14
|
|
|
15
|
+
Linux:
|
|
16
|
+
|
|
12
17
|
```sh
|
|
13
|
-
npx -y shinjuku
|
|
18
|
+
npx -y shinjuku setup
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Windows (Command Prompt or PowerShell):
|
|
22
|
+
|
|
23
|
+
```bat
|
|
24
|
+
npx.cmd -y shinjuku setup
|
|
14
25
|
```
|
|
15
26
|
|
|
16
27
|
Setup does every step for you:
|
|
@@ -24,7 +35,7 @@ Setup does every step for you:
|
|
|
24
35
|
- It downloads and checks the files the wallet needs (about 200 MB), so later
|
|
25
36
|
payments do not wait for them.
|
|
26
37
|
- It offers to install the `shinjuku` command. On Windows it also puts that
|
|
27
|
-
command on your PATH: open a new window after setup to type `shinjuku`.
|
|
38
|
+
command on your PATH: open a new window after setup to type `shinjuku.cmd`.
|
|
28
39
|
- It writes a recovery file. Copy it to two offline places (for example two
|
|
29
40
|
USB drives), then delete it from this computer. It is the only way to get
|
|
30
41
|
your wallet back if this computer is lost.
|
|
@@ -84,7 +95,8 @@ who paid. The wallet keeps no copy of a conversation.
|
|
|
84
95
|
## The `shinjuku` command
|
|
85
96
|
|
|
86
97
|
Every wallet command starts with `shinjuku`, for example `shinjuku balance`,
|
|
87
|
-
`shinjuku add-funds` or `shinjuku chat`. `shinjuku help` lists them all.
|
|
98
|
+
`shinjuku add-funds` or `shinjuku chat`. `shinjuku help` lists them all. On Windows,
|
|
99
|
+
type `shinjuku.cmd`, for example `shinjuku.cmd balance`.
|
|
88
100
|
|
|
89
101
|
## What you need
|
|
90
102
|
|
|
@@ -100,7 +112,7 @@ Add it yourself. The name of the wallet in your app is `shinjuku`.
|
|
|
100
112
|
Claude Code:
|
|
101
113
|
|
|
102
114
|
```sh
|
|
103
|
-
claude mcp add --scope user shinjuku -- npx -y --prefer-offline --no-audit --no-fund shinjuku-shield@0.3.
|
|
115
|
+
claude mcp add --scope user shinjuku -- npx -y --prefer-offline --no-audit --no-fund shinjuku-shield@0.3.230 mcp
|
|
104
116
|
```
|
|
105
117
|
|
|
106
118
|
`--prefer-offline` runs the copy of the wallet that npm saved. If npm has not saved it yet, that start asks
|
|
@@ -119,7 +131,7 @@ with the Releases table in
|
|
|
119
131
|
Versions are published from GitHub Actions with npm provenance.
|
|
120
132
|
|
|
121
133
|
`shinjuku-shield` is the package that holds the wallet. `shinjuku-shielded`
|
|
122
|
-
0.3.
|
|
134
|
+
0.3.230, its older name, runs this package at the same version, so wallets
|
|
123
135
|
installed under that name keep updating. New installs use `shinjuku`.
|
|
124
136
|
|
|
125
137
|
The full guide is
|
package/manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "carbon-shielded-wallet/bundle-manifest/v1",
|
|
3
3
|
"file": "shinjuku-wallet.mjs",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"bytes":
|
|
6
|
-
"sourceCommit": "
|
|
4
|
+
"sha256": "2fc5d76655c3647dc53aa68ae46db4a45cc69964f6f514a089e0ce253e7f70bc",
|
|
5
|
+
"bytes": 10371626,
|
|
6
|
+
"sourceCommit": "c0704a702c21b172d0103f473ee317d42c847048",
|
|
7
7
|
"sourceDirty": false,
|
|
8
8
|
"installRecordMatchesLockfile": true,
|
|
9
9
|
"releaseRule": "valid only when two fresh npm ci --ignore-scripts builds on different OSes give the same sha256; installRecordMatchesLockfile true means every entry npm installed equals its package-lock.json entry and every entry not marked optional, devOptional included, is installed: an optional entry (a package for another platform) may be absent",
|
|
@@ -1075,8 +1075,8 @@
|
|
|
1075
1075
|
],
|
|
1076
1076
|
"seller": {
|
|
1077
1077
|
"file": "shinjuku-seller.mjs",
|
|
1078
|
-
"sha256": "
|
|
1079
|
-
"bytes":
|
|
1078
|
+
"sha256": "10b55d5356a04206c53b602d2c4d5157881619a1121dff4b7700b5b4fa31ffe9",
|
|
1079
|
+
"bytes": 4194469,
|
|
1080
1080
|
"entry": "wallet/src/seller/exact/index.mjs",
|
|
1081
1081
|
"external": [
|
|
1082
1082
|
"@x402/core/http",
|
|
@@ -1968,5 +1968,5 @@
|
|
|
1968
1968
|
}
|
|
1969
1969
|
]
|
|
1970
1970
|
},
|
|
1971
|
-
"publishedAt": "2026-11-
|
|
1971
|
+
"publishedAt": "2026-11-13T11:54:24.076Z"
|
|
1972
1972
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.230",
|
|
4
4
|
"mcpName": "io.github.ShinjukuStaition/shinjuku-shield",
|
|
5
5
|
"description": "Shinjuku Shield, private x402 payments on Solana: the self-custody wallet CLI and its MCP server. Shield, pay, and unshield USDC from any MCP agent, under caps you set.",
|
|
6
|
-
"shinjukuRelease": "
|
|
7
|
-
"shinjukuSha256": "
|
|
6
|
+
"shinjukuRelease": "2fc5d766",
|
|
7
|
+
"shinjukuSha256": "2fc5d76655c3647dc53aa68ae46db4a45cc69964f6f514a089e0ce253e7f70bc",
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
9
9
|
"author": "Shinjuku Shield",
|
|
10
10
|
"homepage": "https://github.com/ShinjukuStaition/shinjuku-shield#readme",
|
package/shinjuku-seller.mjs
CHANGED
|
@@ -32730,12 +32730,22 @@ function npxPackageWord(npmVersion) {
|
|
|
32730
32730
|
const version3 = knownNpmVersion(npmVersion);
|
|
32731
32731
|
return version3 ? `${NPX_PACKAGE}@${version3}` : NPX_PACKAGE;
|
|
32732
32732
|
}
|
|
32733
|
-
function
|
|
32734
|
-
return
|
|
32733
|
+
function typedCommandName(name, platform = process.platform) {
|
|
32734
|
+
return platform === "win32" ? `${name}.cmd` : name;
|
|
32735
32735
|
}
|
|
32736
|
-
function
|
|
32736
|
+
function oneTimeCommandLine(words, npmVersion, { npmArgs = [], platform, appLine = false } = {}) {
|
|
32737
|
+
return [npxCommandPrefix(npmVersion, { recovery: RECOVERY_WORDS.test(String(words ?? "")), npmArgs, platform, appLine }), words].join(" ");
|
|
32738
|
+
}
|
|
32739
|
+
function npxCommandPrefix(npmVersion, { recovery = false, npmArgs = [], platform = process.platform, appLine = false } = {}) {
|
|
32737
32740
|
const cache = knownNpmVersion(npmVersion) && !recovery ? npxCacheFlag() : void 0;
|
|
32738
|
-
return [
|
|
32741
|
+
return [
|
|
32742
|
+
appLine ? "npx" : typedCommandName("npx", platform),
|
|
32743
|
+
...cache ? [cache] : [],
|
|
32744
|
+
"-y",
|
|
32745
|
+
...NPX_INSTALL_FLAGS,
|
|
32746
|
+
...npmArgs,
|
|
32747
|
+
npxPackageWord(npmVersion)
|
|
32748
|
+
].join(" ");
|
|
32739
32749
|
}
|
|
32740
32750
|
function npxCacheFlag(home = setupHome()) {
|
|
32741
32751
|
let config;
|
|
@@ -32749,7 +32759,7 @@ function npxCacheFlag(home = setupHome()) {
|
|
|
32749
32759
|
}
|
|
32750
32760
|
function updateCommandLine(words, npmVersion) {
|
|
32751
32761
|
const version3 = knownNpmVersion(npmVersion);
|
|
32752
|
-
return `take the newest version in the Releases table at ${RELEASES_URL} and run ${["npx", "-y", ...NPX_INSTALL_FLAGS, `${NPX_PACKAGE}@<that version>`, words].filter(Boolean).join(" ")}` + (version3 ? ` (only a version newer than ${version3}, the one that runs now, is an update)` : "");
|
|
32762
|
+
return `take the newest version in the Releases table at ${RELEASES_URL} and run ${[typedCommandName("npx"), "-y", ...NPX_INSTALL_FLAGS, `${NPX_PACKAGE}@<that version>`, words].filter(Boolean).join(" ")}` + (version3 ? ` (only a version newer than ${version3}, the one that runs now, is an update)` : "");
|
|
32753
32763
|
}
|
|
32754
32764
|
function hermesServerLines(entry, { indent, keyIndent, extra = [] }) {
|
|
32755
32765
|
const pad = " ".repeat(keyIndent);
|
|
@@ -32910,7 +32920,7 @@ var init_config = __esm({
|
|
|
32910
32920
|
OLDER_HOME_FOLDER = ".carbon-shielded-wallet";
|
|
32911
32921
|
configPath = (home) => join2(home, CONFIG_FILE);
|
|
32912
32922
|
homeWalletPath = (home, pool2) => join2(home, pool2, "wallet.json");
|
|
32913
|
-
invalid = (why) => new Error(`setup_config_invalid: config.json ${why}; rerun
|
|
32923
|
+
invalid = (why) => new Error(`setup_config_invalid: config.json ${why}; rerun ${typedCommandName(COMMAND_PACKAGE)} setup (it keeps the wallet) or fix the file`);
|
|
32914
32924
|
isPubkey = (value2) => {
|
|
32915
32925
|
try {
|
|
32916
32926
|
return typeof value2 === "string" && new import_web3.PublicKey(value2).toBase58() === value2;
|
|
@@ -39615,12 +39625,13 @@ function sameCommandOnPath({ npmVersion = ownNpmVersion(), env, platform } = {})
|
|
|
39615
39625
|
if (own) keptSame = { npmVersion, same: same2 };
|
|
39616
39626
|
return same2;
|
|
39617
39627
|
}
|
|
39618
|
-
function commandPrefix({ npmVersion = ownNpmVersion(), env, platform, recovery = false } = {}) {
|
|
39619
|
-
return sameCommandOnPath({ npmVersion, env, platform }) ? COMMAND_PACKAGE : npxCommandPrefix(npmVersion, { recovery });
|
|
39628
|
+
function commandPrefix({ npmVersion = ownNpmVersion(), env, platform = process.platform, recovery = false } = {}) {
|
|
39629
|
+
return sameCommandOnPath({ npmVersion, env, platform }) ? typedCommandName(COMMAND_PACKAGE, platform) : npxCommandPrefix(npmVersion, { recovery, platform });
|
|
39620
39630
|
}
|
|
39621
|
-
function commandLine(words, { npmVersion = ownNpmVersion(), env, platform } = {}) {
|
|
39622
|
-
|
|
39623
|
-
return words ?
|
|
39631
|
+
function commandLine(words, { npmVersion = ownNpmVersion(), env, platform = process.platform } = {}) {
|
|
39632
|
+
const name = typedCommandName(COMMAND_PACKAGE, platform);
|
|
39633
|
+
if (sameCommandOnPath({ npmVersion, env, platform })) return words ? `${name} ${words}` : name;
|
|
39634
|
+
return words ? oneTimeCommandLine(words, npmVersion, { platform }) : npxCommandPrefix(npmVersion, { platform });
|
|
39624
39635
|
}
|
|
39625
39636
|
function compareNpmVersions(a, b) {
|
|
39626
39637
|
const x = NPM_VERSION.exec(String(a ?? ""));
|
|
@@ -55904,10 +55915,13 @@ var init_chain2 = __esm({
|
|
|
55904
55915
|
});
|
|
55905
55916
|
|
|
55906
55917
|
// wallet/src/sellerKey.mjs
|
|
55918
|
+
var SHINJUKU_WORD;
|
|
55907
55919
|
var init_sellerKey = __esm({
|
|
55908
55920
|
"wallet/src/sellerKey.mjs"() {
|
|
55909
55921
|
"use strict";
|
|
55910
55922
|
init_reference2();
|
|
55923
|
+
init_config();
|
|
55924
|
+
SHINJUKU_WORD = typedCommandName("shinjuku");
|
|
55911
55925
|
}
|
|
55912
55926
|
});
|
|
55913
55927
|
|
|
@@ -70312,9 +70326,9 @@ function readSaleLane(sellerFolder) {
|
|
|
70312
70326
|
const path = join18(sellerFolder, SALE_LANE_FILE);
|
|
70313
70327
|
if (!existsSync(path)) return void 0;
|
|
70314
70328
|
if (recoveryFilePrivate(path, { refuseMacAccessList: true }) !== true) {
|
|
70315
|
-
throw new Error("seller_sale_lane_not_private: other accounts on this computer can read the seller's key file; run
|
|
70329
|
+
throw new Error("seller_sale_lane_not_private: other accounts on this computer can read the seller's key file; run " + SHINJUKU_WORD2 + " seller setup again");
|
|
70316
70330
|
}
|
|
70317
|
-
const invalid2 = () => new Error("seller_sale_lane_invalid: the seller's key file is damaged; run
|
|
70331
|
+
const invalid2 = () => new Error("seller_sale_lane_invalid: the seller's key file is damaged; run " + SHINJUKU_WORD2 + " seller setup again");
|
|
70318
70332
|
const record = readJson(path);
|
|
70319
70333
|
if (record?.schema !== LANE_SCHEMA || !LANE_ID.test(String(record.laneId)) || typeof record.pool !== "string" || typeof record.mint !== "string" || typeof record.receiveShielded !== "string" || !record.receiveShielded.startsWith("sx4021_")) throw invalid2();
|
|
70320
70334
|
const secret = Buffer.from(String(record.laneSecretBase64), "base64");
|
|
@@ -70391,12 +70405,14 @@ function readSaleView(walletPath2) {
|
|
|
70391
70405
|
const view = readJson(saleViewPath(walletPath2));
|
|
70392
70406
|
return view?.schema === VIEW_SCHEMA && Array.isArray(view.rows) && isSeconds(view.at) ? view : void 0;
|
|
70393
70407
|
}
|
|
70394
|
-
var SALE_LANE_FILE, LANE_SCHEMA, BOOK_SCHEMA, VIEW_SCHEMA, ATOMIC3, DIGEST2, LANE_ID, SALE_MOVING_STATES, SALE_STATES, BOOK_KEEP_SECONDS, BOOK_KEEP_RECORDS, nowSeconds2, isSeconds, saleBookPath, saleViewPath;
|
|
70408
|
+
var SHINJUKU_WORD2, SALE_LANE_FILE, LANE_SCHEMA, BOOK_SCHEMA, VIEW_SCHEMA, ATOMIC3, DIGEST2, LANE_ID, SALE_MOVING_STATES, SALE_STATES, BOOK_KEEP_SECONDS, BOOK_KEEP_RECORDS, nowSeconds2, isSeconds, saleBookPath, saleViewPath;
|
|
70395
70409
|
var init_files = __esm({
|
|
70396
70410
|
"wallet/src/seller/sale/files.mjs"() {
|
|
70397
70411
|
"use strict";
|
|
70398
70412
|
init_fs();
|
|
70399
70413
|
init_recoveryFile();
|
|
70414
|
+
init_config();
|
|
70415
|
+
SHINJUKU_WORD2 = typedCommandName("shinjuku");
|
|
70400
70416
|
SALE_LANE_FILE = "sale-lane.json";
|
|
70401
70417
|
LANE_SCHEMA = "shinjuku-seller-sale-lane/v1";
|
|
70402
70418
|
BOOK_SCHEMA = "shinjuku-seller-sale-book/v1";
|
|
@@ -70886,7 +70902,7 @@ It asks the amount, then gives a one-time address and its QR code: send USDC to
|
|
|
70886
70902
|
} else {
|
|
70887
70903
|
item.inputs = reserve(inputs, `in-flight ${item.kind} ${entry.name}`, entry.record.memoDigest);
|
|
70888
70904
|
}
|
|
70889
|
-
item.next = selfPay ? userSend ? "the user's own send: it goes on by itself; asking for the same send again (the same request id) resumes it and never sends twice" : "the wallet's own step to get the balance ready: it goes on by itself; nothing to do" : entry.state === "submitted" ? "rerun the same pay command: it resends the same payment and never pays twice (cancel works only two minutes after its quote expired, when the pool's public history shows it never landed)" :
|
|
70905
|
+
item.next = selfPay ? userSend ? "the user's own send: it goes on by itself; asking for the same send again (the same request id) resumes it and never sends twice" : "the wallet's own step to get the balance ready: it goes on by itself; nothing to do" : entry.state === "submitted" ? "rerun the same pay command: it resends the same payment and never pays twice (cancel works only two minutes after its quote expired, when the pool's public history shows it never landed)" : `rerun the same pay command to finish it, or close it with ${SHINJUKU_WORD3} cancel`;
|
|
70890
70906
|
detail.inFlight.push(item);
|
|
70891
70907
|
} else if (entry.type === "unshield" && entry.state === "paid") {
|
|
70892
70908
|
const note = String(entry.record.noteCommitment);
|
|
@@ -71032,7 +71048,7 @@ If a payment to this wallet settled, read the chain again with:
|
|
|
71032
71048
|
}
|
|
71033
71049
|
return report("current", spendable + successionMovableAtomic, next, void 0, largest);
|
|
71034
71050
|
}
|
|
71035
|
-
var PAY_ME_WAL_SCHEMA, BALANCE_SNAPSHOT_SCHEMA, BALANCE_SNAPSHOT_FILE, STALE_CAUSES, LARGEST_PAYMENTS, CHANGE_SETTLING, CHANGE_COUNT, CHANGE_REST_OTHER, SPEND_INPUTS, SEND_HOLDS, PAYMENT_SETTLING_MS, NO_VALUE_TYPES, PLAN_ONLY_TYPES, UNSENT_SELF_PAY_FIELDS, isUnsentSelfPay, planOnly, SNAPSHOT_KEY_LABEL, MAINNET_USDC, SELF_PAY_ORIGIN, POCKET_FILL_RECORD, MERGE_RECORD, POOL_MOVE_SCHEMA, FLOAT_PAYMENT_SCHEMA, POOL_MOVE_PATH, POOL_SUCCESSION_SCHEMAS, digestKey, canonicalAtomic, SUCCESSION_JOB_SCHEMA, MERGE_PAYMENT_PATH, spendEntry, PROOF_RECORD;
|
|
71051
|
+
var PAY_ME_WAL_SCHEMA, SHINJUKU_WORD3, BALANCE_SNAPSHOT_SCHEMA, BALANCE_SNAPSHOT_FILE, STALE_CAUSES, LARGEST_PAYMENTS, CHANGE_SETTLING, CHANGE_COUNT, CHANGE_REST_OTHER, SPEND_INPUTS, SEND_HOLDS, PAYMENT_SETTLING_MS, NO_VALUE_TYPES, PLAN_ONLY_TYPES, UNSENT_SELF_PAY_FIELDS, isUnsentSelfPay, planOnly, SNAPSHOT_KEY_LABEL, MAINNET_USDC, SELF_PAY_ORIGIN, POCKET_FILL_RECORD, MERGE_RECORD, POOL_MOVE_SCHEMA, FLOAT_PAYMENT_SCHEMA, POOL_MOVE_PATH, POOL_SUCCESSION_SCHEMAS, digestKey, canonicalAtomic, SUCCESSION_JOB_SCHEMA, MERGE_PAYMENT_PATH, spendEntry, PROOF_RECORD;
|
|
71036
71052
|
var init_balance = __esm({
|
|
71037
71053
|
"wallet/src/balance/balance.mjs"() {
|
|
71038
71054
|
"use strict";
|
|
@@ -71051,6 +71067,7 @@ var init_balance = __esm({
|
|
|
71051
71067
|
init_floatPay();
|
|
71052
71068
|
init_plan();
|
|
71053
71069
|
PAY_ME_WAL_SCHEMA = "carbon-shielded-wallet/pay-me/v1";
|
|
71070
|
+
SHINJUKU_WORD3 = typedCommandName("shinjuku");
|
|
71054
71071
|
BALANCE_SNAPSHOT_SCHEMA = "carbon-shielded-wallet/balance-snapshot/v1";
|
|
71055
71072
|
BALANCE_SNAPSHOT_FILE = "balance-snapshot.json";
|
|
71056
71073
|
STALE_CAUSES = /* @__PURE__ */ new WeakMap();
|
|
@@ -79530,10 +79547,12 @@ function createSaleWatcher({ baseUrl, fetchImpl, signer, laneId, walletPath: wal
|
|
|
79530
79547
|
}
|
|
79531
79548
|
|
|
79532
79549
|
// wallet/src/seller/sale/run.mjs
|
|
79550
|
+
init_config();
|
|
79551
|
+
var SHINJUKU_WORD4 = typedCommandName("shinjuku");
|
|
79533
79552
|
var fail20 = (reason) => {
|
|
79534
79553
|
throw new Error(`seller_${reason}`);
|
|
79535
79554
|
};
|
|
79536
|
-
var SETUP_AGAIN =
|
|
79555
|
+
var SETUP_AGAIN = `run ${SHINJUKU_WORD4} seller setup again`;
|
|
79537
79556
|
async function startSalePath({ baseUrl, fetchImpl, lane, walletPath: walletPath2, saleReceive, mint, express, network, scheme }) {
|
|
79538
79557
|
const signer = laneSigner(lane.secret);
|
|
79539
79558
|
if (laneIdOf(signer.publicKey) !== lane.laneId) fail20(`sale_lane_invalid: the seller's lane file does not fit its key; ${SETUP_AGAIN}`);
|
|
@@ -80968,6 +80987,7 @@ var usdc = (atomic4) => {
|
|
|
80968
80987
|
var PROXY_FLAGS = Object.freeze(["--upstream", "--public-origin", "--port"]);
|
|
80969
80988
|
|
|
80970
80989
|
// wallet/src/seller/exact/index.mjs
|
|
80990
|
+
var SHINJUKU_WORD5 = typedCommandName("shinjuku");
|
|
80971
80991
|
var DEFAULT_MAX_TIMEOUT_SECONDS = 60;
|
|
80972
80992
|
var ROUTE_KEY = /^(GET|POST) (\/[^?#\s*:[\]]*)$/;
|
|
80973
80993
|
var fail21 = (reason) => {
|
|
@@ -81011,18 +81031,18 @@ function torHistoryConnection(connection, pool2, torFetch) {
|
|
|
81011
81031
|
routed = true;
|
|
81012
81032
|
return torFetch;
|
|
81013
81033
|
} });
|
|
81014
|
-
if (!routed) fail21("tor_history_unrouted: this wallet version cannot send its history reads through Tor, so nothing was sent; update shinjuku-shield, or run
|
|
81034
|
+
if (!routed) fail21("tor_history_unrouted: this wallet version cannot send its history reads through Tor, so nothing was sent; update shinjuku-shield, or run " + SHINJUKU_WORD5 + " seller setup again and choose no Tor");
|
|
81015
81035
|
return split3;
|
|
81016
81036
|
}
|
|
81017
81037
|
var RECOVERY_INTERVAL_MS = 5 * 6e4;
|
|
81018
|
-
var INSTALL_LINE = "npm install express @x402/express@2.27.0 @x402/svm@2.27.0
|
|
81038
|
+
var INSTALL_LINE = `${typedCommandName("npm")} install express @x402/express@2.27.0 @x402/svm@2.27.0`;
|
|
81019
81039
|
async function createShinjukuSeller({ home, passphraseFile, routes, fetchImpl = fetch } = {}) {
|
|
81020
81040
|
const walletHome2 = home ?? setUpSellerHome(process.env, homedir4()) ?? setupHome();
|
|
81021
|
-
const config = readSetupConfig(walletHome2) ?? fail21(`not_set_up: no wallet in ${walletHome2}; run
|
|
81041
|
+
const config = readSetupConfig(walletHome2) ?? fail21(`not_set_up: no wallet in ${walletHome2}; run ${SHINJUKU_WORD5} setup first`);
|
|
81022
81042
|
if (sellerMode(walletHome2)?.mode !== SELLER_MODES.anyBuyer) {
|
|
81023
|
-
fail21(`not_set_up: the seller of the wallet in ${walletHome2} is not set up for any x402 buyer; run
|
|
81043
|
+
fail21(`not_set_up: the seller of the wallet in ${walletHome2} is not set up for any x402 buyer; run ${SHINJUKU_WORD5} seller setup and answer 1`);
|
|
81024
81044
|
}
|
|
81025
|
-
const torChoice = networkChoice(walletHome2) ?? fail21(
|
|
81045
|
+
const torChoice = networkChoice(walletHome2) ?? fail21(`tor_choice_missing: run ${SHINJUKU_WORD5} seller setup again (it asks about Tor)`);
|
|
81026
81046
|
let express;
|
|
81027
81047
|
let svm;
|
|
81028
81048
|
let ExactSvmScheme2;
|
|
@@ -81087,7 +81107,7 @@ async function createShinjukuSeller({ home, passphraseFile, routes, fetchImpl =
|
|
|
81087
81107
|
if (lane) {
|
|
81088
81108
|
const sale = inbound.saleReceive;
|
|
81089
81109
|
if (inbound.network !== network || config.network !== network || lane.mint !== inbound.mint) fail21("network_mismatch: the wallet and the facilitator name another network or token");
|
|
81090
|
-
if (lane.pool !== config.pool) fail21("sale_address_other_pool: this wallet moved to another private pool after seller setup; run
|
|
81110
|
+
if (lane.pool !== config.pool) fail21("sale_address_other_pool: this wallet moved to another private pool after seller setup; run " + SHINJUKU_WORD5 + " seller setup again");
|
|
81091
81111
|
const options2 = await checkRoutes(routes, { scheme, network, inbound: { mint: inbound.mint, minimumAtomic: sale.minimumAtomic, maximumAtomic: sale.maximumAtomic } });
|
|
81092
81112
|
const walletPath2 = homeWalletPath(walletHome2, config.pool);
|
|
81093
81113
|
await walletLease(walletPath2);
|
|
@@ -81111,9 +81131,9 @@ async function createShinjukuSeller({ home, passphraseFile, routes, fetchImpl =
|
|
|
81111
81131
|
}
|
|
81112
81132
|
};
|
|
81113
81133
|
}
|
|
81114
|
-
if (!config.proofTools) fail21(
|
|
81134
|
+
if (!config.proofTools) fail21(`proof_tools_missing: rerun ${SHINJUKU_WORD5} setup (it keeps the wallet)`);
|
|
81115
81135
|
const proofTools = loadP03PublicPaymentProofTools(config.proofTools);
|
|
81116
|
-
if (!proofTools.depositProver) fail21(
|
|
81136
|
+
if (!proofTools.depositProver) fail21(`proof_tools_missing: rerun ${SHINJUKU_WORD5} setup (it keeps the wallet)`);
|
|
81117
81137
|
const store = openWalletStore(
|
|
81118
81138
|
homeWalletPath(walletHome2, config.pool),
|
|
81119
81139
|
readSecretText(passphraseFile ?? config.passphraseFile ?? join26(walletHome2, PASSPHRASE_FILE), "the passphrase file")
|