solana-resilience-kit 1.0.1 → 1.0.2

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 CHANGED
@@ -143,13 +143,14 @@ The package ships an executable, `solana-resilience-diagnose`, built on the same
143
143
  `Diagnostics` core (`src/cli/diagnose.ts`). It answers the two questions an
144
144
  operator asks when a Solana dApp misbehaves — *which of my providers is healthy
145
145
  and freshest?* and *did this transaction land, expire, or is it still pending?* —
146
- without writing any code. Run it with `npx` (no install) or from a dependency's
147
- `node_modules/.bin`:
146
+ without writing any code. Run it zero-install with `npx`, or once the package
147
+ is a dependency — call `solana-resilience-diagnose` directly (it is on your
148
+ `node_modules/.bin`):
148
149
 
149
150
  ```bash
150
151
  # Probe provider health across one or more endpoints (reuses the pool's own
151
152
  # slot-freshness ranking, so "freshest" matches what routing would pick):
152
- npx solana-resilience-diagnose probe \
153
+ npx -p solana-resilience-kit solana-resilience-diagnose probe \
153
154
  --rpc https://api.mainnet-beta.solana.com \
154
155
  --rpc https://my-backup.rpc
155
156
  ```
@@ -167,7 +168,7 @@ Freshest: https://api.mainnet-beta.solana.com · 1/2 healthy.
167
168
  # Explain a transaction's outcome point-in-time (no polling loop): it compares
168
169
  # the current signature status and block height against lastValidBlockHeight —
169
170
  # the canonical Solana rule — and never re-signs.
170
- npx solana-resilience-diagnose explain \
171
+ npx -p solana-resilience-kit solana-resilience-diagnose explain \
171
172
  --rpc https://api.mainnet-beta.solana.com \
172
173
  --sig 5xRe...your-signature \
173
174
  --lvbh 287654321
package/dist/cli/index.js CHANGED
@@ -19,6 +19,7 @@
19
19
  * tx) · 2 a usage error.
20
20
  */
21
21
  import { createSolanaRpc } from "@solana/kit";
22
+ import { realpathSync } from "node:fs";
22
23
  import { pathToFileURL } from "node:url";
23
24
  import { SdkError } from "../errors.js";
24
25
  import { Diagnostics } from "./diagnose.js";
@@ -211,8 +212,11 @@ export async function run(argv, deps = {}) {
211
212
  return result.status === "expired" ? 1 : 0;
212
213
  }
213
214
  /* v8 ignore start -- process bootstrap; only runs when invoked as the binary */
215
+ // Resolve symlinks: npm installs the bin as a symlink in node_modules/.bin, so
216
+ // process.argv[1] is that link while import.meta.url is the real dist file —
217
+ // comparing realpaths is what makes the binary fire when run by name.
214
218
  const entry = process.argv[1];
215
- if (entry !== undefined && import.meta.url === pathToFileURL(entry).href) {
219
+ if (entry !== undefined && import.meta.url === pathToFileURL(realpathSync(entry)).href) {
216
220
  run(process.argv.slice(2)).then((code) => {
217
221
  process.exitCode = code;
218
222
  }, (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-resilience-kit",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Vendor-neutral, client-side resilience and observability layer for Solana dApps, built on @solana/kit (web3.js v2).",
5
5
  "type": "module",
6
6
  "license": "MIT",