chore(auth): update to auth-client@2.0.3, use rpc.walletconnect.com (#116)
This commit is contained in:
parent
1ccf19fb2a
commit
9b6dfc366b
1491
dapps/react-dapp-auth/package-lock.json
generated
1491
dapps/react-dapp-auth/package-lock.json
generated
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);
|
||||
|
2443
wallets/react-wallet-auth/package-lock.json
generated
2443
wallets/react-wallet-auth/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user