chore(auth): update to auth-client@2.0.3, use rpc.walletconnect.com (#116)

This commit is contained in:
Ben Kremer
2023-02-16 16:04:36 +01:00
committed by GitHub
parent 1ccf19fb2a
commit 9b6dfc366b
7 changed files with 2834 additions and 1120 deletions
+1198 -293
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -12,7 +12,7 @@
"@chakra-ui/react": "^2.2.6",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
"@walletconnect/auth-client": "^2.0.0",
"@walletconnect/auth-client": "2.0.3",
"better-sqlite3": "^7.6.2",
"ethers": "^5.7.0",
"events": "^3.3.0",
+5 -1
View File
@@ -26,7 +26,11 @@ const Home: NextPage = () => {
nonce: generateNonce(),
statement: "Sign in with wallet.",
})
.then(({ uri }) => setUri(uri));
.then(({ uri }) => {
if (uri) {
setUri(uri);
}
});
}, [client, setUri]);
useEffect(() => {
+5 -2
View File
@@ -9,7 +9,8 @@ import {
Text,
} from "@chakra-ui/react";
import truncate from "smart-truncate";
import { BigNumber, providers } from "ethers";
import { providers } from "ethers";
import { useCallback, useEffect, useState } from "react";
const SignedInView: React.FC<{ address: string }> = ({ address }) => {
@@ -20,7 +21,9 @@ const SignedInView: React.FC<{ address: string }> = ({ address }) => {
useEffect(() => {
const innerEffect = async (address: string) => {
setLoading(true);
const provider = providers.getDefaultProvider();
const provider = new providers.JsonRpcProvider(
`https://rpc.walletconnect.com/v1/?chainId=eip155:1&projectId=${process.env.NEXT_PUBLIC_PROJECT_ID}`
);
const avatar = await provider.getAvatar(address);
const balance = await provider.getBalance(address);
setAvatar(avatar);