@@ -2,12 +2,12 @@ import React from "react";
22import styled from "styled-components" ;
33import { formatUnits , formatEther } from "viem" ;
44import { useAccount } from "wagmi" ;
5- import { KLEROS_CONTRACT_ADDRESS , WETH_CONTRACT_ADDRESS } from "src/consts/index" ;
65import TokenRewards from "./TokenRewards" ;
76import WithHelpTooltip from "../WithHelpTooltip" ;
87import { isUndefined } from "utils/index" ;
98import { useUserQuery , UserQuery } from "queries/useUser" ;
109import { useCoinPrice } from "hooks/useCoinPrice" ;
10+ import { usePNKAddress , useWETHAddress } from "hooks/useContractAddress" ;
1111
1212interface IReward {
1313 token : "ETH" | "PNK" ;
@@ -28,11 +28,6 @@ const tooltipMsg =
2828 "is coherent with the final ruling receive the Juror Rewards composed of " +
2929 "arbitration fees (ETH) + PNK redistribution between jurors." ;
3030
31- const coinIdToAddress = {
32- 0 : KLEROS_CONTRACT_ADDRESS ,
33- 1 : WETH_CONTRACT_ADDRESS ,
34- } ;
35-
3631const rewards : IReward [ ] = [
3732 {
3833 token : "ETH" ,
@@ -59,7 +54,8 @@ const calculateTotalReward = (coinId: number, data: UserQuery): bigint => {
5954const Coherency : React . FC = ( ) => {
6055 const { address } = useAccount ( ) ;
6156 const { data } = useUserQuery ( address ?. toLowerCase ( ) ) ;
62- const { prices : pricesData } = useCoinPrice ( [ KLEROS_CONTRACT_ADDRESS , WETH_CONTRACT_ADDRESS ] ) ;
57+ const coinIdToAddress = [ usePNKAddress ( ) , useWETHAddress ( ) ] ;
58+ const { prices : pricesData } = useCoinPrice ( coinIdToAddress ) ;
6359
6460 return (
6561 < >
0 commit comments