aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-11 19:49:15 +0800
committerGitHub <noreply@github.com>2018-03-11 19:49:15 +0800
commit870ba445b85aec8331059ebdc80e8d37d73bf9cf (patch)
tree6b29441ee2831f3bc22bf289b9e2bad667199b5b /packages/web3-wrapper
parent0aad2ee005c0d6d530dd870ec1dd38399359a3c4 (diff)
parentcaaa70f6302b0d84d43ca93ab014e0cf37886c0a (diff)
downloaddexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.tar
dexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.tar.gz
dexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.tar.bz2
dexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.tar.lz
dexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.tar.xz
dexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.tar.zst
dexon-0x-contracts-870ba445b85aec8331059ebdc80e8d37d73bf9cf.zip
Merge pull request #444 from 0xProject/dedupWeb3Wrapper
Remove custom web3Wrapper from website
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r--packages/web3-wrapper/CHANGELOG.md4
-rw-r--r--packages/web3-wrapper/src/index.ts5
2 files changed, 8 insertions, 1 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md
index ac0f5ff0b..6dabc7eb4 100644
--- a/packages/web3-wrapper/CHANGELOG.md
+++ b/packages/web3-wrapper/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v0.2.1 _TBD_
+
+ * Add a `getProvider` method (#444)
+
## v0.2.0 _March 4, 2018_
* Ensure all returned user addresses are lowercase (#373)
diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts
index 64a19f531..e14eb2914 100644
--- a/packages/web3-wrapper/src/index.ts
+++ b/packages/web3-wrapper/src/index.ts
@@ -11,7 +11,7 @@ export class Web3Wrapper {
if (_.isUndefined((provider as any).sendAsync)) {
// Web3@1.0 provider doesn't support synchronous http requests,
// so it only has an async `send` method, instead of a `send` and `sendAsync` in web3@0.x.x`
- // We re-assign the send method so that Web3@1.0 providers work with 0x.js
+ // We re-assign the send method so that Web3@1.0 providers work with @0xproject/web3-wrapper
(provider as any).sendAsync = (provider as any).send;
}
this._web3 = new Web3();
@@ -22,6 +22,9 @@ export class Web3Wrapper {
public getContractDefaults(): Partial<TxData> {
return this._defaults;
}
+ public getProvider(): Web3.Provider {
+ return this._web3.currentProvider;
+ }
public setProvider(provider: Web3.Provider) {
this._web3.setProvider(provider);
}