shinjuku-shielded 0.3.64 → 0.3.66
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/manifest.json +4 -4
- package/package.json +3 -3
- package/shinjuku-wallet.mjs +51 -6
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": "402e7c3666bf4dfe147de8229872bdf611540526a15d5fdb690392c81b878b9d",
|
|
5
|
+
"bytes": 12181283,
|
|
6
|
+
"sourceCommit": "07b54a455cdbafc18b7f79b107b0cf9e5e722be9",
|
|
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",
|
|
@@ -1282,5 +1282,5 @@
|
|
|
1282
1282
|
"version": "1.8.0"
|
|
1283
1283
|
}
|
|
1284
1284
|
],
|
|
1285
|
-
"publishedAt": "2026-10-
|
|
1285
|
+
"publishedAt": "2026-10-22T11:29:33.345Z"
|
|
1286
1286
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shielded",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.66",
|
|
4
4
|
"mcpName": "io.github.ShinjukuStaition/shinjuku-mcp",
|
|
5
5
|
"description": "Shinjuku Shielded, the private x402 facilitator 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": "402e7c36",
|
|
7
|
+
"shinjukuSha256": "402e7c3666bf4dfe147de8229872bdf611540526a15d5fdb690392c81b878b9d",
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
9
9
|
"author": "Shinjuku Shielded",
|
|
10
10
|
"homepage": "https://github.com/ShinjukuStaition/shinjuku-mcp#readme",
|
package/shinjuku-wallet.mjs
CHANGED
|
@@ -50664,11 +50664,12 @@ function poolLayoutForLength(length) {
|
|
|
50664
50664
|
}
|
|
50665
50665
|
function connect2(rpcUrl, commitment = "finalized", { timeoutMs, wrapFetch = (fetch2) => fetch2 } = {}) {
|
|
50666
50666
|
const pooled = (input, init) => rpcFetch(input, rpcKeepAliveInit(input, init));
|
|
50667
|
-
const fetch2 = wrapFetch(timeoutMs === void 0 ? pooled : async (input, init) => {
|
|
50667
|
+
const fetch2 = wrapFetch(timeoutMs === void 0 ? pooled : async (input, { onResponseHead, ...init } = {}) => {
|
|
50668
50668
|
const circuit = torCircuit();
|
|
50669
50669
|
const timeout = AbortSignal.timeout(timeoutMs);
|
|
50670
50670
|
try {
|
|
50671
50671
|
const response = await pooled(input, { ...init, signal: init?.signal ? AbortSignal.any([init.signal, timeout]) : timeout });
|
|
50672
|
+
onResponseHead?.(response);
|
|
50672
50673
|
const body = await response.text();
|
|
50673
50674
|
const headers = new Headers(response.headers);
|
|
50674
50675
|
headers.delete("content-encoding");
|
|
@@ -50682,13 +50683,24 @@ function connect2(rpcUrl, commitment = "finalized", { timeoutMs, wrapFetch = (fe
|
|
|
50682
50683
|
const connection = countRpcCalls(new import_web395.Connection(rpcUrl, { commitment, fetch: fetch2, disableRetryOnRateLimit: true }));
|
|
50683
50684
|
let nextId = 0;
|
|
50684
50685
|
Object.defineProperty(connection, "abortableRpcRequest", {
|
|
50685
|
-
value: async (method, params, signal) => {
|
|
50686
|
+
value: async (method, params, signal, onResponse) => {
|
|
50687
|
+
let reported = false;
|
|
50688
|
+
const onResponseHead = (response2) => {
|
|
50689
|
+
if (reported) return;
|
|
50690
|
+
reported = true;
|
|
50691
|
+
try {
|
|
50692
|
+
onResponse?.({ status: response2.status, contentLength: Number(response2.headers.get("content-length")) });
|
|
50693
|
+
} catch {
|
|
50694
|
+
}
|
|
50695
|
+
};
|
|
50686
50696
|
const response = await fetch2(rpcUrl, {
|
|
50687
50697
|
method: "POST",
|
|
50688
50698
|
signal,
|
|
50699
|
+
onResponseHead,
|
|
50689
50700
|
headers: { "content-type": "application/json" },
|
|
50690
50701
|
body: JSON.stringify({ jsonrpc: "2.0", id: `abortable-${nextId += 1}`, method, params })
|
|
50691
50702
|
});
|
|
50703
|
+
onResponseHead(response);
|
|
50692
50704
|
return response.json();
|
|
50693
50705
|
},
|
|
50694
50706
|
enumerable: false,
|
|
@@ -57265,6 +57277,26 @@ function validateRecord(raw, ordinal, { programId, pool: pool2, poolDomain, snap
|
|
|
57265
57277
|
});
|
|
57266
57278
|
}
|
|
57267
57279
|
function requestPage(history, pool2, from) {
|
|
57280
|
+
return from === 0 ? requestPageZero(history, pool2) : requestPageNow(history, pool2, from);
|
|
57281
|
+
}
|
|
57282
|
+
function requestPageZero(history, pool2) {
|
|
57283
|
+
const source = typeof history?.rpcEndpoint === "string" ? history.rpcEndpoint : history;
|
|
57284
|
+
let byPool = pageZeroInFlight.get(source);
|
|
57285
|
+
const joined = byPool?.get(pool2);
|
|
57286
|
+
if (joined !== void 0) {
|
|
57287
|
+
markPhase("compact-page0-joined");
|
|
57288
|
+
return joined.then((answer) => answer.error === void 0 ? answer : requestPageNow(history, pool2, 0));
|
|
57289
|
+
}
|
|
57290
|
+
const pending = requestPageNow(history, pool2, 0);
|
|
57291
|
+
if (byPool === void 0) pageZeroInFlight.set(source, byPool = /* @__PURE__ */ new Map());
|
|
57292
|
+
byPool.set(pool2, pending);
|
|
57293
|
+
pending.then(() => {
|
|
57294
|
+
if (byPool.get(pool2) === pending) byPool.delete(pool2);
|
|
57295
|
+
if (byPool.size === 0 && pageZeroInFlight.get(source) === byPool) pageZeroInFlight.delete(source);
|
|
57296
|
+
});
|
|
57297
|
+
return pending;
|
|
57298
|
+
}
|
|
57299
|
+
function requestPageNow(history, pool2, from) {
|
|
57268
57300
|
const attempt = async (index) => {
|
|
57269
57301
|
try {
|
|
57270
57302
|
return { response: await history._rpcRequest("getP03Transitions", [pool2, {
|
|
@@ -58082,7 +58114,7 @@ async function tryCompactP03HistoryReport(options) {
|
|
|
58082
58114
|
return { ok: false, reason, ...detail ? { detail } : {}, error };
|
|
58083
58115
|
}
|
|
58084
58116
|
}
|
|
58085
|
-
var import_web397, P03_COMPACT_HISTORY_SOURCE_MODEL, P03_COMPACT_PAGE, P03_COMPACT_SPOT_CHECKS, FIELD_MODULUS5, SUBTREE_LEAVES3, LOCAL_DEPTH2, OUTER_DEPTH2, PRIMARY_PROOF_BYTES2, FIELD_BYTES3, ED25519_SPKI_PREFIX2, VERSION_1_PREFIX2, HEX64, BASE58, REPLAY_STORE_INDEXED2, PROFILES2, MOVE_HEAD_BYTES2, MOVE_INSERTED_VALUES2, refuse3, hash4, bitAt, zeroRootsMemo, lastFolds, PRE_FOLD_SLICE_MS, preFolds, hex64, droppedPools, verifyQuietMs, VERIFY_SLICE_MS, VERIFY_POLL_MS, verifying, unrefTurn, isSignature, isIndex, IMPORT_KEYS, IMPORT_MAX_VALUES, LIST_ATTEMPTS, OWN_READ_TIMEOUT_MS, BOUNDED_OWN_METHODS, compactReportsRunning, compactHistoryReadsRunning;
|
|
58117
|
+
var import_web397, P03_COMPACT_HISTORY_SOURCE_MODEL, P03_COMPACT_PAGE, P03_COMPACT_SPOT_CHECKS, FIELD_MODULUS5, SUBTREE_LEAVES3, LOCAL_DEPTH2, OUTER_DEPTH2, PRIMARY_PROOF_BYTES2, FIELD_BYTES3, ED25519_SPKI_PREFIX2, VERSION_1_PREFIX2, HEX64, BASE58, REPLAY_STORE_INDEXED2, PROFILES2, MOVE_HEAD_BYTES2, MOVE_INSERTED_VALUES2, refuse3, hash4, bitAt, zeroRootsMemo, lastFolds, PRE_FOLD_SLICE_MS, preFolds, hex64, droppedPools, verifyQuietMs, VERIFY_SLICE_MS, VERIFY_POLL_MS, verifying, unrefTurn, isSignature, isIndex, IMPORT_KEYS, IMPORT_MAX_VALUES, LIST_ATTEMPTS, pageZeroInFlight, OWN_READ_TIMEOUT_MS, BOUNDED_OWN_METHODS, compactReportsRunning, compactHistoryReadsRunning;
|
|
58086
58118
|
var init_compact = __esm({
|
|
58087
58119
|
"wallet/src/history/compact.mjs"() {
|
|
58088
58120
|
"use strict";
|
|
@@ -58212,6 +58244,7 @@ var init_compact = __esm({
|
|
|
58212
58244
|
IMPORT_KEYS = ["afterOrdinal", "instructionIndex", "record", "signature", "slot", "transactionIndex", "values"];
|
|
58213
58245
|
IMPORT_MAX_VALUES = 3;
|
|
58214
58246
|
LIST_ATTEMPTS = 6;
|
|
58247
|
+
pageZeroInFlight = /* @__PURE__ */ new Map();
|
|
58215
58248
|
OWN_READ_TIMEOUT_MS = HISTORY_RPC_REQUEST_TIMEOUT_MS;
|
|
58216
58249
|
BOUNDED_OWN_METHODS = /* @__PURE__ */ new Set(["getAccountInfo", "getAccountInfoAndContext", "getMultipleAccountsInfo", "getMultipleAccountsInfoAndContext"]);
|
|
58217
58250
|
compactReportsRunning = 0;
|
|
@@ -59164,13 +59197,23 @@ async function waitForCompactSource(source, pool2, slot3, budgetMs) {
|
|
|
59164
59197
|
const until = Date.now() + budgetMs;
|
|
59165
59198
|
for (; ; ) {
|
|
59166
59199
|
const abort = new AbortController();
|
|
59200
|
+
let answerBytes;
|
|
59167
59201
|
const params = [pool2, { commitment: "finalized", fromOrdinal: 0, toOrdinal: P03_COMPACT_PAGE, minContextSlot: slot3 }];
|
|
59168
|
-
const read = (typeof source.abortableRpcRequest === "function" ? source.abortableRpcRequest("getP03Transitions", params, abort.signal
|
|
59202
|
+
const read = (typeof source.abortableRpcRequest === "function" ? source.abortableRpcRequest("getP03Transitions", params, abort.signal, ({ contentLength }) => {
|
|
59203
|
+
answerBytes = contentLength;
|
|
59204
|
+
}) : source._rpcRequest("getP03Transitions", params)).catch(() => ({ failed: true }));
|
|
59169
59205
|
let timer;
|
|
59170
|
-
|
|
59206
|
+
let answer = await Promise.race([read, new Promise((resolve38) => {
|
|
59171
59207
|
timer = setTimeout(resolve38, Math.max(inTorRun() ? COMPACT_BEHIND_TOR_READ_MS : COMPACT_BEHIND_READ_MS, until - Date.now()));
|
|
59172
59208
|
})]);
|
|
59173
59209
|
clearTimeout(timer);
|
|
59210
|
+
if (answer === void 0 && answerBytes > COMPACT_BEHIND_REFUSAL_MAX_BYTES) {
|
|
59211
|
+
markPhase("compact-behind-page-coming");
|
|
59212
|
+
answer = await Promise.race([read, new Promise((resolve38) => {
|
|
59213
|
+
timer = setTimeout(resolve38, COMPACT_BEHIND_PAGE_BODY_MS);
|
|
59214
|
+
})]);
|
|
59215
|
+
clearTimeout(timer);
|
|
59216
|
+
}
|
|
59174
59217
|
if (answer === void 0) abort.abort();
|
|
59175
59218
|
if (answer?.result !== void 0) {
|
|
59176
59219
|
markPhase("compact-behind-caught-up");
|
|
@@ -59231,7 +59274,7 @@ function reportHistoryRpc(split5, source, result, crossChecked) {
|
|
|
59231
59274
|
writeStderr(`history: ${who} answered ${list(split5.history)}; your own RPC answered ${list(split5.own)} (the pool account the history must match, and the cross-check)${window2}${integrity}
|
|
59232
59275
|
`);
|
|
59233
59276
|
}
|
|
59234
|
-
var prepareReport, strictScope, withStrictHistorySource, recentScope, withRecentWalletHistory, recentLoads, forgetRecentWalletHistory, proofBuiltAt, historyCacheKey, latestPrewarm, HOME_MARKS_SETTLED_MS, HISTORY_PREWARM_JOIN_MS, SHARED_WALK_WAIT_MS, PAGE0_PREREAD_AFTER_MS, SUBTREE_LEAVES4, prewarmedWalks, sharedWalks, PREWARMED_REPORTS, PAYMENT_TAKEN_REPORTS, isPrewarmedWalletHistory, REPORT_STARTED_AT, walkStartedAtOf, COMPACT_BEHIND_POLL_MS, COMPACT_BEHIND_READ_MS, COMPACT_BEHIND_TOR_READ_MS, COMPACT_BEHIND_RETRY_MS, lastRunReports, writeStderr, announcedSources;
|
|
59277
|
+
var prepareReport, strictScope, withStrictHistorySource, recentScope, withRecentWalletHistory, recentLoads, forgetRecentWalletHistory, proofBuiltAt, historyCacheKey, latestPrewarm, HOME_MARKS_SETTLED_MS, HISTORY_PREWARM_JOIN_MS, SHARED_WALK_WAIT_MS, PAGE0_PREREAD_AFTER_MS, SUBTREE_LEAVES4, prewarmedWalks, sharedWalks, PREWARMED_REPORTS, PAYMENT_TAKEN_REPORTS, isPrewarmedWalletHistory, REPORT_STARTED_AT, walkStartedAtOf, COMPACT_BEHIND_POLL_MS, COMPACT_BEHIND_READ_MS, COMPACT_BEHIND_TOR_READ_MS, COMPACT_BEHIND_REFUSAL_MAX_BYTES, COMPACT_BEHIND_PAGE_BODY_MS, COMPACT_BEHIND_RETRY_MS, lastRunReports, writeStderr, announcedSources;
|
|
59235
59278
|
var init_walletHistory = __esm({
|
|
59236
59279
|
"wallet/src/history/walletHistory.mjs"() {
|
|
59237
59280
|
"use strict";
|
|
@@ -59274,6 +59317,8 @@ var init_walletHistory = __esm({
|
|
|
59274
59317
|
COMPACT_BEHIND_POLL_MS = 150;
|
|
59275
59318
|
COMPACT_BEHIND_READ_MS = 1e3;
|
|
59276
59319
|
COMPACT_BEHIND_TOR_READ_MS = 5e3;
|
|
59320
|
+
COMPACT_BEHIND_REFUSAL_MAX_BYTES = 8192;
|
|
59321
|
+
COMPACT_BEHIND_PAGE_BODY_MS = HISTORY_RPC_REQUEST_TIMEOUT_MS;
|
|
59277
59322
|
COMPACT_BEHIND_RETRY_MS = [500, 1e3, 2e3, 5e3];
|
|
59278
59323
|
lastRunReports = /* @__PURE__ */ new Map();
|
|
59279
59324
|
writeStderr = (text3) => {
|