# Montrevane Transparency JavaScript SDK

Dependency-free, read-only access to the public OP Mainnet transparency
snapshot. It runs in modern browsers and Node.js 18 or newer.

Download the published module into your own project first. The static file URL
is a distribution artifact, not a cross-origin JavaScript CDN.

```sh
mkdir -p vendor
curl --fail-with-body \
  https://montrevane.com/sdk/mtvrn-transparency.mjs \
  --output vendor/mtvrn-transparency.mjs
```

Then import the vendored file from your application. The module calls the
CORS-enabled public API endpoint.

```js
import { getTransparencySnapshot } from "./vendor/mtvrn-transparency.mjs";

const result = await getTransparencySnapshot();
if (result.ok) {
  console.log(result.snapshot.blockNumber, result.snapshot.observations);
} else {
  console.warn(result.status, result.state, result.error.message);
}
```

Expected service outcomes are returned instead of thrown:

- `200`: `ok: true`, Tier A quorum-verified snapshot.
- `409`: `ok: false`, Tier U because fixed RPC evidence conflicted.
- `503`: `ok: false`, Tier U because the RPC quorum was unavailable.

Network failures, timeouts, unexpected HTTP statuses, and malformed or unsafe
payloads throw `TransparencySdkError`. An HTTP 200 snapshot whose declared
`freshUntil` time has passed is rejected with `STALE_RESPONSE`. Callers should retain raw integer fields
as strings unless they deliberately use `BigInt`.

## Safety boundary

The SDK performs one unauthenticated `GET` with credentials omitted. It has no
wallet dependency and cannot connect a wallet, request a signature, approve a
token, or submit a transaction. It also does not calculate price, valuation,
market capitalization, or circulating supply. The SDK rejects a successful
payload unless all four server-declared guardrails remain `false`.

Run the included console example from the `website` directory:

```sh
node public/examples/transparency-console.mjs
```

Optionally set `MTVRN_TRANSPARENCY_ENDPOINT` to test another absolute HTTP(S)
endpoint without query parameters.
