Use faucet to fund laconic accounts while sending a transaction #2

Merged
nabarun merged 9 commits from ag-integrate-faucet into main 2024-07-18 06:02:58 +00:00
Showing only changes of commit 920190d367 - Show all commits

View File

@ -54,24 +54,24 @@ const SignWithCosmos = () => {
address: cosmosAddress,
}),
});
if (response.ok) {
enqueueSnackbar('Tokens sent successfully', { variant: "success" });
} else {
const errorResponse = await response.json();
if (response.status === 429) {
const errorResponse = await response.json();
enqueueSnackbar(`${response.statusText} : ${errorResponse.error}`, { variant: "error" });
setIsRequesting(false);
} else {
throw new Error('Failed to send request');
throw new Error(errorResponse.error);
}
}
getBalances();
setIsRequesting(false);
} catch (error) {
console.error('Error:', error);
throw error;
console.error(error);
enqueueSnackbar("Error getting tokens from faucet", { variant: "error" });
} finally {
setIsRequesting(false);
}
};