Skip to content

Commit b238f02

Browse files
committed
chore: cleanup folders
1 parent e78a1a6 commit b238f02

19 files changed

+54
-34
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ ETHERSCAN_API_KEY=
99
ETHERSCAN_API_KEY_OPTIMISM=
1010
ETHERSCAN_API_KEY_ARBITRUM=
1111
ETHERSCAN_API_KEY_POLYGON=
12+
1213
# Generate one here: https://generate-secret.vercel.app/32
1314
NEXTAUTH_SECRET=

components/layout/Header.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import React from 'react'
22

33
import classNames from 'classnames'
4+
import Image from 'next/image'
45

56
import { SITE_EMOJI, SITE_NAME } from '@/lib/constants'
67
import useScroll from '@/lib/hooks/useScroll'
78

89
import { LinkComponent } from '../app/LinkComponent'
910
import { ThemeSwitcher } from '../app/ThemeSwitcher'
11+
import { BranchColorMode } from '../branch/BranchColorMode'
1012
import BranchIsAuthenticated from '../branch/BranchIsAuthenticated'
1113
import BranchIsWalletConnected from '../branch/BranchIsWalletConnected'
1214
import ResponsiveMobileAndDesktop from '../responsive/ResponsiveMobileAndDesktop'
@@ -23,7 +25,7 @@ export function Header(props: Props) {
2325
props.className,
2426
'Header',
2527
'fixed top-0 w-full',
26-
' px-10 py-3 mb-8 flex items-center',
28+
'px-6 lg:px-10 py-3 mb-8 flex items-center',
2729
{
2830
'border-b border-gray-200 bg-white/50 backdrop-blur-xl dark:bg-black/50 dark:border-gray-800': scrolled,
2931
},
@@ -32,12 +34,18 @@ export function Header(props: Props) {
3234
return (
3335
<header className={classes}>
3436
<ResponsiveMobileAndDesktop>
35-
<LinkComponent href="/" className="flex flex-1 items-center">
36-
<span className="mr-1 text-3xl">{SITE_EMOJI}</span>
37+
<LinkComponent href="/" className="flex flex-1 items-center ">
38+
<BranchColorMode>
39+
<Image alt="Logo" src="/logo-dark.png" width={32} height={32} />
40+
<Image alt="Logo" src="/logo-white.png" width={32} height={32} />
41+
</BranchColorMode>
3742
</LinkComponent>
3843
<LinkComponent className="flex items-center" href="/">
39-
<span className="mr-1">{SITE_EMOJI}</span>
40-
<h1 className="text-gradient-sand text-2xl font-bold">{SITE_NAME}</h1>
44+
<BranchColorMode>
45+
<Image alt="Logo" src="/logo-dark.png" width={32} height={32} />
46+
<Image alt="Logo" src="/logo-white.png" width={32} height={32} />
47+
</BranchColorMode>
48+
<h1 className="text-gradient-sand ml-2 text-2xl font-bold">{SITE_NAME}</h1>
4149
</LinkComponent>
4250
</ResponsiveMobileAndDesktop>
4351
<div className="flex-1" />

components/table/TablePagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const TablePagination = ({
8080
onChange={(e) => {
8181
setPageSize(Number(e.target.value))
8282
}}>
83-
{[10, 20, 30, 40, 50].map((pageSizeParams) => (
83+
{[5, 10, 20, 30, 40, 50].map((pageSizeParams) => (
8484
<option className="text-xl" key={pageSizeParams} value={pageSizeParams}>
8585
Show {pageSizeParams}
8686
</option>
Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
import { AxiosInstance } from 'axios'
2-
import querystring from 'query-string'
1+
import getChainIdApiKey from '../services/etherscan/getChainIdApiKey'
2+
import getEtherscanClient from '../services/etherscan/getEtherscanClient'
3+
import handleErrorTypes from '../services/etherscan/handleErrorTypes'
4+
import handleEtherscanResponse from '../services/etherscan/handleEtherscanResponse'
5+
import isClientConnected from '../services/etherscan/isClientConnected'
6+
import isValidAddress from '../services/etherscan/isValidAddress'
37

4-
import isClientConnected from '../etherscan/isClientConnected'
5-
import isValidAddress from '../etherscan/isValidAddress'
6-
import queryEtherscanClient from '../etherscan/queryEtherscanClient'
7-
8-
export function etherscanAccountTransactionList(client: AxiosInstance, address: string, config: BlockPagination) {
8+
export async function etherscanAccountTransactionList(chainId: number | string, address: string, config: BlockPagination) {
9+
const client = getEtherscanClient(Number(chainId), 5000, getChainIdApiKey(chainId))
910
if (!isClientConnected(client)) {
1011
throw new Error('Etherscan Client Not Connected')
1112
}
1213
if (!isValidAddress(address)) throw new Error('Address Invalid')
1314

14-
const query = querystring.stringify({
15-
module: 'account',
16-
action: 'txlist',
17-
address,
18-
startblock: config.startblock || 0,
19-
endblock: config.endblock || 99999999,
20-
sort: config.sort || 'asc',
21-
page: config.page || 1,
22-
offset: config.offset || 0,
23-
})
24-
return queryEtherscanClient(client, query)
15+
try {
16+
const { data } = await client.get('/api?', {
17+
params: {
18+
module: 'account',
19+
action: 'txlist',
20+
address,
21+
startblock: config.startblock || 0,
22+
endblock: config.endblock || 99999999,
23+
sort: config.sort || 'asc',
24+
page: config.page || 1,
25+
offset: config.offset || 0,
26+
},
27+
})
28+
return handleEtherscanResponse(data)
29+
} catch (error) {
30+
return handleErrorTypes(error)
31+
}
2532
}

lib/hooks/useAccountTransactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { useQuery } from 'wagmi'
33
import { accountTransactions } from '../actions/accountTransactions'
44

55
export const useAccountTransactions = (params?: BlockPagination) => {
6-
return useQuery(['accountTransactions'], () => accountTransactions(params))
6+
return useQuery(['accountTransactions', params], () => accountTransactions(params))
77
}

lib/etherscan/constants.ts renamed to lib/services/etherscan/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface ChainIdToApi {
1212
export const ETHEREUM_MAINNET_API_URL = 'https://api.etherscan.io'
1313
export const ETHEREUM_ROPSTEN_API_URL = 'https://api-ropsten.etherscan.io'
1414
export const ETHEREUM_RINKEBY_API_URL = 'https://api-rinkeby.etherscan.io'
15-
export const ETHEREUM_GOERLI_API_URL = 'https://api-rinkeby.etherscan.io'
15+
export const ETHEREUM_GOERLI_API_URL = 'https://api-goerli.etherscan.io'
1616
export const ETHEREUM_KOVAN_API_URL = 'https://api-kovan.etherscan.io'
1717
export const ETHEREUM_SEPOLIA_API_URL = 'https://api-sepolia.etherscan.io'
1818
export const ETHEREUM_NETWORK_NAME_API_URL_MAP = {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)