diff options
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -21,6 +21,10 @@ import {orderSchema} from './schemas/order_schemas'; // Customize our BigNumber instances bigNumberConfigs.configure(); +/** + * The ZeroEx class is the single entry-point into the 0x.js library. It contains all of the library's functionality + * and all calls to the library should be made through a ZeroEx instance. + */ export class ZeroEx { /** * When creating an order without a specified taker or feeRecipient you must supply the Solidity @@ -29,15 +33,24 @@ export class ZeroEx { */ public static NULL_ADDRESS = constants.NULL_ADDRESS; + /** + * An instance of the ExchangeWrapper class containing methods for interacting with the 0x Exchange smart contract. + */ public exchange: ExchangeWrapper; + /** + * An instance of the TokenRegistryWrapper class containing methods for interacting with the 0x TokenRegistry smart contract. + */ public tokenRegistry: TokenRegistryWrapper; + /** + * An instance of the TokenWrapper class containing methods for interacting with any ERC20 token smart contract. + */ public token: TokenWrapper; private _web3Wrapper: Web3Wrapper; /** * Verifies that the elliptic curve signature `signature` was generated * by signing `data` with the private key corresponding to the `signerAddress` address. * @param data The hex encoded data signed by the supplied signature. - * @param signature A JS object containing the elliptic curve signature parameters. + * @param signature An object containing the elliptic curve signature parameters. * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the signature is valid for the supplied signerAddress and data. */ @@ -144,8 +157,8 @@ export class ZeroEx { this.token.invalidateContractInstances(); } /** - * Get addresses available throught the supplied web3 instance available for sending transactions. - * @return An array of Ethereum addresses available. + * Get user Ethereum addresses available through the supplied web3 instance available for sending transactions. + * @return An array of available user Ethereum addresses. */ public async getAvailableAddressesAsync(): Promise<string[]> { const availableAddresses = await this._web3Wrapper.getAvailableAddressesAsync(); @@ -153,7 +166,7 @@ export class ZeroEx { } /** * Computes the orderHash for a supplied order. - * @param order A JS object that conforms to the Order or SignedOrder interface definitions. + * @param order An object that conforms to the Order or SignedOrder interface definitions. * @return The resulting orderHash from hashing the supplied order. */ public async getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> { @@ -169,7 +182,7 @@ export class ZeroEx { * @param orderHash Hex encoded orderHash to sign. * @param signerAddress The hex encoded Ethereum address you wish to sign it with. This address * must be available via the Web3.Provider supplied to 0x.js. - * @return A JS object containing the Elliptic curve signature parameters generated by signing the orderHash. + * @return An object containing the Elliptic curve signature parameters generated by signing the orderHash. */ public async signOrderHashAsync(orderHash: string, signerAddress: string): Promise<ECSignature> { assert.isHexString('orderHash', orderHash); |