Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge Explorer implementation #80

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*


.env
1 change: 1 addition & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.14.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we want to update to at least node18 since 16 is no longer supports by a lot of libraries these days

6 changes: 6 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"printWidth": 100
}
6 changes: 6 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Zeko Bridge Explorer

```bash
yarn
yarn start
```
1 change: 1 addition & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
17 changes: 17 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const webpack = require('webpack');
module.exports = function override(config, env) {
config.resolve.fallback = {
buffer: require.resolve('buffer'),
crypto: false,
util: false,
stream: false,
...config.resolve.fallback
};
config.plugins.push(
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
);
return config;
}
73 changes: 73 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "zeko-bridge-explorer",
"version": "0.1.0",
"private": true,
"dependencies": {
"@dcspark/cip5-js": "^1.0.0",
"@emurgo/cip14-js": "^3.0.1",
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these two anymore since they're Cardano specific

"@headlessui/react": "1.6.4",
"@radix-ui/react-tabs": "^1.0.1",
"@radix-ui/react-tooltip": "^1.0.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.1",
"@testing-library/user-event": "^13.5.0",
"algosdk": "^1.21.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this since it's Algorand specific

"bech32": "^2.0.0",
"bignumber.js": "^9.0.2",
"buffer": "^6.0.3",
"clsx": "^1.2.1",
"crypto-browserify": "^3.12.0",
"ethers": "^5.6.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this since it's EVM-specific

"moment": "^2.29.3",
"process": "^0.11.10",
"react": "^18.0.0",
"react-app-rewired": "^2.2.1",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.0.0",
"react-intersection-observer": "^9.3.3",
"react-query": "^3.35.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"react-simple-pull-to-refresh": "1.3.3",
"serve": "^13.0.2",
"typescript": "^4.6.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to upgrade to typescript v5 since many tools require it these days

"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build && cp _redirects build/_redirects",
"test": "react-app-rewired test",
"eject": "react-scripts eject",
"serve": "serve -s build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/node": "^16.11.27",
"@types/react": "^18.0.5",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.0.0",
"autoprefixer": "10.4.7",
"postcss": "8.4.14",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"tailwindcss": "3.1.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file not shown.
Binary file not shown.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO to myself: get new icons for you

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" sizes="any" />
<link rel="icon" href="%PUBLIC_URL%/favicon.svg" type="image/svg+xml" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

<meta
name="description"
content="Zeko Bridge Explorer makes tracking your wrapping and unwrapping requests much simpler by exposing all of the key information in an easy-to-consume format."
/>

<meta property="og:title" content="Explore Zeko Blockchain ecosystem with ease." />
<meta property="og:type" content="website" />
<meta
property="og:description"
content="Zeko Bridge Explorer makes tracking your wrapping and unwrapping requests much simpler by exposing all of the key information in an easy-to-consume format."
/>
<meta property="og:url" content="/" />
<meta property="og:site_name" content="Zeko Bridge Explorer" />
<meta
property="og:image"
content="/zeko_banner.png"
/>
<meta
property="og:image:secure_url"
content="/zeko_banner.png"
/>
<meta property="og:image:width" content="720" />
<meta property="og:image:height" content="405" />

<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:description"
content="Zeko Bridge Explorer makes tracking your wrapping and unwrapping requests much simpler by exposing all of the key information in an easy-to-consume format."
/>
<meta name="twitter:title" content="Zeko Bridge Explorer" />
<meta
name="twitter:image"
content="/zeko_banner.png"
/>

<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;700&display=swap"
rel="stylesheet"
/>
<!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.ico" /> -->
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Zeko Bridge Explorer</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "Zeko Bridge Explorer",
"name": "Zeko Bridge Explorer",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO to myself: new banner image

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
58 changes: 58 additions & 0 deletions src/app/zkapps_examples/rollup/bridge-explorer/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { QueryClient, QueryClientProvider } from "react-query";
import { BrowserRouter, Navigate, Route, Routes, useLocation } from "react-router-dom";
import Home from "./Pages/Home/Home";
import Search from "./Pages/Search/Search";
import TxDetail from "./Pages/TxDetail";
import NotFound from "./Components/UI/Molecules/NotFound";
import { Fragment, useLayoutEffect } from "react";
import { Networks, networksMap } from "./Services/ConfigService";
import { AppProvider } from "./context/AppContext";
import MainLayout from "./Components/layout/MainLayout";

export const networkList = Object.values(networksMap || {});
export const initialNetwork = networksMap[Networks.mainnet];

export const queryClient = new QueryClient({
defaultOptions: {
queries: {
cacheTime: 1000 * 60 * 60 * 1, // 24 hours
},
},
});

const ScrollToTop = () => {
const location = useLocation();
useLayoutEffect(() => {
document.documentElement.scrollTo(0, 0);
}, [location.pathname]);
return null;
};

function App() {
return (
<QueryClientProvider client={queryClient}>
<AppProvider>
<BrowserRouter>
<ScrollToTop />
<MainLayout>
<Routes>
{/* By default redirect to mainnet */}
<Route path="/" element={<Navigate to={`/${initialNetwork.id}`} replace />} />
{networkList.map((network) => (
<Fragment key={network.id}>
<Route path={`/${network.id}`} element={<Home />} />
<Route path={`/${network.id}/search`} element={<Search />} />
<Route path={`/${network.id}/search/:type`} element={<Search />} />
<Route path={`/${network.id}/tx/:id`} element={<TxDetail />} />
</Fragment>
))}
<Route path="*" element={<NotFound />} />
</Routes>
</MainLayout>
</BrowserRouter>
</AppProvider>
</QueryClientProvider>
);
}

export default App;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO for myself: new navbar logo

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading