From 5d6a0d2db7f80b18d0b86f551be32687c2e05572 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 16:40:56 +0530 Subject: [PATCH 01/10] add claim token all api doc --- docs/api-documentation.md | 207 ++++++++++++++++++++++++++++++++++---- 1 file changed, 187 insertions(+), 20 deletions(-) diff --git a/docs/api-documentation.md b/docs/api-documentation.md index 0716b2cb..d1cedb12 100644 --- a/docs/api-documentation.md +++ b/docs/api-documentation.md @@ -10,12 +10,7 @@ The Claim Token API provides a simple way to request calibnet tokens from the faucet. This is primarily intended for developers and testers who need tokens to interact with the network. Users provide a valid wallet address and specify the token type (`faucet_info`) they wish to receive. On success, the API returns a -transaction hash confirming the token transfer. - -**Key points:** - -- Each address is subject to rate limiting to prevent abuse. -- This API only distributes Calibnet `tFIL` and `tUSDFC` tokens. +JSON object with `faucet_info` and `tx_hash` confirming the token transfer. --- @@ -28,18 +23,6 @@ transaction hash confirming the token transfer. --- -## Rate Limits - -| Faucet Type | Cooldown Period | Drip Amount | Wallet Cap | Global Cap | -| --------------- | --------------- | ----------- | ---------- | ------------ | -| `CalibnetFIL` | 60 seconds | 1 tFIL | 2 tFIL | 200 tFIL | -| `CalibnetUSDFC` | 60 seconds | 5 tUSDFC | 10 tUSDFC | 1,000 tUSDFC | - -**Note:** All limits reset every 24 hours. Abuse, farming, or automated requests -are prohibited and may result in stricter limits or bans. - ---- - ## Status Codes | Status Code | Description | @@ -56,8 +39,10 @@ are prohibited and may result in stricter limits or bans. ### Success +#### Success claim for `CalibnetFIL` + - **Status:** `200 OK` -- **Content:** Plain text string containing the transaction hash. +- **Content:** JSON with faucet info and transaction hash. **Example:** @@ -67,8 +52,29 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=Calibnet **Response:** +```json +{ + "faucet_info": "CalibnetFIL", + "tx_hash": "0x06784dd239f7f0e01baa19a82877e17b7fcd6e1dd725913fd6f741a2a6c56ce5" +} +``` + +#### Success claim for `CalibnetUSDFC` + +- **Status:** `200 OK` +- **Content:** JSON with faucet info and transaction hash. + ```bash -0x06784dd239f7f0e01baa19a82877e17b7fcd6e1dd725913fd6f741a2a6c56ce5 +curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=CalibnetUSDFC&address=0xae9c4b9508c929966ef37209b336e5796d632cdc" +``` + +**Response:** + +```json +{ + "faucet_info": "CalibnetUSDFC", + "tx_hash": "0x8d75e2394dcf829ab9353370069b6d6afb04c88ea38c765ab4443a1587e12922" +} ``` ### Failure @@ -143,6 +149,167 @@ ServerError|I'm a teapot - mainnet tokens are not available. --- +# Claim Token All API + +**Base URL:** `https://forest-explorer.chainsafe.dev` +**Endpoint:** `/api/claim_token_all` +**HTTP Method:** `GET` + +## Description + +Requests claims for both `CalibnetUSDFC` and `CalibnetFIL` in one call. Returns +a JSON array of per-claim results. Each item corresponds to one faucet claim. + +--- + +## Query Parameters + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | --------------------------------------------- | +| `address` | string | Yes | The wallet address to receive all the tokens. | + +--- + +## Status Codes + +| Status Code | Description | +| ----------- | -------------------------------- | +| 200 | Tokens successfully claimed | +| 400 | Bad request - invalid address | +| 429 | Too many requests - rate limited | +| 500 | Server error | + +--- + +### Claim Response Success & Failure + +The API returns a **JSON array**, where each object corresponds to a faucet +claim attempt. Each object contains: + +- `faucet_info`: A string identifying the faucet (e.g., `CalibnetFIL`, + `CalibnetUSDFC`) + +And either: + +- `tx_hash`: A string containing the transaction hash **if the claim was + successful**, + **or** +- `error`: An object containing the error details **if the claim failed** + +--- + +## Examples + +### Success + +- **Status:** `200 OK` + +**Example:** + +```bash +curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=0xAe9C4b9508c929966ef37209b336E5796D632CDc" +``` + +**Response:** + +```json +[ + { + "faucet_info": "CalibnetUSDFC", + "tx_hash": "0x8d75e2394dcf829ab9353370069b6d6afb04c88ea38c765ab4443a1587e12922" + }, + { + "faucet_info": "CalibnetFIL", + "tx_hash": "0xf133c6aae45e40a48b71449229cb45f5ab5f2e7bd8ae488d1142319191ca8eb0" + } +] +``` + +### Failure + +#### 400 Bad Request + +- **Status:** `400 Bad Request` +- **Content:** JSON array where each item represents a faucet claim result. Each + item includes `faucet_info` and either a `tx_hash` (on success) or an `error` + object (on failure). + +**Example:** + +```bash +curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=CalibnetFIL&address=invalidaddress" +``` + +**Response:** + +```bash +[ + { + "faucet_info": "CalibnetUSDFC", + "error": { + "ServerError": "Invalid address: Not a valid Testnet address" + } + }, + { + "faucet_info": "CalibnetFIL", + "error": { + "ServerError": "Invalid address: Not a valid Testnet address" + } + } +] +``` + +#### 429 Too Many Requests + +- **Status:** `429 Too Many Requests` +- **Content:** JSON array where each item represents a faucet claim result. Each + item includes `faucet_info` and either a `tx_hash` (on success) or an `error` + object (on failure). + +**Example:** + +```bash +curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=CalibnetFIL&address=0xAe9C4b9508c929966ef37209b336E5796D632CDc" +``` + +**Response:** + +```bash +[ + { + "faucet_info": "CalibnetUSDFC", + "error": { + "ServerError": "Too many requests: Rate limited. Try again in 46 seconds." + } + }, + { + "faucet_info": "CalibnetFIL", + "error": { + "ServerError": "Too many requests: Rate limited. Try again in 12 seconds." + } + } +] +``` + +--- + +**Key points:** + +- Each address is subject to rate limiting to prevent abuse. +- This API only distributes Calibnet `tFIL` and `tUSDFC` tokens. + +## Rate Limits + +| Faucet Type | Cooldown Period | Drip Amount | Wallet Cap | Global Cap | +| --------------- | --------------- | ----------- | ---------- | ------------ | +| `CalibnetFIL` | 60 seconds | 1 tFIL | 2 tFIL | 200 tFIL | +| `CalibnetUSDFC` | 60 seconds | 5 tUSDFC | 10 tUSDFC | 1,000 tUSDFC | + +**Note:** All limits reset every 24 hours. Abuse, farming, or automated requests +are prohibited and may result in stricter limits or bans. + +--- + ## Faucet Top-Up Requests If you encounter a server error indicating that faucet is exhausted. From 877fb6da9801d4e54b60b60e80dbcbf7401c7bd8 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 16:41:26 +0530 Subject: [PATCH 02/10] impl claim token all api --- src/faucet/server_api.rs | 54 ++++++++++++++++++++++++++++++++++++---- src/lib.rs | 1 + src/utils/address.rs | 2 +- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/faucet/server_api.rs b/src/faucet/server_api.rs index 8250b4d1..352f8df7 100644 --- a/src/faucet/server_api.rs +++ b/src/faucet/server_api.rs @@ -5,10 +5,12 @@ use crate::utils::{ address::AnyAddress, lotus_json::{LotusJson, signed_message::SignedMessage}, }; +use alloy::primitives::TxHash; use anyhow::Result; use fvm_shared::address::Address; use fvm_shared::econ::TokenAmount; use leptos::{prelude::ServerFnError, server, server_fn::codec::GetUrl}; +use serde::{Deserialize, Serialize}; #[cfg(feature = "ssr")] use axum::http::StatusCode; @@ -196,6 +198,15 @@ pub async fn signed_erc20_transfer( Ok(signed) } +#[derive(Serialize, Deserialize)] +pub struct ClaimResponse { + pub faucet: FaucetInfo, + #[serde(skip_serializing_if = "Option::is_none")] + pub tx_hash: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, +} + /// Server API endpoint for claiming calibnet tokens from the faucet. /// Returns a transaction ID on successful token claim. /// Supports distribution of `CalibnetFIL` and `CalibnetUSDFC` tokens. @@ -204,7 +215,7 @@ pub async fn signed_erc20_transfer( pub async fn claim_token( faucet_info: FaucetInfo, address: String, -) -> Result { +) -> Result { use crate::utils::rpc_context::Provider; use fvm_shared::address::set_current_network; use send_wrapper::SendWrapper; @@ -236,6 +247,31 @@ pub async fn claim_token( .await } +#[server(endpoint = "claim_token_all", input = GetUrl)] +pub async fn claim_token_all(address: String) -> Result, ServerFnError> { + let mut results = Vec::with_capacity(2); + + match claim_token(FaucetInfo::CalibnetUSDFC, address.clone()).await { + Ok(resp) => results.push(resp), + Err(e) => results.push(ClaimResponse { + faucet: FaucetInfo::CalibnetUSDFC, + tx_hash: None, + error: Some(e), + }), + } + + match claim_token(FaucetInfo::CalibnetFIL, address).await { + Ok(resp) => results.push(resp), + Err(e) => results.push(ClaimResponse { + faucet: FaucetInfo::CalibnetFIL, + tx_hash: None, + error: Some(e), + }), + } + + Ok(results) +} + #[cfg(feature = "ssr")] fn parse_and_validate_address( address: &str, @@ -279,7 +315,7 @@ async fn handle_native_claim( recipient: Address, from: Address, rpc: crate::utils::rpc_context::Provider, -) -> Result { +) -> Result { use crate::utils::message::message_transfer; let id_address = rpc.lookup_id(recipient).await.unwrap_or_else(|_| { @@ -313,7 +349,11 @@ async fn handle_native_claim( .eth_get_transaction_hash_by_cid(cid) .await .map_err(ServerFnError::new)?; - Ok(tx_hash.to_string()) + Ok(ClaimResponse { + faucet: faucet_info, + tx_hash: Some(tx_hash), + error: None, + }) } Err(err) => Err(handle_faucet_error(err)), } @@ -325,7 +365,7 @@ async fn handle_erc20_claim( recipient: Address, from: Address, rpc: crate::utils::rpc_context::Provider, -) -> Result { +) -> Result { use crate::utils::address::AddressAlloyExt; let eth_to = recipient.into_eth_address().map_err(ServerFnError::new)?; @@ -341,7 +381,11 @@ async fn handle_erc20_claim( .send_eth_transaction_signed(&signed) .await .map_err(ServerFnError::new)?; - Ok(tx_hash.to_string()) + Ok(ClaimResponse { + faucet: faucet_info, + tx_hash: Some(tx_hash), + error: None, + }) } Err(err) => Err(handle_faucet_error(err)), } diff --git a/src/lib.rs b/src/lib.rs index be09a5c9..25e1606f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,6 +75,7 @@ mod ssr_imports { server_fn::axum::register_explicit::(); server_fn::axum::register_explicit::(); server_fn::axum::register_explicit::(); + server_fn::axum::register_explicit::(); } #[event(fetch)] diff --git a/src/utils/address.rs b/src/utils/address.rs index 41326e7f..94afc726 100644 --- a/src/utils/address.rs +++ b/src/utils/address.rs @@ -108,7 +108,7 @@ impl AddressAlloyExt for Address { error!( "Cannot convert address {self} to Ethereum address. Only ID and Delegated addresses are supported." ); - bail!("invalid address {self}"); + bail!("Address {self} not supported."); } } } From 4de2c9a8a1e67c60249e61e6511b246d4e3c3560 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 17:02:19 +0530 Subject: [PATCH 03/10] improve error msg --- src/utils/address.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/address.rs b/src/utils/address.rs index 94afc726..fc2e28d3 100644 --- a/src/utils/address.rs +++ b/src/utils/address.rs @@ -108,7 +108,9 @@ impl AddressAlloyExt for Address { error!( "Cannot convert address {self} to Ethereum address. Only ID and Delegated addresses are supported." ); - bail!("Address {self} not supported."); + bail!( + "Invalid address {self}, Only ID and Delegated addresses are supported." + ); } } } From 22af5e18c983a57ce5331ead2dbb66bcdd422b16 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 18:02:21 +0530 Subject: [PATCH 04/10] fmt --- src/utils/address.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils/address.rs b/src/utils/address.rs index fc2e28d3..3e7ff11e 100644 --- a/src/utils/address.rs +++ b/src/utils/address.rs @@ -108,9 +108,7 @@ impl AddressAlloyExt for Address { error!( "Cannot convert address {self} to Ethereum address. Only ID and Delegated addresses are supported." ); - bail!( - "Invalid address {self}, Only ID and Delegated addresses are supported." - ); + bail!("Invalid address {self}, Only ID and Delegated addresses are supported."); } } } From a33e17404c9a64a7c56067ee1479e803ef7dcf89 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 18:10:21 +0530 Subject: [PATCH 05/10] response field name change --- src/faucet/server_api.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/faucet/server_api.rs b/src/faucet/server_api.rs index 352f8df7..478faaa1 100644 --- a/src/faucet/server_api.rs +++ b/src/faucet/server_api.rs @@ -200,7 +200,7 @@ pub async fn signed_erc20_transfer( #[derive(Serialize, Deserialize)] pub struct ClaimResponse { - pub faucet: FaucetInfo, + pub faucet_info: FaucetInfo, #[serde(skip_serializing_if = "Option::is_none")] pub tx_hash: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -254,7 +254,7 @@ pub async fn claim_token_all(address: String) -> Result, Serv match claim_token(FaucetInfo::CalibnetUSDFC, address.clone()).await { Ok(resp) => results.push(resp), Err(e) => results.push(ClaimResponse { - faucet: FaucetInfo::CalibnetUSDFC, + faucet_info: FaucetInfo::CalibnetUSDFC, tx_hash: None, error: Some(e), }), @@ -263,7 +263,7 @@ pub async fn claim_token_all(address: String) -> Result, Serv match claim_token(FaucetInfo::CalibnetFIL, address).await { Ok(resp) => results.push(resp), Err(e) => results.push(ClaimResponse { - faucet: FaucetInfo::CalibnetFIL, + faucet_info: FaucetInfo::CalibnetFIL, tx_hash: None, error: Some(e), }), @@ -350,7 +350,7 @@ async fn handle_native_claim( .await .map_err(ServerFnError::new)?; Ok(ClaimResponse { - faucet: faucet_info, + faucet_info: faucet_info, tx_hash: Some(tx_hash), error: None, }) @@ -382,7 +382,7 @@ async fn handle_erc20_claim( .await .map_err(ServerFnError::new)?; Ok(ClaimResponse { - faucet: faucet_info, + faucet_info: faucet_info, tx_hash: Some(tx_hash), error: None, }) From 67707017a8b920f16a5a8595db0b0e01987b373f Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 18:16:11 +0530 Subject: [PATCH 06/10] lint fix --- src/faucet/server_api.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/faucet/server_api.rs b/src/faucet/server_api.rs index 478faaa1..aaa46ec1 100644 --- a/src/faucet/server_api.rs +++ b/src/faucet/server_api.rs @@ -350,7 +350,7 @@ async fn handle_native_claim( .await .map_err(ServerFnError::new)?; Ok(ClaimResponse { - faucet_info: faucet_info, + faucet_info, tx_hash: Some(tx_hash), error: None, }) @@ -382,7 +382,7 @@ async fn handle_erc20_claim( .await .map_err(ServerFnError::new)?; Ok(ClaimResponse { - faucet_info: faucet_info, + faucet_info, tx_hash: Some(tx_hash), error: None, }) From 3b84f1227f3fe67986a572d8b3d3493cfa9d5a01 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 19:33:00 +0530 Subject: [PATCH 07/10] keep claim_token work as it does --- docs/api-documentation.md | 20 ++++++--------- src/faucet/server_api.rs | 51 ++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/docs/api-documentation.md b/docs/api-documentation.md index d1cedb12..451954ee 100644 --- a/docs/api-documentation.md +++ b/docs/api-documentation.md @@ -10,7 +10,7 @@ The Claim Token API provides a simple way to request calibnet tokens from the faucet. This is primarily intended for developers and testers who need tokens to interact with the network. Users provide a valid wallet address and specify the token type (`faucet_info`) they wish to receive. On success, the API returns a -JSON object with `faucet_info` and `tx_hash` confirming the token transfer. +transaction hash confirming the token transfer. --- @@ -42,7 +42,7 @@ JSON object with `faucet_info` and `tx_hash` confirming the token transfer. #### Success claim for `CalibnetFIL` - **Status:** `200 OK` -- **Content:** JSON with faucet info and transaction hash. +- **Content:** Plain text string containing the transaction hash. **Example:** @@ -52,17 +52,14 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=Calibnet **Response:** -```json -{ - "faucet_info": "CalibnetFIL", - "tx_hash": "0x06784dd239f7f0e01baa19a82877e17b7fcd6e1dd725913fd6f741a2a6c56ce5" -} +```bash +0x06784dd239f7f0e01baa19a82877e17b7fcd6e1dd725913fd6f741a2a6c56ce5 ``` #### Success claim for `CalibnetUSDFC` - **Status:** `200 OK` -- **Content:** JSON with faucet info and transaction hash. +- **Content:** Plain text string containing the transaction hash. ```bash curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=CalibnetUSDFC&address=0xae9c4b9508c929966ef37209b336e5796d632cdc" @@ -70,11 +67,8 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=Calibnet **Response:** -```json -{ - "faucet_info": "CalibnetUSDFC", - "tx_hash": "0x8d75e2394dcf829ab9353370069b6d6afb04c88ea38c765ab4443a1587e12922" -} +```bash +0x8d75e2394dcf829ab9353370069b6d6afb04c88ea38c765ab4443a1587e12922 ``` ### Failure diff --git a/src/faucet/server_api.rs b/src/faucet/server_api.rs index aaa46ec1..c13bc45f 100644 --- a/src/faucet/server_api.rs +++ b/src/faucet/server_api.rs @@ -215,7 +215,7 @@ pub struct ClaimResponse { pub async fn claim_token( faucet_info: FaucetInfo, address: String, -) -> Result { +) -> Result { use crate::utils::rpc_context::Provider; use fvm_shared::address::set_current_network; use send_wrapper::SendWrapper; @@ -249,24 +249,23 @@ pub async fn claim_token( #[server(endpoint = "claim_token_all", input = GetUrl)] pub async fn claim_token_all(address: String) -> Result, ServerFnError> { - let mut results = Vec::with_capacity(2); - - match claim_token(FaucetInfo::CalibnetUSDFC, address.clone()).await { - Ok(resp) => results.push(resp), - Err(e) => results.push(ClaimResponse { - faucet_info: FaucetInfo::CalibnetUSDFC, - tx_hash: None, - error: Some(e), - }), - } + let faucets = [FaucetInfo::CalibnetUSDFC, FaucetInfo::CalibnetFIL]; + let mut results = Vec::with_capacity(faucets.len()); - match claim_token(FaucetInfo::CalibnetFIL, address).await { - Ok(resp) => results.push(resp), - Err(e) => results.push(ClaimResponse { - faucet_info: FaucetInfo::CalibnetFIL, - tx_hash: None, - error: Some(e), - }), + for faucet in faucets { + let response = match claim_token(faucet, address.clone()).await { + Ok(tx_hash) => ClaimResponse { + faucet_info: faucet, + tx_hash: Some(tx_hash), + error: None, + }, + Err(e) => ClaimResponse { + faucet_info: faucet, + tx_hash: None, + error: Some(e), + }, + }; + results.push(response); } Ok(results) @@ -315,7 +314,7 @@ async fn handle_native_claim( recipient: Address, from: Address, rpc: crate::utils::rpc_context::Provider, -) -> Result { +) -> Result { use crate::utils::message::message_transfer; let id_address = rpc.lookup_id(recipient).await.unwrap_or_else(|_| { @@ -349,11 +348,7 @@ async fn handle_native_claim( .eth_get_transaction_hash_by_cid(cid) .await .map_err(ServerFnError::new)?; - Ok(ClaimResponse { - faucet_info, - tx_hash: Some(tx_hash), - error: None, - }) + Ok(tx_hash) } Err(err) => Err(handle_faucet_error(err)), } @@ -365,7 +360,7 @@ async fn handle_erc20_claim( recipient: Address, from: Address, rpc: crate::utils::rpc_context::Provider, -) -> Result { +) -> Result { use crate::utils::address::AddressAlloyExt; let eth_to = recipient.into_eth_address().map_err(ServerFnError::new)?; @@ -381,11 +376,7 @@ async fn handle_erc20_claim( .send_eth_transaction_signed(&signed) .await .map_err(ServerFnError::new)?; - Ok(ClaimResponse { - faucet_info, - tx_hash: Some(tx_hash), - error: None, - }) + Ok(tx_hash) } Err(err) => Err(handle_faucet_error(err)), } From a3391eb77cf56ca64c6f046b9ee232803c9393a2 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 19:46:59 +0530 Subject: [PATCH 08/10] fix typo --- docs/api-documentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-documentation.md b/docs/api-documentation.md index 451954ee..c9e53be0 100644 --- a/docs/api-documentation.md +++ b/docs/api-documentation.md @@ -231,7 +231,7 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=0xAe9C4b **Example:** ```bash -curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=CalibnetFIL&address=invalidaddress" +curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?faucet_info=CalibnetFIL&address=invalidaddress" ``` **Response:** @@ -263,7 +263,7 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=Calibnet **Example:** ```bash -curl "https://forest-explorer.chainsafe.dev/api/claim_token?faucet_info=CalibnetFIL&address=0xAe9C4b9508c929966ef37209b336E5796D632CDc" +curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?faucet_info=CalibnetFIL&address=0xAe9C4b9508c929966ef37209b336E5796D632CDc" ``` **Response:** From d903e2f6a80ede14fb07fabe3abe28366d078191 Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 19:50:09 +0530 Subject: [PATCH 09/10] fix example --- docs/api-documentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-documentation.md b/docs/api-documentation.md index c9e53be0..99fa4e72 100644 --- a/docs/api-documentation.md +++ b/docs/api-documentation.md @@ -231,7 +231,7 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=0xAe9C4b **Example:** ```bash -curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?faucet_info=CalibnetFIL&address=invalidaddress" +curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=invalidaddress" ``` **Response:** @@ -263,7 +263,7 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?faucet_info=Cali **Example:** ```bash -curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?faucet_info=CalibnetFIL&address=0xAe9C4b9508c929966ef37209b336E5796D632CDc" +curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=0xAe9C4b9508c929966ef37209b336E5796D632CDc" ``` **Response:** From 36c9a6e3babd2bc74249409e355cd3077a9ce7fa Mon Sep 17 00:00:00 2001 From: Shashank Date: Fri, 17 Oct 2025 19:55:18 +0530 Subject: [PATCH 10/10] correction in api doc --- docs/api-documentation.md | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/api-documentation.md b/docs/api-documentation.md index 99fa4e72..f6cee062 100644 --- a/docs/api-documentation.md +++ b/docs/api-documentation.md @@ -236,20 +236,20 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=invalida **Response:** -```bash +```json [ - { - "faucet_info": "CalibnetUSDFC", - "error": { - "ServerError": "Invalid address: Not a valid Testnet address" - } - }, - { - "faucet_info": "CalibnetFIL", - "error": { - "ServerError": "Invalid address: Not a valid Testnet address" - } + { + "faucet_info": "CalibnetUSDFC", + "error": { + "ServerError": "Invalid address: Not a valid Testnet address" } + }, + { + "faucet_info": "CalibnetFIL", + "error": { + "ServerError": "Invalid address: Not a valid Testnet address" + } + } ] ``` @@ -268,20 +268,20 @@ curl "https://forest-explorer.chainsafe.dev/api/claim_token_all?address=0xAe9C4b **Response:** -```bash +```json [ - { - "faucet_info": "CalibnetUSDFC", - "error": { - "ServerError": "Too many requests: Rate limited. Try again in 46 seconds." - } - }, - { - "faucet_info": "CalibnetFIL", - "error": { - "ServerError": "Too many requests: Rate limited. Try again in 12 seconds." - } + { + "faucet_info": "CalibnetUSDFC", + "error": { + "ServerError": "Too many requests: Rate limited. Try again in 46 seconds." } + }, + { + "faucet_info": "CalibnetFIL", + "error": { + "ServerError": "Too many requests: Rate limited. Try again in 12 seconds." + } + } ] ```