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

NODE REAL #30

Open
wants to merge 1,402 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1402 commits
Select commit Hold shift + click to select a range
a44b9b1
Update extraRpcs.js add RadiumBlock public eth endpoint (#1113)
radiumb May 30, 2024
30cf50b
Update extraRpcs.js (#1118)
0xx92 May 31, 2024
0b99ad8
add ankr taiko
realdealshaman Jun 2, 2024
771d7cc
Remove non-registered RPC for network 19 (#1128)
dineshpinto Jun 4, 2024
764e5c6
add rpcs
realdealshaman Jun 4, 2024
b08efc0
Update extraRpcs.js lava eth (#1127)
mustafaislek Jun 4, 2024
ced2892
add chains
realdealshaman Jun 4, 2024
3008336
Add PublicNode RPC for Blast (#1134)
3eph1r0th Jun 6, 2024
d0b5513
add Citrea Devnet (#1130)
eyusufatik Jun 6, 2024
503b9b9
Add MO chain (#1135)
mochainapp Jun 7, 2024
7dc6392
Update extraRpcs.js for LUKSO Mainnet (#1153)
mustafademiray Jun 12, 2024
a344d52
add default lukso rpc
realdealshaman Jun 12, 2024
f17396a
bahamut rpc endpoint added (#1152)
Himanityagi27 Jun 12, 2024
3fd56d2
Update extraRpcs.js (#1150)
JoGetBlock Jun 12, 2024
533af7d
Update extraRpcs.js (#1149)
Danielvul Jun 12, 2024
e9c8698
Update extraRpcs.js (#1142)
cosminbware Jun 12, 2024
996be79
add default iota evm rpc
realdealshaman Jun 12, 2024
8de72ca
Update extraRpcs.js (#1139)
Danielvul Jun 12, 2024
ff6f40e
Proposal to add GLC rpc's (#1131)
Srikarrao1 Jun 12, 2024
56a8ee5
remove referer urls
0xngmi Jun 12, 2024
8303356
remove spam rpcs
realdealshaman Jun 12, 2024
e7dbff9
use a working rpc for default
realdealshaman Jun 12, 2024
4181a90
Add nal testnet (#1147)
luleigreat Jun 12, 2024
ff19524
new pages to add network to metamask
mintdart Jun 12, 2024
e2d8bba
add lavabuild as default evmos rpc
realdealshaman Jun 12, 2024
7b91245
Update extraRpcs.js - Adding Blast API in IOTA testnet (#1156)
cosminbware Jun 13, 2024
dae031e
update sitemap
mintdart Jun 13, 2024
408b17f
Update extraRpcs.js (#1141)
4everlandorg Jun 13, 2024
65db39f
fix new entries
realdealshaman Jun 13, 2024
127fab8
Update extraRpcs.js (#1158)
4everlandorg Jun 15, 2024
c9fc690
fix syntax
realdealshaman Jun 15, 2024
d0d7522
add sanko
realdealshaman Jun 17, 2024
99efbd2
Update extraRpcs.js (#1168)
DRIgnazGortngschirl Jun 24, 2024
c733a24
update tracking details
realdealshaman Jun 24, 2024
0826b94
Update extraRpcs.js (#1165)
s4njk4n Jun 24, 2024
62874c3
feat: 🎸 Added bArtio testnet RPC (#1164)
codingwithmanny Jun 24, 2024
632a52f
Add RadiumBlock public wss endpoints for Ethereum, Astar/Shiden and M…
radiumb Jun 24, 2024
ef52e09
Added the etherlink mainnet endpoint and removed the etherlink ghosht…
AmardeepSambaru Jun 24, 2024
f9dda03
Update extraRpcs.js (#1161)
4everlandorg Jun 24, 2024
740fb9c
rpc endpoint added (#1159)
Himanityagi27 Jun 24, 2024
da19564
fix syntax
realdealshaman Jun 24, 2024
2f76296
Add Etherlink Network (#1174)
tachyswap Jun 27, 2024
84afec0
Update faucet link for RoninChain (#1172)
huyngopt1994 Jun 27, 2024
4cf4597
Update extraRpcs.js (#1166)
nucash-mining Jun 27, 2024
f25c86e
format
realdealshaman Jun 27, 2024
da9ab65
Update extraRpcs.js (#1178)
AM-979 Jun 28, 2024
2ae63ea
add enuls
realdealshaman Jul 2, 2024
cee8180
Kaia testnet kairos RPC update (#1189)
eseongmoo Jul 8, 2024
6b09ebf
Updated Testnet endpoint and allthatnode urls (#1182)
praveen-kaia Jul 8, 2024
c9423e7
Update extraRpcs.js (#1181)
maradeeym Jul 8, 2024
c50984b
Add PLYR PHI mainnet (#1180)
iamcryptofennec Jul 8, 2024
3512631
fix syntax
realdealshaman Jul 8, 2024
18e06ce
ZetaChain: update RPCs (#1190)
fadeev Jul 9, 2024
3beea93
added Onchain Points Mainnet (#1193)
SwaroopH Jul 11, 2024
1c83c95
remove chain not yet listed on defillama
realdealshaman Jul 11, 2024
04f4292
add privacy policy statement
realdealshaman Jul 11, 2024
53011bb
Add nal mainnet (#1192)
luleigreat Jul 11, 2024
fa8c3e3
add privacy statement
realdealshaman Jul 11, 2024
b3b4055
Add PORTERS Taiko Mainnet public rpc endpoint (#1194)
scermat Jul 15, 2024
a7e34c3
Update Ronin (2020) RPCs (#1204)
dwi Jul 17, 2024
baa8c0d
Update extraRpcs.js (#1201)
ecroxchain Jul 17, 2024
b17e355
🎸 Added Dojima Mainnet and Testnet RPC (#1199)
Mystical94 Jul 17, 2024
0956872
Remove Project Pi PulseChain RPC (#1206)
VandaleCallender Jul 19, 2024
d9994a4
adds Mande rpc (#1157)
prtk418 Jul 19, 2024
573fdb7
add blast logo
realdealshaman Jul 22, 2024
b0022c4
add saakuru
realdealshaman Jul 22, 2024
fd694ed
Tatum RPC Node Changes (#1208)
blockchaingirl1407 Jul 25, 2024
8dcc3f0
Update extraRpcs.js (#1209)
maradeeym Jul 26, 2024
183a067
Just removing our RPCs before we deactivate the servers. Thanks (#1212)
s4njk4n Jul 29, 2024
e0718ba
Update extraRpcs.js (#1210)
maradeeym Jul 29, 2024
a741c9c
add more rpcs
realdealshaman Jul 29, 2024
3853be4
add more chains
realdealshaman Jul 29, 2024
5cf24bd
remove duplicates
realdealshaman Jul 30, 2024
1f5011c
update rpc for jibchain (#1214)
nanthanwa Jul 31, 2024
d282c42
Update extraRpcs.js (#1213)
0xGraffiti Jul 31, 2024
12e74b8
added Zircuit RPC endpoints (#1216)
kbak Jul 31, 2024
2aafed2
update rpc order
realdealshaman Jul 31, 2024
d319d51
Add SX L2 Rollup Mainnet & Toronto RPC (#1217)
akshar Aug 2, 2024
aae3a8e
fix new entry
realdealshaman Aug 2, 2024
3b60c9a
Update extraRpcs.js (#1219)
alxnode Aug 4, 2024
e306337
add network
realdealshaman Aug 6, 2024
c30fcf2
add chain
realdealshaman Aug 6, 2024
5b3a2a1
update chain name
realdealshaman Aug 6, 2024
8f0a8ce
add more chains
realdealshaman Aug 6, 2024
95017b5
update chain name
realdealshaman Aug 6, 2024
e8599b9
fix chain names
realdealshaman Aug 6, 2024
4aba0d7
fix zksync era
realdealshaman Aug 6, 2024
d08d2c3
fix immutable zkevm
realdealshaman Aug 6, 2024
74ef8a8
fix more chain names
realdealshaman Aug 6, 2024
5ab0b1c
fix bitlayer
realdealshaman Aug 6, 2024
af21ecb
add milkomeda c1
realdealshaman Aug 6, 2024
641e0fb
lower case
realdealshaman Aug 6, 2024
0599e6e
add cronos zkevm
realdealshaman Aug 6, 2024
c8d5bc8
add chain
realdealshaman Aug 6, 2024
dfa2e09
add chain
realdealshaman Aug 7, 2024
0782929
update chain
realdealshaman Aug 7, 2024
debbfd7
update slug
realdealshaman Aug 7, 2024
57828c5
add reya
realdealshaman Aug 7, 2024
c0b9dad
fix entry
realdealshaman Aug 7, 2024
640f0e3
fix incorrect chain pages
mintdart Aug 8, 2024
403fedc
update entry
realdealshaman Aug 8, 2024
d5672c2
update entry
realdealshaman Aug 9, 2024
36b77df
fix dupe
realdealshaman Aug 9, 2024
83b8cc3
update kaia icon
realdealshaman Aug 13, 2024
c795092
Vcity rpc added (#1226)
rahulmaske77 Aug 14, 2024
341b3c3
update icon path
realdealshaman Aug 15, 2024
baa7afe
update
realdealshaman Aug 15, 2024
7cad858
format
realdealshaman Aug 16, 2024
456b8f5
add default rpc
realdealshaman Aug 16, 2024
546de59
update rootstock
realdealshaman Aug 16, 2024
f25750f
smol retry
realdealshaman Aug 16, 2024
4f40166
update name
realdealshaman Aug 20, 2024
be1ff32
fix logo
realdealshaman Aug 21, 2024
dc1654e
Add Bifrost Polkadot Mainnet (#1229)
ark930 Aug 21, 2024
442a1ef
Add New Chain - Chang Coin Foundation (5858) (#1228)
earthchie Aug 21, 2024
76641e2
Removed the Pollum rpcs with pollum.services dns (#1233)
jonathanlmd Aug 23, 2024
8e48042
Add HashKey Chain Testnet RPC (#1235)
lyszhang Aug 27, 2024
9e435e6
Update extraRpcs.js (#1239)
maradeeym Aug 28, 2024
164f003
add in default rpcs
realdealshaman Aug 28, 2024
5783e68
Add Soneium Minato Testnet (#1241)
parseb Aug 28, 2024
6f6cdd3
fix new entries
realdealshaman Aug 28, 2024
ace63b0
Update extraRpcs.js (#1245)
maradeeym Aug 30, 2024
c4ab7c9
add default rpc
realdealshaman Aug 30, 2024
4095fda
Update extraRpcs.js (#1244)
maradeeym Aug 30, 2024
57dfcd5
add default
realdealshaman Aug 30, 2024
19f4118
Update extraRpcs.js (#1243)
0xx92 Aug 30, 2024
3e98d60
Fix missing semicolon in extraRpcs.js (#1246)
valamidev Sep 2, 2024
f6f67f8
Update extraRpcs.js (#1252)
simone1999 Sep 7, 2024
7e66d4c
Update extraRpcs.js - Add RPC EVM testnet for Story Protocol (#1251)
ValidatorVN Sep 7, 2024
6702afb
Update extraRpcs.js (#1250)
mrspir Sep 7, 2024
b962ee7
Update extraRpcs.js (#1248)
Danielvul Sep 7, 2024
09ee680
PORTERs endpoints updates (hekla and TOS) (#1256)
scermat Sep 10, 2024
88ca1fc
Update chainIds.json (#1253)
Pumpxy Sep 10, 2024
304936d
Update extraRpcs.js - Add RPC EVM testnet for Story Protocol (Mandrag…
McDaan Sep 11, 2024
53fcbe7
fix: chainIds add scroll (#1258)
lenoteddy Sep 11, 2024
43ac5fb
Update extraRpcs.js (#1257)
Coha05 Sep 11, 2024
c3fb0ef
fix syntax
realdealshaman Sep 11, 2024
966506d
Add dymension to chainIds.json (#1263)
lenoteddy Sep 13, 2024
74d0908
Update extraRpcs.js (#1267)
Josephtran102 Sep 13, 2024
264c054
added BlockHub (#1268)
botxx15 Sep 13, 2024
2b77738
Update extraRpcs.js (#1266)
cougarmaster Sep 13, 2024
e5fccda
add gravity
realdealshaman Sep 13, 2024
16456bf
add etn
realdealshaman Sep 13, 2024
3d77095
added French internationalization key (#1271)
StarryHazex Sep 16, 2024
67b2071
improve Chinese translation (#1270)
BlueMistee Sep 16, 2024
a669d5e
Remove Invalid Blast Chain (#1269)
lenoteddy Sep 16, 2024
1d607f9
Add: itrocket story RPC (#1276)
itrocket-team Sep 17, 2024
e453638
Update extraRpcs.js (#1278)
hubofvalley Sep 18, 2024
baf1c07
add aldebaranode story testnet rpc (#1277)
mrheed Sep 18, 2024
42b3463
Add THAT Mainnet (#1280)
baileynahi Sep 20, 2024
b093683
Remove ws endpoint (#1281)
RogerLamTd Sep 20, 2024
163e7c8
Add Tenderly Node RPCs (#1283)
dzimiks Sep 20, 2024
d74ed86
Update extraRpcs.js (#1282)
mrspir Sep 21, 2024
20e0606
add default rpc
realdealshaman Sep 21, 2024
6b4b688
correct my story rpc ednpoint (#1284)
hubofvalley Sep 21, 2024
fd6f1d8
add Grand Valley 0G evm-rpc (#1286)
hubofvalley Sep 22, 2024
00de042
this rpc returns incorrect timestamps for eg block height 6745450
waynebruce0x Sep 23, 2024
0c77d48
Merge pull request #1288 from DefiLlama/faultyrpc
0xngmi Sep 23, 2024
abca630
add Citrea testnet RPC (#1287)
eyusufatik Sep 23, 2024
379985d
Update extraRpcs.js (#1291)
JoGetBlock Sep 25, 2024
1c92a5d
Update extraRpcs.js (#1290)
Josephtran102 Sep 25, 2024
2c74c49
Introduce callStatic mainnet RPCs (#1294)
Callstatic-Admin Sep 25, 2024
31eb7f6
incorrect block heights
waynebruce0x Sep 27, 2024
dd6454d
more bad rpcs
waynebruce0x Sep 27, 2024
1fcd082
another faulty block height
waynebruce0x Sep 27, 2024
3895c51
check rpc list order
realdealshaman Sep 27, 2024
6b8c295
remove katla
realdealshaman Sep 30, 2024
299412c
Add Lisk Chain ID (#1299)
stellardynamic Sep 30, 2024
300d0f9
Update extraRpcs.js (#1297)
Josephtran102 Sep 30, 2024
ce019b6
add Coha05 rpc (#1295)
Coha05 Sep 30, 2024
d7b8aec
add superposition chain
realdealshaman Sep 30, 2024
638ce47
add iotaevm
realdealshaman Sep 30, 2024
e7bda52
update iota testnet rpcs
realdealshaman Sep 30, 2024
e793602
fix syntax
realdealshaman Sep 30, 2024
eeb76ac
Update callStatic privacy statement (#1304)
Callstatic-Admin Oct 1, 2024
2b89789
add network
realdealshaman Oct 1, 2024
8498b0a
Add Roostock BlastAPI endpoint (#1302)
DefiDebauchery Oct 1, 2024
292f106
fix syntax from new entry
realdealshaman Oct 1, 2024
ad09aea
add chain
realdealshaman Oct 4, 2024
08bc982
add matchain (#1306)
alekswoje Oct 4, 2024
e483c4e
Update extraRpcs.js (#1305)
JoGetBlock Oct 4, 2024
3057ed2
add chain
realdealshaman Oct 5, 2024
6b66f70
Bc Hyper chain rpc added and it's privacy policy declaration (#1307)
akashhalder3 Oct 8, 2024
94fdb03
add Glide Protocol (#1308)
icaksh Oct 8, 2024
1bdf65c
Updated Kaia RPC endpoints (#1311)
praveen-kaia Oct 8, 2024
a7d3dd3
feat: added stakely json-rpc for taiko and fantom (#1312)
trikunai Oct 8, 2024
c2cc3eb
update rsk entry
realdealshaman Oct 9, 2024
73ad8f4
Updated Kaia chain extraRpcs (#1324)
praveen-kaia Oct 14, 2024
b429da4
Update extraRpcs.js (#1323)
Orlanduis Oct 14, 2024
b1ae1c8
add buildbear privacystatement
realdealshaman Oct 14, 2024
d16ad1b
Update extraRpcs.js (#1322)
Orlanduis Oct 14, 2024
257764c
fix the buildbear entry
realdealshaman Oct 14, 2024
6570328
Add CheeseChain RPCs (#1321)
bivsk Oct 14, 2024
238aa31
add default rpc
realdealshaman Oct 14, 2024
69d4538
Added dRPC new endpoints (#1320)
maradeeym Oct 14, 2024
6cb7e3b
update zan rpc url (#1317)
dongjl123 Oct 14, 2024
33ea1f5
Delete OnFinality RPC endpoint for Harmony (#1326)
FiveKG Oct 15, 2024
dd7320e
Update extraRpcs.js (#1328)
BlockRazorinc Oct 16, 2024
79ec28f
fix syntax
realdealshaman Oct 18, 2024
5f3f30a
fix url
realdealshaman Oct 18, 2024
d791137
add aiachain and RPCs (#1330)
moumc Oct 20, 2024
3dc4473
update 48Club rpc url (#1331)
du5 Oct 20, 2024
3f2c212
Fix typo - missed comma before BlockRazor block (#1332)
a10zn8 Oct 20, 2024
23ab5c7
Update extraRpcs.js (#1333)
0xx92 Oct 20, 2024
a90f3c0
Add apechain details (#1335)
409H Oct 22, 2024
66926c3
update name to match icon
realdealshaman Oct 22, 2024
3291ea6
Update extraRpcs.js (#1336)
s3unghyeon Oct 22, 2024
90d5bdf
Added Zeniq Smart Chain (#1337)
nomo-app Oct 22, 2024
0cb2cae
add apechain
realdealshaman Oct 22, 2024
a3efd48
add wc
realdealshaman Oct 23, 2024
d690f7e
add apechain
realdealshaman Oct 23, 2024
8b0b9c6
remove duplicate entry
realdealshaman Oct 23, 2024
b8c8088
Add DreyerX chain (#1338)
billalxcode Oct 23, 2024
99e56b2
build
realdealshaman Oct 23, 2024
45a2fa4
fix chiado list
realdealshaman Oct 23, 2024
5aab159
Add latest Omnia RPCs. (#1340)
dumitrucatalin Oct 28, 2024
7d1942f
Update extraRpcs.js (#1342)
maradeeym Oct 28, 2024
7995560
fix rpc for matchain (#1343)
alekswoje Oct 28, 2024
dc54a4c
add Grand Valley Story Protocol Odyssey testnet rpc (#1344)
hubofvalley Oct 30, 2024
065f260
add spidernode rpc to story odyssey
realdealshaman Oct 30, 2024
ed0cc13
add mandragora story odyssey rpc
realdealshaman Oct 30, 2024
84bcdc3
add story odyssey rpc
realdealshaman Oct 30, 2024
725b6ae
Fix ApeChain
MYKatz Oct 30, 2024
2830121
Merge pull request #1349 from ConstellationCrypto/fix-apechain
0xngmi Oct 30, 2024
5908833
Update extraRpcs.js (#1350)
ValidatorVN Oct 31, 2024
4875441
Add: ITRocket Story RPC (#1352)
itrocket-team Oct 31, 2024
6998226
update aldebaranode rpc
realdealshaman Oct 31, 2024
3fd5bd2
Update extraRpcs.js (#1355)
0xx92 Oct 31, 2024
6f561cc
Update extraRpcs.js (#1356)
botxx15 Oct 31, 2024
4abcb0c
Add Morph mainnet (#1357)
zem007 Oct 31, 2024
a6f5d37
Update extraRpcs.js - adding Sophon networks (#1359)
githubdoramon Oct 31, 2024
2e37363
Add ink sepolia (#1365)
CruzMolina Nov 2, 2024
226673e
added BlockHub's Story Protocol RPC (#1360)
botxx15 Nov 2, 2024
0bbfe01
Update Oasis chains (#1361)
aefhm Nov 2, 2024
80ccff3
Updated extraRpcs.js (#1364)
karloinv Nov 2, 2024
93ad78a
fix oasis after updating routes
realdealshaman Nov 2, 2024
5f25332
chain icon
realdealshaman Nov 2, 2024
04d8159
add sapphire icon
realdealshaman Nov 3, 2024
3337181
revert change
realdealshaman Nov 3, 2024
0c552da
add icon
realdealshaman Nov 4, 2024
f4de303
fix chain
realdealshaman Nov 4, 2024
4d8835f
feat: click and copy rpc (+ minor bug fix) (#1375)
melvinmcrn Nov 5, 2024
230e1e8
Update extraRpcs.js (#1374)
maradeeym Nov 5, 2024
8dead81
include default rpc
realdealshaman Nov 5, 2024
15ac8f0
Update extraRpcs.js (#1376)
karloinv Nov 5, 2024
0668669
Update extraRpcs.js (#1377)
karloinv Nov 5, 2024
6eab43a
Update extraRpcs.js (#1378)
karloinv Nov 6, 2024
66cd1f8
Update extraRpcs.js (#1380)
111STAVR111 Nov 6, 2024
3551a92
update privacy policy for bctech
realdealshaman Nov 6, 2024
f64237c
Adding Story RPC from Rawaki (#1383)
rawakinode Nov 8, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ yarn-error.log*
.env.development.local
.env.test.local
.env.production.local
.env

# vercel
.vercel
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sitemap.xml.js
.next
out
public
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "all",
"printWidth": 120,
"tabWidth": 2
}
149 changes: 74 additions & 75 deletions LICENCE.md

Large diffs are not rendered by default.

21 changes: 2 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:
Expand All @@ -14,21 +12,6 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
## Adding your RPC

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
If you wish to add your RPC, please follow the [PR template](https://github.com/DefiLlama/chainlist/blob/main/pull_request_template.md)
125 changes: 125 additions & 0 deletions components/AdBanner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import * as Fathom from "fathom-client";
import { useEffect, useMemo, useState } from "react";

import { FATHOM_ADS_ID } from "../../hooks/useAnalytics";
import { notTranslation as useTranslations, shuffleArray } from "../../utils";

const BANNERS = [
{
image: "llamanodes.png",
name: "LlamaNodes",
url: "https://llamanodes.com",
},
{
image: "gmx.png",
name: "GMX",
url: "https://app.gmx.io/#/trade/?ref=chainlist",
},
];

export const AdBanner = ({ timer = 15000, startTransition = true, showControls = false }) => {
const t = useTranslations("Common");

const [currentIndex, setCurrentIndex] = useState(0);

const randomBanners = useMemo(() => shuffleArray(BANNERS), []);

useEffect(() => {
const intervalId = setInterval(() => {
if (startTransition) {
return handleNextBanner();
}

return;
}, timer);

return () => clearInterval(intervalId);
}, [currentIndex]);

const handlePrevBanner = () => {
const isFirstBanner = currentIndex === 0;
const newIndex = isFirstBanner ? randomBanners.length - 1 : currentIndex - 1;

setCurrentIndex(newIndex);
};

const handleNextBanner = () => {
const isLastBanner = currentIndex === randomBanners.length - 1;
const newIndex = isLastBanner ? 0 : currentIndex + 1;

setCurrentIndex(newIndex);
};

const srcLarge = `./banners/large/${randomBanners[currentIndex].image}`;
const srcSmall = `./banners/small/${randomBanners[currentIndex].image}`;
const srcName = randomBanners[currentIndex].name;

return (
<div className="flex flex-col w-full h-full justify-center gap-2">
<div className="w-full h-full relative group rounded-[10px]">
<a
href={randomBanners[currentIndex].url}
rel="noopener noreferrer"
target="_blank"
onClick={() => Fathom.trackGoal(FATHOM_ADS_ID[randomBanners[currentIndex].name.toLowerCase()], 0)}
>
<picture className="rounded-[10px] duration-500 w-full h-full">
<source
srcset={srcSmall}
media="(max-width: 420px)"
className="rounded-[10px] duration-500 w-full h-full"
/>
<source
srcset={srcLarge}
media="(max-width: 639px)"
className="rounded-[10px] duration-500 w-full h-full"
/>
<source
srcset={srcSmall}
media="(max-width: 1399px)"
className="rounded-[10px] duration-500 w-full h-full"
/>
<source
srcset={srcLarge}
media="(max-width: 1679px)"
className="rounded-[10px] duration-500 w-full h-full"
/>
<source
srcset={srcSmall}
media="(max-width: 2000px)"
className="rounded-[10px] duration-500 w-full h-full"
/>

<img src={srcLarge} alt={srcName} className="rounded-[10px] duration-500 w-full h-full" />
</picture>
</a>

{/* left arrow */}
{showControls && (
<div
className="hidden group-hover:block absolute top-[50%] -translate-x-0 translate-y-[-50%] left-2 text-xl rounded-full px-2 bg-black/20 text-white cursor-pointer"
onClick={handlePrevBanner}
>
&lsaquo;
</div>
)}

{/* right arrow */}
{showControls && (
<div
className="hidden group-hover:block absolute top-[50%] -translate-x-0 translate-y-[-50%] right-2 text-xl rounded-full px-2 bg-black/20 text-white cursor-pointer"
onClick={handleNextBanner}
>
&rsaquo;
</div>
)}
</div>

<div className="w-full text-center text-xs text-gray-500 dark:text-[#B3B3B3] italic">
<a href="mailto:contact@llama-corp.com" rel="noopener noreferrer" target="_blank">
{`${t("your-ad-here")}, ${t("contact-us").toLowerCase()}`}
</a>
</div>
</div>
);
};
74 changes: 74 additions & 0 deletions components/Layout/Logo.js

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

Loading