Skip to content

Commit

Permalink
Zora + Adsense (#64)
Browse files Browse the repository at this point in the history
* Home Page, Empty Tx Pages, all arch setup

* update readme

* Logos

* Tabs

* Formatting

* Fees, Interaction and Volume cards from ZkFlow

* Explorer Polymorphised Services

* Main Page update with new stuffé

* Testing new stuff

* Generic Explorer Interface

* readme

* Hotfix: Readme hiccup

* Add DEX Screener Token Prices fetcher

* Balance but it's buggy

* Fully functional balance

* Non working Docker stuff

* Remove all warnings

* Containers

* add docker section to readme

* Design Tweaks for centering cards

* temp: network host

* added CI/CD with codecov

* Revert "temp: network host"

This reverts commit f720d46.

* better layout

* Fix activities on all chains

* Move donation card, add powered by... msg

* Add Criteria Card

* Adjust Card Size

* loading + countdown

* Fixes: better api for zks

* Update names

* Logos, Metadata and Date fixes

* wip: date shit

* Ft: redesign tabs, add qr code/clipboard, fix volume change

* tweak sizes

* Wip: volume toggle bridge only

* Feature: all bridges done, wip mantle

* Fully functional bridges

* Install Vite

* Create CI

* add wflows

* Add PR rule

* Fix lints and warns

* Fix builds

* Fix warning

* remove unused lint ignores

* remove useless prints

* remove base path

* Reduce loading time

* fixup badges

* add vercel analytics

* add vercel badge

* cleanup layout

* update readme

* Use blockscout linea api

* Update License

* comment coverage

* Update pages deployment

* Countdown from 20s to be sure

* add twitter logo (#42)

* Metadata Hotfix (#59)

* add twitter logo

* Hotfix: metadata link

* Zora Chain + Logos + Adsense (#63)

* Zora and Nova

* wip: zeta/nova

* Fix Warnings

* Remove unused lines

* Remove inferrable type

* Fix weird layout

* Bridges

* Iteration fix

---------

Co-authored-by: SomaGallai <soma.gallai@cm-robotics.com>
  • Loading branch information
guilyx and SomaGallai committed Sep 24, 2023
1 parent 2c47f16 commit 30f3da0
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 16 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

gtag('config', 'G-J0F0S558N9');
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5201491656980778"
crossorigin="anonymous"></script>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0",
"react-icons": "^4.10.1",
"react-icons": "^4.11.0",
"react-loading-skeleton": "^3.3.1",
"react-router-dom": "^6.11.2",
"react-switch": "^7.0.0"
Expand Down
28 changes: 28 additions & 0 deletions public/chains/nova.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, useState } from 'react';
import { FaTwitter } from 'react-icons/fa';
import { FaTwitter, FaGithub } from 'react-icons/fa';

interface HeaderProps {
hasSearchBar?: boolean;
Expand Down Expand Up @@ -28,14 +28,18 @@ const Header: FC<HeaderProps> = ({ hasSearchBar }) => {
<a className="flex items-center bg" href="/">
<img src="trackdrop.svg" className="h-8 mr-3" alt="TrackDrop Logo" />
<span className="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">TrackDrop</span>
<a href="https://twitter.com/rangonomics" target="_blank" rel="noopener noreferrer">
<a href="https://twitter.com/rangonomics" target="_blank" rel="noopener noreferrer" className="flex items-center ml-10 mr-3">
{/* Twitter icon with margin */}
<FaTwitter size={24} color="#5c86f0" style={{ marginLeft: '430px' }} />
<FaTwitter size={24} color="#5c86f0"/>
</a>
<a href="https://github.com/guilyx/TrackDrop" target="_blank" rel="noopener noreferrer" className="flex items-center ml-3 mr-3">
{/* Twitter icon with margin */}
<FaGithub size={24} color="#5c86f0"/>
</a>
</a>
{hasSearchBar && (
<div className="flex md:order-2">
<div className="relative md:block sm:w-9/12 md:w-96">
<div className="relative md:block sm:w-9/12 md:w-96 ml-10">
<div className="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none bg">
<svg
className="w-5 h-5 text-gray-500"
Expand Down
2 changes: 1 addition & 1 deletion src/components/VolumeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const VolumeCard: FC<VolumeCardProps> = ({ address, transactions }) => {

return (
<div className="p-4 mb-4 bg-white border border-gray-200 rounded-lg shadow-sm 2xl:col-span-2 dark:border-gray-700 sm:p-6 dark:bg-gray-800">
<div className="flex sm:flex-col items-center sm:space-x-0 xl:flex-row 2xl:flex-col xl:space-x-4 2xl:space-x-0">
<div className="sm:flex xl:block 2xl:flex sm:space-x-4 xl:space-x-0 2xl:space-x-4">
<div className="w-52 max-w-52 text-center flex items-center justify-center">
<h3 className="text-xl text-gray-900 dark:text-white font-bold">
Volume {showBridgeTransactions ? '(Bridge)' : '(Total)'}
Expand Down
9 changes: 9 additions & 0 deletions src/pages/AddressPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import BaseExplorerService from '../services/explorers/base.ts';
import ZkEvmExplorerService from '../services/explorers/zkevm.ts';
import ZkSyncExplorerService from '../services/explorers/zksync.ts'; // Import the appropriate services
import LineaExplorerService from '../services/explorers/linea.ts';
import ZoraExplorerService from '../services/explorers/zora.ts';
// import ZetaExplorerService from '../services/explorers/zetachain.ts';
// import NovaExplorerService from '../services/explorers/nova.ts';

const AddressPage = () => {
const address = window.location.search.split('=')[1];
Expand All @@ -37,15 +40,21 @@ const AddressPage = () => {
const mantleService = new MantleExplorerService();
const taikoService = new TaikoExplorerService();
const scrollService = new ScrollExplorerService();
const zoraService = new ZoraExplorerService();
// const novaService = new NovaExplorerService();
// const zetaService = new ZetaExplorerService();

const availableExplorers: Map<string, ExplorerService> = new Map();
availableExplorers.set('zkSync', zkSyncService);
availableExplorers.set('zkEvm', zkEvmService);
availableExplorers.set('Base', baseService);
availableExplorers.set('Linea', lineaService);
availableExplorers.set('Mantle', mantleService);
availableExplorers.set('Zora', zoraService);
// availableExplorers.set('Nova', novaService);
availableExplorers.set('Scroll(T)', scrollService);
availableExplorers.set('Taiko(T)', taikoService);
// availableExplorers.set('Zeta(T)', zetaService);

const tabsInfos: TabInfo[] = Array.from(availableExplorers).map(([key, explorer]) => ({
name: key,
Expand Down
Empty file.
10 changes: 10 additions & 0 deletions src/services/explorers/nova.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import StandardExplorerService from './standard_explorer.ts';
import { ETH_TOKEN } from '../../common/common.ts';

class NovaExplorerService extends StandardExplorerService {
constructor() {
super('nova-explorer.arbitrum.io', "nova", "./chains/nova.svg", 'https://nova-explorer.arbitrum.io/', ETH_TOKEN);
}
}

export default NovaExplorerService;
Empty file added src/services/explorers/opbnb.ts
Empty file.
22 changes: 20 additions & 2 deletions src/services/explorers/scroll.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
import StandardExplorerService from './standard_explorer.ts';
import { ETH_TOKEN } from '../../common/common.ts';

import { Transaction } from './explorer.ts';
class ScrollExplorerService extends StandardExplorerService {
constructor() {
super('sepolia-blockscout.scroll.io', 'scroll', "./chains/scroll.svg", 'https://sepolia-blockscout.scroll.io/', ETH_TOKEN);
super(
'sepolia-blockscout.scroll.io',
'scroll',
'./chains/scroll.svg',
'https://sepolia-blockscout.scroll.io/',
ETH_TOKEN,
);
}

needInternalTx(): boolean {
return true;
}

isFromBridge(tx: Transaction): boolean {
if (!tx.from) return false;
if (tx.from.toLowerCase() === '0x91e8addfe1358aca5314c644312d38237fc1101c'.toLowerCase()) {
return true;
}
return false;
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/services/explorers/standard_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ export interface StandardTransaction {

class StandardExplorerService extends ExplorerService {
uri: string;
address = '';

constructor(uri: string, name: string, logo: string, explorer_url: string, chain_token: Token) {
super(explorer_url, name, logo, chain_token);
this.uri = uri;
}

setAddress(address: string) {
this.address = address;
}

convertToCommonTokens(response: StandardToken[]): Token[] {
const commonTokens: Token[] = [];

Expand Down Expand Up @@ -220,6 +225,8 @@ class StandardExplorerService extends ExplorerService {
}

async getTransactionsList(address: string): Promise<Transaction[]> {
this.setAddress(address);

const limit = 100;
let page = 1;
const transactions: Transaction[] = [];
Expand Down Expand Up @@ -265,12 +272,17 @@ class StandardExplorerService extends ExplorerService {
);

if (response.status === 200) {
let i = 0;
const commonTransactions = this.convertToCommonTransactions(response.data.result);
for (const ctx of commonTransactions) {
if (ctx.fee === 'NaN') ctx.fee = '0';
if (response.data.result[i].transactionHash && ctx.hash == undefined) {
ctx.hash = response.data.result[i].transactionHash;
}
if (ctx.hash !== undefined || ctx.from !== undefined || ctx.to !== undefined) {
transactions.push(ctx);
}
i += 1;
}

if (response.data.result.length < limit) {
Expand Down
15 changes: 14 additions & 1 deletion src/services/explorers/taiko.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import StandardExplorerService from './standard_explorer.ts';
import { ETH_TOKEN } from '../../common/common.ts';
import { Transaction } from './explorer.ts';

class TaikoExplorerService extends StandardExplorerService {
constructor() {
super('explorer.test.taiko.xyz', "taiko", "./chains/taiko.svg", 'https://explorer.test.taiko.xyz', ETH_TOKEN);
super('blockscoutapi.jolnir.taiko.xyz', 'taiko', './chains/taiko.svg', 'https://blockscoutapi.jolnir.taiko.xyz/', ETH_TOKEN);
}

needInternalTx(): boolean {
return true;
}

isFromBridge(tx: Transaction): boolean {
if (!tx.from) return false;
if (tx.from.toLowerCase() === '0x1000777700000000000000000000000000000004'.toLowerCase()) {
return true;
}
return false;
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/services/explorers/zetachain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import StandardExplorerService from './standard_explorer.ts';
import { ETH_TOKEN } from '../../common/common.ts';

class ZetaExplorerService extends StandardExplorerService {
constructor() {
super('explorer.zetachain.com', "zora", "./chains/zora.svg", 'https://explorer.zetachain.com/', ETH_TOKEN);
}
}

export default ZetaExplorerService;
19 changes: 19 additions & 0 deletions src/services/explorers/zora.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import StandardExplorerService from './standard_explorer.ts';
import { ETH_TOKEN } from '../../common/common.ts';
import { Transaction } from './explorer.ts';

class ZoraExplorerService extends StandardExplorerService {
constructor() {
super('explorer.zora.energy', "zora", "./chains/zora.svg", 'https://explorer.zora.energy/', ETH_TOKEN);
}

isFromBridge(tx: Transaction): boolean {
if (!tx.from) return false;
if (tx.from.toLowerCase() === this.address.toLowerCase() && tx.to.toLowerCase() === this.address.toLowerCase()) {
return true;
}
return false;
}
}

export default ZoraExplorerService;

0 comments on commit 30f3da0

Please sign in to comment.