-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
772 lines (711 loc) · 28.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WapWallet</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-03NYM2DSY1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-03NYM2DSY1');
</script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
background-color: #f5f5f5;
}
header {
background-color: #3f51b5;
color: white;
width: 100%;
padding: 1rem;
text-align: center;
}
.container {
width: 80%;
margin: 2rem auto;
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.card {
margin: 1rem 0;
padding: 1rem;
border: 1px solid #ddd;
border-radius: 8px;
}
.card h3 {
margin-top: 0;
}
.form-group {
margin-bottom: 1rem;
}
.form-group input, .form-group select {
width: calc(100% - 20px);
padding: 0.5rem;
margin: 0.5rem 0;
}
.form-group button {
padding: 0.5rem 1rem;
background-color: #3f51b5;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.form-group button:hover {
background-color: #303f9f;
}
.converter label, .converter select, .converter input {
display: block;
width: 100%;
margin-bottom: 0.5rem;
}
.converter button {
width: 100%;
margin-top: 1rem;
}
footer {
background-color: #f5f5f5;
padding: 1rem;
text-align: center;
width: 100%;
}
.tradingview-widget-container {
max-width: 100%;
overflow: auto;
}
@media (max-width: 600px) {
.tradingview-widget-container {
height: 400px; /* Adjust height for smaller screens */
}
.wapwallet-container {
text-align: center;
max-width: 800px;
margin: auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
border-radius: 8px;
}
.wapwallet-container h1 {
color: #333;
font-size: 2rem;
margin-bottom: 20px;
}
.wapwallet-container .form-group {
margin-bottom: 15px;
}
.wapwallet-container label {
display: block;
margin-bottom: 5px;
color: #666;
}
.wapwallet-container input, .wapwallet-container select {
width: 100%;
padding: 10px;
margin: 5px 0 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
.wapwallet-container button {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
.wapwallet-container button:hover {
background-color: #0056b3;
}
.wapwallet-container #budgetList, .wapwallet-container #investmentList, .wapwallet-container #aiAdvice {
margin-top: 20px;
text-align: left;
}
.wapwallet-container .budget-item, .wapwallet-container .investment-item {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
margin-bottom: 10px;
}
}
</style>
</head>
<body>
<header>
<h1>WapWallet</h1>
<h2>Unlocking Crypto's Full Potential with AI-Driven Insights</h2>
</header>
<div class="container">
<div class="card" id="gas-prices">
<h3>Live Gas Prices</h3>
<div id="gas-prices-content">Loading...</div>
</div>
<div class="card" id="market-data">
<h3>Live Market Data</h3>
<ul id="market-data-content">Loading...</ul>
<title></title>
<script>
async function fetchGasPrices() {
try {
const response = await fetch('https://api.blockcypher.com/v1/eth/main');
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
const content = document.getElementById('gas-prices-content');
content.innerHTML = `
High: ${data.high_gas_price} Gwei<br>
Medium: ${data.medium_gas_price} Gwei<br>
Low: ${data.low_gas_price} Gwei
`;
} catch (error) {
console.error('Error fetching gas prices:', error);
const content = document.getElementById('gas-prices-content');
content.innerHTML = 'Failed to fetch gas prices. Please try again later.';
}
}
async function fetchMarketData() {
try {
const response = await fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd');
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
const content = document.getElementById('market-data-content');
content.innerHTML = data.map(coin => `
<li>${coin.name} (${coin.symbol.toUpperCase()}): $${coin.current_price}</li>
`).join('');
} catch (error) {
console.error('Error fetching market data:', error);
const content = document.getElementById('market-data-content');
content.innerHTML = 'Failed to fetch market data. Please try again later.';
}
}
document.addEventListener('DOMContentLoaded', () => {
fetchGasPrices();
fetchMarketData();
});
</script>
</head>
<body>
</div>
<div class="card" id="stock-data">
<h3>Live Stock Market Data</h3>
<div id="stock-data-content">
<div class="tradingview-widget-container">
<div id="tradingview_f0b8f"></div>
<div class="tradingview-widget-copyright">
<a href="https://www.tradingview.com" rel="noopener" target="_blank">
<span class="blue-text">Market Data</span>
</a> by TradingView
</div>
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<script type="text/javascript">
new TradingView.widget({
"width": 980,
"height": 610,
"symbol": "NASDAQ:AAPL",
"interval": "D",
"timezone": "Etc/UTC",
"theme": "light",
"style": "1",
"locale": "en",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"allow_symbol_change": true,
"watchlist": [
"NASDAQ:AAPL",
"NASDAQ:GOOGL",
"NASDAQ:MSFT",
"NASDAQ:AMZN",
"NASDAQ:TSLA",
"NYSE:BRK.B",
"NYSE:V",
"NASDAQ:FB",
"NYSE:JPM",
"NASDAQ:NFLX",
"NYSE:JNJ",
"NYSE:WMT",
"NYSE:PG",
"NASDAQ:NVDA",
"NYSE:DIS",
"NGSE:DANGCEM",
"NGSE:MTNN",
"NGSE:GUARANTY",
"NGSE:ZENITHBANK",
"NGSE:SEPLAT",
"NGSE:FBNH",
"NGSE:UBA",
"NGSE:ACCESS",
"NGSE:NESTLE",
"NGSE:BLOOM",
"NGSE:WAPCO",
"NGSE:FO",
"NGSE:PZ",
"NGSE:CADBURY",
"NGSE:TOTAL",
"NGSE:MOBIL",
"NGSE:CONOIL",
"JSE:NPN",
"JSE:SOL",
"JSE:FSR",
"JSE:MTN",
"JSE:AGL",
"JSE:SHP",
"JSE:BAT",
"JSE:REM",
"JSE:BTI",
"JSE:IMP",
"JSE:BIL",
"JSE:VOD",
"JSE:EXX",
"JSE:TKG",
"JSE:DSY",
"JSE:ABG",
"NSE:EQTY",
"NSE:KCB",
"NSE:SCOM",
"NSE:COOP",
"EGX:COMI",
"EGX:EFID",
"EGX:ORHD",
"EGX:ESRS"
],
"details": true,
"hotlist": true,
"calendar": true,
"news": ["headlines"]
});
</script>
</div>
<div class="wapwallet-container">
<h1>SmartFinance</h1>
<div class="form-group">
<label for="budget">Enter your budget</label>
<input type="number" id="budget" placeholder="Enter budget amount">
</div>
<div class="form-group">
<label for="expense">Enter your expense</label>
<input type="number" id="expense" placeholder="Enter expense amount">
</div>
<button onclick="addExpense()">Add Expense</button>
<div id="budgetList"></div>
<h2>InvestBot</h2>
<div class="form-group">
<label for="amount">Enter amount to invest</label>
<input type="number" id="amount" placeholder="Enter investment amount">
</div>
<button onclick="invest()">Invest</button>
<div id="investmentList"></div>
<div id="aiAdvice"></div>
<h2>Investment Platform: Bamboo</h2>
<div>
<p><a href="https://app.investbamboo.com/invite/miracle758827" target="_blank">Bamboo</a> - Invest in the US stock markets right from your phone with Bamboo. Sign up now in less than 5 minutes and get a bonus for signing up!</p>
<p><a href="https://learn.investbamboo.com/" target="_blank">Learn more about Bamboo</a></p>
<h3>Features:</h3>
<ul>
<li>Easy signup process and user-friendly interface.</li>
<li>Access to US stocks like Apple, Amazon, and Google.</li>
<li>Educational resources to help you understand investing.</li>
</ul>
<h3>Benefits:</h3>
<ul>
<li>Invest with as little as $10.</li>
<li>Diversify your portfolio with a range of investment options.</li>
<li>Earn a signup bonus.</li>
</ul>
<h3>More Information:</h3>
<p>Bamboo offers a seamless way to invest in global markets. It provides a secure platform to grow your investments. Enjoy the flexibility of investing from your mobile device.</p>
</div>
</div>
<div class="card" id="mining-calculator">
<h3>Mining Calculator</h3>
<div class="form-group">
<input type="text" id="hashrate" placeholder="Hashrate">
</div>
<div class="form-group">
<input type="text" id="block-reward" placeholder="Block Reward">
</div>
<div class="form-group">
<input type="text" id="difficulty" placeholder="Difficulty">
</div>
<div class="form-group">
<button onclick="calculateMining()">Calculate</button>
</div>
<div id="mining-result"></div>
</div>
<title>Live Cryptocurrency Prices</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1, h2 {
color: #333;
}
label {
display: block;
margin-top: 10px;
}
select, button {
margin-top: 10px;
padding: 5px;
font-size: 16px;
}
</style>
</head>
<body>
<h1>Cryptocurrency Converter</h1>
<div>
<label for="crypto">Cryptocurrency:</label>
<select id="crypto">
<option value="bitcoin">Bitcoin (BTC)</option>
<option value="ethereum">Ethereum (ETH)</option>
<option value="binancecoin">Binance Coin (BNB)</option>
<option value="ripple">Ripple (XRP)</option>
<option value="cardano">Cardano (ADA)</option>
<option value="dogecoin">Dogecoin (DOGE)</option>
<option value="solana">Solana (SOL)</option>
<option value="polkadot">Polkadot (DOT)</option>
<option value="litecoin">Litecoin (LTC)</option>
<option value="chainlink">Chainlink (LINK)</option>
<option value="bitcoin-cash">Bitcoin Cash (BCH)</option>
<option value="stellar">Stellar (XLM)</option>
<option value="vechain">VeChain (VET)</option>
<option value="filecoin">Filecoin (FIL)</option>
<option value="tron">TRON (TRX)</option>
<option value="eos">EOS (EOS)</option>
<option value="monero">Monero (XMR)</option>
<option value="tezos">Tezos (XTZ)</option>
<option value="cosmos">Cosmos (ATOM)</option>
<option value="algorand">Algorand (ALGO)</option>
</select>
</div>
<div>
<label for="fiat">Fiat Currency:</label>
<select id="fiat">
<option value="usd">US Dollar (USD)</option>
<option value="eur">Euro (EUR)</option>
<option value="gbp">British Pound (GBP)</option>
<option value="jpy">Japanese Yen (JPY)</option>
<option value="aud">Australian Dollar (AUD)</option>
<option value="cad">Canadian Dollar (CAD)</option>
<option value="chf">Swiss Franc (CHF)</option>
<option value="cny">Chinese Yuan (CNY)</option>
<option value="inr">Indian Rupee (INR)</option>
<option value="ngn">Nigerian Naira (NGN)</option>
<option value="kes">Kenyan Shilling (KES)</option>
<option value="ghs">Ghanaian Cedi (GHS)</option>
<option value="zmw">Zambian Kwacha (ZMW)</option>
<option value="egp">Egyptian Pound (EGP)</option>
<option value="sgd">Singapore Dollar (SGD)</option>
<option value="hkd">Hong Kong Dollar (HKD)</option>
<option value="nzd">New Zealand Dollar (NZD)</option>
<option value="krw">South Korean Won (KRW)</option>
<option value="sek">Swedish Krona (SEK)</option>
<option value="mxn">Mexican Peso (MXN)</option>
<option value="nok">Norwegian Krone (NOK)</option>
<option value="try">Turkish Lira (TRY)</option>
<option value="rub">Russian Ruble (RUB)</option>
<option value="zar">South African Rand (ZAR)</option>
<option value="brl">Brazilian Real (BRL)</option>
</select>
</div>
<div>
<button onclick="updatePrice()">Get Price</button>
</div>
<h2>Price: <span id="price">N/A</span></h2>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
function getExchangeRate(crypto, fiat) {
const apiUrl = `https://api.coingecko.com/api/v3/simple/price?ids=${crypto}&vs_currencies=${fiat}`;
return fetch(apiUrl)
.then(response => response.json())
.then(data => {
if (data[crypto] && data[crypto][fiat]) {
return data[crypto][fiat];
} else {
throw new Error('Exchange rate not found');
}
});
}
window.updatePrice = function() {
const cryptoSelect = document.getElementById('crypto');
const fiatSelect = document.getElementById('fiat');
const priceSpan = document.getElementById('price');
const crypto = cryptoSelect.value;
const fiat = fiatSelect.value;
getExchangeRate(crypto, fiat)
.then(rate => {
priceSpan.innerText = `${rate} ${fiat.toUpperCase()}`;
})
.catch(error => {
console.error('Error fetching exchange rate:', error);
priceSpan.innerText = 'N/A';
});
}
});
</script>
</div>
<div class="card" id="defi-tools">
<h3>DeFi Tools</h3>
<div class="form-group">
<button onclick="openDeFiPlatform('Aave')">Open Aave</button>
<button onclick="openDeFiPlatform('Compound')">Open Compound</button>
</div>
<p>Explore decentralized finance (DeFi) tools like lending, borrowing, and liquidity provision on trusted platforms.</p>
</div>
<div class="card" id="list-of-tools">
<h3>❗🔥 List of Tools You Need to Be in Crypto Space! 🔥❗</h3>
<h4>Social Account:</h4>
<ol>
<li>WhatsApp</li>
<li>Discord</li>
<li>Twitter</li>
<li>Telegram</li>
</ol>
<h4>DEX Wallets:</h4>
<ol>
<li>MetaMask</li>
<li>Trust Wallet</li>
<li>Phantom/Solfare Wallet</li>
</ol>
<h4>CEX Wallets:</h4>
<ol>
<li>Binance</li>
<li>MEXC</li>
<li>OKX</li>
<li>Bybit</li>
<li>Kucoin</li>
</ol>
<h4>Common Gas Fees to Own in DEX Wallets:</h4>
<ol>
<li>Ethereum</li>
<li>BNB</li>
<li>Arbitrum</li>
<li>MATIC</li>
<li>USDT</li>
<li>BASE</li>
<li>USDC</li>
<li>SOL</li>
</ol>
<h4>Browsers:</h4>
<ol>
<li>Mises</li>
<li>Kiwi</li>
<li>Brave</li>
<li>Chrome</li>
</ol>
<p>Make sure you create your wallet extensions in Mises and Kiwi. You can get Trust Wallet extension, MetaMask Extension, Binance extension, and a host of others as well.</p>
</div>
<div class="card" id="marketplace-links">
<h3>Crypto Marketplace</h3>
<button onclick="openPancakeSwap()">OPEN PANCAKESWAP</button>
<button onclick="openUniswap()">OPEN UNISWAP</button>
</div>
</div>
<footer>
<p>©WapWallet. All rights reserved.</p>
</footer>
<script>
let budget = 0;
let expenses = [];
let investments = [];
function addExpense() {
const budgetInput = document.getElementById('budget');
const expenseInput = document.getElementById('expense');
if (budgetInput.value) {
budget = parseFloat(budgetInput.value);
budgetInput.value = '';
}
if (expenseInput.value) {
const expense = parseFloat(expenseInput.value);
expenses.push(expense);
expenseInput.value = '';
updateBudgetList();
}
}
function updateBudgetList() {
const budgetList = document.getElementById('budgetList');
budgetList.innerHTML = `<p>Total Budget: $${budget}</p>`;
let totalExpenses = 0;
expenses.forEach(expense => {
budgetList.innerHTML += `<div class="budget-item">Expense: $${expense}</div>`;
totalExpenses += expense;
});
budgetList.innerHTML += `<p>Total Expenses: $${totalExpenses}</p>`;
budgetList.innerHTML += `<p>Remaining Budget: $${budget - totalExpenses}</p>`;
}
function invest() {
const amountInput = document.getElementById('amount');
const amount = parseFloat(amountInput.value);
if (amount) {
investments.push(amount);
amountInput.value = '';
updateInvestmentList();
provideAIAdvice(amount);
}
}
function updateInvestmentList() {
const investmentList = document.getElementById('investmentList');
investmentList.innerHTML = '<h3>Investments</h3>';
investments.forEach((investment, index) => {
investmentList.innerHTML += `<div class="investment-item">Investment ${index + 1}: $${investment}</div>`;
});
}
function provideAIAdvice(amount) {
const aiAdvice = document.getElementById('aiAdvice');
aiAdvice.innerHTML = '<h3>AI Investment Advice</h3>';
// Simple AI logic for demonstration purposes
if (amount < 50) {
aiAdvice.innerHTML += '<p>Investing a small amount can be a great start! Consider investing in low-risk options like government bonds or mutual funds.</p>';
} else if (amount >= 50 && amount < 200) {
aiAdvice.innerHTML += '<p>With this amount, you might want to diversify your investments. Consider a mix of stocks and bonds for balanced growth.</p>';
} else {
// AI investment advice
if (amount >= 10 && amount < 50) {
aiAdvice.innerHTML += "Start with small investments in low-cost index funds to build your investment portfolio.";
} else if (amount >= 50 && amount < 200) {
aiAdvice.innerHTML += "Consider investing in low-risk assets such as bonds or mutual funds.";
} else if (amount >= 200 && amount < 500) {
aiAdvice.innerHTML += "Diversify your portfolio by investing in a mix of stocks and bonds.";
} else if (amount >= 500 && amount < 1000) {
aiAdvice.innerHTML += "Explore index funds or exchange-traded funds (ETFs) for long-term growth potential.";
} else if (amount >= 1000 && amount < 5000) {
aiAdvice.innerHTML += "Consider investing in dividend-paying stocks for passive income.";
} else if (amount >= 5000 && amount < 10000) {
aiAdvice.innerHTML += "Look into real estate investment trusts (REITs) for exposure to the real estate market.";
} else if (amount >= 10000 && amount < 20000) {
aiAdvice.innerHTML += "Consider investing in a mix of stocks, bonds, and real estate for balanced growth.";
} else if (amount >= 20000 && amount < 50000) {
aiAdvice.innerHTML += "Explore growth stocks with high potential returns for aggressive growth strategies.";
} else if (amount >= 50000 && amount < 100000) {
aiAdvice.innerHTML += "Consider diversifying into international markets for global exposure.";
} else if (amount >= 100000 && amount < 200000) {
aiAdvice.innerHTML += "Look into alternative investments like cryptocurrency or commodities for diversification.";
} else if (amount >= 200000 && amount < 500000) {
aiAdvice.innerHTML += "Consider investing in startup companies through venture capital or angel investing.";
} else if (amount >= 500000 && amount < 1000000) {
aiAdvice.innerHTML += "Explore private equity investments for higher potential returns and longer investment horizons.";
} else if (amount >= 1000000 && amount < 2000000) {
aiAdvice.innerHTML += "Consider investing in yourself through education or starting your own business.";
} else if (amount >= 2000000 && amount < 5000000) {
aiAdvice.innerHTML += "Look into philanthropic investments or impact investing for social and environmental impact.";
} else if (amount >= 5000000 && amount < 10000000) {
aiAdvice.innerHTML += "Explore institutional-grade investments like hedge funds or private equity funds for sophisticated strategies.";
} else if (amount >= 10000000 && amount < 20000000) {
aiAdvice.innerHTML += "Consider establishing a family office for comprehensive wealth management and legacy planning.";
} else if (amount >= 20000000 && amount < 50000000) {
aiAdvice.innerHTML += "Look into alternative assets like art, wine, or collectibles for diversification and potential appreciation.";
} else {
aiAdvice.innerHTML += "Your investment amount is substantial. Consider consulting a team of financial advisors for personalized advice and wealth management.";
}
aiAdvice.innerHTML += '<p>Investing a larger amount gives you more options. Look into higher-risk investments like stocks or real estate for potentially higher returns.</p>';
}
}
// Example cryptocurrencies for the dropdown
const cryptocurrencies = [
{ value: 'BTC', label: 'Bitcoin (BTC)' },
{ value: 'ETH', label: 'Ethereum (ETH)' },
{ value: 'BNB', label: 'Binance Coin (BNB)' },
{ value: 'ADA', label: 'Cardano (ADA)' },
{ value: 'DOGE', label: 'Dogecoin (DOGE)' },
{ value: 'XRP', label: 'Ripple (XRP)' },
{ value: 'SOL', label: 'Solana (SOL)' },
];
// Store alerts
let priceAlerts = [];
// Function to set a price alert
function setPriceAlert() {
const crypto = document.getElementById('alert-crypto').value;
const price = parseFloat(document.getElementById('alert-price').value);
if (crypto && price) {
priceAlerts.push({ crypto, price });
document.getElementById('alert-message').textContent = `Alert set for ${crypto} at $${price}`;
} else {
document.getElementById('alert-message').textContent = 'Please select a cryptocurrency and enter a valid price.';
}
}
function openDeFiPlatform(platform) {
let url = '';
if (platform === 'Aave') {
url = 'https://app.aave.com/';
} else if (platform === 'Compound') {
url = 'https://compound.finance/';
}
window.open(url, '_blank');
}
// Function to check prices and trigger alerts
async function checkPriceAlerts() {
const promises = priceAlerts.map(async alert => {
const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${alert.crypto.toLowerCase()}&vs_currencies=usd`);
const data = await response.json();
const currentPrice = data[alert.crypto.toLowerCase()].usd;
if (currentPrice >= alert.price) {
alertUser(alert.crypto, alert.price, currentPrice);
}
});
await Promise.all(promises);
}
// Function to alert the user
function alertUser(crypto, alertPrice, currentPrice) {
alert(`${crypto} has reached your alert price of $${alertPrice}. Current price: $${currentPrice}`);
// Remove the alert from the list
priceAlerts = priceAlerts.filter(alert => alert.crypto !== crypto || alert.price !== alertPrice);
}
// Check price alerts periodically
setInterval(checkPriceAlerts, 60000); // Check every minute
async function fetchGasPrices() {
const response = await fetch('https://api.blockcypher.com/v1/eth/main');
const data = await response.json();
const content = document.getElementById('gas-prices-content');
content.innerHTML = `
High: ${data.high_gas_price} Gwei<br>
Medium: ${data.medium_gas_price} Gwei<br>
Low: ${data.low_gas_price} Gwei
`;
}
async function fetchMarketData() {
const response = await fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd');
const data = await response.json();
const content = document.getElementById('market-data-content');
content.innerHTML = data.map(coin => `
<li>${coin.name} (${coin.symbol.toUpperCase()}): $${coin.current_price}</li>
`).join('');
}
function calculateMining() {
const hashrate = document.getElementById('hashrate').value;
const blockReward = document.getElementById('block-reward').value;
const difficulty = document.getElementById('difficulty').value;
const result = hashrate * blockReward / difficulty;
document.getElementById('mining-result').innerText = `Result: ${result}`;
}
function openPancakeSwap() {
window.open('https://pancakeswap.finance/', '_blank');
}
function openUniswap() {
window.open('https://app.uniswap.org/', '_blank');
}
window.onload = async function() {
const { cryptocurrencies, fiatCurrencies } = await fetchCurrencyOptions();
populateOptions('base-currency', cryptocurrencies);
populateOptions('target-currency', fiatCurrencies);
fetchGasPrices();
fetchMarketData();
};
</script>
</body>
</html>