Browse Source

完成layer页面样式与数据获取

million 1 year ago
parent
commit
02016875ad

File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/ARB.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/AVAX.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/BSC.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/ETH.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/FTM.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/MATIC.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/METIS.svg


File diff suppressed because it is too large
+ 6 - 0
src/assets/layerZero/OP.svg


File diff suppressed because it is too large
+ 2 - 0
src/assets/layerZero/layerZero-white.svg


File diff suppressed because it is too large
+ 2 - 0
src/assets/layerZero/layerZero.svg


+ 22 - 0
src/assets/layerZero/publicChain-white.svg

@@ -0,0 +1,22 @@
+<svg width="100" height="16" viewBox="0 0 100 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_535_294)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.85699V6.89499L7.9475 9.75249L11.1575 7.895V9.5525L12.8855 10.5715V4.85699L7.943 7.71449L3 4.85699Z" fill="white"/>
+<path opacity="0.7" fill-rule="evenodd" clip-rule="evenodd" d="M7.943 2L3 4.857V10.5715L7.943 13.4285L12.8715 10.5715L11.124 9.5525L7.943 11.3905L4.748 9.5525V5.876L7.943 4.038L11.124 5.876L12.8715 4.857L7.943 2Z" fill="white"/>
+</g>
+<path d="M23.898 12.7385L22 12.7515V4.0025H25.081C27.564 4.0025 29.085 5.1595 29.085 7.1875C29.085 9.2935 27.59 10.4375 25.185 10.4375H23.898V12.7385ZM25.133 5.7575H23.898V8.6825H25.133C26.381 8.6825 27.135 8.2015 27.135 7.1875C27.135 6.2255 26.381 5.7575 25.133 5.7575Z" fill="white"/>
+<path d="M33.4021 11.1395C34.3511 11.1395 34.8321 10.2945 34.8321 9.2935V6.3165H36.6781V9.5145C36.6781 11.3995 35.5601 12.9205 33.4021 12.9205C31.2571 12.9205 30.1391 11.3995 30.1391 9.5145V6.3165H31.9851V9.3065C31.9851 10.2945 32.4531 11.1395 33.4021 11.1395Z" fill="white"/>
+<path d="M41.636 12.9335C39.634 12.9335 38.152 11.4905 38.152 9.5405V3.3525H39.998V6.7325C40.479 6.3685 41.09 6.1345 41.74 6.1345C43.742 6.1345 45.12 7.5385 45.12 9.5405C45.12 11.3995 43.625 12.9335 41.636 12.9335ZM41.636 11.1915C42.585 11.1915 43.274 10.4505 43.274 9.5405C43.274 8.6305 42.585 7.8765 41.636 7.8765C40.687 7.8765 39.998 8.6305 39.998 9.5405C39.998 10.4505 40.687 11.1915 41.636 11.1915Z" fill="white"/>
+<path d="M46.6132 3.3525H48.4592V12.7515H46.6132V3.3525Z" fill="white"/>
+<path d="M51.4463 5.3545C50.8223 5.3545 50.3023 4.8475 50.3023 4.2105C50.3023 3.5865 50.8223 3.0665 51.4463 3.0665C52.0703 3.0665 52.5773 3.5865 52.5773 4.2105C52.5773 4.8475 52.0703 5.3545 51.4463 5.3545ZM50.5233 6.3165H52.3693V12.7515H50.5233V6.3165Z" fill="white"/>
+<path d="M57.3065 12.9205C55.3695 12.9335 53.8485 11.3865 53.8485 9.5275C53.8485 7.6555 55.3695 6.1215 57.3065 6.1345C58.5415 6.1475 59.6855 6.7065 60.2705 7.9545L58.7495 8.7865C58.4635 8.2275 57.9435 7.8765 57.3065 7.8765C56.3835 7.8765 55.6945 8.6175 55.6945 9.5275C55.6945 10.4375 56.3835 11.1785 57.3065 11.1785C57.9435 11.1785 58.4635 10.8275 58.7495 10.2685L60.2705 11.1005C59.6855 12.3485 58.5415 12.9075 57.3065 12.9205Z" fill="white"/>
+<path d="M68.1737 12.9205C66.2367 12.9335 64.7157 11.3865 64.7157 9.5275C64.7157 7.6555 66.2367 6.1215 68.1737 6.1345C69.4087 6.1475 70.5527 6.7065 71.1377 7.9545L69.6167 8.7865C69.3307 8.2275 68.8107 7.8765 68.1737 7.8765C67.2507 7.8765 66.5617 8.6175 66.5617 9.5275C66.5617 10.4375 67.2507 11.1785 68.1737 11.1785C68.8107 11.1785 69.3307 10.8275 69.6167 10.2685L71.1377 11.1005C70.5527 12.3485 69.4087 12.9075 68.1737 12.9205Z" fill="white"/>
+<path d="M74.3449 12.7515H72.4989V3.3525H74.3449V6.7065C74.8259 6.3555 75.4629 6.1345 76.1649 6.1345C78.1279 6.1345 79.1549 7.3825 79.1549 9.4105V12.7515L77.3089 12.7385V9.5925C77.3089 8.6825 76.8149 7.8765 75.8789 7.8765C74.9559 7.8765 74.3449 8.6045 74.3449 9.6185V12.7515Z" fill="white"/>
+<path d="M83.5794 12.9205C81.7074 12.9205 80.3944 11.3865 80.3944 9.5145C80.3944 7.6685 81.9024 6.1215 83.8784 6.1215C85.8934 6.1215 87.3754 7.5775 87.3754 9.5145V12.7515H85.6204V11.9975C85.1654 12.5695 84.4634 12.9205 83.5794 12.9205ZM83.8784 11.1915C84.8274 11.1915 85.5294 10.4375 85.5294 9.5275C85.5294 8.6175 84.8274 7.8635 83.8784 7.8635C82.9294 7.8635 82.2404 8.6175 82.2404 9.5275C82.2404 10.4375 82.9294 11.1915 83.8784 11.1915Z" fill="white"/>
+<path d="M90.1035 5.3545C89.4795 5.3545 88.9595 4.8475 88.9595 4.2105C88.9595 3.5865 89.4795 3.0665 90.1035 3.0665C90.7275 3.0665 91.2346 3.5865 91.2346 4.2105C91.2346 4.8475 90.7275 5.3545 90.1035 5.3545ZM89.1805 6.3165H91.0266V12.7515H89.1805V6.3165Z" fill="white"/>
+<path d="M96.1847 7.9285C95.1447 7.9285 94.6767 8.7735 94.6767 9.7615V12.7515H92.8307V9.5405C92.8307 7.6685 93.9357 6.1345 96.1847 6.1345C98.4337 6.1345 99.5647 7.6555 99.5647 9.5405V12.7515H97.7187V9.7615C97.7187 8.7735 97.2377 7.9285 96.1847 7.9285Z" fill="white"/>
+<defs>
+<clipPath id="clip0_535_294">
+<rect width="16" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 22 - 0
src/assets/layerZero/publicChain.svg

