Skip to content

Commit

Permalink
chain id env
Browse files Browse the repository at this point in the history
  • Loading branch information
osiastedian committed Sep 25, 2024
1 parent ef9fa72 commit 8382bd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions contexts/PaliWallet/V2Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ declare global {

export const PaliWalletV2Provider: React.FC<{
children: React.ReactElement;
}> = ({ children }) => {
chainId: string;
}> = ({ children, chainId }) => {
const queryClient = useQueryClient();
const installed = useQuery(["pali", "is-installed"], {
queryFn: () => {
Expand Down Expand Up @@ -152,7 +153,7 @@ export const PaliWalletV2Provider: React.FC<{
() =>
connectedAccount.isSuccess &&
connectedAccount.data &&
isValidSYSAddress(connectedAccount.data.address, CHAIN_ID)
isValidSYSAddress(connectedAccount.data.address, parseInt(chainId))
? connectedAccount.data.address
: undefined,
[connectedAccount.data, connectedAccount.isSuccess]
Expand Down Expand Up @@ -220,7 +221,7 @@ export const PaliWalletV2Provider: React.FC<{
method: "sys_changeUTXOEVM",
params: [
{
chainId: CHAIN_ID,
chainId,
},
],
})
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function MyApp({ Component, pageProps, router }: AppProps) {
}
return (
<QueryClientProvider client={queryClient}>
<PaliWalletV2Provider>
<PaliWalletV2Provider chainId={process.env.NEXT_PUBLIC_CHAIN_ID!}>
<MetamaskProvider>
<NEVMProvider>
<ConnectedWalletProvider>
Expand Down

0 comments on commit 8382bd0

Please sign in to comment.