shinjuku-shielded 0.3.19 → 0.3.20

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 CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schema": "carbon-shielded-wallet/bundle-manifest/v1",
3
3
  "file": "shinjuku-wallet.mjs",
4
- "sha256": "8b897dc95ce8c17c9b0730c6ca5fddaf727b315d054489154d30bd795692a390",
5
- "bytes": 11127328,
6
- "sourceCommit": "a721e6bc401be4155fe3f6b9fb4b3ad634064787",
4
+ "sha256": "c1963de19cc61973bc35d2d55284b771db5846c323419f771e342f9cd3052e57",
5
+ "bytes": 11128106,
6
+ "sourceCommit": "b5e68064df487336e92684f0006a64a5b8018ee9",
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",
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "shinjuku-shielded",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
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": "8b897dc9",
7
- "shinjukuSha256": "8b897dc95ce8c17c9b0730c6ca5fddaf727b315d054489154d30bd795692a390",
6
+ "shinjukuRelease": "c1963de1",
7
+ "shinjukuSha256": "c1963de19cc61973bc35d2d55284b771db5846c323419f771e342f9cd3052e57",
8
8
  "license": "SEE LICENSE IN LICENSE.txt",
9
9
  "author": "Shinjuku Shielded",
10
10
  "homepage": "https://github.com/ShinjukuStaition/shinjuku-mcp#readme",
@@ -52630,22 +52630,20 @@ async function refreshFinalizedP03HistorySnapshot({
52630
52630
  return refreshed;
52631
52631
  }
52632
52632
  async function readFinalizedPool(connection, program, pool) {
52633
- const response = await retryTransientRpc(() => connection.getAccountInfoAndContext(pool, "finalized"));
52634
- const first = parseFinalizedPool(response, program);
52635
- if (first.replayStore !== REPLAY_STORE_INDEXED) return first;
52636
52633
  if (typeof connection.getMultipleAccountsInfoAndContext !== "function") {
52637
- throw new Error("p03_history_e1_tree_read_unavailable");
52634
+ const response = await retryTransientRpc(() => connection.getAccountInfoAndContext(pool, "finalized"));
52635
+ const only = parseFinalizedPool(response, program);
52636
+ if (only.replayStore === REPLAY_STORE_INDEXED) throw new Error("p03_history_e1_tree_read_unavailable");
52637
+ return only;
52638
52638
  }
52639
52639
  const tree = new import_web396.PublicKey(e1TreeAddress(pool.toBase58(), program.toBase58()));
52640
52640
  const both = await retryTransientRpc(() => connection.getMultipleAccountsInfoAndContext(
52641
52641
  [pool, tree],
52642
- { commitment: "finalized", minContextSlot: first.slot }
52642
+ { commitment: "finalized" }
52643
52643
  ));
52644
52644
  if (!Array.isArray(both?.value) || both.value.length !== 2) throw new Error("p03_history_e1_tree_read_invalid");
52645
52645
  const snapshot = parseFinalizedPool({ context: both.context, value: both.value[0] }, program);
52646
- if (snapshot.replayStore !== REPLAY_STORE_INDEXED || snapshot.slot < first.slot) {
52647
- throw new Error("p03_history_e1_tree_read_invalid");
52648
- }
52646
+ if (snapshot.replayStore !== REPLAY_STORE_INDEXED) return snapshot;
52649
52647
  const treeAccount = both.value[1];
52650
52648
  return Object.freeze({
52651
52649
  ...snapshot,
@@ -52725,6 +52723,22 @@ async function readProgramDataIdentity({ connection, address: address5, snapshot
52725
52723
  }
52726
52724
  return data;
52727
52725
  }
52726
+ async function readProgramDataHeader({ connection, address: address5, snapshotSlot, deployedAtSlot }) {
52727
+ const account2 = await retryTransientRpc(() => connection.getAccountInfoAndContext(address5, {
52728
+ commitment: "finalized",
52729
+ minContextSlot: snapshotSlot,
52730
+ dataSlice: { offset: 0, length: 45 }
52731
+ }));
52732
+ const observedSlot = safeSlot(account2?.context?.slot, "programdata_snapshot_slot");
52733
+ const value = account2?.value;
52734
+ if (observedSlot < snapshotSlot || !value || !canonicalKey(value.owner, "programdata_owner").equals(BPF_LOADER_UPGRADEABLE_PROGRAM_ID) || value.executable === true) {
52735
+ throw new Error("p03_history_programdata_account_invalid");
52736
+ }
52737
+ const data = Buffer.from(value.data);
52738
+ if (data.length < 45 || data.readUInt32LE(0) !== 3 || data.readBigUInt64LE(4) !== deployedAtSlot) {
52739
+ throw new Error("p03_history_programdata_identity_invalid");
52740
+ }
52741
+ }
52728
52742
  function coverageKey({ program, initialization, deploymentIdentity }) {
52729
52743
  try {
52730
52744
  const names = Object.keys(deploymentIdentity).sort().join(",");
@@ -52796,12 +52810,11 @@ async function programDataCoverageFor({
52796
52810
  for (let attempt = 1; ; attempt += 1) {
52797
52811
  try {
52798
52812
  const [, newest2] = await Promise.all([
52799
- readProgramDataIdentity({
52813
+ readProgramDataHeader({
52800
52814
  connection,
52801
52815
  address: address5,
52802
52816
  snapshotSlot,
52803
- deployedAtSlot: BigInt(prior.coverage.deployedAtSlot),
52804
- expectedHash: prior.coverage.programDataSha256
52817
+ deployedAtSlot: BigInt(prior.coverage.deployedAtSlot)
52805
52818
  }),
52806
52819
  newestSignature(connection, address5, snapshotSlot)
52807
52820
  ]);
@@ -117257,6 +117270,7 @@ init_payResource();
117257
117270
  init_quote2();
117258
117271
  init_floatPay();
117259
117272
  init_walletHistory();
117273
+ init_phaseTiming();
117260
117274
  init_chain2();
117261
117275
  init_processLease();
117262
117276
  init_store();
@@ -117663,13 +117677,13 @@ async function paidCall({ session, target, method, headers, body, cap, requestId
117663
117677
  const own = ownRecord(store, requestId);
117664
117678
  if (own?.kind !== "pocket") void session.proofTools;
117665
117679
  if (own?.kind !== "pocket") {
117666
- prewarmWalletP03History({
117680
+ withPhaseScope(mark, "prewarm", () => prewarmWalletP03History({
117667
117681
  store,
117668
117682
  connection: connectSplit(session.connection, session.historyUrl),
117669
117683
  programId: session.programId,
117670
117684
  pool: store.state.pool,
117671
117685
  deploymentIdentity: session.proofTools.deploymentIdentity
117672
- });
117686
+ }));
117673
117687
  }
117674
117688
  const policy = session.spendPolicy;
117675
117689
  if (policy && !committed(ownRecord(store, requestId), store)) {