Skip to main content
The useRequestFaucet hook requests testnet tokens for a Para wallet. It uses the currently active wallet by default, making it easy to fund a wallet immediately after creation.

Import

import { useRequestFaucet } from "@getpara/react-sdk";

Usage

With an active wallet, call the hook with no arguments to fund the current wallet:
function FaucetButton() {
  const { requestFaucetAsync, isPending, data } = useRequestFaucet();

  return (
    <div>
      <button
        onClick={() => requestFaucetAsync()}
        disabled={isPending}
      >
        {isPending ? "Requesting..." : "Get Testnet ETH"}
      </button>
      {data && <p>Funded: {data.transactionHash}</p>}
    </div>
  );
}

Return Value

The hook returns a standard React Query mutation result. The data field contains the faucet response once the request succeeds:
FieldTypeDescription
transactionHashstringOn-chain transaction hash
amountstringAmount of testnet tokens sent
chainstringChain the tokens were sent on
walletIdstringID of the wallet that received tokens
addressstringOn-chain address that received tokens

Explicit Wallet ID

To fund a specific wallet instead of the active one, pass walletId directly:
function FundSpecificWallet({ walletId }: { walletId: string }) {
  const { requestFaucetAsync, isPending, data } = useRequestFaucet();

  return (
    <div>
      <button
        onClick={() => requestFaucetAsync({ walletId })}
        disabled={isPending}
      >
        {isPending ? "Requesting..." : "Fund Wallet"}
      </button>
      {data && (
        <p>
          Sent {data.amount} ETH to {data.address}
        </p>
      )}
    </div>
  );
}

Notes

Rate limited to 10 requests per API key per day. Each wallet has a 24-hour cooldown between requests. Only testnet chains are supported.
A 429 response means the rate limit has been exceeded. Check the Retry-After header for when to retry.