aboutsummaryrefslogtreecommitdiffstats
path: root/packages/base-contract
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-04-03 21:19:38 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-04-04 16:56:32 +0800
commit249bf0163d8ee71b7329fd58b72e554c0324279c (patch)
tree5bfb30b082236bd089e35186220bdb02913ba128 /packages/base-contract
parent674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf (diff)
downloaddexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.tar
dexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.gz
dexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.bz2
dexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.lz
dexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.xz
dexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.zst
dexon-0x-contracts-249bf0163d8ee71b7329fd58b72e554c0324279c.zip
Move our contract templates to accept Provider instead of Web3Wrapper
Diffstat (limited to 'packages/base-contract')
-rw-r--r--packages/base-contract/CHANGELOG.json10
-rw-r--r--packages/base-contract/src/index.ts6
2 files changed, 13 insertions, 3 deletions
diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json
index bb7cf261f..e86023b18 100644
--- a/packages/base-contract/CHANGELOG.json
+++ b/packages/base-contract/CHANGELOG.json
@@ -1,5 +1,15 @@
[
{
+ "version": "0.2.0",
+ "changes": [
+ {
+ "note": "Contract wrappers now accept Provider and defaults instead of our Web3Wrapper",
+ "pr": 501
+ }
+ ],
+ "timestamp": 1522673609
+ },
+ {
"version": "0.1.0",
"changes": [
{
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts
index c8cbd7886..bba686f8b 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -1,4 +1,4 @@
-import { ContractAbi, DataItem, TxData, TxDataPayable } from '@0xproject/types';
+import { ContractAbi, DataItem, Provider, TxData, TxDataPayable } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as ethersContracts from 'ethers-contracts';
@@ -49,8 +49,8 @@ export class BaseContract {
}
return txDataWithDefaults;
}
- constructor(web3Wrapper: Web3Wrapper, abi: ContractAbi, address: string) {
- this._web3Wrapper = web3Wrapper;
+ constructor(abi: ContractAbi, address: string, provider: Provider, defaults?: Partial<TxData>) {
+ this._web3Wrapper = new Web3Wrapper(provider, defaults);
this.abi = abi;
this.address = address;
this._ethersInterface = new ethersContracts.Interface(abi);