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

# Faucet

> Fund test accounts on configured testnet environments.

Use the faucet helpers to fund test accounts during onboarding, demos, and QA.
Faucets are per-environment and testnet-only.

There are two different flows:

* `requestTestTokens()` mints ERC-20 test tokens to an EVM wallet outside the unlink contract
* `requestPrivateTokens()` transfers shielded test tokens directly into an Unlink account inside the unlink contract

## Token

Use a test token configured for the environment you selected. In hosted
projects, this comes from your project or environment config.

In the Unlink dashboard, the faucet token cards show each hosted mock token's
truncated address. Use the copy button on the token card to copy the full
address for SDK or API calls.

## Mint to an EVM wallet

```ts theme={null}
const result = await client.faucet.requestTestTokens({
  token: testToken,
});

console.log(result.tx_hash);
```

If you omit `evmAddress`, the SDK uses the connected EVM provider address.

```ts theme={null}
const result = await client.faucet.requestTestTokens({
  token: testToken,
  evmAddress: "0xRecipient",
});
```

<Note>Omitting `evmAddress` requires an EVM provider on the client.</Note>

By default the faucet sends its configured amount. Pass `amount` (in wei, as a
decimal string) to request a specific amount, up to the faucet's configured
maximum. Requests above the maximum, or for `0`, are rejected.

```ts theme={null}
const result = await client.faucet.requestTestTokens({
  token: testToken,
  amount: "1000000000000000000", // 1 token (18 decimals), in wei
});
```

## Fund a private Unlink account

```ts theme={null}
const result = await client.faucet.requestPrivateTokens({
  token: testToken,
});

console.log(result.tx_id, result.status);
```

If you omit `unlinkAddress`, the SDK automatically registers the caller if needed and uses the caller's own Unlink address.

You can also target another Unlink account explicitly:

```ts theme={null}
const result = await client.faucet.requestPrivateTokens({
  token: testToken,
  unlinkAddress: "unlink1recipient...",
});
```

`amount` works the same way here — wei as a decimal string, capped by the
faucet's configured maximum:

```ts theme={null}
const result = await client.faucet.requestPrivateTokens({
  token: testToken,
  amount: "1000000000000000000",
});
```

## When to use which

* Use `requestTestTokens()` when the user needs public ERC-20 balance for an approval or public wallet flow
* Use `requestPrivateTokens()` when the user should start with funds already inside the unlink contract

## Responses

The `requestTestTokens()` method returns an on-chain transaction hash:

```ts theme={null}
type FaucetMintResponse = {
  tx_hash: string;
};
```

The `requestPrivateTokens()` method returns an internal transfer result:

```ts theme={null}
type FaucetTransferResponse = {
  tx_id: string;
  status: TransactionStatus;
};
```

`TransactionStatus` is `"accepted" | "prepared" | "proving" | "proved" |
"broadcasting" | "relayed" | "processed" | "failed"` (see [Transaction
status](/reading-data#transaction-status)).

<Note>
  The faucet `tx_id` is scoped to the faucet and cannot be polled via
  `pollTransactionStatus()`. It is not the same as transaction IDs returned by
  `deposit()`, `transfer()`, or `withdraw()`. To confirm private tokens have
  arrived, use `getBalances()` (see [Reading
  data](/reading-data#read-balances)).
</Note>
