Added quick comments about code

This commit is contained in:
Valtteri Karesto
2021-12-13 22:54:57 +02:00
parent d67613c0cf
commit 380e196db2
9 changed files with 37 additions and 2 deletions

View File

@@ -20,7 +20,14 @@ export const names = [
"Walter",
];
/* This function adds faucet account to application global state.
* It calls the /api/faucet endpoint which in send a HTTP POST to
* https://hooks-testnet.xrpl-labs.com/newcreds and it returns
* new account with 10 000 XRP. Hooks Testnet /newcreds endpoint
* is protected with CORS so that's why we did our own endpoint
*/
export const addFaucetAccount = async (showToast: boolean = false) => {
// Lets limit the number of faucet accounts to 5 for now
if (state.accounts.length > 4) {
return toast.error("You can only have maximum 5 accounts");
}