@@ -0,0 +1,22 @@
+<svg width="100" height="16" viewBox="0 0 100 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_535_243)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.85699V6.89499L7.9475 9.75249L11.1575 7.895V9.5525L12.8855 10.5715V4.85699L7.943 7.71449L3 4.85699Z" fill="black"/>
+<path opacity="0.7" fill-rule="evenodd" clip-rule="evenodd" d="M7.943 2L3 4.857V10.5715L7.943 13.4285L12.8715 10.5715L11.124 9.5525L7.943 11.3905L4.748 9.5525V5.876L7.943 4.038L11.124 5.876L12.8715 4.857L7.943 2Z" fill="black"/>
+</g>
+<path d="M23.898 12.7385L22 12.7515V4.0025H25.081C27.564 4.0025 29.085 5.1595 29.085 7.1875C29.085 9.2935 27.59 10.4375 25.185 10.4375H23.898V12.7385ZM25.133 5.7575H23.898V8.6825H25.133C26.381 8.6825 27.135 8.2015 27.135 7.1875C27.135 6.2255 26.381 5.7575 25.133 5.7575Z" fill="black"/>
+<path d="M33.4021 11.1395C34.3511 11.1395 34.8321 10.2945 34.8321 9.2935V6.3165H36.6781V9.5145C36.6781 11.3995 35.5601 12.9205 33.4021 12.9205C31.2571 12.9205 30.1391 11.3995 30.1391 9.5145V6.3165H31.9851V9.3065C31.9851 10.2945 32.4531 11.1395 33.4021 11.1395Z" fill="black"/>
+<path d="M41.636 12.9335C39.634 12.9335 38.152 11.4905 38.152 9.5405V3.3525H39.998V6.7325C40.479 6.3685 41.09 6.1345 41.74 6.1345C43.742 6.1345 45.12 7.5385 45.12 9.5405C45.12 11.3995 43.625 12.9335 41.636 12.9335ZM41.636 11.1915C42.585 11.1915 43.274 10.4505 43.274 9.5405C43.274 8.6305 42.585 7.8765 41.636 7.8765C40.687 7.8765 39.998 8.6305 39.998 9.5405C39.998 10.4505 40.687 11.1915 41.636 11.1915Z" fill="black"/>
+<path d="M46.6132 3.3525H48.4592V12.7515H46.6132V3.3525Z" fill="black"/>
+<path d="M51.4463 5.3545C50.8223 5.3545 50.3023 4.8475 50.3023 4.2105C50.3023 3.5865 50.8223 3.0665 51.4463 3.0665C52.0703 3.0665 52.5773 3.5865 52.5773 4.2105C52.5773 4.8475 52.0703 5.3545 51.4463 5.3545ZM50.5233 6.3165H52.3693V12.7515H50.5233V6.3165Z" fill="black"/>
+<path d="M57.3065 12.9205C55.3695 12.9335 53.8485 11.3865 53.8485 9.5275C53.8485 7.6555 55.3695 6.1215 57.3065 6.1345C58.5415 6.1475 59.6855 6.7065 60.2705 7.9545L58.7495 8.7865C58.4635 8.2275 57.9435 7.8765 57.3065 7.8765C56.3835 7.8765 55.6945 8.6175 55.6945 9.5275C55.6945 10.4375 56.3835 11.1785 57.3065 11.1785C57.9435 11.1785 58.4635 10.8275 58.7495 10.2685L60.2705 11.1005C59.6855 12.3485 58.5415 12.9075 57.3065 12.9205Z" fill="black"/>
+<path d="M68.1737 12.9205C66.2367 12.9335 64.7157 11.3865 64.7157 9.5275C64.7157 7.6555 66.2367 6.1215 68.1737 6.1345C69.4087 6.1475 70.5527 6.7065 71.1377 7.9545L69.6167 8.7865C69.3307 8.2275 68.8107 7.8765 68.1737 7.8765C67.2507 7.8765 66.5617 8.6175 66.5617 9.5275C66.5617 10.4375 67.2507 11.1785 68.1737 11.1785C68.8107 11.1785 69.3307 10.8275 69.6167 10.2685L71.1377 11.1005C70.5527 12.3485 69.4087 12.9075 68.1737 12.9205Z" fill="black"/>
+<path d="M74.3449 12.7515H72.4989V3.3525H74.3449V6.7065C74.8259 6.3555 75.4629 6.1345 76.1649 6.1345C78.1279 6.1345 79.1549 7.3825 79.1549 9.4105V12.7515L77.3089 12.7385V9.5925C77.3089 8.6825 76.8149 7.8765 75.8789 7.8765C74.9559 7.8765 74.3449 8.6045 74.3449 9.6185V12.7515Z" fill="black"/>
+<path d="M83.5794 12.9205C81.7074 12.9205 80.3944 11.3865 80.3944 9.5145C80.3944 7.6685 81.9024 6.1215 83.8784 6.1215C85.8934 6.1215 87.3754 7.5775 87.3754 9.5145V12.7515H85.6204V11.9975C85.1654 12.5695 84.4634 12.9205 83.5794 12.9205ZM83.8784 11.1915C84.8274 11.1915 85.5294 10.4375 85.5294 9.5275C85.5294 8.6175 84.8274 7.8635 83.8784 7.8635C82.9294 7.8635 82.2404 8.6175 82.2404 9.5275C82.2404 10.4375 82.9294 11.1915 83.8784 11.1915Z" fill="black"/>
+<path d="M90.1035 5.3545C89.4795 5.3545 88.9595 4.8475 88.9595 4.2105C88.9595 3.5865 89.4795 3.0665 90.1035 3.0665C90.7275 3.0665 91.2346 3.5865 91.2346 4.2105C91.2346 4.8475 90.7275 5.3545 90.1035 5.3545ZM89.1805 6.3165H91.0266V12.7515H89.1805V6.3165Z" fill="black"/>
+<path d="M96.1847 7.9285C95.1447 7.9285 94.6767 8.7735 94.6767 9.7615V12.7515H92.8307V9.5405C92.8307 7.6685 93.9357 6.1345 96.1847 6.1345C98.4337 6.1345 99.5647 7.6555 99.5647 9.5405V12.7515H97.7187V9.7615C97.7187 8.7735 97.2377 7.9285 96.1847 7.9285Z" fill="black"/>
+<defs>
+<clipPath id="clip0_535_243">
+<rect width="16" height="16" fill="white"/>
+</clipPath>
+</defs>
+</svg>

