1
1
'use client' ;
2
+ import { useGetAccountKDABalance } from '@/hooks/getAccountKDABalance' ;
2
3
import type { IAgentHookProps } from '@/hooks/getAgentRoles' ;
3
4
import { useGetAgentRoles } from '@/hooks/getAgentRoles' ;
4
5
import { useGetInvestorBalance } from '@/hooks/getInvestorBalance' ;
5
- import { accountKDABalance } from '@/services/accountKDABalance' ;
6
6
import { isAgent } from '@/services/isAgent' ;
7
7
import { isComplianceOwner } from '@/services/isComplianceOwner' ;
8
8
import { isFrozen } from '@/services/isFrozen' ;
@@ -75,7 +75,10 @@ export const AccountProvider: FC<PropsWithChildren> = ({ children }) => {
75
75
const [ isAgentState , setIsAgentState ] = useState ( false ) ;
76
76
const [ isInvestorState , setIsInvestorState ] = useState ( false ) ;
77
77
const [ isFrozenState , setIsFrozenState ] = useState ( false ) ;
78
- const [ kdaBalance , setKdaBalance ] = useState ( - 1 ) ;
78
+ const { data : kdaBalance } = useGetAccountKDABalance ( {
79
+ accountAddress : account ?. address ,
80
+ } ) ;
81
+ // const [kdaBalance, setKdaBalance] = useState(-1);
79
82
const { ...accountRoles } = useGetAgentRoles ( {
80
83
agent : account ?. address ,
81
84
} ) ;
@@ -89,12 +92,11 @@ export const AccountProvider: FC<PropsWithChildren> = ({ children }) => {
89
92
setIsAgentState ( ! ! resIsAgent ) ;
90
93
} ;
91
94
const checkIsGasPayable = async ( account : IWalletAccount ) => {
92
- const res = await accountKDABalance (
93
- { accountName : account . address } ,
94
- account ,
95
- ) ;
96
-
97
- setKdaBalance ( res ) ;
95
+ // const res = await accountKDABalance(
96
+ // { accountName: account.address },
97
+ // account,
98
+ // );
99
+ // setKdaBalance(res);
98
100
} ;
99
101
const checkIsOwner = async ( account : IWalletAccount ) => {
100
102
const resIsOwner = await isOwner ( { owner : account . address } ) ;
0 commit comments