@@ -30,7 +30,7 @@ import {
30
30
CreateTokenError ,
31
31
SendNanoContractTxError ,
32
32
SignMessageWithAddressError ,
33
- } from 'hathor-rpc-handler-test ' ;
33
+ } from '@ hathor/hathor -rpc-handler' ;
34
34
import { isWalletServiceEnabled } from './wallet' ;
35
35
import { ReownModalTypes } from '../components/Reown/ReownModal' ;
36
36
import {
@@ -162,13 +162,13 @@ function* init() {
162
162
*/
163
163
export function * listenForNetworkChange ( ) {
164
164
let previousGenesisHash = yield select ( ( state ) => get ( state . serverInfo , 'genesisHash' ) ) ;
165
-
165
+
166
166
while ( true ) {
167
167
// Wait for the server info to be updated with the new network data
168
168
yield take ( types . SERVER_INFO_UPDATED ) ;
169
-
169
+
170
170
const currentGenesisHash = yield select ( ( state ) => get ( state . serverInfo , 'genesisHash' ) ) ;
171
-
171
+
172
172
if ( previousGenesisHash !== currentGenesisHash ) {
173
173
log . debug ( 'Genesis hash changed, clearing reown sessions.' ) ;
174
174
yield call ( clearSessions ) ;
@@ -208,12 +208,12 @@ export function* refreshActiveSessions(extend = false) {
208
208
}
209
209
210
210
const activeSessions = yield call ( ( ) => walletKit . getActiveSessions ( ) ) ;
211
-
211
+
212
212
yield put ( setReownSessions ( activeSessions || { } ) ) ;
213
213
214
214
if ( extend ) {
215
215
const sessionKeys = Object . keys ( activeSessions || { } ) ;
216
-
216
+
217
217
for ( const key of sessionKeys ) {
218
218
log . debug ( 'Extending session ' ) ;
219
219
log . debug ( activeSessions [ key ] . topic ) ;
@@ -741,7 +741,7 @@ export function* onWalletReset() {
741
741
*/
742
742
export function * onSessionProposal ( action ) {
743
743
const { id, params } = action . payload ;
744
-
744
+
745
745
// Ensure connection state is set to CONNECTING at the beginning of the saga
746
746
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . CONNECTING ) ) ;
747
747
@@ -763,13 +763,13 @@ export function* onSessionProposal(action) {
763
763
log . error ( 'Unsupported methods requested:' , unsupportedMethods ) ;
764
764
// Set connection state to FAILED
765
765
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . FAILED ) ) ;
766
-
766
+
767
767
// Show error modal to user
768
768
yield put ( showGlobalModal ( MODAL_TYPES . ERROR_MODAL , {
769
769
title : 'Connection Error' ,
770
770
message : `The dApp is requesting methods that are not supported: ${ unsupportedMethods . join ( ', ' ) } ` ,
771
771
} ) ) ;
772
-
772
+
773
773
// Reject the session
774
774
const { walletKit } = getGlobalReown ( ) ;
775
775
if ( walletKit ) {
@@ -855,16 +855,16 @@ export function* onSessionProposal(action) {
855
855
} catch ( error ) {
856
856
log . error ( 'Error handling session proposal:' , error ) ;
857
857
yield put ( onExceptionCaptured ( error ) ) ;
858
-
858
+
859
859
// Set connection state to FAILED
860
860
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . FAILED ) ) ;
861
-
861
+
862
862
// Show error modal to user
863
863
yield put ( showGlobalModal ( MODAL_TYPES . ERROR_MODAL , {
864
864
title : 'Connection Error' ,
865
865
message : `Failed to connect to dApp: ${ error . message } ` ,
866
866
} ) ) ;
867
-
867
+
868
868
// Try to reject the session if possible
869
869
try {
870
870
const { walletKit } = getGlobalReown ( ) ;
@@ -914,7 +914,7 @@ export function* onUriInputted(action) {
914
914
log . debug ( 'Error pairing: ' , error ) ;
915
915
// Connection failed
916
916
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . FAILED ) ) ;
917
-
917
+
918
918
// Show error modal to user
919
919
yield put ( showGlobalModal ( MODAL_TYPES . ERROR_MODAL , {
920
920
title : 'Connection Error' ,
0 commit comments