vega-frontend-monorepo/apps/trading/lib/vega-connectors.ts
Maciek 069b57d4ae
feat(wallet): 4370 new connect wallet modal (#4492)
Co-authored-by: asiaznik <artur@vegaprotocol.io>
2023-08-10 13:03:53 +02:00

23 lines
493 B
TypeScript

import {
JsonRpcConnector,
ViewConnector,
InjectedConnector,
} from '@vegaprotocol/wallet';
export const jsonRpc = new JsonRpcConnector();
export const injected = new InjectedConnector();
let view: ViewConnector;
if (typeof window !== 'undefined') {
const urlParams = new URLSearchParams(window.location.hash.split('?')[1]);
view = new ViewConnector(urlParams.get('address'));
} else {
view = new ViewConnector();
}
export const Connectors = {
injected,
jsonRpc,
view,
};