diff options
author | Jacob Evans <jacob@dekz.net> | 2018-09-13 19:51:09 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2018-09-13 19:58:05 +0800 |
commit | cf46d2c7049461e25441239e71f486bfbd2a986a (patch) | |
tree | ebed0751305adb60c74ec6691e360b331f1a26f1 /packages/website/md/docs/0xjs/1.0.0 | |
parent | df5779b6d1a81f85b91c57fd2948ded91c1a07d7 (diff) | |
download | dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.tar dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.tar.gz dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.tar.bz2 dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.tar.lz dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.tar.xz dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.tar.zst dexon-sol-tools-cf46d2c7049461e25441239e71f486bfbd2a986a.zip |
0xjs README/website docs update
Diffstat (limited to 'packages/website/md/docs/0xjs/1.0.0')
-rw-r--r-- | packages/website/md/docs/0xjs/1.0.0/async.md | 17 | ||||
-rw-r--r-- | packages/website/md/docs/0xjs/1.0.0/errors.md | 1 | ||||
-rw-r--r-- | packages/website/md/docs/0xjs/1.0.0/installation.md | 13 | ||||
-rw-r--r-- | packages/website/md/docs/0xjs/1.0.0/introduction.md | 4 | ||||
-rw-r--r-- | packages/website/md/docs/0xjs/1.0.0/versioning.md | 2 |
5 files changed, 26 insertions, 11 deletions
diff --git a/packages/website/md/docs/0xjs/1.0.0/async.md b/packages/website/md/docs/0xjs/1.0.0/async.md index 8abaef331..2909e47e0 100644 --- a/packages/website/md/docs/0xjs/1.0.0/async.md +++ b/packages/website/md/docs/0xjs/1.0.0/async.md @@ -1,10 +1,15 @@ -0x.js is a promise-based library. This means that whenever an asynchronous call is required, the library method will return a native Javascript promise. You can therefore choose between using `promise` or `async/await` syntax when calling our async methods. +0x packages are promise-based libraries. This means that whenever an asynchronous call is required, the library method will return a native Javascript promise. You can therefore choose between using `promise` or `async/await` syntax when calling our async methods. _Async/await syntax (recommended):_ ```javascript try { - var availableAddresses = await zeroEx.getAvailableAddressesAsync(); + const signature = await signatureUtils.ecSignOrderHashAsync( + providerEngine, + orderHashHex, + maker, + SignerType.Default, + ); } catch (error) { console.log('Caught error: ', error); } @@ -13,10 +18,10 @@ try { _Promise syntax:_ ```javascript -zeroEx - .getAvailableAddressesAsync() - .then(function(availableAddresses) { - console.log(availableAddresses); +signature = signatureUtils + .ecSignOrderHashAsync(providerEngine, orderHashHex, maker, SignerType.Default) + .then(function(signature) { + console.log(signature); }) .catch(function(error) { console.log('Caught error: ', error); diff --git a/packages/website/md/docs/0xjs/1.0.0/errors.md b/packages/website/md/docs/0xjs/1.0.0/errors.md deleted file mode 100644 index e97973ccf..000000000 --- a/packages/website/md/docs/0xjs/1.0.0/errors.md +++ /dev/null @@ -1 +0,0 @@ -All error messages thrown by the 0x.js library are part of a documented string enum. Each error message is in all-caps, snake-case format. This makes the error messages easily identifiable, unique and grep-able. The error enums listing all possible errors the library could throw can be found in the `Types` section. diff --git a/packages/website/md/docs/0xjs/1.0.0/installation.md b/packages/website/md/docs/0xjs/1.0.0/installation.md index ac0a47699..74c902afd 100644 --- a/packages/website/md/docs/0xjs/1.0.0/installation.md +++ b/packages/website/md/docs/0xjs/1.0.0/installation.md @@ -11,7 +11,16 @@ npm install 0x.js --save **Import** ```javascript -import { ZeroEx } from '0x.js'; +import { + assetDataUtils, + BigNumber, + ContractWrappers, + generatePseudoRandomSalt, + Order, + orderHashUtils, + signatureUtils, + SignerType, +} from '0x.js'; ``` #### UMD: @@ -28,4 +37,4 @@ Download the UMD module from our [releases page](https://github.com/0xProject/0x ### Wiki -Check out our [wiki](https://0xproject.com/wiki) for articles on how to get 0x.js setup with TestRPC, Infura and more! +Check out our [wiki](https://0xproject.com/wiki) for articles on how to get 0x.js setup with Ganache, Infura and more! diff --git a/packages/website/md/docs/0xjs/1.0.0/introduction.md b/packages/website/md/docs/0xjs/1.0.0/introduction.md index 008376d33..d228c6855 100644 --- a/packages/website/md/docs/0xjs/1.0.0/introduction.md +++ b/packages/website/md/docs/0xjs/1.0.0/introduction.md @@ -1 +1,3 @@ -Welcome to the [0x.js](https://github.com/0xProject/0x-monorepo) documentation! 0x.js is a Javascript library for interacting with the 0x protocol. With it, you can easily make calls to the 0x smart contracts as well as any ERC20 token. Functionality includes generating, signing, filling and cancelling orders, verifying an orders signature, setting or checking a users ERC20 token balance/allowance and much more. +<b>**NOTE:** Release candidate versions are meant to work with V2 of 0x protocol. To interact with V1, select a 0.X version.</b> + +Welcome to the [0x.js](https://github.com/0xProject/0x-monorepo/tree/development/packages/0x.js) documentation! 0x.js is a Javascript library for interacting with the 0x protocol. With it, you can easily make calls to the 0x smart contracts as well as any token adhering to the token standards supported by the protocol (currently ERC20 & ERC721). Functionality includes generating, signing, filling and cancelling orders, verifying an orders signature, setting or checking a users ERC20/ERC721 token balance/allowance and much more. diff --git a/packages/website/md/docs/0xjs/1.0.0/versioning.md b/packages/website/md/docs/0xjs/1.0.0/versioning.md index 6bcaa5b4d..6bae835d3 100644 --- a/packages/website/md/docs/0xjs/1.0.0/versioning.md +++ b/packages/website/md/docs/0xjs/1.0.0/versioning.md @@ -1 +1 @@ -This project adheres to the [Semantic Versioning 2.0.0](http://semver.org/) specification. The library's public interface includes all the methods, properties and types included in the documentation. Since the library is still an alpha, it's public interface is not yet stable and we will introduce backward incompatible changes to the interface without incrementing the major version until the `1.0.0` release. Our convention until then will be to increment the minor version whenever we introduce backward incompatible changes to the public interface, and to increment the patch version otherwise. This way, it is safe for you to include 0x.js in your projects with the tilda (e.g `~0.22.0`) without fear that a patch update would break your app. +Since v1.0.0, this package adheres to the [Semantic Versioning 2.0.0](http://semver.org/) specification. The library's public interface includes all the methods, properties and types included in the documentation. We will publish with a major version bump for any breaking change to the public interface, use a minor version bump when introducing new features in a backwards-compatible way, and patch versions when introducing backwards-compatible bug fixes. Because of this, we recommend you import `0x.js` with a caret `^1.0.0` to take advantage of non-breaking bug fixes. |