-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0ee9b4
commit 4333dee
Showing
62 changed files
with
4,059 additions
and
29 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
import React from 'react'; | ||
import Routes from './Routes'; | ||
import { Footer, Navbar, Search } from './components'; | ||
import { HRC20, HRC721, HRC1155 } from './components/helpers'; | ||
import { BrowserRouter as Router } from "react-router-dom"; | ||
import { Toaster } from 'react-hot-toast'; | ||
function App() { | ||
return ( | ||
<Router> | ||
<Toaster /> | ||
<div className="max-w-8xl mx-auto"> | ||
<Navbar /> | ||
<Search /> | ||
<Routes /> | ||
</div> | ||
<Footer /> | ||
{/* Helper components */} | ||
<HRC20 /> | ||
<HRC721 /> | ||
<HRC1155 /> | ||
</Router> | ||
); | ||
} | ||
|
||
export default function App() { | ||
return ( | ||
<h1 className="text-3xl font-bold underline text-red-800"> | ||
Hello world! | ||
</h1> | ||
) | ||
} | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const breakpoints = { | ||
mobile: '375px', | ||
mobileL: '425px', | ||
tablet: '768px', | ||
tabletM: '868px', | ||
laptop: '1024px', | ||
desktop: '1280px', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import { Home, Address } from "./components" | ||
import { Routes, Route } from "react-router-dom"; | ||
import { Box, Grommet } from "grommet"; | ||
import { useThemeMode } from "../src/hooks/themeSwitcherHook"; | ||
import { theme, darkTheme } from "./theme"; | ||
|
||
const AllRoutes = () => { | ||
const themeMode = useThemeMode(); | ||
return ( | ||
<div className='max-w-8xl mx-auto'> | ||
<Grommet | ||
theme={themeMode === "light" ? theme : darkTheme} | ||
themeMode={themeMode} | ||
full | ||
> | ||
<Routes> | ||
<Route path="/" element={<Home />} /> | ||
<Route path="/address/:id" element={<Address />} /> | ||
</Routes> | ||
</Grommet> | ||
</div> | ||
) | ||
} | ||
|
||
export default AllRoutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { transport } from './explorer'; | ||
import {Block, InternalTransaction, RPCStakingTransactionHarmony, RPCTransactionHarmony, RelatedTransaction} from "../types"; | ||
|
||
export function getBlockByNumber(params: any[]) { | ||
return transport('getBlockByNumber', params) as Promise<Block>; | ||
} | ||
|
||
export function getBlockByHash(params: any[]) { | ||
return transport('getBlockByHash', params) as Promise<Block>; | ||
} | ||
|
||
export function getBlocks(params: any[]) { | ||
return transport('getBlocks', params) as Promise<Block[]>; | ||
} | ||
|
||
export function getCount(params: any[]) { | ||
return transport('getCount', params) as Promise<{ count: string }>; | ||
} | ||
|
||
export function getTransactions(params: any[]) { | ||
return transport('getTransactions', params) as Promise<RPCTransactionHarmony[]>; | ||
} | ||
|
||
export function getTransactionByField(params: any[]) { | ||
return transport('getTransactionByField', params) as Promise<RPCStakingTransactionHarmony>; | ||
} | ||
|
||
export function getStakingTransactionByField(params: any[]) { | ||
return transport('getStakingTransactionsByField', params) as Promise<RPCStakingTransactionHarmony>; | ||
} | ||
|
||
export function getInternalTransactionsByField(params: any[]) { | ||
return transport('getInternalTransactionsByField', params) as Promise<InternalTransaction[]>; | ||
} | ||
|
||
export function getTransactionLogsByField(params: any[]) { | ||
return transport('getLogsByField', params) as Promise<any>; | ||
} | ||
|
||
export function getByteCodeSignatureByHash(params: any[]) { | ||
return transport('getSignaturesByHash', params) as Promise<any>; | ||
} | ||
|
||
export function getRelatedTransactions(params: any[]) { | ||
return transport('getRelatedTransactions', params) as Promise<RelatedTransaction[]>; | ||
} | ||
export function getRelatedTransactionsByType(params: any[]) { | ||
return transport('getRelatedTransactionsByType', params) as Promise<any[]>; | ||
} | ||
|
||
export function getTransactionCountLast14Days() { | ||
return transport('getTransactionCountLast14Days', []) as Promise<any[]>; | ||
} | ||
|
||
export function getContractsByField(params: any[]) { | ||
return transport('getContractsByField', params) as Promise<any[]>; | ||
} | ||
|
||
export function getAllERC20() { | ||
return transport('getAllERC20', []) as Promise<any[]>; | ||
} | ||
|
||
export function getAllERC721() { | ||
return transport('getAllERC721', []) as Promise<any[]>; | ||
} | ||
export function getAllERC1155() { | ||
return transport('getAllERC1155', []) as Promise<any[]>; | ||
} | ||
|
||
export function getUserERC20Balances(params: any[]) { | ||
return transport('getUserERC20Balances', params) as Promise<any[]>; | ||
} | ||
export function getUserERC721Balances(params: any[]) { | ||
return transport('getUserERC721Assets', params) as Promise<any[]>; | ||
} | ||
export function getUserERC1155Balances(params: any[]) { | ||
return transport('getUserERC1155Balances', params) as Promise<any[]>; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {transport} from './ws' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { io } from "socket.io-client"; | ||
|
||
const socket = io("https://ws.explorer-v2-api.hmny.io", { | ||
transports: ["websocket"], | ||
}); | ||
|
||
socket.connect(); | ||
|
||
export const transport = (method: string, params: any[]) => { | ||
return new Promise((resolve, reject) => { | ||
socket.emit(method, params, (res: any) => { | ||
try { | ||
const payload = JSON.parse(res.payload); | ||
|
||
if (res.event === "Response") { | ||
resolve(payload); | ||
} else { | ||
reject(payload); | ||
} | ||
} catch (err) { | ||
reject(null); | ||
} | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { default as Logo } from './logo.svg'; | ||
export { default as LogoWhite } from './logoWhite.svg'; | ||
export { default as OneLogo } from './one-logo.png'; |
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.
Oops, something went wrong.
4333dee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
harmony – ./
harmony-git-master-frankudoags.vercel.app
harmony-tawny.vercel.app
harmony-frankudoags.vercel.app