Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to echo-web3-polyfill #3

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"react-scripts": "3.0.0",
"react-svg": "^10.0.9",
"react-timeago": "^4.4.0",
"echo-web3": "^0.1.5",
"react-tooltip": "^3.10.0",
"recharts": "^1.6.2",
"redux": "^4.0.1",
Expand All @@ -50,12 +51,6 @@
"eslintConfig": {
"extends": "react-app"
},
"husky": {
"hooks": {
"pre-commit": "npm run prettier-check",
"pre-push": "npm run lint && npm run test-once"
}
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
Expand Down
23 changes: 15 additions & 8 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"3": "0xff67881f8d12f372d91baae9752eb3631ff0ed00",
"4": "0x8080c7e4b81ecf23aa6f877cfbfd9b0c228c6ffa",
"42": "0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa",
"50": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c"
"50": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
"103": "0x010000000000000000000000000000000000002f"
},
"decimals": 18,
"displayDecimals": 2
Expand All @@ -28,7 +29,8 @@
"3": "0xc778417e063141139fce010982780140aa0cd5ab",
"4": "0xc778417e063141139fce010982780140aa0cd5ab",
"42": "0xd0a1e359811322d97991e03f863a0c30c2cf029c",
"50": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082"
"50": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
"103": "0x0100000000000000000000000000000000000030"
},
"decimals": 18,
"displayDecimals": 2
Expand All @@ -44,7 +46,8 @@
"3": "0xfc8862446cd3e4a2e7167e7d97df738407fead07",
"4": "0x6f2d6ff85efca691aad23d549771160a12f0a0fc",
"42": "0xc4375b7de8af5a38a93548eb8453a498222c4ff2",
"50": "0xbe0037eaf2d64fe5529bca93c18c9702d3930376"
"50": "0xbe0037eaf2d64fe5529bca93c18c9702d3930376",
"103": "0x0100000000000000000000000000000000000032"
}
},
{
Expand All @@ -58,7 +61,8 @@
"3": "0x06732516acd125b6e83c127752ed5f027e1b276e",
"4": "0xb763e26cd6dd09d16f52dc3c60ebb77e46b03290",
"42": "0x7B6B10CAa9E8E9552bA72638eA5b47c25afea1f3",
"50": "0x34d402f14d58e001d8efbe6585051bf9706aa064"
"50": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
"103": "0x0100000000000000000000000000000000000033"
}
},
{
Expand All @@ -72,7 +76,8 @@
"3": "0xb0b443fe0e8a04c4c85e8fda9c5c1ccc057d6653",
"4": "0x6a732d537daf79d75efaeae286d30fc578fa98d0",
"42": "0x8CB3971b8EB709C14616BD556Ff6683019E90d9C",
"50": "0x25b8fe1de9daf8ba351890744ff28cf7dfa8f5e3"
"50": "0x25b8fe1de9daf8ba351890744ff28cf7dfa8f5e3",
"103": "0x0100000000000000000000000000000000000034"
}
},
{
Expand All @@ -86,7 +91,8 @@
"3": "0xc4895a5aafa2708d6bc1294e20ec839aad156b1d",
"4": "0xc40a46ca4bc8e6057ed571e39cf400f3f935e4d5",
"42": "0xA4f468c9c692eb6B4b8b06270dAe7A2CfeedcDe9",
"50": "0xcdb594a32b1cc3479d8746279712c39d18a07fc0"
"50": "0xcdb594a32b1cc3479d8746279712c39d18a07fc0",
"103": "0x0100000000000000000000000000000000000035"
}
},
{
Expand All @@ -100,7 +106,8 @@
"3": "0x823ebe83d39115536274a8617e00a1ff3544fd63",
"4": "0x521c0941300a18a4edc697368f43a6a870be1f3d",
"42": "0x17e394D1Df6cE29d042195Ea38411A98ff3Ead94",
"50": "0x1e2f9e10d02a6b8f8f69fcbf515e75039d2ea30d"
"50": "0x1e2f9e10d02a6b8f8f69fcbf515e75039d2ea30d",
"103": "0x0100000000000000000000000000000000000036"
}
}
],
Expand Down Expand Up @@ -140,4 +147,4 @@
"value": "dai"
}
]
}
}
3 changes: 3 additions & 0 deletions src/services/web3_wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Web3Wrapper } from '@0x/web3-wrapper';
//@ts-ignore
import { EchoPolyfill } from 'echo-web3';

import { sleep } from '../util/sleep';

Expand All @@ -10,6 +12,7 @@ export const isMetamaskInstalled = (): boolean => {
};

export const initializeWeb3Wrapper = async (): Promise<Web3Wrapper | null> => {
await EchoPolyfill();
const { ethereum, web3, location } = window;

if (web3Wrapper) {
Expand Down
1 change: 1 addition & 0 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum Network {
Rinkeby = 4,
Kovan = 42,
Ganache = 50,
EchoTestnet = 103,
}

export interface Token {
Expand Down