From 87276f9e2e392ab7096c6b93c45bbc08caf2c96e Mon Sep 17 00:00:00 2001
From: Bartek
Date: Thu, 27 Jul 2023 13:18:57 +0200
Subject: [PATCH 3/5] fixes
---
.../USDCDepositConfirmationDialog.tsx | 14 ++++++++++---
.../USDCWithdrawalConfirmationDialog.tsx | 20 +++++++++++++------
.../src/util/fastBridges.ts | 14 ++++---------
3 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCDeposit/USDCDepositConfirmationDialog.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCDeposit/USDCDepositConfirmationDialog.tsx
index cee5629aae..95417151b2 100644
--- a/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCDeposit/USDCDepositConfirmationDialog.tsx
+++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCDeposit/USDCDepositConfirmationDialog.tsx
@@ -53,8 +53,16 @@ export function USDCDepositConfirmationDialog(
const fastBridges = [
...getFastBridges<'bridge'>({
- deepLinkInfo: { from: from.id, to: to.id, amount: props.amount },
- supportedFastBridgeNames: [FastBridgeNames.Celer]
+ deepLinkInfo: {
+ from: from.id,
+ to: to.id,
+ tokenSymbol: 'USDC',
+ amount: props.amount
+ },
+ supportedFastBridgeNames: [
+ FastBridgeNames.Celer,
+ FastBridgeNames.Wormhole
+ ]
}),
...getFastBridges<'swap'>({
deepLinkInfo: {
@@ -68,7 +76,7 @@ export function USDCDepositConfirmationDialog(
: CommonAddress.ArbitrumOne.USDC,
amount: props.amount
},
- supportedFastBridgeNames: [FastBridgeNames.LIFI, FastBridgeNames.Wormhole]
+ supportedFastBridgeNames: [FastBridgeNames.LIFI, FastBridgeNames.Router]
})
]
diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCWithdrawal/USDCWithdrawalConfirmationDialog.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCWithdrawal/USDCWithdrawalConfirmationDialog.tsx
index 53953908d6..dd7b556abb 100644
--- a/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCWithdrawal/USDCWithdrawalConfirmationDialog.tsx
+++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/USDCWithdrawal/USDCWithdrawalConfirmationDialog.tsx
@@ -30,22 +30,30 @@ export function USDCWithdrawalConfirmationDialog(
const fastBridges = [
...getFastBridges<'bridge'>({
- deepLinkInfo: { from: from.id, to: to.id, amount: props.amount },
- supportedFastBridgeNames: [FastBridgeNames.Celer]
+ deepLinkInfo: {
+ from: from.id,
+ to: to.id,
+ tokenSymbol: 'USDC',
+ amount: props.amount
+ },
+ supportedFastBridgeNames: [
+ FastBridgeNames.Celer,
+ FastBridgeNames.Wormhole
+ ]
}),
...getFastBridges<'swap'>({
deepLinkInfo: {
from: from.id,
to: to.id,
fromTokenAddress: isArbitrumGoerli
- ? CommonAddress.Goerli.USDC
- : CommonAddress.Mainnet.USDC,
- toTokenAddress: isArbitrumGoerli
? CommonAddress.ArbitrumGoerli.USDC
: CommonAddress.ArbitrumOne.USDC,
+ toTokenAddress: isArbitrumGoerli
+ ? CommonAddress.Goerli.USDC
+ : CommonAddress.Mainnet.USDC,
amount: props.amount
},
- supportedFastBridgeNames: [FastBridgeNames.LIFI, FastBridgeNames.Wormhole]
+ supportedFastBridgeNames: [FastBridgeNames.LIFI, FastBridgeNames.Router]
})
]
diff --git a/packages/arb-token-bridge-ui/src/util/fastBridges.ts b/packages/arb-token-bridge-ui/src/util/fastBridges.ts
index 511bdd5093..7be91d20fb 100644
--- a/packages/arb-token-bridge-ui/src/util/fastBridges.ts
+++ b/packages/arb-token-bridge-ui/src/util/fastBridges.ts
@@ -67,6 +67,8 @@ function getFastBridgeSlugs(fastBridgeName: FastBridgeNames): {
} {
switch (fastBridgeName) {
case FastBridgeNames.Hop:
+ case FastBridgeNames.Connext:
+ case FastBridgeNames.Stargate:
return {
[ChainId.Mainnet]: 'ethereum',
[ChainId.ArbitrumOne]: 'arbitrum',
@@ -121,13 +123,11 @@ function getBridgeDeepLink(
case FastBridgeNames.Connext:
return `https://bridge.connext.network/${tokenSymbol}-from-${slugFrom}-to-${slugTo}?amount=${amount}`
case FastBridgeNames.Across:
- return `https://across.to/?from=${from}&to=${to}&asset=${tokenSymbol}&amount=${amount}`
+ return 'https://across.to/bridge'
case FastBridgeNames.Stargate:
return `https://stargate.finance/transfer?srcChain=${slugFrom}&dstChain=${slugTo}&srcToken=${tokenSymbol}`
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.
- return `https://synapseprotocol.com/?inputCurrency=${tokenSymbol}&outputCurrency=${tokenSymbol}&outputChain=${to}`
+ return 'https://synapseprotocol.com/'
case FastBridgeNames.Wormhole:
return 'https://www.portalbridge.com/usdc-bridge/'
default:
@@ -198,11 +198,5 @@ export const NonCanonicalTokensBridgeInfo = {
export const USDCBridgeInfo = {
tokenSymbol: 'USDC',
tokenSymbolOnArbitrum: 'USDC.e',
- supportedBridges: [
- FastBridgeNames.Celer,
- FastBridgeNames.LIFI,
- FastBridgeNames.Wormhole,
- FastBridgeNames.Router
- ],
learnMoreUrl: USDC_LEARN_MORE_LINK
} as const
From 4db1a4e34a42be1dac1f907df63877b431fad283 Mon Sep 17 00:00:00 2001
From: Bartek
Date: Thu, 27 Jul 2023 13:35:00 +0200
Subject: [PATCH 4/5] goerli slugs
---
packages/arb-token-bridge-ui/src/util/fastBridges.ts | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/packages/arb-token-bridge-ui/src/util/fastBridges.ts b/packages/arb-token-bridge-ui/src/util/fastBridges.ts
index 7be91d20fb..3470e65038 100644
--- a/packages/arb-token-bridge-ui/src/util/fastBridges.ts
+++ b/packages/arb-token-bridge-ui/src/util/fastBridges.ts
@@ -72,13 +72,17 @@ function getFastBridgeSlugs(fastBridgeName: FastBridgeNames): {
return {
[ChainId.Mainnet]: 'ethereum',
[ChainId.ArbitrumOne]: 'arbitrum',
- [ChainId.ArbitrumNova]: 'nova'
+ [ChainId.ArbitrumNova]: 'nova',
+ [ChainId.Goerli]: 'goerli',
+ [ChainId.ArbitrumGoerli]: 'arbitrum-goerli'
}
default:
return {
[ChainId.Mainnet]: 'mainnet',
[ChainId.ArbitrumOne]: 'arbitrum',
- [ChainId.ArbitrumNova]: 'arbitrum-nova'
+ [ChainId.ArbitrumNova]: 'arbitrum-nova',
+ [ChainId.Goerli]: 'goerli',
+ [ChainId.ArbitrumGoerli]: 'arbitrum-goerli'
}
}
}
From 40f3ced647c1a85a9c129d2c6c35804e83916f31 Mon Sep 17 00:00:00 2001
From: Bartek
Date: Tue, 14 Nov 2023 16:48:10 +0100
Subject: [PATCH 5/5] clean up
---
.../src/components/TransferPanel/OneNovaTransferDialog.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/OneNovaTransferDialog.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/OneNovaTransferDialog.tsx
index 7a05b6893b..8b447ce76d 100644
--- a/packages/arb-token-bridge-ui/src/components/TransferPanel/OneNovaTransferDialog.tsx
+++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/OneNovaTransferDialog.tsx
@@ -34,7 +34,7 @@ export function OneNovaTransferDialog(
deepLinkInfo: {
from: sourceChainId,
to: destinationChainId,
- tokenSymbol: selectedToken?.symbol || 'ETH',
+ tokenSymbol: selectedToken?.symbol ?? 'ETH',
amount: props.amount
},
supportedFastBridgeNames: [FastBridgeNames.Hop]