Skip to content

Commit a5efc68

Browse files
authored
feat: added bridge link for vASTR and added Stargate in the Bridge page (#1443)
* feat: updated styling of the bridge select page * feat: added placeholder links * feat: added vASTR link * fix: updated bridge card title to Stargate
1 parent 8fe0d5d commit a5efc68

File tree

8 files changed

+93
-11
lines changed

8 files changed

+93
-11
lines changed

src/assets/img/logo-stargate.webp

17.9 KB
Binary file not shown.

src/components/assets/Erc20Currency.vue

+14
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,20 @@
9292
</custom-router-link>
9393
</div>
9494

95+
<div v-else>
96+
<custom-router-link
97+
v-if="token.bridgeUrl"
98+
:to="token.bridgeUrl"
99+
:is-disabled="!isBridgeEnabled(token.bridgeUrl)"
100+
>
101+
<button class="btn btn--icon"><astar-icon-bridge class="icon--bridge" /></button>
102+
<span class="text--expand-menu">{{ $t('assets.bridge') }}</span>
103+
<q-tooltip>
104+
<span class="text--tooltip">{{ $t('assets.bridge') }}</span>
105+
</q-tooltip>
106+
</custom-router-link>
107+
</div>
108+
95109
<a :href="explorerLink" target="_blank" rel="noopener noreferrer">
96110
<button class="btn btn--icon">
97111
<astar-icon-external-link class="icon--external-link" />

src/components/bridge/BridgeSelection.vue

+36-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="container--title">
55
<span>{{ $t('bridge.selectBridge') }}</span>
66
</div>
7-
<div class="container--selection">
7+
<div class="container--bridges">
88
<div class="column--selection">
99
<button :disabled="!isEnableCcipBridge">
1010
<component
@@ -92,6 +92,37 @@
9292
</button>
9393
</div>
9494

95+
<div class="column--selection">
96+
<button
97+
:disabled="!stargateBridgeEnabled"
98+
class="button--bridge"
99+
@click="navigateInNewTab(stargateBridgeLink)"
100+
>
101+
<div class="row--logo-bg">
102+
<div class="img--logo-bg">
103+
<img
104+
class="img--logo-stargate"
105+
:src="require('src/assets/img/logo-stargate.webp')"
106+
alt="stargate"
107+
/>
108+
</div>
109+
</div>
110+
<div class="row--bridge-title">
111+
<div class="text--bridge-tag">
112+
<q-chip outline>
113+
{{ $t('bridge.stargateBridge.tag') }}
114+
</q-chip>
115+
</div>
116+
<span class="text--bridge-title">{{ $t('bridge.stargateBridge.title') }}</span>
117+
<div class="box--text-bridge">
118+
<span class="text--bridge">
119+
{{ $t('bridge.stargateBridge.text') }}
120+
</span>
121+
</div>
122+
</div>
123+
</button>
124+
</div>
125+
95126
<div class="column--selection">
96127
<button
97128
:disabled="!celerBridgeEnabled"
@@ -129,8 +160,6 @@
129160
{{ $t('bridge.celerBridge.warning') }}
130161
</p>
131162
</div>
132-
</div>
133-
<div class="container--selection">
134163
<div class="column--selection">
135164
<button :disabled="!isEnableEthBridge">
136165
<component
@@ -252,10 +281,12 @@ import {
252281
layerZeroBridgeEnabled,
253282
ccipSoneiumBridgeEnabled,
254283
nativeBridgeEnabled,
284+
stargateBridgeEnabled,
255285
} from 'src/features';
256286
import { useAccount, useNetworkInfo } from 'src/hooks';
257287
import { EthBridgeNetworkName } from 'src/modules/zk-evm-bridge';
258288
import { layerSwapLink, zKatanaBridgeUrl } from 'src/modules/zk-evm-bridge/index';
289+
import { stargateBridgeLink } from 'src/links/index';
259290
import {
260291
Path as RoutePath,
261292
buildCcipBridgePageLink,
@@ -323,9 +354,11 @@ export default defineComponent({
323354
layerSwapBridgeEnabled,
324355
nativeBridgeEnabled,
325356
layerZeroBridgeEnabled,
357+
stargateBridgeEnabled,
326358
isEnableCcipBridge,
327359
isShibuyaEvm,
328360
isAstarEvm,
361+
stargateBridgeLink,
329362
buildEthereumBridgePageLink,
330363
buildLzBridgePageLink,
331364
navigateInNewTab,

src/components/bridge/styles/bridge-selection.scss

+25-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
@media (min-width: $xl) {
1818
margin-top: 0px;
1919
margin-bottom: 0px;
20+
align-items: end;
21+
margin-right: -40px;
22+
margin-top: -36px;
2023
}
2124
}
2225

@@ -31,17 +34,26 @@
3134

3235
.container--box {
3336
@media (min-width: $xl) {
34-
position: absolute;
35-
right: -40px;
36-
top: -36px;
37-
height: calc(100vh - 98px);
38-
padding-right: 168px;
37+
display: flex;
38+
flex-direction: column;
39+
margin-bottom: 36px;
40+
padding-right: 130px;
3941
padding-left: 48px;
40-
padding-top: 58px;
42+
padding-top: 24px;
4143
box-shadow: 0px 2px 8px 0px #00000014;
4244
}
4345
}
4446

47+
.container--bridges {
48+
@media (min-width: $md) {
49+
display: grid;
50+
column-gap: 20px;
51+
grid-template-columns: repeat(3, 1fr);
52+
justify-content: center;
53+
align-items: center;
54+
}
55+
}
56+
4557
.container--selection {
4658
display: flex;
4759
flex-direction: column;
@@ -61,6 +73,8 @@
6173
}
6274
@media (min-width: $sm) {
6375
width: 240px;
76+
// Memo: to adjust the height to line up the buttons
77+
min-height: 300px;
6478
}
6579
}
6680

@@ -117,6 +131,11 @@
117131
height: 32px;
118132
}
119133

134+
.img--logo-stargate {
135+
width: 40px;
136+
height: 40px;
137+
}
138+
120139
.img--logo-astr {
121140
height: 48px;
122141
}

src/features.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const celerBridgeEnabled = true;
66
export const omniBridgeEnabled = true;
77
export const ccipMinatoBridgeEnabled = true;
88
export const ccipSoneiumBridgeEnabled = true;
9-
const stargateBridgeEnabled = true;
9+
export const stargateBridgeEnabled = true;
1010
const stakeStoneBridgeEnabled = true;
1111
const arthSwapBridgeEnabled = true;
1212

src/i18n/en-US/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,11 @@ export default {
11051105
text: 'Transfer assets between Astar EVM and Astar zkEVM.',
11061106
remark: 'Available on Astar zkEVM and Astar EVM. Switch the network to use it.',
11071107
},
1108+
stargateBridge: {
1109+
title: 'Stargate Bridge',
1110+
tag: 'ERC20',
1111+
text: '3rd Party Bridge. Transfer assets between Soneium and Astar EVM.',
1112+
},
11081113
celerBridge: {
11091114
title: 'Celer Bridge',
11101115
tag: 'ERC20',

src/links/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ export const getEvmExplorerUrl = async (hash: string, web3: Web3): Promise<strin
8181
const blockExplorerUrl = blockExplorerUrls[connectedChainId];
8282
return `${blockExplorerUrl}/tx/${hash}`;
8383
};
84+
85+
export const vastrBridgeLink =
86+
'https://stargate.finance/bridge?srcChain=astar&srcToken=0xfffFffff00000000000000010000000000000010&dstChain=soneium&dstToken=0x60336f9296C79dA4294A19153eC87F8E52158e5F';
87+
88+
export const stargateBridgeLink = 'https://stargate.finance/bridge';

src/modules/token/utils/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Erc20Token, registeredErc20Tokens, tokenImageMap } from 'src/modules/to
66
import { xcmToken } from 'src/modules/xcm';
77
import { Asset } from 'src/v2/models';
88
import { hasProperty } from '@astar-network/astar-sdk-core';
9+
import { vastrBridgeLink } from 'src/links';
910

1011
export const getTokenImage = ({
1112
isNativeToken,
@@ -171,6 +172,11 @@ export const getRegisteredErc20Tokens = ({
171172
const xc20Tokens = xcmToken[network].map((it) => {
172173
try {
173174
const asset = assets.find((that) => that.id === it.assetId) as Asset;
175+
let bridgeUrl = null;
176+
if (it.symbol === 'vASTR') {
177+
bridgeUrl = vastrBridgeLink;
178+
}
179+
174180
return {
175181
srcChainId: Number(providerEndpoints[network].evmChainId),
176182
address: asset.mappedERC20Addr,
@@ -180,7 +186,7 @@ export const getRegisteredErc20Tokens = ({
180186
image: it.logo,
181187
isWrappedToken: false,
182188
isXC20: true,
183-
bridgeUrl: null,
189+
bridgeUrl,
184190
};
185191
} catch (error) {
186192
console.error(error);

0 commit comments

Comments
 (0)