BIN
src/project/layer0/aptosAv.png


BIN
src/project/layer0/aptosBg.png


BIN
src/project/layer0/layerzeroAv.png


BIN
src/project/layer0/layerzeroBg.png


BIN
src/project/layer0/omniAv.png


BIN
src/project/layer0/omniBg.png


BIN
src/project/layer0/omniteAv.png


BIN
src/project/layer0/omniteBg.png


BIN
src/project/layer0/radiantAv.png


BIN
src/project/layer0/radiantBg.png


BIN
src/project/layer0/stargateAv.png


BIN
src/project/layer0/stargateBg.png


BIN
src/project/layer0/tapiocaAv.png


BIN
src/project/layer0/tapiocaBg.png


+ 88 - 0
src/utils/getLayerData.js

@@ -0,0 +1,88 @@
+import axios from "axios";
+
+const netMap = {
+    "bsc": "https://api.bscscan.com",
+    "ftm": "https://api.ftmscan.com",
+    "metis": "https://andromeda-explorer.metis.io",
+    "avax": "https://api.snowtrace.io",
+    "matic": "https://api.polygonscan.com",
+    "arb": "https://api.arbiscan.io",
+    "op": "https://api-optimistic.etherscan.io",
+    "eth": "https://api.etherscan.io"
+}
+const keyMap = {
+    "bsc": ["IHA6XUNGC9A8CS1EVB4ZKMMNCEVWQYWGNF", "35GX1RBQBNKDSS2QFF8YZ9IJ4MUPD8FBV4",
+            "KD21NU93H2696XZGUE6IIZX291V2291WBZ"],
+    "ftm": ["7NS7WM87WNYTDWXFRUP1QFVEGEMEWWTT1R", "JUEKUR5XBG5Z4WQUV71IZHJCPGVWADGHY3",
+            "YCTIQFTS8AXJQVE84CYY2FSGU9JYHWTEMN"],
+    "metis": [null],
+    "avax": ["XZVMR1A53KHXIEZV2X5QYZ2GSYFDDHUGVS", "PX4ZC7BFCMF51E7DC7JKDWERHYCW8JNPM7",
+             "B4XCRBZYZX26NGZG1XJB7UIDGDWF8TYSHT"],
+    "matic": ["5N7B38PZTENUK44XDF3WUPFFN68ICZ87Y3", "SIKU51V7YGAYUZF8HJ7R5FE6WHBP4Z6VEI",
+              "SMIPK99XJR9IXRSSCDHWJB8CT4YKTKJC4E"],
+    "arb": ["FTAT7G2F45P8VNVQG66SGF7T4TS6R2QFGY", "MXKDX8ZX8H5P34WFXFZF1YEPA6X6DDIV5R",
+            "WBCVFF7GVC4XJZFMS3EZJVVPMAH14IT7SU"],
+    "op": ["C8JSVBMBI2NBBYWUJ99ZR2QCQ8GB33NFGB"],
+    "eth": ["FPFT5EGK6F4JS97IA4E8SI24UN559W53VI", "XHSCQN5JZHT4WY1JCATJTN4IDGX2PU6WHH",
+            "ADX2IDIUKD57WAM1GN6YA9E9Y9R3W5CXMC"]
+}
+let txMap = {}
+
+async function getLayerData(address, apiKeyData) {
+    const txMapPromises = Object.keys(netMap).map(async (net) => {
+        try {
+            const u = netMap[net];
+            let k;
+            if (apiKeyData && net in apiKeyData && apiKeyData[net]) {
+                k = apiKeyData[net];
+            } else {
+                const keys = keyMap[net];
+                const index = Math.floor(Math.random() * keys.length);
+                k = keys[index];
+            }
+            let tx = 0;
+            address = address.toLowerCase();
+            let url;
+            if (k === null) {
+                url = `${u}/api?module=account&action=txlist&address=${address}&startblock=0&endblock=99999999&page=1&offset=10000&sort=asc`;
+            } else {
+                url = `${u}/api?module=account&action=txlist&address=${address}&startblock=0&endblock=99999999&page=1&offset=10000&sort=asc&apikey=${k}`;
+            }
+            const res = await axios.get(url);
+            let timeArr = []
+            for (let i = 0; i < res.data.result.length; i++) {
+                const methodId = res.data.result[i].input.slice(0, 10);
+                if (res.data.result[i].from === address && res.data.result[i]['txreceipt_status'] === "1") {
+                    const methodIds =
+                        ["0x9fbf10fc", "0x1114cd2a", "0xc858f5f9", "0x76a9099a", "0x2e15238c", "0xae30f6ee",
+                         "0xc45dec27", "0x2cdf0b95", "0x879762e2", "0x656f3d64", "0x51905636", "0xad660825",
+                         "0xfe359a0d", "0xca23bb4c", "0x00000005"];
+                    if (methodIds.includes(methodId)) {
+                        tx += 1;
+                        timeArr.push(res.data.result[i])
+                    }
+                }
+            }
+            return {net, tx, timeArr};
+        } catch (e) {
+            console.log(e.message);
+            return {net, tx: "0"};
+        }
+    });
+
+    const txMapResults = await Promise.all(txMapPromises);
+    let totalTx = 0;
+    let arr = []
+    txMapResults.forEach(({net, tx , timeArr}) => {
+        if (tx !== "0") {
+            totalTx += tx;
+            arr.push(...timeArr)
+        }
+        txMap[net] = tx;
+    });
+    txMap.arr = arr
+    txMap["total"] = totalTx;
+    return txMap;
+}
+
+export default getLayerData

