> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# createPublic

> Create an unauthenticated wallet viewer for public wallet queries.

Creates a `SparkReadonlyClient` with no authentication. Can query any wallet that hasn't enabled [privacy mode](/wallets/privacy).

## Method Signature

```typescript theme={null}
static createPublic(config?: ConfigOptions): SparkReadonlyClient
```

## Parameters

<ResponseField name="config" type="ConfigOptions">
  Configuration options including network selection.
</ResponseField>

<Expandable title="ConfigOptions Details">
  ```typescript theme={null}
  interface ConfigOptions {
    network?: "MAINNET" | "TESTNET" | "SIGNET" | "REGTEST" | "LOCAL";
    // Additional advanced options rarely needed for readonly use
  }
  ```
</Expandable>

## Returns

<ResponseField name="client" type="SparkReadonlyClient" required>
  A wallet viewer instance with no authentication. Requests are made without an identity key.
</ResponseField>

## Example

```typescript theme={null}
import { SparkReadonlyClient } from "@buildonspark/spark-sdk";

const client = SparkReadonlyClient.createPublic({
  network: "MAINNET",
});

// Query any public wallet
const balance = await client.getAvailableBalance("sp1...");
console.log("Balance:", balance, "sats");
```

<Info>
  Private wallets return empty results (zero balances, empty arrays) to unauthenticated clients, not errors. Use [`createWithMasterKey()`](/api-reference/readonly/create-with-master-key) to query private wallets you own.
</Info>
