32
32
</div >
33
33
</div >
34
34
35
- <div class =" row__actions" >
35
+ <div class =" row__actions-evm " >
36
36
<router-link :to =" buildTransferPageLink(nativeTokenSymbol)" >
37
37
<button class =" btn btn--icon" >
38
38
<astar-icon-transfer />
46
46
<div class =" box--ccip" >
47
47
<custom-router-link
48
48
v-if =" isShibuyaEvm || isAstarEvm"
49
- :to =" buildCcipBridgePageLink() "
50
- :is-disabled =" !isEnableCcipBridge "
49
+ :to =" ccipSoneiumLink "
50
+ :is-disabled =" !isEnableSoneiumCcipBridge "
51
51
>
52
52
<button
53
53
v-if =" width >= screenSize.sm"
60
60
:src ="
61
61
isSoneiumButtonHover
62
62
? require('src/assets/img/chain/soneium-white.svg')
63
- : require('src/assets/img/chain/soneium-color .svg')
63
+ : require('src/assets/img/chain/soneium-blue .svg')
64
64
"
65
65
alt =" soneium"
66
66
/>
77
77
<span class =" text--tooltip" >{{ $t('assets.bridgeToSoneium') }}</span >
78
78
</q-tooltip >
79
79
</custom-router-link >
80
+ </div >
81
+
82
+ <div class =" box--ccip" >
83
+ <custom-router-link
84
+ v-if =" isShibuyaEvm || isAstarEvm"
85
+ :to =" ccipEthereumLink"
86
+ :is-disabled =" !isEnableEthereumCcipBridge"
87
+ >
88
+ <button
89
+ v-if =" width >= screenSize.sm"
90
+ class =" btn btn--icon"
91
+ @mouseover =" isEthereumButtonHover = true"
92
+ @mouseleave =" isEthereumButtonHover = false"
93
+ >
94
+ <img
95
+ class =" img--logo-soneium"
96
+ :src ="
97
+ isEthereumButtonHover
98
+ ? require('src/assets/img/chain/ethereum-white.svg')
99
+ : require('src/assets/img/chain/ethereum-blue.svg')
100
+ "
101
+ alt =" ethereum"
102
+ />
103
+ </button >
104
+ <button v-else class =" btn btn--icon" >
105
+ <img
106
+ class =" img--logo-soneium"
107
+ :src =" require('src/assets/img/chain/ethereum-white.svg')"
108
+ alt =" ethereum"
109
+ />
110
+ </button >
111
+ <span class =" text--mobile-menu" >{{ $t('assets.bridgeToEthereum') }}</span >
112
+ <q-tooltip >
113
+ <span class =" text--tooltip" >{{ $t('assets.bridgeToEthereum') }}</span >
114
+ </q-tooltip >
115
+ </custom-router-link >
80
116
<balloon
81
117
class =" balloon--ccip"
82
118
direction =" top"
83
- :is-balloon =" isCcipBalloon "
119
+ :is-balloon =" isCcipEthereumBalloon "
84
120
:is-balloon-closing =" isBalloonClosing"
85
- :handle-close-balloon =" closeCcipBalloon "
86
- :text =" $t('assets.bridgeToSoneium ')"
121
+ :handle-close-balloon =" closeCcipEthereumBalloon "
122
+ :text =" $t('assets.bridgeToEthereum ')"
87
123
:title =" $t('new')"
88
124
/>
89
125
</div >
@@ -161,10 +197,9 @@ import ModalFaucet from 'src/components/assets/modals/ModalFaucet.vue';
161
197
import Balloon from ' src/components/common/Balloon.vue' ;
162
198
import { LOCAL_STORAGE } from ' src/config/localStorage' ;
163
199
import {
164
- ccipMinatoBridgeEnabled ,
165
200
layerZeroBridgeEnabled ,
166
201
nativeBridgeEnabled ,
167
- ccipSoneiumBridgeEnabled ,
202
+ checkIsCcipBridgeEnabled ,
168
203
} from ' src/features' ;
169
204
import { useAccount , useBreakpoints , useFaucet , useNetworkInfo } from ' src/hooks' ;
170
205
import { faucetSethLink } from ' src/links' ;
@@ -179,6 +214,7 @@ import { useStore } from 'src/store';
179
214
import { computed , defineComponent , ref , watch , watchEffect } from ' vue' ;
180
215
181
216
import CustomRouterLink from ' ../common/CustomRouterLink.vue' ;
217
+ import { CcipNetworkName , CcipNetworkParam } from ' src/modules/ccip-bridge' ;
182
218
183
219
export default defineComponent ({
184
220
components: { ModalFaucet , CustomRouterLink , Balloon },
@@ -197,15 +233,29 @@ export default defineComponent({
197
233
const isFaucet = ref <boolean >(false );
198
234
const isModalFaucet = ref <boolean >(false );
199
235
200
- const isCcipBalloon = ref <boolean >(false );
236
+ const isCcipSoneiumBalloon = ref <boolean >(false );
237
+ const isCcipEthereumBalloon = ref <boolean >(false );
201
238
const isBalloonClosing = ref <boolean >(false );
202
239
const isSoneiumButtonHover = ref <boolean >(false );
240
+ const isEthereumButtonHover = ref <boolean >(false );
203
241
204
- const { currentNetworkName, nativeTokenSymbol, isZkEvm, isAstar, isShibuyaEvm, isAstarEvm } =
205
- useNetworkInfo ();
242
+ const {
243
+ currentNetworkName,
244
+ nativeTokenSymbol,
245
+ isZkEvm,
246
+ isAstar,
247
+ isShibuyaEvm,
248
+ isAstarEvm,
249
+ ccipSoneiumLink,
250
+ ccipEthereumLink,
251
+ } = useNetworkInfo ();
252
+
253
+ const closeCcipSoneiumBalloon = () => {
254
+ isCcipSoneiumBalloon .value = false ;
255
+ };
206
256
207
- const closeCcipBalloon = () => {
208
- isCcipBalloon .value = false ;
257
+ const closeCcipEthereumBalloon = () => {
258
+ isCcipEthereumBalloon .value = false ;
209
259
};
210
260
211
261
const { currentAccount } = useAccount ();
@@ -252,33 +302,39 @@ export default defineComponent({
252
302
253
303
const isTruncate = ! nativeTokenSymbol .value .toUpperCase ().includes (' BTC' );
254
304
255
- const isEnableCcipBridge = computed <boolean >(() => {
256
- return (
257
- (isShibuyaEvm .value && ccipMinatoBridgeEnabled ) ||
258
- (isAstarEvm .value && ccipSoneiumBridgeEnabled )
259
- );
305
+ const isEnableSoneiumCcipBridge = computed <boolean >(() => {
306
+ const from = isShibuyaEvm .value ? CcipNetworkName .ShibuyaEvm : CcipNetworkName .AstarEvm ;
307
+ const to = isShibuyaEvm .value ? CcipNetworkName .SoneiumMinato : CcipNetworkName .Soneium ;
308
+ return checkIsCcipBridgeEnabled ({ from , to });
309
+ });
310
+
311
+ const isEnableEthereumCcipBridge = computed <boolean >(() => {
312
+ const from = isShibuyaEvm .value ? CcipNetworkName .ShibuyaEvm : CcipNetworkName .AstarEvm ;
313
+ const to = isShibuyaEvm .value ? CcipNetworkName .Sepolia : CcipNetworkName .Ethereum ;
314
+ return checkIsCcipBridgeEnabled ({ from , to });
260
315
});
261
316
262
317
// Memo: display the balloon animation
263
318
watch (
264
319
[isShibuyaEvm , isAstarEvm ],
265
320
async () => {
266
- const isBallonShibuyaDisplayed = Boolean (
267
- localStorage .getItem (LOCAL_STORAGE .BALLOON_CCIP_SHIBUYA )
321
+ const isBallonSepoliaCcipDisplayed = Boolean (
322
+ localStorage .getItem (LOCAL_STORAGE .BALLOON_CCIP_SEPOLIA )
268
323
);
269
- const isBallonAstarDisplayed = Boolean (
270
- localStorage .getItem (LOCAL_STORAGE .BALLOON_CCIP_ASTAR )
324
+ const isBallonEthreumCcipDisplayed = Boolean (
325
+ localStorage .getItem (LOCAL_STORAGE .BALLOON_CCIP_ETHEREUM )
271
326
);
272
- if (isShibuyaEvm .value && ! isBallonShibuyaDisplayed ) {
327
+
328
+ if (isShibuyaEvm .value && ! isBallonSepoliaCcipDisplayed ) {
273
329
await wait (1000 );
274
- isCcipBalloon .value = true ;
275
- localStorage .setItem (LOCAL_STORAGE .BALLOON_CCIP_SHIBUYA , ' true' );
330
+ isCcipEthereumBalloon .value = true ;
331
+ localStorage .setItem (LOCAL_STORAGE .BALLOON_CCIP_SEPOLIA , ' true' );
276
332
}
277
333
278
- if (isAstarEvm .value && ! isBallonAstarDisplayed ) {
334
+ if (isAstarEvm .value && ! isBallonEthreumCcipDisplayed ) {
279
335
await wait (1000 );
280
- isCcipBalloon .value = true ;
281
- localStorage .setItem (LOCAL_STORAGE .BALLOON_CCIP_ASTAR , ' true' );
336
+ isCcipEthereumBalloon .value = true ;
337
+ localStorage .setItem (LOCAL_STORAGE .BALLOON_CCIP_ETHEREUM , ' true' );
282
338
}
283
339
},
284
340
{ immediate: true }
@@ -302,18 +358,24 @@ export default defineComponent({
302
358
nativeBridgeEnabled ,
303
359
layerZeroBridgeEnabled ,
304
360
isShibuyaEvm ,
305
- isEnableCcipBridge ,
306
- isCcipBalloon ,
361
+ isEnableSoneiumCcipBridge ,
362
+ isEnableEthereumCcipBridge ,
363
+ isCcipSoneiumBalloon ,
307
364
isBalloonClosing ,
308
365
isAstarEvm ,
309
366
isSoneiumButtonHover ,
310
- closeCcipBalloon ,
311
- buildCcipBridgePageLink ,
367
+ isEthereumButtonHover ,
368
+ ccipSoneiumLink ,
369
+ ccipEthereumLink ,
370
+ isCcipEthereumBalloon ,
371
+ closeCcipEthereumBalloon ,
372
+ closeCcipSoneiumBalloon ,
312
373
truncate ,
313
374
handleModalFaucet ,
314
375
buildTransferPageLink ,
315
376
buildEthereumBridgePageLink ,
316
377
buildLzBridgePageLink ,
378
+ checkIsCcipBridgeEnabled ,
317
379
};
318
380
},
319
381
});
0 commit comments