-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
160 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "Arbitrum", | ||
"logoURI": "https://arbitrum.io/wp-content/uploads/2022/12/One-Logo-280x280-1.png", | ||
"keywords": ["scaling", "layer2", "infrastructure"], | ||
"timestamp": "2023-02-10T22:16:04.897Z", | ||
"tokens": [ | ||
{ | ||
"chainId": 42161, | ||
"address": "0x079504b86d38119F859c4194765029F692b7B7aa", | ||
"name": "Lyra", | ||
"symbol": "LYRA", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/lyra-finance/interface/master/app/public/images/lyra-token.png" | ||
}, | ||
{ | ||
"chainId": 42161, | ||
"address": "0x5B237ab26CeD47Fb8ED104671819C801Aa5bA45E", | ||
"name": "stkLyra", | ||
"symbol": "stkLYRA", | ||
"decimals": 18, | ||
"logoURI": "https://raw.githubusercontent.com/lyra-finance/interface/master/app/public/images/staked-lyra-token.png" | ||
} | ||
], | ||
"version": { | ||
"major": 4, | ||
"minor": 3, | ||
"patch": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { TokenInfo } from '@uniswap/token-lists' | ||
|
||
import getArbitrumChainId from '@/app/utils/getArbitrumChainId' | ||
|
||
import useArbitrumTokenList from './useArbitrumTokenList' | ||
|
||
export default function useArbitrumToken(tokenNameOrAddress: string): TokenInfo | null { | ||
const arbitrumTokenList = useArbitrumTokenList() | ||
if (!arbitrumTokenList) { | ||
return null | ||
} | ||
const chainId = getArbitrumChainId() | ||
const token = arbitrumTokenList.find( | ||
token => | ||
(token.address === tokenNameOrAddress || | ||
token.symbol.toLowerCase() === tokenNameOrAddress.toLowerCase() || | ||
token.name.toLowerCase() === tokenNameOrAddress.toLowerCase()) && | ||
token.chainId === chainId | ||
) | ||
return token ?? null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { TokenInfo } from '@uniswap/token-lists' | ||
import { useMemo } from 'react' | ||
|
||
import getUniqueBy from '@/app/utils/getUniqueBy' | ||
|
||
import ARBITRUM_TOKEN_LIST from '../../constants/tokenlists/arbitrum.tokenlist.json' | ||
|
||
export default function useArbitrumTokenList(): TokenInfo[] { | ||
return useMemo( | ||
() => | ||
getUniqueBy( | ||
// Insert custom list last for overrides | ||
[...ARBITRUM_TOKEN_LIST.tokens], | ||
token => `${token.address}-${token.chainId}` | ||
), | ||
[] | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Network } from '@lyrafinance/lyra-js' | ||
import { TokenInfo } from '@uniswap/token-lists' | ||
|
||
import useArbitrumToken from './useArbitrumToken' | ||
import useOptimismToken from './useOptimismToken' | ||
|
||
export default function useNetworkToken(network: Network, tokenNameOrAddress: string): TokenInfo | null { | ||
const arbitrumToken = useArbitrumToken(tokenNameOrAddress) | ||
const optimismToken = useOptimismToken(tokenNameOrAddress) | ||
switch (network) { | ||
case Network.Arbitrum: | ||
return arbitrumToken | ||
case Network.Optimism: | ||
return optimismToken | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"Multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11", | ||
"ArrakisPoolL1": "0xE6f375A29cDd3B40fa7aA0932fF510D304D95FA6", | ||
"WethLyraStakingRewardsL1": "0x1A364a7e66B21ed3045b13D3465627F9e9613f07" | ||
"WethLyraStakingRewardsL1": "0x1A364a7e66B21ed3045b13D3465627F9e9613f07", | ||
"MultiDistributor": "0xecB73D4621Cabbf199e778CAEBc74bE27f2EcEe1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters