diff --git a/chainIdRpcs.json b/chainIdRpcs.json index 93491c9..fa20c37 100644 --- a/chainIdRpcs.json +++ b/chainIdRpcs.json @@ -57,6 +57,9 @@ "https://demeter-testnet.webb.tools" ], "4006": [ - "https://tangle-standalone-archive.webb.tools" + "https://rpc.tangle.tools" + ], + "1081": [ + "ws://3.144.199.9:9944" ] } diff --git a/faucet-frontend/src/components/ClaimFundsForm.tsx b/faucet-frontend/src/components/ClaimFundsForm.tsx index 2a5d19c..06209f5 100644 --- a/faucet-frontend/src/components/ClaimFundsForm.tsx +++ b/faucet-frontend/src/components/ClaimFundsForm.tsx @@ -13,6 +13,7 @@ type Chain = EvmChain | SubstrateChain; const ClaimFundsForm: React.FC = ({ accessToken }) => { const [chain, setChain] = useState({ Evm: 3884533461 }); const [address, setAddress] = useState(""); + const [onlyNativeToken, setOnlyNativeToken] = useState(true); const claimFunds = async () => { // Implement your claim funds logic here @@ -27,14 +28,15 @@ const ClaimFundsForm: React.FC = ({ accessToken }) => { type: (chain as EvmChain).Evm ? "ethereum" : (chain as SubstrateChain).Substrate - ? "substrate" - : "Unknown", + ? "substrate" + : "Unknown", value: address, }, typedChainId: { type: (chain as EvmChain).Evm ? "Evm" : "Substrate", id: (chain as EvmChain).Evm || (chain as SubstrateChain).Substrate, }, + onlyNativeToken, }, }), { @@ -86,9 +88,8 @@ const ClaimFundsForm: React.FC = ({ accessToken }) => { - - - + + @@ -99,6 +100,17 @@ const ClaimFundsForm: React.FC = ({ accessToken }) => { onChange={(event) => setAddress(event.target.value)} /> + setOnlyNativeToken(event.target.checked)} + checked={onlyNativeToken} + > + + + - + ); }; diff --git a/src/helpers/files.rs b/src/helpers/files.rs index 49bd17e..c60657f 100644 --- a/src/helpers/files.rs +++ b/src/helpers/files.rs @@ -48,10 +48,11 @@ pub fn get_evm_rpc_url(chain_id: u64) -> String { rpc_data[0].clone() } -pub fn get_substrate_rpc_url(_chain_id: u64) -> String { - // TODO: Decide if we want to push this into config - let url = "wss://tangle-standalone-archive.webb.tools:443"; - url.to_string() +pub fn get_substrate_rpc_url(chain_id: u64) -> String { + let rpc_map = read_rpc_data(); + let binding = vec!["ws://localhost:9944".to_string()]; + let rpc_data = rpc_map.get(&chain_id).unwrap_or(&binding); + rpc_data[0].clone() } pub fn get_evm_token_address(chain_id: u64) -> [u8; 20] { diff --git a/src/main.rs b/src/main.rs index 1ad63fa..eb010ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -299,5 +299,5 @@ async fn rocket() -> _ { .manage(cors.to_cors().unwrap()) .manage(tx_sender) .mount("/", rocket_cors::catch_all_options_routes()) - .mount("/", routes![auth::login::twitter, faucet::faucet,]) + .mount("/", routes![auth::login::twitter, faucet::faucet]) } diff --git a/src/txes/networks.rs b/src/txes/networks.rs index fd08ba7..cf56dbc 100644 --- a/src/txes/networks.rs +++ b/src/txes/networks.rs @@ -33,6 +33,7 @@ impl Network { "athena" => Some(Self::Athena), "demeter" => Some(Self::Demeter), "tangle-evm-testnet" => Some(Self::TangleEVMTestnet), + "tangle" => Some(Self::Tangle), _ => None, } }