@arkade-os/sdk Documentation - v0.5.0-rc.11
    Preparing search index...

    Type Alias ArkadeReader

    ArkadeReader: Pick<IndexerProvider, "getVirtualTxs"> & {
        getVtxos(opts: GetVtxosOptions): Promise<NormalizedVtxoPage>;
    }

    Chain reads a caller needs beyond its own wallet's VTXOs: an arbitrary script's virtual outputs, and the transactions that spent them.

    Shaped as getNormalizedVtxos rather than as IndexerProvider, for two reasons. Every VTXO leaving this seam carries its canonical facts — the guarantee scripts/check-provider-boundary.mjs enforces inside the SDK and that a plugin holding a raw provider could otherwise skip. And because NormalizedVirtualCoin is assignable to VirtualCoin, an ArkadeReader satisfies Pick<IndexerProvider, "getVtxos" | "getVirtualTxs"> structurally, so existing narrow seams accept one unchanged. Passing a reader to something that normalizes again — getNormalizedVtxos, Arkade.connect's indexer — is harmless: normalizeVtxo is idempotent. Do not "fix" that by stripping the normalization here; it is the whole point of the seam.

    Deliberately not the whole provider: a caller that could reach getVtxoChain or getSubscription through the wallet would be talking to the server behind the wallet's back, which the service-worker wallet cannot even express.

    Type Declaration

    • getVtxos: function
      • Required opts, unlike the IndexerProvider method it mirrors: this seam reads for named foreign scripts (or outpoints). The type stops a bare getVtxos() at compile time; the runtime defence is the provider's own "Either scripts or outpoints must be provided" throw — the message boundary adds no validation of its own.

        One logical query — the reader chunks nothing. scripts travel in the query string, so a wide list can 414; getAllNormalizedVtxos accepts a reader and chunks and pages to exhaustion. Whether a single call pages internally is the provider's business: when a page comes back, following it is yours.

        Parameters

        Returns Promise<NormalizedVtxoPage>

        getNormalizedVtxos