+ 202 - 178
src/views/HomeView.vue

@@ -7,31 +7,24 @@ import getZksEra from '../utils/getZksEra.js'
 import getZksLite from '../utils/getZksLite.js'
 //@ts-ignore
 import getZkSyncBridge from '../utils/getZkSyncBridge.js'
+//@ts-ignore
+import getLayerData from '../utils/getLayerData.js'
 import * as echarts from 'echarts';
 import {onMounted, ref} from 'vue';
-import balancerBg from '../project/balancer/balancerBg.png'
-import balancerAv from '../project/balancer/balancerAv.png'
-import argentBg from '../project/argent/argentBg.png'
-import argentAv from '../project/argent/argentAv.png'
-import ontoBg from '../project/onto/ontoBg.png'
-import ontoAv from '../project/onto/ontoAv.png'
-import zerionBg from '../project/zerion/zerionBg.png'
-import zerionAv from '../project/zerion/zerionAv.png'
-import zksEraBridgeAv from '../project/zksEraBridge/zksEraBridgeAv.png'
-import zksEraBridgeBg from '../project/zksEraBridge/zksEraBridgeBg.png'
-import zksLiteBridgeBg from '../project/zksLiteBridge/zksLiteBridgeBg.png'
-import zksLiteBridgeAv from '../project/zksLiteBridge/zksLiteBridgeAv.png'
-import orbiterAv from '../project/orbiter/orbiterAv.png'
-import orbiterBg from '../project/orbiter/orbiterBg.png'
-import muteAv from '../project/mute/muteAv.png'
-import muteBg from '../project/mute/muteBg.png'
-import syncswapBg from '../project/syncswap/syncswapBg.png'
-import syncswapAv from '../project/syncswap/syncswapAv.png'
-import getcoinBg from '../project/getcoin/getcoinBg.png'
-import getcoinAv from '../project/getcoin/getcoinAv.png'
-
-
-
+import aptosAv from '../project/layer0/aptosAv.png'
+import aptosBg from '../project/layer0/aptosBg.png'
+import stargateAv from '../project/layer0/stargateAv.png'
+import stargateBg from '../project/layer0/stargateBg.png'
+import radiantAv from '../project/layer0/radiantAv.png'
+import radiantBg from '../project/layer0/radiantBg.png'
+import layerzeroAv from '../project/layer0/layerzeroAv.png'
+import layerzeroBg from '../project/layer0/layerzeroBg.png'
+import tapiocaAv from '../project/layer0/tapiocaAv.png'
+import tapiocaBg from '../project/layer0/tapiocaBg.png'
+import omniAv from '../project/layer0/omniAv.png'
+import omniBg from '../project/layer0/omniBg.png'
+import omniteAv from '../project/layer0/omniteAv.png'
+import omniteBg from '../project/layer0/omniteBg.png'
 
 type EChartsOption = echarts.EChartsOption;
 
