From 4f1e5eef7d589ba4a462fdc33619c1d9529ea5c1 Mon Sep 17 00:00:00 2001 From: MickWang <1244134672@qq.com> Date: Wed, 1 May 2024 17:09:23 +0800 Subject: [PATCH 1/3] add thried party bridge for deposit --- .../transaction/DepositThirdPartyBridge.vue | 179 ++++++++++++++++++ views/transactions/Deposit.vue | 3 + 2 files changed, 182 insertions(+) create mode 100644 components/transaction/DepositThirdPartyBridge.vue diff --git a/components/transaction/DepositThirdPartyBridge.vue b/components/transaction/DepositThirdPartyBridge.vue new file mode 100644 index 00000000..e582f5ca --- /dev/null +++ b/components/transaction/DepositThirdPartyBridge.vue @@ -0,0 +1,179 @@ + + + diff --git a/views/transactions/Deposit.vue b/views/transactions/Deposit.vue index 15a7c380..fcb1268d 100644 --- a/views/transactions/Deposit.vue +++ b/views/transactions/Deposit.vue @@ -425,6 +425,7 @@ + @@ -482,6 +483,8 @@ import { TransitionAlertScaleInOutTransition, TransitionOpacity } from "@/utils/ import DepositSubmitted from "@/views/transactions/DepositSubmitted.vue"; import { ETH_ADDRESS, WMNT_CONTRACT } from "@/zksync-web3-nova/src/utils"; +import DepositThirdPartyBridge from "@/components/transaction/DepositThirdPartyBridge.vue"; + // const okxIcon = "/img/okx-cryptopedia.svg"; const launchIcon = "/img/launch.svg"; const { zkSyncNetworks } = useNetworks(); From a2955fe713e4627e86f22b68651480bced80f0b9 Mon Sep 17 00:00:00 2001 From: MickWang <1244134672@qq.com> Date: Wed, 1 May 2024 18:00:31 +0800 Subject: [PATCH 2/3] update ui --- .../transaction/DepositThirdPartyBridge.vue | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/components/transaction/DepositThirdPartyBridge.vue b/components/transaction/DepositThirdPartyBridge.vue index e582f5ca..d34a5e16 100644 --- a/components/transaction/DepositThirdPartyBridge.vue +++ b/components/transaction/DepositThirdPartyBridge.vue @@ -39,15 +39,17 @@ import { ref } from "vue"; import { ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline"; import { $fetch } from "ofetch"; -import { useOnboardStore } from "@/store/onboard"; - -const onboardStore = useOnboardStore(); - const handleLink = (link: string) => { window.open(link, "_blank"); }; const ThirdPartyBridges = [ + { + name: "Meson Finance", + logo: "/img/Meson.svg", + bannerImg: "Meson.jpg", + url: "https://meson.fi/zklink", + }, { name: "Owlto Finance", logo: "/img/owlto.svg", @@ -60,29 +62,20 @@ const ThirdPartyBridges = [ bannerImg: "Symbiosys.jpg", url: "https://app.symbiosis.finance/swap?chainIn=Ethereum&chainOut=ZkLink&tokenIn=ETH&tokenOut=ETH", }, - { - name: "Meson Finance", - logo: "/img/Meson.svg", - bannerImg: "Meson.jpg", - url: "https://meson.fi/zklink", - }, ]; const bridgePoints = ref(ThirdPartyBridges.map((item) => ({ ...item, points: 0 }))); -const API_URL = "https://app-api.zklink.io/lrt-points/nova/points/project"; +const API_URL = "https://app-api.zklink.io/lrt-points/cache/bridge/latest/points"; const fetchBridgePoints = async () => { - if (!onboardStore.account) return; - const points = (await Promise.all([ - $fetch(API_URL, { params: { address: onboardStore.account.address, project: "owlet" } }), - $fetch(API_URL, { params: { address: onboardStore.account.address, project: "symbiosis" } }), - $fetch(API_URL, { params: { address: onboardStore.account.address, project: "meson" } }), + $fetch(API_URL, { params: { name: "meson" } }), + $fetch(API_URL, { params: { name: "owlet" } }), + $fetch(API_URL, { params: { name: "symbiosis" } }), ])) as any[]; console.log(points, "points"); const _bridgePoints = bridgePoints.value; for (let i = 0; i < points.length; i++) { const { data } = points[i]; - const novaPoints = data.reduce((prev, item) => prev + Number(item.points), 0); - _bridgePoints[i].points = novaPoints.toFixed(2); + _bridgePoints[i].points = data; } bridgePoints.value = _bridgePoints; }; @@ -102,17 +95,17 @@ fetchBridgePoints(); margin-bottom: 1rem; } .deposit-thrid-bridge-item:hover { - background: #032e3f; + background: #343a44; } .deposit-thrid-bridge-item { cursor: pointer; border-radius: 16px; - background: #011c26; + background: #262b33; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem; - margin-bottom: 1rem; + margin-bottom: 24px; .left { display: flex; align-items: center; @@ -145,7 +138,7 @@ fetchBridgePoints(); display: flex; align-items: center; justify-content: flex-end; - font-size: 14px; + font-size: 16px; } } } From b38f26a7331a3f4a5b183250649e3cb020a231e4 Mon Sep 17 00:00:00 2001 From: MickWang <1244134672@qq.com> Date: Wed, 1 May 2024 22:36:36 +0800 Subject: [PATCH 3/3] update ui for mobile --- components/transaction/DepositThirdPartyBridge.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/transaction/DepositThirdPartyBridge.vue b/components/transaction/DepositThirdPartyBridge.vue index d34a5e16..6eb20fdf 100644 --- a/components/transaction/DepositThirdPartyBridge.vue +++ b/components/transaction/DepositThirdPartyBridge.vue @@ -13,7 +13,7 @@

{{ item.name }}

Bridge more than 0.1 ETH/ 500USDT /500 USDC to Nova to earn Nova Points. - +

You can earn Nova Points for each transaction of bridging to Nova over 0.1 ETH/ 500USDT /500 USDC @@ -27,7 +27,7 @@
- {{ item.points }} Nova Points + {{ item.points }} Nova Points
@@ -132,13 +132,13 @@ fetchBridgePoints(); font-weight: 400; line-height: normal; letter-spacing: -0.5px; + margin-right: 20px; } } .right { display: flex; align-items: center; justify-content: flex-end; - font-size: 16px; } } }