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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 2834 additions and 1120 deletions

File diff suppressed because it is too large Load Diff

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",

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(() => {

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);

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,8 @@
"@nextui-org/react": "1.0.8-beta.5",
"@polkadot/keyring": "^10.1.2",
"@solana/web3.js": "1.43.0",
"@walletconnect/auth-client": "^2.0.0",
"@walletconnect/utils": "2.0.0",
"@walletconnect/auth-client": "2.0.3",
"@walletconnect/utils": "2.4.3",
"bs58": "5.0.0",
"cosmos-wallet": "1.2.0",
"ethers": "5.6.6",

View File

@ -10,6 +10,7 @@ export default function useWalletConnectEventsManager(initialized: boolean) {
useEffect(() => {
if (initialized) {
authClient.on('auth_request', ({ id, params }) => {
console.log('auth_request', { id, params })
ModalStore.open('AuthenticationRequest', {
authenticationRequest: {
id,