@@ -50,46 +43,53 @@ type dataArrType = {
 }[]
 let dataArr: dataArrType = [
   {
-    name: 'zks-era bridge',
-    type: ['OFFICAL','BRIDGE'],
-    BG: zksEraBridgeBg,
-    avatar: zksEraBridgeAv,
-    url:'https://bridge.zksync.io/'
+    name: 'Stargate',
+    type: ['Offical','Bridge'],
+    BG: stargateBg,
+    avatar: stargateAv,
+    url:'https://stargate.finance/'
   },
   {
-    name: 'zks-lite bridge',
-    type: ['OFFICAL','BRIDGE'],
-    BG: zksLiteBridgeBg,
-    avatar: zksLiteBridgeAv,
-    url:'https://lite.zksync.io/transaction/deposit'
+    name: 'aptos',
+    type: ['Bridge'],
+    BG: aptosBg,
+    avatar: aptosAv,
+    url:'https://theaptosbridge.com/'
   },
   {
-    name: 'Orbiter',
-    type: ['ERA', 'SWAP'],
-    BG: orbiterBg,
-    avatar: orbiterAv,
-    url:'https://www.orbiter.finance/'
+    name: 'Radiant Capital',
+    type: ['DeFi'],
+    BG: radiantBg,
+    avatar: radiantAv,
+    url:'https://radiant.capital/'
   },
   {
-    name: 'Mute',
-    type: ['ERA', 'DEFI', 'SWAP'],
-    BG: muteBg,
-    avatar: muteAv,
-    url:'https://app.mute.io/swap'
+    name: 'LayerZero Name Service',
+    type: ['Digitalid ID'],
+    BG: layerzeroBg,
+    avatar: layerzeroAv,
+    url:'https://www.lz.domains/'
   },
   {
-    name: 'Syncswap',
-    type: ['ERA', 'SWAP'],
-    BG: syncswapBg,
-    avatar: syncswapAv,
-    url:'https://syncswap.xyz/'
+    name: 'TapiocaDAO',
+    type: ['DeFi'],
+    BG: tapiocaBg,
+    avatar: tapiocaAv,
+    url:'https://www.tapioca.xyz/'
   },
   {
-    name: 'Gitcoin',
-    type: ['DEFI', 'SWAP'],
-    BG: getcoinBg,
-    avatar: getcoinAv,
-    url:'https://bounties.gitcoin.co/'
+    name: 'Omni X',
+    type: ['NFT', 'Bridge'],
+    BG: omniBg,
+    avatar: omniAv,
+    url:'https://omni-x.io/'
+  },
+  {
+    name: 'Omnite',
+    type: ['NFT'],
+    BG: omniteBg,
+    avatar: omniteAv,
+    url:'https://omnite.io/'
   },
 ]
 
