Function: requestIotaFromFaucet()
function requestIotaFromFaucet(input): Promise<number | undefined>;
Submits a V1 faucet request for the given recipient and polls until the request succeeds, is discarded, or the attempt limit is reached.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | { host: string; recipient: string; headers?: HeadersInit; maxAttempts?: number; delayMs?: number; } | - |
input.host | string | Base URL of the faucet service. |
input.recipient | string | Address to receive the tokens. |
input.headers? | HeadersInit | Optional HTTP headers forwarded to every faucet call. |
input.maxAttempts? | number | Maximum number of status-poll attempts before giving up (default: 20). |
input.delayMs? | number | Milliseconds to wait between poll attempts (default: 1500). |
Returns
Promise<number | undefined>
The total amount of gas transferred, or undefined if the faucet
response contained no coin info.
Throws
When the request is discarded, the attempt limit is exceeded, or the faucet returns an error at any stage.