diff options
-rw-r--r-- | README.md | 32 | ||||
-rw-r--r-- | packages/0x.js/src/utils/assert.ts | 5 |
2 files changed, 12 insertions, 25 deletions
@@ -10,32 +10,18 @@ This repository contains all the 0x developer tools written in TypeScript. Our h [whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf [](https://circleci.com/gh/0xProject/0x.js) -[](https://badge.fury.io/js/0x.js) [](https://coveralls.io/github/0xProject/0x.js?branch=master) -[Rocket Chat](https://chat.0xproject.com) +[](https://chat.0xproject.com) [](https://gitter.im/0xProject/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://opensource.org/licenses/Apache-2.0) [](https://greenkeeper.io/) -Instructions ------------- +### Core Packages -Make sure you have `yarn@1.x` installed locally. - -### Creating a new sub-package - -1. Make sure the `name` field in the sub-package's `package.json` starts with `@0xproject/` and has a unique name (e.g `@0xproject/assert`). - -2. Run `yarn install` to install all it's dependencies. - -### How to add a sub-package as a dependency to another sub-package: - -1. Add the sub-packages name (declared in it's `package.json`) to your sub-packages `package.json` under `dependencies` or `devDependencies`. - -2. Run `yarn install` from anywhere in the mono repo. - -3. Import the sub-package as: - -``` -import {myPkg} from '@0xproject/myPkg'; -``` +| Package | Version | Description | +|--------|-------|------------| +| [`0x.js`](/packages/0x.js) | [](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol | +| [`@0xproject/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0xproject/assert) | Standard type and schema assertions | +| [`@0xproject/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas | +| [`@0xproject/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x project TSLint rules | diff --git a/packages/0x.js/src/utils/assert.ts b/packages/0x.js/src/utils/assert.ts index 63d975c03..55912525c 100644 --- a/packages/0x.js/src/utils/assert.ts +++ b/packages/0x.js/src/utils/assert.ts @@ -9,7 +9,8 @@ import {ECSignature} from '../types'; const HEX_REGEX = /^0x[0-9A-F]*$/i; -export const assert = _.extend({}, sharedAssert, { +export const assert = { + ...sharedAssert, isValidSignature(orderHash: string, ecSignature: ECSignature, signerAddress: string) { const isValidSignature = signatureUtils.isValidSignature(orderHash, ecSignature, signerAddress); this.assert(isValidSignature, `Expected order with hash '${orderHash}' to have a valid signature`); @@ -26,4 +27,4 @@ export const assert = _.extend({}, sharedAssert, { const availableAddresses = await web3Wrapper.getAvailableAddressesAsync(); this.assert(!_.isEmpty(availableAddresses), 'No addresses were available on the provided web3 provider'); }, -}); +}; |