aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-06-19 01:24:42 +0800
committerGitHub <noreply@github.com>2018-06-19 01:24:42 +0800
commita3ca3ed33fcf51fbcc236d5b8238648873085630 (patch)
tree18326c8d61df7c3af7617cc2a078603f8aebfecf /packages/contract-wrappers
parentefaa33c4d5caacf592154f6e8552295afd7c9821 (diff)
parent0cdfe7f45802da3e6d3c0fe97148e90c80a13fae (diff)
downloaddexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.tar
dexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.tar.gz
dexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.tar.bz2
dexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.tar.lz
dexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.tar.xz
dexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.tar.zst
dexon-sol-tools-a3ca3ed33fcf51fbcc236d5b8238648873085630.zip
Merge pull request #704 from 0xProject/bug/website/fix-filling-order
Fix filling orders on Portal
Diffstat (limited to 'packages/contract-wrappers')
-rw-r--r--packages/contract-wrappers/CHANGELOG.json8
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts3
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts3
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts2
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts3
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts2
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts3
7 files changed, 20 insertions, 4 deletions
diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json
index 84e773933..39b63178a 100644
--- a/packages/contract-wrappers/CHANGELOG.json
+++ b/packages/contract-wrappers/CHANGELOG.json
@@ -1,5 +1,13 @@
[
{
+ "version": "0.1.0",
+ "changes": [
+ {
+ "note": "Expose 'abi' ContractAbi property on all contract wrappers"
+ }
+ ]
+ },
+ {
"version": "0.0.2",
"changes": [
{
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..8548a06b6 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;