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/async.md | |
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/async.md')
-rw-r--r-- | packages/website/md/docs/0xjs/1.0.0/async.md | 17 |
1 files changed, 11 insertions, 6 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); |