diff --git a/README.md b/README.md index 6c9f724..a297284 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -Faucet App -=== +# Faucet App + [](https://github.com/FuelLabs/faucet/actions/workflows/ci.yml) [](https://discord.gg/xfpK4Pe) @@ -7,19 +7,21 @@ A simple faucet app for dispensing tokens on a fuel network. It uses Google capt without requiring any social media based identification. ## Configuration + The faucet makes use of environment variables for configuration. -| Environment Variable | Description | -|----------------------|-------------------------------------------------------------------------| -| RUST_LOG | EnvFilter configuration for adjusting logging granularity. | -| HUMAN_LOGGING | If false, logs will be output as machine readable JSON. | -| CAPTCHA_SECRET | The secret key used for enabling Google captcha authentication. | -| CAPTCHA_KEY | The website key used for enabling Google captcha authentication. | -| WALLET_SECRET_KEY | A hex formatted string of the wallet private key that owns some tokens. | -| FUEL_NODE_URL | The GraphQL endpoint for connecting to fuel-core. | +| Environment Variable | Description | +| -------------------- | ----------------------------------------------------------------------------------------------- | +| RUST_LOG | EnvFilter configuration for adjusting logging granularity. | +| HUMAN_LOGGING | If false, logs will be output as machine readable JSON. | +| CAPTCHA_SECRET | The secret key used for enabling Google captcha authentication. | +| CAPTCHA_KEY | The website key used for enabling Google captcha authentication. | +| WALLET_SECRET_KEY | A hex formatted string of the wallet private key that owns some tokens. | +| FUEL_NODE_URL | The GraphQL endpoint for connecting to fuel-core. | | PUBLIC_FUEL_NODE_URL | The public GraphQL endpoint for connecting to fuel-core. Ex.: https://node.fuel.network/graphql | -| SERVICE_PORT | The port the service will listen for http connections on. | -| DISPENSE_AMOUNT | Dispense amount on each faucet | +| SERVICE_PORT | The port the service will listen for http connections on. | +| DISPENSE_AMOUNT | Dispense amount on each faucet | +| MIN_GAS_PRICE | The minimum gas price to use in each transfer | ## Build and Run @@ -28,3 +30,19 @@ To run locally, assuming environment variables have already been set: ```sh cargo run ``` + +## Query Params + +When integrating the faucet you can use the following query params to enhance the user experience: + +| Name | Type | Description | +| ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| address | Address | Auto-fill the address field using the provided value | +| redirectUrl | String | If provided with a valid url, once the faucet is complete, the user will be redirected back to the url with tx_id as a query param | +| autoClose | String | If provided empty or true will close automatically the window after the transaction is finished | + +### Example - Redirect +- `http://localhost:3000/?address=fuel134ddh9pfsspar086htdldwxq2jsr3yvqtj5w456kkrz3s653la5q347kmc&redirectUrl=http://localhost:4000` + +### Example - Auto Close +- `http://localhost:3000/?address=fuel134ddh9pfsspar086htdldwxq2jsr3yvqtj5w456kkrz3s653la5q347kmc&autoClose` diff --git a/static/index.html b/static/index.html index 5e7f087..8447edd 100644 --- a/static/index.html +++ b/static/index.html @@ -138,6 +138,11 @@ color: #949494; } + .provider-url a { + color: #949494; + text-decoration: underline; + } + .agreements { text-align: left; margin-top: 25px; @@ -146,7 +151,7 @@ font-size: 14px; } - .queued { + .queued, .redirect-container { display: flex; flex-direction: column; align-items: center; @@ -183,6 +188,10 @@ .hidden { display: none; } + + .footer { + z-index: 9; + }
@@ -241,15 +250,27 @@