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/0x.js/src/contract_wrappers | |
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/0x.js/src/contract_wrappers')
5 files changed, 37 insertions, 12 deletions
diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index f52dba2f1..fd39de34b 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -191,7 +191,12 @@ export class EtherTokenWrapper extends ContractWrapper { artifacts.EtherTokenArtifact, etherTokenAddress, ); - const contractInstance = new EtherTokenContract(this._web3Wrapper, abi, address); + const contractInstance = new EtherTokenContract( + abi, + address, + this._web3Wrapper.getProvider(), + this._web3Wrapper.getContractDefaults(), + ); etherTokenContract = contractInstance; this._etherTokenContractsByAddress[etherTokenAddress] = etherTokenContract; return etherTokenContract; diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 53f32f111..378ae8111 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -170,7 +170,7 @@ export class ExchangeWrapper extends ContractWrapper { * @param shouldThrowOnInsufficientBalanceOrAllowance Whether or not you wish for the contract call to throw * if upon execution the tokens cannot be transferred. * @param takerAddress The user Ethereum address who would like to fill this order. - * Must be available via the supplied Web3.Provider + * Must be available via the supplied Provider * passed to 0x.js. * @param orderTransactionOpts Optional arguments this method accepts. * @return Transaction hash. @@ -235,7 +235,7 @@ export class ExchangeWrapper extends ContractWrapper { * If set to false, the call will continue to fill subsequent * signedOrders even when some cannot be filled. * @param takerAddress The user Ethereum address who would like to fill these - * orders. Must be available via the supplied Web3.Provider + * orders. Must be available via the supplied Provider * passed to 0x.js. * @param orderTransactionOpts Optional arguments this method accepts. * @return Transaction hash. @@ -335,7 +335,7 @@ export class ExchangeWrapper extends ContractWrapper { * cannot be filled. * @param takerAddress The user Ethereum address who would like to fill * these orders. Must be available via the supplied - * Web3.Provider passed to 0x.js. + * Provider passed to 0x.js. * @param orderTransactionOpts Optional arguments this method accepts. * @return Transaction hash. */ @@ -416,7 +416,7 @@ export class ExchangeWrapper extends ContractWrapper { * signedOrder you wish to fill. * @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill. * @param takerAddress The user Ethereum address who would like to fill this order. - * Must be available via the supplied Web3.Provider passed to 0x.js. + * Must be available via the supplied Provider passed to 0x.js. * @param orderTransactionOpts Optional arguments this method accepts. * @return Transaction hash. */ @@ -470,7 +470,7 @@ export class ExchangeWrapper extends ContractWrapper { * filled (each to the specified fillAmount) or aborted. * @param orderFillRequests An array of objects that conform to the OrderFillRequest interface. * @param takerAddress The user Ethereum address who would like to fill there orders. - * Must be available via the supplied Web3.Provider passed to 0x.js. + * Must be available via the supplied Provider passed to 0x.js. * @param orderTransactionOpts Optional arguments this method accepts. * @return Transaction hash. */ @@ -765,7 +765,7 @@ export class ExchangeWrapper extends ContractWrapper { * signedOrder you wish to fill. * @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill. * @param takerAddress The user Ethereum address who would like to fill this order. - * Must be available via the supplied Web3.Provider passed to 0x.js. + * Must be available via the supplied Provider passed to 0x.js. */ public async validateFillOrderThrowIfInvalidAsync( signedOrder: SignedOrder, @@ -812,7 +812,7 @@ export class ExchangeWrapper extends ContractWrapper { * signedOrder you wish to fill. * @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill. * @param takerAddress The user Ethereum address who would like to fill this order. - * Must be available via the supplied Web3.Provider passed to 0x.js. + * Must be available via the supplied Provider passed to 0x.js. */ public async validateFillOrKillOrderThrowIfInvalidAsync( signedOrder: SignedOrder, @@ -920,7 +920,12 @@ export class ExchangeWrapper extends ContractWrapper { artifacts.ExchangeArtifact, this._contractAddressIfExists, ); - const contractInstance = new ExchangeContract(this._web3Wrapper, abi, address); + const contractInstance = new ExchangeContract( + abi, + address, + this._web3Wrapper.getProvider(), + this._web3Wrapper.getContractDefaults(), + ); this._exchangeContractIfExists = contractInstance; return this._exchangeContractIfExists; } diff --git a/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts index e1806c6f2..c4a193264 100644 --- a/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts @@ -121,7 +121,12 @@ export class TokenRegistryWrapper extends ContractWrapper { artifacts.TokenRegistryArtifact, this._contractAddressIfExists, ); - const contractInstance = new TokenRegistryContract(this._web3Wrapper, abi, address); + const contractInstance = new TokenRegistryContract( + abi, + address, + this._web3Wrapper.getProvider(), + this._web3Wrapper.getContractDefaults(), + ); this._tokenRegistryContractIfExists = contractInstance; return this._tokenRegistryContractIfExists; } diff --git a/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts index 211c7dfb4..be558b5be 100644 --- a/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts @@ -63,7 +63,12 @@ export class TokenTransferProxyWrapper extends ContractWrapper { artifacts.TokenTransferProxyArtifact, this._contractAddressIfExists, ); - const contractInstance = new TokenTransferProxyContract(this._web3Wrapper, abi, address); + const contractInstance = new TokenTransferProxyContract( + abi, + address, + this._web3Wrapper.getProvider(), + this._web3Wrapper.getContractDefaults(), + ); this._tokenTransferProxyContractIfExists = contractInstance; return this._tokenTransferProxyContractIfExists; } diff --git a/packages/0x.js/src/contract_wrappers/token_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_wrapper.ts index 5224d451c..194cfb5aa 100644 --- a/packages/0x.js/src/contract_wrappers/token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/token_wrapper.ts @@ -421,7 +421,12 @@ export class TokenWrapper extends ContractWrapper { artifacts.TokenArtifact, normalizedTokenAddress, ); - const contractInstance = new TokenContract(this._web3Wrapper, abi, address); + const contractInstance = new TokenContract( + abi, + address, + this._web3Wrapper.getProvider(), + this._web3Wrapper.getContractDefaults(), + ); tokenContract = contractInstance; this._tokenContractsByAddress[normalizedTokenAddress] = tokenContract; return tokenContract; |