Skip to content

Commit c001091

Browse files
committed
Merge branch 'main' of github.com:DefiLlama/chainlist into DefiLlama-main
2 parents 8a0e0c7 + 7d929eb commit c001091

143 files changed

Lines changed: 4386 additions & 428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check Duplicate Keys
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'constants/extraRpcs.js'
7+
- 'constants/chainIds.js'
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- 'constants/extraRpcs.js'
13+
- 'constants/chainIds.js'
14+
15+
jobs:
16+
check-duplicates:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '18'
25+
26+
- name: Check for duplicate keys
27+
run: node tests/check-duplicate-keys.js

components/CopyUrl/index.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { Popover, PopoverDisclosure, usePopoverStore } from "@ariakit/react/popover";
2+
import { useEffect, useState } from "react";
3+
import * as Fathom from "fathom-client";
4+
import { FATHOM_DROPDOWN_EVENTS_ID } from "../../hooks/useAnalytics";
5+
6+
export default function CopyUrl({ url }) {
7+
const [open, setOpen] = useState(false);
8+
9+
useEffect(() => {
10+
if (open) {
11+
setTimeout(() => {
12+
setOpen(false);
13+
}, 500);
14+
}
15+
}, [open]);
16+
17+
const popover = usePopoverStore({ placement: "bottom", open });
18+
19+
return (
20+
<>
21+
<PopoverDisclosure
22+
store={popover}
23+
render={
24+
<button
25+
className="max-w-[40ch] px-2 py-[2px] -my-[2px] text-center text-sm overflow-hidden whitespace-nowrap text-ellipsis dark:hover:bg-[#222222] dark:hover:text-white hover:bg-[#EAEAEA] rounded-[50px]"
26+
onClick={() => {
27+
navigator.clipboard.writeText(url).then(
28+
() => {
29+
setOpen(true);
30+
if (url.includes("eth.llamarpc")) {
31+
Fathom.trackGoal(FATHOM_DROPDOWN_EVENTS_ID[1], 0);
32+
}
33+
},
34+
() => {
35+
console.error(`Failed to copy ${url}`);
36+
},
37+
);
38+
}}
39+
>
40+
{url}
41+
</button>
42+
}
43+
/>
44+
{popover.show ? (
45+
<Popover
46+
store={popover}
47+
className="max-w-md p-1 text-sm border border-gray-500 rounded bg-neutral-50 text-black drop-shadow"
48+
>
49+
<p>Copied!</p>
50+
</Popover>
51+
) : null}
52+
</>
53+
);
54+
}

components/ExplorerList/index.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { notTranslation as useTranslations } from "../../utils";
2+
import CopyUrl from "../CopyUrl";
3+
import { explorerBlacklist } from "../../constants/explorerBlacklist";
4+
5+
export default function ExplorerList({ chain, lang }) {
6+
const t = useTranslations("Common", lang);
7+
const explorerLinks = chain.explorers?.filter((explorer) => !explorerBlacklist.includes(explorer?.url));
8+
9+
return explorerLinks && explorerLinks.length > 0 ? (
10+
<div className="shadow dark:bg-[#0D0D0D] bg-white p-8 rounded-[10px] flex flex-col gap-3 col-span-full relative overflow-x-auto">
11+
<table className="m-0 border-collapse whitespace-nowrap dark:text-[#B3B3B3] text-black">
12+
<caption className="relative w-full px-3 py-1 text-base font-medium border border-b-0">
13+
<span className="mr-4">{`${chain.name} ${t("explorer-url-list")}`}</span>
14+
</caption>
15+
<thead>
16+
<tr>
17+
<th className="px-3 py-1 font-medium border">{t("explorer-name")}</th>
18+
<th className="px-3 py-1 font-medium border">{t("explorer-url")}</th>
19+
</tr>
20+
</thead>
21+
22+
<tbody>
23+
{explorerLinks?.map((explorer, index) => {
24+
let className = "bg-inherit";
25+
return (
26+
<ExplorerRow
27+
isLoading={chain.isLoading}
28+
explorer={explorer}
29+
key={"explorer" + index}
30+
className={className}
31+
/>
32+
);
33+
})}
34+
</tbody>
35+
</table>
36+
</div>
37+
) : null;
38+
}
39+
40+
const Shimmer = () => {
41+
return <div className="rounded h-5 w-full min-w-[40px] animate-pulse dark:bg-[#171717] bg-[#EAEAEA]"></div>;
42+
};
43+
44+
const ExplorerRow = ({ isLoading, explorer, className }) => {
45+
return (
46+
<tr className={className}>
47+
<td className="px-3 py-1 text-sm border text-center">{isLoading ? <Shimmer /> : explorer?.name}</td>
48+
<td className="border px-3 py-1 max-w-[40ch] text-center">
49+
{isLoading ? <Shimmer /> : explorer?.url ? <CopyUrl url={explorer.url} /> : null}
50+
</td>
51+
</tr>
52+
);
53+
};

components/Layout/index.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from "react";
22
import { useEffect } from "react";
3+
import Link from "next/link";
34
import Header from "../header";
45
// import { useTranslations } from "next-intl";
56
import { notTranslation as useTranslations } from "../../utils";
@@ -35,7 +36,9 @@ export default function Layout({ children, lang, chainName, setChainName }) {
3536
<div className="dark:text-[#B3B3B3] text-black dark:bg-[#0D0D0D] bg-white relative h-full">
3637
<div className="p-5 sticky top-0 bottom-0 m-auto flex flex-col items-center gap-8 justify-center h-screen max-w-[480px] mx-auto">
3738
<figure className="lg:mr-auto">
38-
<Logo />
39+
<Link href="/" prefetch={false}>
40+
<Logo />
41+
</Link>
3942
<figcaption className="font-bold text-2xl">{t("help-info")}</figcaption>
4043
</figure>
4144

@@ -128,8 +131,18 @@ export default function Layout({ children, lang, chainName, setChainName }) {
128131
target="_blank"
129132
rel="noopener noreferrer"
130133
>
131-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" className="w-6 h-6" fill="none" stroke="#2F80ED" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
132-
<polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline>
134+
<svg
135+
xmlns="http://www.w3.org/2000/svg"
136+
viewBox="0 0 24 24"
137+
className="w-6 h-6"
138+
fill="none"
139+
stroke="#2F80ED"
140+
strokeWidth="2"
141+
strokeLinecap="round"
142+
strokeLinejoin="round"
143+
>
144+
<polyline points="16 18 22 12 16 6"></polyline>
145+
<polyline points="8 6 2 12 8 18"></polyline>
133146
</svg>
134147
<span className="text-base font-medium">API</span>
135148
</a>

components/RPCList/index.js

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { useEffect, useMemo, useState } from "react";
2-
import * as Fathom from "fathom-client";
32
import { notTranslation as useTranslations } from "../../utils";
3+
import CopyUrl from "../CopyUrl";
44
import useRPCData from "../../hooks/useRPCData";
55
import useAddToNetwork from "../../hooks/useAddToNetwork";
66
import { useLlamaNodesRpcData } from "../../hooks/useLlamaNodesRpcData";
7-
import { FATHOM_DROPDOWN_EVENTS_ID } from "../../hooks/useAnalytics";
87
import { useRpcStore } from "../../stores";
98
import { renderProviderText } from "../../utils";
109
import { Tooltip } from "../../components/Tooltip";
1110
import useAccount from "../../hooks/useAccount";
12-
import { Popover, PopoverDisclosure, usePopoverStore } from "@ariakit/react/popover";
1311

1412
export default function RPCList({ chain, lang }) {
1513
const [sortChains, setSorting] = useState(true);
@@ -276,53 +274,3 @@ const LightGreenIcon = () => (
276274
/>
277275
</svg>
278276
);
279-
280-
const CopyUrl = ({ url }) => {
281-
const [open, setOpen] = useState(false);
282-
283-
useEffect(() => {
284-
if (open) {
285-
setTimeout(() => {
286-
setOpen(false);
287-
}, 500);
288-
}
289-
}, [open]);
290-
291-
const popover = usePopoverStore({ placement: "bottom", open });
292-
293-
return (
294-
<>
295-
<PopoverDisclosure
296-
store={popover}
297-
render={
298-
<button
299-
className="max-w-[40ch] px-2 py-[2px] -my-[2px] text-center text-sm overflow-hidden whitespace-nowrap text-ellipsis dark:hover:bg-[#222222] dark:hover:text-white hover:bg-[#EAEAEA] rounded-[50px]"
300-
onClick={() => {
301-
navigator.clipboard.writeText(url).then(
302-
() => {
303-
setOpen(true);
304-
if (url.includes("eth.llamarpc")) {
305-
Fathom.trackGoal(FATHOM_DROPDOWN_EVENTS_ID[1], 0);
306-
}
307-
},
308-
() => {
309-
console.error(`Failed to copy ${url}`);
310-
},
311-
);
312-
}}
313-
>
314-
{url}
315-
</button>
316-
}
317-
/>
318-
{popover.show ? (
319-
<Popover
320-
store={popover}
321-
className="max-w-md p-1 text-sm border border-gray-500 rounded bg-neutral-50 text-black drop-shadow"
322-
>
323-
<p>Copied!</p>
324-
</Popover>
325-
) : null}
326-
</>
327-
);
328-
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const data = {
2+
"name": "XO Chain Testnet",
3+
"chain": "XO",
4+
"rpc": [
5+
"https://testnet-rpc-1.xo.market"
6+
],
7+
"faucets": [],
8+
"nativeCurrency": {
9+
"name": "XO Token",
10+
"symbol": "XO",
11+
"decimals": 18
12+
},
13+
"infoURL": "https://xo.market",
14+
"shortName": "xo",
15+
"chainId": 1000101,
16+
"networkId": 1000101,
17+
"icon": "xo",
18+
"explorers": [
19+
{
20+
"name": "xo explorer",
21+
"url": "https://explorer-testnet.xo.market",
22+
"icon": "xo",
23+
"standard": "EIP3091"
24+
}
25+
]
26+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export const data = {
2+
"name": "Wirex Pay Testnet",
3+
"chain": "WirexPay",
4+
"icon": "wpay",
5+
"rpc": ["https://rpc-dev.wirexpaychain.com"],
6+
"faucets": ["https://faucet-dev.wirexpaychain.com"],
7+
"nativeCurrency": {
8+
"name": "Ether",
9+
"symbol": "ETH",
10+
"decimals": 18
11+
},
12+
"features": [
13+
{
14+
"name": "EIP155"
15+
}
16+
],
17+
"infoURL": "https://docs.wirexpaychain.com/tech/wirex-pay-chain",
18+
"shortName": "wirex-testnet",
19+
"chainId": 1001996,
20+
"networkId": 1001996,
21+
"explorers": [
22+
{
23+
"name": "Wirex Pay Testnet Explorer",
24+
"url": "https://explorer-dev.wirexpaychain.com",
25+
"standard": "none"
26+
}
27+
]
28+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export const data = {
2+
name: "Gate Layer",
3+
chain: "GT",
4+
rpc: ["https://gatelayer-mainnet.gatenode.cc"],
5+
nativeCurrency: {
6+
name: "GT",
7+
symbol: "GT",
8+
decimals: 18,
9+
},
10+
features: [{ name: "EIP1559" }, { name: "EIP1559" }],
11+
infoURL: "https://gatechain.io/gatelayer",
12+
shortName: "GateLayer",
13+
chainId: 10088,
14+
networkId: 10088,
15+
icon: "https://www.woofswap.finance/image/tokens/gatelayer.png",
16+
explorers: [
17+
{
18+
name: "GateLayer",
19+
url: "https://www.gatescan.org/gatelayer",
20+
icon: "https://www.woofswap.finance/image/tokens/gatelayer.png",
21+
standard: "EIP-1559",
22+
},
23+
],
24+
"parent": {
25+
"type": "L2",
26+
"chain": "ethereum",
27+
"bridges": [
28+
{
29+
"url": "https://www.gate.com/"
30+
}
31+
]
32+
}
33+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export const data = {
2+
"name": "Awakening Testnet",
3+
"chain": "BDAG",
4+
"icon": "BDAG",
5+
"rpc": [
6+
"​https://rpc.awakening.bdagscan.com",
7+
"https://relay.awakening.bdagscan.com",
8+
],
9+
"features": [{ "name": "EIP155" }, { "name": "EIP1559" }],
10+
"faucets": [
11+
"https://awakening.bdagscan.com/faucet"
12+
],
13+
"nativeCurrency": {
14+
"name": "BlockDAG",
15+
"symbol": "BDAG",
16+
"decimals": 18,
17+
},
18+
"infoURL": "https://www.blockdag.network/",
19+
"shortName": "bdag",
20+
"chainId": 1043,
21+
"networkId": 1043,
22+
"explorers": [
23+
{
24+
"name": "BlockDAG Explorer",
25+
"url": "https://awakening.bdagscan.com/",
26+
},
27+
],
28+
"status": "active"
29+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export const data = {
2+
"name": "RealChain Mainnet",
3+
"chain": "RealChain",
4+
"icon": "realchain",
5+
"rpc": [
6+
"https://rpc.realchain.io",
7+
],
8+
"features": [{ "name": "EIP155" }, { "name": "EIP1559" }],
9+
"faucets": [],
10+
"nativeCurrency": {
11+
"name": "RealCoin",
12+
"symbol": "R",
13+
"decimals": 18,
14+
},
15+
"infoURL": "https://www.realchain.io/",
16+
"shortName": "realchain",
17+
"chainId": 1098,
18+
"networkId": 1098,
19+
"explorers": [
20+
{
21+
"name": "RealChain explorer",
22+
"url": "https://scan.realchain.io/",
23+
},
24+
],
25+
};

0 commit comments

Comments
 (0)