2024-02-21 19:24:30 -06:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom/client';
|
2024-03-07 21:27:37 -06:00
|
|
|
import { MetaMaskProvider } from '@metamask/sdk-react';
|
|
|
|
import 'bootswatch/dist/slate/bootstrap.min.css';
|
2024-04-25 13:21:44 -05:00
|
|
|
import './App.css';
|
|
|
|
import {
|
|
|
|
createBrowserRouter,
|
|
|
|
RouterProvider,
|
|
|
|
} from 'react-router-dom';
|
|
|
|
|
|
|
|
import WebApp from './WebApp';
|
|
|
|
import Widget from './Widget';
|
2024-04-28 20:27:25 -05:00
|
|
|
import MainContextProvider from './contexts/MainContextProvider';
|
2024-04-25 13:21:44 -05:00
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
element: <WebApp />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'widget/',
|
2024-04-25 14:13:31 -05:00
|
|
|
element: <Widget />,
|
2024-04-25 13:21:44 -05:00
|
|
|
},
|
|
|
|
]);
|
2024-02-21 18:01:41 -06:00
|
|
|
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
|
<React.StrictMode>
|
2024-03-07 21:27:37 -06:00
|
|
|
<MetaMaskProvider
|
|
|
|
debug={false}
|
|
|
|
sdkOptions={{
|
|
|
|
dappMetadata: {
|
|
|
|
name: 'DGF Prototype',
|
|
|
|
url: window.location.href,
|
|
|
|
},
|
|
|
|
enableAnalytics: false,
|
|
|
|
readonlyRPCMap: {
|
2024-03-10 11:55:59 -05:00
|
|
|
'0x539': 'http://127.0.0.1:8545/',
|
2024-03-07 21:27:37 -06:00
|
|
|
},
|
|
|
|
}}
|
|
|
|
>
|
2024-04-28 20:27:25 -05:00
|
|
|
<MainContextProvider>
|
|
|
|
<RouterProvider router={router} />
|
|
|
|
</MainContextProvider>
|
2024-03-07 21:27:37 -06:00
|
|
|
</MetaMaskProvider>
|
2024-02-21 18:01:41 -06:00
|
|
|
</React.StrictMode>,
|
2024-02-21 19:24:30 -06:00
|
|
|
);
|