11'use client' ;
22
3- import { useCurrentSafeClient , useSelectedSafeAddress } from '@/features/safe-account/providers/safe-account-provider' ;
43import { useEffect , useState , useCallback } from 'react' ;
54import { DataTable } from '@/components/DataTable/data-table' ;
65import { transactionColumns } from '@/components/DataTable/transaction-columns' ;
76import { PageContainer } from '@/components/Layout/PageContainer' ;
87import { TransactionService } from '@/services/transactions/TransactionService' ;
9- import { UnifiedTransaction } from '@/types/transactions' ;
8+ import { UnifiedTransaction } from '@/features/safe-sdk/ types/transactions' ;
109import { Alert , AlertDescription } from '@/components/ui/alert' ;
1110import { Loader2 , AlertCircle } from 'lucide-react' ;
11+ import { useSafeAccount } from '@/features/safe-sdk/hooks/use-safe-account' ;
12+ import { useSafeClient } from '@/features/safe-sdk/hooks/use-safe-client' ;
1213
1314export default function TransactionsPage ( ) {
1415 // State for transaction data, loading, error, and pagination
@@ -21,20 +22,20 @@ export default function TransactionsPage() {
2122 total : 0 ,
2223 } ) ;
2324
24- const safeClient = useCurrentSafeClient ( ) ;
25- const { selectedSafeAddress } = useSelectedSafeAddress ( ) ;
25+ const safeClient = useSafeClient ( ) ;
26+ const { selectedSafeAccountAddress } = useSafeAccount ( ) ;
2627
2728 // Fetch transactions from the API
2829 const fetchTransactions = useCallback ( async ( ) => {
29- if ( ! safeClient ?. apiKit || ! selectedSafeAddress ) {
30+ if ( ! safeClient ?. apiKit || ! selectedSafeAccountAddress ) {
3031 return ;
3132 }
3233
3334 setIsLoading ( true ) ;
3435 setError ( null ) ;
3536
3637 try {
37- const response = await TransactionService . getAllTransactions ( safeClient . apiKit , selectedSafeAddress , {
38+ const response = await TransactionService . getAllTransactions ( safeClient . apiKit , selectedSafeAccountAddress , {
3839 limit : pagination . limit ,
3940 offset : pagination . offset ,
4041 } ) ;
@@ -51,7 +52,7 @@ export default function TransactionsPage() {
5152 } finally {
5253 setIsLoading ( false ) ;
5354 }
54- } , [ safeClient ?. apiKit , selectedSafeAddress , pagination . limit , pagination . offset ] ) ;
55+ } , [ safeClient ?. apiKit , selectedSafeAccountAddress , pagination . limit , pagination . offset ] ) ;
5556
5657 // Refetch transactions when dependencies change
5758 useEffect ( ( ) => {
@@ -61,10 +62,10 @@ export default function TransactionsPage() {
6162 // Reset pagination offset when Safe address changes
6263 useEffect ( ( ) => {
6364 setPagination ( ( prev ) => ( { ...prev , offset : 0 } ) ) ;
64- } , [ selectedSafeAddress ] ) ;
65+ } , [ selectedSafeAccountAddress ] ) ;
6566
6667 // Show alert if no Safe wallet is selected
67- if ( ! selectedSafeAddress ) {
68+ if ( ! selectedSafeAccountAddress ) {
6869 return (
6970 < PageContainer >
7071 < Alert >
0 commit comments