Token Faucet
Overview
The Token Faucet functionality allows developers to request AR.IO tokens through a captcha-protected API service. This feature was added in SDK version 3.10.0.
The faucet leverages a new API service with hCaptcha integration. Developers can request JSON Web Tokens (JWT) by solving a captcha, and then use those tokens to claim AR.IO tokens to wallet addresses, subject to rate limits.
Initialization
The faucet functionality is available on ARIO instances when initialized with a faucet URL:
Available Methods
The faucet
object on ARIO instances provides the following methods:
captchaUrl
- Get the captcha URL for the current processrequestAuthToken
- Request an auth token using captcha responseclaimWithCaptchaResponse
- Claim tokens directly with captcha responseclaimWithAuthToken
- Claim tokens using an auth tokenverifyAuthToken
- Verify if an auth token is still valid
Usage Flow
- Get Captcha URL - Retrieve the captcha URL for the process
- Solve Captcha - User solves the captcha on the provided URL
- Request Auth Token - Use captcha response to get an auth token
- Claim Tokens - Use auth token to claim tokens to a wallet address
Note
The faucet functionality is only available on testnet instances. The faucetUrl parameter is optional and defaults to 'https://faucet.ario.permaweb.services'.