@@ -214,12 +224,12 @@
Add Custom
diff --git a/packages/bridge-ui/src/components/ChainDropdown.svelte b/packages/bridge-ui/src/components/ChainDropdown.svelte
index b919cc4bf..1277ff5ca 100644
--- a/packages/bridge-ui/src/components/ChainDropdown.svelte
+++ b/packages/bridge-ui/src/components/ChainDropdown.svelte
@@ -14,8 +14,8 @@
warningToast,
} from './NotificationToast.svelte';
- import MxcIcon from "../assets/token/mxc.png"
- import EthIcon from "../assets/ether.png"
+ import MxcIcon from '../assets/token/mxc.png';
+ import EthIcon from '../assets/ether.png';
const switchChains = async (chain: Chain) => {
if (!$signer) {
@@ -38,7 +38,9 @@
warningToast('Switch chain request rejected.');
} else {
// errorToast('Error switching chain.');
- errorToast('Error Switching Chain. Try Switching Manually On Your Wallet');
+ errorToast(
+ 'Error Switching Chain. Try Switching Manually On Your Wallet',
+ );
}
}
};
@@ -47,11 +49,15 @@
-
+
diff --git a/packages/bridge-ui/src/components/icons/AXS.svelte b/packages/bridge-ui/src/components/icons/AXS.svelte
new file mode 100644
index 000000000..a719d7686
--- /dev/null
+++ b/packages/bridge-ui/src/components/icons/AXS.svelte
@@ -0,0 +1,24 @@
+
+
+
diff --git a/packages/bridge-ui/src/i18n.ts b/packages/bridge-ui/src/i18n.ts
index a1c873601..d4a3a013e 100644
--- a/packages/bridge-ui/src/i18n.ts
+++ b/packages/bridge-ui/src/i18n.ts
@@ -1,57 +1,6 @@
-import { _, dictionary, locale } from 'svelte-i18n';
+import { _, locale } from 'svelte-i18n';
function setupI18n({ withLocale: _locale } = { withLocale: 'en' }) {
- dictionary.set({
- en: {
- home: {
- title: 'Taiko Bridge',
- selectToken: 'Select Token',
- to: 'To',
- bridge: 'Bridge',
- approve: 'Approve',
- },
- bridgeForm: {
- fieldLabel: 'Amount',
- maxLabel: 'Max',
- balance: 'Balance',
- processingFeeLabel: 'Processing Fee',
- bridge: 'Bridge',
- approve: 'Approve',
- },
- nav: {
- connect: 'Connect Wallet',
- },
- transaction: {
- pending: 'Pending',
- claim: 'Claim',
- retry: 'Retry',
- release: 'Release',
- claimed: 'Claimed',
- released: 'Released',
- failed: 'Failed',
- },
- toast: {
- transactionSent: 'Transaction sent',
- transactionCompleted: 'Transaction completed!',
- errorWrongNetwork:
- 'You are connected to the wrong chain in your wallet',
- errorSendingTransaction: 'Error sending transaction',
- errorDisconnecting: 'Could not disconnect',
- errorInsufficientBalance: 'Insufficient ETH balance',
- errorCheckingAllowance: 'Error checking allowance',
- fundsClaimed: 'Funds claimed successfully!',
- fundsReleased: 'Funds released successfully!',
- },
- switchChainModal: {
- title: 'Not on the right network',
- subtitle: 'Your current network is not supported. Please select one:',
- },
- connectModal: {
- title: 'Connect Wallet',
- },
- },
- });
-
locale.set(_locale);
}
diff --git a/packages/bridge-ui/src/i18nLocal.ts b/packages/bridge-ui/src/i18nLocal.ts
new file mode 100644
index 000000000..0150ab64b
--- /dev/null
+++ b/packages/bridge-ui/src/i18nLocal.ts
@@ -0,0 +1,55 @@
+
+export const locales: any = {
+ en: "English",
+ de: "Deutsch",
+ nl: "Nederlands",
+ tr: "Türkçe",
+ zh_CN: "简体中文",
+ zh_TW: "繁体中文",
+ ko: "한국어",
+ ro: "Română",
+ es: "Español",
+ fr: "Français",
+ it: "Italiano",
+ ja: "日本語",
+ ru: "Русский",
+ pt: "Portugués",
+ id: "Indonesio",
+ vi: "Tiếng Việt",
+};
+
+
+export const browserLangToLocaleKey = {
+ 'en': 'en',
+ 'en-US': 'en',
+ 'en-GB': 'en',
+ 'de': 'de',
+ 'de-DE': 'de',
+ 'nl': 'nl',
+ 'nl-NL': 'nl',
+ 'tr': 'tr',
+ 'tr-TR': 'tr',
+ 'zh-CN': 'zh_CN',
+ 'zh-TW': 'zh_TW',
+ 'ko': 'ko',
+ 'ko-KR': 'ko',
+ 'ro': 'ro',
+ 'ro-RO': 'ro',
+ 'es': 'es',
+ 'es-ES': 'es',
+ 'fr': 'fr',
+ 'fr-FR': 'fr',
+ 'it': 'it',
+ 'it-IT': 'it',
+ 'ja': 'ja',
+ 'ja-JP': 'ja',
+ 'ru': 'ru',
+ 'ru-RU': 'ru',
+ 'pt': 'pt',
+ 'pt-PT': 'pt',
+ 'pt-BR': 'pt',
+ 'id': 'id',
+ 'id-ID': 'id',
+ 'vi': 'vi',
+ 'vi-VN': 'vi'
+}
diff --git a/packages/bridge-ui/src/locales/de.json b/packages/bridge-ui/src/locales/de.json
new file mode 100644
index 000000000..9e26dfeeb
--- /dev/null
+++ b/packages/bridge-ui/src/locales/de.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/packages/bridge-ui/src/locales/en.json b/packages/bridge-ui/src/locales/en.json
new file mode 100644
index 000000000..3e18271b2
--- /dev/null
+++ b/packages/bridge-ui/src/locales/en.json
@@ -0,0 +1,66 @@
+{
+ "home": {
+ "title": "Wannsee Bridge",
+ "selectToken": "Select Token",
+ "to": "To",
+ "bridge": "Bridge",
+ "approve": "Approve"
+ },
+ "buttton": {
+ "add": "Add",
+ "confirm": "Confirm"
+ },
+ "bridgeForm": {
+ "fieldLabel": "Amount",
+ "maxLabel": "Max",
+ "balance": "Balance",
+ "processingFeeLabel": "Processing Fee",
+ "bridge": "Bridge",
+ "approve": "Approve",
+ "approved": "Approved",
+ "approving": "Approving…",
+ "bridging": "Bridging…",
+ "approveToken": "Approve token",
+ "notFetchToken": "Could not fetch token details.",
+ "invalidAddress": "Invalid token address.",
+ "enterAddress": "Enter valid ERC20 Address",
+ "tokenAreadyAdd": "Tokens already added",
+ "memo": "Memo",
+ "enterMemo": "Enter memo here…",
+ "mxcLimit": "Max limit reached",
+ "memoDesc": "You can attach an arbitrary message to your bridge transaction by using a memo — it will slightly increase gas costs.",
+ "errorComp": "Error computing",
+ "selectNoneDesc": "Selecting None means that you'll require MXC on the receiving chain in order to claim the bridged token. Please, come back later to manually claim.",
+ "notShowMessage": "Do not show this message again"
+ },
+ "nav": {
+ "connect": "Connect Wallet"
+ },
+ "transaction": {
+ "pending": "Pending",
+ "claim": "Claim",
+ "retry": "Retry",
+ "release": "Release",
+ "claimed": "Claimed",
+ "released": "Released",
+ "failed": "Failed"
+ },
+ "toast": {
+ "transactionSent": "Transaction sent",
+ "transactionCompleted": "Transaction completed!",
+ "errorWrongNetwork": "You are connected to the wrong chain in your wallet",
+ "errorSendingTransaction": "Error sending transaction",
+ "errorDisconnecting": "Could not disconnect",
+ "errorInsufficientBalance": "Insufficient ETH balance",
+ "errorCheckingAllowance": "Error checking allowance",
+ "fundsClaimed": "Funds claimed successfully!",
+ "fundsReleased": "Funds released successfully!"
+ },
+ "switchChainModal": {
+ "title": "Not on the right network",
+ "subtitle": "Your current network is not supported. Please select one:"
+ },
+ "connectModal": {
+ "title": "Connect Wallet"
+ }
+}
\ No newline at end of file
diff --git a/packages/bridge-ui/src/locales/es.json b/packages/bridge-ui/src/locales/es.json
new file mode 100644
index 000000000..9e26dfeeb
--- /dev/null
+++ b/packages/bridge-ui/src/locales/es.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/packages/bridge-ui/src/locales/fr.json b/packages/bridge-ui/src/locales/fr.json
new file mode 100644
index 000000000..9e26dfeeb
--- /dev/null
+++ b/packages/bridge-ui/src/locales/fr.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/packages/bridge-ui/src/locales/id.json b/packages/bridge-ui/src/locales/id.json
new file mode 100644
index 000000000..9e26dfeeb
--- /dev/null
+++ b/packages/bridge-ui/src/locales/id.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/packages/bridge-ui/src/locales/it.json b/packages/bridge-ui/src/locales/it.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/it.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/ja.json b/packages/bridge-ui/src/locales/ja.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/ja.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/ko.json b/packages/bridge-ui/src/locales/ko.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/ko.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/nl.json b/packages/bridge-ui/src/locales/nl.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/nl.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/pt.json b/packages/bridge-ui/src/locales/pt.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/pt.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/ro.json b/packages/bridge-ui/src/locales/ro.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/ro.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/ru.json b/packages/bridge-ui/src/locales/ru.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/ru.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/tr.json b/packages/bridge-ui/src/locales/tr.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/tr.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/vi.json b/packages/bridge-ui/src/locales/vi.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/vi.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/locales/zh_CN.json b/packages/bridge-ui/src/locales/zh_CN.json
new file mode 100644
index 000000000..9e26dfeeb
--- /dev/null
+++ b/packages/bridge-ui/src/locales/zh_CN.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/packages/bridge-ui/src/locales/zh_TW.json b/packages/bridge-ui/src/locales/zh_TW.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/packages/bridge-ui/src/locales/zh_TW.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/bridge-ui/src/pages/home/Home.svelte b/packages/bridge-ui/src/pages/home/Home.svelte
index aa52538d4..e6a595cbd 100644
--- a/packages/bridge-ui/src/pages/home/Home.svelte
+++ b/packages/bridge-ui/src/pages/home/Home.svelte
@@ -17,7 +17,11 @@
import { BridgeType } from '../../domain/bridge';
import { ethers, Contract, type Signer, BigNumber } from 'ethers';
- import { L1MXCCROSSTOKEN, L1MXCTOKEN, ISTESTNET } from '../../constants/envVars';
+ import {
+ L1MXCCROSSTOKEN,
+ L1MXCTOKEN,
+ ISTESTNET,
+ } from '../../constants/envVars';
import TooltipModal from '../../components/TooltipModal.svelte';
import Button from '../../components/Button.svelte';
import MXCCrossTokenAbi from '../../constants/abis/MXCCrossToken';
@@ -34,8 +38,10 @@
warningToast,
} from '../../components/NotificationToast.svelte';
- const is_testnet = ISTESTNET == "1"
- console.log(is_testnet)
+ import { _ } from 'svelte-i18n';
+ import { get } from 'svelte/store';
+
+ const isTestnet = ISTESTNET == '1';
enum LogLevel {
DEBUG = 'DEBUG',
@@ -46,41 +52,38 @@
}
ethers.utils.Logger.setLogLevel(LogLevel.OFF);
- const parseEther = ethers.utils.parseEther
- const formatEther = ethers.utils.formatEther
-
+ const parseEther = ethers.utils.parseEther;
+ const formatEther = ethers.utils.formatEther;
let address: string = '';
let tooltipOpen: boolean = false;
let showClose: boolean = false;
- let mxcCrossVal: BigNumber = parseEther("0");
+ let mxcCrossVal: BigNumber = parseEther('0');
let isApprove: boolean = false;
let loadingClaim: boolean = false;
let loadingApprove: boolean = false;
-
async function approve() {
- loadingApprove = true
+ loadingApprove = true;
try {
- const MXCCrossToken = new Contract(L1MXCCROSSTOKEN, MXCCrossTokenAbi, $signer);
-
- const tx = await MXCCrossToken.approve(
- L1MXCTOKEN,
- mxcCrossVal
+ const MXCCrossToken = new Contract(
+ L1MXCCROSSTOKEN,
+ MXCCrossTokenAbi,
+ $signer,
);
+ const tx = await MXCCrossToken.approve(L1MXCTOKEN, mxcCrossVal);
+
successToast('Transaction sent to approve tokens transfer.');
- isApprove = false
+ isApprove = false;
await pendingTransactions.add(tx, $signer);
- successToast(
- `Tokens transfer approved!
`,
- );
+ successToast(`Tokens transfer approved!
`);
} catch (error) {
console.error(error);
- isApprove = true
+ isApprove = true;
const headerError = 'Failed to approve
';
if (error.cause?.status === 0) {
- console.log(111)
+ console.log(111);
const explorerUrl = `${$srcChain.explorerUrl}/tx/${error.cause.transactionHash}`;
const htmlLink = `here`;
errorToast(
@@ -95,24 +98,19 @@
errorToast(`${headerError}Try again later.`);
}
}
- loadingApprove = false
+ loadingApprove = false;
}
async function claim() {
- loadingClaim = true
+ loadingClaim = true;
const MXCToken = new Contract(L1MXCTOKEN, MXCTokenAbi, $signer);
try {
- const tx = await MXCToken.exchange(
- address,
- mxcCrossVal
- );
+ const tx = await MXCToken.exchange(address, mxcCrossVal);
successToast('Transaction sent to exchange tokens transfer.');
await pendingTransactions.add(tx, $signer);
- successToast(
- `Tokens exchange completed!
`,
- );
- tooltipOpen = false;
+ successToast(`Tokens exchange completed!
`);
+ tooltipOpen = false;
} catch (error) {
console.error(error);
const headerError = 'Failed to exchange
';
@@ -131,35 +129,39 @@
errorToast(`${headerError}Try again later.`);
}
}
- loadingClaim = false
+ loadingClaim = false;
}
async function checkMxcCross() {
// console.log(L1MXCCROSSTOKEN,$signer)
- try {
- const MXCCrossToken = new Contract(L1MXCCROSSTOKEN, MXCCrossTokenAbi, $signer);
- mxcCrossVal = await MXCCrossToken.balanceOf(address)
- let allowance = await MXCCrossToken.allowance(address,L1MXCTOKEN);
- if(mxcCrossVal.gt(0)) {
- tooltipOpen = true
- }else {
- tooltipOpen = false
+ try {
+ const MXCCrossToken = new Contract(
+ L1MXCCROSSTOKEN,
+ MXCCrossTokenAbi,
+ $signer,
+ );
+ mxcCrossVal = await MXCCrossToken.balanceOf(address);
+ let allowance = await MXCCrossToken.allowance(address, L1MXCTOKEN);
+ if (mxcCrossVal.gt(0)) {
+ tooltipOpen = true;
+ } else {
+ tooltipOpen = false;
}
- if(mxcCrossVal.gt(allowance)) {
- isApprove = true
- }else {
- isApprove = false
+ if (mxcCrossVal.gt(allowance)) {
+ isApprove = true;
+ } else {
+ isApprove = false;
}
- } catch (e) {
- console.error(e);
- }
- }
+ } catch (e) {
+ console.error(e);
+ }
+ }
$: setAddress($signer).catch((e) => console.error(e));
async function setAddress(signer: Signer) {
try {
address = await signer.getAddress();
- await checkMxcCross()
+ await checkMxcCross();
} catch (error) {}
}
@@ -168,11 +170,9 @@
const tabsRoute = [
{ name: 'bridge', href: '/' },
{ name: 'transactions', href: '/transactions' },
- // { name: 'faucet', href: '/faucet' },
+ { name: 'faucet', href: '/faucet' },
{ name: 'stake', href: '/stake' },
- // Add more tabs if needed
- ];
-
+ ]
async function setBridge() {
// in l1, set the BridgeType.ERC20
@@ -181,7 +181,7 @@
$: activeTab =
$location === '/' ? tabsRoute[0].name : $location.replace('/', '');
-
+
$: if ($srcChain && $srcChain.id === L1_CHAIN_ID) {
setBridge();
}
@@ -190,23 +190,24 @@
+
{@const tab1 = tabsRoute[0]}
{@const tab2 = tabsRoute[1]}
{@const tab3 = tabsRoute[2]}
-
+ {@const tab4 = tabsRoute[3]}
Bridge
@@ -218,10 +219,11 @@
()
{/if}
-
+ {#if isTestnet}
+ Faucet
+ {/if}
{#if $srcChain && $srcChain.id == L1_CHAIN_ID}
-
- Stake
+ Stake
{/if}
@@ -240,29 +242,32 @@
-
+
-
-
+
-
+
- The current bridge is incompatible with L1 MXC. Please click "Claim" to transform your L1 MXC into the latest version of L2 MXC, which will then allow you to seamlessly bridge to L3 zkEVM.
+ The current bridge is incompatible with L1 MXC. Please click "Claim" to
+ transform your L1 MXC into the latest version of L2 MXC, which will then
+ allow you to seamlessly bridge to L3 zkEVM.
{#if loadingApprove}