Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Bugs/#77 web3modal (#78)
Browse files Browse the repository at this point in the history
* #77 attempting to debug new error with web3modal

* #77 attempting to debug new error with web3modal

* #77 attempting to debug new error with web3modal

* #77 attempting to debug new error with web3modal

* #77 attempting to debug new error with web3modal

* #77 update packages

* #77 update yarn checksum behaviour

* #77 update vite config
  • Loading branch information
ShravanSunder authored Feb 21, 2022
1 parent 470c195 commit b0efc7e
Show file tree
Hide file tree
Showing 16 changed files with 1,946 additions and 2,938 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ packages/hardhat-ts/cache
/.pnp
.pnp.js
# yarn / eslint
.yarn/cache
.yarn/install-state.gz
.yarn/build-state.yml
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.eslintcache

# testing
Expand Down
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.0.cjs

This file was deleted.

785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.1.0.cjs
yarnPath: .yarn/releases/yarn-3.2.0.cjs

checksumBehavior: "ignore"
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
"packages/subgraph"
]
},
"packageManager": "yarn@3.1.0",
"packageManager": "yarn@3.2.0",
"devDependencies": {
"eslint": "^8.7.0",
"eslint": "^8.9.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.2",
"lint-staged": "^12.3.4",
"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"shx": "^0.3.4"
Expand Down
30 changes: 15 additions & 15 deletions packages/hardhat-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@
"@defi-wonderland/smock": "^2.0.7",
"@eth-optimism/hardhat-ovm": "^0.2.4",
"@ethereum-waffle/ens": "^3.3.1",
"@ethereumjs/vm": "^5.6.0",
"@ethereumjs/vm": "^5.7.1",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/abstract-provider": "^5.5.1",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/networks": "^5.5.2",
"@ethersproject/providers": "^5.5.2",
"@ethersproject/providers": "^5.5.3",
"@ethersproject/solidity": "^5.5.0",
"@ethersproject/units": "^5.5.0",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.10",
"@nomiclabs/hardhat-waffle": "^2.0.2",
"@openzeppelin/contracts": "^4.4.2",
"@openzeppelin/contracts": "^4.5.0",
"@tenderly/hardhat-tenderly": "^1.0.13",
"@typechain/ethers-v5": "^9.0.0",
"@typechain/hardhat": "^4.0.0",
"chalk": "^4.1.2",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.5.3",
"hardhat": "^2.8.3",
"hardhat-deploy": "^0.9.28",
"ethers": "^5.5.4",
"hardhat": "^2.8.4",
"hardhat-deploy": "^0.9.29",
"hardhat-deploy-ethers": "^0.3.0-beta.13",
"ipfs-http-client": "^54.0.2",
"qrcode-terminal": "^0.12.0",
Expand All @@ -56,29 +56,29 @@
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"@types/node": "^16.11.21",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"@types/node": "^16.11.25",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"chai": "^4.3.6",
"dotenv": "^14.3.2",
"eslint": "^8.7.0",
"eslint": "^8.9.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^8.4.0",
"eslint-config-standard-kit": "^0.15.1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-mocha": "^10.0.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^9.2.0",
"mocha": "^9.2.1",
"node-watch": "^0.7.3",
"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"rlp": "^2.2.7",
"solhint": "^3.3.6",
"solhint": "^3.3.7",
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "^0.7.18",
"ts-node": "^10.4.0",
"solidity-coverage": "^0.7.20",
"ts-node": "^10.5.0",
"tsconfig-paths": "^3.12.0",
"typescript": "^4.5.5"
},
Expand Down
65 changes: 32 additions & 33 deletions packages/vite-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,36 @@
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@babel/runtime": "^7.16.7",
"@emotion/react": "^11.7.1",
"@babel/runtime": "^7.17.2",
"@emotion/react": "^11.8.1",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/abstract-provider": "^5.5.1",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/networks": "^5.5.2",
"@ethersproject/providers": "^5.5.2",
"@ethersproject/providers": "^5.5.3",
"@ethersproject/signing-key": "^5.5.0",
"@ethersproject/solidity": "^5.5.0",
"@ethersproject/units": "^5.5.0",
"@maticnetwork/maticjs": "^3.2.0",
"@maticnetwork/maticjs": "^3.2.3",
"@portis/web3": "^4.1.0",
"@ramp-network/ramp-instant-sdk": "^3.0.0",
"@uniswap/sdk": "^3.0.3",
"@uniswap/token-lists": "^1.0.0-beta.24",
"antd": "^4.18.5",
"antd": "^4.18.8",
"authereum": "^0.1.14",
"axios": "^0.25.0",
"buffer": "^6.0.3",
"eth-components": "3.0.29",
"eth-hooks": "4.0.30",
"eth-components": "3.0.39",
"eth-hooks": "4.0.44",
"ethereum-cryptography": "^0.1.3",
"ethers": "^5.5.3",
"ethers": "^5.5.4",
"fortmatic": "^2.2.1",
"graphiql": "^1.5.16",
"graphql": "^16.3.0",
"history": "^5.2.0",
"http-browserify": "^1.7.0",
"ipfs-http-client": "^55.0.0",
"ipfs-http-client": "^54.0.2",
"pretty-time": "^1.1.0",
"process": "^0.11.10",
"qrcode.react": "^1.0.1",
Expand All @@ -62,36 +61,36 @@
"react-dom": "^17.0.2",
"react-error-boundary": "^3.1.4",
"react-qr-reader": "^2.2.1",
"react-query": "^3.34.12",
"react-query": "^3.34.16",
"react-router-dom": "^5.3.0",
"react-stack-grid": "^0.7.1",
"request": "^2.88.2",
"stream": "^0.0.2",
"stream-browserify": "^3.0.0",
"tailwindcss": "^3.0.17",
"tailwindcss": "^3.0.23",
"timers-browserify": "^2.0.12",
"ts-invariant": "^0.9.4",
"use-debounce": "^7.0.1",
"util": "^0.12.4",
"walletlink": "^2.4.5",
"walletlink": "^2.4.7",
"web3modal": "^1.9.5"
},
"devDependencies": {
"@dethcrypto/eth-sdk": "^0.3.0",
"@emotion/types": "^0.7.0",
"@nomiclabs/hardhat-ethers": "^2.0.4",
"@nomiclabs/hardhat-ethers": "^2.0.5",
"@nomiclabs/hardhat-waffle": "^2.0.2",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/line-clamp": "^0.3.1",
"@tailwindcss/typography": "^0.5.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@tailwindcss/typography": "^0.5.2",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^13.5.0",
"@typechain/hardhat": "^4.0.0",
"@types/isomorphic-fetch": "^0.0.35",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.12",
"@types/node": "^16.11.25",
"@types/pretty-time": "^1.1.2",
"@types/qrcode.react": "^1.0.2",
"@types/react": "^17.0.38",
Expand All @@ -100,47 +99,47 @@
"@types/react-qr-reader": "^2.1.4",
"@types/react-router-dom": "^5.3.3",
"@types/react-stack-grid": "^0.7.3",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"@vitejs/plugin-react": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"@vitejs/plugin-react": "^1.2.0",
"@vitejs/plugin-react-refresh": "^1.3.6",
"@walletconnect/ethereum-provider": "^1.7.1",
"@web3-react/types": "^6.0.7",
"autoprefixer": "^10.4.2",
"cross-env": "^7.0.3",
"eslint": "^8.7.0",
"eslint": "^8.9.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-mocha": "^10.0.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-tailwind": "^0.2.1",
"eslint-plugin-testing-library": "^5.0.4",
"eslint-plugin-testing-library": "^5.0.5",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^7.0.4",
"less": "^4.1.2",
"postcss": "^8.4.5",
"postcss": "^8.4.6",
"prettier": "^2.5.1",
"rollup-plugin-polyfill-node": "^0.8.0",
"shx": "^0.3.4",
"stylelint": "^14.3.0",
"stylelint": "^14.5.1",
"stylelint-config-recommended": "^6.0.0",
"surge": "^0.23.1",
"tailwindcss": "^3.0.17",
"tailwindcss": "^3.0.23",
"tailwindcss-elevation": "^1.0.1",
"ts-node": "^10.4.0",
"ts-node": "^10.5.0",
"twin.macro": "^2.8.2",
"typescript": "^4.5.5",
"vite": "^2.7.13",
"vite": "^2.8.4",
"vite-plugin-babel-macros": "^1.0.5",
"vite-plugin-externals": "^0.3.3",
"vite-plugin-externals": "^0.3.4",
"vite-plugin-imp": "^2.1.3",
"vite-tsconfig-paths": "^3.3.17"
"vite-tsconfig-paths": "^3.4.0"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-app-ts/public/dark-theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/vite-app-ts/public/light-theme.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export const useScaffoldProviders = (): IScaffoldAppProviders => {
*/
const autoConnectToBurner = (connector: TEthersModalConnector | undefined): TEthersModalConnector | undefined => {
let newConnector = connector;
if (CONNECT_TO_BURNER_AUTOMATICALLY && connector) {
(connector as EthersModalConnector).loadCore();
if (CONNECT_TO_BURNER_AUTOMATICALLY && connector && connector?.loadWeb3Modal) {
connector.loadWeb3Modal();
if (connector != null && !connector.hasCachedProvider()) {
newConnector = new EthersModalConnector(
{ ...web3Config, theme: currentTheme },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Button, Input, Table, Typography } from 'antd';

import 'graphiql/graphiql.min.css';
// import 'graphiql/graphiql.min.css';

import { Address } from 'eth-components/ant';
import { transactor } from 'eth-components/functions';
import { EthComponentsSettingsContext } from 'eth-components/models';
import { useGasPrice } from 'eth-hooks';
import { useEthersContext } from 'eth-hooks/context';
import { TEthersProvider } from 'eth-hooks/models';
import GraphiQL from 'graphiql';
// import GraphiQL from 'graphiql';
import React, { FC, ReactElement, useContext, useState } from 'react';
import { useQuery } from 'react-query';

Expand Down Expand Up @@ -198,7 +198,7 @@ export const Subgraph: FC<ISubgraphProps> = (props) => {
)}

<div style={{ margin: 32, height: 400, border: '1px solid #888888', textAlign: 'left' }}>
<GraphiQL fetcher={graphQLFetcher} docExplorerOpen query={EXAMPLE_GQL} />
{/* <GraphiQL fetcher={graphQLFetcher} docExplorerOpen query={EXAMPLE_GQL} /> */}
</div>
</div>

Expand Down
14 changes: 11 additions & 3 deletions packages/vite-app-ts/src/config/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,24 @@ if (DEBUG) console.log(`📡 Connecting to ${TARGET_NETWORK_INFO.name}`);
/**
* localhost faucet enabled
*/
export const FAUCET_ENABLED = import.meta.env.VITE_FAUCET_ALLOWED && import.meta.env.DEV;
export const FAUCET_ENABLED = import.meta.env.VITE_FAUCET_ALLOWED === 'true' && import.meta.env.DEV;
/**
* Use burner wallet as fallback
*/
export const BURNER_FALLBACK_ENABLED = import.meta.env.VITE_BURNER_FALLBACK_ALLOWED && import.meta.env.DEV;
export const BURNER_FALLBACK_ENABLED = import.meta.env.VITE_BURNER_FALLBACK_ALLOWED === 'true' && import.meta.env.DEV;
/**
* Connect to burner on first load if there are no cached providers
*/
export const CONNECT_TO_BURNER_AUTOMATICALLY =
import.meta.env.VITE_CONNECT_TO_BURNER_AUTOMATICALLY && import.meta.env.DEV;
import.meta.env.VITE_CONNECT_TO_BURNER_AUTOMATICALLY === 'true' && import.meta.env.DEV;

if (DEBUG)
invariant.log(
`import.meta.env.DEV: ${import.meta.env.DEV}`,
`import.meta.env.VITE_FAUCET_ALLOWED: ${import.meta.env.VITE_FAUCET_ALLOWED}`,
`import.meta.env.VITE_BURNER_FALLBACK_ALLOWED: ${import.meta.env.VITE_BURNER_FALLBACK_ALLOWED}`,
`import.meta.env.VITE_CONNECT_TO_BURNER_AUTOMATICALLY: ${import.meta.env.VITE_CONNECT_TO_BURNER_AUTOMATICALLY}`
);

if (DEBUG)
invariant.log(
Expand Down
6 changes: 3 additions & 3 deletions packages/vite-app-ts/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interface ImportMetaEnv {
readonly VITE_KEY_INFURA: string;
readonly VITE_KEY_ETHERSCAN: string;
readonly VITE_KEY_BLOCKNATIVE_DAPPID: string;
readonly VITE_FAUCET_ALLOWED: boolean;
readonly VITE_BURNER_FALLBACK_ALLOWED: boolean;
readonly VITE_CONNECT_TO_BURNER_AUTOMATICALLY: boolean;
readonly VITE_FAUCET_ALLOWED: string;
readonly VITE_BURNER_FALLBACK_ALLOWED: string;
readonly VITE_CONNECT_TO_BURNER_AUTOMATICALLY: string;
}

interface ImportMeta {
Expand Down
13 changes: 2 additions & 11 deletions packages/vite-app-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,13 @@
"allowJs": false,
"declarationMap": true,
"declaration": true,
"esModuleInterop": true,
"esModuleInterop": false,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"types": [
// "vite/client",
// "node",
// "ethers",
// "@ethersproject/providers",
// "@ethersproject/abstract-provider",
// "@ethersproject/abstract-signer",
// "@ethersproject/wallet"
],
"typeRoots": ["node_modules/@types", "helpers/types"] /* List of folders to include type definitions from. */,
"forceConsistentCasingInFileNames": true,
"forceConsistentCasingInFileNames": false,
"module": "es2020",
"moduleResolution": "Node",
"incremental": true,
Expand Down
1 change: 1 addition & 0 deletions packages/vite-app-ts/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default defineConfig({
define: {},
optimizeDeps: {
exclude: excludeDeps,
include: ['eth-hooks', 'eth-components'],
},
resolve: {
preserveSymlinks: true,
Expand Down
Loading

0 comments on commit b0efc7e

Please sign in to comment.