@@ -114,11 +114,12 @@ const listeningDisconnect = () => {
 const checkWalletAddress = async () => {
   let accounts: string[] = await MM.value.request({method: 'eth_accounts'});//不弹窗
   address.value = accounts[0]
-  getMainTx()
-  getLiteTx()
-  getMoreInfo()
-  await addChain()
-  await switchEthereumChain()
+  // getMainTx()
+  // getLiteTx()
+  // getMoreInfo()
+  getLayerInfo()
+  // await addChain()
+  // await switchEthereumChain()
 }
 //添加链
 const addChain = () => {
@@ -152,11 +153,12 @@ const switchEthereumChain = () => {
 const connectWallet = async () => {
   let accounts: string[] = await MM.value.request({method: 'eth_requestAccounts'});
   address.value = accounts[0]
-  getMainTx()
-  getLiteTx()
-  getMoreInfo()
-  await addChain()
-  await switchEthereumChain()
+  // getMainTx()
+  // getLiteTx()
+  // getMoreInfo()
+  getLayerInfo()
+  // await addChain()
+  // await switchEthereumChain()
 }
 //获取主网交易次数
 let mainTx = ref(0)
@@ -201,6 +203,26 @@ const getMoreInfo = () => {
     processTime()
   })
 }
+//获得layer信息
+let apiKey = null
+let layerInfo = ref({})
+const getLayerInfo = () => {
+  getLayerData('0x7E43BD38A0D67807887e459f0316395650cBb4C3',apiKey).then(({arb, avax, bsc, eth, ftm, matic, metis, op, total, arr}) => {
+    layerInfo.value = {
+      arb: arb,
+      avax: avax,
+      bsc: bsc,
+      eth: eth,
+      ftm: ftm,
+      matic: matic,
+      metis: metis,
+      op: op,
+      total: total,
+      arr:arr
+    }
+    processTime()
+  })
+}
 //处理时间数据
 const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
 let showMonthNumberArr = ref([0,0,0,0,0,0,0,0,0,0,0,0])
@@ -223,15 +245,26 @@ const processTime = () => {
       forLoop()
     }
   }
