Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"dependencies": {
"@apollo/client": "^3.8.1",
"@bosonprotocol/chat-sdk": "^1.3.1-alpha.9",
"@bosonprotocol/react-kit": "^0.39.0-alpha.2",
"@bosonprotocol/react-kit": "^0.39.0-alpha.4",
"@davatar/react": "^1.10.4",
"@ethersproject/address": "^5.6.1",
"@ethersproject/units": "^5.7.0",
Expand Down
9 changes: 4 additions & 5 deletions src/components/header/accountDrawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { atom } from "jotai";
import { useAtomValue, useUpdateAtom } from "jotai/utils";
import { atom, useAtomValue, useSetAtom } from "jotai";
import { colors } from "lib/styles/colors";
import { CaretDoubleRight } from "phosphor-react";
import { memo, useCallback, useEffect, useRef, useState } from "react";
Expand All @@ -23,14 +22,14 @@ const DRAWER_TOP_MARGIN_MOBILE_WEB = "72px";
const accountDrawerOpenAtom = atom(false);

export function useToggleAccountDrawer() {
const updateAccountDrawerOpen = useUpdateAtom(accountDrawerOpenAtom);
const updateAccountDrawerOpen = useSetAtom(accountDrawerOpenAtom);
return useCallback(() => {
updateAccountDrawerOpen((open) => !open);
}, [updateAccountDrawerOpen]);
}

export function useCloseAccountDrawer() {
const updateAccountDrawerOpen = useUpdateAtom(accountDrawerOpenAtom);
const updateAccountDrawerOpen = useSetAtom(accountDrawerOpenAtom);
return useCallback(
() => updateAccountDrawerOpen(false),
[updateAccountDrawerOpen]
Expand All @@ -44,7 +43,7 @@ export function useAccountDrawer(): [boolean, () => void] {

export function useOpenAccountDrawer(): [boolean, () => void] {
const accountDrawerOpen = useAtomValue(accountDrawerOpenAtom);
const updateAccountDrawerOpen = useUpdateAtom(accountDrawerOpenAtom);
const updateAccountDrawerOpen = useSetAtom(accountDrawerOpenAtom);
return [
accountDrawerOpen,
useCallback(() => updateAccountDrawerOpen(true), [updateAccountDrawerOpen])
Expand Down
7 changes: 3 additions & 4 deletions src/lib/connection/activate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ChainId } from "@uniswap/sdk-core";
import { atom } from "jotai";
import { useAtomValue, useUpdateAtom } from "jotai/utils";
import { atom, useAtomValue, useSetAtom } from "jotai";
import { useCallback } from "react";
import { useAppDispatch } from "state/hooks";
import { updateSelectedWallet } from "state/user/reducer";
Expand Down Expand Up @@ -34,7 +33,7 @@ const activationStateAtom = atom<ActivationState>(IDLE_ACTIVATION_STATE);

function useTryActivation() {
const dispatch = useAppDispatch();
const setActivationState = useUpdateAtom(activationStateAtom);
const setActivationState = useSetAtom(activationStateAtom);

return useCallback(
async (
Expand Down Expand Up @@ -83,7 +82,7 @@ function useTryActivation() {
}

function useCancelActivation() {
const setActivationState = useUpdateAtom(activationStateAtom);
const setActivationState = useSetAtom(activationStateAtom);
return useCallback(
() =>
setActivationState((activationState) => {
Expand Down
15 changes: 8 additions & 7 deletions src/lib/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const SUPPORTED_GAS_ESTIMATE_CHAIN_IDS = [
ChainId.MAINNET,
ChainId.POLYGON,
// ChainId.CELO,
// ChainId.OPTIMISM,
ChainId.OPTIMISM,
// ChainId.ARBITRUM_ONE
// ChainId.BNB,
// ChainId.AVALANCHE,
Expand All @@ -122,6 +122,7 @@ export const TESTNET_CHAIN_IDS = [
ChainId.POLYGON_MUMBAI,
ChainId_POLYGON_AMOY,
ChainId_BASE_SEPOLIA,
ChainId.OPTIMISM_SEPOLIA,
LocalChainId
// ChainId.ARBITRUM_GOERLI,
// ChainId.OPTIMISM_GOERLI,
Expand Down Expand Up @@ -155,8 +156,8 @@ export type SupportedL1ChainId = (typeof L1_CHAIN_IDS)[number];
export const L2_CHAIN_IDS = [
// ChainId.ARBITRUM_ONE,
// ChainId.ARBITRUM_GOERLI,
// ChainId.OPTIMISM,
// ChainId.OPTIMISM_GOERLI
ChainId.OPTIMISM,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE,
ChainId_BASE_SEPOLIA
// ChainId.BASE_GOERLI
Expand All @@ -183,10 +184,10 @@ export function getChainPriority(chainId: number): number {
return 1;
// case ChainId.ARBITRUM_ONE:
// case ChainId.ARBITRUM_GOERLI:
// return 2;
// case ChainId.OPTIMISM:
// case ChainId.OPTIMISM_GOERLI:
// return 3;
// return 2;
case ChainId.OPTIMISM:
case ChainId.OPTIMISM_SEPOLIA:
return 3;
// case ChainId.BNB:
// return 4;
// case ChainId.AVALANCHE:
Expand Down
6 changes: 3 additions & 3 deletions src/lib/constants/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export const DEFAULT_INACTIVE_LIST_URLS: string[] = [
OPTIMISM_LIST,
// CELO_LIST,
// PLASMA_BNB_LIST,
AVALANCHE_LIST,
BASE_LIST,
...UNSUPPORTED_LIST_URLS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not UNSUPPORTED_LIST_URLS anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// AVALANCHE_LIST,
BASE_LIST
// ...UNSUPPORTED_LIST_URLS
];

export const DEFAULT_LIST_OF_LISTS: string[] = [
Expand Down
3 changes: 2 additions & 1 deletion src/lib/constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ export const RPC_PROVIDERS: {
[ChainId.POLYGON]: new AppJsonRpcProvider(ChainId.POLYGON),
[ChainId_POLYGON_AMOY]: new AppJsonRpcProvider(ChainId_POLYGON_AMOY),
[ChainId.BASE]: new AppJsonRpcProvider(ChainId.BASE),
[ChainId_BASE_SEPOLIA]: new AppJsonRpcProvider(ChainId_BASE_SEPOLIA)
[ChainId_BASE_SEPOLIA]: new AppJsonRpcProvider(ChainId_BASE_SEPOLIA),
[ChainId.OPTIMISM_SEPOLIA]: new AppJsonRpcProvider(ChainId.OPTIMISM_SEPOLIA)
};
7 changes: 6 additions & 1 deletion src/lib/constants/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ export const COMMON_BASES: ChainCurrencyList = {
DAI_OPTIMISM,
USDC_OPTIMISM,
USDT_OPTIMISM,
WBTC_OPTIMISM
WBTC_OPTIMISM,
WRAPPED_NATIVE_CURRENCY[ChainId.OPTIMISM] as Token
],
[ChainId.OPTIMISM_GOERLI]: [nativeOnChain(ChainId.OPTIMISM_GOERLI)],
[ChainId.OPTIMISM_SEPOLIA]: [
nativeOnChain(ChainId.OPTIMISM_SEPOLIA),
WRAPPED_NATIVE_CURRENCY[ChainId.OPTIMISM_SEPOLIA] as Token
],
[ChainId.BASE]: [
nativeOnChain(ChainId.BASE),
WRAPPED_NATIVE_CURRENCY[ChainId.BASE] as Token,
Expand Down
7 changes: 7 additions & 0 deletions src/lib/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
"WETH",
"Wrapped Ether"
),
[ChainId.OPTIMISM_SEPOLIA]: new Token(
ChainId.OPTIMISM_SEPOLIA,
"0x4200000000000000000000000000000000000006",
18,
"WETH",
"Wrapped Ether"
),
[ChainId.BASE]: new Token(
ChainId.BASE,
"0x4200000000000000000000000000000000000006",
Expand Down
10 changes: 2 additions & 8 deletions src/lib/utils/uriToHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,11 @@ export default function uriToHttp(uri: string): string[] {
return ["https" + uri.substr(4), uri];
case "ipfs": {
const hash = uri.match(/^ipfs:(\/\/)?(.*)$/i)?.[2];
return [
`https://cloudflare-ipfs.com/ipfs/${hash}/`,
`https://ipfs.io/ipfs/${hash}/`
];
return [`https://ipfs.io/ipfs/${hash}/`];
}
case "ipns": {
const name = uri.match(/^ipns:(\/\/)?(.*)$/i)?.[2];
return [
`https://cloudflare-ipfs.com/ipns/${name}/`,
`https://ipfs.io/ipns/${name}/`
];
return [`https://ipfs.io/ipns/${name}/`];
}
case "ar": {
const tx = uri.match(/^ar:(\/\/)?(.*)$/i)?.[2];
Expand Down
Loading