Commit 36731406 authored by Kegan's avatar Kegan
Browse files

connect wallet functionality

parent 13644c00
......@@ -4,4 +4,7 @@ node_modules
#Hardhat files
cache
artifacts
secrets.js
\ No newline at end of file
#Secrets
secrets.js
infura.js
\ No newline at end of file
......@@ -20,7 +20,7 @@ contract SteamToEther is Context {
function GetSteamAccount(address _addr) public view returns(uint64) {
require(!_addr.isContract(), "Contracts cannot link steam accounts!");
require(_addr != address(0x0), "Cannot use 0x0 address!");
return etherToSteamID[_addr];
}
......
......@@ -6,7 +6,8 @@
"": {
"name": "hardhat-project",
"dependencies": {
"hardhat": "^2.6.2"
"hardhat": "^2.6.2",
"http-server": "^13.0.1"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
......@@ -1894,6 +1895,14 @@
}
]
},
"node_modules/basic-auth": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz",
"integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
......@@ -2230,6 +2239,14 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"node_modules/colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
"engines": {
"node": ">=0.1.90"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
......@@ -2301,6 +2318,14 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
},
"node_modules/corser": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
"integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/crc-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
......@@ -2912,6 +2937,11 @@
"node": ">=6"
}
},
"node_modules/eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
},
"node_modules/evp_bytestokey": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
......@@ -12584,6 +12614,44 @@
"node": ">= 0.6"
}
},
"node_modules/http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"dependencies": {
"eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/http-server": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/http-server/-/http-server-13.0.1.tgz",
"integrity": "sha512-ke9rphoNuqsOCHy4tA3b3W4Yuxy7VUIXcTHSLz6bkMDAJPQD4twjEatquelJBIPwNhZuC3+FYj/+dSaGHdKTCw==",
"dependencies": {
"basic-auth": "^1.0.3",
"colors": "^1.4.0",
"corser": "^2.0.1",
"he": "^1.1.0",
"http-proxy": "^1.18.0",
"mime": "^1.6.0",
"minimist": "^1.2.5",
"opener": "^1.5.1",
"portfinder": "^1.0.25",
"secure-compare": "3.0.1",
"union": "~0.5.0",
"url-join": "^2.0.5"
},
"bin": {
"http-server": "bin/http-server"
},
"engines": {
"node": ">=6"
}
},
"node_modules/http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
......@@ -13365,6 +13433,17 @@
"miller-rabin": "bin/miller-rabin"
}
},
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/mime-db": {
"version": "1.49.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
......@@ -13852,6 +13931,14 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/opener": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
"bin": {
"opener": "bin/opener-bin.js"
}
},
"node_modules/os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
......@@ -14086,6 +14173,27 @@
"node": ">=0.10.0"
}
},
"node_modules/portfinder": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
"integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==",
"dependencies": {
"async": "^2.6.2",
"debug": "^3.1.1",
"mkdirp": "^0.5.5"
},
"engines": {
"node": ">= 0.12.0"
}
},
"node_modules/portfinder/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/postinstall-postinstall": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz",
......@@ -14368,6 +14476,11 @@
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
},
"node_modules/requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
},
"node_modules/resolve": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
......@@ -14467,6 +14580,11 @@
"node": ">=10.0.0"
}
},
"node_modules/secure-compare": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
"integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="
},
"node_modules/semaphore-async-await": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz",
......@@ -15112,6 +15230,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/union": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
"integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
"dependencies": {
"qs": "^6.4.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
......@@ -15147,6 +15276,11 @@
"querystring": "0.2.0"
}
},
"node_modules/url-join": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz",
"integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="
},
"node_modules/url-set-query": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz",
......@@ -16947,6 +17081,11 @@
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
},
"basic-auth": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz",
"integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ="
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
......@@ -17231,6 +17370,11 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
......@@ -17288,6 +17432,11 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
},
"corser": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
"integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c="
},
"crc-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
......@@ -17792,6 +17941,11 @@
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
},
"eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
},
"evp_bytestokey": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
......@@ -25225,6 +25379,35 @@
"toidentifier": "1.0.0"
}
},
"http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"requires": {
"eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
}
},
"http-server": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/http-server/-/http-server-13.0.1.tgz",
"integrity": "sha512-ke9rphoNuqsOCHy4tA3b3W4Yuxy7VUIXcTHSLz6bkMDAJPQD4twjEatquelJBIPwNhZuC3+FYj/+dSaGHdKTCw==",
"requires": {
"basic-auth": "^1.0.3",
"colors": "^1.4.0",
"corser": "^2.0.1",
"he": "^1.1.0",
"http-proxy": "^1.18.0",
"mime": "^1.6.0",
"minimist": "^1.2.5",
"opener": "^1.5.1",
"portfinder": "^1.0.25",
"secure-compare": "3.0.1",
"union": "~0.5.0",
"url-join": "^2.0.5"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
......@@ -25806,6 +25989,11 @@
"brorand": "^1.0.1"
}
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"mime-db": {
"version": "1.49.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
......@@ -26177,6 +26365,11 @@
"is-wsl": "^2.1.1"
}
},
"opener": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A=="
},
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
......@@ -26350,6 +26543,26 @@
"pinkie": "^2.0.0"
}
},
"portfinder": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
"integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==",
"requires": {
"async": "^2.6.2",
"debug": "^3.1.1",
"mkdirp": "^0.5.5"
},
"dependencies": {
"debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"requires": {
"ms": "^2.1.1"
}
}
}
},
"postinstall-postinstall": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz",
......@@ -26567,6 +26780,11 @@
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
},
"requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
},
"resolve": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
......@@ -26636,6 +26854,11 @@
"node-gyp-build": "^4.2.0"
}
},
"secure-compare": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
"integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="
},
"semaphore-async-await": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz",
......@@ -27146,6 +27369,14 @@
"which-boxed-primitive": "^1.0.2"
}
},
"union": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
"integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
"requires": {
"qs": "^6.4.0"
}
},
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
......@@ -27183,6 +27414,11 @@
}
}
},
"url-join": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz",
"integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="
},
"url-set-query": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz",
......
{
"name": "hardhat-project",
"dependencies": {
"hardhat": "^2.6.2"
"hardhat": "^2.6.2",
"http-server": "^13.0.1"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
......
......@@ -2,6 +2,8 @@ const { expect } = require("chai");
const { BigNumber } = require("ethers");
const { ethers } = require("hardhat");
describe("SteamToEther", function () {
it("Created valid link. Test link values exist", async function () {
const SteamToEther = await ethers.getContractFactory("SteamToEther");
......
......@@ -216,6 +216,7 @@ blockquote {
}
.button-primary.button-header {
padding: 15px 40px;
white-space: nowrap;
}
......@@ -1310,6 +1311,37 @@ blockquote {
box-shadow: 0 4px 22px 0 rgba(23, 15, 73, 0.06);
}
.notification-header {
border-radius: 0px 0px 10px 10px;
background-color: #d9dbe9;
box-shadow: 0 12px 24px 0 rgba(20, 20, 43, 0.01), 0 -2px 4px 0 rgba(20, 20, 43, 0.02), 0 3px 14px 0 rgba(74, 58, 255, 0.03);
}
.section-2.hidden {
position: static;
}
.paragraph-2 {
color: #170f49;
text-align: center;
}
.text-block {
font-size: 18px;
}
@media screen and (min-width: 1440px) {
.notification-header {
position: static;
height: 25px;
background-color: #000;
}
.section-2 {
height: 35px;
}
}
@media screen and (min-width: 1920px) {
.cta-card {
padding: 80px 56px 420px;
......@@ -1352,6 +1384,10 @@ blockquote {
color: #615e83;
font-size: 16px;
}
.notification-header {
height: 35px;
}
}
@media screen and (max-width: 991px) {
......@@ -1836,6 +1872,10 @@ blockquote {
.card-2.utility-pages {
padding: 40px 20px;
}
.section-2 {
height: 35px;
}
}
#w-node-c054886d-07d1-a130-b374-a7e8d59be279-d59be275 {
......
......@@ -36,8 +36,8 @@
<div class="w-layout-grid grid-header">
<a href="index.html" aria-current="page" class="logo-brand w-nav-brand w--current"><img src="images/logo_text.png" width="256" sizes="(max-width: 479px) 87vw, (max-width: 767px) 260px, 256px" srcset="images/logo_text-p-500.png 500w, images/logo_text-p-800.png 800w, images/logo_text.png 1536w" alt="" class="header-logo"></a>
<div id="w-node-_46da189b-bbb8-bef4-dcee-3a432b15a416-ed8dffe9">
<a data-w-id="ea485132-27e6-b439-c7af-d8391815e2d2" href="#" target="_blank" class="button-primary button-header w-inline-block">
<div>Connect Wallet</div>
<a data-w-id="ea485132-27e6-b439-c7af-d8391815e2d2" href="#" target="_blank" id="connect-wallet-btn" class="button-primary button-header w-inline-block">
<div id="connect-wallet-btn-text">Connect Wallet</div>
</a>
</div>
</div>
......@@ -487,5 +487,159 @@
<script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=6134d5b6d6b22c5832d8df7c" type="text/javascript" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="js/webflow.js" type="text/javascript"></script>
<!-- [if lte IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/placeholders/3.0.2/placeholders.min.js"></script><![endif] -->
<script type="module">
import { ethers } from "./js/ethers.js";
import infura from "./js/infura.js";
const connect_txt = document.getElementById('connect-wallet-btn-text');
const connect_btn = document.getElementById('connect-wallet-btn');
const is_web3 = (window.ethereum != undefined);
const provider = !is_web3 ? new ethers.providers.JsonRpcProvider(infura.getNetwork()) : new ethers.providers.Web3Provider(window.ethereum);
var signer = null;
const IsWalletConnected = async () => {
return (await provider.listAccounts()).length > 0;
};
const OnConnectClicked = async () => {
// 1. determine if we can connect a wallet?
if(!is_web3) return; // infura -> do nothing
if(await IsWalletConnected()) return; // wallet already connected
try {
await provider.send("eth_requestAccounts", []); //temp link metamask
} catch (e) {
console.log(e);
return; //connection rejected?!
}
OnWalletLinked();
};
const OnWalletLinked = async () => {
signer = provider.getSigner();
connect_btn.classList.add("button-secondary");
//display address or ENS name
let address = await signer.getAddress();
let ens = await GetENSName(address);
connect_txt.innerHTML = (ens == null ? await signer.getAddress() : ens);
}
const GetABI = async () => {
if(!IsOnArbitrum()) return [];
let network = await provider.getNetwork();
if(network.chainId == 421611)
{
return [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "_wallet",
"type": "address"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_steamId64",
"type": "uint64"
}
],
"name": "AccountLinked",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint64",
"name": "_steamId",
"type": "uint64"
}
],
"name": "GetEthereumWallets",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_addr",
"type": "address"
}
],
"name": "GetSteamAccount",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint64",
"name": "_steamId64",
"type": "uint64"
}
],
"name": "LinkSteamAccount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
];
}
if(network.chainId == 42161)
{
return []; //current mainnet contract abi
}