-  if (tradingTimeArr.value){
-    tradingTimeArr.value.forEach((item:any) => {
-      if(item.balanceChanges[0].from && item.balanceChanges[0].from.toLowerCase() === address.value.toLowerCase()){
-        let receivedAt = new Date(Date.parse(item.receivedAt)).toString();
-        let strArr = receivedAt.split(' ')
-        let month = strArr[1]
-        let index = showMonthArr.value.indexOf(month)
-        showMonthNumberArr.value[index]++
-      }
+  // if (tradingTimeArr.value){
+  //   tradingTimeArr.value.forEach((item:any) => {
+  //     if(item.balanceChanges[0].from && item.balanceChanges[0].from.toLowerCase() === address.value.toLowerCase()){
+  //       let receivedAt = new Date(Date.parse(item.receivedAt)).toString();
+  //       let strArr = receivedAt.split(' ')
+  //       let month = strArr[1]
+  //       let index = showMonthArr.value.indexOf(month)
+  //       showMonthNumberArr.value[index]++
+  //     }
+  //   })
+  // }
+  if(layerInfo.value.arr){
+    layerInfo.value.arr.forEach((item:any) => {
+      let timestamp = parseFloat(item.timeStamp) * 1000; // 时间戳(以毫秒为单位)
+      let date = new Date(timestamp);
+      let dateString = date.toDateString();
+      let strArr = dateString.split(' ')
+      let month = strArr[1]
+      let index = showMonthArr.value.indexOf(month)
+      showMonthNumberArr.value[index]++
     })
   }
 
@@ -299,8 +332,8 @@ const sunAndMoon = () => {
     document.documentElement.style.setProperty('--color-text','#181818')
   }
   sun.value = !sun.value
-
 }
+
 </script>
 
 <template>
@@ -333,11 +366,11 @@ const sunAndMoon = () => {
       <div class="item">
         <div class="top">
           <div class="img">
-            <img v-show="!sun" src="../assets/group1-white.svg" alt="group1">
-            <img v-show="sun" src="../assets/group1.svg" alt="group1">
+            <img v-show="!sun" src="../assets/layerZero/layerZero-white.svg" alt="group1">
+            <img v-show="sun" src="../assets/layerZero/layerZero.svg" alt="group1">
           </div>
           <div class="title">
-            Protocols lnteraction
+            Total Transactions
             <el-popover
                 placement="bottom"
                 :width="230"
@@ -357,107 +390,89 @@ const sunAndMoon = () => {
           </div>
         </div>
         <div class="number">
-          {{ contract }}
+          {{ layerInfo.total || 0 }}
         </div>
       </div>
-      <div class="item">
+      <div class="item" style="gap:6px;">
         <div class="top">
           <div class="img">
-            <img v-show="!sun" class="img" src="../assets/group3-white.svg" alt="group2">
-            <img v-show="sun" class="img" src="../assets/group3.svg" alt="group2">
-          </div>
-          <div class="title">
-            Total Transactions
-            <el-popover
-                placement="bottom"
-                :width="250"
-                trigger="hover"
-                effect="dark"
-            >
-              <template #reference>
-                <img src="../assets/info.svg" alt="info">
-              </template>
-              <div class="popoverText">
-                Total zkSync lite
-              </div>
-              <div class="popoverText">
-                transactions issuedfrom the account
-              </div>
-            </el-popover>
+            <img v-show="!sun" src="../assets/layerZero/publicChain-white.svg" alt="group1">
+            <img v-show="sun" src="../assets/layerZero/publicChain.svg" alt="group1">
           </div>
         </div>
-        <div class="number">
-          {{ liteTx }}
-          <img @click="toLink('https://zkscan.io/')" style="cursor: pointer" src="../assets/arrow-right-up-line.svg" alt="arrow">
-        </div>
-      </div>
-      <div class="item">
-        <div class="top">
-          <div class="img">
-            <img v-show="!sun" class="img" src="../assets/group2-white.svg" alt="group2">
-            <img v-show="sun" class="img" src="../assets/group2.svg" alt="group2">
+        <div class="publicChainBox">
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/ETH.svg" alt="ETH">
+              ETH
+            </div>
+            <div class="number">
+              {{ layerInfo.eth || 0 }}
+            </div>
           </div>
-          <div class="title">
-            Total Transactions
-            <el-popover
-                placement="bottom"
-                :width="250"
-                trigger="hover"
-                effect="dark"
-            >
-              <template #reference>
-                <img src="../assets/info.svg" alt="info">
-              </template>
-              <div class="popoverText">
-                Total zkSync era
-              </div>
-              <div class="popoverText">
-                transactions issuedfrom the account
-              </div>
-            </el-popover>
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/MATIC.svg" alt="ETH">
+              MATIC
+            </div>
+            <div class="number">
+              {{ layerInfo.matic || 0 }}
+            </div>
           </div>
-        </div>
-        <div class="number">
-          {{ mainTx }}
-          <img @click="toLink('https://explorer.zksync.io/')" style="cursor: pointer" src="../assets/arrow-right-up-line.svg" alt="arrow">
-        </div>
-      </div>
-      <div class="item" style="height: 94px">
-        <div class="top">
-          <div class="img">
-            <img v-show="!sun" class="img" src="../assets/official-bridge-white.svg" alt="group2">
-            <img v-show="sun" class="img" src="../assets/official-bridge-black.svg" alt="group2">
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/BSC.svg" alt="ETH">
+              BSC
+            </div>
+            <div class="number">
+              {{ layerInfo.bsc || 0 }}
+            </div>
           </div>
-          <div style="display: flex;gap:40px">
-            <div style="display: flex;flex-direction: column;gap:20px">
-              <img v-show="!sun" src="../assets/L1-To-L2-white.svg" alt="To">
-              <img v-show="sun" src="../assets/L1-To-L2.svg" alt="To">
-              <div class="number">
-                {{ l1Tol2Tx }}
-              </div>
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/ARB.svg" alt="ETH">
+              ARB
             </div>
-            <div style="display: flex;flex-direction: column;gap:20px">
-              <img v-show="!sun" src="../assets/L2-To-L1-white.svg" alt="To">
-              <img v-show="sun" src="../assets/L2-To-L1.svg" alt="To">
-              <div class="number">
-                {{ l2Tol1Tx }}
-              </div>
+            <div class="number">
+              {{ layerInfo.arb || 0 }}
             </div>
           </div>
-        </div>
-
-      </div>
-      <div class="item">
-        <div class="top">
-          <div class="img">
-            <img class="img" src="../assets/group4.svg" alt="group2">
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/OP.svg" alt="ETH">
+              OP
+            </div>
+            <div class="number">
+              {{ layerInfo.op || 0 }}
+            </div>
           </div>
-          <div class="title">
-            Total amount spent
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/AVAX.svg" alt="ETH">
+              AVAX
+            </div>
+            <div class="number">
+              {{ layerInfo.avax || 0 }}
+            </div>
+          </div>
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/FTM.svg" alt="ETH">
+              FTM
+            </div>
+            <div class="number">
+              {{ layerInfo.ftm || 0 }}
+            </div>
+          </div>
+          <div class="publicChainItem">
+            <div class="title">
+              <img src="../assets/layerZero/METIS.svg" alt="ETH">
+              METIS
+            </div>
+            <div class="number">
+              {{ layerInfo.metis || 0 }}
+            </div>
           </div>
-        </div>
-        <div class="number">
-          {{ amount }} USDT
         </div>
       </div>
     </div>
@@ -599,13 +614,13 @@ const sunAndMoon = () => {
   .dataColumn {
     display: flex;
     align-items: center;
-    justify-content: space-between;
+    //justify-content: space-between;
     padding: 75px 60px 60px 60px;
     border-bottom: 1px solid #f7f7f7;
     margin: 0 -60px;
 
     .item {
-      width: 330px;
+      width: 260px;
       display: flex;
       flex-direction: column;
       gap: 20px;
@@ -618,21 +633,30 @@ const sunAndMoon = () => {
         .img {
           height: 16px;
         }
-
-        .title {
+      }
+      .publicChainBox{
+        display: flex;
+        align-items: center;
+        gap:88px;
+        .publicChainItem{
           display: flex;
-          align-items: center;
-          gap: 8px;
+          flex-direction: column;
+          gap:20px;
+        }
+      }
+      .title {
+        display: flex;
+        align-items: center;
+        gap: 8px;
+        font-weight: 400;
+        font-size: 14px;
+        line-height: 18px;
+        //color: #010101;
+        font-family: 'HONOR Sans CN';
+        .popoverText{
           font-weight: 400;
-          font-size: 14px;
-          line-height: 18px;
-          //color: #010101;
-          font-family: 'HONOR Sans CN';
-          .popoverText{
-            font-weight: 400;
-            font-size: 12px;
-            line-height: 24px;
-          }
+          font-size: 12px;
+          line-height: 24px;
         }
       }
 

Some files were not shown because too many files changed in this diff