UNPKG

@suiware/kit

Version:

Opinionated React components and hooks for building Sui dApps.

31 lines (28 loc) 1.22 kB
interface IUseFaucetParams { onError?: (error: Error | null, errorMessage?: string) => void; onSuccess?: (message: string) => void; } interface IUseFaucetResponse { /** * Funds the address on the test network. * * @param {string|undefined} address The address to fund. If not provided, the current address is used. */ fund: (address?: string) => void; } /** * The `useFaucet()` hook lets you fund an address an a test network. * * The supported networks are **localnet**, **devnet** and **testnet**. * The granted amount is: * - localnet: 100 SUI * - devnet: 10 SUI * - testnet: 1 SUI * For the **testnet**, the faucet link is opened in a new tab. * Please note there is a certain quota for requesting funds from **devnet** and **testnet**. * If you have reached the limit, wait for 24 hours, and in the meanwhile use the `#devnet-faucet` and `#testnet-faucet` channels * of the official Sui Discord https://discord.gg/sui. * @returns {IUseFaucetResponse} An object with the fund function. */ declare const useFaucet: ({ onError, onSuccess, }: IUseFaucetParams) => IUseFaucetResponse; export { type IUseFaucetParams, type IUseFaucetResponse, useFaucet as default };