Skip to content

Commit

Permalink
addresses update, some fixes by api removing
Browse files Browse the repository at this point in the history
  • Loading branch information
foxier25 committed Sep 28, 2024
1 parent 4f98adc commit e05cbee
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/TopLevelModals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function TopLevelModals() {
const addressClaimToggle = useToggleModal(ApplicationModal.ADDRESS_CLAIM)
const blockedAccountModalOpen = useModalIsOpen(ApplicationModal.BLOCKED_ACCOUNT)
const { account } = useWeb3React()
useAccountRiskCheck(account)
// useAccountRiskCheck(account)
const accountBlocked = Boolean(blockedAccountModalOpen && account)
const fiatOnrampFlagEnabled = useFiatOnrampFlag() === BaseVariant.Enabled

Expand Down
6 changes: 5 additions & 1 deletion src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const V2_ROUTER_ADDRESS: AddressMap = constructSameAddressMap('0x7a250d56
// celo v3 addresses
const CELO_V3_CORE_FACTORY_ADDRESSES = '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc'
const CELO_ROUTER_ADDRESS = '0x5615CDAb10dc425a742d643d949a7F474C01abc4'
const LUX_ROUTER_ADDRESS = '0x043ccF9C207165DA6D4a44ae47488AF49843bADe';
const LUX_V3_FACTORY_ADDRESS = "0x0650683db720c793ff7e609A08b5fc2792c91f39";
const LUX_ROUTER_ADDRESS = '0xE7b0662a7A45d32a8Ce13A0545bA246F32B86a95';
const CELO_V3_MIGRATOR_ADDRESSES = '0x3cFd4d48EDfDCC53D3f173F596f621064614C582'
const CELO_MULTICALL_ADDRESS = '0x633987602DE5C4F337e3DbF265303A1080324204'
const CELO_QUOTER_ADDRESSES = '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8'
Expand All @@ -36,6 +37,7 @@ export const V3_CORE_FACTORY_ADDRESSES: AddressMap = {
]),
[SupportedChainId.CELO]: CELO_V3_CORE_FACTORY_ADDRESSES,
[SupportedChainId.CELO_ALFAJORES]: CELO_V3_CORE_FACTORY_ADDRESSES,
[SupportedChainId.LUX]: LUX_V3_FACTORY_ADDRESS,
}

export const V3_MIGRATOR_ADDRESSES: AddressMap = {
Expand All @@ -60,6 +62,7 @@ export const MULTICALL_ADDRESS: AddressMap = {
[SupportedChainId.ARBITRUM_RINKEBY]: '0xa501c031958F579dB7676fF1CE78AD305794d579',
[SupportedChainId.CELO]: CELO_MULTICALL_ADDRESS,
[SupportedChainId.CELO_ALFAJORES]: CELO_MULTICALL_ADDRESS,
[SupportedChainId.LUX]: "0x9fb423Df995c5b69f538eA86BC81a60254F2ecA3",
}

export const SWAP_ROUTER_ADDRESSES: AddressMap = {
Expand Down Expand Up @@ -129,6 +132,7 @@ export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = {
]),
[SupportedChainId.CELO]: CELO_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
[SupportedChainId.CELO_ALFAJORES]: CELO_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
[SupportedChainId.LUX]: "0xD736808D0cbcC3237b5d8caE10B30FcDcaFf0fEF",
}

export const ENS_REGISTRAR_ADDRESSES: AddressMap = {
Expand Down
3 changes: 1 addition & 2 deletions src/constants/chainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,11 @@ const CHAIN_INFO: ChainInfoMap = {
[SupportedChainId.LUX]: {
networkType: NetworkType.L1,
blockWaitMsBeforeWarning: ms`10m`,
bridge: 'https://bridge.lux.fi/',
docs: 'https://docs.lux.fi/',
logoUrl: celoLogo,
label: "Lux",
nativeCurrency: { name: 'Lux', symbol: 'LUX', decimals: 18 },
explorer: 'https://explorer.lux.fi/',
explorer: 'https://explore.lux.network',
infoLink: 'https://info.uniswap.org/#/lux/',
},
}
Expand Down
5 changes: 4 additions & 1 deletion src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ export const CUSD_CELO = new Token(
18,
'cUSD',
'Celo Dollar'
)
);
const LUX_LUX = new Token(SupportedChainId.LUX, "0x53B1aAA5b6DDFD4eD00D0A7b5Ef333dc74B605b5", 18, "LUX", "LUX");
export const CEUR_CELO = new Token(
SupportedChainId.CELO,
'0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73',
Expand Down Expand Up @@ -465,6 +466,8 @@ export function nativeOnChain(chainId: number): NativeCurrency | Token {
nativeCurrency = new MaticNativeCurrency(chainId)
} else if (isCelo(chainId)) {
nativeCurrency = getCeloNativeCurrency(chainId)
} else if(chainId === SupportedChainId.LUX) {
nativeCurrency = LUX_LUX;
} else {
nativeCurrency = ExtendedEther.onChain(chainId)
}
Expand Down
143 changes: 141 additions & 2 deletions src/graphql/data/__generated__/types-and-hooks.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
22 changes: 11 additions & 11 deletions src/hooks/useBestTrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export function useBestTrade(
)

const [clientSideRouter] = useClientSideRouter()
const routingAPITrade = useRoutingAPITrade(
tradeType,
autoRouterSupported && isWindowVisible ? debouncedAmount : undefined,
debouncedOtherCurrency,
clientSideRouter ? RouterPreference.CLIENT : RouterPreference.API
)
// const routingAPITrade = useRoutingAPITrade(
// tradeType,
// autoRouterSupported && isWindowVisible ? debouncedAmount : undefined,
// debouncedOtherCurrency,
// clientSideRouter ? RouterPreference.CLIENT : RouterPreference.API
// )

const isLoading = routingAPITrade.state === TradeState.LOADING
const useFallback = !autoRouterSupported || routingAPITrade.state === TradeState.NO_ROUTE_FOUND
// const isLoading = routingAPITrade.state === TradeState.LOADING
const useFallback = !autoRouterSupported;

// only use client side router if routing api trade failed or is not supported
const bestV3Trade = useClientSideV3Trade(
Expand All @@ -53,9 +53,9 @@ export function useBestTrade(
// only return gas estimate from api if routing api trade is used
return useMemo(
() => ({
...(useFallback ? bestV3Trade : routingAPITrade),
...(isLoading ? { state: TradeState.LOADING } : {}),
...bestV3Trade,
// ...(isLoading ? { state: TradeState.LOADING } : {}),
}),
[bestV3Trade, isLoading, routingAPITrade, useFallback]
[bestV3Trade, useFallback]
)
}

0 comments on commit e05cbee

Please sign in to comment.