Skip to content

Commit

Permalink
feat: add deBridge fast bridge (#2192)
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx authored Jan 15, 2025
1 parent 1360e8a commit 2efad00
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/arb-token-bridge-ui/public/images/bridge/deBridge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function WithdrawalConfirmationDialog(
from: childChain.id,
to: parentChain.id,
tokenSymbol: selectedToken?.symbol ?? nativeCurrency.symbol,
tokenAddress: selectedToken?.address,
amount: props.amount
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function BridgesTable(props: {
return 1
}

if (a.name < b.name) {
if (a.name.toLowerCase() < b.name.toLowerCase()) {
return -1
} else {
return 1
Expand Down
12 changes: 11 additions & 1 deletion packages/arb-token-bridge-ui/src/util/fastBridges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Synapse from '@/images/bridge/synapse.png'
import Wormhole from '@/images/bridge/wormhole.svg'
// import LIFI from '@/images/bridge/lifi.webp'
import Router from '@/images/bridge/router.webp'
import deBridge from '@/images/bridge/deBridge.svg'

import { ChainId } from '../types/ChainId'
import { USDC_LEARN_MORE_LINK } from '../constants'
Expand All @@ -22,7 +23,8 @@ export enum FastBridgeNames {
Synapse = 'Synapse',
Wormhole = 'Wormhole',
LIFI = 'LI.FI',
Router = 'Router'
Router = 'Router',
deBridge = 'deBridge'
}

export enum SpecialTokenSymbol {
Expand All @@ -39,11 +41,13 @@ export function getFastBridges({
from,
to,
tokenSymbol,
tokenAddress = '',
amount
}: {
from: ChainId
to: ChainId
tokenSymbol: string
tokenAddress?: string
amount: string
}): FastBridgeInfo[] {
function chainIdToSlug(chainId: ChainId): string {
Expand Down Expand Up @@ -77,6 +81,8 @@ export function getFastBridges({
return `https://stargate.finance/transfer?srcChain=${chainIdToSlug(
from
)}&dstChain=${chainIdToSlug(to)}&srcToken=${tokenSymbol}`
case FastBridgeNames.deBridge:
return `https://app.debridge.finance/?inputChain=${from}&outputChain=${to}&amount=${amount}&inputCurrency=${tokenAddress}`
case FastBridgeNames.Synapse:
// We can't specify the input chain for Synapse, as it will use whatever the user is connected to.
// We make sure to prompt a network switch to Arbitrum prior to showing this.
Expand Down Expand Up @@ -118,6 +124,10 @@ export function getFastBridges({
[FastBridgeNames.Synapse]: {
imageSrc: Synapse,
href: getBridgeDeepLink(FastBridgeNames.Synapse)
},
[FastBridgeNames.deBridge]: {
imageSrc: deBridge,
href: getBridgeDeepLink(FastBridgeNames.deBridge)
}
}

Expand Down

0 comments on commit 2efad00

Please sign in to comment.