shinjuku-shield 0.3.208 → 0.3.210
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 +4 -4
- package/manifest.json +6 -6
- package/package.json +3 -3
- package/shinjuku-seller.mjs +37 -17
- package/shinjuku-wallet.mjs +124 -40
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@ web services and AI answers from your private balance, so the payment does
|
|
|
5
5
|
not show who paid. It works inside your AI app (Claude, Cursor, Codex) and in
|
|
6
6
|
a terminal. Only you hold the keys: they never leave your computer.
|
|
7
7
|
|
|
8
|
-
This is version 0.3.
|
|
8
|
+
This is version 0.3.210. The command is `shinjuku`.
|
|
9
9
|
|
|
10
10
|
## Set up
|
|
11
11
|
|
|
12
12
|
```sh
|
|
13
|
-
npx -y shinjuku@0.3.
|
|
13
|
+
npx -y shinjuku@0.3.210 setup
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Setup does every step for you:
|
|
@@ -100,7 +100,7 @@ Add it yourself. The name of the wallet in your app is `shinjuku`.
|
|
|
100
100
|
Claude Code:
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
|
-
claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.
|
|
103
|
+
claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.210 mcp
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
## For builders: check what you install
|
|
@@ -116,7 +116,7 @@ with the Releases table in
|
|
|
116
116
|
Versions are published from GitHub Actions with npm provenance.
|
|
117
117
|
|
|
118
118
|
`shinjuku-shield` is the package that holds the wallet. `shinjuku-shielded`
|
|
119
|
-
0.3.
|
|
119
|
+
0.3.210, its older name, runs this package at the same version, so wallets
|
|
120
120
|
installed under that name keep updating. New installs use `shinjuku`.
|
|
121
121
|
|
|
122
122
|
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": "2b7c138c4c824705da41d7d40c276b95bd8d546a6f80c782fdc5b698c8946996",
|
|
5
|
+
"bytes": 9650108,
|
|
6
|
+
"sourceCommit": "df5b9ea5aa1a330598af3851cdda6bddbc48e581",
|
|
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",
|
|
@@ -1040,8 +1040,8 @@
|
|
|
1040
1040
|
],
|
|
1041
1041
|
"seller": {
|
|
1042
1042
|
"file": "shinjuku-seller.mjs",
|
|
1043
|
-
"sha256": "
|
|
1044
|
-
"bytes":
|
|
1043
|
+
"sha256": "f8f72239b2288bbf4f253967545cc120adda2500902af29c8693117bc104dbac",
|
|
1044
|
+
"bytes": 4093726,
|
|
1045
1045
|
"entry": "wallet/src/seller/exact/index.mjs",
|
|
1046
1046
|
"external": [
|
|
1047
1047
|
"@x402/core/http",
|
|
@@ -1933,5 +1933,5 @@
|
|
|
1933
1933
|
}
|
|
1934
1934
|
]
|
|
1935
1935
|
},
|
|
1936
|
-
"publishedAt": "2026-11-
|
|
1936
|
+
"publishedAt": "2026-11-11T06:50:53.278Z"
|
|
1937
1937
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.210",
|
|
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": "2b7c138c",
|
|
7
|
+
"shinjukuSha256": "2b7c138c4c824705da41d7d40c276b95bd8d546a6f80c782fdc5b698c8946996",
|
|
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
|
@@ -33344,6 +33344,22 @@ var init_secretFile = __esm({
|
|
|
33344
33344
|
}
|
|
33345
33345
|
});
|
|
33346
33346
|
|
|
33347
|
+
// wallet/src/net/globalDispatcher.mjs
|
|
33348
|
+
function activeGlobalDispatcher() {
|
|
33349
|
+
return globalThis[ACTIVE_KEY];
|
|
33350
|
+
}
|
|
33351
|
+
function setActiveGlobalDispatcher(dispatcher) {
|
|
33352
|
+
globalThis[ACTIVE_KEY] = dispatcher;
|
|
33353
|
+
}
|
|
33354
|
+
var UNDICI_MAJOR, ACTIVE_KEY;
|
|
33355
|
+
var init_globalDispatcher = __esm({
|
|
33356
|
+
"wallet/src/net/globalDispatcher.mjs"() {
|
|
33357
|
+
"use strict";
|
|
33358
|
+
UNDICI_MAJOR = Number.parseInt(String(process.versions.undici ?? ""), 10);
|
|
33359
|
+
ACTIVE_KEY = /* @__PURE__ */ Symbol.for(UNDICI_MAJOR >= 8 ? "undici.globalDispatcher.2" : "undici.globalDispatcher.1");
|
|
33360
|
+
}
|
|
33361
|
+
});
|
|
33362
|
+
|
|
33347
33363
|
// wallet/src/net/runEnd.mjs
|
|
33348
33364
|
function runSleep(ms) {
|
|
33349
33365
|
if (ended) return Promise.resolve();
|
|
@@ -33363,6 +33379,7 @@ var ended, sources, runEnded, runEndedError, sleeps;
|
|
|
33363
33379
|
var init_runEnd = __esm({
|
|
33364
33380
|
"wallet/src/net/runEnd.mjs"() {
|
|
33365
33381
|
"use strict";
|
|
33382
|
+
init_globalDispatcher();
|
|
33366
33383
|
ended = false;
|
|
33367
33384
|
sources = /* @__PURE__ */ new Set();
|
|
33368
33385
|
runEnded = () => ended;
|
|
@@ -34800,7 +34817,7 @@ function keepAliveDispatcher() {
|
|
|
34800
34817
|
if (shared !== void 0) return shared;
|
|
34801
34818
|
try {
|
|
34802
34819
|
if (proxiedRun()) return void 0;
|
|
34803
|
-
const global2 =
|
|
34820
|
+
const global2 = activeGlobalDispatcher();
|
|
34804
34821
|
if (global2?.constructor?.name !== "Agent") return void 0;
|
|
34805
34822
|
shared = new global2.constructor({ keepAliveTimeout: KEEP_ALIVE_MS, keepAliveMaxTimeout: KEEP_ALIVE_MS });
|
|
34806
34823
|
shared.on?.("connect", () => markPhase("socket-new"));
|
|
@@ -34817,7 +34834,7 @@ function payHostDispatcher() {
|
|
|
34817
34834
|
if (payHostShared !== void 0) return payHostShared;
|
|
34818
34835
|
try {
|
|
34819
34836
|
if (proxiedRun()) return void 0;
|
|
34820
|
-
const global2 =
|
|
34837
|
+
const global2 = activeGlobalDispatcher();
|
|
34821
34838
|
if (global2?.constructor?.name !== "Agent") return void 0;
|
|
34822
34839
|
payHostShared = new global2.constructor({ keepAliveTimeout: FLOAT_KEEP_ALIVE_MS, keepAliveMaxTimeout: FLOAT_KEEP_ALIVE_MS });
|
|
34823
34840
|
payHostShared.on?.("connect", () => markPhase("socket-new"));
|
|
@@ -34836,12 +34853,12 @@ function rpcKeepAliveInit(url, init = {}) {
|
|
|
34836
34853
|
const dispatcher = origin !== void 0 && payHostOrigins.has(origin) ? payHostDispatcher() : void 0;
|
|
34837
34854
|
return dispatcher === void 0 ? keepAliveInit(init) : { ...init, dispatcher };
|
|
34838
34855
|
}
|
|
34839
|
-
var
|
|
34856
|
+
var KEEP_ALIVE_MS, shared, FLOAT_KEEP_ALIVE_MS, payHostShared, payHostOrigins, DRAIN_MAX_BYTES;
|
|
34840
34857
|
var init_keepAlive = __esm({
|
|
34841
34858
|
"wallet/src/fetch/keepAlive.mjs"() {
|
|
34842
34859
|
"use strict";
|
|
34843
34860
|
init_phaseTiming();
|
|
34844
|
-
|
|
34861
|
+
init_globalDispatcher();
|
|
34845
34862
|
KEEP_ALIVE_MS = 2e4;
|
|
34846
34863
|
FLOAT_KEEP_ALIVE_MS = 24e4;
|
|
34847
34864
|
payHostOrigins = /* @__PURE__ */ new Set();
|
|
@@ -34888,6 +34905,7 @@ function proxyDispatcher(Dispatcher, proxy) {
|
|
|
34888
34905
|
httpProxy: proxy,
|
|
34889
34906
|
httpsProxy: proxy,
|
|
34890
34907
|
noProxy: "",
|
|
34908
|
+
proxyTunnel: true,
|
|
34891
34909
|
keepAliveTimeout: KEEP_ALIVE_MS,
|
|
34892
34910
|
keepAliveMaxTimeout: KEEP_ALIVE_MS,
|
|
34893
34911
|
clientFactory: () => tunnelClient(Dispatcher, port, url.hostname)
|
|
@@ -35174,6 +35192,7 @@ var init_facilitatorOnion = __esm({
|
|
|
35174
35192
|
init_rpcDefault();
|
|
35175
35193
|
init_tunnelGuard();
|
|
35176
35194
|
init_runEnd();
|
|
35195
|
+
init_globalDispatcher();
|
|
35177
35196
|
SITE_ONIONS = FACILITATOR_SITE_ONIONS;
|
|
35178
35197
|
SITE_SPARE_ONIONS = FACILITATOR_SPARE_ONIONS;
|
|
35179
35198
|
PINNED_FACILITATOR_ONIONS = Object.freeze({
|
|
@@ -37723,20 +37742,20 @@ async function moveToNewTorCircuit(why = "rate") {
|
|
|
37723
37742
|
return true;
|
|
37724
37743
|
}
|
|
37725
37744
|
function canSwitchTorTag() {
|
|
37726
|
-
return typeof http.setGlobalProxyFromEnv === "function" ||
|
|
37745
|
+
return typeof http.setGlobalProxyFromEnv === "function" || activeGlobalDispatcher()?.constructor?.name === "EnvHttpProxyAgent";
|
|
37727
37746
|
}
|
|
37728
37747
|
function switchTorTag() {
|
|
37729
37748
|
if (runEnded()) return;
|
|
37730
37749
|
const proxy = withRunTag(`http://${new URL(process.env[MARK].split(" ")[1]).host}`);
|
|
37731
37750
|
const env = proxyEnv(proxy);
|
|
37732
|
-
const oldGlobal =
|
|
37751
|
+
const oldGlobal = activeGlobalDispatcher();
|
|
37733
37752
|
Object.assign(process.env, env, { [MARK]: `tor ${proxy}` });
|
|
37734
37753
|
if (typeof http.setGlobalProxyFromEnv === "function") http.setGlobalProxyFromEnv(env);
|
|
37735
|
-
const nodeBuilt =
|
|
37754
|
+
const nodeBuilt = activeGlobalDispatcher();
|
|
37736
37755
|
const Dispatcher = [nodeBuilt, oldGlobal].find((one) => one?.constructor?.name === "EnvHttpProxyAgent")?.constructor;
|
|
37737
|
-
if (Dispatcher)
|
|
37756
|
+
if (Dispatcher) setActiveGlobalDispatcher(proxyDispatcher(Dispatcher, proxy));
|
|
37738
37757
|
const left = [...laneDispatchers.values()];
|
|
37739
|
-
for (const one of /* @__PURE__ */ new Set([oldGlobal, nodeBuilt])) if (one !== void 0 && one !==
|
|
37758
|
+
for (const one of /* @__PURE__ */ new Set([oldGlobal, nodeBuilt])) if (one !== void 0 && one !== activeGlobalDispatcher()) left.push(one);
|
|
37740
37759
|
laneDispatchers.clear();
|
|
37741
37760
|
setImmediate(() => {
|
|
37742
37761
|
for (const dispatcher of left) {
|
|
@@ -37754,7 +37773,7 @@ function switchTorTag() {
|
|
|
37754
37773
|
function torLaneInit(lane, init = {}) {
|
|
37755
37774
|
if (lane === 0 || !inTorRun() || runEnded()) return init;
|
|
37756
37775
|
try {
|
|
37757
|
-
const global2 =
|
|
37776
|
+
const global2 = activeGlobalDispatcher();
|
|
37758
37777
|
if (global2?.constructor?.name !== "EnvHttpProxyAgent") return init;
|
|
37759
37778
|
let dispatcher = laneDispatchers.get(lane);
|
|
37760
37779
|
if (dispatcher === void 0) {
|
|
@@ -37789,7 +37808,7 @@ function onCurrentCircuit(init) {
|
|
|
37789
37808
|
}
|
|
37790
37809
|
function onOwnTorTag(task) {
|
|
37791
37810
|
if (!inTorRun() || onOwnTagNow()) return task();
|
|
37792
|
-
const global2 =
|
|
37811
|
+
const global2 = activeGlobalDispatcher();
|
|
37793
37812
|
if (global2?.constructor?.name !== "EnvHttpProxyAgent") return task();
|
|
37794
37813
|
const proxy = withRunTag(`http://${new URL(process.env[MARK].split(" ")[1]).host}`);
|
|
37795
37814
|
return onOwnTagDispatcher(proxyDispatcher(global2.constructor, proxy), task);
|
|
@@ -37879,7 +37898,7 @@ async function rpcFetch(input, init) {
|
|
|
37879
37898
|
rpcNotBefore.set(post.key, Math.max(rpcNotBefore.get(post.key) ?? 0, Date.now() + retryAfterMs(response)));
|
|
37880
37899
|
}
|
|
37881
37900
|
}
|
|
37882
|
-
var relayKeyOf, READ_ONLY_METHOD, readOnlyPost, TOR_HTTP_TUNNEL, LOCAL_PROOF_TIMEOUT_MS, LOCAL_PROOF_MAX_BYTES, MARK, ownProxyRefused, ONION_V3, RETRY_AFTER_CAP_MS, RETRY_AFTER_FLOOR_MS, RETRY_AFTER_DEFAULT_MS, RPC_NO_ANSWER_LIMIT_MS, RPC_PACING_CAP_MS, PACING_NOTICE_EVERY_MS, PACING_RATE_WINDOW_MS, TOR_MAX_ROTATIONS, runStartedAt, rpcNotBefore, pacingWaiters, pacingSince, pacedMs, rpcAnswered, lastAnswerAt, readSteps, pacingNoticeAt, pacingSamples, torMoves, torCircuitId, torMovesRefused, pendingMove, inTorRunOf, inTorRun, isOnionOrigin, TOR_MIN_VERSION, TOR_EXPERT_BUNDLE, TOR_EXPERT_BUNDLE_SHA256, TOR_ARCHIVE, TOR_EXPERT_BUNDLE_URL, TOR_EXPERT_BUNDLES, TUNNEL_LINE, TOR_DEB_KEY, TOR_DEB_KEYRING, TOR_INSTALL, torStart, LOCAL_TUNNEL, torStartText, TOR_WINDOW, torUpdateHow, TOR_STOP_OLD_WINDOWS, torTooOldWhy, TOR_WAIT_WORDS, TOR_WAIT_PLAIN, withRunTag, proxyEnv, pacedSoFar, RESENDABLE_METHOD, torCircuit,
|
|
37901
|
+
var relayKeyOf, READ_ONLY_METHOD, readOnlyPost, TOR_HTTP_TUNNEL, LOCAL_PROOF_TIMEOUT_MS, LOCAL_PROOF_MAX_BYTES, MARK, ownProxyRefused, ONION_V3, RETRY_AFTER_CAP_MS, RETRY_AFTER_FLOOR_MS, RETRY_AFTER_DEFAULT_MS, RPC_NO_ANSWER_LIMIT_MS, RPC_PACING_CAP_MS, PACING_NOTICE_EVERY_MS, PACING_RATE_WINDOW_MS, TOR_MAX_ROTATIONS, runStartedAt, rpcNotBefore, pacingWaiters, pacingSince, pacedMs, rpcAnswered, lastAnswerAt, readSteps, pacingNoticeAt, pacingSamples, torMoves, torCircuitId, torMovesRefused, pendingMove, inTorRunOf, inTorRun, isOnionOrigin, TOR_MIN_VERSION, TOR_EXPERT_BUNDLE, TOR_EXPERT_BUNDLE_SHA256, TOR_ARCHIVE, TOR_EXPERT_BUNDLE_URL, TOR_EXPERT_BUNDLES, TUNNEL_LINE, TOR_DEB_KEY, TOR_DEB_KEYRING, TOR_INSTALL, torStart, LOCAL_TUNNEL, torStartText, TOR_WINDOW, torUpdateHow, TOR_STOP_OLD_WINDOWS, torTooOldWhy, TOR_WAIT_WORDS, TOR_WAIT_PLAIN, withRunTag, proxyEnv, pacedSoFar, RESENDABLE_METHOD, torCircuit, laneDispatchers, laneOfDispatcher;
|
|
37883
37902
|
var init_proxy = __esm({
|
|
37884
37903
|
"wallet/src/net/proxy.mjs"() {
|
|
37885
37904
|
"use strict";
|
|
@@ -37893,6 +37912,7 @@ var init_proxy = __esm({
|
|
|
37893
37912
|
init_rpcDefault();
|
|
37894
37913
|
init_phaseTiming();
|
|
37895
37914
|
init_homeJob();
|
|
37915
|
+
init_globalDispatcher();
|
|
37896
37916
|
relayKeyOf = (input) => {
|
|
37897
37917
|
if (!isShinjukuRelayUrl(input)) return void 0;
|
|
37898
37918
|
return `${new URL(typeof input === "string" || input instanceof URL ? input : input.url).origin}${FACILITATOR_RPC_PATH}`;
|
|
@@ -38011,7 +38031,6 @@ ${command}`;
|
|
|
38011
38031
|
pacedSoFar = () => pacedMs + (pacingWaiters > 0 ? Date.now() - pacingSince : 0);
|
|
38012
38032
|
RESENDABLE_METHOD = /^(get[A-Za-z]+|simulateTransaction|isBlockhashValid|minimumLedgerSlot|sendTransaction)$/;
|
|
38013
38033
|
torCircuit = () => torCircuitId;
|
|
38014
|
-
GLOBAL_DISPATCHER2 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
38015
38034
|
laneDispatchers = /* @__PURE__ */ new Map();
|
|
38016
38035
|
laneOfDispatcher = /* @__PURE__ */ new WeakMap();
|
|
38017
38036
|
registerRunDispatchers(() => laneDispatchers.values());
|
|
@@ -68402,6 +68421,7 @@ var init_floatPay = __esm({
|
|
|
68402
68421
|
init_plan();
|
|
68403
68422
|
init_runEnd();
|
|
68404
68423
|
init_paymentIdentifier();
|
|
68424
|
+
init_globalDispatcher();
|
|
68405
68425
|
init_floatWords();
|
|
68406
68426
|
MAX_BODY_BYTES = 12 * 1024;
|
|
68407
68427
|
REFUND_OUTCOME_NEWS_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -78666,6 +78686,7 @@ init_tunnelGuard();
|
|
|
78666
78686
|
init_serviceUrl();
|
|
78667
78687
|
init_backup();
|
|
78668
78688
|
init_files();
|
|
78689
|
+
init_globalDispatcher();
|
|
78669
78690
|
var cli = () => commandPrefix();
|
|
78670
78691
|
var SellerRefusal = class extends Error {
|
|
78671
78692
|
constructor(code, plain) {
|
|
@@ -78726,15 +78747,14 @@ function networkChoice(home) {
|
|
|
78726
78747
|
return void 0;
|
|
78727
78748
|
}
|
|
78728
78749
|
}
|
|
78729
|
-
var GLOBAL_DISPATCHER3 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
78730
78750
|
function proxyDispatcherClass() {
|
|
78731
78751
|
const refuse6 = () => new SellerRefusal("seller_tor_unsupported", `This Node.js (${process.version}) cannot send the seller's requests through Tor, so nothing was sent. Install Node.js 24 or newer, then run this again.`);
|
|
78732
78752
|
if (typeof http2.setGlobalProxyFromEnv !== "function") throw refuse6();
|
|
78733
|
-
const before =
|
|
78753
|
+
const before = activeGlobalDispatcher();
|
|
78734
78754
|
const restore = http2.setGlobalProxyFromEnv({ HTTP_PROXY: TOR_HTTP_TUNNEL, HTTPS_PROXY: TOR_HTTP_TUNNEL, NO_PROXY: "" });
|
|
78735
|
-
const Dispatcher =
|
|
78755
|
+
const Dispatcher = activeGlobalDispatcher()?.constructor;
|
|
78736
78756
|
if (typeof restore === "function") restore();
|
|
78737
|
-
if (
|
|
78757
|
+
if (activeGlobalDispatcher() !== before || Dispatcher?.name !== "EnvHttpProxyAgent") throw refuse6();
|
|
78738
78758
|
return Dispatcher;
|
|
78739
78759
|
}
|
|
78740
78760
|
async function sellerTor(recorded, home) {
|
package/shinjuku-wallet.mjs
CHANGED
|
@@ -43272,6 +43272,22 @@ var init_phaseTiming = __esm({
|
|
|
43272
43272
|
}
|
|
43273
43273
|
});
|
|
43274
43274
|
|
|
43275
|
+
// wallet/src/net/globalDispatcher.mjs
|
|
43276
|
+
function activeGlobalDispatcher() {
|
|
43277
|
+
return globalThis[ACTIVE_KEY];
|
|
43278
|
+
}
|
|
43279
|
+
function setActiveGlobalDispatcher(dispatcher) {
|
|
43280
|
+
globalThis[ACTIVE_KEY] = dispatcher;
|
|
43281
|
+
}
|
|
43282
|
+
var UNDICI_MAJOR, ACTIVE_KEY;
|
|
43283
|
+
var init_globalDispatcher = __esm({
|
|
43284
|
+
"wallet/src/net/globalDispatcher.mjs"() {
|
|
43285
|
+
"use strict";
|
|
43286
|
+
UNDICI_MAJOR = Number.parseInt(String(process.versions.undici ?? ""), 10);
|
|
43287
|
+
ACTIVE_KEY = /* @__PURE__ */ Symbol.for(UNDICI_MAJOR >= 8 ? "undici.globalDispatcher.2" : "undici.globalDispatcher.1");
|
|
43288
|
+
}
|
|
43289
|
+
});
|
|
43290
|
+
|
|
43275
43291
|
// wallet/src/fetch/keepAlive.mjs
|
|
43276
43292
|
import diagnosticsChannel from "node:diagnostics_channel";
|
|
43277
43293
|
function whenRequestSent(url, { maxMs = 40 } = {}) {
|
|
@@ -43437,7 +43453,7 @@ function keepAliveDispatcher() {
|
|
|
43437
43453
|
if (shared !== void 0) return shared;
|
|
43438
43454
|
try {
|
|
43439
43455
|
if (proxiedRun()) return void 0;
|
|
43440
|
-
const global2 =
|
|
43456
|
+
const global2 = activeGlobalDispatcher();
|
|
43441
43457
|
if (global2?.constructor?.name !== "Agent") return void 0;
|
|
43442
43458
|
shared = new global2.constructor({ keepAliveTimeout: KEEP_ALIVE_MS, keepAliveMaxTimeout: KEEP_ALIVE_MS });
|
|
43443
43459
|
shared.on?.("connect", () => markPhase("socket-new"));
|
|
@@ -43454,7 +43470,7 @@ function floatDispatcher() {
|
|
|
43454
43470
|
if (floatShared !== void 0) return floatShared;
|
|
43455
43471
|
try {
|
|
43456
43472
|
if (proxiedRun()) return void 0;
|
|
43457
|
-
const global2 =
|
|
43473
|
+
const global2 = activeGlobalDispatcher();
|
|
43458
43474
|
if (global2?.constructor?.name !== "Agent") return void 0;
|
|
43459
43475
|
floatShared = new global2.constructor({ keepAliveTimeout: FLOAT_KEEP_ALIVE_MS, keepAliveMaxTimeout: FLOAT_KEEP_ALIVE_MS });
|
|
43460
43476
|
floatShared.on?.("connect", () => markPhase("float-socket-new"));
|
|
@@ -43483,7 +43499,7 @@ function payHostDispatcher() {
|
|
|
43483
43499
|
if (payHostShared !== void 0) return payHostShared;
|
|
43484
43500
|
try {
|
|
43485
43501
|
if (proxiedRun()) return void 0;
|
|
43486
|
-
const global2 =
|
|
43502
|
+
const global2 = activeGlobalDispatcher();
|
|
43487
43503
|
if (global2?.constructor?.name !== "Agent") return void 0;
|
|
43488
43504
|
payHostShared = new global2.constructor({ keepAliveTimeout: FLOAT_KEEP_ALIVE_MS, keepAliveMaxTimeout: FLOAT_KEEP_ALIVE_MS });
|
|
43489
43505
|
payHostShared.on?.("connect", () => markPhase("socket-new"));
|
|
@@ -43537,12 +43553,12 @@ async function drainBody(response, { maxMs = DRAIN_MAX_MS } = {}) {
|
|
|
43537
43553
|
}
|
|
43538
43554
|
}
|
|
43539
43555
|
}
|
|
43540
|
-
var
|
|
43556
|
+
var expectedSends, KEEP_ALIVE_MS, shared, floatShared, floatUsedAtMs, FLOAT_KEEP_ALIVE_MS, payHostShared, payHostOrigins, DRAIN_MAX_BYTES, DRAIN_MAX_MS;
|
|
43541
43557
|
var init_keepAlive = __esm({
|
|
43542
43558
|
"wallet/src/fetch/keepAlive.mjs"() {
|
|
43543
43559
|
"use strict";
|
|
43544
43560
|
init_phaseTiming();
|
|
43545
|
-
|
|
43561
|
+
init_globalDispatcher();
|
|
43546
43562
|
expectedSends = /* @__PURE__ */ new Set();
|
|
43547
43563
|
KEEP_ALIVE_MS = 2e4;
|
|
43548
43564
|
floatUsedAtMs = 0;
|
|
@@ -43592,6 +43608,7 @@ function proxyDispatcher(Dispatcher, proxy) {
|
|
|
43592
43608
|
httpProxy: proxy,
|
|
43593
43609
|
httpsProxy: proxy,
|
|
43594
43610
|
noProxy: "",
|
|
43611
|
+
proxyTunnel: true,
|
|
43595
43612
|
keepAliveTimeout: KEEP_ALIVE_MS,
|
|
43596
43613
|
keepAliveMaxTimeout: KEEP_ALIVE_MS,
|
|
43597
43614
|
clientFactory: () => tunnelClient(Dispatcher, port, url.hostname)
|
|
@@ -43855,7 +43872,7 @@ function endRun({ stderr = process.stderr } = {}) {
|
|
|
43855
43872
|
};
|
|
43856
43873
|
} catch {
|
|
43857
43874
|
}
|
|
43858
|
-
const all = /* @__PURE__ */ new Set([
|
|
43875
|
+
const all = /* @__PURE__ */ new Set([activeGlobalDispatcher()]);
|
|
43859
43876
|
for (const list of sources) {
|
|
43860
43877
|
try {
|
|
43861
43878
|
for (const dispatcher of list()) all.add(dispatcher);
|
|
@@ -43877,11 +43894,11 @@ function endRun({ stderr = process.stderr } = {}) {
|
|
|
43877
43894
|
}
|
|
43878
43895
|
return true;
|
|
43879
43896
|
}
|
|
43880
|
-
var
|
|
43897
|
+
var ended, held, sources, runEnded, runEndedError, sleeps;
|
|
43881
43898
|
var init_runEnd = __esm({
|
|
43882
43899
|
"wallet/src/net/runEnd.mjs"() {
|
|
43883
43900
|
"use strict";
|
|
43884
|
-
|
|
43901
|
+
init_globalDispatcher();
|
|
43885
43902
|
ended = false;
|
|
43886
43903
|
sources = /* @__PURE__ */ new Set();
|
|
43887
43904
|
runEnded = () => ended;
|
|
@@ -43950,7 +43967,7 @@ function onionInit(init = {}) {
|
|
|
43950
43967
|
const own = ownTagInit(init);
|
|
43951
43968
|
if (own.dispatcher) return own;
|
|
43952
43969
|
try {
|
|
43953
|
-
const global2 =
|
|
43970
|
+
const global2 = activeGlobalDispatcher();
|
|
43954
43971
|
const proxy = process.env.HTTP_PROXY;
|
|
43955
43972
|
if (global2?.constructor?.name !== "EnvHttpProxyAgent" || !proxy) return init;
|
|
43956
43973
|
let dispatcher = onionDispatchers.get(proxy);
|
|
@@ -44382,13 +44399,14 @@ async function routeFacilitatorsOverOnion(argv2, {
|
|
|
44382
44399
|
}
|
|
44383
44400
|
};
|
|
44384
44401
|
}
|
|
44385
|
-
var SITE_ONIONS, SITE_SPARE_ONIONS, PINNED_FACILITATOR_ONIONS, PINNED_SPARE_ONIONS, HISTORY_ONIONS, HISTORY_SPARE_ONIONS, PINNED_HISTORY_ONIONS, PINNED_HISTORY_SPARE_ONIONS, HISTORY_PROBE_PATH, SITE_PROBE_PATH, SITE_PROBE_ANSWERS, KEPT_ANSWER_MS, KEPT_ANSWER_BYTES, KEPT_BODY_MS, FACILITATOR_FLAGS, V3_ONION, DISCOVERY_TIMEOUT_MS, WARM_TIMEOUT_MS, RACE_TIMEOUT_MS, ROUTE_WAIT_MS, SPARE_AFTER_MS, SPARE_CAUSE, routedGroups, liveOnions, hostOf, noAnswer, routedOnions, routedOrigins, onionsOfOrigin, routesOverOnion, routedGroupOf, firstRaces, firstRaceRecords, firstRacesMarked, roleOf, ROUTE_LABELS, requestLabel, moveRecords, moveTimingLog, writeMove, firstOnionRace,
|
|
44402
|
+
var SITE_ONIONS, SITE_SPARE_ONIONS, PINNED_FACILITATOR_ONIONS, PINNED_SPARE_ONIONS, HISTORY_ONIONS, HISTORY_SPARE_ONIONS, PINNED_HISTORY_ONIONS, PINNED_HISTORY_SPARE_ONIONS, HISTORY_PROBE_PATH, SITE_PROBE_PATH, SITE_PROBE_ANSWERS, KEPT_ANSWER_MS, KEPT_ANSWER_BYTES, KEPT_BODY_MS, FACILITATOR_FLAGS, V3_ONION, DISCOVERY_TIMEOUT_MS, WARM_TIMEOUT_MS, RACE_TIMEOUT_MS, ROUTE_WAIT_MS, SPARE_AFTER_MS, SPARE_CAUSE, routedGroups, liveOnions, hostOf, noAnswer, routedOnions, routedOrigins, onionsOfOrigin, routesOverOnion, routedGroupOf, firstRaces, firstRaceRecords, firstRacesMarked, roleOf, ROUTE_LABELS, requestLabel, moveRecords, moveTimingLog, writeMove, firstOnionRace, onionDispatchers, ownTag, ownTagDispatchers, onOwnTagNow, ownTagInit;
|
|
44386
44403
|
var init_facilitatorOnion = __esm({
|
|
44387
44404
|
"wallet/src/net/facilitatorOnion.mjs"() {
|
|
44388
44405
|
"use strict";
|
|
44389
44406
|
init_rpcDefault();
|
|
44390
44407
|
init_tunnelGuard();
|
|
44391
44408
|
init_runEnd();
|
|
44409
|
+
init_globalDispatcher();
|
|
44392
44410
|
SITE_ONIONS = FACILITATOR_SITE_ONIONS;
|
|
44393
44411
|
SITE_SPARE_ONIONS = FACILITATOR_SPARE_ONIONS;
|
|
44394
44412
|
PINNED_FACILITATOR_ONIONS = Object.freeze({
|
|
@@ -44487,7 +44505,6 @@ var init_facilitatorOnion = __esm({
|
|
|
44487
44505
|
const race = firstRaces.get(origin);
|
|
44488
44506
|
return race === void 0 ? void 0 : { ...race };
|
|
44489
44507
|
};
|
|
44490
|
-
GLOBAL_DISPATCHER3 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
44491
44508
|
onionDispatchers = /* @__PURE__ */ new Map();
|
|
44492
44509
|
ownTag = new AsyncLocalStorage2();
|
|
44493
44510
|
ownTagDispatchers = /* @__PURE__ */ new Set();
|
|
@@ -48835,7 +48852,7 @@ function proxyUrl(value2) {
|
|
|
48835
48852
|
return `http://${url.host}`;
|
|
48836
48853
|
}
|
|
48837
48854
|
function envProxyActive() {
|
|
48838
|
-
const dispatcher =
|
|
48855
|
+
const dispatcher = activeGlobalDispatcher()?.constructor?.name ?? "";
|
|
48839
48856
|
if (/proxy/i.test(dispatcher)) return true;
|
|
48840
48857
|
return [http.globalAgent, https.globalAgent].some((agent) => agent?.options?.proxyEnv !== void 0 && agent?.options?.proxyEnv !== null);
|
|
48841
48858
|
}
|
|
@@ -49112,20 +49129,20 @@ async function moveToNewTorCircuit(why = "rate") {
|
|
|
49112
49129
|
return true;
|
|
49113
49130
|
}
|
|
49114
49131
|
function canSwitchTorTag() {
|
|
49115
|
-
return typeof http.setGlobalProxyFromEnv === "function" ||
|
|
49132
|
+
return typeof http.setGlobalProxyFromEnv === "function" || activeGlobalDispatcher()?.constructor?.name === "EnvHttpProxyAgent";
|
|
49116
49133
|
}
|
|
49117
49134
|
function switchTorTag() {
|
|
49118
49135
|
if (runEnded()) return;
|
|
49119
49136
|
const proxy = withRunTag(`http://${new URL(process.env[MARK].split(" ")[1]).host}`);
|
|
49120
49137
|
const env = proxyEnv(proxy);
|
|
49121
|
-
const oldGlobal =
|
|
49138
|
+
const oldGlobal = activeGlobalDispatcher();
|
|
49122
49139
|
Object.assign(process.env, env, { [MARK]: `tor ${proxy}` });
|
|
49123
49140
|
if (typeof http.setGlobalProxyFromEnv === "function") http.setGlobalProxyFromEnv(env);
|
|
49124
|
-
const nodeBuilt =
|
|
49141
|
+
const nodeBuilt = activeGlobalDispatcher();
|
|
49125
49142
|
const Dispatcher = [nodeBuilt, oldGlobal].find((one) => one?.constructor?.name === "EnvHttpProxyAgent")?.constructor;
|
|
49126
|
-
if (Dispatcher)
|
|
49143
|
+
if (Dispatcher) setActiveGlobalDispatcher(proxyDispatcher(Dispatcher, proxy));
|
|
49127
49144
|
const left = [...laneDispatchers.values()];
|
|
49128
|
-
for (const one of /* @__PURE__ */ new Set([oldGlobal, nodeBuilt])) if (one !== void 0 && one !==
|
|
49145
|
+
for (const one of /* @__PURE__ */ new Set([oldGlobal, nodeBuilt])) if (one !== void 0 && one !== activeGlobalDispatcher()) left.push(one);
|
|
49129
49146
|
laneDispatchers.clear();
|
|
49130
49147
|
setImmediate(() => {
|
|
49131
49148
|
for (const dispatcher of left) {
|
|
@@ -49143,7 +49160,7 @@ function switchTorTag() {
|
|
|
49143
49160
|
function torLaneInit(lane, init = {}) {
|
|
49144
49161
|
if (lane === 0 || !inTorRun() || runEnded()) return init;
|
|
49145
49162
|
try {
|
|
49146
|
-
const global2 =
|
|
49163
|
+
const global2 = activeGlobalDispatcher();
|
|
49147
49164
|
if (global2?.constructor?.name !== "EnvHttpProxyAgent") return init;
|
|
49148
49165
|
let dispatcher = laneDispatchers.get(lane);
|
|
49149
49166
|
if (dispatcher === void 0) {
|
|
@@ -49180,7 +49197,7 @@ function torOwnCircuitInit(lane, init = {}) {
|
|
|
49180
49197
|
function freshTorCircuitProxy() {
|
|
49181
49198
|
if (!inTorRun() || runEnded()) return void 0;
|
|
49182
49199
|
try {
|
|
49183
|
-
if (
|
|
49200
|
+
if (activeGlobalDispatcher()?.constructor?.name !== "EnvHttpProxyAgent") return void 0;
|
|
49184
49201
|
return withRunTag(`http://${new URL(process.env[MARK].split(" ")[1]).host}`);
|
|
49185
49202
|
} catch {
|
|
49186
49203
|
return void 0;
|
|
@@ -49192,7 +49209,7 @@ function onCurrentCircuit(init) {
|
|
|
49192
49209
|
}
|
|
49193
49210
|
function onOwnTorTag(task) {
|
|
49194
49211
|
if (!inTorRun() || onOwnTagNow()) return task();
|
|
49195
|
-
const global2 =
|
|
49212
|
+
const global2 = activeGlobalDispatcher();
|
|
49196
49213
|
if (global2?.constructor?.name !== "EnvHttpProxyAgent") return task();
|
|
49197
49214
|
const proxy = withRunTag(`http://${new URL(process.env[MARK].split(" ")[1]).host}`);
|
|
49198
49215
|
return onOwnTagDispatcher(proxyDispatcher(global2.constructor, proxy), task);
|
|
@@ -49373,8 +49390,8 @@ async function proxyEntry(argv2, run2, { err = (text3) => process.stderr.write(t
|
|
|
49373
49390
|
`);
|
|
49374
49391
|
return 1;
|
|
49375
49392
|
}
|
|
49376
|
-
const nodeBuilt =
|
|
49377
|
-
if (nodeBuilt?.constructor?.name === "EnvHttpProxyAgent")
|
|
49393
|
+
const nodeBuilt = activeGlobalDispatcher();
|
|
49394
|
+
if (nodeBuilt?.constructor?.name === "EnvHttpProxyAgent") setActiveGlobalDispatcher(proxyDispatcher(nodeBuilt.constructor, proxy2));
|
|
49378
49395
|
let torVersion;
|
|
49379
49396
|
try {
|
|
49380
49397
|
torVersion = await proveTor(proxy2);
|
|
@@ -49464,7 +49481,7 @@ function torChild(argv2, stdio) {
|
|
|
49464
49481
|
if (!options.mode) throw new ProxyUsageError("torChild needs --tor");
|
|
49465
49482
|
return proxiedChild(options.args, options.proxy, stdio);
|
|
49466
49483
|
}
|
|
49467
|
-
var relayKeyOf, READ_ONLY_METHOD, readOnlyPost, TOR_HTTP_TUNNEL, TOR_CHECK, PROOF_TIMEOUT_MS, LOCAL_PROOF_TIMEOUT_MS, LOCAL_PROOF_MAX_BYTES, torProvenAt, proxyProvenAt, MARK, TOR_RUN_STARTED_ENV, ownProxyRefused, ONION_V3, RETRY_AFTER_CAP_MS, RETRY_AFTER_FLOOR_MS, RETRY_AFTER_DEFAULT_MS, RPC_NO_ANSWER_LIMIT_MS, RPC_PACING_CAP_MS, PACING_NOTICE_EVERY_MS, PACING_RATE_WINDOW_MS, TOR_MAX_ROTATIONS, runStartedAt, rpcNotBefore, pacingWaiters, pacingSince, pacedMs, rpcAnswered, lastAnswerAt, readSteps, pacingNoticeAt, pacingSamples, torMoves, torCircuitId, torMovesRefused, pendingMove, inTorRunOf, inTorRun, runNetworkMode, isOnionOrigin, ProxyUsageError, isOnionHost, PROXY_REMOVED, ENV_PROXY_NAMES, OUTER_PROXY_ENV, DIRECT_RUN_MARK, USE_ENV_PROXY_FLAG, withoutEnvProxyFlag, TOR_MIN_VERSION, localTorProof, TOR_EXPERT_BUNDLE, TOR_EXPERT_BUNDLE_SHA256, TOR_ARCHIVE, TOR_EXPERT_BUNDLE_URL, TOR_EXPERT_BUNDLES, TUNNEL_LINE, TOR_DEB_KEY, TOR_DEB_KEYRING, TOR_INSTALL, torStart, LOCAL_TUNNEL, torStartText, TOR_WINDOW, torNotRunningMessage, torUpdateHow, TOR_STOP_OLD_WINDOWS, torTooOldWhy, torTooOldMessage, NOTICE, TOR_NOTICE_LINE, ONION_DETAIL_LINE, withoutOnionDetail, QUIET_RUN_MARK, QUIET_RUNS, QUIET_TERMINAL_COMMANDS, INFER_SUBCOMMANDS, quietRun, TOR_TROUBLE_LINE, TOR_WAIT_WORDS, TOR_WAIT_PLAIN, TOR_TROUBLE_PLAIN, promptRedraw, TOR_TROUBLE_SAID, quietTorErr, withRunTag, proxyEnv, pacedSoFar, RESENDABLE_METHOD, torCircuit,
|
|
49484
|
+
var relayKeyOf, READ_ONLY_METHOD, readOnlyPost, TOR_HTTP_TUNNEL, TOR_CHECK, PROOF_TIMEOUT_MS, LOCAL_PROOF_TIMEOUT_MS, LOCAL_PROOF_MAX_BYTES, torProvenAt, proxyProvenAt, MARK, TOR_RUN_STARTED_ENV, ownProxyRefused, ONION_V3, RETRY_AFTER_CAP_MS, RETRY_AFTER_FLOOR_MS, RETRY_AFTER_DEFAULT_MS, RPC_NO_ANSWER_LIMIT_MS, RPC_PACING_CAP_MS, PACING_NOTICE_EVERY_MS, PACING_RATE_WINDOW_MS, TOR_MAX_ROTATIONS, runStartedAt, rpcNotBefore, pacingWaiters, pacingSince, pacedMs, rpcAnswered, lastAnswerAt, readSteps, pacingNoticeAt, pacingSamples, torMoves, torCircuitId, torMovesRefused, pendingMove, inTorRunOf, inTorRun, runNetworkMode, isOnionOrigin, ProxyUsageError, isOnionHost, PROXY_REMOVED, ENV_PROXY_NAMES, OUTER_PROXY_ENV, DIRECT_RUN_MARK, USE_ENV_PROXY_FLAG, withoutEnvProxyFlag, TOR_MIN_VERSION, localTorProof, TOR_EXPERT_BUNDLE, TOR_EXPERT_BUNDLE_SHA256, TOR_ARCHIVE, TOR_EXPERT_BUNDLE_URL, TOR_EXPERT_BUNDLES, TUNNEL_LINE, TOR_DEB_KEY, TOR_DEB_KEYRING, TOR_INSTALL, torStart, LOCAL_TUNNEL, torStartText, TOR_WINDOW, torNotRunningMessage, torUpdateHow, TOR_STOP_OLD_WINDOWS, torTooOldWhy, torTooOldMessage, NOTICE, TOR_NOTICE_LINE, ONION_DETAIL_LINE, withoutOnionDetail, QUIET_RUN_MARK, QUIET_RUNS, QUIET_TERMINAL_COMMANDS, INFER_SUBCOMMANDS, quietRun, TOR_TROUBLE_LINE, TOR_WAIT_WORDS, TOR_WAIT_PLAIN, TOR_TROUBLE_PLAIN, promptRedraw, TOR_TROUBLE_SAID, quietTorErr, withRunTag, proxyEnv, pacedSoFar, RESENDABLE_METHOD, torCircuit, laneDispatchers, laneOfDispatcher, PROXY_WARNING_FLAG, proxiedExecArgv, proxiedNodeOptions, TOR_FROM_CONFIG_ENV, TOR_FROM_CONFIG_HINT, TOR_FROM_CONFIG_SENTENCE, launcherPid, torStarter;
|
|
49468
49485
|
var init_proxy = __esm({
|
|
49469
49486
|
"wallet/src/net/proxy.mjs"() {
|
|
49470
49487
|
"use strict";
|
|
@@ -49478,6 +49495,7 @@ var init_proxy = __esm({
|
|
|
49478
49495
|
init_rpcDefault();
|
|
49479
49496
|
init_phaseTiming();
|
|
49480
49497
|
init_homeJob();
|
|
49498
|
+
init_globalDispatcher();
|
|
49481
49499
|
relayKeyOf = (input) => {
|
|
49482
49500
|
if (!isShinjukuRelayUrl(input)) return void 0;
|
|
49483
49501
|
return `${new URL(typeof input === "string" || input instanceof URL ? input : input.url).origin}${FACILITATOR_RPC_PATH}`;
|
|
@@ -49677,7 +49695,6 @@ ${command}`;
|
|
|
49677
49695
|
pacedSoFar = () => pacedMs + (pacingWaiters > 0 ? Date.now() - pacingSince : 0);
|
|
49678
49696
|
RESENDABLE_METHOD = /^(get[A-Za-z]+|simulateTransaction|isBlockhashValid|minimumLedgerSlot|sendTransaction)$/;
|
|
49679
49697
|
torCircuit = () => torCircuitId;
|
|
49680
|
-
GLOBAL_DISPATCHER4 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
49681
49698
|
laneDispatchers = /* @__PURE__ */ new Map();
|
|
49682
49699
|
laneOfDispatcher = /* @__PURE__ */ new WeakMap();
|
|
49683
49700
|
registerRunDispatchers(() => laneDispatchers.values());
|
|
@@ -103118,7 +103135,7 @@ async function discoverX402({
|
|
|
103118
103135
|
ok: false,
|
|
103119
103136
|
error: "discover_query_empty",
|
|
103120
103137
|
detail: "the query has no search words (after common words are removed)",
|
|
103121
|
-
next:
|
|
103138
|
+
next: 'Ask the user what the paid service must do, then call find_paid_services with a few words for it, for example query "weather forecast" or "token price". Nothing was searched or paid.',
|
|
103122
103139
|
results: [],
|
|
103123
103140
|
sourcesRead: [],
|
|
103124
103141
|
privacy: PRIVACY_FULL
|
|
@@ -104765,7 +104782,7 @@ function sellerWaitMs(record) {
|
|
|
104765
104782
|
return Math.min(Math.max(seconds2 * 1e3, SELLER_TIMEOUT_MS), FLOAT_KEEP_BYTES_MS);
|
|
104766
104783
|
}
|
|
104767
104784
|
function sellerAnswerInit(url, init, ms) {
|
|
104768
|
-
const target = () => init.dispatcher ?? routeDispatcherOf(url) ??
|
|
104785
|
+
const target = () => init.dispatcher ?? routeDispatcherOf(url) ?? activeGlobalDispatcher();
|
|
104769
104786
|
if (target() === void 0) return init;
|
|
104770
104787
|
return { ...init, dispatcher: { dispatch: (options, handler) => target().dispatch({ ...options, headersTimeout: ms, bodyTimeout: ms }, handler) } };
|
|
104771
104788
|
}
|
|
@@ -104779,7 +104796,7 @@ async function sendWatchingStall(fetchImpl, url, init, waitMs, {
|
|
|
104779
104796
|
onDeadStall = () => {
|
|
104780
104797
|
}
|
|
104781
104798
|
} = {}) {
|
|
104782
|
-
const global2 =
|
|
104799
|
+
const global2 = activeGlobalDispatcher();
|
|
104783
104800
|
const proxy = process.env.HTTPS_PROXY;
|
|
104784
104801
|
const watched = !resentBefore && inTorRun() && init.dispatcher === void 0 && routeDispatcherOf(url) === void 0 && global2?.constructor?.name === "EnvHttpProxyAgent" && typeof proxy === "string" && proxy !== "";
|
|
104785
104802
|
if (!watched) return { response: await fetchImpl(url, sellerAnswerInit(url, init, waitMs)), stallResent: false };
|
|
@@ -104986,7 +105003,7 @@ function x402HeaderText(response, name, field5) {
|
|
|
104986
105003
|
}
|
|
104987
105004
|
function newConnectionDispatcher(stallProxy) {
|
|
104988
105005
|
try {
|
|
104989
|
-
const Dispatcher =
|
|
105006
|
+
const Dispatcher = activeGlobalDispatcher()?.constructor;
|
|
104990
105007
|
if (stallProxy !== void 0) return Dispatcher?.name === "EnvHttpProxyAgent" ? proxyDispatcher(Dispatcher, stallProxy) : void 0;
|
|
104991
105008
|
if (Dispatcher?.name === "Agent") return new Dispatcher();
|
|
104992
105009
|
const proxy = String(process.env.SHINJUKU_WALLET_PROXIED ?? "").startsWith("tor ") ? process.env.HTTPS_PROXY : void 0;
|
|
@@ -106626,7 +106643,7 @@ async function payViaFloat({
|
|
|
106626
106643
|
const proxy = freshTorCircuitProxy();
|
|
106627
106644
|
let dispatcher;
|
|
106628
106645
|
try {
|
|
106629
|
-
dispatcher = proxy === void 0 ? void 0 : proxyDispatcher(
|
|
106646
|
+
dispatcher = proxy === void 0 ? void 0 : proxyDispatcher(activeGlobalDispatcher().constructor, proxy);
|
|
106630
106647
|
} catch {
|
|
106631
106648
|
dispatcher = void 0;
|
|
106632
106649
|
}
|
|
@@ -107286,7 +107303,7 @@ function paidResult(record, replayed) {
|
|
|
107286
107303
|
float: { floatId: record.floatId }
|
|
107287
107304
|
};
|
|
107288
107305
|
}
|
|
107289
|
-
var import_web3114, FLOAT_PAYMENT_SCHEMA, REGENERATE_CODES, FLOAT_PAYMENT_WAL_PREFIX2, FLOAT_CONFIG_SCHEMA, FLOAT_PAY_PATH, FLOAT_MEMO_PATH, FLOAT_STATUS_PATH, MAX_BODY_BYTES, FLOAT_REFUND_ETA_SECONDS, REFUND_READ_EARLY_MS, REFUND_ETA_MAX_SECONDS, RERUN_STATUS_READ_MAX_MS, REFUND_SENT_FLOOR_SECONDS, refundDueOf, REFUND_SETTLED_AFTER_MS, REFUND_OUTCOME_NEWS_MS, FINISHING_POLL_MS, FINISHING_LIMIT_MS, SELLER_TIMEOUT_MS, SELLER_TIMEOUT_ABSURD_SECONDS, SELLER_STALL_CHECK_AFTER_MS, SELLER_STALL_CHECK_EVERY_MS, SELLER_STALL_CHECK_TIMEOUT_MS, SELLER_STALL_MISSES, RESULT_LIMIT_BYTES, FLOAT_STATUS_START_MS, FLOAT_STATUS_POLL_MS, FLOAT_STATUS_TIMEOUT_MS, CONFIRM_READ_MS, FLOAT_TRANSFER_DEAD, FLOAT_PAYMENT_REVERTED, VERDICT_POLL_MS, SELLER_ANSWER_VERDICT_MS, TRANSFER_MIN_BLOCKS_LEFT, TRANSFER_FRESH_MS, BLOCK_HEIGHT_TIMEOUT_MS, CONFIG_TIMEOUT_MS, MEMO_UPLOAD_TIMEOUT_MS, CONFIG_CACHE_MS, FLOAT_POOL_WARM_MS, DECIMAL3, POSITIVE, PENDING_CODES, FLOAT_FRONT_HEADER, hash7, fail22, GENERIC_REASON, SELLER_REASON_MAX, SELLER_REASON_READ_BYTES, FEE_PAYER_RESENDS, FEE_PAYER_RESEND_MS,
|
|
107306
|
+
var import_web3114, FLOAT_PAYMENT_SCHEMA, REGENERATE_CODES, FLOAT_PAYMENT_WAL_PREFIX2, FLOAT_CONFIG_SCHEMA, FLOAT_PAY_PATH, FLOAT_MEMO_PATH, FLOAT_STATUS_PATH, MAX_BODY_BYTES, FLOAT_REFUND_ETA_SECONDS, REFUND_READ_EARLY_MS, REFUND_ETA_MAX_SECONDS, RERUN_STATUS_READ_MAX_MS, REFUND_SENT_FLOOR_SECONDS, refundDueOf, REFUND_SETTLED_AFTER_MS, REFUND_OUTCOME_NEWS_MS, FINISHING_POLL_MS, FINISHING_LIMIT_MS, SELLER_TIMEOUT_MS, SELLER_TIMEOUT_ABSURD_SECONDS, SELLER_STALL_CHECK_AFTER_MS, SELLER_STALL_CHECK_EVERY_MS, SELLER_STALL_CHECK_TIMEOUT_MS, SELLER_STALL_MISSES, RESULT_LIMIT_BYTES, FLOAT_STATUS_START_MS, FLOAT_STATUS_POLL_MS, FLOAT_STATUS_TIMEOUT_MS, CONFIRM_READ_MS, FLOAT_TRANSFER_DEAD, FLOAT_PAYMENT_REVERTED, VERDICT_POLL_MS, SELLER_ANSWER_VERDICT_MS, TRANSFER_MIN_BLOCKS_LEFT, TRANSFER_FRESH_MS, BLOCK_HEIGHT_TIMEOUT_MS, CONFIG_TIMEOUT_MS, MEMO_UPLOAD_TIMEOUT_MS, CONFIG_CACHE_MS, FLOAT_POOL_WARM_MS, DECIMAL3, POSITIVE, PENDING_CODES, FLOAT_FRONT_HEADER, hash7, fail22, GENERIC_REASON, SELLER_REASON_MAX, SELLER_REASON_READ_BYTES, FEE_PAYER_RESENDS, FEE_PAYER_RESEND_MS, sortedJson, MODEL_ID, RESIGN_ASK_WINDOW_MS, RESIGN_ASK_TIMEOUT_MS, RESIGN_FINISHING_WAIT_MS, RESIGN_MIN_SELLER_LEFT_MS, RESIGN_ANSWER_MAX_BYTES, floatPaymentWalName, floatRecordName, PAYMENT_TIME_MIN_MS, PAYMENT_TIME_MAX_MS, FLOAT_KEEP_BYTES_MS, memoryOnlyNeedsScrub, FLOAT_KEEP_OPEN_REQUEST_MS, configCache, configGeneration, configReadSequence, configReads, configRefreshes, SPECULATED_MAX_AGE_MS, speculatedQuotes, poolDomains, FLOAT_FACTS_SCHEMA, floatFacts, floatFactsKey, floatFactsMac, poolDomainReads, poolDomainWarmFailedAt, WARM_RETRY_MS, payerGenerator, etaEntry, loadPayerGenerator, plainText, quoteLimits, originOf, BROADCAST_REFUSED, BROADCAST_REFUSED_STANDARD, BROADCAST_DEAD, TRANSFER_LANDING_WINDOW_MS, PROOF_DELIVERY_MS, SELF_BROADCAST_LEG1_LEFT_MS, BROADCAST_UNSIGNED, BROADCAST_NO_LOOKUP, BROADCAST_LANDED, BROADCAST_LIMIT_MS, BROADCAST_QUOTE_MARGIN_MS, SELF_BROADCAST_RESEND_MS, SELF_BROADCAST_UNANSWERED_RESEND_MS, SELLER_HEADERS_MAX_COUNT, SELLER_HEADERS_MAX_BYTES, FINAL_AFTER_202_MS, SELLER_HEADERS_KEPT;
|
|
107290
107307
|
var init_floatPay = __esm({
|
|
107291
107308
|
"wallet/src/pay/floatPay.mjs"() {
|
|
107292
107309
|
"use strict";
|
|
@@ -107317,6 +107334,7 @@ var init_floatPay = __esm({
|
|
|
107317
107334
|
init_plan();
|
|
107318
107335
|
init_runEnd();
|
|
107319
107336
|
init_paymentIdentifier();
|
|
107337
|
+
init_globalDispatcher();
|
|
107320
107338
|
init_floatWords();
|
|
107321
107339
|
FLOAT_PAYMENT_SCHEMA = "carbon-shielded-wallet/float-payment/v1";
|
|
107322
107340
|
REGENERATE_CODES = /* @__PURE__ */ new Set(["float_payment_in_flight", "float_quote_open"]);
|
|
@@ -107371,7 +107389,6 @@ var init_floatPay = __esm({
|
|
|
107371
107389
|
SELLER_REASON_READ_BYTES = 4096;
|
|
107372
107390
|
FEE_PAYER_RESENDS = 8;
|
|
107373
107391
|
FEE_PAYER_RESEND_MS = 15e3;
|
|
107374
|
-
GLOBAL_DISPATCHER5 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
107375
107392
|
sortedJson = (value2) => JSON.stringify(value2, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.keys(item).sort().map((key) => [key, item[key]])) : item);
|
|
107376
107393
|
MODEL_ID = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,79}$/;
|
|
107377
107394
|
RESIGN_ASK_WINDOW_MS = 25e3;
|
|
@@ -120838,6 +120855,7 @@ function refusalSay(a, tool, again, npmVersion) {
|
|
|
120838
120855
|
}
|
|
120839
120856
|
if (code2 === "wallet_not_set_up" && tool === "find_paid_services") return "Not searched yet. Set up the wallet first: setup asks one question, whether to use Tor, which hides your IP address.";
|
|
120840
120857
|
if (code2 === "wallet_not_set_up") return "The wallet is not set up yet, so nothing was paid. Ask to set up the wallet first.";
|
|
120858
|
+
if (code2 === "discover_query_empty") return 'Not searched: say in a few words what the paid service must do, for example "weather forecast" or "token price". Nothing was paid.';
|
|
120841
120859
|
if (code2 === "mcp_config_damaged") return "Nothing was done: the wallet's settings file is damaged. Your wallet and its money are safe; setup repairs the file and keeps the wallet.";
|
|
120842
120860
|
if (code2 === "mcp_tool_disabled" && a.noShield === true) {
|
|
120843
120861
|
return a.alsoSetup === true ? "Nothing was paid or moved. To turn this on, remove a setting in this app's wallet settings, run setup again, then reconnect the wallet." : "Nothing was paid or moved. This app's wallet settings turn this off. To turn it on, remove that setting there, then reconnect the wallet.";
|
|
@@ -140764,6 +140782,7 @@ ${key}`).digest("hex").slice(0, 40)}.json`);
|
|
|
140764
140782
|
const inferenceSentAt = /* @__PURE__ */ new Map();
|
|
140765
140783
|
let moneyCallsInFlight = 0;
|
|
140766
140784
|
let spendCallsInFlight = 0;
|
|
140785
|
+
const spendingRequests = /* @__PURE__ */ new Map();
|
|
140767
140786
|
let joinWaitingCalls = 0;
|
|
140768
140787
|
const joinCallMaxMs = Number.isSafeInteger(ops.joinCallMaxMs) && ops.joinCallMaxMs > 0 ? ops.joinCallMaxMs : JOIN_CALL_MAX_MS;
|
|
140769
140788
|
let lastMoneyCallEndedAt = 0;
|
|
@@ -141162,6 +141181,8 @@ ${key}`).digest("hex").slice(0, 40)}.json`);
|
|
|
141162
141181
|
const spending = SPEND_TOOLS.has(tool.name);
|
|
141163
141182
|
callsInFlight += 1;
|
|
141164
141183
|
if (spending) spendCallsInFlight += 1;
|
|
141184
|
+
const spendId = (tool.name === "pay_for_service" || tool.name === "inference_chat") && typeof args[0]?.request_id === "string" ? args[0].request_id : void 0;
|
|
141185
|
+
if (spendId !== void 0) spendingRequests.set(spendId, (spendingRequests.get(spendId) ?? 0) + 1);
|
|
141165
141186
|
holdJoinNudge();
|
|
141166
141187
|
if (paying) {
|
|
141167
141188
|
paysInFlight += 1;
|
|
@@ -141188,6 +141209,11 @@ ${key}`).digest("hex").slice(0, 40)}.json`);
|
|
|
141188
141209
|
});
|
|
141189
141210
|
callsInFlight -= 1;
|
|
141190
141211
|
if (spending) spendCallsInFlight -= 1;
|
|
141212
|
+
if (spendId !== void 0) {
|
|
141213
|
+
const left = (spendingRequests.get(spendId) ?? 1) - 1;
|
|
141214
|
+
if (left > 0) spendingRequests.set(spendId, left);
|
|
141215
|
+
else spendingRequests.delete(spendId);
|
|
141216
|
+
}
|
|
141191
141217
|
nudgeJoinWhenQuiet();
|
|
141192
141218
|
if (moving) {
|
|
141193
141219
|
lastWriterEndedAt = Date.now();
|
|
@@ -144418,13 +144444,15 @@ ${canonical5}`;
|
|
|
144418
144444
|
const own = /* @__PURE__ */ new Set();
|
|
144419
144445
|
const floats = [];
|
|
144420
144446
|
for (const name of store.listWal()) {
|
|
144421
|
-
|
|
144447
|
+
const deposit = name.startsWith("deposit-");
|
|
144448
|
+
if (!deposit && !name.startsWith(RESOURCE_PAYMENT_WAL_PREFIX2) && !name.startsWith(FLOAT_PAYMENT_WAL_PREFIX2)) continue;
|
|
144422
144449
|
let record;
|
|
144423
144450
|
try {
|
|
144424
144451
|
record = store.readWal(name);
|
|
144425
144452
|
} catch {
|
|
144426
144453
|
continue;
|
|
144427
144454
|
}
|
|
144455
|
+
if (deposit && record?.schema !== DEPOSIT_WAL_SCHEMA) continue;
|
|
144428
144456
|
if (name.startsWith(FLOAT_PAYMENT_WAL_PREFIX2)) {
|
|
144429
144457
|
if (typeof record?.refundTo === "string") floats.push(record);
|
|
144430
144458
|
} else if (typeof record?.memoDigest === "string") own.add(record.memoDigest.replace(/^0x/i, "").toLowerCase());
|
|
@@ -145383,6 +145411,38 @@ ${canonical5}`;
|
|
|
145383
145411
|
return cancelWords(payMeRefusal(error, `call wallet_add_funds with request_id "${requestId}" to read it`));
|
|
145384
145412
|
}
|
|
145385
145413
|
}
|
|
145414
|
+
const sentToSeller = sellerSentAt.has(requestId) || inferenceSentAt.has(requestId);
|
|
145415
|
+
let recorded = true;
|
|
145416
|
+
try {
|
|
145417
|
+
recorded = cancelMatches(session.openStore(), requestId).includes("payment");
|
|
145418
|
+
} catch {
|
|
145419
|
+
recorded = true;
|
|
145420
|
+
}
|
|
145421
|
+
log(`MCP_CANCEL_RUNNING_CHECK running=${spendingRequests.has(requestId)} sent=${sentToSeller} recorded=${recorded}`);
|
|
145422
|
+
if (spendingRequests.has(requestId) && !sentToSeller && !recorded) {
|
|
145423
|
+
return json4({
|
|
145424
|
+
say: "This payment is starting now and may still be paid; it cannot be stopped from here. Ask for your receipts in a moment; it never pays twice.",
|
|
145425
|
+
ok: true,
|
|
145426
|
+
requestId,
|
|
145427
|
+
kind: "payment",
|
|
145428
|
+
cancelled: false,
|
|
145429
|
+
stage: "starting",
|
|
145430
|
+
detail: "this payment's call is still running in this wallet and has not made its payment record yet, so there is nothing to close now; it may still pay; nothing was changed",
|
|
145431
|
+
next: "Tell the user the payment is still starting and may still be made. When its call answers, give the user that answer; wallet_receipts lists the payment. Do not pay again. Keep request_id values for your own calls; never show one to the user."
|
|
145432
|
+
});
|
|
145433
|
+
}
|
|
145434
|
+
if (spendingRequests.has(requestId) && sentToSeller) {
|
|
145435
|
+
return json4({
|
|
145436
|
+
say: "This payment is being paid now and cannot be stopped. Ask for your receipts in a moment; it never pays twice.",
|
|
145437
|
+
ok: true,
|
|
145438
|
+
requestId,
|
|
145439
|
+
kind: "payment",
|
|
145440
|
+
cancelled: false,
|
|
145441
|
+
stage: "paying",
|
|
145442
|
+
detail: "this payment's call is still running in this wallet, so it cannot be cancelled now; nothing was changed",
|
|
145443
|
+
next: "Tell the user the payment is being made now and cannot be stopped. When its call answers, give the user that answer; wallet_receipts lists the payment. Do not pay again. Keep request_id values for your own calls; never show one to the user."
|
|
145444
|
+
});
|
|
145445
|
+
}
|
|
145386
145446
|
if (!closings.has(requestId)) {
|
|
145387
145447
|
const running = cancelPayment(requestId);
|
|
145388
145448
|
closings.set(requestId, running);
|
|
@@ -158988,11 +159048,11 @@ function networkChoice(home) {
|
|
|
158988
159048
|
function proxyDispatcherClass() {
|
|
158989
159049
|
const refuse12 = () => new SellerRefusal("seller_tor_unsupported", `This Node.js (${process.version}) cannot send the seller's requests through Tor, so nothing was sent. Install Node.js 24 or newer, then run this again.`);
|
|
158990
159050
|
if (typeof http2.setGlobalProxyFromEnv !== "function") throw refuse12();
|
|
158991
|
-
const before =
|
|
159051
|
+
const before = activeGlobalDispatcher();
|
|
158992
159052
|
const restore = http2.setGlobalProxyFromEnv({ HTTP_PROXY: TOR_HTTP_TUNNEL, HTTPS_PROXY: TOR_HTTP_TUNNEL, NO_PROXY: "" });
|
|
158993
|
-
const Dispatcher =
|
|
159053
|
+
const Dispatcher = activeGlobalDispatcher()?.constructor;
|
|
158994
159054
|
if (typeof restore === "function") restore();
|
|
158995
|
-
if (
|
|
159055
|
+
if (activeGlobalDispatcher() !== before || Dispatcher?.name !== "EnvHttpProxyAgent") throw refuse12();
|
|
158996
159056
|
return Dispatcher;
|
|
158997
159057
|
}
|
|
158998
159058
|
async function sellerTor(recorded, home) {
|
|
@@ -159707,7 +159767,7 @@ function answersMissing(flags) {
|
|
|
159707
159767
|
${cli2()} seller setup --yes --upstream ${EXAMPLE_UPSTREAM} --path /weather --price 0.01 --public-origin ${EXAMPLE_ORIGIN}
|
|
159708
159768
|
Add --backup-confirmed once the wallet folder is on two computers, offline.`);
|
|
159709
159769
|
}
|
|
159710
|
-
var cli2, setupCli, SellerRefusal, SELLER_FOLDER, FILES2, SELLER_MODES, NOT_OFFERED_YET, MODE_SCHEMA, modeFile, ANY_BUYER_PATH, KEY_FILES, DEFAULT_SELLER_PORT, MAX_PRICE_ATOMIC, PROFILE_KEYS2, EXAMPLE_UPSTREAM, EXAMPLE_ORIGIN, sellerDir, sellerConfigPath, backupFile, notSetUp, WITHOUT_TOR,
|
|
159770
|
+
var cli2, setupCli, SellerRefusal, SELLER_FOLDER, FILES2, SELLER_MODES, NOT_OFFERED_YET, MODE_SCHEMA, modeFile, ANY_BUYER_PATH, KEY_FILES, DEFAULT_SELLER_PORT, MAX_PRICE_ATOMIC, PROFILE_KEYS2, EXAMPLE_UPSTREAM, EXAMPLE_ORIGIN, sellerDir, sellerConfigPath, backupFile, notSetUp, WITHOUT_TOR, usdc4, shownUrl2, notReachable, writeFailed, PROXY_FLAGS, NO_ANSWER;
|
|
159711
159771
|
var init_setup = __esm({
|
|
159712
159772
|
"wallet/src/seller/setup.mjs"() {
|
|
159713
159773
|
"use strict";
|
|
@@ -159726,6 +159786,7 @@ var init_setup = __esm({
|
|
|
159726
159786
|
init_serviceUrl();
|
|
159727
159787
|
init_backup();
|
|
159728
159788
|
init_files();
|
|
159789
|
+
init_globalDispatcher();
|
|
159729
159790
|
cli2 = () => commandPrefix();
|
|
159730
159791
|
setupCli = () => commandPrefix({ recovery: true });
|
|
159731
159792
|
SellerRefusal = class extends Error {
|
|
@@ -159765,7 +159826,6 @@ var init_setup = __esm({
|
|
|
159765
159826
|
backupFile = (home) => join49(sellerDir(home), FILES2.backup);
|
|
159766
159827
|
notSetUp = () => new SellerRefusal("seller_not_set_up", `Shinjuku seller is not set up on this computer yet. Run: ${cli2()} seller setup`);
|
|
159767
159828
|
WITHOUT_TOR = "Without Tor, Shinjuku sees this computer's IP address when your seller talks to it.";
|
|
159768
|
-
GLOBAL_DISPATCHER6 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
159769
159829
|
usdc4 = (atomic5) => {
|
|
159770
159830
|
const text3 = formatUsdc(String(atomic5));
|
|
159771
159831
|
return text3 === void 0 ? "?" : text3.includes(".") ? text3 : `${text3}.00`;
|
|
@@ -163343,6 +163403,13 @@ async function addFunds(values, deps) {
|
|
|
163343
163403
|
await release();
|
|
163344
163404
|
}
|
|
163345
163405
|
}
|
|
163406
|
+
var APP_LINK_WORDS = Object.freeze({
|
|
163407
|
+
open: "waiting for USDC at its address",
|
|
163408
|
+
shielding: "USDC arrived; it becomes private by itself",
|
|
163409
|
+
done: "done: it is in your private balance",
|
|
163410
|
+
closed: "closed with nothing sent to it",
|
|
163411
|
+
reclaimed: "taken back out of its address"
|
|
163412
|
+
});
|
|
163346
163413
|
async function fundsStatus(values, deps) {
|
|
163347
163414
|
const pool2 = values.get("--pool");
|
|
163348
163415
|
const passphrase2 = values.has("--passphrase-file") ? readPrivateLine(resolve37(values.get("--passphrase-file")), "--passphrase-file") : deps.env[PASSPHRASE_ENV];
|
|
@@ -163356,13 +163423,30 @@ async function fundsStatus(values, deps) {
|
|
|
163356
163423
|
const plan = wanted === void 0 ? plans.at(-1) : plans.find((entry) => entry.fundsId === wanted);
|
|
163357
163424
|
const { terminal } = fundsOutput(values, deps);
|
|
163358
163425
|
if (!plan) {
|
|
163426
|
+
let links = [];
|
|
163427
|
+
if (wanted === void 0) {
|
|
163428
|
+
try {
|
|
163429
|
+
links = listPayMe(store);
|
|
163430
|
+
} catch {
|
|
163431
|
+
links = [];
|
|
163432
|
+
}
|
|
163433
|
+
}
|
|
163434
|
+
const appLinks = links.map((record) => ({
|
|
163435
|
+
state: record.state,
|
|
163436
|
+
...record.amountAtomic ? { askedAtomic: String(record.amountAtomic) } : {},
|
|
163437
|
+
privateAtomic: typeof record.shieldedAtomic === "string" ? record.shieldedAtomic : "0",
|
|
163438
|
+
createdAt: record.createdAt ?? null
|
|
163439
|
+
}));
|
|
163359
163440
|
const none2 = {
|
|
163360
|
-
status: wanted
|
|
163441
|
+
status: wanted !== void 0 ? "this wallet has no add-funds run with that --funds-id" : appLinks.length ? "this wallet has no add-funds run from the terminal; its add-funds links from the agent app are below" : "this wallet has no add-funds run yet",
|
|
163361
163442
|
runs: plans.map((entry) => entry.fundsId),
|
|
163362
|
-
|
|
163443
|
+
...appLinks.length ? { appLinks } : {},
|
|
163444
|
+
next: appLinks.length ? `see your private balance: ${cli()} balance; add more privately in one step: ${cli()} help add-funds` : `add funds privately in one step: ${cli()} help add-funds`
|
|
163363
163445
|
};
|
|
163446
|
+
const linkLine = (link3) => ` ${link3.askedAtomic ? `${usdc3(link3.askedAtomic)} USDC asked, ` : ""}${usdc3(link3.privateAtomic)} USDC private, ${APP_LINK_WORDS[link3.state] ?? link3.state}`;
|
|
163364
163447
|
deps.io.out(terminal ? `${none2.status.charAt(0).toUpperCase()}${none2.status.slice(1)}${none2.runs.length ? ` (its runs: ${none2.runs.join(", ")})` : ""}.
|
|
163365
|
-
|
|
163448
|
+
` + (appLinks.length ? `${appLinks.map(linkLine).join("\n")}
|
|
163449
|
+
` : "") + `Next: ${none2.next}.
|
|
163366
163450
|
` : `${JSON.stringify(none2, null, 2)}
|
|
163367
163451
|
`);
|
|
163368
163452
|
return;
|