chore: bump dependencies ethers dapp (#143)

* chore: updates dependencies

* fix: projectId ts undefined

---------

Co-authored-by: Gancho Radkov <ganchoradkov@gmail.com>
This commit is contained in:
Gancho Radkov 2023-03-24 13:49:39 +02:00 committed by GitHub
parent 805160ea49
commit e79ae76a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1678 additions and 1239 deletions

View File

@ -29,18 +29,18 @@
},
"dependencies": {
"@ethereumjs/tx": "^3.5.0",
"@walletconnect/encoding": "^1.0.1",
"@walletconnect/types": "^2.1.4",
"@walletconnect/universal-provider": "^2.1.4",
"@walletconnect/utils": "^2.1.4",
"@web3modal/standalone": "^2.0.0-beta.10",
"axios": "^0.21.1",
"blockies-ts": "^1.0.0",
"caip-api": "^2.0.0-beta.1",
"cosmos-wallet": "^1.1.0",
"eth-sig-util": "^2.5.3",
"ethereumjs-util": "^7.0.6",
"ethers": "^5.3.0",
"@walletconnect/encoding": "^1.0.2",
"@walletconnect/types": "^2.5.1",
"@walletconnect/universal-provider": "^2.5.1",
"@walletconnect/utils": "^2.5.1",
"@web3modal/standalone": "^2.2.2",
"ethers": "5.7.2",
"prop-types": "^15.7.2",
"qr-image": "^3.2.0",
"next": "12.2.4",

View File

@ -10,7 +10,7 @@ export const DEFAULT_MAIN_CHAINS = [
export const DEFAULT_TEST_CHAINS = [
// testnets
"eip155:42",
"eip155:5",
"eip155:69",
"eip155:80001",
"eip155:421611",

View File

@ -145,6 +145,8 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
try {
setIsInitializing(true);
if (!DEFAULT_PROJECT_ID) return;
const provider = await UniversalProvider.init({
projectId: DEFAULT_PROJECT_ID,
logger: DEFAULT_LOGGER,
@ -153,6 +155,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
const web3Modal = new Web3Modal({
projectId: DEFAULT_PROJECT_ID,
walletConnectVersion: 2,
});
setEthereumProvider(provider);
@ -180,14 +183,6 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
console.log("Enabling EthereumProvider for chainId: ", chainId);
const customRpcs = Object.keys(chainData.eip155).reduce(
(rpcs: Record<string, string>, chainId) => {
rpcs[chainId] = chainData.eip155[chainId].rpc[0];
return rpcs;
},
{},
);
const session = await ethereumProvider.connect({
namespaces: {
eip155: {
@ -200,7 +195,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
],
chains: [`eip155:${chainId}`],
events: ["chainChanged", "accountsChanged"],
rpcMap: customRpcs,
rpcMap: {},
},
},
pairingTopic: pairing?.topic,

View File

@ -1,6 +1,5 @@
import type { NextPage } from "next";
import React, { useState } from "react";
import { version } from "@walletconnect/universal-provider/package.json";
import * as encoding from "@walletconnect/encoding";
import { BigNumber, utils } from "ethers";
import { TypedDataField } from "@ethersproject/abstract-signer";
@ -32,7 +31,7 @@ import {
SToggleContainer,
} from "./../components/app";
import { useWalletConnectClient } from "./../contexts/ClientContext";
import { version } from "../../node_modules/@walletconnect/universal-provider/package.json";
interface IFormattedRpcResponse {
method: string;
address: string;

File diff suppressed because it is too large Load Diff