diff --git a/src/api/hooks/useGetDelegationNodeCommissionChange.ts b/src/api/hooks/useGetDelegationNodeCommissionChange.ts index 277a8cbb..8768da37 100644 --- a/src/api/hooks/useGetDelegationNodeCommissionChange.ts +++ b/src/api/hooks/useGetDelegationNodeCommissionChange.ts @@ -1,6 +1,6 @@ import {useQuery} from "@tanstack/react-query"; import {Types} from "aptos"; -import {getValidatorCommission} from ".."; +import {getValidatorCommissionChange} from ".."; import {useGlobalState} from "../../global-config/GlobalConfig"; import {ResponseError} from "../client"; import {MoveValue} from "aptos/src/generated"; @@ -21,8 +21,8 @@ export function useGetDelegationNodeCommissionChange({ const [{aptos_client: client}] = useGlobalState(); const query = useQuery({ - queryKey: ["validatorCommission", client, validatorAddress], - queryFn: () => getValidatorCommission(client, validatorAddress), + queryKey: ["validatorCommissionChange", client, validatorAddress], + queryFn: () => getValidatorCommissionChange(client, validatorAddress), select: (res: MoveValue[]) => Number(res ? res[0] : 0) / 100, // commission rate: 22.85% is represented as 2285 }); diff --git a/src/api/index.ts b/src/api/index.ts index 476b6856..367a82da 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -253,13 +253,13 @@ export async function getValidatorCommission( export async function getValidatorCommissionChange( client: AptosClient, - poolAddress: Types.Address, + validatorAddress: Types.Address, ): Promise { const payload: Types.ViewRequest = { function: "0x1::delegation_pool::operator_commission_percentage_next_lockup_cycle", type_arguments: [], - arguments: [poolAddress], + arguments: [validatorAddress], }; return withResponseError(client.view(payload)); }