aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsuan Lee <boczeratul@gmail.com>2019-03-06 17:17:49 +0800
committerHsuan Lee <boczeratul@gmail.com>2019-03-06 17:17:49 +0800
commit2a8be43abca45b164acd98cb91836cd50100d312 (patch)
tree3bbfea3c40dc7e1fc2e453b88c63b6dbea94651b
parent0a1a317f013e6a5043ef4abb2ed99474cbc8611a (diff)
downloaddexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.tar
dexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.tar.gz
dexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.tar.bz2
dexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.tar.lz
dexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.tar.xz
dexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.tar.zst
dexon-sol-tools-2a8be43abca45b164acd98cb91836cd50100d312.zip
Update subproviders to new version
-rw-r--r--packages/subproviders/package.json12
-rw-r--r--packages/subproviders/src/globals.d.ts4
-rw-r--r--packages/subproviders/src/index.ts14
-rw-r--r--packages/subproviders/src/subproviders/ganache.ts6
-rw-r--r--packages/subproviders/src/subproviders/metamask_subprovider.ts10
-rw-r--r--packages/subproviders/src/subproviders/nonce_tracker.ts2
-rw-r--r--packages/subproviders/src/subproviders/signer.ts8
-rw-r--r--packages/subproviders/src/subproviders/subprovider.ts2
-rw-r--r--packages/subproviders/src/utils/subprovider_utils.ts2
-rw-r--r--packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts2
-rw-r--r--yarn.lock97
11 files changed, 131 insertions, 28 deletions
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json
index d945be9de..220058a8f 100644
--- a/packages/subproviders/package.json
+++ b/packages/subproviders/package.json
@@ -29,10 +29,10 @@
}
},
"dependencies": {
- "@0x/assert": "^1.0.23",
- "@0x/types": "^1.5.2",
- "@0x/utils": "^3.0.1",
- "@0x/web3-wrapper": "^3.2.4",
+ "@0x/assert": "^2.0.6",
+ "@0x/types": "^2.1.1",
+ "@0x/utils": "^4.2.2",
+ "@0x/web3-wrapper": "^6.0.2",
"@dexon-foundation/ganache-core": "^2.3.2",
"@dexon-foundation/typescript-typings": "^4.0.2",
"@dexon-foundation/web3-provider-engine": "^14.1.1",
@@ -43,7 +43,7 @@
"bip39": "^2.5.0",
"bn.js": "^4.11.8",
"eth-lightwallet": "^3.0.1",
- "ethereum-types": "^1.1.6",
+ "ethereum-types": "^2.1.0",
"ethereumjs-tx": "^1.3.5",
"ethereumjs-util": "^5.1.1",
"hdkey": "^0.7.1",
@@ -52,7 +52,7 @@
"semaphore-async-await": "^1.5.1"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.2",
+ "@0x/tslint-config": "^3.0.0",
"@types/bip39": "^2.4.0",
"@types/bn.js": "^4.11.0",
"@types/ethereumjs-tx": "^1.0.0",
diff --git a/packages/subproviders/src/globals.d.ts b/packages/subproviders/src/globals.d.ts
index d174c2912..3cbf84e37 100644
--- a/packages/subproviders/src/globals.d.ts
+++ b/packages/subproviders/src/globals.d.ts
@@ -4,13 +4,13 @@ declare module '*.json' {
export default json;
/* tslint:enable */
}
-declare module '@dexon-foundation/web3-provider-engine/util/rpc-cache-utils' {
+declare module 'web3-provider-engine/util/rpc-cache-utils' {
class ProviderEngineRpcUtils {
public static blockTagForPayload(payload: any): string | null;
}
export = ProviderEngineRpcUtils;
}
-declare module '@dexon-foundation/web3-provider-engine/subproviders/fixture' {
+declare module 'web3-provider-engine/subproviders/fixture' {
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
class FixtureSubprovider {
constructor(staticResponses: any);
diff --git a/packages/subproviders/src/index.ts b/packages/subproviders/src/index.ts
index f438ea11a..bbb58c5a4 100644
--- a/packages/subproviders/src/index.ts
+++ b/packages/subproviders/src/index.ts
@@ -1,6 +1,6 @@
import Eth from '@ledgerhq/hw-app-eth';
import TransportU2F from '@ledgerhq/hw-transport-u2f';
-export import Web3ProviderEngine = require('@dexon-foundation/web3-provider-engine');
+export import Web3ProviderEngine = require('web3-provider-engine');
import { LedgerEthereumClient } from './types';
@@ -52,8 +52,16 @@ export { ECSignature, EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Ty
export {
JSONRPCRequestPayload,
- Provider,
+ SupportedProvider,
JSONRPCResponsePayload,
- JSONRPCErrorCallback,
JSONRPCResponseError,
+ JSONRPCErrorCallback,
+ Web3JsProvider,
+ GanacheProvider,
+ EIP1193Provider,
+ ZeroExProvider,
+ EIP1193Event,
+ Web3JsV1Provider,
+ Web3JsV2Provider,
+ Web3JsV3Provider,
} from 'ethereum-types';
diff --git a/packages/subproviders/src/subproviders/ganache.ts b/packages/subproviders/src/subproviders/ganache.ts
index f42d6deac..6e53eeecc 100644
--- a/packages/subproviders/src/subproviders/ganache.ts
+++ b/packages/subproviders/src/subproviders/ganache.ts
@@ -1,5 +1,5 @@
-import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
-import * as Ganache from '@dexon-foundation/ganache-core';
+import { GanacheProvider, JSONRPCRequestPayload } from 'ethereum-types';
+import * as Ganache from 'ganache-core';
import { Callback, ErrorCallback } from '../types';
@@ -10,7 +10,7 @@ import { Subprovider } from './subprovider';
* It intercepts all JSON RPC requests and relays them to an in-process ganache instance.
*/
export class GanacheSubprovider extends Subprovider {
- private readonly _ganacheProvider: Provider;
+ private readonly _ganacheProvider: GanacheProvider;
/**
* Instantiates a GanacheSubprovider
* @param opts The desired opts with which to instantiate the Ganache provider
diff --git a/packages/subproviders/src/subproviders/metamask_subprovider.ts b/packages/subproviders/src/subproviders/metamask_subprovider.ts
index ba207d4cc..bb85cf771 100644
--- a/packages/subproviders/src/subproviders/metamask_subprovider.ts
+++ b/packages/subproviders/src/subproviders/metamask_subprovider.ts
@@ -1,5 +1,6 @@
+import { providerUtils } from '@0x/utils';
import { marshaller, Web3Wrapper } from '@0x/web3-wrapper';
-import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
+import { JSONRPCRequestPayload, SupportedProvider, ZeroExProvider } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
import { Callback, ErrorCallback } from '../types';
@@ -16,13 +17,14 @@ import { Subprovider } from './subprovider';
*/
export class MetamaskSubprovider extends Subprovider {
private readonly _web3Wrapper: Web3Wrapper;
- private readonly _provider: Provider;
+ private readonly _provider: ZeroExProvider;
/**
* Instantiates a new MetamaskSubprovider
- * @param provider Web3 provider that should handle all user account related requests
+ * @param supportedProvider Web3 provider that should handle all user account related requests
*/
- constructor(provider: Provider) {
+ constructor(supportedProvider: SupportedProvider) {
super();
+ const provider = providerUtils.standardizeOrThrow(supportedProvider);
this._web3Wrapper = new Web3Wrapper(provider);
this._provider = provider;
}
diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts
index 4e4013d23..eea722aee 100644
--- a/packages/subproviders/src/subproviders/nonce_tracker.ts
+++ b/packages/subproviders/src/subproviders/nonce_tracker.ts
@@ -3,7 +3,7 @@ import * as _ from 'lodash';
import { BlockParamLiteral, JSONRPCRequestPayload } from 'ethereum-types';
import EthereumTx = require('ethereumjs-tx');
import ethUtil = require('ethereumjs-util');
-import providerEngineUtils = require('@dexon-foundation/web3-provider-engine/util/rpc-cache-utils');
+import providerEngineUtils = require('web3-provider-engine/util/rpc-cache-utils');
import { Callback, ErrorCallback, NextCallback, NonceSubproviderErrors } from '../types';
diff --git a/packages/subproviders/src/subproviders/signer.ts b/packages/subproviders/src/subproviders/signer.ts
index 9bd5cbdf1..21752c406 100644
--- a/packages/subproviders/src/subproviders/signer.ts
+++ b/packages/subproviders/src/subproviders/signer.ts
@@ -1,5 +1,5 @@
import { marshaller, Web3Wrapper } from '@0x/web3-wrapper';
-import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
+import { JSONRPCRequestPayload, SupportedProvider } from 'ethereum-types';
import { Callback, ErrorCallback } from '../types';
@@ -15,11 +15,11 @@ export class SignerSubprovider extends Subprovider {
private readonly _web3Wrapper: Web3Wrapper;
/**
* Instantiates a new SignerSubprovider.
- * @param provider Web3 provider that should handle all user account related requests
+ * @param supportedProvider Web3 provider that should handle all user account related requests
*/
- constructor(provider: Provider) {
+ constructor(supportedProvider: SupportedProvider) {
super();
- this._web3Wrapper = new Web3Wrapper(provider);
+ this._web3Wrapper = new Web3Wrapper(supportedProvider);
}
/**
* This method conforms to the web3-provider-engine interface.
diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts
index 214375dfd..444a8786b 100644
--- a/packages/subproviders/src/subproviders/subprovider.ts
+++ b/packages/subproviders/src/subproviders/subprovider.ts
@@ -1,6 +1,6 @@
import { promisify } from '@0x/utils';
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
-import Web3ProviderEngine = require('@dexon-foundation/web3-provider-engine');
+import Web3ProviderEngine = require('web3-provider-engine');
import { Callback, ErrorCallback, JSONRPCRequestPayloadWithMethod } from '../types';
/**
diff --git a/packages/subproviders/src/utils/subprovider_utils.ts b/packages/subproviders/src/utils/subprovider_utils.ts
index f63699de2..beda408ab 100644
--- a/packages/subproviders/src/utils/subprovider_utils.ts
+++ b/packages/subproviders/src/utils/subprovider_utils.ts
@@ -1,4 +1,4 @@
-import Web3ProviderEngine = require('@dexon-foundation/web3-provider-engine');
+import Web3ProviderEngine = require('web3-provider-engine');
import { Subprovider } from '../subproviders/subprovider';
diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
index e0fae763a..a5cef30dc 100644
--- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
+++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
@@ -1,5 +1,5 @@
import * as chai from 'chai';
-import FixtureSubprovider = require('@dexon-foundation/web3-provider-engine/subproviders/fixture');
+import FixtureSubprovider = require('web3-provider-engine/subproviders/fixture');
import { promisify } from '@0x/utils';
import EthereumTx = require('ethereumjs-tx');
diff --git a/yarn.lock b/yarn.lock
index e758ba0ac..ce0fef3a1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -482,6 +482,17 @@
lodash "^4.17.5"
valid-url "^1.0.9"
+"@0x/assert@^2.0.6":
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/@0x/assert/-/assert-2.0.6.tgz#3eb444818d45f857fe187454e50f8d28aeb1c2b3"
+ integrity sha512-MYmbb9oh7Mgf/Ko0h3B5VpRqHzctt0I/+vyQpt/8CmaSVFS0xj8fsvRwFeEqNnI4FIBuVJxEoiHzODJxBGxiTQ==
+ dependencies:
+ "@0x/json-schemas" "^3.0.6"
+ "@0x/typescript-typings" "^4.1.0"
+ "@0x/utils" "^4.2.2"
+ lodash "^4.17.11"
+ valid-url "^1.0.9"
+
"@0x/dev-utils@^1.0.24":
version "1.0.24"
resolved "https://registry.yarnpkg.com/@0x/dev-utils/-/dev-utils-1.0.24.tgz#7fa1d209865a502fef23933e6a85df00f4dad8ab"
@@ -505,6 +516,16 @@
jsonschema "^1.2.0"
lodash.values "^4.3.0"
+"@0x/json-schemas@^3.0.6":
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/@0x/json-schemas/-/json-schemas-3.0.6.tgz#f372bc81a587ab8db902225e69a497707030cac0"
+ integrity sha512-PFbsRHTXhQdO2eqCGzeIXsL+SUsx9GBO7Trkkq3xDQuqMGwNfuqeZN//UEfhaIRYi35EeqH1LNowYBFyUp+Q6g==
+ dependencies:
+ "@0x/typescript-typings" "^4.1.0"
+ "@types/node" "*"
+ jsonschema "^1.2.0"
+ lodash.values "^4.3.0"
+
"@0x/sol-resolver@^1.2.3":
version "1.2.3"
resolved "https://registry.yarnpkg.com/@0x/sol-resolver/-/sol-resolver-1.2.3.tgz#d45d18a6bdeb212abf791b1cbbeac1bb780a94d0"
@@ -553,6 +574,17 @@
tslint-react "^3.2.0"
tsutils "3.0.0"
+"@0x/tslint-config@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@0x/tslint-config/-/tslint-config-3.0.0.tgz#ddb4e0d3ee28387e777a26eb7e4b669b8799cad6"
+ integrity sha512-PThQr5CIZH6V4k4buiuU6/f0zn+Bmf9kf5kSBaLYgE3R2p3C7ONWAPcKZT99Y1QQ/nT/1N0uv0Ylzv2xw1y0Bw==
+ dependencies:
+ lodash "^4.17.11"
+ tslint "5.11.0"
+ tslint-eslint-rules "5.4.0"
+ tslint-react "^3.2.0"
+ tsutils "3.0.0"
+
"@0x/types@^1.5.2":
version "1.5.2"
resolved "https://registry.yarnpkg.com/@0x/types/-/types-1.5.2.tgz#19c99ff796664fc256facb10e704aa6541912551"
@@ -561,6 +593,15 @@
bignumber.js "~4.1.0"
ethereum-types "^1.1.6"
+"@0x/types@^2.1.1":
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/@0x/types/-/types-2.1.1.tgz#7082aa789a2c616f7c533c916af03f39c5c739a0"
+ integrity sha512-V/kYmTpZnrjVSYtvgVLh6CKhkbcZ5OAw4sSJpalVjfCDt1HVGmDVSJTDISpeO2tG3+q+DYf9QNP2J8lhAaDeoA==
+ dependencies:
+ "@types/node" "*"
+ bignumber.js "~8.0.2"
+ ethereum-types "^2.1.0"
+
"@0x/typescript-typings@^3.0.8":
version "3.0.8"
resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-3.0.8.tgz#85689e477c1cb5e5bd3eeee0dd1e73e9c2f1db83"
@@ -571,6 +612,17 @@
ethereum-types "^1.1.6"
popper.js "1.14.3"
+"@0x/typescript-typings@^4.1.0":
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/@0x/typescript-typings/-/typescript-typings-4.1.0.tgz#facf20f482ae7e18a6791752a3187d0301507a1d"
+ integrity sha512-kBzmTGo55J/rEbYN0MRWB+QmuyDqDE5J6/L5n9i+U9tLyJjVVlMCT3U/BjsSLo8hAR99qKJ960bMO4JkTpJHbA==
+ dependencies:
+ "@types/bn.js" "^4.11.0"
+ "@types/react" "*"
+ bignumber.js "~8.0.2"
+ ethereum-types "^2.1.0"
+ popper.js "1.14.3"
+
"@0x/utils@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-3.0.1.tgz#20ada4a98f001c0a6656d45ae56e111b73ef8803"
@@ -589,6 +641,25 @@
js-sha3 "^0.7.0"
lodash "^4.17.5"
+"@0x/utils@^4.2.2":
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/@0x/utils/-/utils-4.2.2.tgz#d37777332be999e26011a1128e70900815578b70"
+ integrity sha512-+bdUa7e9747O148dhwJbdZE72p7W+DZGXMZnJEA2X+oxLkz1OhCTSKRm8nohCcCS9ZGCcBuV9RyUGGkAeL0ztQ==
+ dependencies:
+ "@0x/types" "^2.1.1"
+ "@0x/typescript-typings" "^4.1.0"
+ "@types/node" "*"
+ abortcontroller-polyfill "^1.1.9"
+ bignumber.js "~8.0.2"
+ chalk "^2.3.0"
+ detect-node "2.0.3"
+ ethereum-types "^2.1.0"
+ ethereumjs-util "^5.1.1"
+ ethers "~4.0.4"
+ isomorphic-fetch "2.2.1"
+ js-sha3 "^0.7.0"
+ lodash "^4.17.11"
+
"@0x/web3-wrapper@^3.2.4":
version "3.2.4"
resolved "https://registry.yarnpkg.com/@0x/web3-wrapper/-/web3-wrapper-3.2.4.tgz#02d84e36866d3b7c4b71ed2ddf23c05f73bb340d"
@@ -602,6 +673,20 @@
ethers "~4.0.4"
lodash "^4.17.5"
+"@0x/web3-wrapper@^6.0.2":
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/@0x/web3-wrapper/-/web3-wrapper-6.0.2.tgz#cdf6c5cf42c9593a1e3430030e14457b01a56eb2"
+ integrity sha512-1J1Sc7X3XyAILtysdhCuKLg1RJf1X3C5/r65abUbxwdlAMXs9VjjpY17qBzGbJoG4GfwoCprSLdqIlsKcWp7RQ==
+ dependencies:
+ "@0x/assert" "^2.0.6"
+ "@0x/json-schemas" "^3.0.6"
+ "@0x/typescript-typings" "^4.1.0"
+ "@0x/utils" "^4.2.2"
+ ethereum-types "^2.1.0"
+ ethereumjs-util "^5.1.1"
+ ethers "~4.0.4"
+ lodash "^4.17.11"
+
"@0xproject/npm-cli-login@^0.0.11":
version "0.0.11"
resolved "https://registry.yarnpkg.com/@0xproject/npm-cli-login/-/npm-cli-login-0.0.11.tgz#3f1ec06112ce62aad300ff0575358f68aeecde2e"
@@ -1448,7 +1533,7 @@
version "9.6.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.5.tgz#ee700810fdf49ac1c399fc5980b7559b3e5a381d"
-"@types/node@^10.3.2":
+"@types/node@10.9.4", "@types/node@^10.3.2":
version "10.9.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897"
@@ -4563,6 +4648,14 @@ ethereum-types@^1.1.6:
"@types/node" "*"
bignumber.js "~4.1.0"
+ethereum-types@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-2.1.0.tgz#cfa453c3b1d6dd934b7e71b6e530a0d45484fce8"
+ integrity sha512-qPQeUruCvUYO/KRXcZKj5Nfu15Xc0DiuafvtJdhYKNCUTWTW1BpikaiNbi/3TSflzKy05SugLxNtAJjCrnvu6w==
+ dependencies:
+ "@types/node" "10.9.4"
+ bignumber.js "~8.0.2"
+
ethereumjs-abi@0.6.5:
version "0.6.5"
resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241"
@@ -7097,7 +7190,7 @@ lodash@^4.14.0, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0:
version "4.17.5"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
-lodash@^4.5.1:
+lodash@^4.17.11, lodash@^4.5.1:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"