From 4811dfa66310edfb00cf2db9def4565770edb742 Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 14 Jun 2018 13:56:36 -0700 Subject: Fix filling orders on Portal --- packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts | 3 ++- .../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts | 3 ++- packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts | 2 ++ .../contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts | 3 ++- .../src/contract_wrappers/token_transfer_proxy_wrapper.ts | 2 ++ packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts | 3 ++- packages/website/ts/blockchain.ts | 1 + 7 files changed, 13 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts index e646bae78..04f69bc3d 100644 --- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts @@ -35,7 +35,8 @@ const CONTRACT_NAME_TO_NOT_FOUND_ERROR: { Exchange: ContractWrappersError.ExchangeContractDoesNotExist, }; -export class ContractWrapper { +export abstract class ContractWrapper { + public abstract abi: ContractAbi; protected _web3Wrapper: Web3Wrapper; protected _networkId: number; private _blockAndLogStreamerIfExists?: BlockAndLogStreamer; diff --git a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts index 713d4d3f6..36b7a234a 100644 --- a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts @@ -1,5 +1,5 @@ import { schemas } from '@0xproject/json-schemas'; -import { LogWithDecodedArgs } from '@0xproject/types'; +import { ContractAbi, LogWithDecodedArgs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -17,6 +17,7 @@ import { TokenWrapper } from './token_wrapper'; * The caller can convert ETH into the equivalent number of wrapped ETH ERC20 tokens and back. */ export class EtherTokenWrapper extends ContractWrapper { + public abi: ContractAbi = artifacts.EtherToken.abi; private _etherTokenContractsByAddress: { [address: string]: EtherTokenContract; } = {}; diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index 430ce9c5e..2c517502a 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -2,6 +2,7 @@ import { schemas } from '@0xproject/json-schemas'; import { formatters, getOrderHashHex, OrderStateUtils } from '@0xproject/order-utils'; import { BlockParamLiteral, + ContractAbi DecodedLogArgs, ECSignature, ExchangeContractErrs, @@ -54,6 +55,7 @@ interface ExchangeContractErrCodesToMsgs { * events of the 0x Exchange smart contract. */ export class ExchangeWrapper extends ContractWrapper { + public abi: ContractAbi = artifacts.Exchange.abi; private _exchangeContractIfExists?: ExchangeContract; private _orderValidationUtilsIfExists?: OrderValidationUtils; private _tokenWrapper: TokenWrapper; diff --git a/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts index fb9396281..7b558ed69 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts @@ -1,4 +1,4 @@ -import { Token } from '@0xproject/types'; +import { ContractAbi, Token } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -14,6 +14,7 @@ import { TokenRegistryContract } from './generated/token_registry'; * This class includes all the functionality related to interacting with the 0x Token Registry smart contract. */ export class TokenRegistryWrapper extends ContractWrapper { + public abi: ContractAbi = artifacts.TokenRegistry.abi; private _tokenRegistryContractIfExists?: TokenRegistryContract; private _contractAddressIfExists?: string; private static _createTokenFromMetadata(metadata: TokenMetadata): Token | undefined { diff --git a/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts index 2fe3e6620..5194931d7 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts @@ -1,4 +1,5 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { ContractAbi } from '@0xproject/types'; import * as _ from 'lodash'; import { artifacts } from '../artifacts'; @@ -11,6 +12,7 @@ import { TokenTransferProxyContract } from './generated/token_transfer_proxy'; * This class includes the functionality related to interacting with the TokenTransferProxy contract. */ export class TokenTransferProxyWrapper extends ContractWrapper { + public abi: ContractAbi = artifacts.TokenTransferProxy.abi; private _tokenTransferProxyContractIfExists?: TokenTransferProxyContract; private _contractAddressIfExists?: string; constructor(web3Wrapper: Web3Wrapper, networkId: number, contractAddressIfExists?: string) { diff --git a/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts index 7c7907fd2..d9364715f 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts @@ -1,5 +1,5 @@ import { schemas } from '@0xproject/json-schemas'; -import { LogWithDecodedArgs } from '@0xproject/types'; +import { ContractAbi, LogWithDecodedArgs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -26,6 +26,7 @@ import { TokenTransferProxyWrapper } from './token_transfer_proxy_wrapper'; * to the 0x Proxy smart contract. */ export class TokenWrapper extends ContractWrapper { + public abi: ContractAbi = artifacts.Token.abi; public UNLIMITED_ALLOWANCE_IN_BASE_UNITS = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; private _tokenContractsByAddress: { [address: string]: TokenContract }; private _tokenTransferProxyWrapper: TokenTransferProxyWrapper; diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index c955e1033..3ebdd1dee 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -625,6 +625,7 @@ export class Blockchain { ); const provider = this._contractWrappers.getProvider(); const web3Wrapper = new Web3Wrapper(provider); + web3Wrapper.abiDecoder.addABI(this._contractWrappers.exchange.abi); const receipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash); return receipt; } -- cgit v1.2.3 From 5fa6a2848f2c70f656f8cc711d10d708edb10949 Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 14 Jun 2018 14:07:41 -0700 Subject: Fix typo --- packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index 2c517502a..8548a06b6 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -2,7 +2,7 @@ import { schemas } from '@0xproject/json-schemas'; import { formatters, getOrderHashHex, OrderStateUtils } from '@0xproject/order-utils'; import { BlockParamLiteral, - ContractAbi + ContractAbi, DecodedLogArgs, ECSignature, ExchangeContractErrs, -- cgit v1.2.3 From fadd91b6a27327c8f4eba76b5e0e5756c119a69e Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 14 Jun 2018 14:22:53 -0700 Subject: Add to changelog for contract-wrappers --- packages/contract-wrappers/CHANGELOG.json | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'packages') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 84e773933..0669b9c17 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,4 +1,12 @@ [ + { + "version": "0.0.3", + "changes": [ + { + "note": "Expose 'abi' ContractAbi property on all contract wrappers" + } + ] + }, { "version": "0.0.2", "changes": [ -- cgit v1.2.3 From 35f4f7573316812571a463b2b1743d8a5bea327e Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 14 Jun 2018 16:49:06 -0700 Subject: Prettier --- packages/contract-wrappers/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 0669b9c17..58ef090f7 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -6,7 +6,7 @@ "note": "Expose 'abi' ContractAbi property on all contract wrappers" } ] - }, + }, { "version": "0.0.2", "changes": [ -- cgit v1.2.3 From 0cdfe7f45802da3e6d3c0fe97148e90c80a13fae Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 18 Jun 2018 10:06:38 -0700 Subject: Adjust version in changelog --- packages/contract-wrappers/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 58ef090f7..39b63178a 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,6 +1,6 @@ [ { - "version": "0.0.3", + "version": "0.1.0", "changes": [ { "note": "Expose 'abi' ContractAbi property on all contract wrappers" -- cgit v1.2.3