From a77221ae1e374278f14cd5122d2e7272f9a75aa1 Mon Sep 17 00:00:00 2001 From: Korbinian Date: Wed, 8 May 2024 16:41:54 +0200 Subject: [PATCH] feat(bridge-ui): add WETH warning (#17051) --- .../config/schemas/configuredCustomTokens.schema.json | 3 +++ .../ReviewStep/ReviewStep.svelte | 10 ++++++++++ packages/bridge-ui/src/i18n/en.json | 9 +++++---- packages/bridge-ui/src/libs/token/tokens.ts | 4 ++++ packages/bridge-ui/src/libs/token/types.ts | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/bridge-ui/config/schemas/configuredCustomTokens.schema.json b/packages/bridge-ui/config/schemas/configuredCustomTokens.schema.json index 044be0aff9..1a92562b13 100644 --- a/packages/bridge-ui/config/schemas/configuredCustomTokens.schema.json +++ b/packages/bridge-ui/config/schemas/configuredCustomTokens.schema.json @@ -30,6 +30,9 @@ }, "mintable": { "type": "boolean" + }, + "wrapped": { + "type": "boolean" } }, "required": ["name", "addresses", "symbol", "decimals", "type", "logoURI"] diff --git a/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ReviewStep/ReviewStep.svelte b/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ReviewStep/ReviewStep.svelte index 17a5dd1a86..099573e7cf 100644 --- a/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ReviewStep/ReviewStep.svelte +++ b/packages/bridge-ui/src/components/Bridge/FungibleBridgeComponents/ReviewStep/ReviewStep.svelte @@ -9,6 +9,7 @@ import { destNetwork as destChain, enteredAmount, selectedToken } from '$components/Bridge/state'; import { PUBLIC_SLOW_L1_BRIDGING_WARNING } from '$env/static/public'; import { LayerType } from '$libs/chain'; + import { isWrapped, type Token } from '$libs/token'; import { connectedSourceChain } from '$stores/network'; export let hasEnoughEth: boolean = false; @@ -21,6 +22,10 @@ $: displayL1Warning = slowL1Warning && $destChain?.id && chainConfig[$destChain.id].type === LayerType.L1; + $: wrapped = $selectedToken !== null && isWrapped($selectedToken as Token); + + $: wrappedAssetWarning = $t('bridge.alerts.wrapped_eth'); + const dispatch = createEventDispatcher(); const editTransactionDetails = () => { @@ -64,6 +69,11 @@ {$t('bridge.alerts.slow_bridging')} {/if} +{#if wrapped} + + {@html wrappedAssetWarning} +{/if} +