forked from JackHamer09/zksync-plus
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add list of custom bridges for tokens (#168)
- Loading branch information
1 parent
247adcc
commit 9c26047
Showing
10 changed files
with
143 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div> | ||
<CommonAlert variant="warning" size="sm" :icon="ExclamationTriangleIcon" class="mb-block-gap"> | ||
<p>{{ customBridgeToken.symbol }} token requires use of a custom bridge</p> | ||
</CommonAlert> | ||
<TypographyCategoryLabel> | ||
Use 3rd party bridges or CEXs to bridge {{ customBridgeToken.symbol }} to | ||
{{ type === "deposit" ? eraNetwork.name : eraNetwork.l1Network?.name }}. | ||
</TypographyCategoryLabel> | ||
<CommonCardWithLineButtons> | ||
<DestinationItem | ||
v-for="(item, index) in displayedBridges" | ||
:key="index" | ||
:label="item.label" | ||
:icon-url="item.iconUrl" | ||
:href="item.href!" | ||
:icon="ArrowTopRightOnSquareIcon" | ||
as="a" | ||
target="_blank" | ||
/> | ||
</CommonCardWithLineButtons> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ExclamationTriangleIcon, ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline"; | ||
import { type CustomBridgeToken } from "@/data/customBridgeTokens"; | ||
const props = defineProps({ | ||
customBridgeToken: { | ||
type: Object as PropType<CustomBridgeToken>, | ||
required: true, | ||
}, | ||
type: { | ||
type: String as PropType<"deposit" | "withdraw">, | ||
required: true, | ||
}, | ||
}); | ||
const { eraNetwork } = storeToRefs(useZkSyncProviderStore()); | ||
const displayedBridges = computed(() => { | ||
if (props.type === "deposit") { | ||
return props.customBridgeToken.bridges | ||
.map((e) => ({ | ||
...e, | ||
href: e.depositUrl, | ||
})) | ||
.filter((e) => e.href); | ||
} | ||
return props.customBridgeToken.bridges | ||
.map((e) => ({ | ||
...e, | ||
href: e.withdrawUrl, | ||
})) | ||
.filter((e) => e.href); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,49 @@ | ||
type CustomBridgeToken = { | ||
export type CustomBridgeToken = { | ||
chainId: number; | ||
l1Address: string; | ||
l2Address: string; | ||
bridgeName: string; | ||
bridgeUrlDeposit: string; | ||
bridgeUrlWithdraw: string; | ||
symbol: string; | ||
bridges: { | ||
label: string; | ||
iconUrl: string; | ||
depositUrl?: string; | ||
withdrawUrl?: string; | ||
}[]; | ||
}; | ||
|
||
export const customBridgeTokens: CustomBridgeToken[] = [ | ||
{ | ||
chainId: 1, | ||
l1Address: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", | ||
l2Address: "0x703b52F2b28fEbcB60E1372858AF5b18849FE867", | ||
bridgeName: "txSync Bridge", | ||
bridgeUrlDeposit: "https://portal.txsync.io/bridge/?token=0x703b52F2b28fEbcB60E1372858AF5b18849FE867", | ||
bridgeUrlWithdraw: "https://portal.txsync.io/bridge/withdraw/?token=0x703b52F2b28fEbcB60E1372858AF5b18849FE867", | ||
bridges: [ | ||
{ | ||
label: "txSync Bridge", | ||
iconUrl: "/img/txsync.png", | ||
depositUrl: "https://portal.txsync.io/bridge/?token=0x703b52F2b28fEbcB60E1372858AF5b18849FE867", | ||
withdrawUrl: "https://portal.txsync.io/bridge/withdraw/?token=0x703b52F2b28fEbcB60E1372858AF5b18849FE867", | ||
}, | ||
], | ||
symbol: "wstETH", | ||
}, | ||
{ | ||
chainId: 1, | ||
l1Address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", | ||
l2Address: "0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4", | ||
bridges: [ | ||
{ | ||
label: "Orbiter", | ||
iconUrl: "/img/orbiter.svg", | ||
depositUrl: "https://www.orbiter.finance/?source=Ethereum&dest=zkSync%20Era&token=USDC", | ||
withdrawUrl: "https://www.orbiter.finance/?source=zkSync%20Era&dest=Ethereum&token=USDC", | ||
}, | ||
{ | ||
label: "Symbiosis", | ||
iconUrl: "/img/symbiosis.svg", | ||
depositUrl: "https://app.symbiosis.finance/bridge", | ||
withdrawUrl: "https://app.symbiosis.finance/bridge", | ||
}, | ||
], | ||
symbol: "USDC", | ||
}, | ||
]; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters