) => {
+ if (/^[0-9a-fA-F]*$/.test(e.target.value)) {
+ setClaimFeesFormState({
+ ...claimFeesFormState,
+ [e.target.name]: e.target.value,
+ });
+ }
+ setEstimatedFee(0);
+ };
+
+ const onClaim = async () => {
+ if (claimFeesFormState.account) {
+ setDisabled(true);
+ claimFees(claimFeesFormState.account, 3000, claimFeesFormState.validatorNodePublicKey, parseInt(claimFeesFormState.epoch)).then((resp) => {
+ console.log(resp);
+ }).catch((e) => {
+ console.error(e);
+ }).finally(() => {
+ setDisabled(false);
+ });
+ };
+ }
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ const formattedKey = (key: any[]) => {
+ let account = dataAccountsList.accounts.find((account: any) => account.account.key_index === +key[0])
+ if (account === undefined) {
+ return null
+ return {key[0]} {key[1]}
+ }
+ return {key[0]} {key[1]}
Account {account.account.name}
+ }
+
+ return (
+
+
+
+
+ );
+}
diff --git a/applications/tari_dan_wallet_web_ui/src/utils/json_rpc.tsx b/applications/tari_dan_wallet_web_ui/src/utils/json_rpc.tsx
index 6413c8a43c..3257fee884 100644
--- a/applications/tari_dan_wallet_web_ui/src/utils/json_rpc.tsx
+++ b/applications/tari_dan_wallet_web_ui/src/utils/json_rpc.tsx
@@ -34,13 +34,13 @@ async function internalJsonRpc(method: string, token: any = null, params: any =
id = json_id;
json_id += 1;
});
- let address = "http://localhost:9000";
- try {
- address = await (await fetch('/json_rpc_address')).text();
- if (!address.startsWith("http")) {
- address = "http://" + address;
- }
- } catch { }
+ let address = "http://127.0.0.1:18016";
+ // try {
+ // address = await (await fetch('/json_rpc_address')).text();
+ // if (!address.startsWith("http")) {
+ // address = "http://" + address;
+ // }
+ // } catch { }
let headers: { [key: string]: string } = {
"Content-Type": "application/json",
};
@@ -185,3 +185,7 @@ export const accountNFTsList = (offset: number, limit: number) => jsonRpc("nfts.
// settings
export const getSettings = () => jsonRpc("settings.get", []);
export const setSettings = (settings: any) => jsonRpc("settings.set", settings);
+
+// validators
+export const getFeeSummary = (validatorPublicKey: string, minEpoch: number, maxEpoch: number) => jsonRpc("validators.get_fee_summary", [validatorPublicKey, minEpoch, maxEpoch]);
+export const claimFees = (account: string, maxFee: number, validatorPublicKey: string, epoch: number) => jsonRpc("validators.claim_fees", [account, maxFee, validatorPublicKey, epoch]);