UNPKG

@renegade-fi/core

Version:
24 lines 771 B
import invariant from 'tiny-invariant'; import { getWalletFromRelayer } from './getWalletFromRelayer.js'; export async function reconnect(config) { try { invariant(config.state.seed, 'No seed found'); invariant(config.state.id, 'No id found'); const wallet = await getWalletFromRelayer(config); if (wallet) { config.setState((x) => ({ ...x, status: 'in relayer', })); console.log('Wallet found in relayer', { status: 'in relayer', walletId: wallet.id, }); } } catch (error) { console.error('Could not reconnect', { error }); config.setState({}); } } //# sourceMappingURL=reconnect.js.map