> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/clients/typescript/viem/faucet.md).

# Faucet Helper

Claim funds from a compatible legacy faucet without reading recipient balances.

`checkFaucet()` attempts a claim on every invocation. It does not inspect native or sUSDC balances. The faucet server decides eligibility and enforces cooldowns; rejection is surfaced as an error rather than a successful no-op.

## Supported API

This helper supports a **legacy faucet API**:

* `POST {faucetUrl}/api/claim` with JSON body `{ "address": "..." }`.
* A successful response containing `{ "msg": "Txhash: 0x..." }`.

It is **not compatible with the current public faucet's authenticated `/api/claim/new` API**, which returns `{ claimed, tier }` rather than a transaction hash. Use that faucet's web interface or a separate integration for that API. Removing the balance precheck does not change the helper's HTTP protocol.

```typescript
import { checkFaucet } from "seismic-viem";

// publicClient is an existing viem or shielded public client.
// faucetUrl must point to a server implementing the legacy API above.
const result = await checkFaucet({
  address: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
  publicClient,
  faucetUrl,
});
console.log(result.hash);
```

On success, the helper waits for the transaction receipt and returns `{ sent: true, hash, txUrl? }`. HTTP errors, rejected claims, malformed transaction hashes, and receipt-wait errors propagate to the caller. Invoke it on an explicit funding action rather than on every render or reconnect.

## Migration

The `minBalanceWei` and `minBalanceEther` parameters and the exported `parseMinBalance()` function have been removed. The result no longer includes a `{ sent: false }` variant.

Default `eth_getBalance` now returns a compatibility placeholder on updated reth; it cannot decide whether an account needs funds. A native balance check would also be wrong for an sUSDC faucet, since a wallet can pay gas with sUSDC while holding no native funds. See [Balance RPCs](/reference/balance-rpcs.md).

Faucet-contract inventory monitoring is separate from recipient claims. This helper does not read inventory, perform sUSDC signed reads, or replenish the faucet.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.seismic.systems/clients/typescript/viem/faucet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
