diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-05 20:06:58 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-04-05 20:06:58 +0800 |
commit | 89a72ebf0dbff606d511ae51bfee7ffc0a5df18f (patch) | |
tree | 65c935c4c372d2c497bec08164b314866050192b /packages/base-contract | |
parent | 20aaab0847d0ec8b2a44f392ddd467f0c475cfb5 (diff) | |
parent | 7f7ddee0f95f3ed3e903c230088dbee4648771bd (diff) | |
download | dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.tar dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.tar.gz dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.tar.bz2 dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.tar.lz dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.tar.xz dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.tar.zst dexon-sol-tools-89a72ebf0dbff606d511ae51bfee7ffc0a5df18f.zip |
Merge branch 'development' into removeMigrateStep
* development:
Fix tests
Call static functions as static
Address feedback
Move our contract templates to accept Provider instead of Web3Wrapper
Diffstat (limited to 'packages/base-contract')
-rw-r--r-- | packages/base-contract/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/base-contract/src/index.ts | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index bb7cf261f..da957ec83 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "0.2.0", + "changes": [ + { + "note": "Contract wrappers now accept Provider and defaults instead of Web3Wrapper", + "pr": 501 + } + ] + }, + { "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); |