diff --git a/packages/bridge-ui/README.md b/packages/bridge-ui/README.md index 59cd6eb5f52..876a1df3eb4 100644 --- a/packages/bridge-ui/README.md +++ b/packages/bridge-ui/README.md @@ -14,18 +14,22 @@ You can use the following values in the `.env` file to spin up the Bridge UI loc ``` VITE_NODE_ENV=dev -VITE_L1_RPC_URL="https://l1rpc.a1.taiko.xyz/" -VITE_L2_RPC_URL="https://l2rpc.a1.taiko.xyz/" -VITE_RELAYER_URL="http://localhost:4102/" -VITE_TEST_ERC20_ADDRESS_MAINNET="0x3E3a3416DbCc5cb4448B6b171fF15f9Da35Ab72d" -VITE_MAINNET_CHAIN_ID=31338 -VITE_TAIKO_CHAIN_ID=167003 -VITE_MAINNET_CHAIN_NAME="Ethereum A1" -VITE_TAIKO_CHAIN_NAME="Taiko A1" +VITE_L1_RPC_URL="https://l1rpc.internal.taiko.xyz/" +VITE_L2_RPC_URL="https://l2rpc.internal.taiko.xyz/" +VITE_RELAYER_URL="https://relayer.internal.taiko.xyz/" +VITE_TEST_ERC20_ADDRESS_MAINNET="0x1B5Ccd66cc2408A0084047720167F6234Dc5498A" +VITE_TEST_ERC20_SYMBOL_MAINNET="BULL" +VITE_TEST_ERC20_NAME_MAINNET="Bull Token" +VITE_MAINNET_CHAIN_ID=31336 +VITE_TAIKO_CHAIN_ID=167001 +VITE_MAINNET_CHAIN_NAME="Ethereum A2" +VITE_TAIKO_CHAIN_NAME="Taiko A2" +VITE_MAINNET_TOKEN_VAULT_ADDRESS="0xAE4C9bD0f7AE5398Df05043079596E2BF0079CE9" VITE_TAIKO_TOKEN_VAULT_ADDRESS="0x0000777700000000000000000000000000000002" -VITE_MAINNET_TOKEN_VAULT_ADDRESS="0xD0dfd5baCf160B97C8eE3ecb463F18c08673160c" +VITE_MAINNET_HEADER_SYNC_ADDRESS="0xa6421A7f48498cee3aEb6428a8A2DD5fAA3AcE2f" VITE_TAIKO_HEADER_SYNC_ADDRESS="0x0000777700000000000000000000000000000001" -VITE_MAINNET_HEADER_SYNC_ADDRESS="0x7B3AF414448ba906f02a1CA307C56c4ADFF27ce7" -VITE_MAINNET_BRIDGE_ADDRESS="0x3612E284D763f42f5E4CB72B1602b23DAEC3cA60" +VITE_MAINNET_BRIDGE_ADDRESS="0x0237443359aB0b11EcDC41A7aF1C90226a88c70f" VITE_TAIKO_BRIDGE_ADDRESS="0x0000777700000000000000000000000000000004" +VITE_MAINNET_SIGNAL_SERVICE_ADDRESS="0x403cc7802725928652a3d116Bb1781005e2e76d3" +VITE_TAIKO_SIGNAL_SERVICE_ADDRESS="0x0000777700000000000000000000000000000007" ``` \ No newline at end of file diff --git a/packages/bridge-ui/jest.config.js b/packages/bridge-ui/jest.config.js index 5f01fcc3700..e7adeb038d2 100644 --- a/packages/bridge-ui/jest.config.js +++ b/packages/bridge-ui/jest.config.js @@ -39,10 +39,10 @@ export default { ], coverageThreshold: { global: { - statements: 96, - branches: 79, - functions: 91, - lines: 97, + statements: 95, + branches: 72, + functions: 89, + lines: 96, }, }, modulePathIgnorePatterns: ["/public/build/"], diff --git a/packages/bridge-ui/src/App.svelte b/packages/bridge-ui/src/App.svelte index 4eedd15104b..41fe60d2384 100644 --- a/packages/bridge-ui/src/App.svelte +++ b/packages/bridge-ui/src/App.svelte @@ -50,6 +50,9 @@ import BridgeABI from "./constants/abi/Bridge"; import { providers } from "./store/providers"; import HeaderAnnouncement from "./components/HeaderAnnouncement.svelte"; + import type { TokenService } from "./domain/token"; + import { CustomTokenService } from "./storage/customTokenService"; + import { userTokens, tokenService } from "./store/userToken"; const providerMap: Map = new Map< number, @@ -130,15 +133,25 @@ providerMap ); + const tokenStore: TokenService = new CustomTokenService( + window.localStorage, + ); + + tokenService.set(tokenStore); + transactioner.set(storageTransactioner); signer.subscribe(async (store) => { if (store) { + const userAddress = await store.getAddress(); const txs = await $transactioner.GetAllByAddress( - await store.getAddress() + userAddress ); transactions.set(txs); + + const tokens = await $tokenService.GetTokens(userAddress) + userTokens.set(tokens); } return store; }); @@ -180,7 +193,7 @@ } transactionToIntervalMap.set(tx.ethersTx.hash, interval); - if (!tx.signal) return; + if (!tx.msgHash) return; const contract = new ethers.Contract( chains[tx.toChainId].bridgeAddress, @@ -189,7 +202,7 @@ ); const messageStatus: MessageStatus = - await contract.getMessageStatus(tx.signal); + await contract.getMessageStatus(tx.msgHash); if (messageStatus === MessageStatus.Done) { successToast("Bridge message processed successfully"); diff --git a/packages/bridge-ui/src/app.css b/packages/bridge-ui/src/app.css index fa8fe6531da..fc03aeddba9 100644 --- a/packages/bridge-ui/src/app.css +++ b/packages/bridge-ui/src/app.css @@ -47,6 +47,10 @@ border-radius: 0.5rem; } +ul.token-dropdown li.cursor-pointer:last-child, ul.token-dropdown li.cursor-pointer:first-child { + border-radius: 0; +} + .taiko-banner { background-image: url('assets/taiko-banner.svg'); background-repeat: no-repeat; diff --git a/packages/bridge-ui/src/assets/erc20.png b/packages/bridge-ui/src/assets/erc20.png new file mode 100644 index 00000000000..902ed2b9c87 Binary files /dev/null and b/packages/bridge-ui/src/assets/erc20.png differ diff --git a/packages/bridge-ui/src/components/MessageStatusTooltip.svelte b/packages/bridge-ui/src/components/MessageStatusTooltip.svelte index 2aca9cde74a..f24fc143129 100644 --- a/packages/bridge-ui/src/components/MessageStatusTooltip.svelte +++ b/packages/bridge-ui/src/components/MessageStatusTooltip.svelte @@ -11,8 +11,12 @@