File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export const WithdrawalProvider = ({ children }: { children: React.ReactNode })
40
40
setClaimTxHash
41
41
} = useWithdrawalStore ( )
42
42
43
-
43
+ const { isActiveNetworkSepolia } = useNetworkInfo ( )
44
44
const {
45
45
initializeNativeWithdrawal,
46
46
initializeERC20Withdrawal,
@@ -112,12 +112,18 @@ export const WithdrawalProvider = ({ children }: { children: React.ReactNode })
112
112
useEffect ( ( ) => {
113
113
const checkClaimTx = async ( ) => {
114
114
try {
115
- await canClaimWithdrawal ( JSON . parse ( withdrawalTxData ) )
116
- setStep ( 'claim' )
115
+ const res = await canClaimWithdrawal ( JSON . parse ( withdrawalTxData ) )
116
+ if ( isActiveNetworkSepolia ) {
117
+ setStep ( 'claim' )
118
+ } else if ( res ) {
119
+ setStep ( 'claim' )
120
+ }
117
121
} catch ( error ) {
118
- console . error ( 'Error checking claim status:' , error )
119
- setError ( 'Failed to check claim status' )
120
- setStep ( 'error' )
122
+ if ( error && ( error as any ) . message && ! ( error as any ) . message . includes ( `proven withdrawal has not matured yet` ) ) {
123
+ console . error ( 'Error checking claim status:' , error )
124
+ setError ( 'Failed to check claim status' )
125
+ setStep ( 'error' )
126
+ }
121
127
}
122
128
}
123
129
Original file line number Diff line number Diff line change @@ -40,11 +40,9 @@ export function useAnchorageWithdrawalClaim() {
40
40
]
41
41
} ) ;
42
42
43
- console . log ( `resuest for claim` , request )
44
43
const walletClient = getWalletClient ( chainId ! )
45
44
46
45
const hash = await walletClient . writeContract ( request as any ) ;
47
- console . log ( `write claim tsx hash` , hash ) ;
48
46
return {
49
47
hash
50
48
} ;
Original file line number Diff line number Diff line change @@ -51,8 +51,11 @@ export function useAnchorageWithdrawalClaimable() {
51
51
}
52
52
53
53
} catch ( error ) {
54
- console . log ( `claimable` , error )
55
- console . error ( `${ ERROR_CODE } : claim error:` , error )
54
+ if ( error && ( error as any ) . message && ! ( error as any ) . message . includes ( `proven withdrawal has not matured yet` ) ) {
55
+ console . log ( `claimable` , error )
56
+ console . error ( `${ ERROR_CODE } : claim error:` , error )
57
+ }
58
+
56
59
throw error
57
60
}
58
61
}
You can’t perform that action at this time.
0 commit comments