chore(auth): update to auth-client@2.0.3, use rpc.walletconnect.com (#116)
This commit is contained in:
Generated
+1198
-293
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user