diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-16 22:30:35 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-16 22:30:35 +0800 |
commit | fe63a81f6a15a521c643b74f4442cdbf037202cf (patch) | |
tree | a596b494ceb6ed1a84ab054e5983a3b44fcc95cd /src/0x.ts | |
parent | 225ec506454ac9b912ee50fb6a138c201da1519b (diff) | |
download | dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.gz dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.tar.zst dexon-sol-tools-fe63a81f6a15a521c643b74f4442cdbf037202cf.zip |
Add and improve comments
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -22,6 +22,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 @@ -30,15 +34,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. */ @@ -145,8 +158,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(); @@ -154,7 +167,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> { @@ -170,7 +183,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); |