diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-07-12 08:44:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-12 08:44:24 +0800 |
commit | 98e8a6dd706f0a630402d9009ad3dcf9b0ff872d (patch) | |
tree | 67abd7c0bca868a3b2d1f46c6f30321ba7c175be /src/0x.ts | |
parent | 9bb14a1d69f63485650604b83b6bc784cfe2a8c6 (diff) | |
parent | 4efba2a4bc93f49f1962f1c774c628aea4d19251 (diff) | |
download | dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.tar dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.tar.gz dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.tar.bz2 dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.tar.lz dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.tar.xz dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.tar.zst dexon-sol-tools-98e8a6dd706f0a630402d9009ad3dcf9b0ff872d.zip |
Merge pull request #106 from 0xProject/single-exchange
Single exchange
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 39 |
1 files changed, 0 insertions, 39 deletions
@@ -21,7 +21,6 @@ import {ECSignature, ZeroExError, Order, SignedOrder, Web3Provider} from './type import {orderHashSchema} from './schemas/order_hash_schema'; import {orderSchema} from './schemas/order_schemas'; import {SchemaValidator} from './utils/schema_validator'; -import {ExchangeArtifactsByName} from './exchange_artifacts_by_name'; // Customize our BigNumber instances bigNumberConfigs.configure(); @@ -245,42 +244,4 @@ export class ZeroEx { throw new Error(ZeroExError.INVALID_SIGNATURE); } - /** - * Returns the ethereum addresses of all available exchange contracts - * supported by this library on the network that the supplied web3 - * provider is connected to - * @return The ethereum addresses of all available exchange contracts. - */ - public async getAvailableExchangeContractAddressesAsync(): Promise<string[]> { - const networkId = await this._web3Wrapper.getNetworkIdIfExistsAsync(); - if (_.isUndefined(networkId)) { - return []; - } else { - const exchangeArtifacts = _.values(ExchangeArtifactsByName); - const networkSpecificExchangeArtifacts = _.compact(_.map( - exchangeArtifacts, exchangeArtifact => exchangeArtifact.networks[networkId])); - const exchangeAddresses = _.map( - networkSpecificExchangeArtifacts, - networkSpecificExchangeArtifact => networkSpecificExchangeArtifact.address, - ); - return exchangeAddresses; - } - } - /** - * Returns the ethereum addresses of all available exchange contracts - * supported by this library on the network that the supplied web3 - * provider is connected to that are currently authorized by the Proxy contract - * @return The ethereum addresses of all available and authorized exchange contract. - */ - public async getProxyAuthorizedExchangeContractAddressesAsync(): Promise<string[]> { - const exchangeContractAddresses = await this.getAvailableExchangeContractAddressesAsync(); - const proxyAuthorizedExchangeContractAddresses = []; - for (const exchangeContractAddress of exchangeContractAddresses) { - const isAuthorized = await this.proxy.isAuthorizedAsync(exchangeContractAddress); - if (isAuthorized) { - proxyAuthorizedExchangeContractAddresses.push(exchangeContractAddress); - } - } - return proxyAuthorizedExchangeContractAddresses; - } } |