File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -140,3 +140,14 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=MainnetF
140140``` bash
141141ServerError| I' m a teapot - mainnet tokens are not available.
142142```
143+
144+ ---
145+
146+ ## Faucet Top-Up Requests
147+
148+ If you encounter a server error indicating that faucet is exhausted (e.g.,
149+ "ServerError|Faucet is empty, Request top-up"), you can request a refill here:
150+
151+ - [Request Faucet Top-Up](https://github.com/ChainSafe/forest-explorer/discussions/134)
152+
153+ This discussion thread is monitored for top-up requests.
Original file line number Diff line number Diff line change @@ -219,6 +219,15 @@ pub async fn claim_token(
219219 . map_err ( ServerFnError :: new) ?;
220220
221221 SendWrapper :: new ( async move {
222+ let faucet_balance = rpc
223+ . wallet_balance ( from, & faucet_info. token_type ( ) )
224+ . await
225+ . map_err ( ServerFnError :: new) ?;
226+ if faucet_balance < * faucet_info. drip_amount ( ) {
227+ return Err ( ServerFnError :: ServerError (
228+ "Faucet is empty, Request top-up" . to_string ( ) ,
229+ ) ) ;
230+ }
222231 match faucet_info {
223232 FaucetInfo :: MainnetFIL => {
224233 set_response_status ( StatusCode :: IM_A_TEAPOT ) ;
You can’t perform that action at this time.
0 commit comments