-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show ARB token on all Orbit chains #1475
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
parentChainId, | ||
childChainId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passing chain id fixes the following issue:
user's source chain was an Arbitrum Chain, e.g. Arb One, and destination chain is L3 Orbit
then user switched destination to L1
the L1<->L2 Arb token was not added to bridgeTokens
because the chain ids in useArbTokenBridge
was still the old pair (Arb One & L3 Orbit) instead of L1 & L2
if (isArbitrumToken) { | ||
return true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never show the "Import" text for Arb token
const [networks] = useNetworks() | ||
const { childChainProvider, parentChainProvider } = | ||
useNetworksRelationship(networks) | ||
|
||
const { addPendingTransaction } = useTransactionHistory(walletAddress) | ||
|
||
const { | ||
eth: [, updateEthL1Balance], | ||
erc20: [, updateErc20L1Balance] | ||
} = useBalance({ | ||
provider: l1.provider, | ||
provider: parentChainProvider, | ||
walletAddress | ||
}) | ||
const { | ||
eth: [, updateEthL2Balance], | ||
erc20: [, updateErc20L2Balance] | ||
} = useBalance({ | ||
provider: l2.provider, | ||
provider: childChainProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l1 & l2 from params are stale so had to do this after switching chain
might need to check if that causes issues with transfers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use that across the entire hook and get rid of l1/l2 in params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100%
@chrstph-dvx is working on that 😁
if (!walletAddress) { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't use it at all
const [networks] = useNetworks() | ||
const { childChainProvider, parentChainProvider } = | ||
useNetworksRelationship(networks) | ||
|
||
const { addPendingTransaction } = useTransactionHistory(walletAddress) | ||
|
||
const { | ||
eth: [, updateEthL1Balance], | ||
erc20: [, updateErc20L1Balance] | ||
} = useBalance({ | ||
provider: l1.provider, | ||
provider: parentChainProvider, | ||
walletAddress | ||
}) | ||
const { | ||
eth: [, updateEthL2Balance], | ||
erc20: [, updateErc20L2Balance] | ||
} = useBalance({ | ||
provider: l2.provider, | ||
provider: childChainProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use that across the entire hook and get rid of l1/l2 in params
const isArbitrumTokenAndIsChildChainOrbit = | ||
isArbitrumTokenList(listId) && isChildChainOrbit | ||
const parentChainTokenAddress = isArbitrumTokenAndIsChildChainOrbit | ||
? tokenData.address.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? tokenData.address.toLowerCase() | |
? address.toLowerCase() |
closes FS-327