Skip to content

Commit

Permalink
feat: bridge add chains (#584)
Browse files Browse the repository at this point in the history
* wip: bridge form page

* wip: bridge transaction preview and status page

* wip: rainbow bridge integration

* wip: rainbow bridge transfer

* wip: get token balance

* wip: bridge transfer status & history

* wip: transform rainbow transfer rawData

* fix: bridge abi filename

* feat: Perfect interaction details

* fix: bridge transaction status icon animate

* feat: copy wallet accountId

* feat: bridge history filter hash

* fix: bridge custom address

* fix: some bugs that came up during testing

* fix: some bugs

* fix

* wip

wip

fix

wip

wip

* adjusting the stargate contract integration

* fix: change ethereum testnet

* chore: upgrade @near-eth/* dependencies

* fix: miss dependency os-browserify

* fix: miss dependencies @near-eth/aurora-*

* feat: calculate stargate fee and mininimum received

* feat: integration bridge history api

* fix: stargate query contract optimization

* fix: unconnect wallet bug

* fix: bridge to default token

* fix: bridge history support near and other query optimization

* fix: Bridge Route text adjustment

* fix: some bugs

* fix: some bugs

* wip

* feat: support more evm chains and improve interaction details

* fix: judgment discount logic

* fix: bridge realtime computing gas

* fix: some bugs

* fix: some bugs

* feat: aurora tokens config add USDC

* fix: some bugs

* fix: remove display gas fee

* fix: evm erc20 approve

* fix: getTokenByAddress

* fix: bridge cannot cover gas fee warning

* feat: new bridge menu

* fix: bridge token selector filter

* fix: bridge custom address

* fix: remove console

* fix: bridge unconnected wallet disable input amount

* fix: bridge token out disable style

* fix: bridge bugs

* fix: wallet selector discount

* feat: bridge add stargate protocol fee

* fix: bridge readableMinAmountWithSlippage

* fix: bridge preview fee

* fix: bridge preview minimun received

* fix: bridge Bridging Time

* fix: change aurora receive address

* feat: bridge add chains Avalanche Mantle Polygon

* fix: bridge fee main token exchange rate calculation adjustment

* fix: remove console

* fix: change bridge history api

* Revert "fix: change bridge history api"

This reverts commit d2773a2.

* feat: bridge add sei chain

* fix: remove console

* feat: bridge add chains

* fix: some bugs

* fix: some bugs

* feat: bridge chains sort

* fix: hidden Mantle chain

* fix: bridge history amount
  • Loading branch information
harry1115 authored Aug 20, 2024
1 parent 2bae759 commit f4afb81
Show file tree
Hide file tree
Showing 15 changed files with 519 additions and 221 deletions.
1 change: 1 addition & 0 deletions src/pages/Bridge/abi/stargateOFTUSDC.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions src/pages/Bridge/components/ConnectWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';

import { useWalletConnectContext } from '../providers/walletConcent';
import { formatSortAddress } from '../utils/format';
import { formatChainIcon, formatSortAddress } from '../utils/format';
import Button from './Button';
import SvgIcon from './SvgIcon';
import CopyToClipboard from 'react-copy-to-clipboard';
Expand Down Expand Up @@ -146,13 +146,19 @@ function ChainSelector({
<SvgIcon name="IconArrowDown" className="text-xs ml-2" />
</div>
{showOptions && (
<div className="absolute z-50 py-2 px-1.5 rounded-lg border border-borderC text-sm bg-darkBg text-white shadow-lg">
<div
className="absolute z-50 py-2 px-1.5 rounded-lg border border-borderC text-sm bg-darkBg text-white shadow-lg overflow-y-auto"
style={{ maxHeight: '50vh' }}
>
{options.map((option) => (
<div
key={option}
className="hover:bg-symbolHover2 transition-colors py-2 px-4 flex items-center gap-2 cursor-pointer"
onClick={() => handleOptionClick(option)}
>
<div className="w-6 h-6 bg-black rounded-md">
<img src={formatChainIcon(option)} className="w-6 h-6" />
</div>
<div className="min-w-20">{option}</div>
{value === option && (
<SvgIcon
Expand Down
9 changes: 3 additions & 6 deletions src/pages/Bridge/components/HistoryTable.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import React, { useEffect, useMemo } from 'react';
import React, { useMemo } from 'react';
import SvgIcon from './SvgIcon';
import {
formatAmount,
formatChainIcon,
formatFileUrl,
formatSortAddress,
formatTimestamp,
formatTxExplorerUrl,
} from '../utils/format';
import Button from './Button';
import useBridge from '../hooks/useBridge';
import { getTokenByAddress, getTokenMeta } from '../utils/token';
import { getTokenByAddress } from '../utils/token';
import CustomTooltip from 'src/components/customTooltip/customTooltip';

const columns = [
Expand Down Expand Up @@ -68,7 +65,7 @@ function TableItem({

<CustomTooltip id="token-symbol" />
</span>
{formatAmount(transaction.volume, tokenMeta?.decimals)}
{formatAmount(transaction.amount, tokenMeta?.decimals)}
</div>
</td>
<td>
Expand Down
Loading

0 comments on commit f4afb81

Please sign in to comment.