-
Notifications
You must be signed in to change notification settings - Fork 3
/
card.php
547 lines (413 loc) · 24.4 KB
/
card.php
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
<!DOCTYPE html>
<html lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<html onmouseover="checkNetworkVer()" onmouseout="checkNetworkVer()" >
<head itemscope itemtype="http://schema.org/WebSite">
<title>Buying Plata Token with Credit Card & Debit Card</title>
<link rel="canonical" href="https://www.plata.ie/card/" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
<meta property="og:title" itemprop="name" content="Buying Plata Token with Credit Card & Debit Card"/>
<meta property="og:type" content="website"/>
<meta property="og:url" itemprop="url" content="https://www.plata.ie/card/"/>
<meta property="og:image" content="https://cdn.sumup.store/2/th640/60bf37bd24c9ee5915eee434b6679291/520c9b05-cb28-439b-a509-27f3a1aef2ba.jpeg" alt="Plata Token"/>
<meta property="og:description" content=""/>
<meta property="og:site_name" content="Typo FX"/>
<script src="https://cdn.jsdelivr.net/npm/@walletconnect/[email protected]/dist/umd/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<link rel="stylesheet" href="card-style.css">
<link rel="shortcut icon" type="image/svg" href="https://cdn.sumup.store/assets/v808.0.0/themes/os-theme2/images/logo.5a6a7f60.png"/>
<script src="https://cdn.sumup.store/assets/v808.0.0/shared/shared.2df828ac.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/translator/translator.845c2333.js" defer></script>
</head>
<script src="https://cdn.sumup.store/assets/v808.0.0/shared/shared.2df828ac.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/translator/translator.845c2333.js" defer></script>
<script nonce="hQF2bDyF/K/pz6GGDAMsDg==">
window.dataLayer = window.dataLayer || [];
function gtag() { window.dataLayer.push(arguments); }
</script>
<!-- Google Tag Manager -->
<script nonce="hQF2bDyF/K/pz6GGDAMsDg==">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KJVNV3D');</script>
<!-- End Google Tag Manager -->
<script nonce="hQF2bDyF/K/pz6GGDAMsDg==">
const appInfo = {
shopId: "b9e39299-694e-4da2-b318-07417e050f1c",
checkoutApiUrl: "https://checkout.sumupstore.com",
};
</script>
</head>
<body data-globals='{"shopInfo":{"domain":"https:\/\/platatoken.sumupstore.com","uuid":"b9e39299-694e-4da2-b318-07417e050f1c","checkoutUrl":"https:\/\/checkout.sumupstore.com","currencyCode":"EUR","isPreviewMode":false,"locale":"en-GB","mch":"7eb09da5daf7069533f23db0dcbd07c947f939dc2db15fcba37eeedc3cb32ad7"},"settings":{"installmentsEnabled":false,"backToCheckout":false,"cartType":"side_cart"},"translations":{"notificationError":"Product cannot be added to cart","productDescriptionShowLess":"Show less","productDescriptionShowMore":"Show more"},"imagesUrl":{"productBlind":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/product_blind.42469217.png","placeholderItem":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-item.5ad90dd0.svg","cartIcon":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/header-cart-icon.b98de144.svg","cartDeleteIcon":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/cart-remove-icon.c33934ab.svg","hamburgerMenu":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/header-hamburger-menu.0f2115b4.svg","hamburgerMenuClose":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/header-hamburger-close.ee19af5c.svg","bannerPlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-banner.3776bc29.svg","text_and_imagePlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-banner.3776bc29.svg","text_onlyPlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-banner.3776bc29.svg","logoPlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-logo.07eb53b3.svg"},"featurePolicy":[]}' data-content-group="product">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KJVNV3D"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div data-selector="os-theme-notification" class="os-theme-notification"> </div>
<!-- OS Theme - Header section -->
<header class="container px-lg-6 p-0 header has-no-logo"
data-selector="os-theme-header"
id="os-theme-header"
has-no-logo>
<div class="row m-0 header-row flex-nowrap">
<div class="col-auto hamburger-menu-wrapper d-lg-none">
</div>
<div class="nav-col">
<div class="row nav-row flex-nowrap">
<div class="col-auto nav-wrapper">
</div>
</div>
</div>
<!--
<style>
table, th, td {
border:0px solid black;
align:right;
}
</style>
-->
<div align="right" id="walletInjectBar">
<table style="width:100%">
<tr>
<td><span><a href="https://www.plata.ie/"><img height="55" src="https://www.plata.ie/card/plata-token.svg" /></a><span></td>
<td><div align="right"><div>
<table>
<td><button id= "btnChain" class="btnChain" onclick=""></button></td>
<td><button id= "btnConnectButton" class="btnConnectWallet" onclick="changeNetworkToPolygon(),showModal()">Connect Wallet</button></td>
</table>
</tr>
</table>
</div>
<script>
function CopyVcartMessage() {
let _VcartMessage = document.getElementById("VcartMessage");
_VcartMessage.select();
document.execCommand("copy");
alert("Copied!");
}
</script>
<br>
<div id="boxApp" align="center">
<div id="box" class="box">
<h2>Buy Plata with Card</h2>
<form>
<label for="VcartMessage">Your PLT deposit address:</label><a> </a><img height="11" src="https://www.plata.ie/images/copyIcon.png" style="cursor: pointer;" onclick="CopyVcartMessage()">
<input type="text" id="VcartMessage" name="VcartMessage" placeholder="0x..." maxlength="42" size="42"/>
<label for="cartMessage">Confirm your PLT deposit address:</label>
<input type="text" id="cartMessage" name="os-cart-message-input" placeholder="0x..." data-selector="os-cart-message-input" maxlength="42" size="42"/>
<br>
<!--
<select id="_cartMessage" class="cartMessage selectList" name="os-cart-message-input" data-selector="os-cart-message-input" size=1>
<option>Choose your DEX ERC-20 Wallet</option>
</select>
-->
<br><right>Pay with EUR (Enter Amount):</right>
<div id="sideCartItemsList" class="reduceText"></div>
<br>
<button id="goToCheckout" class="cart-checkout-button buttonBuyNow" data-cy="cart-widget-go-to-checkout" onclick="updateListing()">Buy now</button>
<br>
<!--<input type="checkbox" id="notbot" name="notbot" value="notbot" onclick="enableBuy()">I'm not a bot
<br>-->
</form>
<hr width="95%" class="hrline">
<a id="ConnectedWallet">Disconnected</a><a> </a><a id="NetNetWork"></a>
<br>
<br>
<div id="box2" class="boxSmallButtons">
Disclaimer: We can use this third-party service to purchase<br>
Plata Tokens from Polygon Blockchain.<br>By registering on their platform, you are also accepting their terms of service and will be required to pass their KYC process, which runs independently of ours.
</div>
</div id="box_">
</div id="boxApp_">
<br>
<center><a id="dappVersion">PlataByCard dApp Version 0.2.0</a></center>
</div>
</div>
</div>
</div>
<br>
<center><div class="nomics-ticker-widget" data-name="Plata V2" data-base="PLT9" data-quote="EUR"></div><script src="https://widget.nomics.com/embed.js"></script></center>
<table class="table-footer">
<tr>
<th>Typo FX © 2023</th>
<th>powered by <a href="https://www.sumup.com" rel="nofollow"> <img height="24" src="sumupLogo.svg" alt="Sumup">
</a>
</th>
</table>
<footer>
</footer>
<script src="https://platatoken.sumupstore.com/translations/os_theme?locales=en,en" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/themes/os-theme2/runtime.c2c4c915.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/themes/os-theme2/os-theme2.944f5b2a.js" defer></script>
<script src="cart.91f1617f.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/gallery/gallery.30df91d6.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/variants/variants.d1978907.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/analytics/analytics.f938f152.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/cookie-banner/cookie-banner.cfdab135.js" defer></script>
<script src="https://cdn.sumup.store/assets/v808.0.0/navigation/navigation.c68e1bb4.js" defer></script>
<body data-globals='{"shopInfo":{"domain":"https:\/\/platatoken.sumupstore.com","uuid":"b9e39299-694e-4da2-b318-07417e050f1c","checkoutUrl":"https:\/\/checkout.sumupstore.com","currencyCode":"EUR","isPreviewMode":false,"locale":"en-GB","mch":"7eb09da5daf7069533f23db0dcbd07c947f939dc2db15fcba37eeedc3cb32ad7"},"settings":{"installmentsEnabled":false,"backToCheckout":false,"cartType":"side_cart"},"translations":{"notificationError":"Product cannot be added to cart","productDescriptionShowLess":"Show less","productDescriptionShowMore":"Show more"},"imagesUrl":{"productBlind":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/product_blind.42469217.png","placeholderItem":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-item.5ad90dd0.svg","cartIcon":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/header-cart-icon.b98de144.svg","cartDeleteIcon":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/cart-remove-icon.c33934ab.svg","hamburgerMenu":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/header-hamburger-menu.0f2115b4.svg","hamburgerMenuClose":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/header-hamburger-close.ee19af5c.svg","bannerPlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-banner.3776bc29.svg","text_and_imagePlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-banner.3776bc29.svg","text_onlyPlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-banner.3776bc29.svg","logoPlaceholder":"https:\/\/cdn.sumup.store\/assets\/v808.0.0\/themes\/os-theme2\/images\/placeholder-logo.07eb53b3.svg"},"featurePolicy":[]}' data-content-group="product">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KJVNV3D"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<!-- The Modal --> <!-- Modal content -->
<div id="myModal" class="modal">
<div class="modal-content">
<center>
<span onclick="closeModal()"></span>
<h4>Select your Web3 Wallet</h4>
<button class="buttonBuyNow" onclick="connectMetamaskPC(),closeModal()">Metamask</button><br><br>
<button class="buttonBuyNow" onclick="connectWC(),closeModal()">WalletConnect</button><br><br>
<button class="buttonBuyNow" onclick="connectMetamaskPC(),closeModal()">Coinbase</button><br><br>
</center>
</div>
<script>
var account;
var MetaAccount;
const accounts = [];
// https://docs.walletconnect.com/quick-start/dapps/web3-provider
var provider = new WalletConnectProvider.default({
rpc: {
1: "https://mainnet.mycustomnode.com",
137: "https://polygon-rpc.com/", // https://docs.polygon.technology/docs/develop/network-details/network/
// ...
},
bridge: 'https://bridge.walletconnect.org',
});
var sign = async (msg) => {
if (w3) {
return await w3.eth.personal.sign(msg, account);
} else {
return false;
}
}
var contract = async (abi, address) => {
if (w3) {
return new w3.eth.Contract(abi, address);
} else {
return false;
}
}
var disconnect = async () => {
// Close provider session
await provider.disconnect();
document.getElementById("ConnectedWallet").innerText = "Disconnected";
document.getElementById("btnConnectButton").innerText = "Connect Wallet";
//document.getElementById("NetNetWork").innerText = "";
//accounts[0] = "";
//account = "";
hideAllConnectedButtons();
}
var address = "0x4b4f8ca8FB3e66B5DdAfCEbFE86312cEC486DAE1";
var abi = [{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"increment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}];
var addressGiveAway = "0x9921413Eb2A101A31B37291C33d33883B7581B7F";
var abiGiveAway = [{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TransferReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"address","name":"_destAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TransferSent","type":"event"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawTotal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endGiveaway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"giveAwayPlataToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"setExcludeFromBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"setIncludeToBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}];
var requestPlataWalletConnect = async () =>
{
const token = String("0xc298812164bd558268f51cc6e3b8b5daaf0b6341");
conn = new w3.eth.Contract(abiGiveAway, addressGiveAway);
await conn.methods.giveAwayERC20(token,account).send({from:account});
}
var changeNetworkToPolygonWalletConnect = async () =>
{
await w3.eth
.request({
method: "wallet_addEthereumChain",
params: [
{ chainId: "0x89",
chainName: "Polygon Mainnet",
rpcUrls:[ "https://polygon-rpc.com"],
blockExplorerUrls: ["https://polygonscan.com/"],
nativeCurrency: {
name: "MATIC",
symbol: "MATIC",
decimals: 18,
},
} ],
})
.catch(() => {});
}
function getAccounts(callback) {
web3.eth.getAccounts((error,result) => {
if (error) {
console.log(error);
} else {
callback(result);
}
});
}
function enableBuy(){
}
function checkNetworkVer() {
let networkVer = parseInt(window.ethereum.networkVersion);
if(networkVer == 137) {
document.getElementById("NetNetWork").innerText = "(Polygon Chain: 137)";
document.getElementById("btnChain").className = "btnChain";
//document.getElementById("btnConnect").disabled = true;
}
else
{
disconnect();
document.getElementById("NetNetWork").innerText = "Unknown Network";
document.getElementById("btnConnectButton").innerText = "Switch Chain";
document.getElementById("btnChain").className = "btnWrongChain";
//document.getElementById("btnConnect").disabled = false;
}
}
function listPlataMetamaskPC() {
let networkVer = parseInt(window.ethereum.networkVersion);
if(networkVer == 137) {
addPlata();
} else console.log('Wrong Network');
}
const addPlata = async() =>
{
await window.ethereum.request({
method: "wallet_watchAsset",
params: {
type: 'ERC20',
options: {
address: '0xc298812164bd558268f51cc6e3b8b5daaf0b6341',
symbol: 'PLT',
decimals: 4,
image: 'https://www.plata.ie/plataI2.svg',
},
},
}).catch();
}
const changeNetworkToPolygon = async() =>
{
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [{
chainId: "0x89",
chainName: "Polygon Mainnet",
rpcUrls:[ "https://polygon-rpc.com"],
blockExplorerUrls: ["https://polygonscan.com/"],
nativeCurrency: {
name: "MATIC",
symbol: "MATIC",
decimals: 18,
},
}],
}).catch();
}
function hideAllConnectedButtons(){
}
function showConnectedMenuMetamask(){
}
function showConnectedWalletConnect(){
}
const connectMetamaskPC = async() => {
let accounts = await window.ethereum.request ( {method : 'eth_requestAccounts'}).catch((err) => {} )
changeNetworkToPolygon();
MetaAccount = accounts[0];
console.log("ConnectedWallet " + MetaAccount);
console.log( "ReducedConnectedWallet " + ReducedStringNameWalletAddress(MetaAccount) );
document.getElementById("ConnectedWallet").innerText = "Connected";
document.getElementById("btnConnectButton").innerText = ReducedStringNameWalletAddress(MetaAccount);
document.getElementById("VcartMessage").value = MetaAccount;
/*
function addWalletList(){
var x = document.getElementById("cartMessage");
console.log(x);
var option = new Option(MetaAccount);
console.log(option);
x.add(option);
} addWalletList();
document.getElementById("cartMessage").focus();
*/
showConnectedMenuMetamask();
//document.getElementById("btnDisconnect").style.display = "visible";
}
window.onload = () => {
if(window.ethereum) {
//document.getElementById("NetNetWork").innerText = "MetaMask Detected";
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
web3 = new Web3(window.ethereum);
}
else {}
//document.getElementById("NetNetWork").innerText = "MetaMask not detected";
}
const connectWC = async () => {
document.getElementById("ConnectedWallet").innerText = "Connecting...";
await provider.enable();
const web3 = new Web3(provider);
window.w3 = web3;
var accounts = await web3.eth.getAccounts();
const chainId = await web3.eth.getChainId();
account = accounts[0];
//document.getElementById("ConnectedWallet").innerText = accounts[0];
if (chainId != 137) {
alert ("Unknown Chain, it must be Polygon (137)");
disconnect();
} else {
console.log("ConnectedWallet " + account);
console.log("ReducedConnectedWallet " + ReducedStringNameWalletAddress(account));
document.getElementById("ConnectedWallet").innerText = "Connected";
document.getElementById("NetNetWork").innerText = "Polygon Chain: 137";
document.getElementById("btnConnectButton").innerText = ReducedStringNameWalletAddress(account);
document.getElementById("VcartMessage").value = account;
showConnectedWalletConnect();
}
}
function showConnectedMenuWallConnect(){
document.getElementById("ClaimWallConnect").style.visibility="visible";
}
function ConnectedWallet(acc){
let _account = acc;
return _account;
}
function ReducedStringNameWalletAddress(account) {
let WalletAddress = account + " ";
return ( WalletAddress.slice(0,6) + "..." + WalletAddress.slice(-5,-1) );;
}
function getOS() {
var OS = "Unknown";
var _isMobile = navigator.userAgent.toLowerCase().match(/mobile/i);
var isMobile = "PC";
if (navigator.appVersion.indexOf("Win")!=-1) OS="Windows";
else if (navigator.appVersion.indexOf("Mac")!=-1) OS="MacOS";
else if (navigator.appVersion.indexOf("X11")!=-1) OS="UNIX";
else if (navigator.appVersion.indexOf("Linux")!=-1) OS="Linux";
if (_isMobile == "mobile") isMobile = "mobile";
//console.log(navigator.userAgent);
let userAgent = navigator.userAgent;
let browserName;
if(userAgent.match(/chrome|chromium|crios/i)){
browserName = "Chrome";
} else if(userAgent.match(/firefox|fxios/i)){
browserName = "Firefox";
} else if(userAgent.match(/safari/i)){
browserName = "Safari";
}else if(userAgent.match(/opr\//i)){
browserName = "Opera";
} else if(userAgent.match(/edg/i)){
browserName = "Edge";
} else { browserName="Unknown Browser";
}
console.log("OS: " + OS + " " + isMobile + " " + browserName);
//document.getElementById("OperatingSystem").innerText = "OS: " + OS + " " + isMobile + " " + browserName;
} getOS();
var modal = document.getElementById("myModal");
var span = document.getElementsByClassName("close")[0];
function showModal() {
myModal.style.display = "block";
}
function closeModal() {
myModal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == myModal) {
myModal.style.display = "none";
}
}
function AlertBox(){
alert("I am an alert box!");
}
</script>
</div>
</body>
</html>