diff --git a/src/screens/ApproveTransaction.tsx b/src/screens/ApproveTransaction.tsx index 8af48bf..f149388 100644 --- a/src/screens/ApproveTransaction.tsx +++ b/src/screens/ApproveTransaction.tsx @@ -23,6 +23,7 @@ import { getPathKey } from '../utils/misc'; import { WalletConnectRequests, approveWalletConnectRequest, + rejectWalletConnectRequest, } from '../utils/wallet-connect/wallet-connect-requests'; import { web3wallet } from '../utils/wallet-connect/WalletConnectUtils'; import { MEMO } from './ApproveTransfer'; @@ -95,9 +96,9 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { setCosmosStargateClient(client); } catch (error: any) { setTxError(error.message); + setIsTxErrorDialogOpen(true); const response = formatJsonRpcError(requestEventId, error.message); await web3wallet!.respondSessionRequest({ topic, response }); - setIsTxErrorDialogOpen(true); } }; @@ -144,9 +145,9 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { ); } catch (error: any) { setTxError(error.message); + setIsTxErrorDialogOpen(true); const response = formatJsonRpcError(requestEventId, error.message); await web3wallet!.respondSessionRequest({ topic, response }); - setIsTxErrorDialogOpen(true); } }; getCosmosGas(); @@ -207,12 +208,22 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { navigation.navigate('Laconic'); } catch (error: any) { setTxError(error.message); + setIsTxErrorDialogOpen(true); const response = formatJsonRpcError(requestEventId, error.message); await web3wallet!.respondSessionRequest({ topic, response }); - setIsTxErrorDialogOpen(true); } }; + const rejectRequestHandler = async () => { + const response = rejectWalletConnectRequest(requestEvent); + await web3wallet!.respondSessionRequest({ + topic, + response, + }); + + navigation.navigate('Laconic'); + }; + return ( <> @@ -256,7 +267,13 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { /> +