2023-01-19 11:16:21 +00:00
|
|
|
import {
|
|
|
|
RestConnector,
|
|
|
|
JsonRpcConnector,
|
|
|
|
ViewConnector,
|
|
|
|
} from '@vegaprotocol/wallet';
|
2022-02-22 23:06:35 +00:00
|
|
|
|
2022-02-23 05:39:12 +00:00
|
|
|
export const rest = new RestConnector();
|
2022-10-03 18:12:34 +00:00
|
|
|
export const jsonRpc = new JsonRpcConnector();
|
2022-02-23 05:39:12 +00:00
|
|
|
|
2023-01-19 11:16:21 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2022-02-22 23:06:35 +00:00
|
|
|
export const Connectors = {
|
2022-02-23 05:39:12 +00:00
|
|
|
rest,
|
2022-10-03 18:12:34 +00:00
|
|
|
jsonRpc,
|
2023-01-19 11:16:21 +00:00
|
|
|
view,
|
2022-02-22 23:06:35 +00:00
|
|
|
};
|