diff --git a/packages/bridge-ui/src/app.css b/packages/bridge-ui/src/app.css index f1e9de666cd..fba7e9c29ed 100644 --- a/packages/bridge-ui/src/app.css +++ b/packages/bridge-ui/src/app.css @@ -27,7 +27,6 @@ .btn.btn-accent { background-color: hsla(var(--af) / var(--tw-bg-opacity, 1)); border-color: hsla(var(--af) / var(--tw-bg-opacity, 1)); - height: 60px; } .btn.btn-accent:hover { diff --git a/packages/bridge-ui/src/bridge/ERC20Bridge.ts b/packages/bridge-ui/src/bridge/ERC20Bridge.ts index 2e79e42faca..e00a1e35813 100644 --- a/packages/bridge-ui/src/bridge/ERC20Bridge.ts +++ b/packages/bridge-ui/src/bridge/ERC20Bridge.ts @@ -173,15 +173,15 @@ export class ERC20Bridge implements Bridge { if (messageStatus === MessageStatus.New) { const proof = await this.prover.generateProof({ - srcChain: opts.message.srcChainId.toNumber(), + srcChain: opts.message.srcChainId, msgHash: opts.msgHash, sender: opts.srcBridgeAddress, srcBridgeAddress: opts.srcBridgeAddress, - destChain: opts.message.destChainId.toNumber(), + destChain: opts.message.destChainId, destHeaderSyncAddress: - chains[opts.message.destChainId.toNumber()].headerSyncAddress, + chains[opts.message.destChainId].headerSyncAddress, srcSignalServiceAddress: - chains[opts.message.srcChainId.toNumber()].signalServiceAddress, + chains[opts.message.srcChainId].signalServiceAddress, }); if (opts.message.gasLimit.gt(BigNumber.from(2500000))) { @@ -234,15 +234,14 @@ export class ERC20Bridge implements Bridge { if (messageStatus === MessageStatus.Failed) { const proofOpts = { - srcChain: opts.message.srcChainId.toNumber(), + srcChain: opts.message.srcChainId, msgHash: opts.msgHash, sender: opts.srcBridgeAddress, destBridgeAddress: opts.destBridgeAddress, - destChain: opts.message.destChainId.toNumber(), + destChain: opts.message.destChainId, destHeaderSyncAddress: - chains[opts.message.destChainId.toNumber()].headerSyncAddress, - srcHeaderSyncAddress: - chains[opts.message.srcChainId.toNumber()].headerSyncAddress, + chains[opts.message.destChainId].headerSyncAddress, + srcHeaderSyncAddress: chains[opts.message.srcChainId].headerSyncAddress, }; const proof = await this.prover.generateReleaseProof(proofOpts); diff --git a/packages/bridge-ui/src/bridge/ETHBridge.ts b/packages/bridge-ui/src/bridge/ETHBridge.ts index 8aceb3b8341..c82f6407ab5 100644 --- a/packages/bridge-ui/src/bridge/ETHBridge.ts +++ b/packages/bridge-ui/src/bridge/ETHBridge.ts @@ -7,11 +7,10 @@ import type { ClaimOpts, ReleaseOpts, } from '../domain/bridge'; -import TokenVault from '../constants/abi/TokenVault'; import type { Prover } from '../domain/proof'; -import { MessageStatus } from '../domain/message'; import BridgeABI from '../constants/abi/Bridge'; import { chains } from '../chain/chains'; +import { type Message, MessageStatus } from '../domain/message'; export class ETHBridge implements Bridge { private readonly prover: Prover; @@ -22,7 +21,7 @@ export class ETHBridge implements Bridge { static async prepareTransaction( opts: BridgeOpts, - ): Promise<{ contract: Contract; message: any; owner: string }> { + ): Promise<{ contract: Contract; message: Message; owner: string }> { const contract: Contract = new Contract( opts.bridgeAddress, BridgeABI, @@ -30,7 +29,7 @@ export class ETHBridge implements Bridge { ); const owner = await opts.signer.getAddress(); - const message = { + const message: Message = { sender: owner, srcChainId: opts.fromChainId, destChainId: opts.toChainId, @@ -113,15 +112,15 @@ export class ETHBridge implements Bridge { if (messageStatus === MessageStatus.New) { const proofOpts = { - srcChain: opts.message.srcChainId.toNumber(), + srcChain: opts.message.srcChainId, msgHash: opts.msgHash, sender: opts.srcBridgeAddress, srcBridgeAddress: opts.srcBridgeAddress, - destChain: opts.message.destChainId.toNumber(), + destChain: opts.message.destChainId, destHeaderSyncAddress: - chains[opts.message.destChainId.toNumber()].headerSyncAddress, + chains[opts.message.destChainId].headerSyncAddress, srcSignalServiceAddress: - chains[opts.message.srcChainId.toNumber()].signalServiceAddress, + chains[opts.message.srcChainId].signalServiceAddress, }; const proof = await this.prover.generateProof(proofOpts); @@ -169,15 +168,14 @@ export class ETHBridge implements Bridge { if (messageStatus === MessageStatus.Failed) { const proofOpts = { - srcChain: opts.message.srcChainId.toNumber(), + srcChain: opts.message.srcChainId, msgHash: opts.msgHash, sender: opts.srcBridgeAddress, destBridgeAddress: opts.destBridgeAddress, - destChain: opts.message.destChainId.toNumber(), + destChain: opts.message.destChainId, destHeaderSyncAddress: - chains[opts.message.destChainId.toNumber()].headerSyncAddress, - srcHeaderSyncAddress: - chains[opts.message.srcChainId.toNumber()].headerSyncAddress, + chains[opts.message.destChainId].headerSyncAddress, + srcHeaderSyncAddress: chains[opts.message.srcChainId].headerSyncAddress, }; const proof = await this.prover.generateReleaseProof(proofOpts); diff --git a/packages/bridge-ui/src/components/ChainDropdown.svelte b/packages/bridge-ui/src/components/ChainDropdown.svelte index db6d8e8c485..453e62a6421 100644 --- a/packages/bridge-ui/src/components/ChainDropdown.svelte +++ b/packages/bridge-ui/src/components/ChainDropdown.svelte @@ -1,5 +1,4 @@ diff --git a/packages/bridge-ui/src/components/Transactions.svelte b/packages/bridge-ui/src/components/Transactions.svelte deleted file mode 100644 index 67bd281025a..00000000000 --- a/packages/bridge-ui/src/components/Transactions.svelte +++ /dev/null @@ -1,58 +0,0 @@ - - -
- {#if $transactions.length} - - - - - - - - - - - - {#each $transactions as transaction} - { - if (showInsufficientBalanceMessage) { - showInsufficientBalance = true; - } else { - showMessageStatusTooltip = true; - } - }} - onShowTransactionDetailsClick={() => { - selectedTransaction = transaction; - }} - toChain={chains[transaction.toChainId]} - fromChain={chains[transaction.fromChainId]} - {transaction} /> - {/each} - -
FromToAmountStatusDetails
- {:else} - No transactions - {/if} - - {#if selectedTransaction} - (selectedTransaction = null)} /> - {/if} - - - -
diff --git a/packages/bridge-ui/src/components/InsufficientBalanceTooltip.svelte b/packages/bridge-ui/src/components/Transactions/InsufficientBalanceTooltip.svelte similarity index 87% rename from packages/bridge-ui/src/components/InsufficientBalanceTooltip.svelte rename to packages/bridge-ui/src/components/Transactions/InsufficientBalanceTooltip.svelte index f5a5dc6064b..68415e8460e 100644 --- a/packages/bridge-ui/src/components/InsufficientBalanceTooltip.svelte +++ b/packages/bridge-ui/src/components/Transactions/InsufficientBalanceTooltip.svelte @@ -1,5 +1,5 @@ diff --git a/packages/bridge-ui/src/components/MessageStatusTooltip.svelte b/packages/bridge-ui/src/components/Transactions/MessageStatusTooltip.svelte similarity index 72% rename from packages/bridge-ui/src/components/MessageStatusTooltip.svelte rename to packages/bridge-ui/src/components/Transactions/MessageStatusTooltip.svelte index e98c856b45c..e6a9df8181d 100644 --- a/packages/bridge-ui/src/components/MessageStatusTooltip.svelte +++ b/packages/bridge-ui/src/components/Transactions/MessageStatusTooltip.svelte @@ -1,5 +1,6 @@ @@ -12,14 +13,9 @@