Skip to content

Commit 2a2587a

Browse files
committed
chore: updated hathor-rpc-lib to use published version
1 parent 841bc62 commit 2a2587a

File tree

3 files changed

+26
-77
lines changed

3 files changed

+26
-77
lines changed

package-lock.json

+12-63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@hathor/hathor-rpc-handler/@hathor/wallet-lib/axios": "1.7.7"
3535
},
3636
"dependencies": {
37-
"@hathor/hathor-rpc-handler": "0.0.3-experimental-alpha",
37+
"@hathor/hathor-rpc-handler": "0.4.0-experimental-alpha",
3838
"@hathor/wallet-lib": "2.0.1",
3939
"@ledgerhq/hw-transport-node-hid": "6.28.1",
4040
"@reduxjs/toolkit": "2.2.3",

src/sagas/reown.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
CreateTokenError,
3131
SendNanoContractTxError,
3232
SignMessageWithAddressError,
33-
} from 'hathor-rpc-handler-test';
33+
} from '@hathor/hathor-rpc-handler';
3434
import { isWalletServiceEnabled } from './wallet';
3535
import { ReownModalTypes } from '../components/Reown/ReownModal';
3636
import {
@@ -162,13 +162,13 @@ function* init() {
162162
*/
163163
export function* listenForNetworkChange() {
164164
let previousGenesisHash = yield select((state) => get(state.serverInfo, 'genesisHash'));
165-
165+
166166
while (true) {
167167
// Wait for the server info to be updated with the new network data
168168
yield take(types.SERVER_INFO_UPDATED);
169-
169+
170170
const currentGenesisHash = yield select((state) => get(state.serverInfo, 'genesisHash'));
171-
171+
172172
if (previousGenesisHash !== currentGenesisHash) {
173173
log.debug('Genesis hash changed, clearing reown sessions.');
174174
yield call(clearSessions);
@@ -208,12 +208,12 @@ export function* refreshActiveSessions(extend = false) {
208208
}
209209

210210
const activeSessions = yield call(() => walletKit.getActiveSessions());
211-
211+
212212
yield put(setReownSessions(activeSessions || {}));
213213

214214
if (extend) {
215215
const sessionKeys = Object.keys(activeSessions || {});
216-
216+
217217
for (const key of sessionKeys) {
218218
log.debug('Extending session ');
219219
log.debug(activeSessions[key].topic);
@@ -741,7 +741,7 @@ export function* onWalletReset() {
741741
*/
742742
export function* onSessionProposal(action) {
743743
const { id, params } = action.payload;
744-
744+
745745
// Ensure connection state is set to CONNECTING at the beginning of the saga
746746
yield put(setWCConnectionState(REOWN_CONNECTION_STATE.CONNECTING));
747747

@@ -763,13 +763,13 @@ export function* onSessionProposal(action) {
763763
log.error('Unsupported methods requested:', unsupportedMethods);
764764
// Set connection state to FAILED
765765
yield put(setWCConnectionState(REOWN_CONNECTION_STATE.FAILED));
766-
766+
767767
// Show error modal to user
768768
yield put(showGlobalModal(MODAL_TYPES.ERROR_MODAL, {
769769
title: 'Connection Error',
770770
message: `The dApp is requesting methods that are not supported: ${unsupportedMethods.join(', ')}`,
771771
}));
772-
772+
773773
// Reject the session
774774
const { walletKit } = getGlobalReown();
775775
if (walletKit) {
@@ -855,16 +855,16 @@ export function* onSessionProposal(action) {
855855
} catch (error) {
856856
log.error('Error handling session proposal:', error);
857857
yield put(onExceptionCaptured(error));
858-
858+
859859
// Set connection state to FAILED
860860
yield put(setWCConnectionState(REOWN_CONNECTION_STATE.FAILED));
861-
861+
862862
// Show error modal to user
863863
yield put(showGlobalModal(MODAL_TYPES.ERROR_MODAL, {
864864
title: 'Connection Error',
865865
message: `Failed to connect to dApp: ${error.message}`,
866866
}));
867-
867+
868868
// Try to reject the session if possible
869869
try {
870870
const { walletKit } = getGlobalReown();
@@ -914,7 +914,7 @@ export function* onUriInputted(action) {
914914
log.debug('Error pairing: ', error);
915915
// Connection failed
916916
yield put(setWCConnectionState(REOWN_CONNECTION_STATE.FAILED));
917-
917+
918918
// Show error modal to user
919919
yield put(showGlobalModal(MODAL_TYPES.ERROR_MODAL, {
920920
title: 'Connection Error',

0 commit comments

Comments
 (0)