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:
parent
805160ea49
commit
e79ae76a8d
@ -29,18 +29,18 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethereumjs/tx": "^3.5.0",
|
"@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",
|
"axios": "^0.21.1",
|
||||||
"blockies-ts": "^1.0.0",
|
"blockies-ts": "^1.0.0",
|
||||||
"caip-api": "^2.0.0-beta.1",
|
"caip-api": "^2.0.0-beta.1",
|
||||||
"cosmos-wallet": "^1.1.0",
|
"cosmos-wallet": "^1.1.0",
|
||||||
"eth-sig-util": "^2.5.3",
|
"eth-sig-util": "^2.5.3",
|
||||||
"ethereumjs-util": "^7.0.6",
|
"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",
|
"prop-types": "^15.7.2",
|
||||||
"qr-image": "^3.2.0",
|
"qr-image": "^3.2.0",
|
||||||
"next": "12.2.4",
|
"next": "12.2.4",
|
||||||
|
@ -10,7 +10,7 @@ export const DEFAULT_MAIN_CHAINS = [
|
|||||||
|
|
||||||
export const DEFAULT_TEST_CHAINS = [
|
export const DEFAULT_TEST_CHAINS = [
|
||||||
// testnets
|
// testnets
|
||||||
"eip155:42",
|
"eip155:5",
|
||||||
"eip155:69",
|
"eip155:69",
|
||||||
"eip155:80001",
|
"eip155:80001",
|
||||||
"eip155:421611",
|
"eip155:421611",
|
||||||
|
@ -145,6 +145,8 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
|||||||
try {
|
try {
|
||||||
setIsInitializing(true);
|
setIsInitializing(true);
|
||||||
|
|
||||||
|
if (!DEFAULT_PROJECT_ID) return;
|
||||||
|
|
||||||
const provider = await UniversalProvider.init({
|
const provider = await UniversalProvider.init({
|
||||||
projectId: DEFAULT_PROJECT_ID,
|
projectId: DEFAULT_PROJECT_ID,
|
||||||
logger: DEFAULT_LOGGER,
|
logger: DEFAULT_LOGGER,
|
||||||
@ -153,6 +155,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
|||||||
|
|
||||||
const web3Modal = new Web3Modal({
|
const web3Modal = new Web3Modal({
|
||||||
projectId: DEFAULT_PROJECT_ID,
|
projectId: DEFAULT_PROJECT_ID,
|
||||||
|
walletConnectVersion: 2,
|
||||||
});
|
});
|
||||||
|
|
||||||
setEthereumProvider(provider);
|
setEthereumProvider(provider);
|
||||||
@ -180,14 +183,6 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
|||||||
|
|
||||||
console.log("Enabling EthereumProvider for chainId: ", chainId);
|
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({
|
const session = await ethereumProvider.connect({
|
||||||
namespaces: {
|
namespaces: {
|
||||||
eip155: {
|
eip155: {
|
||||||
@ -200,7 +195,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
|||||||
],
|
],
|
||||||
chains: [`eip155:${chainId}`],
|
chains: [`eip155:${chainId}`],
|
||||||
events: ["chainChanged", "accountsChanged"],
|
events: ["chainChanged", "accountsChanged"],
|
||||||
rpcMap: customRpcs,
|
rpcMap: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
pairingTopic: pairing?.topic,
|
pairingTopic: pairing?.topic,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import type { NextPage } from "next";
|
import type { NextPage } from "next";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { version } from "@walletconnect/universal-provider/package.json";
|
|
||||||
import * as encoding from "@walletconnect/encoding";
|
import * as encoding from "@walletconnect/encoding";
|
||||||
import { BigNumber, utils } from "ethers";
|
import { BigNumber, utils } from "ethers";
|
||||||
import { TypedDataField } from "@ethersproject/abstract-signer";
|
import { TypedDataField } from "@ethersproject/abstract-signer";
|
||||||
@ -32,7 +31,7 @@ import {
|
|||||||
SToggleContainer,
|
SToggleContainer,
|
||||||
} from "./../components/app";
|
} from "./../components/app";
|
||||||
import { useWalletConnectClient } from "./../contexts/ClientContext";
|
import { useWalletConnectClient } from "./../contexts/ClientContext";
|
||||||
|
import { version } from "../../node_modules/@walletconnect/universal-provider/package.json";
|
||||||
interface IFormattedRpcResponse {
|
interface IFormattedRpcResponse {
|
||||||
method: string;
|
method: string;
|
||||||
address: string;
|
address: string;
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user