From a8ac464a8a6c75d97a20145fd012e84f840413c2 Mon Sep 17 00:00:00 2001
From: Sero <69639595+Seroxdesign@users.noreply.github.com>
Date: Mon, 1 Apr 2024 07:08:58 -0400
Subject: [PATCH] composedb ID chain
---
.../actions/composeDB/updatePlayerFromComposeDB.ts | 2 +-
packages/web/components/ConnectToProgress.tsx | 4 ++--
packages/web/components/EditProfileModal.tsx | 2 +-
packages/web/components/Player/PlayerStart.tsx | 2 +-
.../components/Player/Profile/ComposeDBPromptModal.tsx | 4 ++--
packages/web/components/Setup/SetupHeader.tsx | 2 +-
packages/web/components/Setup/WizardPane.tsx | 2 +-
packages/web/components/SwitchNetworkButton.tsx | 2 +-
packages/web/contexts/ComposeDBContext.tsx | 5 ++---
packages/web/pages/_app.tsx | 8 ++++----
packages/web/utils/playerHelpers.ts | 1 -
11 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/packages/backend/src/handlers/actions/composeDB/updatePlayerFromComposeDB.ts b/packages/backend/src/handlers/actions/composeDB/updatePlayerFromComposeDB.ts
index 1209c7ff2a..33a9a905c9 100644
--- a/packages/backend/src/handlers/actions/composeDB/updatePlayerFromComposeDB.ts
+++ b/packages/backend/src/handlers/actions/composeDB/updatePlayerFromComposeDB.ts
@@ -62,7 +62,7 @@ export const updatePlayerFromComposeDB = async (
({ did } = await Caip10Link.fromAccount(
composeDBClient.context.ceramic,
// mainnet; the site prompts them to switch if necessary
- `${ethereumAddress.toLowerCase()}@eip155:1`,
+ `${ethereumAddress.toLowerCase()}@eip155:10`,
));
try {
diff --git a/packages/web/components/ConnectToProgress.tsx b/packages/web/components/ConnectToProgress.tsx
index e8670bd256..5b81eb9f17 100644
--- a/packages/web/components/ConnectToProgress.tsx
+++ b/packages/web/components/ConnectToProgress.tsx
@@ -36,14 +36,14 @@ export const ConnectToProgress: React.FC<{
const { fetching } = useUser();
if (isConnected && !fetching) {
- if (chainId !== 1 && showSwitchButton) {
+ if (chainId !== 10 && showSwitchButton) {
return (
{header && {header}}
- Please switch to to progress
+ Please switch to to progress
diff --git a/packages/web/components/EditProfileModal.tsx b/packages/web/components/EditProfileModal.tsx
index 0b7e8d0949..5fdaee9334 100644
--- a/packages/web/components/EditProfileModal.tsx
+++ b/packages/web/components/EditProfileModal.tsx
@@ -248,7 +248,7 @@ export const EditProfileModal: React.FC = ({
}
};
- if (chainId !== '0x1') {
+ if (chainId !== '0xa') {
return (
diff --git a/packages/web/components/Player/PlayerStart.tsx b/packages/web/components/Player/PlayerStart.tsx
index d02debbcd8..fb1d6466e3 100644
--- a/packages/web/components/Player/PlayerStart.tsx
+++ b/packages/web/components/Player/PlayerStart.tsx
@@ -24,7 +24,7 @@ export const PlayerStart: React.FC = () => {
}, [connected, user, fetching]);
const canRedirect = useMemo(
- () => connected && !fetching && chainId === '0x1',
+ () => connected && !fetching && chainId === '0xa',
[connected, fetching, chainId],
);
diff --git a/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx b/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx
index 1d01498a66..6df3a35488 100644
--- a/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx
+++ b/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx
@@ -200,13 +200,13 @@ export const ComposeDBPromptModal: React.FC = ({
- {chainId === '0x1' ? (
+ {chainId === '0xa' ? (
{status}
) : (
- Please switch to to
+ Please switch to to
progress.
)}
diff --git a/packages/web/components/Setup/SetupHeader.tsx b/packages/web/components/Setup/SetupHeader.tsx
index 13587fe66d..4f90ff5e08 100644
--- a/packages/web/components/Setup/SetupHeader.tsx
+++ b/packages/web/components/Setup/SetupHeader.tsx
@@ -27,7 +27,7 @@ export const SetupHeader: React.FC = () => {
);
const { connected, chainId } = useWeb3();
- if (!connected || chainId !== '0x1') return null;
+ if (!connected || chainId !== '0xa') return null;
return (
diff --git a/packages/web/components/Setup/WizardPane.tsx b/packages/web/components/Setup/WizardPane.tsx
index 98a3c8b7e6..40e70d4791 100644
--- a/packages/web/components/Setup/WizardPane.tsx
+++ b/packages/web/components/Setup/WizardPane.tsx
@@ -79,7 +79,7 @@ export const WizardPane = ({
}
}, [current, defaultValues, dirtyFields, field, resetField]);
- const wrongChain = chainId != null && chainId !== '0x1';
+ const wrongChain = chainId != null && chainId !== '0xa';
if ((!connecting && !connected) || wrongChain) {
return ;
}
diff --git a/packages/web/components/SwitchNetworkButton.tsx b/packages/web/components/SwitchNetworkButton.tsx
index 3b85a64c71..724a0b627b 100644
--- a/packages/web/components/SwitchNetworkButton.tsx
+++ b/packages/web/components/SwitchNetworkButton.tsx
@@ -5,7 +5,7 @@ import { NETWORK_INFO } from 'utils/networks';
import { useSwitchChain } from 'wagmi';
export const SwitchNetworkButton: React.FC<{ chainId?: string }> = ({
- chainId = '0x1',
+ chainId = '0xa',
}) => {
const { connected } = useWeb3();
const networkInfo = NETWORK_INFO[chainId];
diff --git a/packages/web/contexts/ComposeDBContext.tsx b/packages/web/contexts/ComposeDBContext.tsx
index b68db06674..13cfac5f73 100644
--- a/packages/web/contexts/ComposeDBContext.tsx
+++ b/packages/web/contexts/ComposeDBContext.tsx
@@ -35,7 +35,6 @@ export const ComposeDBContextProvider: React.FC = ({
children,
}) => {
const { chainId, provider } = useWeb3();
-
const [connecting, setConnecting] = useState(false);
const [authenticated, setAuthenticated] = useState(false);
@@ -67,8 +66,8 @@ export const ComposeDBContextProvider: React.FC = ({
const connect = useCallback(async () => {
if (provider == null || connecting) return;
- if (chainId !== '0x1') {
- throw new CeramicError('ComposeDB should be used on mainnet only');
+ if (chainId !== '0xa') {
+ throw new CeramicError('ComposeDB should be used on Optimism only');
}
setConnecting(true);
diff --git a/packages/web/pages/_app.tsx b/packages/web/pages/_app.tsx
index d02838dbb4..7160e185bf 100644
--- a/packages/web/pages/_app.tsx
+++ b/packages/web/pages/_app.tsx
@@ -20,17 +20,17 @@ import { mainnet, optimism, polygon } from 'wagmi/chains';
const config = createConfig(
getDefaultConfig({
- chains: [mainnet, optimism, polygon],
+ chains: [optimism, polygon, mainnet],
transports: {
+ [optimism.id]: http(
+ `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`,
+ ),
[mainnet.id]: http(
`https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`,
),
[polygon.id]: http(
`https://polygon-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`,
),
- [optimism.id]: http(
- `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`,
- ),
},
// Required API Keys
diff --git a/packages/web/utils/playerHelpers.ts b/packages/web/utils/playerHelpers.ts
index 9e1ab1941b..eeaad3681d 100644
--- a/packages/web/utils/playerHelpers.ts
+++ b/packages/web/utils/playerHelpers.ts
@@ -9,7 +9,6 @@ import {
Maybe,
profileMapping,
} from '@metafam/utils';
-import ProfileIcon from 'assets/generic-user-icon.svg';
import GuildCoverImageFull from 'assets/guild-background-full.jpeg';
import GuildCoverImageSmall from 'assets/guild-background-small.jpeg';
import PlayerCoverImageSmall from 'assets/player-background-small.jpg';