diff options
Diffstat (limited to 'packages/contract-wrappers')
9 files changed, 60 insertions, 22 deletions
diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 84e773933..33d9bc4c0 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,5 +1,23 @@ [ { + "timestamp": 1529397769, + "version": "0.0.5", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "timestamp": 1527617227, + "version": "0.0.4", + "changes": [ + { + "note": "Expose 'abi' ContractAbi property on all contract wrappers" + } + ] + }, + { "version": "0.0.2", "changes": [ { diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md index c8a0145d5..3f8eb921c 100644 --- a/packages/contract-wrappers/CHANGELOG.md +++ b/packages/contract-wrappers/CHANGELOG.md @@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.0.5 - _June 19, 2018_ + + * Dependencies updated + +## v0.0.4 - _May 29, 2018_ + + * Dependencies updated + +## v0.0.3 - _May 29, 2018_ + + * Dependencies updated + ## v0.0.2 - _May 22, 2018_ * Dependencies updated diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index d5d4bfbc8..cd4b25957 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/contract-wrappers", - "version": "0.0.2", + "version": "0.0.5", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -46,13 +46,13 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.3.0", - "@0xproject/dev-utils": "^0.4.2", - "@0xproject/migrations": "^0.0.6", - "@0xproject/monorepo-scripts": "^0.1.20", - "@0xproject/sol-compiler": "^0.5.0", - "@0xproject/subproviders": "^0.10.2", - "@0xproject/tslint-config": "^0.4.18", + "@0xproject/abi-gen": "^0.3.2", + "@0xproject/dev-utils": "^0.4.4", + "@0xproject/migrations": "^0.0.8", + "@0xproject/monorepo-scripts": "^0.2.1", + "@0xproject/sol-compiler": "^0.5.2", + "@0xproject/subproviders": "^0.10.4", + "@0xproject/tslint-config": "^0.4.20", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -77,19 +77,19 @@ "web3-provider-engine": "^14.0.4" }, "dependencies": { - "@0xproject/assert": "^0.2.10", - "@0xproject/base-contract": "^0.3.2", - "@0xproject/fill-scenarios": "^0.0.2", - "@0xproject/json-schemas": "0.7.22", - "@0xproject/order-utils": "0.0.5", - "@0xproject/types": "0.7.0", - "@0xproject/typescript-typings": "^0.3.2", - "@0xproject/utils": "^0.6.2", - "@0xproject/web3-wrapper": "^0.6.4", + "@0xproject/assert": "^0.2.12", + "@0xproject/base-contract": "^0.3.4", + "@0xproject/fill-scenarios": "^0.0.4", + "@0xproject/json-schemas": "0.8.1", + "@0xproject/order-utils": "^0.0.7", + "@0xproject/types": "^0.8.1", + "@0xproject/typescript-typings": "^0.4.1", + "@0xproject/utils": "^0.7.1", + "@0xproject/web3-wrapper": "^0.7.1", "ethereum-types": "^0.0.1", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", - "ethers": "^3.0.15", + "ethers": "3.0.22", "js-sha3": "^0.7.0", "lodash": "^4.17.4", "uuid": "^3.1.0" 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; |