3 import 'bootstrap/dist/js/bootstrap';
4 import "bootstrap/scss/bootstrap";
5 import React from "react";
6 import ReactDOM from "react-dom";
7 import App from "./components/App.js";
8 import { BrowserRouter } from 'react-router-dom';
10 import { Provider } from "react-redux";
11 import configureStore from "./store";
13 import Bytom from 'bytom-js-sdk'
15 require("babel-core/register");
16 require("babel-polyfill");
18 window.addEventListener('load', async function() {
19 if (typeof window.bytom !== 'undefined') {
20 let bytomPollInterval = 3 * 1000;
23 solonet: 'http://app.bycoin.io:3000/',
24 testnet: 'http://app.bycoin.io:3020/',
25 mainnet: 'https://api.bycoin.im:8000/'
29 window.bytom.defaultAccount = await window.bytom.request('currentAccount')
31 const bytom = new Bytom(networks, '')
32 bytom.setNetType(window.bytom.defaultAccount.net)
34 global.bytomAPI = bytom
36 // Check to see if the user has signed in/out of their
37 // bytom wallet or switched accounts
38 let accountInterval = setInterval(async function() {
39 const account = await window.bytom.request('currentAccount')
40 if ( account.guid !== window.bytom.defaultAccount.guid) {
41 location.reload(true);
43 }, bytomPollInterval);
51 <Provider store={configureStore()}>
56 ), document.getElementById('root'));