Compare commits

...

3472 Commits

Author SHA1 Message Date
Leonid Logvinov
f3241ff86a Merge pull request #883 from 0xProject/feature/tslint-improvements
New tslint rules
2018-07-18 14:54:47 +02:00
Leonid Logvinov
904968cf4a Fix an inconsistency in abi-gen CHANGELOG.json 2018-07-18 14:31:03 +02:00
Amir Bandeali
56a4a374cd Merge pull request #857 from 0xProject/feature/contracts/batchGetOrderInfo
Add getOrdersInfo function
2018-07-17 14:13:33 -07:00
Amir Bandeali
caa5b4e342 Add tests for getOrderInfo and getOrdersInfo 2018-07-17 13:59:14 -07:00
Amir Bandeali
b6172c3965 Reorder checks in getOrderInfo 2018-07-17 12:18:16 -07:00
Amir Bandeali
02ddfa07a7 Add getOrdersInfo function 2018-07-17 12:18:16 -07:00
Alex Browne
5022878680 Merge pull request #886 from 0xProject/fix/time-offset-accidental-revert
Mine a dummy block in blockchain_lifecycle to re-apply any time offset
2018-07-17 12:12:12 -07:00
Alex Browne
2bfacbb8ba Mine a dummy block in blockchain_lifecycle to re-apply any time offset 2018-07-17 11:48:39 -07:00
Alex Browne
b18d2b0274 Merge pull request #881 from 0xProject/fix/timestamp-conversions
Fix bugs having to do with block timestamps and order expirationTimes
2018-07-17 10:57:39 -07:00
Fabio Berger
15e92958d6 Merge pull request #875 from 0xProject/fix-order-watcher
OrderWatcher Fixes
2018-07-17 13:47:23 +02:00
Fabio Berger
f56a7d0cb2 Fix linter 2018-07-17 13:29:36 +02:00
Fabio Berger
59fd5c69c0 Remove no-longer needed tests 2018-07-17 13:27:41 +02:00
Leonid Logvinov
bf8ac3b9e6 Fix tslint issues 2018-07-17 12:59:02 +02:00
Leonid Logvinov
edcdc9b1b9 Upgrade tslint to the newest version 2018-07-17 12:58:42 +02:00
Leonid Logvinov
4227aaa68a Add new tslint rules 2018-07-17 12:58:04 +02:00
Fabio Berger
b750ce8be6 Stop subscriptions from unsubscribing on recoverable network issues 2018-07-17 12:33:43 +02:00
Fabio Berger
03a6a088c5 Merge branch 'v2-prototype' into fix-order-watcher
* v2-prototype: (39 commits)
  Add chris to website
  Fix ocean link
  Move update onboarding step tracking to onboarding flow code
  Bump npm-run-all from 4.1.2 to 4.1.3
  Move format to helper function
  Fix linter
  Add assertion to make sure caller to fetchAsync isn't trying to set timeout in a context-specific way
  Fix linter issues
  Remove unused import
  Switch conditional
  Update yarn.lock and artifact
  Fix abi-gen tests to not rely on sleep, since it causes intermittent failures
  Add missing assertion
  Move type defs to typescript-typingsd
  Fix linter
  Make createFinalPayload protected
  Replace process.browser with detect-node library
  Export Web3ProviderEngine and RPCSubprovider from 0x.js
  Export Web3ProviderEngine from subproviders package
  Update deps
  ...
2018-07-17 12:06:35 +02:00
Fabio Berger
1e787a7646 Remove stateLayer OrderWatcher config and instead temporarily hard-code until we get pending block to work with Blockstream 2018-07-17 12:04:29 +02:00
Fabio Berger
766ac3f1fe Remove blockRetention config 2018-07-17 11:57:52 +02:00
fragosti
a9038f2afc Add chris to website 2018-07-17 01:16:29 -07:00
Alex Browne
9828fa335e Fix bugs having to do with block timestamps and order expirationTimes 2018-07-16 18:41:37 -07:00
Brandon Millman
0c04d490bb Fix ocean link 2018-07-16 17:48:24 -07:00
Leonid Logvinov
e9589ff786 Sort the config file lexicographically 2018-07-16 15:59:00 +02:00
Leonid Logvinov
01789e6750 Merge pull request #800 from feuGeneA/patch-2
use bullets, not a task list, for Types of Changes
2018-07-16 15:24:18 +02:00
Leonid Logvinov
c3f7ba1b91 Merge pull request #872 from 0xProject/dependabot/npm_and_yarn/npm-run-all-4.1.3
Bump npm-run-all from 4.1.2 to 4.1.3
2018-07-16 15:22:58 +02:00
Fabio Berger
151ce6e3c7 Pass stateLater into getBlockAsync call 2018-07-16 10:24:34 +02:00
Francesco Agosti
6bdee26c30 Merge pull request #876 from 0xProject/feature/website/heap-tracking-sanity
Move update onboarding step tracking to onboarding flow code
2018-07-13 14:34:54 -07:00
fragosti
5e4b1eed30 Move update onboarding step tracking to onboarding flow code 2018-07-13 14:09:34 -07:00
Francesco Agosti
ab5cd95ccc Merge pull request #867 from 0xProject/bug/website/txhash-error
Only upload sourcemaps to rollbar on live deploys, and handle NaN error by using 0
2018-07-13 13:35:01 -07:00
dependabot[bot]
a3dc398da5 Bump npm-run-all from 4.1.2 to 4.1.3
Bumps [npm-run-all](https://github.com/mysticatea/npm-run-all) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/mysticatea/npm-run-all/releases)
- [Commits](https://github.com/mysticatea/npm-run-all/compare/v4.1.2...v4.1.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-07-13 18:25:06 +00:00
fragosti
b70f5d1a1e Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into bug/website/txhash-error 2018-07-13 11:15:50 -07:00
Francesco Agosti
26363931ed Merge pull request #866 from 0xProject/feature/website/integrate-heap
Integrate Heap analytics into the website
2018-07-13 11:14:38 -07:00
Fabio Berger
e2438330f5 Merge pull request #874 from 0xProject/fix/request-timeout-issue
Fix Fetch Timeout Issue
2018-07-13 20:12:37 +02:00
fragosti
c5fcdd0657 Move format to helper function 2018-07-13 11:11:49 -07:00
Fabio Berger
345f3c07a5 Add PR numbers 2018-07-13 20:04:21 +02:00
Fabio Berger
f3477ff28c Add changelog entries 2018-07-13 20:03:22 +02:00
Fabio Berger
7ac4fa50b5 Update yarn.lock 2018-07-13 19:55:45 +02:00
Fabio Berger
2f0a914838 Fix linter 2018-07-13 19:53:49 +02:00
Fabio Berger
5fc7d9a603 Fix bug that make all getBlock and getLog requests go to latest block 2018-07-13 19:44:56 +02:00
Fabio Berger
ced68e4e02 Expose Blockstreams blockRetention config as an OrderWatcher config 2018-07-13 19:44:21 +02:00
Fabio Berger
80071beaac Add assertion to make sure caller to fetchAsync isn't trying to set timeout in a context-specific way 2018-07-13 19:38:35 +02:00
Fabio Berger
de1029d5ef Fix linter issues 2018-07-13 18:51:21 +02:00
Fabio Berger
efc64cf17f Remove unused import 2018-07-13 17:17:45 +02:00
Fabio Berger
2f41ed50c1 Switch conditional 2018-07-13 16:47:32 +02:00
Fabio Berger
fcc8cdd36a Update yarn.lock and artifact 2018-07-13 16:40:06 +02:00
Fabio Berger
248632ce76 Merge branch 'v2-prototype' into fix/request-timeout-issue
* v2-prototype:
  Remove legacy portal code
2018-07-13 16:12:49 +02:00
Fabio Berger
25681754bd Fix abi-gen tests to not rely on sleep, since it causes intermittent failures 2018-07-13 16:06:15 +02:00
Fabio Berger
179c487da9 Add missing assertion 2018-07-13 15:25:48 +02:00
Fabio Berger
350989bbec Move type defs to typescript-typingsd 2018-07-13 15:25:37 +02:00
Fabio Berger
f5293e6c38 Fix linter 2018-07-13 15:09:51 +02:00
Fabio Berger
70c3515c94 Make createFinalPayload protected 2018-07-13 15:04:17 +02:00
Fabio Berger
4c7fd5a4e8 Replace process.browser with detect-node library 2018-07-13 15:03:13 +02:00
Fabio Berger
9d24341d94 Export Web3ProviderEngine and RPCSubprovider from 0x.js 2018-07-13 14:35:31 +02:00
Fabio Berger
512502ca08 Export Web3ProviderEngine from subproviders package 2018-07-13 14:26:02 +02:00
Fabio Berger
6ce662c7a4 Update deps 2018-07-13 13:05:38 +02:00
Fabio Berger
701ea5c46b Add typedoc for json-rpc-error package 2018-07-13 13:05:21 +02:00
Fabio Berger
2e5ff53d72 -fetch'; 2018-07-13 12:42:01 +02:00
Fabio Berger
1229c61ba4 Make timeout configurable on RPCSubprovider 2018-07-13 12:05:02 +02:00
fragosti
ee54438e92 Fix logging typo 2018-07-12 18:30:01 -07:00
fragosti
65af78c85d Fix indentify typo 2018-07-12 18:20:46 -07:00
fragosti
b4747c3f85 Refactor utils and add UNNKOWN environment type 2018-07-12 18:11:25 -07:00
fragosti
1df074b73e Make Analytics API non-async 2018-07-12 16:57:03 -07:00
fragosti
254d30b8df Fix linting errors 2018-07-12 15:56:01 -07:00
fragosti
ac5588c7c4 Make error reporter not return a promise and add more environment possibilities 2018-07-12 15:56:01 -07:00
fragosti
ddb70a89ad Do not crash on NaN, and provide default 2018-07-12 15:54:45 -07:00
fragosti
f4b2a9625d Only upload sourcemaps to rollbar on live deploys, and log NaN error for future debugging 2018-07-12 15:54:45 -07:00
Fabio Berger
c2a1317c38 Adjust timeout 2018-07-12 23:17:35 +02:00
Fabio Berger
49f1a6933c Add fetchAsync util and RPCSubprovider 2018-07-12 23:13:47 +02:00
Brandon Millman
9b387b8ec3 Merge pull request #865 from 0xProject/refactor/website/remove-legacy-portal
Remove legacy portal code
2018-07-12 11:01:14 -07:00
Fabio Berger
a45a29432e Merge pull request #863 from 0xProject/refactor/0x.js
Refactor 0x.js
2018-07-12 15:53:31 +02:00
Fabio Berger
819d069edc Add missing param 2018-07-12 15:25:35 +02:00
Fabio Berger
b0a57a5091 remove non-existent param comment 2018-07-12 15:25:25 +02:00
Fabio Berger
d8678d562d Add assertions to SignatureUtils exported methods 2018-07-12 15:22:21 +02:00
Leonid Logvinov
34a9035164 Merge pull request #788 from feuGeneA/abi-gen-ignore-unchanged
Using timestamps, skip generation of already-up-to-date contract wrappers
2018-07-12 11:53:21 +02:00
fragosti
0941e0a929 Add no-floating-promises ignore comments 2018-07-11 16:50:00 -07:00
fragosti
1ee78062d7 Remove unused configs and constants 2018-07-11 15:43:37 -07:00
Brandon Millman
09f5609618 Remove legacy portal code 2018-07-11 15:42:20 -07:00
fragosti
098322c564 Integrate heap analytics 2018-07-11 15:39:12 -07:00
Fabio Berger
365e24c1cd Fix prettier 2018-07-11 23:58:22 +02:00
Brandon Millman
b82fdd59e7 Merge pull request #626 from 0xProject/refactor/connect/browser-websocket-support
Add support for browser websocket client and fix multiple subscriptions bug
2018-07-11 14:40:19 -07:00
Brandon Millman
6190ac7791 Change version to 1.0.0 2018-07-11 14:31:39 -07:00
Brandon Millman
ed3aeb7997 Fix lint for order watcher 2018-07-11 13:35:21 -07:00
Brandon Millman
33f92b6bcf Fix lint for order-utils 2018-07-11 13:15:28 -07:00
fragosti
9131a72a47 Replace calls to google analytics with calls to heap 2018-07-11 12:14:23 -07:00
Brandon Millman
e5617dfe61 Lint fixes 2018-07-11 11:46:28 -07:00
Brandon Millman
e67d67419f Prettier 2018-07-11 11:29:34 -07:00
Brandon Millman
17c34716f9 Provide subscriptionOpts in error callback and include url in error messages 2018-07-11 11:16:45 -07:00
Brandon Millman
e12f7c3026 Remove outdated comments 2018-07-11 10:27:05 -07:00
Brandon Millman
af395eccda Update orderbook channel and factory tests 2018-07-11 10:25:54 -07:00
Brandon Millman
c403dcdabf Update tests 2018-07-11 10:25:54 -07:00
Brandon Millman
c500cc095f Enforce one handler per channel 2018-07-11 10:25:54 -07:00
Brandon Millman
6ecda647ad Add TODO comment for switching requestIds to strings 2018-07-11 10:25:54 -07:00
Brandon Millman
3e7ee1f090 Add explicit HACK comment when we import assert 2018-07-11 10:25:54 -07:00
Brandon Millman
0c120cb7a3 Assert that connection is opening before attempting to subscribe 2018-07-11 10:19:36 -07:00
Brandon Millman
cab6829df9 Remove unused import 2018-07-11 10:19:36 -07:00
Brandon Millman
0efe6df416 Add CHANGELOG entry 2018-07-11 10:19:36 -07:00
Brandon Millman
a4b6112a31 Consolidate back to one channel and expose only the factory 2018-07-11 10:18:15 -07:00
Brandon Millman
47debf0134 Initial implementation of OrderbookChannelFactory 2018-07-11 10:17:45 -07:00
Brandon Millman
16ddd1edfc Implement web browser socket 2018-07-11 10:17:45 -07:00
Fabio Berger
0f1fd0e90d prettier fix 2018-07-11 19:16:12 +02:00
Fabio Berger
ef76d83d2a Fix linter issues 2018-07-11 19:15:39 +02:00
Fabio Berger
df9f6004f2 Rename compact_artifacts to artifacts and update them 2018-07-11 19:09:02 +02:00
Fabio Berger
9a87f99dcd Add PR to changelog 2018-07-11 19:08:05 +02:00
Fabio Berger
30011db6d7 Add changelog entry 2018-07-11 19:06:38 +02:00
Fabio Berger
b6ac132c78 Refactor 0x.js to V2 2018-07-11 18:53:50 +02:00
Fabio Berger
abf87a643d Remove artifact tests since no testnet deployments are finalized 2018-07-11 18:49:37 +02:00
Fabio Berger
3824ea9079 Remove TokenRegistry from 0x.js 2018-07-11 18:46:12 +02:00
Fabio Berger
5e22ce05c5 Remove duplicate sol-compiler dep 2018-07-11 18:34:38 +02:00
Jacob Evans
8fcc7aefa7 Merge pull request #840 from 0xProject/feature/migrations/forwarder-migrations
Add Migrations for Forwarder and miscellaneous fixes
2018-07-11 20:59:23 +10:00
Jacob Evans
0b6ea1d046 Contract Wrappers - Ether token block range
Start after migrations to avoid any unexpected logs
2018-07-11 20:45:18 +10:00
Fabio Berger
22d3981a74 Temporarily remove OrderWatcher from 0x.js 2018-07-11 12:34:13 +02:00
Jacob Evans
81b4f4928d Remove extra ERC20ProxyId from Forwarder constructor 2018-07-11 20:16:59 +10:00
Jacob Evans
dd77a38535 Add Migrations for Forwarder 2018-07-11 20:16:04 +10:00
fragosti
d319b53e23 Add Heap snippet 2018-07-10 15:13:54 -07:00
Alex Browne
b9627e14d0 Merge pull request #848 from 0xProject/feature/contracts/safeMath
Add revert reasons and optimization to safeMath
2018-07-10 14:01:13 -07:00
Brandon Millman
56a96d36a1 Merge pull request #849 from 0xProject/feature/website/tokens-backend
Grab token registry information from our DB for mainnet
2018-07-10 13:57:14 -07:00
Amir Bandeali
e60630fa73 Update artifacts 2018-07-10 12:55:31 -07:00
Amir Bandeali
5ef6613024 Add revert reasons and optimization to safeMath 2018-07-10 12:53:47 -07:00
Amir Bandeali
af7e02de27 Merge pull request #837 from 0xProject/fix/contracts/assetProxyOwnerVersion
Use 0.4.10 in AssetProxyOwner
2018-07-10 12:46:53 -07:00
Brandon Millman
51d5b9d35d Grab token registry information from our DB for mainnet 2018-07-10 12:01:51 -07:00
Amir Bandeali
092ca6bcf5 Use 0.4.10 in AssetProxyOwner, add readBytes4 to contract and remove LibBytes 2018-07-10 11:24:22 -07:00
Francesco Agosti
2625cbbfed Merge pull request #846 from 0xProject/feature/website/add-peter-to-about
Add Peter to about page
2018-07-10 10:31:01 -07:00
fragosti
cedd1d5596 Add LinkedIn for Peter 2018-07-10 10:30:25 -07:00
Francesco Agosti
fb9e14a229 Merge pull request #845 from 0xProject/bug/website/portal-soft-launch-fixes
Enable sourceMaps on Rollbar and fix some small issues
2018-07-10 10:26:40 -07:00
fragosti
4e1bd7b5f0 Add Peter to about page 2018-07-09 19:02:50 -07:00
fragosti
5dfed8cd00 Update rollbar for telemetry 2018-07-09 18:17:14 -07:00
fragosti
a2672a0d78 Get rollbar uploads working by enabling sourcemaps 2018-07-09 18:04:55 -07:00
fragosti
ee5ac6b800 Fix unsubscribe bug 2018-07-09 16:16:48 -07:00
fragosti
a481d2ab46 Use JSON stringify around GIT_SHA 2018-07-09 16:07:16 -07:00
fragosti
c8bb21d12d Add sourcemaps for rollbar 2018-07-09 14:26:05 -07:00
fragosti
e817cd7d43 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into v2-prototype 2018-07-09 13:27:05 -07:00
fragosti
bd6085fffd Change Jacobs title to Ecosystem Engineer 2018-07-09 13:25:18 -07:00
Brandon Millman
7efe9a9385 Delete wings.png 2018-07-09 13:21:46 -07:00
Brandon Millman
50da40a727 Delete taas.png 2018-07-09 13:21:29 -07:00
Brandon Millman
48390a1875 Delete qtum.png 2018-07-09 13:21:12 -07:00
Brandon Millman
a3d27cd128 Delete eos.png 2018-07-09 13:20:49 -07:00
Brandon Millman
589c814ee6 Update icon file names 2018-07-09 13:17:57 -07:00
Leonid Logvinov
4b60a3cbab Merge branch 'v2-prototype' into abi-gen-ignore-unchanged 2018-07-09 20:08:28 +02:00
Fabio Berger
17956efe35 Merge pull request #843 from 0xProject/update-after-dev-publish
Update CHANGELOG & Versions After Development Publish
2018-07-09 19:40:37 +02:00
Fabio Berger
8378c9f85e Fix changelogs 2018-07-09 19:27:18 +02:00
Fabio Berger
c6da829713 Remaining version fixes 2018-07-09 18:55:22 +02:00
Fabio Berger
844b0687a6 Update incorrect versions 2018-07-09 18:22:18 +02:00
Fabio Berger
2ed2dd2fb7 Update package versions 2018-07-09 18:16:02 +02:00
Fabio Berger
d2f7dd3d5a Update changelogs 2018-07-09 17:49:28 +02:00
F. Eugene Aumson
9f08916cf1 add tests of abi-gen 2018-07-09 10:56:18 -04:00
F. Eugene Aumson
a0e3676e3a move abi-gen funcs from index to utils for testing
preparing for unit testing. purely refactoring (no functionality
changed).
2018-07-09 10:45:21 -04:00
F. Eugene Aumson
2276793629 using timestamps, skip gen of up-to-date wrappers 2018-07-09 10:36:41 -04:00
Fabio Berger
a9b320e636 Add back timestamp 2018-07-09 15:49:24 +02:00
Leonid Logvinov
ecdc0636d8 Merge pull request #841 from 0xProject/feature/v2-contract-wrappers-validation
Feature/v2 contract wrappers validation
2018-07-09 12:21:32 +02:00
Leonid Logvinov
ea12e34809 Ignore coverage of generated files 2018-07-09 12:07:42 +02:00
Leonid Logvinov
9fb7865292 Dedupe AssetProxyId types 2018-07-09 11:43:00 +02:00
Leonid Logvinov
12f30c78ff Fix a typo 2018-07-09 11:29:42 +02:00
Leonid Logvinov
e3bed5cc71 Default shouldValidate to true 2018-07-09 11:29:09 +02:00
Leonid Logvinov
0f8f5ca5ff Add basic validation for exchange contract wrapper 2018-07-09 11:13:21 +02:00
Leonid Logvinov
0fe0433b9a Add type for AssetProxyId 2018-07-09 11:13:21 +02:00
Leonid Logvinov
ab1e38701d Add revert reason parsing to error handling decorator 2018-07-09 11:13:21 +02:00
Leonid Logvinov
258fe8ea50 Render callAsync in templates even if it returns nothing 2018-07-09 11:13:21 +02:00
Leonid Logvinov
813824868e Return AssetProxyId instead of string from proxy.getProxyIdAsync() 2018-07-09 11:13:21 +02:00
Fabio Berger
028184947f Merge pull request #833 from feuGeneA/issue-823
document how to check test coverage on a fork
2018-07-09 10:10:31 +02:00
Amir Bandeali
14c96e0b97 Merge pull request #839 from 0xProject/refactor/contracts/forwarder-interfaces
Refactor forwarder file structure
2018-07-08 20:29:31 -07:00
Brandon Millman
ef03d1ae13 Give environment enums string values 2018-07-08 01:37:22 -07:00
Amir Bandeali
f1613d36ac Move functions out of Forwarder.sol 2018-07-07 23:23:22 -07:00
Amir Bandeali
8314bbbbac Add interfaces and mixins 2018-07-07 22:57:09 -07:00
Amir Bandeali
462f1f00d8 Combine mixins 2018-07-07 22:11:36 -07:00
Amir Bandeali
1c80bba4dd Use interfaces instead of full contracts 2018-07-07 22:11:36 -07:00
fragosti
d22cff0976 Shim shouldShowPortalV2 to always return true 2018-07-06 16:08:35 -07:00
Francesco Agosti
269b56b907 Merge pull request #838 from 0xProject/feature/website/portal-final-touches
Some final polish touches for portal!
2018-07-06 15:38:51 -07:00
fragosti
60ebfcf36d Fix lint errors 2018-07-06 15:21:50 -07:00
fragosti
824c331ea0 Make unlock metamask step look more like mock 2018-07-06 15:17:23 -07:00
fragosti
b9e51d2fad Add updated asset for unlock metamask portal onboarding step 2018-07-06 14:23:00 -07:00
fragosti
9669a4d121 Create Balance component and make token symbols smaller than token amounts 2018-07-06 14:21:30 -07:00
Amir Bandeali
e929fb4337 Merge pull request #826 from 0xProject/refactor/contracts/todos
Address TODOs and small fixes
2018-07-06 13:41:06 -07:00
Brandon Millman
80da9cd31f Merge pull request #835 from 0xProject/feature/website/token-updates
Update token registry icons and asset picker flows
2018-07-06 13:24:55 -07:00
Amir Bandeali
5ed7a1baba Add lint-contracts to default lint command 2018-07-06 13:23:09 -07:00
Amir Bandeali
07c111d1f5 Remove TODOs that won't be addressed 2018-07-06 13:23:09 -07:00
Amir Bandeali
a2024da955 Remove AbiV2 where unused 2018-07-06 13:23:05 -07:00
fragosti
7418926ebb Give Wallet a min height 2018-07-06 13:17:28 -07:00
Brandon Millman
4cc33d270e Merge pull request #828 from 0xProject/feature/website/portal-improvements
Fix some portal bugs, and poll for best gas price
2018-07-06 13:05:27 -07:00
Brandon Millman
f767f5c12c Hard code exchange abi 2018-07-06 13:03:35 -07:00
Amir Bandeali
0ea3b10efd Only reset currentContextAddress if it was previously updated 2018-07-06 11:53:59 -07:00
Amir Bandeali
d634775d40 Change uint => uint256 2018-07-06 11:53:59 -07:00
Francesco Agosti
c4ab5bc653 Merge pull request #829 from 0xProject/bug/web3-wrapper/fix-invalid-transaction-format
Fix invalid transaction format errors when going through `SingerSubprovider`
2018-07-06 11:46:03 -07:00
Amir Bandeali
1d3bdfc374 Merge pull request #834 from 0xProject/fix/contracts/linter
Apply linter to nested contracts
2018-07-06 11:45:06 -07:00
fragosti
72fb1ee36f Fix linting issues 2018-07-06 11:30:01 -07:00
fragosti
afbc4989d5 address CR feedback 2018-07-06 11:23:41 -07:00
Amir Bandeali
d2e422cd5e Apply new linter rules 2018-07-06 10:58:28 -07:00
Brandon Millman
49c7365d93 Update token registry icons and asset picker flows 2018-07-06 10:51:46 -07:00
fragosti
c753e24f0a Export marshaller and use it to unmarshal tx dataa 2018-07-06 10:35:13 -07:00
fragosti
acfbba5476 Revert moving formatUtils into utils 2018-07-06 10:23:24 -07:00
Amir Bandeali
e796734659 Update linter config 2018-07-06 09:51:09 -07:00
F. Eugene Aumson
f172908bde document how to check test coverage on a fork 2018-07-06 10:26:24 -04:00
Leonid Logvinov
16dc4e9f66 Instantiate BlockAndLogStreamer with generic type parameters 2018-07-06 13:36:23 +02:00
Fabio Berger
8eefc89d55 Merge pull request #831 from 0xProject/fix-readme-intros
Update Package Descriptions
2018-07-06 13:10:00 +02:00
Fabio Berger
20d349cea7 Merge pull request #825 from 0xProject/fix-order-watcher
OrderWatcher Fixes
2018-07-06 13:06:12 +02:00
Fabio Berger
22f408f713 Update readme and doc intros 2018-07-06 13:05:13 +02:00
Fabio Berger
1e0fa776c1 Add isVerbose flag and log blockstream recoverable errors rather then bubbling them up 2018-07-06 12:34:03 +02:00
Leonid Logvinov
faf5c84082 Fix imports 2018-07-06 11:21:49 +02:00
Leonid Logvinov
b21f6e4d86 Merge pull request #822 from 0xProject/v2-contract-wrappers-WIP
V2 contract wrappers
2018-07-06 12:10:55 +03:00
Jacob Evans
bc52303402 Types: Move Forwarder Revert Reason into types package 2018-07-06 18:26:59 +10:00
Jacob Evans
2da705e81c Forwarder specify the revert reasons 2018-07-06 18:09:56 +10:00
Jacob Evans
a0601cd052 Forwarder fix linter error 2018-07-06 17:44:17 +10:00
Jacob Evans
ed2c06508b Update to new assertions 2018-07-06 17:43:15 +10:00
Jacob Evans
03b3d74748 Merge pull request #522 from 0xProject/feature/contracts/forwarder
Forwarding contract
2018-07-06 16:29:56 +10:00
Jacob Evans
0557d6a9bf Forwarding contract (squashed commits) 2018-07-06 15:30:07 +10:00
Brandon Millman
d975c0cef3 Merge pull request #827 from 0xProject/feature/website/landing-page-cta
Landing page CTA for portal
2018-07-05 22:03:13 -07:00
fragosti
188bf000b7 Add formatUtils 2018-07-05 18:59:01 -07:00
fragosti
608442b2e8 Add to changelog, rename to formatUtils and lint 2018-07-05 18:56:58 -07:00
fragosti
aefc122caf Add conversion utility file 2018-07-05 18:38:25 -07:00
fragosti
a72eae7ea8 Unmarshall txn data in SignerSubprovider before calling web3wrapper sendTransactionAsync 2018-07-05 18:32:28 -07:00
fragosti
30e3afc0fb Add unmarshallTxData to marshaller 2018-07-05 17:48:02 -07:00
fragosti
97809a03eb Make wallet height responsive 2018-07-05 17:11:50 -07:00
fragosti
f894ffc0cc Poll for gas prices and use fast instead of average for better UX 2018-07-05 15:37:35 -07:00
fragosti
127fbc6e94 Just disable closing onboarding by clicking outside for firefox 2018-07-05 15:16:46 -07:00
Brandon Millman
9f870b3d4e Change call to action link to /portal 2018-07-05 15:12:22 -07:00
Amir Bandeali
51b86742d1 Merge pull request #824 from protofire/v2-prototype-solhint
Add and apply solidity linter (V2, updated)
2018-07-05 15:09:41 -07:00
Brandon Millman
3a85b3212b Unify large and small padding in Portal 2018-07-05 14:42:22 -07:00
Brandon Millman
fd6445439e Implement landing page change in preperation for portal 2018-07-05 14:34:34 -07:00
Brandon Millman
51fa8d3e24 Merge pull request #820 from 0xProject/bug/website/top-bar-layout
Various mobile portal fixes and top bar layout refactor
2018-07-05 14:33:22 -07:00
Brandon Millman
7b8db1156d Various fixes for portal on mobile and top bar layout 2018-07-05 14:31:05 -07:00
Fabio Berger
32ad34d224 properly stop blockstream and pass stateLayer into blockstream 2018-07-05 23:18:55 +02:00
Fabio Berger
cfbb1c440e Add pr number 2018-07-05 22:33:11 +02:00
Fabio Berger
ade2f96ca3 Add changelog notes 2018-07-05 22:32:25 +02:00
Fabio Berger
abb38e1bc0 Don't unsubscribe on Blockstream errors 2018-07-05 22:25:47 +02:00
Fabio Berger
0df36471b7 Pass actual networkId 2018-07-05 22:24:21 +02:00
fragosti
97312c2656 Use default networkId of 1 for ledger dropdown 2018-07-05 11:45:54 -07:00
fragosti
e9e4df4891 Fix onboarding closing on unlock metamask step on click outside 2018-07-05 11:28:34 -07:00
Francesco Agosti
e0f80c5e6a Merge pull request #816 from 0xProject/feature/website/portal-mobile-improvements
Make onboarding and wallet copy dynamic based on OS
2018-07-05 11:09:25 -07:00
Alex Shafranovich
f21b042ed1 Contracts 2.0.0 were linted with solhint 2018-07-05 21:01:14 +03:00
Alex Shafranovich
d8c7c9803c Added Solhint package and 'lint-contracts' npm script 2018-07-05 20:58:52 +03:00
fragosti
302b9deef3 Rename getBestDownloadLink to getBestWalletDownloadLinkAndIsMobile 2018-07-05 10:54:13 -07:00
Leonid Logvinov
0c8264801a Fix tests 2018-07-05 19:11:41 +02:00
Leonid Logvinov
54d1a0359f Fix prettier 2018-07-05 17:09:14 +02:00
Leonid Logvinov
b87e48c113 Fix merge conflicts 2018-07-05 16:51:37 +02:00
Fabio Berger
a874cd2424 Remove legacy logic 2018-07-05 16:42:01 +02:00
Fabio Berger
d9e308e53a Refactor order-watcher to use Blockstream under-the-hood 2018-07-05 16:39:53 +02:00
Leonid Logvinov
efc3536283 Add CHANGELOG entries 2018-07-05 16:30:36 +02:00
Leonid Logvinov
4b7e669d29 Upgrade artifacts 2018-07-05 16:02:26 +02:00
Leonid Logvinov
01c6efeaf1 Merge branch 'v2-prototype' into v2-contract-wrappers-WIP 2018-07-05 17:00:50 +03:00
Leonid Logvinov
22cf7bee5b Merge pull request #814 from 0xProject/feature/fill-scenarios-v2
@0xproject/contract-wrappers V2 refactor. Part 2
2018-07-05 16:59:12 +03:00
Leonid Logvinov
ef890aeac4 Adjust comments 2018-07-05 15:58:42 +02:00
Leonid Logvinov
91e8c00076 Fix comments 2018-07-05 15:58:42 +02:00
Leonid Logvinov
20bf4d8ef9 Improve the comment 2018-07-05 15:58:42 +02:00
Leonid Logvinov
795da130a2 Rename Proxie to Proxy 2018-07-05 15:58:41 +02:00
Leonid Logvinov
51a625d4af Rename compact_artifacts to artifacts 2018-07-05 15:58:41 +02:00
Leonid Logvinov
ab8544b0ff Rearrange assertions t match parameter order 2018-07-05 15:58:41 +02:00
Leonid Logvinov
b68d16820f Fix match orders test and add a validation TODO 2018-07-05 15:58:41 +02:00
Leonid Logvinov
61d9cdced0 Add tests for exchange contract wrapper 2018-07-05 15:58:41 +02:00
Leonid Logvinov
714f9ed207 Add Exchange contract wrapper 2018-07-05 15:56:32 +02:00
Leonid Logvinov
ccccaf8e12 Pass through blockPollingInterval down to contract wrapper 2018-07-05 15:56:31 +02:00
Leonid Logvinov
c3ce9d6104 Export orderStatus and OrderInfo 2018-07-05 15:56:31 +02:00
Leonid Logvinov
d3f602f063 Add blockPollingInterval config to contractWrappers config type 2018-07-05 15:56:31 +02:00
Leonid Logvinov
6b379a8a0f Add contractWrappers.erc721Proxy.getproxyIdAsync 2018-07-05 15:56:31 +02:00
Leonid Logvinov
d1d636f1ca Add contractWrappers.erc20Proxy.getproxyIdAsync 2018-07-05 15:56:31 +02:00
Leonid Logvinov
ba9d3cbdb8 Make it possible to configure block polling interval in base contract wrapper 2018-07-05 15:56:31 +02:00
Leonid Logvinov
bcf8d51806 Add blockPollingIntervalMs as an optional field to contract-wrappers config schemas 2018-07-05 15:05:58 +02:00
Leonid Logvinov
66c0d6724a Add even more entries to postinstall hack 2018-07-05 15:05:58 +02:00
Leonid Logvinov
0f477607f9 Update dummy tokens addresses in token_utils 2018-07-05 15:05:58 +02:00
Leonid Logvinov
c1635f2656 Remove only from tests 2018-07-05 15:05:57 +02:00
Leonid Logvinov
029d91bd7a Add OrderInfo and OrderStatus to types 2018-07-05 15:05:57 +02:00
Leonid Logvinov
03dbad6813 Add OrderTxOptsSchema 2018-07-05 15:05:57 +02:00
Leonid Logvinov
c65b2573c4 Refactor fill-scenarios for V2 2018-07-05 15:05:57 +02:00
Leonid Logvinov
7fbee77875 Export ecSignatureParameterSchema from json-schemas 2018-07-05 15:05:57 +02:00
Leonid Logvinov
3cc1a952ca Add ordersSchema to json-schemas 2018-07-05 15:05:57 +02:00
Leonid Logvinov
9c8de3e933 Fix VRS signature generation in order-utils 2018-07-05 15:05:57 +02:00
Leonid Logvinov
cbdce6b67e Update ABI in compact_artifacts 2018-07-05 15:05:57 +02:00
Leonid Logvinov
a6746ae5cd Upgrade artifacts 2018-07-05 15:05:57 +02:00
Leonid Logvinov
7111f3ffc6 Dump assert version and make the order-watcher depend on the old assert version 2018-07-05 15:05:57 +02:00
Fabio Berger
87a7a4ad2d Merge pull request #821 from 0xProject/remove-web3-from-wrapper
Remove Web3.js From 0x-monorepo 🍾
2018-07-05 15:04:58 +02:00
Leonid Logvinov
1ee2d6ed54 Merge branch 'v2-prototype' into v2-contract-wrappers-WIP 2018-07-05 15:04:01 +02:00
Leonid Logvinov
1eba78e20a Revert all changes to the contracts 2018-07-05 14:49:05 +02:00
Fabio Berger
a1fb438a8c Prettier fixes 2018-07-05 13:03:33 +02:00
Fabio Berger
40d1b0a23c Update json-schema version used by web3-wrapper 2018-07-05 12:35:38 +02:00
Fabio Berger
1c9a657693 Add schema assertion checks for callData and txData 2018-07-05 12:35:16 +02:00
Fabio Berger
11747c6cf4 Make sure from is included in txData 2018-07-05 12:34:15 +02:00
Fabio Berger
2a7b3aecc3 Add CallData schema to json-schemas 2018-07-05 12:33:48 +02:00
Fabio Berger
75babed693 Update assert changelog 2018-07-05 12:07:17 +02:00
Fabio Berger
0a32ae6cb5 Add defaultBlock param to getBalanceInWeiAsync 2018-07-05 12:04:08 +02:00
Fabio Berger
3d67f122a5 Move 'from' check to sendTransaction 2018-07-05 12:03:34 +02:00
Fabio Berger
b0daec8384 Remove bn.js unused dep 2018-07-05 01:56:40 +02:00
Fabio Berger
f5b1fe0e6b Fix linter issues 2018-07-05 01:45:56 +02:00
Fabio Berger
139d289b01 remove stray console.log 2018-07-05 01:39:46 +02:00
Fabio Berger
fd242a9cba Remove web3Utils dep and write necessary utility methods 2018-07-05 01:38:14 +02:00
Fabio Berger
7efa17ef7d Add new param javadoc comment 2018-07-05 00:40:43 +02:00
Fabio Berger
a0b9c7777b merge v2-prototype 2018-07-05 00:38:15 +02:00
Fabio Berger
5204e4c08d Pass 'from' param to estimateGas since it is required 2018-07-05 00:36:30 +02:00
Fabio Berger
1050ecdf3c Refactor Web3Wrapper to no longer use Web3.js & add more test coverage 2018-07-05 00:36:01 +02:00
Fabio Berger
5176d929fa Merge pull request #817 from 0xProject/remove-web3
Remove Web3 Dependencies (exept for in web3-wrapper)
2018-07-04 18:51:17 +02:00
Fabio Berger
d712dc47d9 Removee getContractFromAbi method since we no longer use it and do not recommend others use it 2018-07-04 18:11:50 +02:00
Fabio Berger
8adc6f0faa merge v2-prototype 2018-07-04 16:35:49 +02:00
Fabio Berger
4e783fba57 Add missing undefined check 2018-07-04 16:34:03 +02:00
Jacob Evans
ade620f4f7 Merge pull request #775 from RadarRelay/eth-lightwallet-subprovider-final
Eth lightwallet subprovider (replaces #660)
2018-07-04 20:49:25 +10:00
Jacob Evans
5915f8430c Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final 2018-07-04 20:29:54 +10:00
Jacob Evans
9e0f06d060 Specify the lint rule to disable 2018-07-04 20:06:10 +10:00
Fabio Berger
ce86ae0191 Add assert dep 2018-07-04 08:56:12 +02:00
Fabio Berger
2bec5cb7fd Fix bug in string enum assertion so that we check enum values not keys 2018-07-04 08:55:16 +02:00
Fabio Berger
cd766ea2a1 Add more assertions to Web3Wrapper public methods 2018-07-04 08:54:43 +02:00
Fabio Berger
aeea3817a4 Merge pull request #818 from 0xProject/fix-intermittent-test-failure
Fix intermittent test failure in Subproviders package
2018-07-04 07:48:37 +02:00
fragosti
0f11ae1875 No longer elevate relayer grid tile on long press 2018-07-03 18:22:19 -07:00
fragosti
6e87e3e1ac Fix issue where onboarding doesn't scroll to wallet when starting from relayers page 2018-07-03 18:05:00 -07:00
Fabio Berger
4ba108d12f Use stub in test to avoid difference in setup, how network requests take place 2018-07-04 00:59:18 +02:00
Fabio Berger
8ff17ff960 improve comment 2018-07-04 00:41:19 +02:00
Fabio Berger
0d56daf7ab remove console.log 2018-07-04 00:37:39 +02:00
Fabio Berger
9db0bc262b Fix conditional 2018-07-04 00:36:57 +02:00
Fabio Berger
f410903465 Rename to InjectedProvider and make publicConfigStore optional 2018-07-04 00:29:29 +02:00
Fabio Berger
5f2c303bd8 Remove hack since latest web3-provider-engine fixed underlying issue 2018-07-04 00:23:40 +02:00
Fabio Berger
6aa4984fed Fix instance variable name 2018-07-04 00:22:21 +02:00
Fabio Berger
f5cd1ac82e Fix linter 2018-07-04 00:18:09 +02:00
Fabio Berger
54c0b7b261 Fix type 2018-07-04 00:13:36 +02:00
Fabio Berger
a7902eca1f Fix package.json 2018-07-03 23:57:33 +02:00
Fabio Berger
2b4bb579d4 Rename subprovider in blockchain.ts 2018-07-03 23:57:19 +02:00
fragosti
52c956222e Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/portal-mobile-improvements 2018-07-03 14:43:23 -07:00
Francesco Agosti
0900e0c85e Merge pull request #811 from 0xProject/feature/website/onboarding-polish-2
Add Hotjar, and other small improvements
2018-07-03 14:43:02 -07:00
Fabio Berger
a5653337c1 Remove unused imported Web3.js 2018-07-03 23:36:14 +02:00
Fabio Berger
d097113639 Remove dep on Web3 in Website. Introduced InjectedWeb3 type. 2018-07-03 23:34:51 +02:00
fragosti
9389d64392 Add toshi logo asset 2018-07-03 14:32:11 -07:00
fragosti
931e7e7d71 Prompt user to download Toshi or MetaMask in install wallet onboarding step 2018-07-03 14:28:49 -07:00
Fabio Berger
cce2fb40a1 Fix import 2018-07-03 23:11:59 +02:00
Fabio Berger
547cf4bef3 Refactor testnet-faucet to use web3Wrapper instead of web3 directly 2018-07-03 23:11:49 +02:00
Fabio Berger
d528ce757c Replace use of web3 w/ web3wrapper in subproviders and rename injectedWeb3 to signer subprovider for clarity 2018-07-03 22:58:17 +02:00
fragosti
3b78188fec Show different download links and icons when on mobile 2018-07-03 13:51:58 -07:00
Alex Browne
d91b30faef Merge pull request #812 from 0xProject/fix/revert-assertions-improvements
Improve robustness of revert reason assertions
2018-07-03 13:42:30 -07:00
Alex Browne
dc956020ef Move NodeType caching out of web3-wrapper and into our internal code 2018-07-03 12:57:11 -07:00
fragosti
a52eb81380 Rename isMobile utility fn to be more specific and add isMobileOperatingSystem 2018-07-03 12:48:19 -07:00
fragosti
ab0055d5c6 Add OperatingSystemType and get OS util 2018-07-03 12:45:28 -07:00
fragosti
32c25a2034 Persist whether onboarding is open or close across refreshes 2018-07-03 11:48:34 -07:00
fragosti
c30b42434a Fix linting 2018-07-03 11:31:40 -07:00
fragosti
3c797a6e11 Merge branch 'fixed-position-onboarding' into feature/website/onboarding-polish-2 2018-07-03 11:26:26 -07:00
Brandon Millman
9b864517e2 Merge pull request #799 from 0xProject/feature/website/wallet-menu
Add menu for at the top of wallet and top right component
2018-07-03 11:19:52 -07:00
Fabio Berger
a858e2870b Merge pull request #815 from 0xProject/update-dependencies
Update Blockstream & ProviderEngine
2018-07-03 20:19:08 +02:00
Alex Browne
ce1542da4f Update CHANGELOG.json for ethereum-types and web3-wrapper 2018-07-03 10:59:45 -07:00
Alex Browne
d2ebf4a777 Add TransactionReceiptStatus type to ethereum-types 2018-07-03 10:49:35 -07:00
Alex Browne
c5fcea1dbd Actually cache node type in web3-wrapper 2018-07-03 10:40:54 -07:00
Fabio Berger
5e8ef070e2 Fix alignment 2018-07-03 18:26:12 +02:00
Brandon Millman
2d30c290e9 Remove InstallPrompt 2018-07-03 09:22:52 -07:00
Fabio Berger
688b34710e Update blockstream to latest version, propogate errors to top-level callers 2018-07-03 18:15:20 +02:00
Brandon Millman
afbfc8ba1c Implement clickaway for wallet menu on mobile 2018-07-03 09:06:29 -07:00
Fabio Berger
671f29774b Update web3-provider-engine version w/o caret 2018-07-03 16:56:49 +02:00
Fabio Berger
4c99ac0ca2 Update web3-provider-engine 2018-07-03 15:59:30 +02:00
Leonid Logvinov
0e690608d3 Merge pull request #782 from 0xProject/feature/contract-wrappers-v2
@0xproject/contract-wrappers V2 refactor. Part 1
2018-07-03 15:32:38 +03:00
Fabio Berger
92f6391df5 Merge pull request #801 from feuGeneA/patch-3
in subproviders/package.json, cite typescript-typings only once
2018-07-03 11:53:23 +02:00
Brandon Millman
f2af6e4b3a Add optional onClick to Link simple menu item 2018-07-03 01:51:59 -07:00
Jacob Evans
27c03cffe2 Fix unused imports 2018-07-03 17:01:08 +10:00
Jacob Evans
499915042e Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final 2018-07-03 16:58:08 +10:00
Jacob Evans
1a901554cc compiler and ts lint are confused about ContractEventArgs 2018-07-03 15:39:15 +10:00
Alex Browne
5b64b3ea93 Improve robustness of revert reason assertions 2018-07-02 18:57:33 -07:00
fragosti
6fc5c0cd46 Remove unused import 2018-07-02 18:36:41 -07:00
Brandon Millman
328da21420 Merge pull request #806 from 0xProject/feature/website/mobile-readable-web3-names
Add detection logic for Toshi and Cipher
2018-07-02 18:26:16 -07:00
Brandon Millman
81062d20eb Merge pull request #808 from 0xProject/feature/website/better-balance-formatting
Add better balance formatting rules for balances and usd values
2018-07-02 18:25:58 -07:00
Brandon Millman
835d06dcdc Merge pull request #810 from 0xProject/feature/wesbite/remove-add-balance
Remove increase balance link from balance_bounded_input component
2018-07-02 18:25:43 -07:00
fragosti
8929543b55 Add end comment to hotjar tracking code 2018-07-02 18:15:41 -07:00
fragosti
f62044c1e3 Add media file and remove stray comment 2018-07-02 18:14:21 -07:00
fragosti
a31f7a5112 Implement fixed position onboarding option 2018-07-02 18:12:08 -07:00
Brandon Millman
fe68114f39 Use new lock svg 2018-07-02 17:56:37 -07:00
fragosti
a5231df6d9 Add media query abstraction around ScreenWidths and stop relayer grid hover effect on mobile 2018-07-02 17:26:48 -07:00
Brandon Millman
fd545ec00f Remove increase balance link from balance_bounded_input component 2018-07-02 17:14:46 -07:00
Brandon Millman
73d8a2adf7 Always show the wrap ether row in between ETH and WETH 2018-07-02 17:02:11 -07:00
Brandon Millman
04d11d6fac Add human readable names for Toshi and Cipher 2018-07-02 16:37:22 -07:00
Brandon Millman
2eede4a09e Update start onboarding copy and relayer grid empty color 2018-07-02 16:30:13 -07:00
Brandon Millman
bc7e8ff471 Add better balance formatting rules for balances and usd values 2018-07-02 16:08:02 -07:00
fragosti
73e81c62fb Remove max-width from onboarding card to support iPad 2018-07-02 15:58:53 -07:00
fragosti
8c5dc7cecd Only auto-start onboarding if blockchain is loaded 2018-07-02 15:52:59 -07:00
Francesco Agosti
300c9f09b9 Merge pull request #805 from 0xProject/feature/website/add-alex-to-about
Add Alex Browne to about page
2018-07-02 14:09:31 -07:00
fragosti
06f4427939 Add Alex Browne to about page 2018-07-02 13:15:40 -07:00
Amir Bandeali
b1dc20bbb3 Add developer mailing list link to README 2018-07-02 09:51:51 -07:00
F. Eugene Aumson
4887d1d42f in subproviders, cite typescript-typings only once
`yarn build` was giving the following warning:

warning package.json: "dependencies" has dependency "@0xproject/typescript-typings" with range "^0.4.1" that collides with a dependency in "devDependencies" of the same name with version "^0.4.2"
2018-07-02 11:23:33 -04:00
Fabio Berger
d247d72e3e Merge pull request #803 from 0xProject/fix/publishing/remote-tag-removal
Small publish fixes
2018-07-02 16:20:34 +02:00
Fabio Berger
50957e1d29 Update incorrect versions of deps 2018-07-02 16:04:48 +02:00
Fabio Berger
6aad12a52f Add new changelog entry 2018-07-02 14:26:52 +02:00
Fabio Berger
db0944acde fix prettier 2018-07-02 14:21:49 +02:00
Fabio Berger
e553ef83de Git command outputs logs to stdErr so only way to check for errors if with try/catch 2018-07-02 14:20:42 +02:00
Fabio Berger
a619949a56 Remove remote tag before local one 2018-07-02 14:19:30 +02:00
Fabio Berger
1346fa792a Add logs for when tags get removed 2018-07-02 13:53:44 +02:00
Fabio Berger
b763cdbd4c combine changelog entries since we haven't published yet 2018-07-02 13:53:24 +02:00
Fabio Berger
e4eac14dc9 version outdated 2018-07-02 13:53:05 +02:00
Fabio Berger
bdda1f2992 Throw if changelog version is below package.json version 2018-07-02 13:32:22 +02:00
Fabio Berger
9c7289d7a3 Update outdated changelogs 2018-07-02 13:31:34 +02:00
Fabio Berger
d861caca23 Fix bug where 18 decimal tokens instead of 5 decimal tokens created 2018-07-02 12:31:02 +02:00
Fabio Berger
590033bcb2 Merge pull request #802 from 0xProject/fix/five_decimal_scenario
FillOrder Combinatorial Testing Fixes
2018-07-02 12:24:57 +02:00
Fabio Berger
af1e4574a8 Disable custom-no-magic-number for block 2018-07-02 11:39:07 +02:00
Fabio Berger
7b806fe84d Remove unused variable 2018-07-02 11:18:48 +02:00
Fabio Berger
e54e2ac67b Add .vscode from .gitignore 2018-07-02 11:13:31 +02:00
Fabio Berger
de9f0732a0 Merge branch 'v2-prototype' into fix/five_decimal_scenario
* v2-prototype: (75 commits)
  Update relayer grid tiles to use Text
  Fix build
  Update file structure
  Update 2.0.0 artifacts
  Move ledgerhq module declarations to typescript-typings
  Export LedgerEthereumClient type in subproviders
  Update artifacts
  Add logging and updated artifacts
  Fix migrations
  Run prettier
  Add Kovan artifacts
  Use ledger subprovider
  Add Kovan migrations
  Remove state variable from Link component in Portal
  Make registerAssetProxy append only
  Update staging api link
  Change getTransactionReceipt to awaitTransactionMined
  Move /docs route to the end
  Remove extra call to scrollIntoView for wallet in onboarding
  Update expectRevertReasonOrAlwaysFailingTransactionAsync to check status codes
  ...
2018-07-02 11:12:01 +02:00
Fabio Berger
20acdbf6c3 Add commented out scenarios not run by default 2018-07-02 11:01:15 +02:00
Fabio Berger
6a6d2f73a8 Fix comment 2018-07-02 11:00:32 +02:00
Fabio Berger
f5a8f00af8 Fix validation logic by checking for 0 maker/taker amount before 0 fillTakerAssetAmount since one causes the other during combinatorial testing 2018-07-02 10:52:49 +02:00
Fabio Berger
018a437d62 Print out entire orderFill scenario 2018-07-02 10:51:28 +02:00
Fabio Berger
32d75b6483 Transfer ERC721 token instead of burning, so we can still set an allowance to it in tests 2018-07-02 10:50:48 +02:00
Fabio Berger
cb6cace910 Fix bug where using nullAddress for order instead of actual taker address 2018-07-02 10:49:41 +02:00
Fabio Berger
0326ddd79d Add maker and taker balance/allowance scenarios to generateFillOrderCombination 2018-07-02 10:48:59 +02:00
Jacob Evans
d6f40a9281 Remove duplicated typescript-typings in package.json 2018-07-02 18:14:19 +10:00
Jacob Evans
687802394a Remove duplicate type definitions.
Clear private key earlier
Fix changelog in typescript-typings from bad merge
2018-07-02 18:09:05 +10:00
Jacob Evans
ad570b8ae1 Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final 2018-07-02 11:21:16 +10:00
Jacob Evans
b9165c03af Use PrivateKeySubprovider inside eth lightwallet
There's a loss of information when hex encoding and passing to eth light wallet (chain id is lost). This results in a different signature. While it may work on testnets it is not sufficient for our test cases. We can export the private key and use it in our PrivateKeyWalletSubprovider
2018-07-02 11:09:32 +10:00
F. Eugene Aumson
cfe57f52f4 use bullets, not a task list, for Types of Changes 2018-07-01 20:44:28 -04:00
Brandon Millman
86d4ffe7e5 Lint fixes 2018-07-01 14:51:02 -07:00
Brandon Millman
2dea179333 More cleanup 2018-07-01 14:51:02 -07:00
Brandon Millman
5a7908984e Consolidate logic for common menu items 2018-07-01 14:51:02 -07:00
Brandon Millman
955fdf5d13 Give connected header accessory more padding 2018-07-01 14:51:02 -07:00
Brandon Millman
a6f40d4187 Implement correct behavior for menu in the wallet 2018-07-01 14:50:55 -07:00
Brandon Millman
6daf754f5b Add menu to wallet 2018-07-01 14:50:55 -07:00
Brandon Millman
da8cf9981e Implement simple menu 2018-07-01 14:50:55 -07:00
Brandon Millman
be64184cfa Clean up a bit of the provider display logic 2018-07-01 14:50:55 -07:00
Brandon Millman
3031598843 Implement icon button 2018-07-01 14:50:55 -07:00
Brandon Millman
b9b00e10d3 Update relayer grid tiles to use Text 2018-06-30 12:37:34 -07:00
Amir Bandeali
6c34255a3e Merge pull request #781 from 0xProject/refactor/contracts/fileStructure
Update contracts file structure
2018-06-29 18:36:00 -07:00
Amir Bandeali
41064adc66 Fix build 2018-06-29 18:20:44 -07:00
Amir Bandeali
2fcc36bbad Update file structure 2018-06-29 18:05:40 -07:00
Amir Bandeali
762c0143eb Merge pull request #770 from 0xProject/feature/migrations/kovan-deploy
Add Kovan migrations
2018-06-29 17:49:15 -07:00
Amir Bandeali
6c6f34ee72 Update 2.0.0 artifacts 2018-06-29 17:41:25 -07:00
Francesco Agosti
42b7b0dab9 Merge pull request #787 from 0xProject/feature/website/portal-onboarding-polish
Portal v2 onboarding polish
2018-06-29 17:40:43 -07:00
Amir Bandeali
e58e35e098 Move ledgerhq module declarations to typescript-typings 2018-06-29 17:25:56 -07:00
Amir Bandeali
654b048602 Export LedgerEthereumClient type in subproviders 2018-06-29 17:25:56 -07:00
Amir Bandeali
3ece72af49 Update artifacts 2018-06-29 17:25:56 -07:00
Amir Bandeali
2ef31991c7 Add logging and updated artifacts 2018-06-29 17:25:56 -07:00
Amir Bandeali
d3293a5571 Fix migrations 2018-06-29 17:25:56 -07:00
Amir Bandeali
854752acdf Run prettier 2018-06-29 17:25:56 -07:00
Amir Bandeali
0c889385f1 Add Kovan artifacts 2018-06-29 17:25:56 -07:00
Amir Bandeali
6e1a549fcb Use ledger subprovider 2018-06-29 17:25:56 -07:00
Amir Bandeali
5f0a2953c6 Add Kovan migrations 2018-06-29 17:25:56 -07:00
Amir Bandeali
78b513c52a Merge pull request #797 from 0xProject/refactor/contracts/registerAssetProxy
Make registerAssetProxy append only
2018-06-29 17:25:21 -07:00
fragosti
8ffce78827 Remove state variable from Link component in Portal 2018-06-29 16:47:58 -07:00
Amir Bandeali
d4852092b8 Make registerAssetProxy append only 2018-06-29 16:25:16 -07:00
Brandon Millman
622ce0bf2e Update staging api link 2018-06-29 16:11:57 -07:00
Amir Bandeali
6a197a64e6 Merge pull request #793 from 0xProject/feature/contracts/transferFromFallback
Optimize transferFrom (saves ~2000 gas /fill)
2018-06-29 15:34:56 -07:00
Amir Bandeali
1e4c3ed22b Change getTransactionReceipt to awaitTransactionMined 2018-06-29 15:21:00 -07:00
Brandon Millman
e3521c6388 Move /docs route to the end 2018-06-29 15:20:44 -07:00
fragosti
9d81e069dc Remove extra call to scrollIntoView for wallet in onboarding 2018-06-29 14:04:41 -07:00
Amir Bandeali
8623a30763 Merge pull request #796 from 0xProject/fix/contracts/failingTransactionAssertions
Update expectRevertReasonOrAlwaysFailingTransactionAsync to check status codes
2018-06-29 14:03:28 -07:00
Alex Browne
6cf39896f1 Update expectRevertReasonOrAlwaysFailingTransactionAsync to check status codes 2018-06-29 13:46:42 -07:00
Amir Bandeali
44b6adaa29 Fix deployment to geth 2018-06-29 13:33:22 -07:00
Amir Bandeali
762a6199b2 Fix tests 2018-06-29 13:33:22 -07:00
Amir Bandeali
8da42b12f4 Remove transferFrom, implement in fallback function 2018-06-29 13:33:22 -07:00
fragosti
c473a0444c Bump automatic show onborading delay by 1000ms 2018-06-29 13:30:43 -07:00
fragosti
e693629bbd Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/portal-onboarding-polish 2018-06-29 13:27:19 -07:00
fragosti
0dbe883c3b Fix onboarding always starting 2018-06-29 13:24:31 -07:00
Brandon Millman
cc12bc9247 Merge pull request #792 from 0xProject/feature/website/wallet-polish
Various wallet polish items
2018-06-29 12:01:13 -07:00
Brandon Millman
ddec01e6c1 Change function to a const 2018-06-29 11:56:31 -07:00
Brandon Millman
03bc7bb935 Move wallet scrollIntoView into PortalOnboardingFlow 2018-06-29 11:55:00 -07:00
fragosti
5207dfdc0e Rename userHasAllowances bool to follow proper convention 2018-06-29 11:50:24 -07:00
fragosti
fc40efb761 Allow you to continue the onboarding flow once youve installed metamask and refreshed the page 2018-06-29 11:47:12 -07:00
Amir Bandeali
50556e2609 Merge pull request #774 from 0xProject/style/contracts/abiEncodeAsmComments
Added some comments for ASM hashing
2018-06-29 11:41:23 -07:00
Alex Browne
7a22298597 Merge pull request #794 from 0xProject/fix/devnet-minimum-blocks
Improve reliability of the minimum block number hack for devnet/geth
2018-06-29 11:21:17 -07:00
fragosti
36cadaae46 Use Image component where relevant and add back tracked token timestamp logic 2018-06-29 11:08:48 -07:00
Leonid Logvinov
09e921a562 Fix build after rebase 2018-06-29 17:52:55 +03:00
Leonid Logvinov
13cbaf56b2 Add a comment 2018-06-29 17:52:55 +03:00
Leonid Logvinov
62910c8e89 Assign true values to names vars 2018-06-29 17:52:55 +03:00
Leonid Logvinov
f20e1acad9 Fix a typo 2018-06-29 17:52:55 +03:00
Leonid Logvinov
5dea432ebf Set the interval to 0 in awaitTranscationSuccessAsync 2018-06-29 17:52:55 +03:00
Leonid Logvinov
016d82d766 Make promises dangerous 2018-06-29 17:52:54 +03:00
Leonid Logvinov
260c72cc20 Add a TODO comment 2018-06-29 17:52:54 +03:00
Leonid Logvinov
3d7bcd7ecb Add isSubscriptionToken assertion 2018-06-29 17:52:54 +03:00
Leonid Logvinov
ac9175bf88 Rename approved to approvedAddress 2018-06-29 17:52:54 +03:00
Leonid Logvinov
294d3bbdc1 Use removeUndefinedProperties for txOpts 2018-06-29 17:52:54 +03:00
Leonid Logvinov
6db614251e Rename getApprovedAsync to getApprovedIfExistsAsync 2018-06-29 17:52:54 +03:00
Leonid Logvinov
bcc588efe7 Add HACK comments 2018-06-29 17:52:54 +03:00
Leonid Logvinov
f7b3fc58bc Add assertions for txOpts and methodOpts 2018-06-29 17:52:54 +03:00
Leonid Logvinov
de40497330 Remove v2 artifact scripts 2018-06-29 17:52:54 +03:00
Leonid Logvinov
d84bb7ed7e Remove tokenTransferProxyAddress from config 2018-06-29 17:52:54 +03:00
Leonid Logvinov
f02ada2d11 Add a hack comment 2018-06-29 17:52:54 +03:00
Leonid Logvinov
48970d3424 Fix a typo 2018-06-29 17:52:54 +03:00
Leonid Logvinov
8940b1759d Fix linter errors 2018-06-29 17:52:54 +03:00
Leonid Logvinov
91a50d0f53 Fix addresses in WETH9 and ZRX token artifacts 2018-06-29 17:52:54 +03:00
Leonid Logvinov
ed4f8c5b66 Fix the token supply in migrations 2018-06-29 17:52:53 +03:00
Leonid Logvinov
2f07ee0a8f Dump assert version and make the order-watcher depend on the old assert version 2018-06-29 17:52:53 +03:00
Leonid Logvinov
8dd00a8eef Change event args names after templates change 2018-06-29 17:52:53 +03:00
Leonid Logvinov
d7845a177e Add contract-wrappers -> json-schemas and order-utils to postinstall hack 2018-06-29 17:52:53 +03:00
Leonid Logvinov
7a3be0a320 Change import paths from z_r_x and e_r_c to zrx and erc in migrations 2018-06-29 17:52:53 +03:00
Leonid Logvinov
14cebce304 Regenerate yarn.lock 2018-06-29 17:52:53 +03:00
Leonid Logvinov
9fcf9f2504 Export newly refactored contracts from contract-wrappers and index.ts 2018-06-29 17:52:53 +03:00
Leonid Logvinov
c466ab6cf2 Change artifacts list and add dependencies to package.json 2018-06-29 17:52:53 +03:00
Leonid Logvinov
01bf789ad4 Bump the version so that order-watcher doesn't pick it up 2018-06-29 17:52:53 +03:00
Leonid Logvinov
1a1ab5af54 Refactor event subscription tests 2018-06-29 17:52:53 +03:00
Leonid Logvinov
4089ad7b4b Refactor types 2018-06-29 17:52:53 +03:00
Leonid Logvinov
2adc299c78 Implement ERC721 token wrapper and token transfer proxy with tests 2018-06-29 17:52:53 +03:00
Leonid Logvinov
3aef323c13 Refactor ERC20 token transfer proxy and it's tests 2018-06-29 17:52:53 +03:00
Leonid Logvinov
a655cd046c Refactor ERC20 token wrapper and it's tests 2018-06-29 17:52:53 +03:00
Leonid Logvinov
9c8701f5f6 Refactor ether token wrapper test 2018-06-29 17:52:52 +03:00
Leonid Logvinov
7ac84aff0a Refactor base contract-wrapper class to use new names, artifact format and only decode logs from that contract 2018-06-29 17:52:52 +03:00
Leonid Logvinov
fd13c8f68c Refactor EtherToken contract wrapper to use new names and artifacts format 2018-06-29 17:52:52 +03:00
Leonid Logvinov
532964af42 Use new signature verification method in assertions 2018-06-29 17:52:52 +03:00
Leonid Logvinov
52d1407215 Export txDefaults from web3_wrapper.ts 2018-06-29 17:52:52 +03:00
Leonid Logvinov
ecb7356345 Refactor tokenUtils to not use tokenRegistry 2018-06-29 17:52:52 +03:00
Leonid Logvinov
edda7dae94 Add new test constants 2018-06-29 17:52:52 +03:00
Leonid Logvinov
32da0a376a Skip & refactor artifacts tests 2018-06-29 17:52:52 +03:00
Leonid Logvinov
073e76ee90 Run V2 migrations instead of V1 before tests 2018-06-29 17:52:52 +03:00
Leonid Logvinov
ceba82260f Remove unused params in filter_utils 2018-06-29 17:52:52 +03:00
Leonid Logvinov
a5a61c87fc Start unused parameter names with underscore 2018-06-29 17:52:52 +03:00
Leonid Logvinov
d34feb1e0a Remove old contracts and add new ones to/from artifacts.ts 2018-06-29 17:52:52 +03:00
Leonid Logvinov
6cc5e45183 Remove exchange-related functionality for now 2018-06-29 17:52:52 +03:00
Leonid Logvinov
618c7ef48a Update compact_wrtifacts 2018-06-29 17:52:52 +03:00
Leonid Logvinov
14047f9c7b Change import paths from z_r_x and e_r_c to zrx and erc. Also rename event args after templates change 2018-06-29 17:52:51 +03:00
Leonid Logvinov
f439f162d2 Change import paths from z_r_x and e_r_c to zrx and erc 2018-06-29 17:52:51 +03:00
Leonid Logvinov
5b685b32bd Rename TransferContractEventArgs to MetacoinTransferEventArgs after changing contracts templates 2018-06-29 17:52:51 +03:00
Leonid Logvinov
6ce151c676 Change import paths from z_r_x and e_r_c to zrx and erc 2018-06-29 17:52:51 +03:00
Leonid Logvinov
eb79b5d651 Pin contract-wrappers version 2018-06-29 17:52:51 +03:00
Leonid Logvinov
608e1c8960 Remove unused code/variables from abi-decoder 2018-06-29 17:52:51 +03:00
Leonid Logvinov
f8772d8850 Rename {{*}}ContractEventArgs to {{*}}EventArgs and append {{contractName}} to each event name (ERC721TransferEventArgs instead of TransferContractEventArgs) 2018-06-29 17:52:51 +03:00
Leonid Logvinov
ce2f408864 Update json-schema version to 1.0.0 2018-06-29 17:52:51 +03:00
Leonid Logvinov
c2a362e3ea Add to postinstall hack: rm fill-scenarios/node_modules/@0xproject 2018-06-29 17:52:51 +03:00
Leonid Logvinov
eafdd4d42d Remove generated contract directory before writing new contracts and replace z_r_x and e_r_c with zrx and erc accordingly 2018-06-29 17:52:51 +03:00
Fabio Berger
1a2c58494f Merge pull request #783 from 0xProject/miscenaleous-fixes
Migration Related Miscellaneous fixes
2018-06-29 11:59:49 +02:00
Fabio Berger
68c00976f1 Fix merge 2018-06-29 11:40:05 +02:00
Fabio Berger
aa2616b307 Merge v2-prototype 2018-06-29 11:34:38 +02:00
Jacob Evans
3062c18ebd Merge pull request #795 from 0xProject/miscellaneous-fixes/v2-exchange-register-assets
Register the asset proxies to exchange
2018-06-29 19:31:10 +10:00
Jacob Evans
a83f5241dc Register the asset proxies to exchange 2018-06-29 19:12:42 +10:00
Brandon Millman
f89acb49be Add dollar sign to NullTokenRow 2018-06-29 01:11:02 -07:00
Brandon Millman
2b5f45676f Remove unused imports and variables 2018-06-29 01:07:50 -07:00
Brandon Millman
aedd51a61b Refactor inline styles out of Wallet 2018-06-29 00:59:24 -07:00
Brandon Millman
0b5a49c17d Remove some hardcoded MetaMask colors 2018-06-28 23:31:17 -07:00
Brandon Millman
08f7666d21 Create AccountConnection component 2018-06-28 23:24:57 -07:00
Brandon Millman
81ff99276b Fix scrollbar bug 2018-06-28 23:03:30 -07:00
fragosti
e71862676c Bold all balances in onboarding 2018-06-28 18:02:32 -07:00
fragosti
67777c586d Customize allowance setting onboarding step if you have your allowances set 2018-06-28 18:00:10 -07:00
fragosti
9ada8e4ddf Re-center react-popper on every step 2018-06-28 17:51:39 -07:00
fragosti
0142e7fa8f Fix button hover and active hover state 2018-06-28 17:37:22 -07:00
fragosti
467e9abf5f Show eth balance in add eth balance onboarding step 2018-06-28 17:34:29 -07:00
fragosti
512980d9bd Change onboarding flow to communicate 3 steps 2018-06-28 17:25:58 -07:00
fragosti
e235a63119 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/portal-onboarding-polish 2018-06-28 17:20:05 -07:00
Alex Browne
4c28b66539 Add @0xproject/utils as dependency to dev-utils/package.json 2018-06-28 15:42:56 -07:00
Greg Hysen
46d79e5115 Updated hashing comments as-per PR 2018-06-28 15:41:06 -07:00
Alex Browne
d79994fbb2 Improve reliability of the minimum block number hack for the devnet/geth 2018-06-28 15:32:14 -07:00
Brandon Millman
518a2da027 Merge pull request #791 from 0xProject/bug/website/broken-not-found
Fix NotFound component and render 0x.js docs for /docs
2018-06-28 12:35:18 -07:00
Brandon Millman
71fa92dbeb Fix NotFound component and render 0x.js docs for /docs 2018-06-28 12:24:34 -07:00
Brandon Millman
172d2353dd Start onboarding from relayer index 2018-06-28 11:50:08 -07:00
Brandon Millman
3315006c45 Fix learn how to set up account layout 2018-06-28 11:50:08 -07:00
Brandon Millman
6700745585 Fix typo 2018-06-28 11:50:08 -07:00
Brandon Millman
0ff18058ab Get rid of unused stuff in wallet 2018-06-28 11:50:08 -07:00
Brandon Millman
1a11283086 Fix body overlay on mobile 2018-06-28 11:50:08 -07:00
Brandon Millman
ed559be47c Change learn how to update your account styling 2018-06-28 11:50:08 -07:00
Brandon Millman
a60dd1cbaf Fix key issue and remove WalletDisconnectedItem 2018-06-28 11:50:08 -07:00
Brandon Millman
7ee37fb62a Implement new locked and uninstalled states 2018-06-28 11:50:08 -07:00
Brandon Millman
2970e103db Fix off center icon in wallet 2018-06-28 11:50:08 -07:00
Brandon Millman
78333b3026 Change wallet margin based on hover to prevent re-layout 2018-06-28 11:50:08 -07:00
Brandon Millman
1ca182e741 Update ProviderDisplay with new design 2018-06-28 11:50:08 -07:00
Brandon Millman
8419db53bb Implement provider name in header 2018-06-28 11:50:08 -07:00
Brandon Millman
f76c9bc226 Implement loading body rows 2018-06-28 11:50:08 -07:00
Brandon Millman
6a39a69afe Added Circle component 2018-06-28 11:50:08 -07:00
Francesco Agosti
2474d1d2f4 Merge pull request #780 from 0xProject/feature/website/support-new-metamask
Refactor Blockchain.ts to allow arbitrary provider state changes
2018-06-28 11:36:49 -07:00
fragosti
e4188f5d4c Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/support-new-metamask 2018-06-28 11:17:30 -07:00
Brandon Millman
0fcbd02d50 Merge pull request #762 from 0xProject/feature/website/scroll-to-token
Sort wallet tokens by timestamp added and scroll to newly added token
2018-06-28 10:47:43 -07:00
Brandon Millman
4969797c23 Remove isTracked field on token in favor of trackedTimestamp 2018-06-28 10:39:16 -07:00
Brandon Millman
0e932286d2 Use moment and lodash 2018-06-28 10:38:07 -07:00
Brandon Millman
366a9502dd Sort wallet tokens by timestamp added and scroll to newly added token 2018-06-28 10:38:07 -07:00
Fabio Berger
988a334758 Merge pull request #707 from 0xProject/feature/combinatorial-testing
OrderFill Declarative Testing & Combinatorial Tests [Merge after #760]
2018-06-28 11:04:16 +02:00
Fabio Berger
4fe6269043 Remove unused constants 2018-06-28 10:45:28 +02:00
Fabio Berger
646927962a Reduce the userAddresses to the individual addresses actually used by tests, as well as only deploy the number of ERC20 tokens needed for each test suite 2018-06-28 10:43:37 +02:00
Fabio Berger
b56baefaa6 Add await time constant 2018-06-28 09:34:13 +02:00
Fabio Berger
f49a507297 Add missing awaitTransactionSuccessAsync calls 2018-06-28 09:13:56 +02:00
fragosti
c20549e88d Scroll to top when going to relayers page from onboarding 2018-06-27 19:23:51 -07:00
fragosti
cd16986942 Bring you directly to relayers page once you finish onboarding 2018-06-27 19:21:09 -07:00
fragosti
e481404a14 Remove period in title from last step 2018-06-27 19:07:53 -07:00
fragosti
3dfde15133 Always restart onboarding from 0 and other small improvements 2018-06-27 18:56:14 -07:00
fragosti
4454cfa65d Customize flow depending on what steps you've completed 2018-06-27 18:21:51 -07:00
fragosti
382839464f Break wrapping ETH into a 3rd step 2018-06-27 17:00:07 -07:00
fragosti
cce5585795 Fix animation when coming from bottom 2018-06-27 16:29:38 -07:00
fragosti
26a9fe9127 Fix width issue with onboarding card on mobile 2018-06-27 16:21:50 -07:00
fragosti
47a267c3fa Clicking overlay closes onboarding 2018-06-27 15:14:21 -07:00
fragosti
36836eb942 Fix z index issue with wrap buttons and onboarding cards 2018-06-27 14:45:01 -07:00
fragosti
aad0804a1e Break wrath ETH step into 2 2018-06-27 14:33:04 -07:00
fragosti
3c68d9c297 Fix skip button position on first step 2018-06-27 13:51:37 -07:00
fragosti
ffdc7d13a9 Make onboarding bounce around less 2018-06-27 13:40:52 -07:00
fragosti
c5085d8364 Scroll to wallet when onboarding automatically starts as well 2018-06-27 13:36:38 -07:00
fragosti
00ad7bc470 Change asset for final onboarding step 2018-06-27 13:23:17 -07:00
fragosti
360927ec77 Changing provider to ledger more consistent with previous experience 2018-06-27 11:37:24 -07:00
fragosti
b6f546ebe0 Fix convention stuff 2018-06-27 11:17:32 -07:00
fragosti
2a092143dc Remove IS_MAINNET_ENABLED config 2018-06-27 10:40:07 -07:00
fragosti
de50407953 Rename all corresponding bools to shouldUseLedgerProvider 2018-06-27 10:34:17 -07:00
Fabio Berger
57d5fbfbd8 Merge pull request #766 from perissology/feature/solcov-ignore
[sol-cov] add ability to ignore covering specific code blocks
2018-06-27 19:00:16 +02:00
Fabio Berger
92322c0e07 Remove network 50 details 2018-06-27 18:42:34 +02:00
Fabio Berger
97ed453eb4 Re-generate and clean up artifacts for 2.0.0 2018-06-27 18:34:44 +02:00
Fabio Berger
654b782810 Add missing AssetProxyOwner from compile:v2 command 2018-06-27 18:34:03 +02:00
Fabio Berger
51211a21ba Improve ganache-core's GanacheOpts type and require it instead of any 2018-06-27 18:33:32 +02:00
Fabio Berger
133b6fe240 Encode ZRX address as needed. 2018-06-27 18:32:48 +02:00
Fabio Berger
c824fe8718 Add optimizer settings to migrations compiler.json 2018-06-27 18:31:34 +02:00
Fabio Berger
26d3a487a5 Update ganache-cli to latest 2018-06-27 18:31:18 +02:00
perissology
e0a2afc068 rename function 2018-06-27 07:26:12 -07:00
Fabio Berger
f6e97bb284 Merge pull request #763 from prettymuchbryce/invalid-argument-error
Fix OrderWatcher uncaught Error
2018-06-27 11:55:04 +02:00
Fabio Berger
6c8b998505 Fix tslint 2018-06-27 11:28:41 +02:00
Fabio Berger
f9fab216e9 Merge branch 'v2-prototype' into invalid-argument-error 2018-06-27 11:02:40 +02:00
Fabio Berger
c308359f59 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
  Improve 'web3-provider-engine' typings
  Fix build
  Update artifacts
  Add more revert reasons to tests
  Make dispatchTransferFrom revert with reason from AssetProxy on failure
  Remove redundant files, hard code function selector in dispatchTransferFrom, and modify revert reason
  Updated offset of receiverData length to reflect new assetData encoding.
  ERC20 Custom storage layout
  Golf the authorization check
  ERC20 manual memory layout
  ERC20 inline return
  ERC721 inline return
  Golf ERC721 transferFrom
  Inline ERC20 tranferFrom selector constant
  Optimize ERC20 transferFrom
  Polish asset picker layout
  Update relayer grid fallback icon
  Change metamask install link based on browser
  Use ethereumjs-tx@1.3.5 instead of our fork

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
#	packages/contracts/test/exchange/core.ts
#	packages/migrations/artifacts/2.0.0/DummyERC721Token.json
2018-06-27 10:59:37 +02:00
Fabio Berger
375d667144 Move combinatorial fillOrder tests into the fill_ordere test file 2018-06-27 10:43:12 +02:00
Nikita Galkin
84bd54ba40 Improve 'web3-provider-engine' typings 2018-06-27 09:26:48 +03:00
Amir Bandeali
73c36fe2d2 Merge pull request #773 from 0xProject/feature/contracts/abi-calldata-proxy
Optimize transfer
2018-06-26 18:38:30 -07:00
Amir Bandeali
ec3e9efdaa Fix build 2018-06-26 18:30:20 -07:00
Amir Bandeali
d5c389b7dc Update artifacts 2018-06-26 17:36:44 -07:00
Amir Bandeali
7f233dcb15 Add more revert reasons to tests 2018-06-26 17:34:43 -07:00
Fabio Berger
6a2421c683 Fix tests 2018-06-26 23:17:29 +02:00
Fabio Berger
d66ca7b5cb Fix enum name 2018-06-26 23:17:20 +02:00
fragosti
5e38cbd69c Never use trackedTokenState when fetching new token state 2018-06-26 13:58:31 -07:00
Amir Bandeali
b6d8dcb6e1 Make dispatchTransferFrom revert with reason from AssetProxy on failure 2018-06-26 13:57:55 -07:00
Amir Bandeali
08ee1ab2e6 Remove redundant files, hard code function selector in dispatchTransferFrom, and modify revert reason 2018-06-26 13:57:51 -07:00
fragosti
26edec5773 Fix bug where we are requesting tokens on a different network 2018-06-26 13:43:25 -07:00
fragosti
d72e06842f Remove unused variables 2018-06-26 12:48:00 -07:00
fragosti
0a0da63ac7 Make unsubscribing work 2018-06-26 12:33:38 -07:00
Greg Hysen
873ec898d8 Updated offset of receiverData length to reflect new assetData encoding. 2018-06-26 12:23:19 -07:00
Remco Bloemen
97a70d14a3 ERC20 Custom storage layout 2018-06-26 12:23:19 -07:00
Remco Bloemen
394fbebfa8 Golf the authorization check 2018-06-26 12:23:19 -07:00
Remco Bloemen
b79588c4a0 ERC20 manual memory layout 2018-06-26 12:23:19 -07:00
Remco Bloemen
3b46e82625 ERC20 inline return 2018-06-26 12:23:19 -07:00
Remco Bloemen
dbaf1fcd43 ERC721 inline return 2018-06-26 12:23:19 -07:00
Remco Bloemen
4caf1271e4 Golf ERC721 transferFrom 2018-06-26 12:23:19 -07:00
Remco Bloemen
6921943aff Inline ERC20 tranferFrom selector constant 2018-06-26 12:23:19 -07:00
Remco Bloemen
3ce90b8257 Optimize ERC20 transferFrom 2018-06-26 12:23:19 -07:00
fragosti
3866154b50 Fix stateful ledger dialog edge state 2018-06-26 12:16:10 -07:00
fragosti
64ed2464cf Get things working with legacy portal 2018-06-26 12:09:20 -07:00
fragosti
e27780aee9 Fix subtle issues with ledger config dialog 2018-06-26 11:59:23 -07:00
Brandon Millman
744e6e60c5 Polish asset picker layout 2018-06-26 11:17:00 -07:00
fragosti
f70c1ff009 Ledger to metamask to ledger working 2018-06-26 11:01:50 -07:00
Brandon Millman
3a808fe7fd Update relayer grid fallback icon 2018-06-26 10:40:59 -07:00
Brandon Millman
2ca169b3c4 Merge pull request #777 from 0xProject/feature/website/browser-detection
Change metamask install link based on browser
2018-06-26 10:29:26 -07:00
Alex Browne
098d486291 Merge pull request #776 from 0xProject/ethereum-js-tx-1.3.5
Use ethereumjs-tx@1.3.5 instead of our fork
2018-06-26 10:22:53 -07:00
Fabio Berger
ec4fb70b80 Merge pull request #760 from 0xProject/refactor/check-revert-reasons
Check Revert Reasons in Contract Tests
2018-06-26 19:20:19 +02:00
Fabio Berger
2a82807be4 Fix type issue 2018-06-26 19:16:57 +02:00
Fabio Berger
43ae868c69 Merge branch 'refactor/check-revert-reasons' into feature/combinatorial-testing
* refactor/check-revert-reasons:
  Temporarily switch revert reasons to `TransferFailed`. Should be `InvalidAmount` but because of an oversight in the assembly implementation of `dispatchTransferFrom`, it always throws `TransferFailed`
  Expect RevertReason be passed in, not string
  Rename RevertReasons to RevertReason since singular enum names are more common

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
#	packages/contracts/test/exchange/core.ts
2018-06-26 18:53:44 +02:00
Fabio Berger
1bc742aed1 Temporarily switch revert reasons to TransferFailed. Should be InvalidAmount but because of an oversight in the assembly implementation of dispatchTransferFrom, it always throws TransferFailed 2018-06-26 18:49:10 +02:00
Fabio Berger
6dc852774e Update AbstractAssetWrapper 2018-06-26 08:52:25 +02:00
Fabio Berger
7967ebed57 Rename to singular 2018-06-26 08:51:40 +02:00
Fabio Berger
105b927397 Fix merge issues 2018-06-26 08:43:37 +02:00
Fabio Berger
9219f9d8ae Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (21 commits)
  Don't use variables for revert reasons
  Add comments to dispatchTransferFrom
  Document IAssetData
  Compute bytes4 proxyid constants
  Return inplace bytes in LibBytes.readBytesWithLength
  Add Greg's documentation to MixinErc721Transfer
  Add Greg's documentation to MixinErc20Transfer
  Gas golf the transfer success logic
  Optimize like in PR #767
  Run prettier and fix linting errors
  Fix tests
  Update tests
  Fix AssetProxyUtils
  Update tests
  Fix ERC721Proxy TokenId
  Update AssetProxyUtils
  Add IAssetData
  WIP
  ABI encoded asset data
  Remove proxyId argument from dispatchTransferFrom
  ...

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
2018-06-26 08:13:59 +02:00
Fabio Berger
f780e6f235 Expect RevertReason be passed in, not string 2018-06-26 08:11:32 +02:00
Fabio Berger
27670f4da6 Rename RevertReasons to RevertReason since singular enum names are more common 2018-06-26 08:11:14 +02:00
Fabio Berger
e051743a3d Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (21 commits)
  Don't use variables for revert reasons
  Add comments to dispatchTransferFrom
  Document IAssetData
  Compute bytes4 proxyid constants
  Return inplace bytes in LibBytes.readBytesWithLength
  Add Greg's documentation to MixinErc721Transfer
  Add Greg's documentation to MixinErc20Transfer
  Gas golf the transfer success logic
  Optimize like in PR #767
  Run prettier and fix linting errors
  Fix tests
  Update tests
  Fix AssetProxyUtils
  Update tests
  Fix ERC721Proxy TokenId
  Update AssetProxyUtils
  Add IAssetData
  WIP
  ABI encoded asset data
  Remove proxyId argument from dispatchTransferFrom
  ...

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
2018-06-26 08:07:37 +02:00
Fabio Berger
fb03003b3a Fix inconsistency between contract and reference implementation of order validation logic 2018-06-26 07:50:24 +02:00
Brandon Millman
e52d0a3512 Change metamask install link based on browser 2018-06-25 17:48:36 -07:00
Amir Bandeali
cba92a01b6 Merge pull request #743 from 0xProject/feature/contracts/abi-encoded
ABI encode assetData fields
2018-06-25 16:53:15 -07:00
Alex Browne
0a87364101 Use ethereumjs-tx@1.3.5 instead of our fork 2018-06-25 16:40:33 -07:00
Amir Bandeali
a89908540f Don't use variables for revert reasons 2018-06-25 16:34:06 -07:00
fragosti
c4e2dcafa4 Have basic network switching working 2018-06-25 16:26:34 -07:00
Amir Bandeali
0163984ea4 Add comments to dispatchTransferFrom 2018-06-25 16:19:08 -07:00
Remco Bloemen
db3ce08cab Document IAssetData 2018-06-25 16:19:08 -07:00
Remco Bloemen
1076959006 Compute bytes4 proxyid constants 2018-06-25 16:19:08 -07:00
Remco Bloemen
5127cbb22c Return inplace bytes in LibBytes.readBytesWithLength 2018-06-25 16:19:08 -07:00
Remco Bloemen
9175b43542 Add Greg's documentation to MixinErc721Transfer 2018-06-25 16:19:07 -07:00
Remco Bloemen
562fec01d8 Add Greg's documentation to MixinErc20Transfer 2018-06-25 16:19:07 -07:00
Remco Bloemen
b8051c8fed Gas golf the transfer success logic 2018-06-25 16:19:07 -07:00
Remco Bloemen
4df66a4802 Optimize like in PR #767 2018-06-25 16:19:07 -07:00
Amir Bandeali
a2ff63daa5 Run prettier and fix linting errors 2018-06-25 16:19:07 -07:00
Amir Bandeali
7ce0f9682f Fix tests 2018-06-25 16:19:07 -07:00
Remco Bloemen
3c6d0dc3e0 Update tests 2018-06-25 16:19:07 -07:00
Remco Bloemen
64a6fb2344 Fix AssetProxyUtils 2018-06-25 16:19:07 -07:00
Remco Bloemen
07734a5184 Update tests 2018-06-25 16:19:07 -07:00
Remco Bloemen
32d4994219 Fix ERC721Proxy TokenId 2018-06-25 16:19:07 -07:00
Remco Bloemen
08d22d2f3c Update AssetProxyUtils 2018-06-25 16:19:07 -07:00
Remco Bloemen
b7b0185baf Add IAssetData 2018-06-25 16:19:07 -07:00
Remco Bloemen
7b0c13c121 WIP 2018-06-25 16:19:07 -07:00
Remco Bloemen
a98ecc05af ABI encoded asset data 2018-06-25 16:19:07 -07:00
Remco Bloemen
f7337c1a05 Remove proxyId argument from dispatchTransferFrom 2018-06-25 16:19:07 -07:00
fragosti
53e2cda4c8 Remove existing networkId watching logic from BlockchainWatcher 2018-06-25 16:01:26 -07:00
Fabio Berger
8064914bb7 Prettier fixes 2018-06-25 23:17:56 +02:00
Fabio Berger
6bb2203f79 Small stylistic tweaks 2018-06-25 23:07:27 +02:00
Fabio Berger
3d56817da1 Update yarn.lock 2018-06-25 23:00:19 +02:00
Fabio Berger
31e3b9ff8b Fix and imprrove ethLightWalletSubprovider 2018-06-25 22:59:41 +02:00
Fabio Berger
b2e32aaf58 Remove legacy named subprovider 2018-06-25 22:59:24 +02:00
Fabio Berger
699de9174e Format type 2018-06-25 22:59:04 +02:00
Fabio Berger
1dd9ec4d5a Remove duplicate type 2018-06-25 22:58:50 +02:00
Fabio Berger
87d66ccf6c Fix Tslint issues 2018-06-25 22:58:36 +02:00
Fabio Berger
1134ff1075 Fix tslint issues 2018-06-25 20:17:00 +02:00
Fabio Berger
178676ef8c Fix lint errors 2018-06-25 20:08:00 +02:00
Greg Hysen
94740155e5 Comments for ASM hashing 2018-06-25 11:02:31 -07:00
Fabio Berger
9341afe764 Merge pull request #772 from 0xProject/add-coverage-instructions
Improve Contracts README Testing Section
2018-06-25 19:58:15 +02:00
Cavan
7ce1e9b18d Add eth-lightwallet subprovider and tests 2018-06-25 19:39:23 +02:00
Cavan
1821f60fb5 Move eth-lightwallet declaration to typings 2018-06-25 19:08:16 +02:00
Cavan
235d78565e Format subprovider using prettier 2018-06-25 19:06:22 +02:00
Cavan
db5880539b Update changelogs 2018-06-25 19:01:53 +02:00
Cavan
76f4d67f33 Remove timestamps and fix typings 2018-06-25 18:58:25 +02:00
Bryce
e59c57106c Run prettier 2018-06-25 09:44:56 -07:00
Cavan
bb4c748bf1 Formatting and standards updates 2018-06-25 18:42:13 +02:00
perissology
92cb9c3807 add /*solcov ignore next*/ tests 2018-06-25 08:18:02 -07:00
perissology
1a4e99431b support ignoring entire contracts 2018-06-25 07:55:19 -07:00
Fabio Berger
ec9d1ca57e Document all the contract test options in README 2018-06-25 15:18:02 +02:00
Fabio Berger
71c9b98896 Fix revertReason 2018-06-25 14:23:35 +02:00
Fabio Berger
71bac8c60b Update yarn.lock 2018-06-25 13:51:41 +02:00
Fabio Berger
7b0f7c2e5c Remove no longer used method 2018-06-25 13:51:18 +02:00
Fabio Berger
ad67a6add5 Check revert reasons in declarative and combinatorial tests 2018-06-25 13:51:00 +02:00
Fabio Berger
1353723b58 merge check-revert-reasons 2018-06-25 13:02:38 +02:00
Fabio Berger
f811c07454 Move RevertReasons to @0xproject/types package 2018-06-25 12:59:26 +02:00
Fabio Berger
bb85382824 Add missing import 2018-06-25 12:47:44 +02:00
Fabio Berger
3ed4a1ba20 Add missing import 2018-06-25 12:47:13 +02:00
Fabio Berger
c50da5d034 merge check-revert-reasons 2018-06-25 12:32:16 +02:00
Fabio Berger
9b196ba68c Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (97 commits)
  Fix typos in comments
  Add modifier and tests for removeAuthorizedAddressAtIndex
  Update and add tests
  Change removeAuthorizedAddress => removeAuthorizedAddressAtIndex
  Move isFunctionRemoveAuthorizedAddress to test
  Fix usage of `popLastByte`
  Fix LibBytes is a library
  Remove `areBytesEqual`
  Fix usage of `contentAddress()`
  Clean low bits in bytes4
  Clean high bits in address
  Refactor LibBytes.readBytes4 for consistency
  Fix LibBytes.equals
  Add trailing garbage testcase for LibBytes.equals
  Rename bytes.equals
  Add slice and sliceDestructive
  Rename bytes.rawAddress and add bytes.contentAddress
  Rename read/writeBytesWithLength
  Using LibBytes for bytes
  Make LibBytes a library
  ...

# Conflicts:
#	packages/contracts/src/utils/constants.ts
#	packages/contracts/test/exchange/core.ts
2018-06-25 11:49:14 +02:00
Fabio Berger
df79fb19af Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (48 commits)
  Fix typos in comments
  Add modifier and tests for removeAuthorizedAddressAtIndex
  Update and add tests
  Change removeAuthorizedAddress => removeAuthorizedAddressAtIndex
  Move isFunctionRemoveAuthorizedAddress to test
  Fix usage of `popLastByte`
  Fix LibBytes is a library
  Remove `areBytesEqual`
  Fix usage of `contentAddress()`
  Clean low bits in bytes4
  Clean high bits in address
  Refactor LibBytes.readBytes4 for consistency
  Fix LibBytes.equals
  Add trailing garbage testcase for LibBytes.equals
  Rename bytes.equals
  Add slice and sliceDestructive
  Rename bytes.rawAddress and add bytes.contentAddress
  Rename read/writeBytesWithLength
  Using LibBytes for bytes
  Make LibBytes a library
  ...

# Conflicts:
#	packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol
#	packages/contracts/test/libraries/lib_bytes.ts
2018-06-25 11:45:17 +02:00
Leonid Logvinov
f8bde5ab9b Merge pull request #735 from feuGeneA/metacoin-independence
Metacoin independence
2018-06-25 11:35:24 +02:00
Jacob Evans
0cd37cbf7e Merge pull request #758 from 0xProject/fix/order-utils/known-order-hash
Fix known order hash value test in order-utils
2018-06-25 15:47:07 +10:00
Remco Bloemen
d621e4201d Merge pull request #698 from 0xProject/fix/contracts/using-libbytes
Fixes and refactoring regarding LibBytes
2018-06-23 14:08:40 +02:00
Remco Bloemen
82af1df3c3 Fix typos in comments 2018-06-23 13:55:02 +02:00
Amir Bandeali
ea8c2b8d69 Add modifier and tests for removeAuthorizedAddressAtIndex 2018-06-23 13:53:39 +02:00
Amir Bandeali
8ddcb6c841 Update and add tests 2018-06-23 13:53:39 +02:00
Amir Bandeali
1681361aed Change removeAuthorizedAddress => removeAuthorizedAddressAtIndex 2018-06-23 13:53:39 +02:00
Remco Bloemen
6a6f98299d Move isFunctionRemoveAuthorizedAddress to test 2018-06-23 13:53:39 +02:00
Remco Bloemen
19ba272d62 Fix usage of popLastByte 2018-06-23 13:53:39 +02:00
Remco Bloemen
2f8ceca2ef Fix LibBytes is a library 2018-06-23 13:53:39 +02:00
Remco Bloemen
ba1baafca5 Remove areBytesEqual 2018-06-23 13:53:38 +02:00
Remco Bloemen
20a07494f6 Fix usage of contentAddress() 2018-06-23 13:53:38 +02:00
Remco Bloemen
c66477c690 Clean low bits in bytes4 2018-06-23 13:53:38 +02:00
Remco Bloemen
5c612a186f Clean high bits in address 2018-06-23 13:53:38 +02:00
Remco Bloemen
943e556f43 Refactor LibBytes.readBytes4 for consistency 2018-06-23 13:53:38 +02:00
Remco Bloemen
4bf4f96f47 Fix LibBytes.equals 2018-06-23 13:53:38 +02:00
Remco Bloemen
384cd2f605 Add trailing garbage testcase for LibBytes.equals 2018-06-23 13:53:38 +02:00
Remco Bloemen
425af46f98 Rename bytes.equals 2018-06-23 13:53:38 +02:00
Remco Bloemen
c83ee04662 Add slice and sliceDestructive 2018-06-23 13:53:38 +02:00
Remco Bloemen
2054cd78da Rename bytes.rawAddress and add bytes.contentAddress 2018-06-23 13:53:38 +02:00
Remco Bloemen
88982f98ff Rename read/writeBytesWithLength 2018-06-23 13:53:38 +02:00
Remco Bloemen
2ea0b839d3 Using LibBytes for bytes 2018-06-23 13:53:38 +02:00
Remco Bloemen
afd83e59b8 Make LibBytes a library 2018-06-23 13:53:38 +02:00
Remco Bloemen
7f84049538 Merge LibMem and LibBytes 2018-06-23 13:53:38 +02:00
Remco Bloemen
98840c9c5f Use provided mem in refernce memcpy 2018-06-23 13:53:38 +02:00
Amir Bandeali
26cacfa247 Merge pull request #749 from 0xProject/feature/contracts/transactionHashAsm
Converted `hashZeroExTransaction` to assembly. Saves 1k gas
2018-06-22 16:57:50 -07:00
Bryce Neal
4b2d27b5e5 CHANGELOG spacing 2018-06-22 16:57:49 -07:00
Bryce
69625946b1 Typings and comment 2018-06-22 16:56:19 -07:00
Bryce
f7fe9b0961 Update at abi_decoder 2018-06-22 16:41:47 -07:00
Greg Hysen
7fcd34eb36 Apply mask to address to zero-out unused bytes. 2018-06-22 16:35:50 -07:00
Brandon Millman
1f5848ba82 Remove extra border from the bottom of the wallet 2018-06-22 16:07:07 -07:00
perissology
bbd414bdcd add ability to ignore covering specific code blocks 2018-06-22 15:59:36 -07:00
Brandon Millman
a1737a28d0 Do not render ZRX or WETH as removable tracked tokens 2018-06-22 15:57:34 -07:00
Brandon Millman
66be42d1f8 Center items in portal drawer header 2018-06-22 15:33:58 -07:00
Francesco Agosti
c984c0f2c0 Merge pull request #764 from 0xProject/feature/website/relay-grid-stacking-bug
Fix issue where hovered tiles appear over top bar
2018-06-22 15:16:13 -07:00
fragosti
89d2bb7ecd Fix issue where hovered tiles appear over top bar 2018-06-22 14:32:21 -07:00
Bryce Neal
9f8cad93f7 CHANGELOG spacing 2018-06-22 14:08:21 -07:00
Bryce Neal
a207260fe0 Fix CHANGELOG spacing. 2018-06-22 14:07:19 -07:00
Bryce
1ef4a47255 Fix spacing 2018-06-22 14:06:45 -07:00
Bryce
b8aa68b4d1 Add CHANGELOG entry 2018-06-22 14:05:23 -07:00
Bryce
61edbac6e5 Remove package-lock 2018-06-22 14:02:29 -07:00
Bryce
d315133d34 Re-throw if not INVALID_ARGUMENT 2018-06-22 14:01:14 -07:00
Bryce
82d59dbea8 Address INVALID_ARGUMENT issue 2018-06-22 13:35:49 -07:00
Francesco Agosti
42884e0871 Merge pull request #746 from 0xProject/feature/website/relayer-grid-polish
Relayer grid polish
2018-06-22 13:11:33 -07:00
fragosti
7fb8b546f9 Remove unecessary position relative rules 2018-06-22 12:22:31 -07:00
fragosti
80fe1938b8 Fix tslint error 2018-06-22 12:04:45 -07:00
fragosti
2409afae95 Merge https://github.com/0xProject/0x-monorepo into v2-prototype 2018-06-22 11:54:37 -07:00
fragosti
06705f9e88 Remove diverse from about page 2018-06-22 11:54:24 -07:00
fragosti
2b408e71ac Use Ops instead of Operations in Mels description 2018-06-22 11:47:57 -07:00
Brandon Millman
b097193486 Merge pull request #750 from 0xProject/bug/website/fix-add-token
Various add token flow bugs
2018-06-22 11:43:02 -07:00
Brandon Millman
543f2c91fe Pulled out reset AssetPicker state into a common variable 2018-06-22 11:37:57 -07:00
fragosti
05c0088445 Comment out Chris, and move Mel up in about page 2018-06-22 11:22:33 -07:00
Fabio Berger
2f6f815d81 Fix tslint 2018-06-22 18:54:18 +02:00
Fabio Berger
1e03fbe1a8 Fix prettier 2018-06-22 18:50:02 +02:00
Fabio Berger
4409f11b24 Rename ContractLibErrors to RevertReasons 2018-06-22 18:45:45 +02:00
Fabio Berger
7a216901be Remove revert reason 'Exchange' prefix 2018-06-22 18:41:55 +02:00
Fabio Berger
0e7c254b93 Move constants over to ContractLibError enum and update all tests 2018-06-22 18:36:15 +02:00
Fabio Berger
ba14850c9a Standardize ERC20 error strings given convention 2018-06-22 18:35:35 +02:00
Fabio Berger
59d3a21993 Fix test now that contract reverts with message 2018-06-22 17:39:41 +02:00
Fabio Berger
d2faa49bf4 Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype:
  Check that assetProxy exists before attempting transfer
2018-06-22 17:15:51 +02:00
Fabio Berger
438c0e27ea Merge pull request #748 from 0xProject/fix/contracts/nullAssetProxy
Check that assetProxy exists before attempting transfer
2018-06-22 17:14:22 +02:00
Fabio Berger
4c14372b4a Add revert reason checks to wrapper tests 2018-06-22 17:12:52 +02:00
Fabio Berger
8b4077d7de Fix tests 2018-06-22 17:12:31 +02:00
Fabio Berger
914b009361 Change Whitelist error messages to conform to rest and added revert reason checks to transactions tests 2018-06-22 17:12:17 +02:00
Jacob Evans
b2a4b7eb88 Fix known order hash value test 2018-06-22 23:00:22 +10:00
Fabio Berger
daa50442c9 Add revert reason checks to match_orders tests 2018-06-22 14:28:01 +02:00
Fabio Berger
76fd7f47eb Fix tests 2018-06-22 14:13:44 +02:00
Fabio Berger
fbf840cb68 Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype:
  Update ganache-core in yarn.lock
  Add coverage and test:circleci command to sra-report
  Add missing artifacts
  Skip failing tests temporarily
  Fix web3-wrapper test
  fix name
  Add missing package tests from circleci
2018-06-22 13:26:59 +02:00
Fabio Berger
798a647b71 Merge pull request #757 from 0xProject/fix/circle-ci
Add missing package tests from circleci
2018-06-22 13:26:12 +02:00
Fabio Berger
26a0b09064 Update ganache-core in yarn.lock 2018-06-22 13:12:55 +02:00
Fabio Berger
98570b5da1 Add coverage and test:circleci command to sra-report 2018-06-22 12:50:52 +02:00
Fabio Berger
e923d7dafb Add missing artifacts 2018-06-22 12:33:23 +02:00
Fabio Berger
64b6861880 Skip failing tests temporarily 2018-06-22 12:33:10 +02:00
Fabio Berger
c46e11cae2 Fix web3-wrapper test 2018-06-22 12:32:12 +02:00
Fabio Berger
82ccfa21e1 fix name 2018-06-22 12:02:40 +02:00
Fabio Berger
13f7fc1fd2 Add missing package tests from circleci 2018-06-22 11:59:14 +02:00
Fabio Berger
018cc14a87 Fix expected version in test 2018-06-22 10:47:38 +02:00
Fabio Berger
3ce295a2af Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (40 commits)
  Use make-promises-safe as a preloader instead of manually importing
  Updated compiler runs to be 1,000,000
  Add event to setSignatureValidatorApproval, rename signer => signerAddress accross all contracts
  Add senderAddress to Fill and Cancel logs, add comments to events and types
  Fix Island component
  Add missing image assets for Chris and Mel
  Fix some bugs in sol-cov
  Remove unreachable PreSigned check
  Fix linting
  Buttons look hella disabled now
  Remove border radius, fix width issue for unlock step
  Add Chris and Mel to about page
  fix linter issues
  only call getLocationByOffset if source if defined
  Set settleOrder and settleMatchedOrders to private
  Prevent prettier issue
  Support mobile friendly onboarding flows
  Removed MixinSettlement. Moved `settleOrder` into `MixinExchangeCore` and `settleMatchedOrders` into `MixinMatchOrders`
  Migrations after rebasing
  Linter
  ...
2018-06-22 10:39:07 +02:00
Fabio Berger
a30107ab86 Check revert reason in dispatcher tests 2018-06-22 10:38:08 +02:00
Fabio Berger
d8df6968d3 remove unused import 2018-06-22 10:37:25 +02:00
Fabio Berger
0515c6acde Merge pull request #752 from 0xProject/make-promises-safe-preloader
Use make-promises-safe as a preloader instead of manually importing
2018-06-22 10:32:06 +02:00
Amir Bandeali
607b44e01d Check that assetProxy exists before attempting transfer 2018-06-21 22:45:15 -07:00
Amir Bandeali
5c0bae2070 Merge pull request #751 from 0xProject/feature/contracts/compilerRuns
Updated compiler runs to be 1,000,000
2018-06-21 22:06:31 -07:00
Alex Browne
4012e31115 Use make-promises-safe as a preloader instead of manually importing 2018-06-21 19:17:33 -07:00
Greg Hysen
2d8e9eda56 Converted hashZeroExTransaction to assembly. Saves 1k gas 2018-06-21 18:49:17 -07:00
Brandon Millman
4375a0e07e Fix state mutation in reducer 2018-06-21 18:06:34 -07:00
Brandon Millman
a07cfb7abc Do not add empty token to local storage 2018-06-21 18:06:34 -07:00
Greg Hysen
c131d82699 Updated compiler runs to be 1,000,000 2018-06-21 17:58:39 -07:00
fragosti
de2dcbae5a Lint and fix typo 2018-06-21 17:42:37 -07:00
fragosti
b0000bb276 Fix z-index issues 2018-06-21 17:40:33 -07:00
fragosti
82789d5315 Fix issues that arose from merge 2018-06-21 17:40:33 -07:00
Brandon Millman
3df5882711 Remove Background component 2018-06-21 17:40:33 -07:00
Brandon Millman
b6765b849c Padding adjustment 2018-06-21 17:40:33 -07:00
Brandon Millman
df94e5f164 Remove styles from Portal component 2018-06-21 17:40:33 -07:00
Brandon Millman
79edc12c76 Add Background component 2018-06-21 17:40:33 -07:00
Brandon Millman
bd03151c2a Various relayer grid ui polish items 2018-06-21 17:40:33 -07:00
Amir Bandeali
7c0fdc7ecf Merge pull request #740 from 0xProject/feature/contracts/updateEvents
Update events
2018-06-21 17:14:14 -07:00
Amir Bandeali
b333ed91de Add event to setSignatureValidatorApproval, rename signer => signerAddress accross all contracts 2018-06-21 16:10:12 -07:00
Amir Bandeali
6a073d5f86 Add senderAddress to Fill and Cancel logs, add comments to events and types 2018-06-21 16:09:38 -07:00
Alex Browne
c7159b2be4 Merge pull request #747 from 0xProject/fix/sol-cov-bugs
Fix some bugs in sol-cov
2018-06-21 13:50:30 -07:00
Amir Bandeali
2d98193c83 Merge pull request #744 from NoteGio/v2-prototype-unreachable
Remove unreachable PreSigned check
2018-06-21 13:38:23 -07:00
fragosti
685756f9d5 Fix Island component 2018-06-21 13:26:33 -07:00
fragosti
535bb364b6 Add missing image assets for Chris and Mel 2018-06-21 13:17:51 -07:00
Francesco Agosti
c740539f48 Merge pull request #739 from 0xProject/feature/website/mobile-friendly-onboarding
Add support for mobile-friendly onboarding flows
2018-06-21 13:16:13 -07:00
Alex Browne
4cf331067b Fix some bugs in sol-cov 2018-06-21 13:14:13 -07:00
Austin Roberts
a3ba7683f4 Remove unreachable PreSigned check
This code was unreachable, as it had the exact same condition as line 206.
2018-06-21 14:15:20 -05:00
fragosti
5edfec68cf Fix linting 2018-06-21 12:12:44 -07:00
fragosti
eb494f78fa Buttons look hella disabled now 2018-06-21 12:09:38 -07:00
fragosti
d963941be0 Remove border radius, fix width issue for unlock step 2018-06-21 11:33:47 -07:00
Francesco Agosti
8ab65fdde4 Merge pull request #742 from 0xProject/feature/website/chris-mel-about-page
Add Chris and Mel to about page
2018-06-21 11:32:10 -07:00
fragosti
8e2c0bb977 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/mobile-friendly-onboarding 2018-06-21 11:06:53 -07:00
fragosti
f1f1064f70 Add Chris and Mel to about page 2018-06-21 10:57:26 -07:00
Brandon Millman
88500e3714 Merge pull request #734 from 0xProject/feature/website/shadow-styling
Update Island shadow styling and use Island in more places
2018-06-21 10:31:48 -07:00
Leonid Logvinov
eae2a4df8b Merge pull request #702 from perissology/feature/missing-sources
[sol-cov] Only collect coverage for provided sources
2018-06-21 19:28:35 +02:00
perissology
ade8e95d2e fix linter issues 2018-06-21 09:12:30 -07:00
Fabio Berger
a0b225b8b1 Test revert reasons in proxy tests 2018-06-21 17:43:48 +02:00
Fabio Berger
323e8756ba remove only 2018-06-21 17:27:26 +02:00
Fabio Berger
ada5428df7 Check revert reasons in Authorizable tests 2018-06-21 17:23:59 +02:00
Fabio Berger
7869c19245 Change revert reason in ownable to be similar to all other revert reasons 2018-06-21 17:23:42 +02:00
Fabio Berger
5706b29c8c remove .only 2018-06-21 17:06:44 +02:00
Fabio Berger
8ff7b2405f Update yarn.lock 2018-06-21 16:53:14 +02:00
Fabio Berger
eaabe15863 Update core tests to actually check revert message 2018-06-21 16:53:05 +02:00
Fabio Berger
63b2ae743b Add command to remove all node_modules, nested and hoisted 2018-06-21 16:52:01 +02:00
perissology
c5ea985a70 only call getLocationByOffset if source if defined 2018-06-21 06:24:50 -07:00
Remco Bloemen
11b35b89f5 Merge pull request #692 from 0xProject/refactor/contracts/RemovedMixinSettlement
Removed MixinSettlement
2018-06-21 13:26:40 +02:00
Greg Hysen
6d5b16725d Set settleOrder and settleMatchedOrders to private 2018-06-20 17:27:45 -07:00
fragosti
c34897036e Prevent prettier issue 2018-06-20 16:05:19 -07:00
fragosti
1e51af1d4b Support mobile friendly onboarding flows 2018-06-20 15:51:17 -07:00
Greg Hysen
8ee6e26608 Removed MixinSettlement. Moved settleOrder into MixinExchangeCore and settleMatchedOrders into MixinMatchOrders 2018-06-20 15:36:28 -07:00
Brandon Millman
4d36f38f96 Merge pull request #733 from 0xProject/bug/website/identicon-layout
Move some layout logic out of the Identicon component
2018-06-20 15:25:51 -07:00
Greg Hysen
d31ca444e1 Merge pull request #736 from 0xProject/feature/contracts/MixinSignatureValidatorTests
MixinSignatureValidator Test Cases + Bug Fixes
2018-06-20 14:18:13 -07:00
Greg Hysen
090b3014c0 Migrations after rebasing 2018-06-20 14:00:21 -07:00
Greg Hysen
491a322ceb Linter 2018-06-20 13:54:39 -07:00
Greg Hysen
12e16d532b Renamed constants in test wallet/validator 2018-06-20 13:54:39 -07:00
Greg Hysen
7814a391d8 Few more minor #nit wording changes 2018-06-20 13:54:39 -07:00
Greg Hysen
322151b0d5 Changed wording of two tests #nit 2018-06-20 13:54:39 -07:00
Greg Hysen
4a136cafda Minor improvements to MixinSignatureValidator tests 2018-06-20 13:54:39 -07:00
Greg Hysen
d0df25d9e2 Remove .only 2018-06-20 13:54:39 -07:00
Greg Hysen
8d003dbc30 Fixed two mislabelled revert reasons + Signature Validator revert tests working on Geth 2018-06-20 13:54:39 -07:00
Greg Hysen
2c7358d64f Minor style tweaks 2018-06-20 13:54:39 -07:00
Greg Hysen
94e260cec6 Fixed how trezor messages are signed in signature_utils. Now uses byteLength instead of length. 2018-06-20 13:54:39 -07:00
Greg Hysen
783ac3c105 Fixed callAsync template. Previously did not append callData, so we couldn’t specify from address 2018-06-20 13:54:39 -07:00
Greg Hysen
d46e3f6778 Twenty new tests for MixinSignatureValidator. Fixed handling of unsupported types. Fixed trezor prefix. 2018-06-20 13:54:39 -07:00
Alex Browne
6fe3158778 Merge pull request #725 from 0xProject/feature/revert-trace-code-snippets
Include source code snippets in revert stack traces
2018-06-20 12:36:04 -07:00
Alex Browne
bbd12e33ec Update version for @types/solidity-parser-antlr 2018-06-20 12:22:39 -07:00
Alex Browne
e4d55242d8 Update to match latest type definitions and other small changes 2018-06-20 12:22:39 -07:00
Alex Browne
dedddcfcf5 Update sol-cov CHANGELOG.json 2018-06-20 12:22:39 -07:00
Alex Browne
613a78bcf6 Include source code snippets in revert stack traces 2018-06-20 12:19:30 -07:00
Alex Browne
f5decb1d7e Merge pull request #738 from 0xProject/fix/changelogs
Fix CHANGELOG entries changed during incorrect merge (2a4456b)
2018-06-20 12:19:04 -07:00
Fabio Berger
47b4c236c3 Fix CHANGELOG entries changed during incorrect merge (2a4456b) 2018-06-20 20:29:22 +02:00
fragosti
39ccb2df0b Scroll to wallet for mobile onboarding 2018-06-20 11:25:59 -07:00
Fabio Berger
5bfdffda11 Add support for approveAll in assetWrapper and fillOrderScenarios 2018-06-20 19:14:04 +02:00
Fabio Berger
247f8c8557 Fix orderValidationUtils where was confusing a makerAssetAmount as a takerAssetAmount 2018-06-20 19:13:30 +02:00
Fabio Berger
3ce449e167 Improve verbose logging 2018-06-20 19:12:31 +02:00
F. Eugene Aumson
663f9657ea ethereum-types now only has v0.0.2, no 0.0.1 2018-06-20 09:06:38 -04:00
F. Eugene Aumson
457f951aaf add missing metacoin dependencies 2018-06-20 09:06:38 -04:00
F. Eugene Aumson
feafd57027 make metacoin tsconfig independent 2018-06-20 09:06:32 -04:00
Fabio Berger
5c0183c71e Fix merge variable name issue 2018-06-20 14:08:56 +02:00
Fabio Berger
fb7d425244 Add support for setting allowance to unlimited 2018-06-20 13:56:27 +02:00
Fabio Berger
3fab40efe5 Add noop conditionals for clarity 2018-06-20 13:55:45 +02:00
Fabio Berger
0bbdbc9e63 Rename for clarity 2018-06-20 13:55:28 +02:00
Fabio Berger
9bc481ff62 Split balance and allowance amount types in prep of adding the "unlimited" allowance enum value 2018-06-20 13:36:57 +02:00
Fabio Berger
32dea43d2e Remove unneeded explicit type def 2018-06-20 13:31:57 +02:00
Fabio Berger
632da71a8d Add TS 2.7 numeric separators to improve readability 2018-06-20 13:31:21 +02:00
Fabio Berger
2ffab22185 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (22 commits)
  Fix closing parens in liborder
  Update after rebase
  ERC721Proxy Always call safeTransferFrom
  Rename makerEpoch => orderEpoch
  Make cancelOrdersUpTo compatible with sender abstraction
  Update PR template
  Use Image component instead of img tag
  Assembler orderHash function
  Optimize and remove redundant encodePacked
  Fix linting issue
  Fix bug where we do fetch balances on wallet login
  Check network state immediately instead of waiting for delay
  Fix onboarding persisting when changing routes
  Consolidate account state messaging logic
  Only elevate wallet zIndex when onboarding is in progress
  Rebase and update feedback
  Run linter
  Add Portal v2 logging
  Simplified handling of source < 32 edge case
  Basic EIP712 encoder
  ...
2018-06-20 13:25:29 +02:00
Fabio Berger
5541327968 Add ability for verbose logging 2018-06-20 13:24:09 +02:00
Jacob Evans
096eaa20d7 Merge pull request #637 from 0xProject/bug/contracts/eip712-191-prefix
Add missing EIP191 prefix for EIP712 and Execute Transaction
2018-06-20 10:54:51 +10:00
fragosti
e5fe6b915e Change Island to use styled-components 2018-06-19 17:32:01 -07:00
Jacob Evans
512bd84cc2 Fix closing parens in liborder 2018-06-20 10:27:45 +10:00
Jacob Evans
ebbcbeedd2 Merge pull request #730 from 0xProject/bug/contracts/eip712-191-prefix-asm-orderhash
Assembler orderHash function
2018-06-20 10:25:31 +10:00
Jacob Evans
be17308e50 Merge pull request #717 from 0xProject/feature/contracts/erc721proxy-always-safeTransferFrom
ERC721Proxy Always call safeTransferFrom
2018-06-20 10:24:12 +10:00
Jacob Evans
25fa29e6e1 Update after rebase 2018-06-20 10:01:41 +10:00
Jacob Evans
bddc47f9b2 ERC721Proxy Always call safeTransferFrom 2018-06-20 10:00:59 +10:00
fragosti
51948d7760 Show start onboarding flow button on top of wallet on mobile 2018-06-19 16:39:52 -07:00
Brandon Millman
5817a30031 Update Island shadow styling and use Island in more places 2018-06-19 16:25:43 -07:00
Amir Bandeali
e216eb1e7b Merge pull request #714 from 0xProject/feature/contracts/cancelOrdersUpToSender
Make cancelOrdersUpTo compatible with sender abstraction
2018-06-19 15:23:28 -07:00
Brandon Millman
549c6afa0a Move some layout logic out of the Identicon component 2018-06-19 13:55:29 -07:00
Amir Bandeali
6b08e6b809 Rename makerEpoch => orderEpoch 2018-06-19 13:52:23 -07:00
Francesco Agosti
0438fdde49 Merge pull request #724 from 0xProject/bug/website/onboarding-improvements
Fix Wallet appearing over Drawer, and Onboarding not exiting when changing routes
2018-06-19 13:47:52 -07:00
Francesco Agosti
be4ea18119 Merge pull request #727 from 0xProject/bug/website/fix-fetching-balances-on-wallet-login
Fix bug where we do not fetch balances on wallet login
2018-06-19 13:43:08 -07:00
fragosti
a75d6531f2 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into bug/website/onboarding-improvements 2018-06-19 13:29:54 -07:00
Brandon Millman
da69ddc19b Merge pull request #732 from 0xProject/feature/update-pr-template
Update PR template
2018-06-19 13:16:42 -07:00
Amir Bandeali
e92926e881 Make cancelOrdersUpTo compatible with sender abstraction 2018-06-19 13:04:55 -07:00
Brandon Millman
7dd208fb49 Merge pull request #723 from 0xProject/bug/website/drawer-address
Consolidate account state display message logic
2018-06-19 10:44:18 -07:00
Brandon Millman
5305db689d Update PR template 2018-06-19 10:41:27 -07:00
Francesco Agosti
2338c7a3b3 Merge pull request #706 from 0xProject/feature/website/portal-v2-analytics
Add logging to Portal V2
2018-06-19 10:32:35 -07:00
Brandon Millman
829bc96209 Use Image component instead of img tag 2018-06-19 10:30:28 -07:00
fragosti
7454e16aae Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/portal-v2-analytics 2018-06-19 10:19:38 -07:00
Brandon Millman
e4acad60e9 Merge pull request #726 from 0xProject/bug/website/late-eth-balance
Check network state immediately instead of waiting for delay
2018-06-19 10:03:08 -07:00
Fabio Berger
f35af1fb6d Fix typo 2018-06-19 17:53:16 +02:00
Fabio Berger
c0e008c601 Rename NewOrderFactory to OrderFactoryFromScenario for clarity 2018-06-19 17:41:10 +02:00
Fabio Berger
9acf4458c0 Remove hack in ERC20Wrapper 2018-06-19 17:38:15 +02:00
Fabio Berger
70de264d4d Cleanup coreCombinatorialUtils 2018-06-19 17:31:26 +02:00
Fabio Berger
1a0b9e4612 Comments and cleanup 2018-06-19 17:25:08 +02:00
Remco Bloemen
66dc70c057 Merge pull request #683 from 0xProject/fix/contracts/memcpy
Simplified handling of source < 32 edge case
2018-06-19 13:53:25 +02:00
Fabio Berger
6641f34d76 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
  Prettier fix
  Update default params in sendRawPaylodAsync for improved JSON-RPC compatibility
  Fix missed merge conflicts
  Fix additional versions and update yarn.lock
  Add OrderWatcherConfig type to 0x.js docs page
  Export OrderWatcherConfig from 0x.js
  Update all package versions to match latest published to NPM
  Update CHANGELOG's with publishes performed on development branch
  Rebase with latest removing PROXY_ID from transfer
  Split transfer impl and AssetProxyMixin
  change @0xproject/types to ethereum-types
  remove mistaken comment
  workaround for TypeScript trailing comma bug
  Document contract_templates
2018-06-19 13:48:58 +02:00
Fabio Berger
f3ae5d8160 Prettier fix 2018-06-19 13:46:39 +02:00
Fabio Berger
d937541aa0 Merge pull request #701 from feuGeneA/v2-prototype
Document use of contract_templates (take 2; based on v2-prototype, not master)
2018-06-19 13:44:55 +02:00
Fabio Berger
21707d7ff6 Merge pull request #728 from 0xProject/fix/post-dev-publish
Update v2-prototype w/ development changes since publish
2018-06-19 13:18:36 +02:00
Leonid Logvinov
3002bc0eee Merge pull request #731 from avonian/v2-prototype
Fix sendRawPaylodAsync for improved JSON-RPC compatibility
2018-06-19 13:17:20 +02:00
Ara Kevonian
df50232ed9 Update default params in sendRawPaylodAsync for improved JSON-RPC compatibility 2018-06-19 04:13:32 -07:00
Fabio Berger
17d49067e9 Fix missed merge conflicts 2018-06-19 12:56:22 +02:00
Remco Bloemen
9a2e023a51 Assembler orderHash function 2018-06-19 12:55:04 +02:00
Jacob Evans
9c747f3160 Merge pull request #659 from 0xProject/feature/contracts/split-proxy-internal-logic
Split transfer implementation and AssetProxyMixin
2018-06-19 20:41:06 +10:00
Fabio Berger
08ea71cb24 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (40 commits)
  Increase number of columns in relayer grid for small screens
  Make isValidSignature public
  Make batchFill methods return FIllResults struct
  Remove remove_tags script
  Small fixes
  Use semver package instead of getNextPatchVersion
  Use semver library instead of semverUtils
  small fixes
  Show all errors of a given kind at once rather then throwing after the first instance is encountered
  fix package.json
  Add more prepublish checks
  remove remove_tags script
  Create a shared Image component
  Adjust version in changelog
  Update RelayerGridTile render logic to incorportate colors and logos
  Add max width to top bar
  Set max-width for LargeLayout
  Finish last onboarding step
  Finish set allowance step
  Add onboarding assets
  ...
2018-06-19 12:35:32 +02:00
Fabio Berger
a96abe2422 Fix additional versions and update yarn.lock 2018-06-19 12:32:43 +02:00
Fabio Berger
84a4a888e6 Add OrderWatcherConfig type to 0x.js docs page 2018-06-19 11:34:44 +02:00
Fabio Berger
e3299b546e Export OrderWatcherConfig from 0x.js 2018-06-19 11:33:46 +02:00
Fabio Berger
f2e0f1b2f1 Update all package versions to match latest published to NPM 2018-06-19 11:32:55 +02:00
Fabio Berger
2a4456b9ca Update CHANGELOG's with publishes performed on development branch 2018-06-19 11:16:30 +02:00
Jacob Evans
560a55bfd1 Optimize and remove redundant encodePacked 2018-06-19 17:32:17 +10:00
fragosti
d32f0fad12 Fix linting issue 2018-06-18 18:56:31 -07:00
fragosti
031e7d270d Fix bug where we do fetch balances on wallet login 2018-06-18 18:08:38 -07:00
Brandon Millman
3b73a0e269 Check network state immediately instead of waiting for delay 2018-06-18 18:01:38 -07:00
Brandon Millman
0bfcf79e79 Increase number of columns in relayer grid for small screens 2018-06-18 17:44:09 -07:00
fragosti
bdd299dd9e Fix onboarding persisting when changing routes 2018-06-18 17:24:31 -07:00
Brandon Millman
f97e605bf6 Consolidate account state messaging logic 2018-06-18 17:08:44 -07:00
fragosti
db9ff76754 Only elevate wallet zIndex when onboarding is in progress 2018-06-18 16:57:28 -07:00
Amir Bandeali
49f5495c45 Merge pull request #716 from 0xProject/feature/contracts/publicSignatureValidator
Make isValidSignature public
2018-06-18 16:20:16 -07:00
Amir Bandeali
9e431df848 Make isValidSignature public 2018-06-18 16:00:55 -07:00
Amir Bandeali
12476c52a4 Merge pull request #713 from 0xProject/feature/contracts/batchFillReturn
Make batchFill methods return FIllResults struct
2018-06-18 16:00:43 -07:00
Amir Bandeali
8fd9aebcb9 Make batchFill methods return FIllResults struct 2018-06-18 15:50:02 -07:00
Fabio Berger
8c83f4ba3b Merge pull request #722 from 0xProject/improvement/publishing-v2
Improvements to pre-publishing checks
2018-06-18 23:33:17 +02:00
Fabio Berger
25b6d1a232 Remove remove_tags script 2018-06-18 23:20:07 +02:00
Fabio Berger
880cbd88c2 Small fixes 2018-06-18 23:15:52 +02:00
Fabio Berger
dcd53c3c5b Use semver package instead of getNextPatchVersion 2018-06-18 23:08:44 +02:00
Fabio Berger
3e64b3da39 Use semver library instead of semverUtils 2018-06-18 23:08:33 +02:00
Fabio Berger
9a748c8bf1 small fixes 2018-06-18 23:07:03 +02:00
Fabio Berger
53eae14763 Show all errors of a given kind at once rather then throwing after the first instance is encountered 2018-06-18 23:06:55 +02:00
Fabio Berger
074c42e8b6 fix package.json 2018-06-18 23:06:48 +02:00
Fabio Berger
8633fa7024 Add more prepublish checks 2018-06-18 23:06:32 +02:00
Fabio Berger
19668b9b48 remove remove_tags script 2018-06-18 23:05:03 +02:00
Brandon Millman
3f02631b98 Merge pull request #712 from 0xProject/feature/website/portal-facelift
Change relayer grid tile to use logos and primary colors
2018-06-18 12:11:59 -07:00
Brandon Millman
da46eefe2e Create a shared Image component 2018-06-18 12:09:31 -07:00
Francesco Agosti
a3ca3ed33f Merge pull request #704 from 0xProject/bug/website/fix-filling-order
Fix filling orders on Portal
2018-06-18 10:24:42 -07:00
Francesco Agosti
efaa33c4d5 Merge pull request #711 from 0xProject/website/feature/prettier-onboarding-components
Made onboarding look like the mocks
2018-06-18 10:13:19 -07:00
fragosti
0cdfe7f458 Adjust version in changelog 2018-06-18 10:06:38 -07:00
Jacob Evans
190eafc30e Merge branch 'v2-prototype' into bug/contracts/eip712-191-prefix 2018-06-18 21:50:35 +10:00
Jacob Evans
d4ee0e8622 Rebase and update feedback
Cache the domain separator data with address this
Use the EIP712Types enum for types everywhere
Rename EIP712 struct ExecuteTransaction to ZeroExTransaction
2018-06-18 21:46:05 +10:00
Jacob Evans
96c90e6295 Rebase with latest removing PROXY_ID from transfer 2018-06-18 16:36:30 +10:00
Jacob Evans
ff95da411b Split transfer impl and AssetProxyMixin 2018-06-18 15:24:12 +10:00
Brandon Millman
2ad411ea29 Update RelayerGridTile render logic to incorportate colors and logos 2018-06-16 13:34:09 -07:00
Brandon Millman
55cbcd728d Add max width to top bar 2018-06-16 13:34:09 -07:00
Brandon Millman
8880860105 Set max-width for LargeLayout 2018-06-16 13:34:09 -07:00
Remco Bloemen
0c238448fd Merge pull request #700 from 0xProject/fix/contracts/tokenbugs
Handle tokens that do not return bool
2018-06-16 10:10:17 +02:00
fragosti
8a76fdc126 Finish last onboarding step 2018-06-15 18:34:57 -07:00
fragosti
433f830cf3 Finish set allowance step 2018-06-15 18:15:03 -07:00
fragosti
8893bc102c Add onboarding assets 2018-06-15 18:03:10 -07:00
fragosti
0cf9927132 Add all steps to their own file 2018-06-15 18:02:46 -07:00
fragosti
5993125cc7 Prettify account setup and add eth steps of onboarding 2018-06-15 15:17:20 -07:00
fragosti
0c34309133 Make metamask part of the fow pretty 2018-06-15 14:49:01 -07:00
fragosti
3d6ce0fb76 Make start onboarding button pretty 2018-06-15 14:06:17 -07:00
fragosti
54f79c2798 Improve styles of onboarding tooltip 2018-06-15 13:24:59 -07:00
F. Eugene Aumson
8bac1706a1 change @0xproject/types to ethereum-types 2018-06-15 10:37:37 -04:00
fragosti
d0a3779091 Add Pointer component 2018-06-14 18:19:07 -07:00
Alex Browne
ff0960b174 Merge pull request #705 from 0xProject/feature/revert-trace-subprovider
Introduce subprovider for printing revert stack traces
2018-06-14 17:07:03 -07:00
Alex Browne
7032825e35 Change wording of error message when you try to use more than one subprovider 2018-06-14 16:53:48 -07:00
Alex Browne
d118533d87 Remove redundant check in trace.ts and revert_trace.ts 2018-06-14 16:53:29 -07:00
fragosti
35f4f75733 Prettier 2018-06-14 16:49:06 -07:00
Alex Browne
ef61c3543f Fix linter errors 2018-06-14 16:38:21 -07:00
Alex Browne
897560745a De-duplicate code by refactoring subprovider classes 2018-06-14 16:33:09 -07:00
Alex Browne
5a8539a122 Fix linter errors and remove coverage.json 2018-06-14 16:04:08 -07:00
Alex Browne
d9292a70bf Remove unused variables and other small fixes 2018-06-14 16:00:24 -07:00
Alex Browne
a9c23b7c28 Reverse order of stack trace to match behavior of most other language stack traces 2018-06-14 15:50:54 -07:00
fragosti
2cc7289b7b Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/portal-v2-analytics 2018-06-14 15:50:46 -07:00
fragosti
81d6df925e Run linter 2018-06-14 15:47:59 -07:00
Alex Browne
263bfb1bda Fix a bug in revert_trace.ts 2018-06-14 15:46:59 -07:00
fragosti
677e77d0ae Add Portal v2 logging 2018-06-14 15:43:10 -07:00
Fabio Berger
0d0c1af7f7 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
  Run prettify
  Implement allowance and final flow step
  Render TokenAllowance
  Add utilities for getting tokens from tokensByAddress
  Wrap AllowanceToggle in redux container
2018-06-15 00:03:47 +02:00
Fabio Berger
fb55def54f Add ability to tweak the relevant balances/allowances for the maker and taker for a fillScenario. Convert more of the core tests to the declarative form. 2018-06-15 00:03:00 +02:00
Fabio Berger
eea86757d5 - Refactor assetWrapper to contain more of the normalizing logic instead of erc20Wrapper and erc721Wrapper
- Add burn method to DummyERC721Token
- Add additional methods to assetWrapper to set balance/allowances on ERC20 and ERC721 tokens
- Use approve instead of approveAll for ERC721 tokens
2018-06-15 00:00:02 +02:00
Francesco Agosti
e7eb220c50 Merge pull request #695 from 0xProject/feature/website/onboarding-flow-allowances
Implement allowances and final "congrats" onboarding flow step
2018-06-14 14:41:42 -07:00
fragosti
7d67005820 Run prettify 2018-06-14 14:26:17 -07:00
fragosti
fadd91b6a2 Add to changelog for contract-wrappers 2018-06-14 14:22:53 -07:00
fragosti
5fa6a2848f Fix typo 2018-06-14 14:07:41 -07:00
Alex Browne
7ab921669b Introduce subprovider for printing revert stack traces 2018-06-14 13:58:54 -07:00
fragosti
4811dfa663 Fix filling orders on Portal 2018-06-14 13:56:36 -07:00
perissology
7a41a5249f Collect coverage for provided sources
When solidity generates source maps during contract compilation, the
contracts are referred to by an id, which corresponds to an array index.

We may not want to cover all sources that were included in a compilation,
but because we use array indexes (vs. the id that is provided by solidity
compiler) to map the contract to the sourceMap, the provided sourceCodes
array must include the code at the correct index. This can result in
empty slots in the sourceCodes array.

This commit allows the coverage to only be collected for the contracts
with provided sourceCode.
2018-06-14 11:17:04 -07:00
F. Eugene Aumson
f9e05d0cad remove mistaken comment
It must have been left over from when an abi-gen output was modified to
be the source of this template.
2018-06-14 13:52:10 -04:00
F. Eugene Aumson
15a63c4bc5 workaround for TypeScript trailing comma bug
before this change, TypeScript compilation of the generated contract
wrapper was giving me the following errors:

$ abi-gen --abis 'build/contracts/*.json' --out build/types --template contract_templates/contract.handlebars --partials 'contract_templates/partials/*.handlebars'
Found 7 partial templates
Found 1 ABI files
Processing: Migrations...
Created: build/types/migrations.ts
$ tsc
build/types/migrations.ts(81,23): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(108,23): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(130,23): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(146,25): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(173,25): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
build/types/migrations.ts(195,25): error TS1013: A rest parameter or binding pattern may not have a trailing comma.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here is the generated code around the first error:

74:    public setCompleted = {
75:        async sendTransactionAsync(
76:            completed: BigNumber,
77:            txData: Partial<TxData> = {},
78:        ): Promise<string> {
79:            const self = this as any as MigrationsContract;
80:            const inputAbi = self._lookupAbi('setCompleted(uint256)').inputs;
81:            [completed,
82:    ] = BaseContract._formatABIDataItemList(inputAbi, [completed,
83:    ], BaseContract._bigNumberToString.bind(self));

All of the other errors are the same, a destructuring assignment with a
single element but with a trailing comma.

This is legal JavaScript but it is not allowed by the TypeScript
compiler, apparently per the bug described at
https://github.com/Microsoft/TypeScript/issues/24628 .

While awaiting the 3.0 version of TypeScript, it's a simple enough
change to have the template not append a trailing comma.
2018-06-14 13:51:18 -04:00
F. Eugene Aumson
4a2e4d2b55 Document contract_templates 2018-06-14 13:51:10 -04:00
Fabio Berger
12033abe09 Rename OrderAmountScenario to OrderAssetAmountScenario and convert generateOrderCombinations to generateFillOrderCombinations 2018-06-14 12:07:57 +02:00
Fabio Berger
f9410d5d00 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (27 commits)
  Add back redirector behind feature flag
  Update minHeight in Text
  Use Text components in Values
  Use spread operator instead of React.createElement
  Fix issue with positions hash
  Revert localhost config
  Use Text in Teams
  Use Text in OpenPositions
  Use Text component for HeaderItem
  Remove FloatingImage
  Move FilledImage into components/ui
  Replace FlatButton with Button in Retry
  Fix incorrect colors
  Add font family to Button component and use in Join0x component
  Consolidate jobs page grey colors with shared colors
  Fix lint errors
  Remove extra packages
  Implement small open positions
  Implement large screen open positions
  Teams section
  ...
2018-06-14 11:17:58 +02:00
Fabio Berger
c232a32991 Use a defaultFillScenario in fillOrder tests 2018-06-14 11:17:13 +02:00
Fabio Berger
57f37939d5 Fix incorrect string values in enum 2018-06-14 11:16:51 +02:00
Fabio Berger
432ff58107 Fix calculation of expFilledTakerAmount and expected values in events emitted 2018-06-14 11:16:32 +02:00
Remco Bloemen
2c7d6a7711 Handle tokens that do not return bool 2018-06-14 10:54:54 +02:00
Fabio Berger
d31b051fc5 Replace initial set of legacy manually written fillOrder tests with declarative FillScenario tests 2018-06-14 10:41:04 +02:00
Fabio Berger
98405a39db Add ability to specify takerAssetFillAmount and taker scenarios as part of a FillScenario 2018-06-14 10:40:17 +02:00
Brandon Millman
0e354e5ea1 Merge pull request #685 from 0xProject/feature/website/jobs-page
Jobs page
2018-06-13 13:34:54 -07:00
Brandon Millman
d172a97247 Add back redirector behind feature flag 2018-06-13 12:29:36 -07:00
Brandon Millman
8a3df7e434 Update minHeight in Text 2018-06-13 12:19:14 -07:00
Brandon Millman
eafcbabaa2 Use Text components in Values 2018-06-13 12:10:21 -07:00
Brandon Millman
14071ea119 Use spread operator instead of React.createElement 2018-06-13 12:01:08 -07:00
Fabio Berger
6239686afa Fix divide by zero bug 2018-06-13 18:36:30 +02:00
Fabio Berger
45186b70ec Move orderFill combinatorialTests to exchange folder 2018-06-13 16:14:48 +02:00
Fabio Berger
b4fead9606 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (26 commits)
  Rename _coverageCollector -> _profilerCollector in TraceCollectionSubprovider
  Refactor sol-cov to de-duplicate code for coverage and profiling
  Rename popByte and popAddress
  Hard code test addresses/bytes32 instead of generating pseudorandom ones
  Update artifacts
  Rename computeCoverageAsync -> computeSingleTraceCoverageAsync
  Fix linter errors
  Refactor sol-cov to avoid keeping traceInfo in memory
  Unpop byte rather than making deep copy
  Pass gas in to marketBuyOrdersNoThrow
  Looks up the memory location of makerAssetData/takerAssetData
  Make ZRX_PROXY_ID constant rather than popping it from ZRX_ASSET_DATA
  Add tests for deepCopyBytes and missing write methods from LibBytes
  Pop id from assetData before dispatching to AssetProxies
  Upgrade solidity-parser-entlr 0.2.11 => 0.2.12
  Fix import order
  Fix typos
  Add CHANGELOGs
  Speed-up sol-cov
  Increase delay when sending transactions during devnet startup
  ...
2018-06-13 16:10:05 +02:00
Fabio Berger
61243b418e Implement initial set of orderFill combinatorial tests 2018-06-13 16:09:04 +02:00
Fabio Berger
fe75660e88 Refactor ERC20 and ERC721 wrappers for V2 and introduce the assetWrapper superset 2018-06-13 16:01:01 +02:00
Fabio Berger
946e6c1644 Remaining refactors of order-utils components for V2 2018-06-13 13:20:13 +02:00
Fabio Berger
3eb232b3fc For some reason order-watcher tests were timeing out so I increased the timeout limit 2018-06-13 13:18:19 +02:00
Fabio Berger
38de1c9a31 Remove comment since we have added the tests 2018-06-13 13:16:22 +02:00
Fabio Berger
78dcb87a75 Variable rename for clarity 2018-06-13 13:11:45 +02:00
fragosti
421e568232 Implement allowance and final flow step 2018-06-12 16:54:37 -07:00
Alex Browne
4efd28c092 Merge pull request #694 from 0xProject/refactor-sol-cov
Refactor sol-cov to de-duplicate code for coverage and profiling
2018-06-12 16:51:58 -07:00
Brandon Millman
d0bbee7e8c Fix issue with positions hash 2018-06-12 16:11:31 -07:00
Brandon Millman
7640563991 Revert localhost config 2018-06-12 16:09:23 -07:00
Amir Bandeali
90cf85c3f0 Merge pull request #682 from 0xProject/feature/contracts/popProxyId
Remove proxyId checks in AssetProxies
2018-06-12 16:05:46 -07:00
Brandon Millman
f1a98693d0 Use Text in Teams 2018-06-12 15:58:24 -07:00
Brandon Millman
2794d64d3e Use Text in OpenPositions 2018-06-12 15:54:27 -07:00
Alex Browne
82743cca92 Rename _coverageCollector -> _profilerCollector in TraceCollectionSubprovider 2018-06-12 15:46:41 -07:00
Alex Browne
d0c348e595 Refactor sol-cov to de-duplicate code for coverage and profiling 2018-06-12 15:40:18 -07:00
Alex Browne
f50d3088dc Merge pull request #691 from 0xProject/fix/sol-cov-memory
Refactor sol-cov to avoid keeping traceInfo in memory
2018-06-12 15:38:28 -07:00
Amir Bandeali
0917fa0d75 Rename popByte and popAddress 2018-06-12 15:30:46 -07:00
Amir Bandeali
cfb73dd534 Hard code test addresses/bytes32 instead of generating pseudorandom ones 2018-06-12 15:30:46 -07:00
Amir Bandeali
ef497b7989 Update artifacts 2018-06-12 15:30:41 -07:00
Brandon Millman
9d9341901f Use Text component for HeaderItem 2018-06-12 15:25:47 -07:00
Brandon Millman
155e3d225d Remove FloatingImage 2018-06-12 15:03:16 -07:00
Brandon Millman
ca41f100ab Move FilledImage into components/ui 2018-06-12 14:49:42 -07:00
Brandon Millman
084285a760 Replace FlatButton with Button in Retry 2018-06-12 14:26:48 -07:00
Brandon Millman
982391cd7c Fix incorrect colors 2018-06-12 14:23:47 -07:00
Brandon Millman
d206d0a3ae Add font family to Button component and use in Join0x component 2018-06-12 14:23:03 -07:00
Alex Browne
627ea6c860 Rename computeCoverageAsync -> computeSingleTraceCoverageAsync 2018-06-12 14:11:11 -07:00
Alex Browne
bcc76b3764 Fix linter errors 2018-06-12 14:09:42 -07:00
fragosti
39692a8b3f Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/onboarding-flow-allowances 2018-06-12 14:01:19 -07:00
Brandon Millman
eba8b4bf00 Consolidate jobs page grey colors with shared colors 2018-06-12 13:45:56 -07:00
Brandon Millman
f149665660 Fix lint errors 2018-06-12 13:40:15 -07:00
Brandon Millman
e3bb64cf35 Remove extra packages 2018-06-12 12:52:36 -07:00
Alex Browne
33f0669100 Refactor sol-cov to avoid keeping traceInfo in memory 2018-06-12 12:42:14 -07:00
Amir Bandeali
3a5f3e8b55 Unpop byte rather than making deep copy 2018-06-12 11:45:02 -07:00
Amir Bandeali
a0a90afbc0 Pass gas in to marketBuyOrdersNoThrow 2018-06-12 11:45:02 -07:00
Greg Hysen
2f96cb257c Looks up the memory location of makerAssetData/takerAssetData 2018-06-12 11:45:02 -07:00
Amir Bandeali
5910bec52e Make ZRX_PROXY_ID constant rather than popping it from ZRX_ASSET_DATA 2018-06-12 11:45:02 -07:00
Amir Bandeali
764b1c35cb Add tests for deepCopyBytes and missing write methods from LibBytes 2018-06-12 11:45:02 -07:00
Amir Bandeali
ee8c9b764d Pop id from assetData before dispatching to AssetProxies 2018-06-12 11:45:02 -07:00
Brandon Millman
7080f0c35a Implement small open positions 2018-06-12 10:44:03 -07:00
Brandon Millman
679d60cd5a Implement large screen open positions 2018-06-12 10:41:09 -07:00
Brandon Millman
bc36c0faed Teams section 2018-06-12 10:41:09 -07:00
Brandon Millman
3c073bc360 Benefits section 2018-06-12 10:41:08 -07:00
Brandon Millman
c52d5e1084 Refactor into BulletedItemList component 2018-06-12 10:41:08 -07:00
Brandon Millman
b7bb27fa21 Rework values section 2018-06-12 10:41:08 -07:00
Brandon Millman
087aaa2f94 Polish mission section and photo section 2018-06-12 10:41:08 -07:00
Brandon Millman
474b93a22f Add link to open positions section 2018-06-12 10:41:08 -07:00
Brandon Millman
0c2f002a7d Add scroll to top for jobs page 2018-06-12 10:41:08 -07:00
Brandon Millman
3d76d83a39 Skeleton for jobs page and initial implementation 2018-06-12 10:41:05 -07:00
Leonid Logvinov
787015f537 Upgrade solidity-parser-entlr 0.2.11 => 0.2.12 2018-06-12 10:22:15 -07:00
Leonid Logvinov
fb624fddc4 Fix import order 2018-06-11 22:30:14 -07:00
Leonid Logvinov
605ddacb71 Merge pull request #689 from 0xProject/geth-increase-startup-tx-delay
Increase delay when sending transactions during devnet startup
2018-06-11 22:15:51 -07:00
Leonid Logvinov
71934f05a8 Merge pull request #687 from 0xProject/feature/metacoin-docs
Add profiler and geth tests to metacoin
2018-06-11 22:03:22 -07:00
Leonid Logvinov
534a0d6836 Fix typos 2018-06-11 22:03:07 -07:00
Leonid Logvinov
746b1d0c4d Merge pull request #688 from 0xProject/feature/await-transaction-speedup
Speedup awaitTransactionMinedAsync and reduce polling interval in contracts tests
2018-06-11 21:56:56 -07:00
Leonid Logvinov
387c80e00a Merge pull request #690 from 0xProject/feature/truffle-sol-cov-fixes
Sol-cov fixes
2018-06-11 21:55:38 -07:00
Leonid Logvinov
05c914691f Add CHANGELOGs 2018-06-11 18:12:32 -07:00
Leonid Logvinov
94398d70f4 Speed-up sol-cov 2018-06-11 18:01:33 -07:00
Alex Browne
915ddb2b2b Increase delay when sending transactions during devnet startup 2018-06-11 17:26:10 -07:00
Alex Browne
b916e7f7ef Add note to web3-wrapper CHANGELOG.json 2018-06-11 17:13:58 -07:00
Alex Browne
3cc30f91a9 Speedup awaitTransactionMinedAsync and reduce polling interval in contracts tests 2018-06-11 17:07:28 -07:00
Leonid Logvinov
f4a61b4c70 Don't throw when no config file is found 2018-06-11 16:10:56 -07:00
Leonid Logvinov
6eebd693ce Fix solidityVersion schema regex 2018-06-11 16:10:15 -07:00
Fabio Berger
7e78f5941a Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (68 commits)
  Stop exporting ArtifactWriter
  Fix no-unused-variable tslint rule to include parameters and fix issues
  Fix linter exclude rule
  Validate all signature types rather then only ECSignatures
  Store the instantiated OrderValidationUtils
  Remove global hooks from tests and deploy contracts from within the specific tests
  Add EmitStatement to ASTVisitor
  Fix tslint issues
  Add back artifacts file
  Fix a bug in SolCompilerArtifacts adapter config overriding
  Move OrderValidationUtils (+ tests) and ExchangeTransferSimulator to order-utils
  export parseECSignature method
  Export ArtifactWriter from migrations package
  Remove unused artifact file
  Pass in generated contract wrapper to orderValidationUtils at instantiation
  Refactor orderValidationUtils to use the generated contract wrapper instead of the higher-level one
  Refactor ExchangeTransferSimulator public interface to accet an AbstractBalanceAndProxyAllowanceLazyStore so that this module could be re-used in different contexts.
  Increase timeout for contract migrations
  Remove some copy-paste code
  Await transactions in migrations
  ...
2018-06-12 00:23:48 +02:00
Fabio Berger
bc0ae6be31 Merge pull request #684 from 0xProject/fix/contract-wrappers/exchangeTransferSimulator
Move ExchangeTransferSimulator & OrderValidationUtils to Order-Utils
2018-06-12 00:14:19 +02:00
Fabio Berger
c03119d10a Stop exporting ArtifactWriter 2018-06-12 00:13:57 +02:00
Fabio Berger
e1879ef4d9 Fix no-unused-variable tslint rule to include parameters and fix issues 2018-06-11 23:42:30 +02:00
Fabio Berger
b6df727efb Fix linter exclude rule 2018-06-11 23:15:03 +02:00
Fabio Berger
fe58b44916 Validate all signature types rather then only ECSignatures 2018-06-11 22:14:03 +02:00
Fabio Berger
0a2694811d Store the instantiated OrderValidationUtils 2018-06-11 22:13:36 +02:00
Fabio Berger
31fe232bac Remove global hooks from tests and deploy contracts from within the specific tests 2018-06-11 22:13:12 +02:00
Leonid Logvinov
682f6d273c Fix linter issues 2018-06-11 12:49:46 -07:00
Leonid Logvinov
83ddaccf4a Add profiler and geth tests to metacoin 2018-06-11 11:59:48 -07:00
Leonid Logvinov
e0c0584c59 Add EmitStatement to ASTVisitor 2018-06-11 11:14:49 -07:00
Fabio Berger
60f5a52964 Merge branch 'v2-prototype' into fix/contract-wrappers/exchangeTransferSimulator
* v2-prototype:
  Fix a bug in SolCompilerArtifacts adapter config overriding
  Increase timeout for contract migrations
  Remove some copy-paste code
  Await transactions in migrations
  Fix typos
  Await transactions in migrations
  Await fake transactions
  Fix a typo
  Implement SolidityProfiler & adapt sol-cov to work with Geth

# Conflicts:
#	packages/migrations/CHANGELOG.json
2018-06-11 19:54:59 +02:00
Leonid Logvinov
7e5866ce3f Merge pull request #675 from 0xProject/feature/sol-cov-geth
`ProfilerSubprovider` & Geth-related fixes for `sol-cov`
2018-06-11 10:48:18 -07:00
Fabio Berger
89b7b56a2c Fix tslint issues 2018-06-11 19:43:40 +02:00
Fabio Berger
ae54b13d4b Add back artifacts file 2018-06-11 19:43:25 +02:00
Leonid Logvinov
927ccc489c Fix a bug in SolCompilerArtifacts adapter config overriding 2018-06-11 10:28:30 -07:00
Fabio Berger
21f7722f10 Move OrderValidationUtils (+ tests) and ExchangeTransferSimulator to order-utils 2018-06-11 19:21:32 +02:00
Fabio Berger
e4afe603f9 export parseECSignature method 2018-06-11 19:15:41 +02:00
Fabio Berger
30d15a1438 Export ArtifactWriter from migrations package 2018-06-11 19:12:55 +02:00
Fabio Berger
c84586dd66 Remove unused artifact file 2018-06-11 19:12:35 +02:00
Fabio Berger
e9f87c2026 Pass in generated contract wrapper to orderValidationUtils at instantiation 2018-06-11 14:44:53 +02:00
Fabio Berger
afa27a3c2a Refactor orderValidationUtils to use the generated contract wrapper instead of the higher-level one 2018-06-11 14:34:00 +02:00
Fabio Berger
ce6078ed94 Refactor ExchangeTransferSimulator public interface to accet an AbstractBalanceAndProxyAllowanceLazyStore so that this module could be re-used in different contexts. 2018-06-11 10:24:55 +02:00
Remco Bloemen
82d1412d45 Simplified handling of source < 32 edge case 2018-06-11 09:19:52 +02:00
Leonid Logvinov
6d5949ba9c Increase timeout for contract migrations 2018-06-08 15:27:59 -07:00
Leonid Logvinov
cdb165af7f Remove some copy-paste code 2018-06-08 14:56:46 -07:00
Leonid Logvinov
88a3f8e4aa Await transactions in migrations 2018-06-08 14:56:46 -07:00
Leonid Logvinov
1c3dc757c3 Fix typos 2018-06-08 14:56:45 -07:00
Leonid Logvinov
25866095db Await transactions in migrations 2018-06-08 14:56:45 -07:00
Leonid Logvinov
b6c8d8e971 Await fake transactions 2018-06-08 14:56:45 -07:00
Leonid Logvinov
ab94b0b231 Fix a typo 2018-06-08 14:56:45 -07:00
Leonid Logvinov
760bab8f86 Implement SolidityProfiler & adapt sol-cov to work with Geth 2018-06-08 14:56:45 -07:00
Greg Hysen
817c332d11 Merge pull request #627 from 0xProject/feature/contracts/erc721SafeTransferFrom
On-Chain AssetData Decoding Lib + safeTransferFrom for ERC721 + Memcpy
2018-06-08 11:58:23 -07:00
Greg Hysen
05fbc8e6b0 Linter changes to contracts 2018-06-08 11:43:47 -07:00
Greg Hysen
c39301b6da Fixed assetProxyUtils for linter 2018-06-08 11:04:07 -07:00
Alex Browne
add9a9db9b Merge pull request #674 from 0xProject/feature/geth-test-ci
Run contracts tests against Geth in CI
2018-06-08 10:53:22 -07:00
Greg Hysen
05123ea6f4 Updated LibBytes error messages 2018-06-07 16:32:42 -07:00
Jacob Evans
a8d328bfc9 Basic EIP712 encoder 2018-06-07 16:09:30 -07:00
Greg Hysen
d62ff34a5a Cleanup after last rebase 2018-06-07 15:53:30 -07:00
Alex Browne
a8b8d53d9d Run contracts tests against Geth in CI 2018-06-07 15:47:43 -07:00
Greg Hysen
0d4ff5a916 Updated tests to use new revert handler 2018-06-07 15:39:40 -07:00
Greg Hysen
8ace41d144 Minor fixes after rebase 2018-06-07 15:39:40 -07:00
Greg Hysen
5bb7219f4b Camelcase in memCopy 2018-06-07 15:39:40 -07:00
Greg Hysen
f0200ab697 Moved some constants to global scope in assetProxyUtils 2018-06-07 15:39:40 -07:00
Greg Hysen
f457a56d4a Style updates to contracts 2018-06-07 15:39:40 -07:00
Greg Hysen
db086de84a Union types for generalized decodeAssetData 2018-06-07 15:39:40 -07:00
Greg Hysen
37684c6af0 Fixed a styling throughout contracts. Moved closing parenthesis for long list of function parameters to next line. 2018-06-07 15:39:40 -07:00
Greg Hysen
3c75d4f1dd Removed setting makerAssetData/takerAssetData from tests where values are same as defaultOrderParams. 2018-06-07 15:39:40 -07:00
Greg Hysen
b19276bb0f Fixed merge error when rebasing wrt length variable in asset data decoders 2018-06-07 15:39:40 -07:00
Greg Hysen
774d831fae Style updates to ERC721 onReceiver 2018-06-07 15:39:40 -07:00
Greg Hysen
a1b49d8389 Fixed after rebase 2018-06-07 15:39:40 -07:00
Greg Hysen
12e2bfc794 Fixes after rebasing 2018-06-07 15:39:38 -07:00
Greg Hysen
6e5abade3c updated migrations artifacts 2018-06-07 15:38:48 -07:00
Greg Hysen
e4e3676095 Fixed up after rebasing. Contracts build and tests pass 2018-06-07 15:38:48 -07:00
Greg Hysen
3ed13150e1 Style audit for proxies + libmem + libbytes 2018-06-07 15:38:48 -07:00
Greg Hysen
f03e5c6bd1 Style audit proxies 2018-06-07 15:38:48 -07:00
Greg Hysen
8496c1cdd3 Call safeTransferFrom only when there is receiver data present 2018-06-07 15:38:48 -07:00
Greg Hysen
3c3851c221 Fixed formatting in memory layout 2018-06-07 15:38:48 -07:00
Greg Hysen
05f1e9e3b8 Resolved edge case in Memcpy where where send would eventually turn "negative" and wrap around. 2018-06-07 15:38:48 -07:00
Greg Hysen
249a1e6d8d Removed the LibAssetProxyDecoder. Merged decode functions into the proxies. This way they can still be used by the forwarding contract. TestAssetDataDecoders inherits them in the same way the forwarding contract would 2018-06-07 15:38:48 -07:00
Greg Hysen
e042e0ad32 Converged on naming scheme for asset data: renamed all instances of assetMetadata, proxyData, proxyMetadata to assetData 2018-06-07 15:38:48 -07:00
Greg Hysen
5db15ca54c proxyData -> assetData 2018-06-07 15:38:48 -07:00
Remco Bloemen
069b89b208 Implement memcpy using masking and end-aligned words 2018-06-07 15:38:48 -07:00
Remco Bloemen
63014aeb6b Add tests for word loop iteration 2018-06-07 15:38:48 -07:00
Remco Bloemen
31e21db5b5 Add test for zero-size overlap 2018-06-07 15:38:48 -07:00
Remco Bloemen
7f21872510 Add test cases 2018-06-07 15:38:47 -07:00
Remco Bloemen
27351c9a90 Cleanup test script 2018-06-07 15:38:47 -07:00
Remco Bloemen
76b918d40e Convert Solidity tests to vectors 2018-06-07 15:38:47 -07:00
Remco Bloemen
f5bc0b205c Generate tests from vectors 2018-06-07 15:38:47 -07:00
Greg Hysen
b3c253ea2a Tests for writing bytes to nested bytes 2018-06-07 15:38:47 -07:00
Greg Hysen
d17e031259 Fixed up wording in memcpy 2018-06-07 15:38:47 -07:00
Greg Hysen
842363200b Tons of tests around nested byte arrays and ERC721 receiver 2018-06-07 15:38:42 -07:00
Greg Hysen
d9f9895b2b Test for onReceived erc721 callback 2018-06-07 15:37:42 -07:00
Greg Hysen
bc0edd4042 LibAssetProxyDecoder tests 2018-06-07 15:36:18 -07:00
Greg Hysen
9b82e2df58 Foundation for TestLibAssetProxyDecoder 2018-06-07 15:36:18 -07:00
Greg Hysen
3d65341080 Tests for libMem 2018-06-07 15:36:18 -07:00
Greg Hysen
80215ea181 LibMem + TestLibMem + LibAssetProxyDecoder + DummyERC721Receiver 2018-06-07 15:36:17 -07:00
Leonid Logvinov
78d8526e41 Merge pull request #679 from 0xProject/fix/await-transactions
Add missing awaitTransactionSuccessAsync calls
2018-06-07 15:34:46 -07:00
Alex Browne
0ddaabe377 Add missing awaitTransactionSuccessAsync calls 2018-06-07 14:46:03 -07:00
Fabio Berger
20f9318597 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
  Fix linter issue
  Fix linter issue
  Fix tslint issues
  Fix missing paths
  Fixed path
  Use source-map-support package to include correct line numbers in mocha
  move generated contract wrappers from `contract_wrappers/generated/` to `generated_contract_wrappers` in package with no non-generated contract wrappers
2018-06-07 21:45:48 +02:00
Fabio Berger
9bc6ebde4e Merge pull request #671 from 0xProject/refactor/move-spawn-switch-to-utils
Move spawnSwitchErr to @0xproject/utils
2018-06-07 21:44:22 +02:00
Fabio Berger
011f14d115 Fix linter issue 2018-06-07 21:24:27 +02:00
Fabio Berger
62a5cbb5ce Fix linter issue 2018-06-07 21:15:12 +02:00
Fabio Berger
5aaf87d612 Merge branch 'v2-prototype' into refactor/move-spawn-switch-to-utils
* v2-prototype:
  Fix tslint issues
  Fix tslint failure
  Pass in fee and assetAmount rather then the whole signedOrder
  Fix missing paths
  Revert to returning orderState on invalid order
  - Refactor remainingFillableCalculator so it can be used for the maker and taker side - Moved the tests over from order-watcher - Did some token -> asset renaming
  Update naming in orderStateUtils to use asset over token, also removed cancelledAmount since in V2 it's binary.
  Fixed path
  Use source-map-support package to include correct line numbers in mocha
  move generated contract wrappers from `contract_wrappers/generated/` to `generated_contract_wrappers` in package with no non-generated contract wrappers
2018-06-07 21:13:30 +02:00
Fabio Berger
96b31f3974 Merge pull request #678 from 0xProject/fix/order-utils/remaining-v2-changes
Remaining Order-utils V2 Changes
2018-06-07 21:12:21 +02:00
Fabio Berger
09e387bf09 Merge pull request #670 from 0xProject/fix/generated-nesting
Remove unnecessary folder nesting
2018-06-07 21:12:10 +02:00
Alex Browne
05fe8792ea Merge pull request #676 from 0xProject/feature/mocha-source-maps
Use source-map-support package to include correct line numbers in mocha
2018-06-07 11:55:47 -07:00
Fabio Berger
18ed45597a Fix tslint issues 2018-06-07 18:58:51 +02:00
Fabio Berger
b646c84414 Merge branch 'fix/order-utils/remaining-v2-changes' into feature/combinatorial-testing
* fix/order-utils/remaining-v2-changes:
  Fix tslint failure
  Pass in fee and assetAmount rather then the whole signedOrder
2018-06-07 18:52:14 +02:00
Fabio Berger
a200eaacaa Fix tslint failure 2018-06-07 18:51:52 +02:00
Fabio Berger
f5ad553be3 Pass in fee and assetAmount rather then the whole signedOrder 2018-06-07 18:33:42 +02:00
Fabio Berger
7b7664bd66 Merge branch 'fix/order-utils/remaining-v2-changes' into feature/combinatorial-testing
* fix/order-utils/remaining-v2-changes:
  Revert to returning orderState on invalid order
  - Refactor remainingFillableCalculator so it can be used for the maker and taker side - Moved the tests over from order-watcher - Did some token -> asset renaming
  Update naming in orderStateUtils to use asset over token, also removed cancelledAmount since in V2 it's binary.
2018-06-07 18:22:00 +02:00
Fabio Berger
4f4acc04fe Fix missing paths 2018-06-07 18:14:35 +02:00
Fabio Berger
dee0fec9e9 Revert to returning orderState on invalid order 2018-06-07 18:10:56 +02:00
Fabio Berger
73cc2a140c - Refactor remainingFillableCalculator so it can be used for the maker and taker side
- Moved the tests over from order-watcher
- Did some token -> asset renaming
2018-06-07 18:03:50 +02:00
Fabio Berger
6058a74da5 Update naming in orderStateUtils to use asset over token, also removed cancelledAmount since in V2 it's binary. 2018-06-07 18:02:48 +02:00
Fabio Berger
ab5e021bda POC: Generates an order from spec, get's the amount fillable 2018-06-07 18:00:13 +02:00
Fabio Berger
bd3b652cfc Fixed path 2018-06-07 13:15:13 +02:00
Fabio Berger
73429fc720 merge v2-prototype 2018-06-07 12:27:03 +02:00
Fabio Berger
10478a6b2f Merge branch 'v2-prototype' into refactor/move-spawn-switch-to-utils
* v2-prototype: (66 commits)
  Run prettier
  Remove unused variable
  Fix linting issues
  Change shouldRenderHeader prop to shouldHideHeader
  Get build and tests to pass
  typo
  Apply prettier
  Update contracts tests after rebase
  Apply various fixes based on PR feedback
  Document debug_increaseTime method and fix typo in devnet README
  Use an enum for ProviderType in contracts/src/utils/web3_wrapper
  Update contracts package README
  Update relevant changelogs
  Remove global gas estimate buffer
  Add Async suffix to relevant assertions
  Fix linter errors
  Update package.json and yarn.lock
  Update more things to work with both Geth and Ganache
  Small fixes and cleanup
  Add additional gas to calls to fillOrderNoThrow
  ...

# Conflicts:
#	packages/order-watcher/src/order_watcher/order_watcher.ts
#	packages/react-docs/src/components/type.tsx
#	packages/website/ts/components/ui/lifecycle_raised_button.tsx
#	packages/website/ts/components/wallet/wallet.tsx
2018-06-07 12:21:44 +02:00
Fabio Berger
0fc9814004 merge v2-prototype 2018-06-07 12:18:53 +02:00
Fabio Berger
e0bc01eea1 Merge pull request #673 from mohoff/patch-1
typo
2018-06-07 08:54:05 +01:00
fragosti
2af6d3f6bc Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/onboarding-flow-allowances 2018-06-06 18:07:22 -07:00
fragosti
cbe5438a31 Render TokenAllowance 2018-06-06 18:06:03 -07:00
Francesco Agosti
67c4ad128c Merge pull request #662 from 0xProject/feature/improve-linting
Tried enabling no-unused-variable...
2018-06-06 17:21:09 -07:00
fragosti
870eca0d9f Run prettier 2018-06-06 16:59:28 -07:00
Alex Browne
d299458084 Use source-map-support package to include correct line numbers in mocha 2018-06-06 16:54:20 -07:00
fragosti
e0cf68f1d5 Remove unused variable 2018-06-06 16:45:26 -07:00
fragosti
64906a1ba5 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/improve-linting 2018-06-06 16:43:37 -07:00
fragosti
e75721016e Fix linting issues 2018-06-06 16:43:05 -07:00
fragosti
e0d5b9daf8 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/improve-linting 2018-06-06 16:36:11 -07:00
Brandon Millman
5989844f1c Merge pull request #672 from 0xProject/feature/website/account-management-polish
Account management polish
2018-06-06 16:12:47 -07:00
Brandon Millman
14e3f413a2 Change shouldRenderHeader prop to shouldHideHeader 2018-06-06 16:11:23 -07:00
fragosti
a97d77064a Get build and tests to pass 2018-06-06 15:26:40 -07:00
mohoff
3342dd4001 typo 2018-06-06 23:21:53 +02:00
Alex Browne
785b9811f3 Merge pull request #622 from 0xProject/geth-devnet-rebase-on-v2
Run contract tests against private Geth network
2018-06-06 13:43:29 -07:00
Alex Browne
643c77ded0 Apply prettier 2018-06-06 13:28:32 -07:00
Fabio Berger
e617da3bbf Implement initial generateOrder function that given the scenario values for an order, generates the actual order. 2018-06-06 22:13:50 +02:00
Alex Browne
76f01511a3 Update contracts tests after rebase 2018-06-06 13:10:59 -07:00
Alex Browne
dd8727d3ae Apply various fixes based on PR feedback 2018-06-06 12:41:15 -07:00
Alex Browne
b933946f33 Document debug_increaseTime method and fix typo in devnet README 2018-06-06 12:41:15 -07:00
Alex Browne
5d2f9d7a33 Use an enum for ProviderType in contracts/src/utils/web3_wrapper 2018-06-06 12:41:15 -07:00
Alex Browne
3baf14b793 Update contracts package README 2018-06-06 12:41:15 -07:00
Alex Browne
c57e4ba508 Update relevant changelogs 2018-06-06 12:41:14 -07:00
Alex Browne
98656289ea Remove global gas estimate buffer 2018-06-06 12:41:14 -07:00
Alex Browne
167a38e27d Add Async suffix to relevant assertions 2018-06-06 12:41:14 -07:00
Alex Browne
ba6806df5d Fix linter errors 2018-06-06 12:41:14 -07:00
Alex Browne
fe12101278 Update package.json and yarn.lock 2018-06-06 12:41:14 -07:00
Alex Browne
d6d7f4e875 Update more things to work with both Geth and Ganache 2018-06-06 12:40:31 -07:00
Alex Browne
63caddea62 Small fixes and cleanup 2018-06-06 12:40:31 -07:00
Alex Browne
36b01fbdcf Add additional gas to calls to fillOrderNoThrow 2018-06-06 12:40:31 -07:00
Alex Browne
45a3d8b75a Remove extra logs and other small fixes 2018-06-06 12:40:31 -07:00
Alex Browne
bca62c813d Throw in web3-wrapper when rawCallResult is '0x' 2018-06-06 12:40:30 -07:00
Alex Browne
ae1cf74dcd Remove outdated todo 2018-06-06 12:40:30 -07:00
Alex Browne
577a8dd005 Fix some more test cases, especially those that call increaseTime 2018-06-06 12:40:30 -07:00
Alex Browne
5900899c01 Add support for TEST_PROVIDER env var 2018-06-06 12:40:30 -07:00
Alex Browne
2dfc468094 Update more tests to pass on Geth 2018-06-06 12:40:30 -07:00
Alex Browne
98ffe9931d Get LibBytes tests working on both Ganache and Geth 2018-06-06 12:40:30 -07:00
Alex Browne
2004c0d739 Add ability to quickly switch between Geth and Ganache by changing a const 2018-06-06 12:39:44 -07:00
Alex Browne
cd7cb025ad Update exchange/transactions tests for Geth error messages 2018-06-06 12:39:43 -07:00
Alex Browne
96da267778 Fix ethers.js version override (the package is just called 'ethers') 2018-06-06 12:39:43 -07:00
Alex Browne
5816e410e9 Use our fork of ethers.js 2018-06-06 12:39:43 -07:00
Alex Browne
31c98fc0db Update some tests after rebase 2018-06-06 12:39:43 -07:00
Alex Browne
00bf957b53 Add more transactions to Geth on init. Skip tests that are failing. 2018-06-06 12:39:43 -07:00
Alex Browne
5b999c2f7d Increase gas limit to account for bigger ExchangeContract 2018-06-06 12:39:42 -07:00
Alex Browne
1cc9d9c071 Replace constant.REVERT test assertions with expectRevertOrAlwaysFailingTransaction 2018-06-06 12:39:42 -07:00
Alex Browne
72fb8460e9 Update code after rebase 2018-06-06 12:39:42 -07:00
Alex Browne
577156fe5f Use Geth for contract tests 2018-06-06 12:39:39 -07:00
fragosti
612cc96e41 Add utilities for getting tokens from tokensByAddress 2018-06-06 11:47:11 -07:00
Brandon Millman
da3f783a9f Merge pull request #669 from 0xProject/bug/website/fix-balance-rendering
Update balance amount rendering logic
2018-06-06 11:44:06 -07:00
Leonid Logvinov
b1e8545981 Merge pull request #653 from 0xProject/feature/ethereum-types-docs
Add a documentation page for ethereum-types package
2018-06-06 11:38:43 -07:00
fragosti
6a2da6dc06 Fix merge conflict 2018-06-06 11:23:57 -07:00
fragosti
58603e2a5a Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/improve-linting 2018-06-06 11:17:13 -07:00
fragosti
d97184880c Use CLI for exclude 2018-06-06 11:10:06 -07:00
Leonid Logvinov
625f40cfa6 Add EthereumTypes to _renderDrawer 2018-06-06 10:31:38 -07:00
Leonid Logvinov
49049b8c12 Merge pull request #657 from 0xProject/feature/build-speed
Speedup CI builds
2018-06-06 10:25:43 -07:00
fragosti
037912ccab Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/improve-linting 2018-06-06 10:20:35 -07:00
Leonid Logvinov
8b05b864fb Don't build website if no changes were made to it 2018-06-06 10:11:51 -07:00
Leonid Logvinov
319135c8fe Remove lerna bootstrap 2018-06-06 10:11:51 -07:00
Leonid Logvinov
61d9e418e8 Fix linter issues in generated contract wrappers 2018-06-06 10:11:51 -07:00
Leonid Logvinov
475bb2845d Add generated contract artifacts to prettierignore 2018-06-06 10:11:51 -07:00
Leonid Logvinov
42f39de0f9 Stop running prettier on generated files 2018-06-06 10:11:51 -07:00
fragosti
3898b8e8ab Wrap AllowanceToggle in redux container 2018-06-06 10:11:30 -07:00
Leonid Logvinov
b1fd005c95 Enable skipLibCheck flag in ts 2018-06-06 10:00:21 -07:00
Fabio Berger
cf8fdd3a70 Move spawnSwitchErr to @0xproject/utils 2018-06-06 16:26:04 +02:00
Fabio Berger
cb754ee125 move generated contract wrappers from contract_wrappers/generated/ to generated_contract_wrappers in package with no non-generated contract wrappers 2018-06-06 15:39:38 +02:00
Fabio Berger
cea81df969 Add missing import 2018-06-06 14:49:41 +02:00
Fabio Berger
af1d5fce6e Merge pull request #665 from 0xProject/fix/fix-build-watch
Improve Build/Watch Commands
2018-06-06 13:46:52 +01:00
Fabio Berger
54b86b6131 Add missing yarn 2018-06-06 13:40:34 +02:00
Fabio Berger
ec2b83515b Add missing build:all command 2018-06-06 13:26:08 +02:00
Fabio Berger
2f2724dff5 Fix remaining tslint issues 2018-06-06 12:39:15 +02:00
Fabio Berger
271fa26890 merge v2-prototype 2018-06-06 12:31:30 +02:00
Fabio Berger
fe437da751 Exclude generate contract wrappers from tslint 2018-06-06 12:23:50 +02:00
Fabio Berger
129876d1be remove unused imports from 0x.js test 2018-06-06 12:22:15 +02:00
Fabio Berger
f2ced67a8d Remove unused imports from contract handlebar template 2018-06-06 12:21:12 +02:00
Fabio Berger
787eec8be4 Merge v2-prototype 2018-06-06 11:30:57 +02:00
Fabio Berger
cc39eea999 Merge pull request #664 from 0xProject/fixes/misc-small-fixes
Small miscellaneous fixes
2018-06-06 10:26:50 +01:00
Fabio Berger
cbfed99bc6 Merge branch 'v2-prototype' into fixes/misc-small-fixes
* v2-prototype:
  Remove TranslatedText
  Fix prettier
  Add back UMD bundles for 0x.js
  Move portal disclaimer to the account management section
  Move prices into portal
  Use stricter check for subscribe input text
  Make buttons stack on mobile
  Do not show subscribe form if language is not english
  Address PR feedback
  Lint and cleanup
  Implement subscription form
  Add styled-components and polished
  Have basic newsletter subscribe form working
2018-06-06 11:10:27 +02:00
Brandon Millman
2b4cd8b2ec Fix undefined ether balance 2018-06-06 01:33:35 -07:00
Brandon Millman
b5dc72b126 Make scrollability a prop on TradeHistory 2018-06-06 01:33:35 -07:00
Brandon Millman
ab4d2faea3 Fix EthWrappers background color 2018-06-06 01:33:35 -07:00
Brandon Millman
1677817d9f Update GenerateOrderForm and FillOrder components 2018-06-06 01:33:35 -07:00
Brandon Millman
03854baf53 Update EthWrappers component 2018-06-06 01:33:35 -07:00
Brandon Millman
61dc253de1 Update TradeHistory component 2018-06-06 01:33:35 -07:00
Brandon Millman
a0e8f410d1 Hide action column on mainnet 2018-06-06 01:33:35 -07:00
Brandon Millman
2865f63c5d Fix TokenBalances background color 2018-06-06 01:33:35 -07:00
Brandon Millman
3f19ab1a87 Add isFullWidth prop to TokenBalances component 2018-06-06 01:33:35 -07:00
Brandon Millman
d75fec0cee Update balance amount rendering logic 2018-06-05 22:03:26 -07:00
fragosti
39570a9663 Remove TranslatedText 2018-06-05 21:49:14 -07:00
Brandon Millman
479c18e21f Fix prettier 2018-06-05 16:41:17 -07:00
Brandon Millman
fd4453d85e Merge pull request #668 from 0xProject/feature/website/move-disclaimer
Move portal disclaimer to the account management section
2018-06-05 16:40:08 -07:00
Leonid Logvinov
7ee7f99780 Add back UMD bundles for 0x.js 2018-06-05 16:29:18 -07:00
Brandon Millman
4c0b8e3113 Merge pull request #666 from 0xProject/bug/website/fix-missing-prices
Move price fetching from wallet into portal
2018-06-05 16:11:04 -07:00
Brandon Millman
e0af60d8a7 Move portal disclaimer to the account management section 2018-06-05 16:10:15 -07:00
Brandon Millman
afcb7f00da Move prices into portal 2018-06-05 15:37:51 -07:00
Jacob Evans
a59e9f024e Update Order utils to use eip712 2018-06-05 14:08:04 -07:00
Francesco Agosti
e1b06bfce2 Merge pull request #652 from 0xProject/feature/website/landing-subscribe-button-2
Implement subscribe form on landing page
2018-06-05 13:16:10 -07:00
fragosti
8de3f03b49 Use stricter check for subscribe input text 2018-06-05 12:59:10 -07:00
fragosti
db8f018b42 Some cleanup 2018-06-05 11:51:07 -07:00
fragosti
59cb2132f2 Linter now passes 2018-06-05 11:46:05 -07:00
Fabio Berger
25f62daf14 - Rename watch to watch_without_deps in sub-packages, so dev's don't confuse running watch from root dir, with sub-package dir
- stop using special prebuild script name and run pre_build steps for `watch` and `build` commands
- Remove `clean` step from `build`/`watch`
2018-06-05 15:38:40 +02:00
Fabio Berger
05b9dfbe30 Mention the gasLimit until in the doc comment 2018-06-05 12:29:32 +02:00
Fabio Berger
3db4e2ee2f Merge branch 'v2-prototype' into fixes/misc-small-fixes
* v2-prototype:
  Fix broken link to `contract_templates`

# Conflicts:
#	packages/abi-gen/README.md
2018-06-05 12:22:24 +02:00
Fabio Berger
86a6a5b826 Replace - with _ in yarn script name so that we are consistent across yarn script names 2018-06-05 12:20:23 +02:00
Fabio Berger
cc6338d048 Add switch-default tslint rule and add missing default statement 2018-06-05 12:19:28 +02:00
Fabio Berger
57b65726d6 Remove outdated link in ABI-gen README 2018-06-05 12:16:25 +02:00
Fabio Berger
44a736c53b Merge pull request #661 from feuGeneA/patch-1
Fix broken link to `contract_templates`
2018-06-05 02:47:45 -07:00
Fabio Berger
38cbd42d81 Merge pull request #656 from 0xProject/refactor/fill-scenarios/for-v2
Refactor fill-scenarios for v2
2018-06-05 02:15:27 -07:00
Fabio Berger
28d019f824 Use _.omit for conciseness 2018-06-05 11:13:55 +02:00
Alex Browne
54b8e1be89 Merge pull request #658 from 0xProject/dont-automatically-rebuild-for-tests
Don't automatically rebuild when running yarn test
2018-06-05 01:00:51 -07:00
fragosti
9778695b4a Try enabling no-unused-variable... 2018-06-04 19:48:21 -07:00
Alex Browne
44b6285268 Remove duplicate cleans in package.json when clean is called in prebuild 2018-06-04 18:40:16 -07:00
F. Eugene Aumson
6c6fb2e287 Fix broken link to contract_templates
Note there is still a broken link here, the "wrapper files" one in the second paragraph.
2018-06-04 21:37:47 -04:00
Alex Browne
ecdfde8c38 Remove common-js/umd differentiation from 0x.js/package.json 2018-06-04 18:24:20 -07:00
fragosti
ea2d5b9d4a Make buttons stack on mobile 2018-06-04 17:52:39 -07:00
Jacob Evans
4670cc1a5f Add missing EIP191 prefix for EIP712 2018-06-04 17:41:00 -07:00
Leonid Logvinov
1e0522fe8f Add a TODO comment on StructLog type in the docs 2018-06-04 17:31:30 -07:00
Jacob Evans
70858603ed Merge pull request #633 from 0xProject/feature/contracts/errors
Update error handling
2018-06-04 17:25:45 -07:00
fragosti
3c508c1d27 Do not show subscribe form if language is not english 2018-06-04 17:06:23 -07:00
Jacob Evans
5c44db341f rename GT to GREATER_THAN 2018-06-04 17:04:16 -07:00
fragosti
cf73363016 Address PR feedback 2018-06-04 17:02:10 -07:00
Jacob Evans
351173e554 Rebase from v2-prototype 2018-06-04 16:55:22 -07:00
Amir Bandeali
342432dc76 Update Exchange statuses, revert instead of emmitting event on fill/cancel failures, and remove redundant logic in matchOrders 2018-06-04 15:55:28 -07:00
Alex Browne
c4538cada7 Don't automatically rebuild when running yarn test 2018-06-04 14:13:17 -07:00
Fabio Berger
de532bb2fc revert multisig change 2018-06-04 21:54:16 +01:00
Fabio Berger
f525afa5de reset multisign 2018-06-04 21:49:04 +01:00
Fabio Berger
9fba470364 Add PR to changelog 2018-06-04 21:29:17 +01:00
Fabio Berger
6cd5bf31c9 Update fill-scenarios for V2 and add CHANGELOG entry 2018-06-04 20:54:39 +01:00
Fabio Berger
321c0a8537 Remove unused compact artifacts from order-utils 2018-06-04 20:54:04 +01:00
Fabio Berger
b9bc58ef10 Add missing exports to order-utils and add CHANGELOG entry 2018-06-04 20:53:48 +01:00
Fabio Berger
7bcf05fd19 Add new 2.0 artifacts to migrations 2018-06-04 20:53:08 +01:00
Fabio Berger
f816bdf541 Remove compact_artifacts and replace with updated artifacts 2018-06-04 20:52:37 +01:00
Alex Browne
79472552aa Merge pull request #655 from 0xProject/update-migrations
Update artifacts in migrations
2018-06-04 12:47:11 -07:00
Fabio Berger
c5e5c8288e Update fill-scenarios to depend on v2 updated order-utils and types. Needed to re-employ the symlink hack. 2018-06-04 20:45:35 +01:00
Alex Browne
fd1c7f7169 Update artifacts in migrations 2018-06-04 12:45:23 -07:00
Leonid Logvinov
9212d67e2f Add a documentation page for ethereum types 2018-06-04 10:54:14 -07:00
Francesco Agosti
f5c74d123a Merge pull request #644 from 0xProject/feature/website/refactor-token-state-fetching
Move TokenState fetching logic up into Portal.tsx so it can be used by Wallet and PortalOnboardingFlow
2018-06-04 10:46:08 -07:00
fragosti
c8421efcd3 Address feedback 2018-06-04 10:27:24 -07:00
fragosti
f382609d01 Implement WETH step logic for continue 2018-06-04 10:25:38 -07:00
fragosti
f9615c18a1 Move trackedTokenStateByAddress logic into portal 2018-06-04 10:25:38 -07:00
fragosti
a74597c7cd Lint and cleanup 2018-06-01 17:37:32 -07:00
Fabio Berger
d50fbac5f9 Merge pull request #636 from 0xProject/refactor/order-utils/for-v2
Refactor order-utils for v2
2018-06-01 17:29:44 -07:00
fragosti
95086a75e6 Merge branch 'feature/website/landing-subscribe-button' into feature/website/landing-subscribe-button-2 2018-06-01 17:28:04 -07:00
fragosti
073a96cf63 Implement subscription form 2018-06-01 17:25:50 -07:00
Fabio Berger
d3c64bd5b4 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype:
  Set contract expiration time to a constant 10 minutes
  Remove unused promises array
  Make erc20_wrapper and erc721_wrapper serial
  Rename changelogs to changelog
  Add CHANGELOG entry
  Check that git branch is up to date before publishing
  Move prepublish checks before building packages for publishing
  Refactor changelog utils to a separate module
2018-06-01 17:13:02 -07:00
Fabio Berger
7024a7468a Improve comments and remove unused imports 2018-06-01 17:02:54 -07:00
Alex Browne
62e60e2ba6 Merge pull request #651 from 0xProject/serial-contract-wrappers
Make erc20_wrapper and erc721_wrapper serial and increase contract expiration time
2018-06-01 16:56:32 -07:00
Alex Browne
fb3860757c Set contract expiration time to a constant 10 minutes 2018-06-01 16:40:38 -07:00
Alex Browne
e4a8b17522 Remove unused promises array 2018-06-01 16:18:22 -07:00
Alex Browne
448df1bb9c Make erc20_wrapper and erc721_wrapper serial 2018-06-01 16:09:49 -07:00
Leonid Logvinov
bf6900fb2a Merge pull request #650 from 0xProject/feature/publishing
Improve publishing flow
2018-06-01 15:50:13 -07:00
Leonid Logvinov
50552546f3 Rename changelogs to changelog 2018-06-01 15:46:16 -07:00
Fabio Berger
324fab8186 Fix tslint issues 2018-06-01 14:12:18 -07:00
Fabio Berger
7ab80f01b5 Add comment to exported method 2018-06-01 14:09:47 -07:00
Fabio Berger
9ce4a5c7b1 Add missing dep 2018-06-01 14:09:16 -07:00
Fabio Berger
c9a0525a10 Fix types version 2018-06-01 14:02:15 -07:00
Fabio Berger
83465bb7f5 Also manually symlink types package in contracts 2018-06-01 14:02:00 -07:00
Leonid Logvinov
e8771fb36a Add CHANGELOG entry 2018-06-01 13:59:45 -07:00
Leonid Logvinov
d4d03f3d7f Check that git branch is up to date before publishing 2018-06-01 13:55:40 -07:00
Fabio Berger
d567d667e8 Remove usage of prebuild since it doesn't run on watch 2018-06-01 13:49:30 -07:00
Fabio Berger
3d55bbbc29 remove artifactsDir and contracts from compiler.json 2018-06-01 13:42:06 -07:00
Leonid Logvinov
2f8e52f905 Move prepublish checks before building packages for publishing 2018-06-01 13:39:04 -07:00
Fabio Berger
a5896ac6b6 Add postinstall hack to get around yarn not setting up symlinks properly. This is a temporary fix while we wait on: https://github.com/yarnpkg/yarn/issues/5907 2018-06-01 13:36:22 -07:00
Fabio Berger
94b9d5644c Fix type imports 2018-06-01 13:33:46 -07:00
Leonid Logvinov
06e5fc233c Refactor changelog utils to a separate module 2018-06-01 13:12:45 -07:00
Fabio Berger
aefb922a05 Remove ISigner artifact 2018-06-01 13:11:18 -07:00
Fabio Berger
a22434fd73 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype:
  Update v2 artifacts
  Add IWallet and IValidator to compiled contracts
  Split migrations compile command into one for V1 and another for V2

# Conflicts:
#	packages/migrations/artifacts/2.0.0/Exchange.json
#	packages/migrations/artifacts/2.0.0/TestSignatureValidator.json
2018-06-01 13:08:38 -07:00
Fabio Berger
c41846805d Merge pull request #649 from 0xProject/addArtifacts
Add Updated V2 Artifacts
2018-06-01 13:06:42 -07:00
Fabio Berger
b7b45b69a6 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype: (33 commits)
  Only show ProviderDisplay in portal
  Improve sol-cov docs
  Remove old parse code
  Refactor order parser and add shared order support to new portal
  Add generate and fill order routes
  Address feedback
  Override ethereumjs-tx version
  Fix missing key
  Update placeholder param ordering
  Change userEtherBalanceInWei to optional so we can know if its loading
  Add loading state to ProviderDisplay
  Tweaks
  Add Placeholder component
  Add StandardIconRow
  Split render into loading and loaaded
  Fix linter errors
  Fix linter errors
  Add ethereum-types to extraFileIncludes
  Introduce ethereum-types package
  Remove merge conflicts from yarn.lock
  ...

# Conflicts:
#	packages/contracts/src/utils/exchange_wrapper.ts
#	packages/contracts/src/utils/match_order_tester.ts
#	packages/contracts/src/utils/types.ts
#	packages/contracts/test/exchange/core.ts
#	packages/contracts/test/exchange/match_orders.ts
#	packages/contracts/test/libraries/lib_bytes.ts
#	packages/sol-cov/package.json
2018-06-01 13:05:17 -07:00
Fabio Berger
ed5528664c Update v2 artifacts 2018-06-01 12:20:54 -07:00
Fabio Berger
fe88d3c225 Add IWallet and IValidator to compiled contracts 2018-06-01 12:20:36 -07:00
Fabio Berger
aed4ee8694 Split migrations compile command into one for V1 and another for V2 2018-06-01 12:05:57 -07:00
fragosti
817d9b0d3e Add styled-components and polished 2018-06-01 11:49:58 -07:00
Fabio Berger
df9cfe7840 Update json-schemas version to 1.0.0 to avoid possible conflicts 2018-06-01 11:48:55 -07:00
Fabio Berger
8cd4578d83 Add signature specific validation methods, and other refactors 2018-06-01 11:34:12 -07:00
Brandon Millman
9ca41b9536 Merge pull request #648 from 0xProject/feature/website/fill-order
Add shared order support
2018-06-01 11:22:25 -07:00
Brandon Millman
559743c911 Only show ProviderDisplay in portal 2018-06-01 11:05:01 -07:00
fragosti
3a7f26f620 Have basic newsletter subscribe form working 2018-06-01 11:04:56 -07:00
Leonid Logvinov
04a0eae241 Improve sol-cov docs 2018-06-01 10:43:33 -07:00
Brandon Millman
0500d2fb6e Remove old parse code 2018-06-01 10:37:44 -07:00
Brandon Millman
31f1a9e5aa Refactor order parser and add shared order support to new portal 2018-06-01 10:37:44 -07:00
Brandon Millman
6387aae471 Add generate and fill order routes 2018-06-01 10:37:44 -07:00
Fabio Berger
152082e182 Fix TODOs 2018-05-31 21:32:20 -07:00
Fabio Berger
08eb2b3df7 Update all artifacts 2018-05-31 21:32:13 -07:00
Fabio Berger
846ec87249 List V2 contracts in compile.json now 2018-05-31 21:28:58 -07:00
Fabio Berger
62690b5159 Fix sol-cov issue by changing it's dep to current version of types 2018-05-31 21:23:28 -07:00
Fabio Berger
719c432ca8 Rename ISigner to IWallet and implement SignatureType.Validator 2018-05-31 21:23:08 -07:00
Fabio Berger
e654616b6d Bump types to a major version to avoid the caret 2018-05-31 20:39:10 -07:00
Fabio Berger
f0473b0320 Fix metadata offsets 2018-05-31 16:12:56 -07:00
Fabio Berger
fcc627e6e1 fix method rename 2018-05-31 16:12:36 -07:00
Fabio Berger
fe17802cd2 Rename Ecrecover to EthSign 2018-05-31 16:12:21 -07:00
Leonid Logvinov
384c05ccc7 Merge pull request #642 from 0xProject/feature/ethereum-types
Introduce ethereum-types package
2018-05-31 14:33:28 -07:00
Leonid Logvinov
193e4f3275 Address feedback 2018-05-31 13:43:53 -07:00
Brandon Millman
6fd87568e7 Merge pull request #643 from 0xProject/feature/website/wallet-loading
Add loading states to wallet and provider display
2018-05-31 13:34:12 -07:00
Alex Browne
484fd68495 Merge pull request #647 from 0xProject/override-ethereumjs-tx-version
Override ethereumjs-tx version
2018-05-31 12:19:37 -07:00
Alex Browne
792be54443 Override ethereumjs-tx version 2018-05-31 12:05:13 -07:00
Brandon Millman
00df102c29 Fix missing key 2018-05-31 11:54:25 -07:00
Brandon Millman
90e68ddd73 Update placeholder param ordering 2018-05-31 11:54:25 -07:00
Brandon Millman
df27f4f118 Change userEtherBalanceInWei to optional so we can know if its loading 2018-05-31 11:54:25 -07:00
Brandon Millman
bee26daf0c Add loading state to ProviderDisplay 2018-05-31 11:54:25 -07:00
Brandon Millman
b76c738785 Tweaks 2018-05-31 11:54:25 -07:00
Brandon Millman
8ca9fb0251 Add Placeholder component 2018-05-31 11:54:25 -07:00
Brandon Millman
3b26a656f7 Add StandardIconRow 2018-05-31 11:54:25 -07:00
Brandon Millman
2f5ac5d993 Split render into loading and loaaded 2018-05-31 11:54:25 -07:00
Leonid Logvinov
a2fc9a964b Fix linter errors 2018-05-31 11:19:18 -07:00
Leonid Logvinov
b8a267370d Fix linter errors 2018-05-31 11:04:06 -07:00
Leonid Logvinov
fa3d011f68 Add ethereum-types to extraFileIncludes 2018-05-31 11:04:05 -07:00
Leonid Logvinov
a7fc9caacb Introduce ethereum-types package 2018-05-31 11:04:05 -07:00
Leonid Logvinov
c284f6dcd4 Merge pull request #624 from 0xProject/feature/fast-ci2
Rebalance CI tests to run faster
2018-05-31 11:02:56 -07:00
Fabio Berger
368d59c3ca Update artifacts 2018-05-31 11:02:45 -07:00
Fabio Berger
94ee82e076 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype: (45 commits)
  Check length before accessing indices, add awaitTransactionSuccess where needed, and rename function
  Add back before/after snapshots for each test
  Rename Signer to Wallet, rename GAS_ESTIMATE to GAS_LIMIT
  Make preSigned and allowedValidators mappings public
  Change names of signature types
  Fix formatting and tests
  Make AssetProxyId last byte of assetData
  Add signer to txHash, allow approveValidator to be used with executeTransaction
  Update Whitelist
  Fix Exchange interface
  Increase block gas limit
  Use last byte of signature as signature type
  Remove TxOrigin signature type, modify whitelist to use Validator signature type
  Update Whitelist contract with comments, also require maker to be whitelisted
  Fix build
  Add example whitelist contract and minimum tests
  Add sample whitelist contract
  Add TxOrigin signature type and rearrange order of types
  Add approveValidator function
  Add Validator signature type
  ...

# Conflicts:
#	packages/contracts/src/contracts/current/protocol/Exchange/MixinSignatureValidator.sol
#	packages/contracts/src/utils/types.ts
#	packages/contracts/test/exchange/transactions.ts
#	packages/order-utils/src/asset_proxy_utils.ts
2018-05-31 10:45:34 -07:00
Leonid Logvinov
bfefb6e696 Remove merge conflicts from yarn.lock 2018-05-31 10:36:34 -07:00
Leonid Logvinov
95b7601e2b Don't wait con contract tests to submit coverage 2018-05-31 10:34:24 -07:00
Leonid Logvinov
f9c8bd868c Keep node versions consistent 2018-05-31 10:33:56 -07:00
Leonid Logvinov
a773973b1b Split tests into two buckets 2018-05-31 10:33:56 -07:00
Leonid Logvinov
a60006366b Use a newer version of node/yarn to speed-up deps instaation 2018-05-31 10:33:56 -07:00
Leonid Logvinov
a66bb7889a Try to cache dependencies 2018-05-31 10:32:43 -07:00
Leonid Logvinov
adfba06e85 Combine lint and pretttier tests together 2018-05-31 10:32:43 -07:00
Leonid Logvinov
6ee4e954f6 Rebalance tests 2018-05-31 10:32:43 -07:00
Leonid Logvinov
a11d139ff6 Merge pull request #641 from 0xProject/feature/remove-types
Remove types
2018-05-31 10:29:42 -07:00
Leonid Logvinov
85a3e66314 Add changelog entry for typescript-typings 2018-05-31 10:29:05 -07:00
Leonid Logvinov
1a3958ed60 Remove some types 2018-05-31 10:20:36 -07:00
Leonid Logvinov
743c957918 Remove published types 2018-05-31 10:20:35 -07:00
Amir Bandeali
224a6c192b Fix build 2018-05-31 10:19:10 -07:00
Alex Browne
ae47da3801 Merge pull request #640 from 0xProject/await-transaction-success
Add awaitTransactionSuccess where needed
2018-05-30 22:28:37 -07:00
Alex Browne
a6d669453f Pass in a provider and instantiate a new web3Wrapper in token_registry_wrapper 2018-05-30 22:27:07 -07:00
Fabio Berger
0beab9eec4 Expose isValidPresignedSignatureAsync method 2018-05-30 17:55:33 -07:00
Fabio Berger
aa997f1be5 Move isValidOrderHash to the order_hash_test file 2018-05-30 17:55:16 -07:00
Fabio Berger
4eb58a70bb Decide to throw for Caller signature type for now 2018-05-30 17:54:59 -07:00
Amir Bandeali
5b31d0aa36 Merge pull request #561 from 0xProject/feature/contracts/txorigin
Add Validator signature type
2018-05-30 17:53:22 -07:00
Amir Bandeali
79e7c44884 Check length before accessing indices, add awaitTransactionSuccess where needed, and rename function 2018-05-30 17:52:37 -07:00
Amir Bandeali
1382c1243a Add back before/after snapshots for each test 2018-05-30 17:11:31 -07:00
Amir Bandeali
8f2fd9b603 Rename Signer to Wallet, rename GAS_ESTIMATE to GAS_LIMIT 2018-05-30 17:11:31 -07:00
Amir Bandeali
d625b65a09 Make preSigned and allowedValidators mappings public 2018-05-30 17:11:31 -07:00
Amir Bandeali
101e9be7b9 Change names of signature types 2018-05-30 17:11:31 -07:00
Amir Bandeali
9f93d8f533 Fix formatting and tests 2018-05-30 17:11:31 -07:00
Amir Bandeali
6050a59e4a Make AssetProxyId last byte of assetData 2018-05-30 17:11:30 -07:00
Amir Bandeali
e5b7e29113 Add signer to txHash, allow approveValidator to be used with executeTransaction 2018-05-30 17:11:30 -07:00
Amir Bandeali
ecdd0ce9f2 Update Whitelist 2018-05-30 17:11:30 -07:00
Amir Bandeali
fc5c598f8f Fix Exchange interface 2018-05-30 17:11:30 -07:00
Amir Bandeali
18ebed3c5d Increase block gas limit 2018-05-30 17:11:30 -07:00
Amir Bandeali
822e319efe Use last byte of signature as signature type 2018-05-30 17:11:30 -07:00
Amir Bandeali
6d462fc961 Remove TxOrigin signature type, modify whitelist to use Validator signature type 2018-05-30 17:11:30 -07:00
Amir Bandeali
4b71c65aea Update Whitelist contract with comments, also require maker to be whitelisted 2018-05-30 17:11:30 -07:00
Amir Bandeali
34ab53173d Fix build 2018-05-30 17:11:30 -07:00
Amir Bandeali
d6be6f79ce Add example whitelist contract and minimum tests 2018-05-30 17:11:30 -07:00
Amir Bandeali
87d36f06fd Add sample whitelist contract 2018-05-30 17:11:30 -07:00
Amir Bandeali
3eb05b4505 Add TxOrigin signature type and rearrange order of types 2018-05-30 17:11:30 -07:00
Amir Bandeali
0789c6a3d8 Add approveValidator function 2018-05-30 17:11:30 -07:00
Amir Bandeali
b587f076fe Add Validator signature type 2018-05-30 17:11:30 -07:00
Amir Bandeali
a5a7217c8f Add deepCopyBytes method to LibBytes 2018-05-30 17:11:30 -07:00
Amir Bandeali
c0cf55b40b Merge pull request #639 from 0xProject/fix/contracts/multisigWrapper
Update LogDecoder
2018-05-30 17:10:39 -07:00
Fabio Berger
9200ed2216 Introduce OrderWithoutExchangeAddress type since this is what get's sent to the smart contracts 2018-05-30 14:45:20 -07:00
Fabio Berger
e1f7dd1372 Add ISigner artifacts 2018-05-30 14:08:58 -07:00
Fabio Berger
32833b7301 Fix order-utils tests 2018-05-30 14:08:43 -07:00
Fabio Berger
3302c89284 Revivie the ECSignatureSchema 2018-05-30 13:52:27 -07:00
Francesco Agosti
e18d61b31a Merge pull request #635 from 0xProject/feature/website/custom-onboarding-tooltip
Remove react-joyride and some more refactoring
2018-05-30 11:49:04 -07:00
Francesco Agosti
61cd1ae525 Merge pull request #638 from 0xProject/feature/website/onboarding-eth-flow
Onboarding: implement add ETH step, and stub for add WETH step
2018-05-30 11:17:38 -07:00
Alex Browne
064608a8ef Add awaitTransactionSuccess where needed 2018-05-30 11:10:30 -07:00
Amir Bandeali
5a840c88b5 Change logDecoder back into class, remove awaitTransactionMined from multiSigWrapper 2018-05-30 10:00:58 -07:00
fragosti
b14c3fe48d Onboarding: implement add ETH step, and stub for add WETH step 2018-05-29 17:57:22 -07:00
Fabio Berger
4874d55d03 Initial refactor of order-utils. Move many utils from contracts into this package. 2018-05-29 16:58:30 -07:00
Brandon Millman
b20e40dd6f Fix unselected relayer drawer item 2018-05-29 16:04:25 -07:00
fragosti
bc28a08dd0 Address PR feedback 2018-05-29 15:49:13 -07:00
fragosti
0d3010f6fc Remove react-joyride from deps 2018-05-29 15:27:30 -07:00
fragosti
399a651fa3 Add entry to CHANGELOG.json 2018-05-29 15:24:10 -07:00
fragosti
30ac5fcb5e Remove blacklist concept 2018-05-29 15:18:43 -07:00
fragosti
92cb5e10be Some cleanup 2018-05-29 14:26:38 -07:00
Fabio Berger
10faa47495 Freeze order-utils at 0.0.5 for all packages except contracts 2018-05-29 13:38:19 -07:00
fragosti
f0bbf2cab0 Improve tooltip look 2018-05-29 12:53:18 -07:00
fragosti
338e8be327 Add types for react-popper, remove types for react-joyride 2018-05-29 11:21:14 -07:00
Leonid Logvinov
a4726a0e0d Merge pull request #621 from 0xProject/feature/compiler-assertions
Add schema assertions on public methods of @0xproject/sol-compiler
2018-05-29 10:58:46 -07:00
fragosti
d4a366aeb1 Replace react-joyride with react-popper 2018-05-29 10:48:44 -07:00
Leonid Logvinov
98652997f9 Add a CHANGELOG entry 2018-05-29 10:09:09 -07:00
Leonid Logvinov
f5a39c2f7b Make opts param optional in Compiler 2018-05-29 10:09:09 -07:00
Leonid Logvinov
9854db0a63 Throw if trying to schema-validate an undefined 2018-05-29 10:09:09 -07:00
Leonid Logvinov
cc7b0f4623 Add CHANGELOG entry 2018-05-29 10:09:09 -07:00
Leonid Logvinov
549e6d57c4 Add schema assertions on public methods of @0xproject/sol-compiler 2018-05-29 10:09:07 -07:00
Fabio Berger
dea322e2c5 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype:
  Hide wallet management option and expand component on small screens
  Remove registry override
  Revert "Change the registry in yarn.lock"
  Change the registry in yarn.lock
  Remove contracts -> @0xproject/order-utils dependency
2018-05-25 19:54:11 -07:00
Fabio Berger
ed5b9c2b56 Merge pull request #625 from 0xProject/feature/contracts-without-contract-wrappers
Remove contracts -> @0xproject/contract-wrappers dependency
2018-05-25 19:52:47 -07:00
Brandon Millman
c31ca4af90 Hide wallet management option and expand component on small screens 2018-05-25 18:34:07 -07:00
Leonid Logvinov
2c9ec4bee8 Remove registry override 2018-05-25 17:01:50 -07:00
Leonid Logvinov
6dcfc36a4a Revert "Change the registry in yarn.lock"
This reverts commit 76579a3004.
2018-05-25 16:36:56 -07:00
Leonid Logvinov
76579a3004 Change the registry in yarn.lock 2018-05-25 16:13:48 -07:00
Leonid Logvinov
1d68692bb6 Remove contracts -> @0xproject/order-utils dependency 2018-05-25 16:09:17 -07:00
Fabio Berger
790af0fd72 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype:
  Fix imports in order_utils
  Use web3-wrapper instead of 0x.js, update logDecoder
  Cleanup tests
  Add errMsg when throwing on unrecognized error
  Move readFirst4 to LibBytes
  Add old MultiSig to previous contracts, cleanup file structure
  Fix build
  Address feedback, rename contract to AssetProxyOwner
  Update multisig tests and utils
  Update MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress to use a mapping of registered proxies
  Implement design for relayers with no volume or tokens
2018-05-25 15:39:02 -07:00
fragosti
39008372e5 Write custom tooltip component 2018-05-25 15:31:27 -07:00
fragosti
1026952f26 Run linter 2018-05-25 13:13:06 -07:00
fragosti
9631927a8c Add localstorage helper 2018-05-25 12:03:18 -07:00
fragosti
b0e6ce581a Add next button 2018-05-25 12:03:18 -07:00
fragosti
e575323c60 Auto-show onboarding flow on first page view 2018-05-25 12:03:18 -07:00
fragosti
809ac3340c Add ability to blacklist onboarding steps 2018-05-25 12:03:18 -07:00
fragosti
f0af638874 Fix PortalOnboardingFlowProps 2018-05-25 12:03:18 -07:00
fragosti
b49148ec54 Implement metamask installation flow 2018-05-25 12:03:18 -07:00
Brandon Millman
c7f5e77b3f Merge pull request #620 from 0xProject/feature/website/relayer-empty
Implement design for relayers with no volume or tokens
2018-05-24 23:16:44 -07:00
Leonid Logvinov
817248369a Fix imports in order_utils 2018-05-24 18:30:48 -07:00
Amir Bandeali
654698b208 Merge pull request #571 from 0xProject/feature/contracts/proxyOwner
Update MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress
2018-05-24 17:24:52 -07:00
Fabio Berger
4e5bfae332 Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype:
  Temporarily disable installation tests
  Use domain separator for exchange address
  publicGetOrderSchemaHash -> getOrderSchemaHash
  Update order hash to match latest eip712
  Pin connect in sra-report
  Fix a typo
  Pin types in sra-report
  Fix linter issues
  Unpin types version in @0xproject/connect
  Pin types version in website
  Do a fake version bump on types so that yarn doesn't try to install updated version for not yet migrated packages
  Migrate migrations to v2
2018-05-24 16:31:21 -07:00
Fabio Berger
895a9093aa Merge pull request #575 from 0xProject/feature/contracts/eip712-order-hash
Update order hash to match latest eip712
2018-05-24 16:30:46 -07:00
Fabio Berger
35121f0b78 Merge branch 'v2-prototype' into feature/contracts/eip712-order-hash
* v2-prototype:
  Temporarily disable installation tests
  Pin connect in sra-report
  Fix a typo
  Pin types in sra-report
  Fix linter issues
  Unpin types version in @0xproject/connect
  Pin types version in website
  Do a fake version bump on types so that yarn doesn't try to install updated version for not yet migrated packages
  Migrate migrations to v2

# Conflicts:
#	packages/contracts/src/utils/order_utils.ts
2018-05-24 16:30:30 -07:00
Leonid Logvinov
c4a7574f7b Merge pull request #618 from 0xProject/feature/v2-migrations
Migrate migrations, types to v2
2018-05-24 16:18:44 -07:00
Leonid Logvinov
4ee636ecca Temporarily disable installation tests 2018-05-24 16:07:11 -07:00
Fabio Berger
662dc12877 Add senderAddress to order schema 2018-05-24 16:05:07 -07:00
Jacob Evans
3cc8af819c Use domain separator for exchange address 2018-05-24 16:00:22 -07:00
Jacob Evans
fcf4a958c3 publicGetOrderSchemaHash -> getOrderSchemaHash 2018-05-24 16:00:22 -07:00
Jacob Evans
65676c22f9 Update order hash to match latest eip712 2018-05-24 16:00:22 -07:00
Leonid Logvinov
3e907d7f4f Pin connect in sra-report 2018-05-24 15:45:11 -07:00
Leonid Logvinov
9fa567aa78 Fix a typo 2018-05-24 15:42:29 -07:00
Amir Bandeali
237ebb0716 Use web3-wrapper instead of 0x.js, update logDecoder 2018-05-24 15:39:19 -07:00
Amir Bandeali
fdea260e41 Cleanup tests 2018-05-24 15:39:19 -07:00
Amir Bandeali
9af77dc835 Add errMsg when throwing on unrecognized error 2018-05-24 15:39:19 -07:00
Amir Bandeali
d4aacd218a Move readFirst4 to LibBytes 2018-05-24 15:39:19 -07:00
Amir Bandeali
326a566db2 Add old MultiSig to previous contracts, cleanup file structure 2018-05-24 15:39:19 -07:00
Amir Bandeali
84257dac2b Fix build 2018-05-24 15:39:19 -07:00
Amir Bandeali
22ad9e1e1a Address feedback, rename contract to AssetProxyOwner 2018-05-24 15:39:19 -07:00
Amir Bandeali
cc44f5f75d Update multisig tests and utils 2018-05-24 15:39:19 -07:00
Amir Bandeali
23df5cc201 Update MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress to use a mapping of registered proxies 2018-05-24 15:39:19 -07:00
Brandon Millman
dab2d5db44 Implement design for relayers with no volume or tokens 2018-05-24 15:37:04 -07:00
Leonid Logvinov
1717c5c00d Pin types in sra-report 2018-05-24 15:28:37 -07:00
Leonid Logvinov
ea3f82ccc2 Fix linter issues 2018-05-24 14:56:20 -07:00
Leonid Logvinov
fd6ce470e7 Unpin types version in @0xproject/connect 2018-05-24 14:40:53 -07:00
Leonid Logvinov
6d3fbbe256 Pin types version in website 2018-05-24 14:40:32 -07:00
Leonid Logvinov
45c4de16d2 Do a fake version bump on types so that yarn doesn't try to install updated version for not yet migrated packages 2018-05-24 14:33:48 -07:00
Leonid Logvinov
92b0efff5a Migrate migrations to v2 2018-05-24 13:59:30 -07:00
Leonid Logvinov
bc550c3265 Merge pull request #617 from 0xProject/feature/no-coverage-ci-contracts
Disable contracts coverage on CI
2018-05-24 13:37:55 -07:00
Francesco Agosti
b39aa5d359 Merge pull request #607 from 0xProject/feature/website/onboarding-setup
Set up structure for onboarding flow along with basic step 0
2018-05-24 13:02:45 -07:00
fragosti
f8f8bd95ca Improve OnboardingFlow API and typescript types 2018-05-24 11:24:10 -07:00
fragosti
d057b77dc5 Address PR feedback 2018-05-24 10:53:13 -07:00
fragosti
27d637195d Undo change to react-highlight 2018-05-24 10:52:11 -07:00
fragosti
46919ce797 Fix build errors 2018-05-24 10:52:11 -07:00
fragosti
b4e1ce59f9 Fix issue where modal can be out of sync with app state 2018-05-24 10:52:11 -07:00
fragosti
7af77d3eb0 Basic onboarding flow infrastructure set up 2018-05-24 10:51:06 -07:00
Francesco Agosti
de1ff52de3 Merge pull request #612 from 0xProject/feature/website/add-redux-devtools
Add redux-devtools-extension to project
2018-05-24 10:12:57 -07:00
Leonid Logvinov
69c1df68c8 Disable contracts coverage on CI 2018-05-24 09:57:13 -07:00
Fabio Berger
62431fee8e Merge pull request #615 from 0xProject/refactor/json-schemas/for-v2
Refactor order schemas in json-schemas for v2
2018-05-24 09:39:28 -07:00
Fabio Berger
357201869a Change all wsrun commands so that they fast-exit (e.g any one failing stops the entire process from executing) 2018-05-23 21:27:37 -07:00
Fabio Berger
a88e8ffe79 Have source-map-loader ignore node_modules packages 2018-05-23 21:27:08 -07:00
Fabio Berger
5c88f43e15 Revert to an earlier version that works 2018-05-23 21:26:17 -07:00
Alex Browne
2f7ab3e32d Merge pull request #613 from 0xProject/check-tx-receipt-status
Check transaction receipt status
2018-05-23 18:12:41 -07:00
Fabio Berger
3ec05bb5d8 Force hex to have at least two hex values after the prefix, but it could be two zeros 2018-05-23 17:36:34 -07:00
Fabio Berger
59890f2c83 Fix Hex regex and tests 2018-05-23 17:28:17 -07:00
Fabio Berger
2c70162bee Remove the caret so it actually installs this version 2018-05-23 17:28:03 -07:00
Brandon Millman
2f1a4042bf Merge pull request #603 from 0xProject/feature/website/wallet-flex-box
Improve wallet layout using flexbox
2018-05-23 17:03:54 -07:00
Fabio Berger
4af7740907 Merge branch 'v2-prototype' into refactor/json-schemas/for-v2
* v2-prototype:
  Ignore v2 artifacts
2018-05-23 17:01:14 -07:00
Fabio Berger
f64ea361d4 Add CHANGELOG entry 2018-05-23 17:00:32 -07:00
Fabio Berger
9c850d152c Updated Order, SignedOrder schemas, removed ECSignature schema types and added Hex basic type 2018-05-23 16:52:41 -07:00
Fabio Berger
71266c0220 Merge pull request #614 from 0xProject/bug/prettier/ignore-v2-artifacts
Ignore v2 artifacts
2018-05-23 15:47:43 -07:00
Brandon Millman
0801457ff0 Use visibility property instead of placeholder div in wrap ether item 2018-05-23 15:28:51 -07:00
Jacob Evans
ba7c9ceccc Ignore v2 artifacts 2018-05-23 15:21:43 -07:00
Alex Browne
f6f2818a02 Change error message for awaitTransactionSuccessAsync 2018-05-23 15:09:19 -07:00
Alex Browne
b05a3b7aed Check transaction receipt status codes where applicable 2018-05-23 15:09:17 -07:00
Brandon Millman
3fe94891d3 Merge branch 'v2-prototype' into feature/website/wallet-flex-box
* v2-prototype: (95 commits)
  Add missing dep to website
  Upgrade solidity parser
  Fix trace test
  Fix linter issues
  Move contract utils
  Fix prettier
  Fix NameResolver
  Fix prettier
  Remove 0x.js as a dependency from website
  Enable 0x.js tests
  Fix small bug in order-utils
  Address feedback
  Fix Tslint error caused by "PromiseLike" value
  Fix Tslint error caused by "PromiseLike" value
  Update dogfood url
  fix contract-wrappers version
  Parse compiler.json in SolCompilerArtifactsAdapter
  Fix TokenTransferProxy artifact name since it's now suffixed with _v1
  Update yarn.lock
  Fix signature verification test
  ...
2018-05-23 14:16:32 -07:00
Fabio Berger
9d11028fce Bump all dependencies on json-schemas down a patch version so that they don't auto-magically get upgraded to the next version during the next publish 2018-05-23 13:56:52 -07:00
Fabio Berger
f6b81f588d Add missing dep to website 2018-05-23 13:30:09 -07:00
Fabio Berger
513007a82c Merge pull request #589 from 0xProject/feature/truffle-sol-cov
Sol-cov artifact Adapters (truffle)
2018-05-23 12:01:38 -07:00
Leonid Logvinov
bf18a90da7 Upgrade solidity parser 2018-05-23 11:21:33 -07:00
Leonid Logvinov
2ddd53b355 Fix trace test 2018-05-23 10:49:08 -07:00
Leonid Logvinov
c9aef16649 Fix linter issues 2018-05-23 10:39:56 -07:00
Leonid Logvinov
6a77e0fe56 Move contract utils 2018-05-23 10:32:14 -07:00
Leonid Logvinov
0a725415a4 Merge branch 'v2-prototype' into feature/truffle-sol-cov 2018-05-23 10:19:10 -07:00
Leonid Logvinov
af0d9439d4 Merge pull request #611 from 0xProject/feature/remove-0x-from=-website
Remove 0x.js as a dependency from website
2018-05-23 10:16:00 -07:00
Leonid Logvinov
65f09d0528 Fix prettier 2018-05-23 10:15:03 -07:00
Leonid Logvinov
48e6695447 Fix NameResolver 2018-05-23 09:57:43 -07:00
Leonid Logvinov
e3604c1662 Fix prettier 2018-05-23 09:41:35 -07:00
Leonid Logvinov
5913d654bd Remove 0x.js as a dependency from website 2018-05-23 09:41:35 -07:00
Fabio Berger
f3fe9661f6 Merge pull request #609 from 0xProject/refactor/contracts/remove0xjsDep
Remove 0x.js dep from Contracts
2018-05-23 09:04:59 -07:00
Fabio Berger
17cfd7b001 Enable 0x.js tests 2018-05-23 08:37:43 -07:00
Fabio Berger
e941bdd945 Merge branch 'v2-prototype' into refactor/contracts/remove0xjsDep
* v2-prototype:
  Fix small bug in order-utils
  Fix Tslint error caused by "PromiseLike" value
  Update dogfood url
2018-05-22 18:15:38 -07:00
Alex Browne
e7e8773cd4 Fix small bug in order-utils 2018-05-22 18:14:23 -07:00
Leonid Logvinov
ebc750d5bf Address feedback 2018-05-22 17:41:48 -07:00
Fabio Berger
3507fe6d5b Merge branch 'v2-prototype' of github.com:0xProject/0x-monorepo into v2-prototype
* 'v2-prototype' of github.com:0xProject/0x-monorepo:
  Update dogfood url
2018-05-22 17:37:23 -07:00
Fabio Berger
f9ef6491e6 Fix Tslint error caused by "PromiseLike" value 2018-05-22 17:37:06 -07:00
Fabio Berger
61e487224f Fix Tslint error caused by "PromiseLike" value 2018-05-22 17:36:41 -07:00
Brandon Millman
85eb82acb2 Update dogfood url 2018-05-22 17:36:22 -07:00
Fabio Berger
4d364ea261 fix contract-wrappers version 2018-05-22 17:18:09 -07:00
Fabio Berger
577528bb9c merge v2-prototype 2018-05-22 16:56:09 -07:00
Leonid Logvinov
d49f2c40ae Parse compiler.json in SolCompilerArtifactsAdapter 2018-05-22 16:41:50 -07:00
Fabio Berger
706bfafe74 Fix TokenTransferProxy artifact name since it's now suffixed with _v1 2018-05-22 16:38:26 -07:00
Fabio Berger
1b8204dabe Update yarn.lock 2018-05-22 16:37:33 -07:00
Fabio Berger
05cabded02 Fix signature verification test 2018-05-22 16:37:17 -07:00
Fabio Berger
1578402cbe Fix TokenTransferProxy artifact name since it's now suffixed with _v1 2018-05-22 16:37:04 -07:00
fragosti
49ee56b22c Move to deps from devDeps and use in development only 2018-05-22 16:32:26 -07:00
Leonid Logvinov
8c7f0902c0 Add a more verbose comment for self-destruct 2018-05-22 16:29:10 -07:00
Leonid Logvinov
056ef9ccd1 Merge pull request #610 from 0xProject/feature/sra-report-without-0x
Remove 0x.js dependency from sra-report
2018-05-22 16:18:42 -07:00
fragosti
dfc635b451 Add redux-devtools-extension to project 2018-05-22 16:08:04 -07:00
Leonid Logvinov
68321362c5 Remove 0x.js dependency from sra-report 2018-05-22 15:45:44 -07:00
Leonid Logvinov
f7560036b8 Merge branch 'v2-prototype' into feature/truffle-sol-cov 2018-05-22 15:33:36 -07:00
Leonid Logvinov
fc87caa348 Merge branch 'development' into v2-prototype 2018-05-22 15:30:39 -07:00
Leonid Logvinov
6e0aef5f2b Fix depth tracking in a tracer 2018-05-22 15:27:18 -07:00
Leonid Logvinov
127b3e7d60 Fix sol-compiler version 2018-05-22 15:27:17 -07:00
Leonid Logvinov
9740199870 Fix sol-cov tests 2018-05-22 15:27:17 -07:00
Leonid Logvinov
06be580d2c Fix a bug in CALL-like opcode handling 2018-05-22 15:27:17 -07:00
Leonid Logvinov
6540343f45 Remove trace.json 2018-05-22 15:27:17 -07:00
Leonid Logvinov
447b305e3c Suppport subcalls in constructor 2018-05-22 15:27:17 -07:00
Leonid Logvinov
0c53d276f8 Use BlockParamLiteral.Latest 2018-05-22 15:27:17 -07:00
Leonid Logvinov
83c37c6a7a Address feedback 2018-05-22 15:27:17 -07:00
Leonid Logvinov
ac52ad88a1 Use loglevel instead of verbose flag 2018-05-22 15:26:29 -07:00
Leonid Logvinov
84a1b5612d Publish
- 0x.js@0.38.0
 - @0xproject/abi-gen@0.3.0
 - @0xproject/assert@0.2.10
 - @0xproject/base-contract@0.3.2
 - @0xproject/connect@0.6.13
 - @0xproject/contract-wrappers@0.0.2
 - contracts@2.1.29
 - @0xproject/dev-utils@0.4.2
 - @0xproject/fill-scenarios@0.0.2
 - @0xproject/json-schemas@0.7.24
 - @0xproject/metacoin@0.0.7
 - @0xproject/migrations@0.0.6
 - @0xproject/monorepo-scripts@0.1.20
 - @0xproject/order-utils@0.0.5
 - @0xproject/order-watcher@0.0.2
 - @0xproject/react-docs-example@0.0.12
 - @0xproject/react-docs@0.0.12
 - @0xproject/react-shared@0.1.7
 - @0xproject/sol-compiler@0.5.0
 - @0xproject/sol-cov@0.0.11
 - @0xproject/sol-resolver@0.0.5
 - @0xproject/sra-report@0.1.0
 - @0xproject/subproviders@0.10.2
 - @0xproject/testnet-faucets@1.0.30
 - @0xproject/tslint-config@0.4.18
 - @0xproject/types@0.7.0
 - @0xproject/typescript-typings@0.3.2
 - @0xproject/utils@0.6.2
 - @0xproject/web3-wrapper@0.6.4
 - @0xproject/website@0.0.33
2018-05-22 15:25:47 -07:00
Leonid Logvinov
fa4e694859 Updated CHANGELOGS 2018-05-22 15:22:38 -07:00
Leonid Logvinov
f8c628b0c7 Updated CHANGELOGS 2018-05-22 15:22:12 -07:00
Leonid Logvinov
2f35e4789c Change publish command name 2018-05-22 15:20:35 -07:00
Leonid Logvinov
253bada643 Fix import paths 2018-05-22 15:20:35 -07:00
Leonid Logvinov
e4fe497504 Refactor ContractData lookup 2018-05-22 15:20:35 -07:00
Leonid Logvinov
5c9bde203e Remove a comment 2018-05-22 15:20:35 -07:00
Leonid Logvinov
d9907f227e Use a hidden directory for temp artifacts 2018-05-22 15:20:34 -07:00
Leonid Logvinov
08b08ef1d0 Match class names with file names 2018-05-22 15:20:34 -07:00
Leonid Logvinov
334ef5c3eb Improve a CHANGELOG comment 2018-05-22 15:20:34 -07:00
Leonid Logvinov
ac925aa226 Improve a CHANGELOG comment 2018-05-22 15:20:34 -07:00
Leonid Logvinov
86f17fb466 Rename ZeroExArtifactAdapter to SolCompilerArtifactAdapter 2018-05-22 15:20:34 -07:00
Leonid Logvinov
6aafda4517 Assign then pass 2018-05-22 15:20:34 -07:00
Leonid Logvinov
8267950dbc Assign then return 2018-05-22 15:20:34 -07:00
Leonid Logvinov
56d1b0103f Introduce CONFIG_FILE 2018-05-22 15:20:34 -07:00
Leonid Logvinov
1ff34bd0f4 Remove web3Factory.create and remove dev-tools dependency on sol-cov 2018-05-22 15:20:34 -07:00
Leonid Logvinov
b86248f13f Add CHANGELOG entries 2018-05-22 15:20:34 -07:00
Leonid Logvinov
427a29145d Support all opcodes in a trace parser 2018-05-22 15:20:34 -07:00
Leonid Logvinov
974575b695 Make sol-cov work with truffle and other artifact adapters 2018-05-22 15:20:34 -07:00
Leonid Logvinov
60b1fdd367 Only look at *.sol files in NameResolver 2018-05-22 15:20:33 -07:00
Leonid Logvinov
842f2ea5cc Fix a bug in FS resolver causing it to try reading directories 2018-05-22 15:20:33 -07:00
Leonid Logvinov
ae220c37df Add solcVersion to CompilerOpts 2018-05-22 15:20:33 -07:00
Fabio Berger
6f57f52ac2 Fix dep version 2018-05-22 13:44:35 -07:00
Fabio Berger
4897513d7d Fix import 2018-05-22 13:19:35 -07:00
Fabio Berger
c8dad01137 Fix await calls 2018-05-22 13:19:29 -07:00
Fabio Berger
5a09063adb Refactor etherToken test to use contract-wrappers 2018-05-22 13:15:16 -07:00
Fabio Berger
9de9bf651b Fix ExchangeWrapper 2018-05-22 13:15:01 -07:00
Fabio Berger
09d80b1e50 Fix imports 2018-05-22 13:14:38 -07:00
Fabio Berger
2b793f372a Merge branch 'v2-prototype' into refactor/contracts/remove0xjsDep
* v2-prototype:
  Fix tslint issues
  Add `are` to boolean naming conventions
  Fix tslint
  Fix the tsutils version, fixing ts typings issue
  Rename some variables in multi_sig_with_time_lock.ts
  Remove extra awaitTransactionMinedAsync calls
  Update artifacts
  Update yarn.lock
  Fix warnings in Metacoin
  Upgrade UglifyJS to include ES6 support
  Add CancelOrder and MatchOrder types
  Add missing return types
  Ignore classnames linter rule
  Apply changes to test/exchange/match_orders.ts
  Fix some unhandled promise rejections
  Add awaitTransactionMinedAsync after every sent transaction
  Add missing blockchainLifecycle calls to contracts tests

# Conflicts:
#	packages/contracts/src/utils/exchange_wrapper.ts
#	packages/contracts/test/asset_proxy/proxies.ts
#	packages/contracts/test/exchange/dispatcher.ts
#	packages/contracts/test/multi_sig_with_time_lock.ts
2018-05-22 13:02:21 -07:00
Fabio Berger
4cfeb6b8ac Merge branch 'v2-prototype' of github.com:0xProject/0x-monorepo into v2-prototype
* 'v2-prototype' of github.com:0xProject/0x-monorepo:
  Rename some variables in multi_sig_with_time_lock.ts
  Remove extra awaitTransactionMinedAsync calls
  Apply changes to test/exchange/match_orders.ts
  Fix some unhandled promise rejections
  Add awaitTransactionMinedAsync after every sent transaction
  Add missing blockchainLifecycle calls to contracts tests
2018-05-22 11:58:50 -07:00
Fabio Berger
9373451ca8 Fix tslint issues 2018-05-22 11:58:42 -07:00
Fabio Berger
15c199d5a2 Add are to boolean naming conventions 2018-05-22 11:58:35 -07:00
Alex Browne
cde85243d6 Merge pull request #601 from 0xProject/contracts-test-fixes
Contracts test fixes
2018-05-22 11:48:41 -07:00
Fabio Berger
c579db1a7b Merge branch 'v2-prototype' of github.com:0xProject/0x-monorepo into v2-prototype
* 'v2-prototype' of github.com:0xProject/0x-monorepo:
  Update artifacts
  Update yarn.lock
  Fix warnings in Metacoin
  Upgrade UglifyJS to include ES6 support
  Add CancelOrder and MatchOrder types
  Add missing return types
  Ignore classnames linter rule
2018-05-22 11:42:58 -07:00
Fabio Berger
61fa34e2ce Fix tslint 2018-05-22 11:42:52 -07:00
Fabio Berger
96febf6639 Merge pull request #605 from 0xProject/fix/multiple/build-errors
Fix build/lint errors and warnings
2018-05-22 11:40:27 -07:00
Fabio Berger
09e59cf677 Fix the tsutils version, fixing ts typings issue 2018-05-22 11:23:14 -07:00
Fabio Berger
9119ee14b6 Update artifact 2018-05-22 11:19:19 -07:00
Fabio Berger
2ac2ae3eee Fix tsutils version 2018-05-22 11:19:09 -07:00
Fabio Berger
a682b5d90e Remove 0x.js dep from contracts 2018-05-22 11:18:50 -07:00
Alex Browne
e26c0c58ae Rename some variables in multi_sig_with_time_lock.ts 2018-05-22 11:02:29 -07:00
Alex Browne
187fa71526 Remove extra awaitTransactionMinedAsync calls 2018-05-22 10:58:34 -07:00
Leonid Logvinov
031f97e97c Publish
- 0x.js@0.38.0
 - @0xproject/abi-gen@0.3.0
 - @0xproject/assert@0.2.10
 - @0xproject/base-contract@0.3.2
 - @0xproject/connect@0.6.13
 - @0xproject/contract-wrappers@0.0.2
 - contracts@2.1.29
 - @0xproject/dev-utils@0.4.2
 - @0xproject/fill-scenarios@0.0.2
 - @0xproject/json-schemas@0.7.24
 - @0xproject/metacoin@0.0.7
 - @0xproject/migrations@0.0.6
 - @0xproject/monorepo-scripts@0.1.20
 - @0xproject/order-utils@0.0.5
 - @0xproject/order-watcher@0.0.2
 - @0xproject/react-docs-example@0.0.12
 - @0xproject/react-docs@0.0.12
 - @0xproject/react-shared@0.1.7
 - @0xproject/sol-compiler@0.5.0
 - @0xproject/sol-cov@0.0.11
 - @0xproject/sol-resolver@0.0.5
 - @0xproject/sra-report@0.1.0
 - @0xproject/subproviders@0.10.2
 - @0xproject/testnet-faucets@1.0.30
 - @0xproject/tslint-config@0.4.18
 - @0xproject/types@0.7.0
 - @0xproject/typescript-typings@0.3.2
 - @0xproject/utils@0.6.2
 - @0xproject/web3-wrapper@0.6.4
 - @0xproject/website@0.0.33
2018-05-22 10:26:47 -07:00
Leonid Logvinov
b9e1c3c34f Updated CHANGELOGS 2018-05-22 10:26:39 -07:00
Leonid Logvinov
1a35107a1d Updated CHANGELOGS 2018-05-22 10:16:53 -07:00
Leonid Logvinov
d3e086c850 Change publish command name 2018-05-22 10:16:53 -07:00
Fabio Berger
4a0c8d72b0 merge development 2018-05-22 09:25:02 -07:00
Fabio Berger
ab9cfd293b remove generated contract_wrappers during clean 2018-05-22 09:21:20 -07:00
Fabio Berger
cc840a6911 Merge pull request #594 from 0xProject/improvement/addCustomTslintRules
Add more tslint rules
2018-05-22 18:04:50 +02:00
Remco Bloemen
5456187dd0 Update artifacts 2018-05-22 17:13:04 +02:00
Remco Bloemen
73c95c328d Update yarn.lock 2018-05-22 17:08:47 +02:00
Remco Bloemen
4a971be168 Fix warnings in Metacoin 2018-05-22 15:19:40 +02:00
Remco Bloemen
f657a3d811 Upgrade UglifyJS to include ES6 support 2018-05-22 15:19:40 +02:00
Remco Bloemen
b39f75a2e3 Add CancelOrder and MatchOrder types 2018-05-22 15:15:14 +02:00
Remco Bloemen
1dad14f8ea Add missing return types 2018-05-22 13:50:07 +02:00
Remco Bloemen
5cc2e8de7b Ignore classnames linter rule 2018-05-22 13:45:18 +02:00
Brandon Millman
d0abc60176 Add missing key 2018-05-21 21:41:03 -07:00
Brandon Millman
130e83d9b2 Use flexbox for wrapped ether item 2018-05-21 21:25:43 -07:00
Brandon Millman
ed8acdb11c Re add wrapped ether item 2018-05-21 21:25:43 -07:00
Brandon Millman
26370da13d Rewrite balance rows using flex box 2018-05-21 21:25:42 -07:00
Fabio Berger
c4a2f70017 Make lint run in parallel 2018-05-21 18:36:06 -07:00
Alex Browne
a5d315ee2a Apply changes to test/exchange/match_orders.ts 2018-05-21 16:58:29 -07:00
Alex Browne
4fa57f55e6 Fix some unhandled promise rejections 2018-05-21 16:52:49 -07:00
Alex Browne
2c496a92ad Add awaitTransactionMinedAsync after every sent transaction 2018-05-21 16:52:49 -07:00
Alex Browne
4ca8903a21 Add missing blockchainLifecycle calls to contracts tests 2018-05-21 16:52:49 -07:00
Greg Hysen
d460c0e8b9 Merge pull request #572 from 0xProject/feature/contracts/atomicMatching
Atomic Order Matching
2018-05-21 14:29:56 -07:00
Greg Hysen
11b6d290da Removed debug line from chai_setup. Its failing linter and does not appear to be used (it was from an old PR I merged in). 2018-05-21 14:25:39 -07:00
Greg Hysen
d83902834f Ran prettier 2018-05-21 13:54:11 -07:00
Fabio Berger
0fdf32cf6f merge development 2018-05-21 13:38:12 -07:00
Greg Hysen
f4ebbfabf4 Added getNullFillResults 2018-05-18 17:07:00 -07:00
Greg Hysen
b5bcfc8fe7 orderFilledAmount -> orderTakerAssetFilledAmount 2018-05-18 17:07:00 -07:00
Greg Hysen
d13c08cc0d Style improvements to order matching 2018-05-18 17:07:00 -07:00
Greg Hysen
89abd76570 Upgraded to Solidity 0.4.24 2018-05-18 17:07:00 -07:00
Greg Hysen
8c1ae35088 Rebased against v2-prototype 2018-05-18 17:05:36 -07:00
Greg Hysen
bb74789b42 Changed calculateFillResults to public visibility so that it can be used by the Forwarding Contract. 2018-05-18 17:01:06 -07:00
Greg Hysen
dbbd32d2ce Moved feeTokenAddress to MatchOrderTester constructor. Since it is constant, we dont need to pass it in on each call. 2018-05-18 17:01:06 -07:00
Greg Hysen
80285a300d Wording of calculateMatchedFillResults 2018-05-18 17:01:06 -07:00
Greg Hysen
2eb5819851 Cleaned up interface for decoding proxy data. Added a general decoder, which should be useful for the forwarding contract code. 2018-05-18 17:01:06 -07:00
Greg Hysen
e748e1891b Style improvements to the match orders typescript test class 2018-05-18 17:01:06 -07:00
Greg Hysen
28bb11217c Removed redundant log decode call 2018-05-18 17:01:06 -07:00
Greg Hysen
636dae6a79 The OrderInfo struct is now returned by the getOrderInfo function 2018-05-18 17:01:06 -07:00
Greg Hysen
c8f65a1bf9 Updated order of settleMatchedOrders to align with settleOrder 2018-05-18 17:01:06 -07:00
Greg Hysen
ce177ae6f6 IExchange inherits from all other interfaces (in the same order as Exchange inherits Mixins) 2018-05-18 17:01:06 -07:00
Greg Hysen
c79f3501cd Renamed takerAssetFilledAmount to orderFilledAmount to more easily distinguish between fill results and order state 2018-05-18 17:01:06 -07:00
Greg Hysen
80114edc71 Comments for readability in exchange core and mixin match orders 2018-05-18 17:01:06 -07:00
Greg Hysen
71483e2865 Renamed "validate" functions to "assert" in mixin match. 2018-05-18 17:01:06 -07:00
Greg Hysen
93087324d9 Throw if the left or right orders do not compute the correct fill results. I like this better than just logging an error and failing silently. 2018-05-18 17:01:06 -07:00
Greg Hysen
061facdcce Removed redundant status checks in matchOrders. Saves gas, plus follows pattern of fillOrder more closely. 2018-05-18 17:01:06 -07:00
Greg Hysen
3e6e7fb272 Token -> Asset in fillOrder spec 2018-05-18 17:01:06 -07:00
Greg Hysen
12d8c2398f Reordered functions in mixin exchange core -- getOrderInfo is at the bottom 2018-05-18 17:01:06 -07:00
Greg Hysen
bb73963421 Changes based on style guidelines put out by Amir 2018-05-18 17:01:06 -07:00
Greg Hysen
1dd7688bdd Reordered fund transfers for matched orders, plus added an extra sanity check to order matching calculations 2018-05-18 17:01:06 -07:00
Greg Hysen
5735095521 Style changes to atomic order matching 2018-05-18 17:01:06 -07:00
Greg Hysen
fa7570352c Added require reasons to MixinMatchOrders and cleaned up some comments. 2018-05-18 17:01:06 -07:00
Greg Hysen
f378406d15 Updated remaining contracts to v0.4.23 2018-05-18 17:01:05 -07:00
Greg Hysen
68fa7ae2a3 Removed isRoundingError from mixin header 2018-05-18 17:01:05 -07:00
Greg Hysen
9b1015bbce Atomic Order Matching - Tests 2018-05-18 17:01:05 -07:00
Greg Hysen
a4c821eb60 Atomic Order Matching - Smart Contracts. 2018-05-18 17:01:05 -07:00
Brandon Millman
c70540e7f4 Merge pull request #598 from 0xProject/feature/website/mobile-optimize
Mobile optimize the portal layout
2018-05-18 15:38:04 -07:00
Brandon Millman
e291146443 Prettier 2018-05-18 11:36:17 -07:00
Brandon Millman
faa2b6237f Change number of columns in relayer index for small screens 2018-05-18 11:35:13 -07:00
Brandon Millman
26661f3091 Wallet instead of balances for small screens 2018-05-18 11:35:13 -07:00
Brandon Millman
e6e8d49d72 Close drawer when new path is chosen 2018-05-18 11:35:13 -07:00
Brandon Millman
b9ca055586 Fix styling of portal menu 2018-05-18 11:35:13 -07:00
Brandon Millman
9ce7be050a Refactor portal specific colors out of react-shared 2018-05-18 11:35:13 -07:00
Brandon Millman
1d2617c826 Add custom styling for drawer 2018-05-18 11:35:13 -07:00
Brandon Millman
7c8e9ddc42 Fix key issue for portal routes 2018-05-18 11:35:13 -07:00
Brandon Millman
157764c0d9 Fix responsiveness broken in rebase 2018-05-18 11:35:13 -07:00
Brandon Millman
317ff81744 Set up scaffolding for new drawer 2018-05-18 11:35:13 -07:00
Brandon Millman
bd7fc780cb Hide wallet component for small screens 2018-05-18 11:35:13 -07:00
Brandon Millman
4b343d9dcf Fix token link key 2018-05-18 11:35:13 -07:00
Brandon Millman
7a6a5d7595 Modulate number of columns based on screenwidth 2018-05-18 11:35:13 -07:00
Brandon Millman
85020c74cf Fix prettier 2018-05-18 11:33:46 -07:00
Jacob Evans
0137c0da8c Merge pull request #583 from 0xProject/bug/contracts/erc721-encoded-pad
ERC721Proxy Pad to 32 if asset ids are small
2018-05-18 12:26:31 +10:00
fragosti
407731ab16 Change my title to clarify 2018-05-17 16:33:09 -07:00
Francesco Agosti
72503c0689 Merge pull request #596 from 0xProject/feature/website/weth-eth-conversion-errors
Show error messages in the wrapped ether item
2018-05-17 13:15:24 -07:00
fragosti
e9e570db4f Center all the things 2018-05-17 13:04:39 -07:00
fragosti
5bc83fceaa Refactor code in response to CR feedback 2018-05-17 13:04:39 -07:00
fragosti
e7fd501200 Remove duplicate function call to validate 2018-05-17 13:04:39 -07:00
fragosti
ea0067d999 Show error messages in the wrapped ether item 2018-05-17 13:04:39 -07:00
fragosti
ec49ca6480 Improve about page descriptions 2018-05-17 13:04:39 -07:00
Alex Browne
a26cc7c14d Merge pull request #597 from 0xProject/make-promises-safe
Use make-promises-safe to catch unhandled rejections in tests
2018-05-17 11:58:31 -07:00
Brandon Millman
c9d3041460 Merge pull request #586 from 0xProject/feature/website/manage-wallet-2
Manage your wallet section of portal
2018-05-17 11:05:58 -07:00
Brandon Millman
943b7d39c6 Fix tslint false positive 2018-05-17 11:02:55 -07:00
Brandon Millman
6b1a911604 Fix spread 2018-05-17 11:02:55 -07:00
Brandon Millman
3d4e03f2cd Refactor account management itmes 2018-05-17 11:02:55 -07:00
Brandon Millman
48b0b54819 Add loading component 2018-05-17 11:02:55 -07:00
Brandon Millman
00515eb6f9 Refactor a bunch of layouts into their own files 2018-05-17 11:02:55 -07:00
Brandon Millman
63e7391981 Add portal layout component 2018-05-17 11:02:55 -07:00
Brandon Millman
b6776f53ab Get rid of extra curly brackets 2018-05-17 11:02:55 -07:00
Brandon Millman
6a0cda7396 Fix lint error 2018-05-17 11:02:55 -07:00
Brandon Millman
09692dc70e Fix comments 2018-05-17 11:02:55 -07:00
Brandon Millman
e0482f5400 Wait for blockchain to display the account management routes 2018-05-17 11:02:55 -07:00
Brandon Millman
c787dc7356 Fix linter errors and relayer index reloading 2018-05-17 11:02:55 -07:00
Brandon Millman
ea948ac2c8 Trade direct route 2018-05-17 11:02:55 -07:00
Brandon Millman
d6e321e97f Add manage you wallet footer 2018-05-17 11:02:55 -07:00
Brandon Millman
807250510a Add props to back button 2018-05-17 11:02:55 -07:00
Brandon Millman
ef1e974346 Back button and title components 2018-05-17 11:02:55 -07:00
Brandon Millman
55d1228abb Implement new menu styling 2018-05-17 11:02:55 -07:00
Brandon Millman
9e76d2ca63 Add menu 2018-05-17 11:02:55 -07:00
Brandon Millman
d53915e7e3 Add routes 2018-05-17 11:02:55 -07:00
Fabio Berger
7fab782907 Improve naming 2018-05-17 14:07:55 +02:00
Fabio Berger
cf7967e629 Disable magic number rule in more places where it isn't helping code readability 2018-05-17 14:07:44 +02:00
Fabio Berger
0eacbac8f6 Merge branch 'development' into improvement/addCustomTslintRules
* development:
  Remove "Order utils" from menu for now
  Fix top tokens key
  Improve about page descriptions
  Do not remove artifacts when running `clean`
2018-05-17 13:57:51 +02:00
Fabio Berger
cec76c33b6 Remove "Order utils" from menu for now 2018-05-17 13:21:37 +02:00
Brandon Millman
18dcf98998 Fix top tokens key 2018-05-16 18:07:47 -07:00
Alex Browne
251218af8b Use make-promises-safe to catch unhandled rejections in tests 2018-05-16 17:36:37 -07:00
Fabio Berger
e2cbe42ed0 Update yarn.lock 2018-05-16 20:44:16 +02:00
fragosti
c06ed58582 Improve about page descriptions 2018-05-16 10:15:04 -07:00
Fabio Berger
78623ae3bd Merge branch 'development' into v2-prototype
* development: (29 commits)
  Do not remove artifacts when running `clean`
  fix style errors
  Fix circular dependency
  Add my profile image to images
  Add myself to about page
  Add dogfood configs to website
  Revert to lerna:run lint
  Do lint sequentially
  Exclude monorepo-scripts from tslint as test
  Fix prettier
  Add hover state to top tokens
  Change to weekly txn volume
  Change minimum Node version to 6.12
  Document Node.js version requirement and add it to package.json
  Apply prettier to some files which were not formatted correctly
  Fix TSLint issues
  Fix TSLint issues
  Update ethereeumjs-testrpc to ganache-cli
  Fix infinite loop
  Add changelog entries for packages where executable binary exporting fixed
  ...

# Conflicts:
#	packages/contracts/package.json
#	packages/contracts/util/formatters.ts
#	packages/contracts/util/signed_order_utils.ts
#	packages/migrations/package.json
#	yarn.lock
2018-05-16 16:18:47 +02:00
Fabio Berger
4de6221825 Do not remove artifacts when running clean 2018-05-16 16:08:15 +02:00
Fabio Berger
136c6d01b3 Do not remove artifacts when running clean 2018-05-16 16:01:37 +02:00
Fabio Berger
22f3f57f44 Merge branch 'development' into improvement/addCustomTslintRules
* development:
  fix style errors
  Fix circular dependency
  Add my profile image to images
  Add myself to about page
  Add dogfood configs to website
  Change minimum Node version to 6.12
  Document Node.js version requirement and add it to package.json
2018-05-16 15:15:23 +02:00
Fabio Berger
b2f362225c Fix comments 2018-05-16 15:14:31 +02:00
Fabio Berger
40ed59ce28 Improve name 2018-05-16 15:14:24 +02:00
Fabio Berger
839db68571 Fix TSLint rules 2018-05-16 14:59:10 +02:00
Fabio Berger
fec6ac3ff0 Enforce new rules, including no-switch-case-fall-through 2018-05-16 14:58:28 +02:00
Fabio Berger
45fa26dc6c Implement boolean variable naming custom TSLint rule 2018-05-16 14:58:01 +02:00
Fabio Berger
f49d432fdc Implement custom no-magic-numbers rule that doesn't include magic numbers passed into BigNumber instantiations (e.g const amount = new BigNumber(5); ) 2018-05-16 14:57:28 +02:00
Fabio Berger
1a31ceff8e Run linter sequentially 2018-05-16 14:56:11 +02:00
Francesco Agosti
cc486cb86d Merge pull request #593 from 0xProject/bug/website/fix-cirular-dependency
Fix circular dependency
2018-05-15 16:35:05 -07:00
Francesco Agosti
7a45a579c0 Merge pull request #592 from 0xProject/feature/website/add-francesco-about
Add myself to about page
2018-05-15 15:59:24 -07:00
fragosti
dc58d539c2 fix style errors 2018-05-15 15:54:17 -07:00
fragosti
2ba78eb740 Fix circular dependency 2018-05-15 15:27:27 -07:00
fragosti
f43b275f16 Add my profile image to images 2018-05-15 14:50:33 -07:00
fragosti
509a81a572 Add myself to about page 2018-05-15 14:44:57 -07:00
Brandon Millman
184232ba4f Add dogfood configs to website 2018-05-15 13:51:43 -07:00
Amir Bandeali
9e0471bfbb Merge branch 'development' into v2-prototype 2018-05-15 15:52:49 -04:00
Alex Browne
0bc338ba42 Merge pull request #578 from 0xProject/document-node-version
Document Node.js version requirement and add it to package.json
2018-05-15 10:51:49 -07:00
Fabio Berger
406e91d387 Merge pull request #588 from 0xProject/improvement/use-wsrun
Individual package building & watching!!! 💪 🌹
2018-05-15 11:41:51 +02:00
Fabio Berger
473acafd14 Revert to lerna:run lint 2018-05-15 11:21:49 +02:00
Fabio Berger
7474e6b1c9 Do lint sequentially 2018-05-15 11:05:02 +02:00
Fabio Berger
323955277c Exclude monorepo-scripts from tslint as test 2018-05-15 10:47:00 +02:00
Fabio Berger
03b5b09122 Fix prettier 2018-05-15 10:43:41 +02:00
Fabio Berger
fe00c06d4b Merge development 2018-05-15 10:22:22 +02:00
Brandon Millman
ca08dd9705 Add hover state to top tokens 2018-05-15 00:52:51 -07:00
Brandon Millman
b3e53b609b Change to weekly txn volume 2018-05-14 22:49:08 -07:00
Alex Browne
fdeab0475c Change minimum Node version to 6.12 2018-05-14 18:46:53 -07:00
Alex Browne
f86cc0dc7a Document Node.js version requirement and add it to package.json 2018-05-14 18:46:52 -07:00
Alex Browne
0457c959dd Merge pull request #590 from 0xProject/fix-prettier
Apply prettier to some files which were not formatted correctly
2018-05-14 18:41:45 -07:00
Alex Browne
c520b7f1fb Apply prettier to some files which were not formatted correctly 2018-05-14 15:44:09 -07:00
Fabio Berger
5422bf5733 Fix TSLint issues 2018-05-14 23:27:41 +02:00
Fabio Berger
a703160226 Merge branch 'development' into improvement/use-wsrun
* development:
  Update ethereeumjs-testrpc to ganache-cli

# Conflicts:
#	package.json
2018-05-14 22:31:53 +02:00
Fabio Berger
d0905eda49 Fix TSLint issues 2018-05-14 21:48:46 +02:00
Leonid Logvinov
da60008048 Update ethereeumjs-testrpc to ganache-cli 2018-05-14 20:16:13 +02:00
Fabio Berger
7c023233f2 Fix infinite loop 2018-05-14 20:02:41 +02:00
Fabio Berger
1e7003a307 Add changelog entries for packages where executable binary exporting fixed 2018-05-14 19:57:41 +02:00
Fabio Berger
8cb074657d Rename bin to server in testnet-faucets since bin is no longer gitignored 2018-05-14 19:33:45 +02:00
Fabio Berger
5f72b86ce4 Fix sra-report binary 2018-05-14 19:33:23 +02:00
Fabio Berger
09d33792f3 rename build:watch to watch and remove build from docs:stage 2018-05-14 19:32:52 +02:00
Fabio Berger
a6773b85d2 Fix sol-compiler binary so it can be called directly from packages 2018-05-14 19:32:32 +02:00
Fabio Berger
5f678acf46 Fix abi-gen binary so it can be called directly from packages 2018-05-14 19:31:56 +02:00
Fabio Berger
76f9ad0705 Remove build from docs:stage commands 2018-05-14 19:24:47 +02:00
Fabio Berger
478f6ed011 Move from using lerna multi-package commands to wsrun, update README's accordingly 2018-05-14 19:23:50 +02:00
Fabio Berger
c94d1b2275 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Add missing type definitions
2018-05-14 11:30:51 +02:00
Fabio Berger
7d60356fac Remove tslint-config as dep to monorepo-scripts to avoid circular dependency. Since monorepo-scripts is only expected to be used from within the monorepo, we reference tslint-config w/ a relative path 2018-05-14 11:30:15 +02:00
Leonid Logvinov
58fa35641d Merge pull request #585 from 0xProject/feature/typedef
Add missing type definitions. Enable typedef linter rule
2018-05-14 10:36:13 +02:00
Leonid Logvinov
b74957acdf Add missing type definitions 2018-05-14 10:35:13 +02:00
Fabio Berger
6aed4fb1ae Merge pull request #579 from 0xProject/breakUp0xjs
Split 0x.js into: contract-wrappers & order-watcher
2018-05-11 19:11:27 +02:00
Fabio Berger
ad8e12eeae Add missing .gitkeeps 2018-05-11 18:54:33 +02:00
Fabio Berger
31763a018c Revert "Remove gitkeeps"
This reverts commit 3f6876c419.
2018-05-11 18:50:50 +02:00
Fabio Berger
bc20f8a004 improve wording 2018-05-11 18:24:07 +02:00
Fabio Berger
3f6876c419 Remove gitkeeps 2018-05-11 17:41:35 +02:00
Fabio Berger
fb9c774558 Create coverage dir if doesn't exist 2018-05-11 17:41:25 +02:00
Fabio Berger
7df9393d29 Add compilerSettings to compiler.json 2018-05-11 16:26:08 +02:00
Fabio Berger
c6439def2c Add deployedBytecode to artifacts since it is needed by sol-cov 2018-05-11 16:25:52 +02:00
Fabio Berger
273d3445e4 Revert throw conditions since it messes with the expected test timing 2018-05-11 16:04:03 +02:00
Fabio Berger
bc3dc52377 Revert back to hack, we need the configured web3Wrapper 2018-05-11 15:40:19 +02:00
Fabio Berger
ef1d484d9e Add comment to TransactionReceiptWithDecodedLogs explaining that it doesn't always return "decodedLogs" 2018-05-11 15:39:15 +02:00
Fabio Berger
63cd5a6296 Get rid of hack 2018-05-11 15:24:31 +02:00
Fabio Berger
657dc785ea Get networkId from web3Wrapper 2018-05-11 15:23:50 +02:00
Fabio Berger
461e74d8be Throw if tx reverts 2018-05-11 15:23:34 +02:00
Fabio Berger
a7daea1728 Remove unused methods and imports 2018-05-11 15:22:57 +02:00
Fabio Berger
c4416f9696 Prettier ignore artifact files 2018-05-11 14:45:50 +02:00
Fabio Berger
f9ad34170d Add compiler dep 2018-05-11 14:25:48 +02:00
Fabio Berger
45f2a8ad06 Update yarn.lock 2018-05-11 13:31:49 +02:00
Fabio Berger
3dad802c90 Fix version 2018-05-11 13:18:13 +02:00
Fabio Berger
735166f06c remove unused modules 2018-05-11 13:15:41 +02:00
Fabio Berger
042df52e5c Fix deps 2018-05-11 13:15:21 +02:00
Fabio Berger
294a65f842 Fix prettier 2018-05-11 13:11:50 +02:00
Fabio Berger
bf8550ae1e Update artifacts 2018-05-11 12:59:14 +02:00
Fabio Berger
91549ef28c Update yarn.lock 2018-05-11 12:58:45 +02:00
Fabio Berger
95956eff64 Update global_hooks 2018-05-11 12:58:34 +02:00
Fabio Berger
bcae71dfa4 Remove legacy test 2018-05-11 12:33:39 +02:00
Fabio Berger
d370296e82 Merge branch 'development' into breakUp0xjs
* development:
  Fix ganache subprovider config
  Fix a bug in compiler config precedence
  Fix linter errors
  Fix templates
  Remove unused deployer docs configs
  Add a legacy endpoint for the deployer
  Add a check for compiler output
  Add a comment
  Put ARTIFACTS_VERSION in a config
  Improve a comment
  Remove _applyDefaultsToDeployTxDataAsync
  Add a HACK comment
  Fix linter issues
  Rename deployer to sol-compiler
  Remove deployer
  Remove deployer from 0x.js and migrations
  Configure migrations with a compiler.json
  Remove deployer from metacoin and contract tests
  Update wallet footer and add remove token functionality

# Conflicts:
#	.gitignore
#	packages/0x.js/package.json
#	packages/0x.js/src/0x.ts
#	packages/contracts/package.json
#	packages/contracts/test/multi_sig_with_time_lock.ts
#	packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts
#	packages/contracts/util/artifacts.ts
#	packages/deployer/test/deployer_test.ts
#	packages/migrations/package.json
2018-05-11 12:32:57 +02:00
Leonid Logvinov
f42f608f3f Merge pull request #574 from 0xProject/feature/rm-rf-deployer
Remove @0xproject/deployer.Deployer. Make contracts able to deploy themselves
2018-05-11 12:12:39 +02:00
Fabio Berger
f78b5741c3 Add missing version directory to path 2018-05-11 12:05:46 +02:00
Fabio Berger
733fe5b335 Add artifacts to clean command 2018-05-11 12:05:32 +02:00
Leonid Logvinov
c093aab350 Fix ganache subprovider config 2018-05-11 11:59:08 +02:00
Brandon Millman
44f17c1706 Merge pull request #580 from 0xProject/feature/website/remove-tokens
Update wallet footer and add remove token functionality
2018-05-10 10:55:17 -07:00
Fabio Berger
8302e1687a Remove unnecessary compile command 2018-05-10 19:03:58 +02:00
Fabio Berger
7ad4380653 Standardize gitignores and remove migrations/artifacts 2018-05-10 19:02:59 +02:00
Fabio Berger
bea185ce8b Commit v1 artifacts to migrations package and remove compile step from prebuild 2018-05-10 19:02:41 +02:00
Fabio Berger
5a73b8a8e6 Replace mkdir with mkdirp so it also created any missing intermediate directories 2018-05-10 18:56:32 +02:00
Fabio Berger
da62a0af3b Fix path to artifacts 2018-05-10 18:55:30 +02:00
Leonid Logvinov
1137abfd33 Fix a bug in compiler config precedence 2018-05-10 18:26:44 +02:00
Leonid Logvinov
e972ed8456 Fix linter errors 2018-05-10 18:12:34 +02:00
Leonid Logvinov
2e1c2d9dfe Fix templates 2018-05-10 17:56:57 +02:00
Fabio Berger
83dd333eba Fix tslint errors 2018-05-10 17:55:27 +02:00
Leonid Logvinov
f854f3ee2b Remove unused deployer docs configs 2018-05-10 17:47:38 +02:00
Leonid Logvinov
1055ca6d44 Add a legacy endpoint for the deployer 2018-05-10 17:47:38 +02:00
Leonid Logvinov
a5fea3b9c3 Add a check for compiler output 2018-05-10 17:47:38 +02:00
Leonid Logvinov
62f1430a2c Add a comment 2018-05-10 17:47:38 +02:00
Leonid Logvinov
1dec6a442e Put ARTIFACTS_VERSION in a config 2018-05-10 17:47:38 +02:00
Leonid Logvinov
97831e3702 Improve a comment 2018-05-10 17:47:38 +02:00
Leonid Logvinov
7eb9444458 Remove _applyDefaultsToDeployTxDataAsync 2018-05-10 17:47:38 +02:00
Leonid Logvinov
ebc296ea31 Add a HACK comment 2018-05-10 17:47:38 +02:00
Leonid Logvinov
75d24dea0e Fix linter issues 2018-05-10 17:47:38 +02:00
Leonid Logvinov
a6f72de09d Rename deployer to sol-compiler 2018-05-10 17:47:38 +02:00
Leonid Logvinov
96037aed52 Remove deployer 2018-05-10 17:46:57 +02:00
Leonid Logvinov
f9d80adaee Remove deployer from 0x.js and migrations 2018-05-10 17:46:57 +02:00
Leonid Logvinov
422e5a19d4 Configure migrations with a compiler.json 2018-05-10 17:46:57 +02:00
Leonid Logvinov
3d58b38e4e Remove deployer from metacoin and contract tests 2018-05-10 17:46:57 +02:00
Fabio Berger
0a044199a1 Add missing DummyToken 2018-05-10 17:29:59 +02:00
Fabio Berger
cd5f00ac4d Merge branch 'development' into breakUp0xjs
* development: (38 commits)
  Add fallback image support to relayer grid tile
  Clear relayer grid state when fetching
  Configure the compiler to generate artifacts with deployedBytecode
  Implement loading and error state for relayer grid
  Fallback image for relayer grid tile
  Change relayer grid tile to link on header
  Display top tokens from backend
  Remove overflowZ property from portal
  Suggestions and fix bad merge
  Fix typo
  Only show untracked tokens
  Make wallet scrollable
  Add token flow
  Update The Ocean logo
  Fix artifacts paths
  Create an artifacts folder
  Introduce a var
  Add removeHexPrefix util method
  CHeck if ABI exists
  Improve the readability of the check for should compile
  ...

# Conflicts:
#	.gitignore
#	packages/contracts/test/multi_sig_with_time_lock.ts
#	packages/contracts/test/multi_sig_with_time_lock_except_remove_auth_addr.ts
#	packages/contracts/util/artifacts.ts
2018-05-10 17:08:07 +02:00
Fabio Berger
23c4027c83 Add missing uuid types 2018-05-10 16:53:12 +02:00
Fabio Berger
eeb08b7fae Fix type error for latched on property 2018-05-10 16:53:03 +02:00
Fabio Berger
20beb2bdb6 Add generated contracts in contract-wrappers to gitignore 2018-05-10 16:52:47 +02:00
Fabio Berger
c6882d0bd8 Rename zeroExContract... to contractWrappers... 2018-05-10 16:51:45 +02:00
Fabio Berger
ce47e83939 Update yarn.lock 2018-05-10 16:41:05 +02:00
Fabio Berger
832e1e2cf7 Add missing quote 2018-05-10 15:26:19 +02:00
Fabio Berger
6d61616492 Add PR number 2018-05-10 15:23:17 +02:00
Fabio Berger
d5304fb5bd Remove provider instance variable 2018-05-10 15:23:04 +02:00
Fabio Berger
13a61db289 Add var returns 2018-05-10 15:22:51 +02:00
Fabio Berger
93b74cc766 Remove unneeded tslint disable 2018-05-10 15:22:33 +02:00
Fabio Berger
28e83c21e2 Remove uneeded tslint config 2018-05-10 15:22:13 +02:00
Fabio Berger
33ed5cd437 Remove generated contract wrappers 2018-05-10 15:21:37 +02:00
Fabio Berger
37c8e21f25 Remove extra tslint config 2018-05-10 15:00:06 +02:00
Fabio Berger
7b726650e9 Improve createOrderWatcherAsync 2018-05-10 14:59:54 +02:00
Fabio Berger
d3adb48c2e Fix no-any-propagation 2018-05-10 14:59:37 +02:00
Fabio Berger
9838124abc Remove unnecessary tslint config 2018-05-10 14:59:10 +02:00
Fabio Berger
4df847c349 Add pr number to changelogs 2018-05-10 14:58:15 +02:00
Jacob Evans
f9d2689a12 Pad to 32 if asset ids are small 2018-05-10 15:59:44 +10:00
Brandon Millman
c64ad1af28 Add fallback image support to relayer grid tile 2018-05-09 17:29:02 -07:00
Brandon Millman
e83b056bd4 Clear relayer grid state when fetching 2018-05-09 15:59:53 -07:00
Brandon Millman
eba6dcc497 Update wallet footer and add remove token functionality 2018-05-09 15:46:18 -07:00
Fabio Berger
017b5a23d8 Fix website and 0x.js docs 2018-05-09 23:26:51 +02:00
Leonid Logvinov
c7a147f49d Configure the compiler to generate artifacts with deployedBytecode 2018-05-09 23:14:44 +02:00
Fabio Berger
f84a466d16 Remove last artifact 2018-05-09 22:15:35 +02:00
Fabio Berger
382a805c7e Remove artifacts 2018-05-09 22:14:19 +02:00
Fabio Berger
0b38e575d6 Fix package.json 2018-05-09 22:08:41 +02:00
Fabio Berger
209266dbed Split 0x.js into contract-wrappers, order-watcher but keep 0x.js as a unifying library with the same interface 2018-05-09 20:36:28 +02:00
Brandon Millman
20f6d8d3d0 Implement loading and error state for relayer grid 2018-05-09 10:57:26 -07:00
Brandon Millman
09b26645ee Fallback image for relayer grid tile 2018-05-09 10:04:28 -07:00
Brandon Millman
9f2258ebd9 Change relayer grid tile to link on header 2018-05-09 09:28:57 -07:00
Amir Bandeali
9744b1906a Merge pull request #546 from 0xProject/feature/contracts/solidity-0.4.23
Use Solidity 0.4.23
2018-05-08 17:20:23 -07:00
Brandon Millman
71e2ee62e4 Merge pull request #576 from 0xProject/feature/website/top-tokens
Display top tokens from backend
2018-05-08 14:30:26 -07:00
Brandon Millman
6c8ee4d55d Merge pull request #557 from 0xProject/feature/website/top-bar-redesign
Redesign top bar for portal v2
2018-05-08 14:29:30 -07:00
Amir Bandeali
5198c56db9 Add revert variables, change lib => libs to get around gitignore 2018-05-08 13:10:09 -07:00
Brandon Millman
f94d4b492d Display top tokens from backend 2018-05-08 11:32:44 -07:00
Brandon Millman
e01a4fcbb4 Merge branch 'development' into feature/website/top-bar-redesign
* development:
  Remove overflowZ property from portal
  Fix typo
  Only show untracked tokens
  Make wallet scrollable
  Add token flow
2018-05-08 11:17:00 -07:00
Brandon Millman
5ed9b8b1dc Remove overflowZ property from portal 2018-05-08 11:16:12 -07:00
Brandon Millman
17f3d5f6ba Suggestions and fix bad merge 2018-05-08 11:12:46 -07:00
Brandon Millman
607d738342 Merge branch 'development' into feature/website/top-bar-redesign
* development: (63 commits)
  Update The Ocean logo
  Fix artifacts paths
  Create an artifacts folder
  Introduce a var
  Add removeHexPrefix util method
  CHeck if ABI exists
  Improve the readability of the check for should compile
  Use named constants
  Add a comment
  Fix comments
  Rename args to constructor-args
  Fix a typo
  Define a separator const
  Move artifacts from src/artifacts to artifacts/v1
  Fix sol-cov to work with the new artifacts format
  Implement new artifacts format
  Publish
  Updated CHANGELOGS
  Make node types a dependency
  Fix type errors in CSS properties
  ...
2018-05-08 11:04:31 -07:00
Brandon Millman
1b102f9ed3 Merge pull request #570 from 0xProject/feature/website/wallet-add-tokens
Portal v2 add tokens flow
2018-05-08 11:01:40 -07:00
Brandon Millman
6c38481550 Fix typo 2018-05-08 10:17:04 -07:00
Brandon Millman
9cbd151658 Only show untracked tokens 2018-05-08 10:16:08 -07:00
Brandon Millman
419b670aa3 Make wallet scrollable 2018-05-08 10:16:08 -07:00
Brandon Millman
a44874d2eb Add token flow 2018-05-08 10:16:08 -07:00
Brandon Millman
e9d70b7b1e Merge pull request #556 from 0xProject/feature/website/portal-v2
Add new top-level portal component with wallet and relayer index layout
2018-05-08 10:14:33 -07:00
Fabio Berger
73c6f11c9c Update The Ocean logo 2018-05-08 10:47:35 +02:00
Amir Bandeali
7e7364fc83 Move Authorizable to AssetProxy dir, rename to MixinAuthorizable 2018-05-07 11:20:53 -07:00
Leonid Logvinov
a9c5488620 Merge pull request #537 from 0xProject/feature/artifacts-v2
Implement the new artifacts format
2018-05-07 14:46:28 +02:00
Leonid Logvinov
906af858a5 Fix artifacts paths 2018-05-07 14:32:17 +02:00
Leonid Logvinov
b699a61f56 Create an artifacts folder 2018-05-07 14:23:24 +02:00
Leonid Logvinov
8eabc49e9d Introduce a var 2018-05-07 14:06:00 +02:00
Leonid Logvinov
9e67e12732 Add removeHexPrefix util method 2018-05-07 14:04:58 +02:00
Leonid Logvinov
2d30183d65 CHeck if ABI exists 2018-05-07 13:57:03 +02:00
Leonid Logvinov
fcb0a05880 Improve the readability of the check for should compile 2018-05-07 13:49:21 +02:00
Leonid Logvinov
fad7dc9f04 Use named constants 2018-05-07 13:46:44 +02:00
Leonid Logvinov
7c1e05d33c Add a comment 2018-05-07 13:42:47 +02:00
Leonid Logvinov
02147f546e Fix comments 2018-05-07 13:41:50 +02:00
Leonid Logvinov
3d51bc1ada Rename args to constructor-args 2018-05-07 13:40:53 +02:00
Leonid Logvinov
95df4433dc Fix a typo 2018-05-07 13:40:05 +02:00
Leonid Logvinov
0f1589a43f Define a separator const 2018-05-07 13:37:21 +02:00
Leonid Logvinov
27262c4e56 Move artifacts from src/artifacts to artifacts/v1 2018-05-07 13:32:24 +02:00
Leonid Logvinov
c9b8f2a397 Fix sol-cov to work with the new artifacts format 2018-05-07 10:52:28 +02:00
Leonid Logvinov
72b2a1c66f Implement new artifacts format 2018-05-07 10:23:08 +02:00
Amir Bandeali
395d060427 Split up mixins and interfaces 2018-05-04 17:10:25 -07:00
Amir Bandeali
bbf088d903 Make LibBytes methods internal, add TestLibBytes 2018-05-04 17:00:24 -07:00
Leonid Logvinov
69a6166b6a Publish
- 0x.js@0.37.2
 - @0xproject/abi-gen@0.2.13
 - @0xproject/assert@0.2.9
 - @0xproject/base-contract@0.3.1
 - @0xproject/connect@0.6.12
 - contracts@2.1.28
 - @0xproject/deployer@0.4.3
 - @0xproject/dev-utils@0.4.1
 - @0xproject/json-schemas@0.7.23
 - @0xproject/metacoin@0.0.6
 - @0xproject/migrations@0.0.5
 - @0xproject/order-utils@0.0.4
 - @0xproject/react-docs-example@0.0.11
 - @0xproject/react-docs@0.0.11
 - @0xproject/react-shared@0.1.6
 - @0xproject/sol-cov@0.0.10
 - @0xproject/sol-resolver@0.0.4
 - @0xproject/sra-report@0.0.14
 - @0xproject/subproviders@0.10.1
 - @0xproject/testnet-faucets@1.0.29
 - @0xproject/types@0.6.3
 - @0xproject/typescript-typings@0.3.1
 - @0xproject/utils@0.6.1
 - @0xproject/web3-wrapper@0.6.3
 - @0xproject/website@0.0.32
2018-05-05 01:55:12 +02:00
Leonid Logvinov
bf87b1a6af Updated CHANGELOGS 2018-05-05 01:55:04 +02:00
Leonid Logvinov
2e8a5602b2 Make node types a dependency 2018-05-05 01:33:35 +02:00
Leonid Logvinov
0ec1c4ad6d Fix type errors in CSS properties 2018-05-05 01:26:02 +02:00
Leonid Logvinov
15a3a8c62f Use a single version of react types 2018-05-05 01:13:22 +02:00
Leonid Logvinov
f001181e39 Revert yarn.lock changes 2018-05-05 01:10:48 +02:00
Leonid Logvinov
2c659d3d82 Publish
- @0xproject/react-docs-example@0.0.10
 - @0xproject/react-docs@0.0.10
 - @0xproject/react-shared@0.1.5
 - @0xproject/website@0.0.31
2018-05-04 23:55:03 +02:00
Leonid Logvinov
5ffff7397e Updated CHANGELOGS 2018-05-04 23:54:57 +02:00
Leonid Logvinov
1a36459ab8 Fix property name 2018-05-04 22:41:39 +02:00
Leonid Logvinov
33cc79c13b Upgrade react types version 2018-05-04 21:17:07 +02:00
Leonid Logvinov
b4cb21b55e Publish
- 0x.js@0.37.1
 - contracts@2.1.27
 - @0xproject/order-utils@0.0.3
 - @0xproject/sra-report@0.0.13
 - @0xproject/testnet-faucets@1.0.28
 - @0xproject/website@0.0.30
2018-05-04 20:44:18 +02:00
Leonid Logvinov
ae68c3abe4 Updated CHANGELOGS 2018-05-04 20:44:12 +02:00
Brandon Millman
939e2c70c4 Add headers to wallet and relayer index 2018-05-04 11:04:58 -07:00
Brandon Millman
14b29172b1 Add scrolling to relayer index 2018-05-04 11:04:58 -07:00
Brandon Millman
58794fc8e9 Lay out wallet and relayers 2018-05-04 11:04:58 -07:00
Leonid Logvinov
91fdd6fc29 Make a negligible change to order-utils to publish a new version 2018-05-04 19:07:02 +02:00
Leonid Logvinov
8dd9124863 Publish
- 0x.js@0.37.0
 - @0xproject/abi-gen@0.2.12
 - @0xproject/assert@0.2.8
 - @0xproject/base-contract@0.3.0
 - @0xproject/connect@0.6.11
 - contracts@2.1.26
 - @0xproject/deployer@0.4.2
 - @0xproject/dev-utils@0.4.0
 - @0xproject/json-schemas@0.7.22
 - @0xproject/metacoin@0.0.5
 - @0xproject/migrations@0.0.4
 - @0xproject/monorepo-scripts@0.1.19
 - @0xproject/order-utils@0.0.2
 - @0xproject/react-docs-example@0.0.9
 - @0xproject/react-docs@0.0.9
 - @0xproject/react-shared@0.1.4
 - @0xproject/sol-cov@0.0.9
 - @0xproject/sol-resolver@0.0.3
 - @0xproject/sra-report@0.0.12
 - @0xproject/subproviders@0.10.0
 - @0xproject/testnet-faucets@1.0.27
 - @0xproject/tslint-config@0.4.17
 - @0xproject/types@0.6.2
 - @0xproject/typescript-typings@0.3.0
 - @0xproject/utils@0.6.0
 - @0xproject/web3-wrapper@0.6.2
 - @0xproject/website@0.0.29
2018-05-04 12:16:17 +02:00
Leonid Logvinov
3fc99dbad5 Updated CHANGELOGS 2018-05-04 12:16:11 +02:00
Leonid Logvinov
01dd84dced Add order utils docs to the menu 2018-05-04 12:09:46 +02:00
Brandon Millman
6b92ef733c Open relayer app when clicking on grid tile 2018-05-03 13:59:08 -07:00
Brandon Millman
fe0f4ae257 Add header images to relayer grid tiles 2018-05-03 13:59:00 -07:00
Fabio Berger
cf9555debc Fix logo left padding on mobile 2018-05-03 12:35:21 +02:00
Fabio Berger
528008b1a9 Add new section to homepage 2018-05-03 12:35:07 +02:00
Brandon Millman
5e3576ed69 Remove id property from WebsiteBackendRelayerInfo 2018-05-02 17:03:59 -07:00
Amir Bandeali
c84be8ddb3 Update contracts with revert reasons and constructor keyword 2018-05-02 15:23:05 -07:00
Amir Bandeali
853b5e1b72 Merge pull request #569 from 0xProject/feature/contracts/batchTransfer
Batch transfers in proxies
2018-05-02 11:32:27 -07:00
Amir Bandeali
3355a39fe0 Add MixinAssetProxy to reuse redundant code 2018-05-02 11:30:26 -07:00
Leonid Logvinov
28ee9e247e Add order-utils to monorepo-scripts 2018-05-02 20:00:06 +03:00
Leonid Logvinov
a054b485d0 Merge pull request #559 from 0xProject/feature/order-utils
Move order utils to @0xproject/order-utils
2018-05-02 19:42:59 +03:00
Leonid Logvinov
3585326d7e Fix signature utils tests 2018-05-02 19:30:32 +03:00
Leonid Logvinov
a6046af024 Stop exporting assertions from order-utils 2018-05-02 18:38:50 +03:00
Leonid Logvinov
adaff92c92 Create wrapper functions so that docs render properly 2018-05-02 16:01:01 +03:00
Leonid Logvinov
0499541e11 Move order utils to @0xproject/order-utils 2018-05-02 15:10:24 +03:00
Brandon Millman
f08738e133 Add Greg and Remco to the about page 2018-05-01 17:11:06 -07:00
Amir Bandeali
0cb357a0e9 Add tests for batchTransferFrom 2018-05-01 13:39:55 -07:00
Amir Bandeali
668dcb7cf0 Add batchTransferFrom to asset proxies 2018-05-01 13:38:41 -07:00
Brandon Millman
1fbdc14734 Merge pull request #550 from 0xProject/feature/website/crypto-compare-prices
Grab wallet price information by token symbol
2018-05-01 10:09:04 -07:00
Jacob Evans
3e683162e9 Merge pull request #568 from 0xProject/bug/0x.js/trade-simulator-trading-zrx
Execute Taker side in trade simulation
2018-05-01 21:55:49 +10:00
Jacob Evans
8e7937bdb6 Update comment to be more descriptive of null address in exchange simulator 2018-05-01 19:06:17 +10:00
Jacob Evans
b36587fac8 Execute taker side in trade simulation
Fill if the taker address is open
2018-05-01 14:43:47 +10:00
Brandon Millman
3a1f9d01e8 Remove WETH special case, website backend handles this now 2018-04-30 16:49:47 -07:00
Amir Bandeali
b5c4b81aac Merge pull request #563 from 0xProject/feature/contracts/proxyIds
Add hard coded proxyId into each AssetProxy
2018-04-30 16:44:38 -07:00
Amir Bandeali
c849c8ef08 Remove outdated comment 2018-04-30 16:40:27 -07:00
Amir Bandeali
bbb3d5bb67 Add hard coded proxyId into each AssetProxy 2018-04-30 16:40:27 -07:00
Brandon Millman
1131d66b3d Hit website backend for price information 2018-04-30 16:40:02 -07:00
Amir Bandeali
63ad2ebf0b Merge pull request #560 from 0xProject/refactor/contracts/structure
Update contracts structure
2018-04-30 09:53:03 -07:00
Brandon Millman
7104ae4752 Merge pull request #564 from 0xProject/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2018-04-30 09:47:33 -07:00
Brandon Millman
2403323463 Style suggestions 2018-04-27 15:05:23 -07:00
Brandon Millman
feb7dfffa1 Move quote currency string into config 2018-04-27 15:05:23 -07:00
Brandon Millman
005e633e2a yarn.lock 2018-04-27 15:05:00 -07:00
Brandon Millman
127fe971e9 Prettier 2018-04-27 14:50:04 -07:00
Brandon Millman
3c4bde6ea1 Create CODE_OF_CONDUCT.md 2018-04-27 14:09:25 -07:00
Brandon Millman
dc19690863 Merge branch 'development' into feature/website/crypto-compare-prices
* development:
  Fix react type versions to avoid minor version bumps with breaking changes
  Update Web3 Provider Engine to 14.0.4
  Remove auto-assignment of everyone to PR's
  Check for Yarn instead of npm
  Add hack comment about the use of sudo
  Fix lazy load component name
  Rename Portal and PortalMenu components to LegacyPortal and LegacyPortalMenu
  Remove unnecessary additional params
  Remove outside declaration
  Capitalize yarn
  Use path for platform independence
  Consolidate github personal access token env to one place: constants.ts
  Use methods moved to utils since now shared by multiple scripts
  Add comment
  Improve comments
  Add checks for the required local setup before running the publish script
  Add descriptions for all commands in monorepo-scripts
  Add removeGitTags script that can be run after a failed Lerna publish
2018-04-26 17:11:01 -07:00
Amir Bandeali
e4f8ea2f7c Move TokenRegistry to 'previous' directory 2018-04-26 11:11:54 -07:00
Amir Bandeali
599d34f1c0 Make all lib functions internal, add contracts for testing 2018-04-26 11:11:54 -07:00
Amir Bandeali
31411dd11b Add LibFillResults 2018-04-26 11:09:53 -07:00
Amir Bandeali
b7781108ae Add ERC721 contracts from zeppelin-solidity 2018-04-26 10:59:27 -07:00
Amir Bandeali
35ca7d1826 Merge pull request #498 from 0xProject/feature/contracts/takerAbstraction
Sender abstraction
2018-04-26 10:59:03 -07:00
Amir Bandeali
9ddec32260 Add tests and comments 2018-04-26 10:56:44 -07:00
Amir Bandeali
185e7d43fb Add tests 2018-04-26 10:33:37 -07:00
Amir Bandeali
0e0a46f373 Update tests and utils 2018-04-26 10:33:37 -07:00
Amir Bandeali
732202fe8e Implement sender abstraction 2018-04-26 10:33:37 -07:00
Jacob Evans
47604384d4 Merge pull request #555 from 0xProject/feature/subproviders/upgrade-provider-engine
Update Web3 Provider Engine to 14.0.4
2018-04-26 15:44:55 +10:00
Fabio Berger
e1cab78c09 Remove remenants of MaliciousToken contract 2018-04-26 10:06:32 +09:00
Fabio Berger
9dc4ec6fb5 Fix prettier 2018-04-25 18:07:22 +09:00
Fabio Berger
c69984e309 Fix react type versions to avoid minor version bumps with breaking changes 2018-04-24 20:06:09 +09:00
Fabio Berger
0baaf1767b Fix merge conflict issues 2018-04-24 20:01:04 +09:00
Fabio Berger
eab76c5819 Fix @types/react version to avoid accidental minor version bumps with breaking changes 2018-04-24 19:54:22 +09:00
Fabio Berger
ebd6f7ace0 Merge pull request #549 from 0xProject/feature/contracts/combineAssetProxyDispatcher
Merge Exchange and AssetProxyDispatcher (depends on #548)
2018-04-24 18:38:11 +09:00
Fabio Berger
a6d5cd4b39 Fix CI failures caused by Webkit css properties not being recognized by React types. This is a hack. 2018-04-24 17:38:25 +09:00
Fabio Berger
4c5a632095 Revert "Fix CI test failure"
This reverts commit 870693b968.
2018-04-24 17:28:18 +09:00
Brandon Millman
b8c611de2b ProviderDisplay changes 2018-04-24 01:11:01 -07:00
Fabio Berger
870693b968 Fix CI test failure 2018-04-24 16:54:08 +09:00
Fabio Berger
b24b98a365 merge v2-prototype 2018-04-24 16:51:32 +09:00
Fabio Berger
fd041e2997 Merge pull request #548 from 0xProject/refactor/contracts/test-cleanup
Cleanup tests
2018-04-24 16:46:40 +09:00
Brandon Millman
9c827a0298 Top bar expanded display type 2018-04-23 23:47:37 -07:00
Brandon Millman
766aeaa9e1 Relayer grid spacing tweaks 2018-04-23 23:47:04 -07:00
Amir Bandeali
27a44f0e77 Rename variables, create private validation methods in token wrappers 2018-04-23 23:23:01 -07:00
Brandon Millman
567768c66a Add headers to wallet and relayer index 2018-04-23 22:17:26 -07:00
Brandon Millman
deaa5f3211 Add scrolling to relayer index 2018-04-23 21:45:05 -07:00
Jacob Evans
5682cd0048 Update Web3 Provider Engine to 14.0.4 2018-04-24 14:33:32 +10:00
Brandon Millman
11f1ccf3ff Lay out wallet and relayers 2018-04-23 21:17:23 -07:00
Fabio Berger
2896110d4d Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Fix lazy load component name
  Rename Portal and PortalMenu components to LegacyPortal and LegacyPortalMenu
2018-04-24 13:01:15 +09:00
Fabio Berger
d05b175e04 Remove auto-assignment of everyone to PR's 2018-04-24 12:53:54 +09:00
Brandon Millman
10a379077c Merge pull request #552 from 0xProject/refactor/website/legacy-portal
Rename Portal component to LegacyPortal
2018-04-23 22:42:07 -04:00
Fabio Berger
ffd9b79100 Check for Yarn instead of npm 2018-04-24 10:43:44 +09:00
Fabio Berger
04c07d9006 Merge pull request #541 from 0xProject/improveMonorepoScripts
Improve Monorepo-scripts
2018-04-24 10:34:40 +09:00
Fabio Berger
a3cc5c1dd7 Add hack comment about the use of sudo 2018-04-24 10:32:44 +09:00
Brandon Millman
941342cc24 Fix lazy load component name 2018-04-23 16:49:53 -07:00
Brandon Millman
cc471dd127 Rename Portal and PortalMenu components to LegacyPortal and LegacyPortalMenu 2018-04-23 14:27:11 -07:00
Amir Bandeali
432b064601 Fix tests 2018-04-23 10:50:09 -07:00
Amir Bandeali
a8a0a5cbfb Combine Exchange with AssetProxyDispatcher 2018-04-23 10:50:09 -07:00
Amir Bandeali
32e77753b5 Define numbers of dummy tokens to deploy in constants 2018-04-23 09:57:13 -07:00
Amir Bandeali
f427a736a3 Remove type assertions 2018-04-23 09:57:13 -07:00
Amir Bandeali
afb02b8bd1 Fix and cleanup tests 2018-04-23 09:57:13 -07:00
Amir Bandeali
48b44342ab Add ERC721 wrapper 2018-04-23 09:57:13 -07:00
Amir Bandeali
1f968fa4fd Add ERC20Wrapper 2018-04-23 09:57:13 -07:00
Amir Bandeali
ebf5077e1a Merge pull request #547 from 0xProject/refactor/contracts/cleanup
Cleanup contracts
2018-04-23 09:56:20 -07:00
Amir Bandeali
7d26b96d42 Rename proxyUtils => assetProxyUtils 2018-04-22 18:53:13 -07:00
Amir Bandeali
08208acf53 Rename missed variables 2018-04-22 14:44:56 -07:00
Brandon Millman
9b535e3cec Rename baseCurrency to quoteCurrency 2018-04-22 14:20:42 -04:00
Brandon Millman
9656895726 Remove some unused imports 2018-04-22 14:17:34 -04:00
Brandon Millman
121b6949a1 Rate limit crypto compare calls 2018-04-22 14:05:03 -04:00
Brandon Millman
fb31c49317 Refactor common fetch logic into fetch_utils 2018-04-22 13:28:13 -04:00
Brandon Millman
e51f9b3593 Grab price information from crypto compare api 2018-04-22 13:10:58 -04:00
Amir Bandeali
46653a0268 Reorder event args 2018-04-21 17:31:17 -07:00
Amir Bandeali
fcef1819b1 Add missing async suffix 2018-04-21 17:31:17 -07:00
Amir Bandeali
3335fc7baf Rename token => asset 2018-04-21 17:31:17 -07:00
Amir Bandeali
63abf34664 Rename Token => IERC20Token 2018-04-21 17:31:17 -07:00
Amir Bandeali
120ca5b1ec Rename DummyToken => DummyERC20Token 2018-04-21 17:31:17 -07:00
Amir Bandeali
1c94ab7cc3 export proxyUtils instead of individual functions 2018-04-21 17:31:17 -07:00
Amir Bandeali
aa3be51980 Fix names and visibilities, use address type over contract type for function args and returns 2018-04-21 17:31:11 -07:00
Amir Bandeali
fe6c77cafb Remove unused constructor arguments 2018-04-21 15:42:09 -07:00
Amir Bandeali
67117913dd Add presigned signature type 2018-04-20 13:57:18 -07:00
Amir Bandeali
e532f2c165 Fix zeppelin imports, run prettier 2018-04-20 13:57:18 -07:00
Greg Hysen
a0c7da95c2 Added tests for (most functions in) LibBytes. The write methods are not currently compatible with our generated contract wrappers. 2018-04-20 13:56:18 -07:00
Greg Hysen
95dbc0f5bc Added description for the DummyERC721Token constructor 2018-04-20 13:56:18 -07:00
Greg Hysen
ab13ce96cc Renamed addAssetProxy back to registerAssetProxy; this seemed to cause less confusion. Also updated the function description. 2018-04-20 13:56:18 -07:00
Greg Hysen
ac0c35424b Reverting earlier change: interfaces now inherit from other interfaces 2018-04-20 13:56:18 -07:00
Greg Hysen
41242a6660 Clarified that 0x0 could be passed into AssetProxyDispatcher 2018-04-20 13:56:18 -07:00
Greg Hysen
e80f203efc Inlined decodeMetadata in the proxies and removed encodeMetadata (already exists in Typescript). This simplifies the code. 2018-04-20 13:56:18 -07:00
Greg Hysen
dbd65cdb04 Added @TODO for safeTransferFrom support in ERC721 proxy 2018-04-20 13:56:18 -07:00
Greg Hysen
e4dd33a675 Removed outdated TODO comment in MixinSettlementProxy 2018-04-20 13:56:18 -07:00
Greg Hysen
0e3544e1f9 Miscellaneous style changes to the contracts package; specifically tests 2018-04-20 13:56:18 -07:00
Greg Hysen
f4589b5bd4 Ran prettier 2018-04-20 13:56:18 -07:00
Greg Hysen
3b7068e8d0 renaming after tokenTransferProxy was removed 2018-04-20 13:56:18 -07:00
Greg Hysen
2a8fc705c7 Commented out 0x.js tests until migration package is ready. 2018-04-20 13:56:18 -07:00
Greg Hysen
c19fb1dffc Removed ERC20 V1 Proxy + TokenTransferProxy 2018-04-20 13:56:18 -07:00
Greg Hysen
436a6605fb Updated commenting. Noted that transferFrom succeeds or throws on all transferFrom implementations. 2018-04-20 13:56:18 -07:00
Greg Hysen
84eddc3d94 switched to constants in default order params. 2018-04-20 13:56:18 -07:00
Greg Hysen
dfe6b2844b Reverted change that allowed ERC721 transfer proxy to be called with amount 0. This now throws. 2018-04-20 13:56:18 -07:00
Greg Hysen
6be5fe928e Removed takerTokenAddress and makerTokenAddress from Order struct. 2018-04-20 13:56:18 -07:00
Greg Hysen
167654c9a0 Added clarity to not-authorized test case in dispatcher 2018-04-20 13:56:18 -07:00
Greg Hysen
6d6179fb2c toUnsigned -> toBuffer in assetProxyUtils 2018-04-20 13:56:18 -07:00
Greg Hysen
80d06d358a Unrolled the loop that copies the Order struct in FillOrderNoThrow. Saves 900 gas 2018-04-20 13:56:18 -07:00
Greg Hysen
1cace49b74 address -> IAssetProxy where possible for clarity 2018-04-20 13:56:18 -07:00
Greg Hysen
7ab5442163 Reverted to calling read/write uint256 2018-04-20 13:56:18 -07:00
Greg Hysen
4d42f64fa3 More testing of common functionality across proxies 2018-04-20 13:56:17 -07:00
Greg Hysen
8d83243378 Updates to proxy tests. 2018-04-20 13:56:17 -07:00
Greg Hysen
e1a74b6bdd More authorized -> owner in test comments 2018-04-20 13:56:17 -07:00
Greg Hysen
44919c353e Removed unnecessary deployments in test 2018-04-20 13:56:17 -07:00
Greg Hysen
cf8523da5f Moved ERC721 FillOrderNoThrow tests into wrapper 2018-04-20 13:56:17 -07:00
Greg Hysen
10707ebc3a Style improvements to the Asset Proxy tests 2018-04-20 13:56:17 -07:00
Greg Hysen
8374a51e6a Replaced instances of accounts[0] with owner in contracts test cases 2018-04-20 13:56:17 -07:00
Greg Hysen
4e48de1116 Minor changes to typescript tests 2018-04-20 13:56:17 -07:00
Greg Hysen
b3b29f527e Minor fixes to the contracts 2018-04-20 13:56:17 -07:00
Greg Hysen
37cfeed0f5 Rearranged preconditions in ERC721 proxy 2018-04-20 13:56:17 -07:00
Greg Hysen
cb27fe17cd Changed order of encode/decode functions in token proxies 2018-04-20 13:56:17 -07:00
Greg Hysen
682ab76ba1 Updated name of AssetProxyChanged -> AssetProxySet 2018-04-20 13:56:17 -07:00
Greg Hysen
c811b710eb Explicity declare memory for complex types, where possible 2018-04-20 13:56:17 -07:00
Greg Hysen
d0930b9048 Improved readability of FillOrderNoThrow II 2018-04-20 13:56:17 -07:00
Greg Hysen
591645758a Improved readability of FillOrderNoThrow 2018-04-20 13:56:17 -07:00
Greg Hysen
4e093369f6 Updated ERC20 v1 proxy names in tests 2018-04-20 13:56:17 -07:00
Greg Hysen
be8e8791b7 Ran prettier/linter on new contract tests 2018-04-20 13:56:17 -07:00
Greg Hysen
b13a2e71ad Added comments around deploying contracts to helper/wrapper tests 2018-04-20 13:56:17 -07:00
Greg Hysen
28678214d2 TS styles in core contract tests 2018-04-20 13:56:17 -07:00
Greg Hysen
f75d03c9ae Added more comments to proxy tests 2018-04-20 13:56:17 -07:00
Greg Hysen
51508a732d Cleaned up TS in dispatcher tests 2018-04-20 13:56:17 -07:00
Greg Hysen
326d8d3976 Proxy Metadata -> Data 2018-04-20 13:56:17 -07:00
Greg Hysen
f559a5510b Cleaning up some wording 2018-04-20 13:56:17 -07:00
Greg Hysen
bf8b123dfc Removed some unused ERC721 tokens 2018-04-20 13:56:17 -07:00
Greg Hysen
32a7442845 Minor style improvements to asset proxy utils 2018-04-20 13:56:17 -07:00
Greg Hysen
a0dfdefd16 ethereum-js for encoding/decoding asset proxy data 2018-04-20 13:56:17 -07:00
Greg Hysen
e7b0c24d9d Added memory to bytes arrays, where possible 2018-04-20 13:56:17 -07:00
Greg Hysen
1707f1940d Replaced read/write Uint256 with generic bytes32, plus casting 2018-04-20 13:56:17 -07:00
Greg Hysen
5dd708aae8 Updated public -> external 2018-04-20 13:56:17 -07:00
Greg Hysen
2477ea2fcf Removed unused dependency 2018-04-20 13:56:17 -07:00
Greg Hysen
9b624a884b snake case to camel case 2018-04-20 13:56:17 -07:00
Greg Hysen
bc7672652e makerAssetProxyData/takerAssetProxyData -> makerAssetData/takerAssetData 2018-04-20 13:56:17 -07:00
Greg Hysen
cc77f8489e nilAddress to ZeroEx.NULL_ADDRESS 2018-04-20 13:56:17 -07:00
Greg Hysen
564ddff4c7 IAssetProxyDispatcher to IAssetProxy in MixinSettlement layer + allowing 0-condition in ERC721 transfer 2018-04-20 13:56:17 -07:00
Greg Hysen
023ea94f07 Removed Log prefix from events 2018-04-20 13:56:17 -07:00
Greg Hysen
adad76eca6 Removed unnecessary assetProxyManagerAddress 2018-04-20 13:56:17 -07:00
Greg Hysen
772bb65237 removed unnecessary import 2018-04-20 13:56:17 -07:00
Greg Hysen
d72a731865 setAssetProxy to addAssetProxy 2018-04-20 13:56:17 -07:00
Greg Hysen
f35fe56d9b Renamed TransferProxy to Proxy 2018-04-20 13:56:17 -07:00
Greg Hysen
1ab70f130d Renaming TransferProxy to Proxy 2018-04-20 13:56:17 -07:00
Greg Hysen
86f79949ea ERC20 V1 proxy compiling 2018-04-20 13:56:17 -07:00
Greg Hysen
219d6c294d Changed order of write parameters in LibBytes. Now ordered by most generalized to most specific 2018-04-20 13:56:17 -07:00
Greg Hysen
78d81f193f Asset Proxy Dispatcher 2018-04-20 13:56:17 -07:00
Fabio Berger
b9e0cd4512 Fix type issue 2018-04-20 13:56:17 -07:00
Fabio Berger
f9d4966000 Fix merge 2018-04-20 13:56:17 -07:00
Amir Bandeali
ad2289935d Use addFillResults function and add comments to all marketFill functions 2018-04-20 13:56:17 -07:00
Amir Bandeali
fd47b3fac5 Fix EtherDelta imports 2018-04-20 13:56:17 -07:00
Amir Bandeali
84d836f22b Add back require statements and tests (will move to another PR) 2018-04-20 13:56:17 -07:00
Amir Bandeali
5d05a2da74 Revert variable naming 2018-04-20 13:56:17 -07:00
Amir Bandeali
2f639b77bb Update Solidity syntax and comments 2018-04-20 13:56:17 -07:00
Amir Bandeali
8b5b371821 Return all amounts traded and fees paid 2018-04-20 13:56:17 -07:00
Amir Bandeali
0c74a3bc66 Add tests for marketBuyOrders 2018-04-20 13:56:17 -07:00
Amir Bandeali
75f77f3e86 Add marketBuyOrders, rename variables, and fx old tests 2018-04-20 13:56:17 -07:00
Amir Bandeali
7a66da5a51 Fix build errors 2018-04-20 13:56:17 -07:00
Amir Bandeali
3541f5e1da Separate filled/cancelled errors 2018-04-20 13:56:17 -07:00
Amir Bandeali
8f809e3a29 Remove partial cancels 2018-04-20 13:56:17 -07:00
Greg Hysen
3f76985435 updated test name to reflect smart contracts 2018-04-20 13:56:17 -07:00
Greg Hysen
751f9b9240 Change from cancelOrdersBefore to cancelOrdersUpTo. The effect is that orders with salt <= to maker epoch will be cancelled (previously, it was salt < maker epoch) 2018-04-20 13:56:17 -07:00
Greg Hysen
1efba5979f Renamed all instances of timestamp to salt. Clarified test case wording. 2018-04-20 13:56:17 -07:00
Greg Hysen
bf3c4f4743 Fixed spacing 2018-04-20 13:56:17 -07:00
Greg Hysen
aeb0742434 Implementation and tests in the protocol for cancelling all orders up to a specific time 2018-04-20 13:56:17 -07:00
Amir Bandeali
e98b4ea26d Fix build errors 2018-04-20 13:56:17 -07:00
Amir Bandeali
1729cfaea9 Update copyright headers 2018-04-20 13:56:17 -07:00
Amir Bandeali
56ade9c44e Add private keys for testrpc mnemonic 2018-04-20 13:56:17 -07:00
Amir Bandeali
6db0b2e398 Address feedback and lint 2018-04-20 13:56:16 -07:00
Amir Bandeali
2bd1ddd129 Add tests for fillOrderNoThrow based functions 2018-04-20 13:56:16 -07:00
Amir Bandeali
20a37bdd1d Fix fillOrderNoThrow 2018-04-20 13:56:16 -07:00
Amir Bandeali
234447cb3d Add logging to testrpc script 2018-04-20 13:56:16 -07:00
Amir Bandeali
97232145a4 Fix package.json 2018-04-20 13:56:16 -07:00
Amir Bandeali
056ec6d2b3 Bump Solidity version to 0.4.21 2018-04-20 13:56:16 -07:00
Amir Bandeali
2c44c7ea83 Add fillOrderNoThrow to exchange wrapper and add test 2018-04-20 13:56:16 -07:00
Amir Bandeali
9cc1956b4b Update formatting 2018-04-20 13:56:16 -07:00
Amir Bandeali
a35138e2b9 Update fillOrderNoThrow 2018-04-20 13:56:16 -07:00
Amir Bandeali
49f6c20b20 Update order utils 2018-04-20 13:56:16 -07:00
Amir Bandeali
6bfc02d79d Modify tests to work with new utils 2018-04-20 13:56:16 -07:00
Amir Bandeali
7b166837d3 Add script for starting testrpc with preconfigured private keys 2018-04-20 13:56:16 -07:00
Amir Bandeali
3ff8a319c5 Add utils for hashing and signing orders, update wrappers 2018-04-20 13:56:16 -07:00
Amir Bandeali
cd8f8e1e4a Modify utils to work with new signature format 2018-04-20 13:56:16 -07:00
Amir Bandeali
ed43d8d08b Change order field names 2018-04-20 13:56:16 -07:00
Amir Bandeali
ca786cdd11 Fix log decoding 2018-04-20 13:56:16 -07:00
Amir Bandeali
3e659f0de8 Revert getOrderHash to old logic 2018-04-20 13:56:16 -07:00
Amir Bandeali
795a357595 Fix compile errors 2018-04-20 13:56:16 -07:00
Remco Bloemen
5737365b2d Update fillOrderNoThrow 2018-04-20 13:56:16 -07:00
Remco Bloemen
8dff54de42 Use ABIv2 exchange core in wrapper functions 2018-04-20 13:56:16 -07:00
Remco Bloemen
c1b8a7fbb7 Implement ABIv2 in ExchangeCore 2018-04-20 13:56:16 -07:00
Remco Bloemen
6f3c6f7599 Implement EIP712 and ABIv2 in LibOrder 2018-04-20 13:56:16 -07:00
Amir Bandeali
246eca91aa Add logDecoder, remove outdated tests 2018-04-20 13:56:16 -07:00
Amir Bandeali
5fd378e4ce Merge development 2018-04-20 13:56:16 -07:00
Amir Bandeali
382f24c556 Run prettier 2018-04-20 13:56:16 -07:00
Amir Bandeali
0773fcf66f Fix utils to work with new ABI 2018-04-20 13:56:16 -07:00
Amir Bandeali
650a24ba87 Add fillOrderNoThrow and wrapper functions 2018-04-20 13:56:16 -07:00
Amir Bandeali
d2be2ee6cd Fix compile errors 2018-04-20 13:56:16 -07:00
Remco Bloemen
7d63c5d982 Fix spelling of latter 2018-04-20 13:56:16 -07:00
Remco Bloemen
a4f294c090 Add offset to signature 2018-04-20 13:56:16 -07:00
Remco Bloemen
58c5e800d0 Document noThrow wrapper and correct fixed array offset 2018-04-20 13:56:16 -07:00
Remco Bloemen
6d7097eed5 Add Trezor signatures 2018-04-20 13:56:16 -07:00
Remco Bloemen
55da59a537 Add Todos 2018-04-20 13:56:16 -07:00
Remco Bloemen
012ee310a4 Fix documentation 2018-04-20 13:56:16 -07:00
Remco Bloemen
1e07fcacac Verify length on EIP712 signatures 2018-04-20 13:56:16 -07:00
Remco Bloemen
69ab913bc6 Remove unused return value 2018-04-20 13:56:16 -07:00
Remco Bloemen
83a63f64b1 Spelling fixes 2018-04-20 13:56:16 -07:00
Remco Bloemen
8f7e67367a Add documentation 2018-04-20 13:56:16 -07:00
Remco Bloemen
0dad3fecb6 Make wrappers external again 2018-04-20 13:56:16 -07:00
Remco Bloemen
09b99bbf8b Explicit returns 2018-04-20 13:56:16 -07:00
Remco Bloemen
92e112dc63 Revert cancel order signature abstraction 2018-04-20 13:56:16 -07:00
Remco Bloemen
6f5a84703e Fix hash argument name 2018-04-20 13:56:16 -07:00
Remco Bloemen
c0de35e71c Fix batchFillOrdersNoThrow name 2018-04-20 13:56:16 -07:00
Remco Bloemen
f7dd6f7a7e Fix input length in fillOrderNoThrow 2018-04-20 13:56:16 -07:00
Remco Bloemen
655c1eb90f Add SignatureType.Invalid and documentation 2018-04-20 13:56:16 -07:00
Remco Bloemen
af6885db81 Make first value illegal 2018-04-20 13:56:16 -07:00
Remco Bloemen
78e216d157 Implement EIP712 at verify-signature call site 2018-04-20 13:56:16 -07:00
Remco Bloemen
61726d84ac Cancel signature abstraction 2018-04-20 13:56:16 -07:00
Remco Bloemen
60d3bed393 Cache order maker signature (ZEIP-15) 2018-04-20 13:56:16 -07:00
Remco Bloemen
3133ca0081 Add EIP712 signatures (implements ZEIP-17) 2018-04-20 13:56:16 -07:00
Remco Bloemen
0f720223a9 Add external contract call signatures (relates to ZEIP 1 and 7) 2018-04-20 13:56:16 -07:00
Remco Bloemen
6bb93b8170 Revert after cascade 2018-04-20 13:56:16 -07:00
Remco Bloemen
d0f32d1865 Add 'caller' signature type 2018-04-20 13:56:16 -07:00
Remco Bloemen
2fe4e380d1 Abstract signature to opaque bytearray 2018-04-20 13:56:16 -07:00
Remco Bloemen
a7f4701698 Use interfaces for contract types 2018-04-20 13:56:16 -07:00
Amir Bandeali
f12e4f8889 Use new logDecoder interface 2018-04-20 13:56:16 -07:00
Amir Bandeali
df99a360fb Rename variables 2018-04-20 13:56:16 -07:00
Amir Bandeali
4c76ad072a Move log decoding logic to exchange wrapper 2018-04-20 13:56:16 -07:00
Amir Bandeali
edf837ed62 Add logDecoder, remove outdated tests 2018-04-20 13:56:16 -07:00
Amir Bandeali
7201a74aea Move utils dir into src 2018-04-20 13:56:16 -07:00
Amir Bandeali
9e2f8bead9 Merge development 2018-04-20 13:56:16 -07:00
Amir Bandeali
942867179c Run prettier 2018-04-20 13:56:16 -07:00
Amir Bandeali
6b897f6fd2 Get tests to build 2018-04-20 13:56:16 -07:00
Amir Bandeali
389f1cde51 Fix utils to work with new ABI 2018-04-20 13:56:16 -07:00
Amir Bandeali
1ad31ab007 Add fillOrderNoThrow and wrapper functions 2018-04-20 13:56:15 -07:00
Remco Bloemen
914db52c4d Move order settlement to MSettlement 2018-04-20 13:56:15 -07:00
Remco Bloemen
fe51ec906e Exchange refactor using mixin pattern 2018-04-20 13:56:15 -07:00
Remco Bloemen
85551f4994 Fix compiler warnings 2018-04-20 13:56:15 -07:00
Remco Bloemen
fc1cfcceca Update exchange to use interfaces and current SafeMath 2018-04-20 13:56:15 -07:00
Remco Bloemen
6b4d4b9246 Copy Exchange and deps to previous as Exchange_v1 2018-04-20 13:56:15 -07:00
Remco Bloemen
b06ba55be3 Add interfaces for Exchange, TokenRegistery and TokenTransferProxy 2018-04-20 13:56:15 -07:00
Amir Bandeali
d08bfbf705 Merge pull request #545 from 0xProject/feature/deployer/solidity-0.4.23
Feature/deployer/solidity 0.4.23
2018-04-20 13:55:49 -07:00
Amir Bandeali
a10e466fed Fix getABIEncodedTransactionData in contract templates 2018-04-20 13:54:33 -07:00
Amir Bandeali
35bb010c35 Add support for solidity 0.4.23 2018-04-20 13:54:28 -07:00
Brandon Millman
0046a0762c Merge pull request #543 from 0xProject/feature/website/integrate-relayer-info
Integrate relayer index with website backend
2018-04-20 15:37:41 -04:00
Brandon Millman
c453012a8e Add specific render path for error and loading 2018-04-20 15:36:40 -04:00
Fabio Berger
1f82c7eadf Remove unnecessary additional params 2018-04-20 10:04:22 +09:00
Fabio Berger
b6fb8dbb52 Remove outside declaration 2018-04-20 10:03:53 +09:00
Fabio Berger
30256cbe51 Capitalize yarn 2018-04-20 10:01:21 +09:00
Fabio Berger
7f46e9af2c Use path for platform independence 2018-04-20 10:00:37 +09:00
Fabio Berger
417cec9e04 Consolidate github personal access token env to one place: constants.ts 2018-04-20 09:36:03 +09:00
Jacob Evans
62a55c0135 Merge pull request #540 from 0xProject/feature/abi-gen/tuple-return-types
Support Tuples returned from functions
2018-04-20 08:49:23 +10:00
Jacob Evans
72336eb393 Remove ethers-contracts types 2018-04-20 08:26:10 +10:00
Brandon Millman
12d8c0b6af Integrate relayer index with website backend 2018-04-19 16:28:35 -04:00
Jacob Evans
5c232b6a8d Update CHANGELOGs 2018-04-19 17:16:05 +10:00
Fabio Berger
f6fd4281a4 Add ImToken to landing page 2018-04-19 15:35:12 +09:00
Jacob Evans
4bee63afc6 Interface for EventDescription renamed topics 2018-04-19 16:28:46 +10:00
Jacob Evans
d186f6148b Use ethers in abi_decoder utils 2018-04-19 15:25:04 +10:00
Fabio Berger
2b15c03b9a Use methods moved to utils since now shared by multiple scripts 2018-04-19 14:19:34 +09:00
Fabio Berger
60d879e045 Add comment 2018-04-19 14:16:11 +09:00
Fabio Berger
858d1768ce Improve comments 2018-04-19 14:14:10 +09:00
Fabio Berger
fc2b7f747b Add checks for the required local setup before running the publish script 2018-04-19 14:10:48 +09:00
Jacob Evans
207019c7f3 Add ethers to web3-wrapper 2018-04-19 14:59:10 +10:00
Jacob Evans
b264bbea84 Update 0x.js package json for ethers 2018-04-19 14:57:14 +10:00
Jacob Evans
32efb3e280 Update ethers in metacoin project 2018-04-19 13:44:14 +10:00
Fabio Berger
1a0d68d49a Add descriptions for all commands in monorepo-scripts 2018-04-19 11:56:41 +09:00
Fabio Berger
7dd3b2d38b Add removeGitTags script that can be run after a failed Lerna publish 2018-04-19 11:40:22 +09:00
Fabio Berger
4bc65faf1a Merge pull request #526 from 0xProject/fix/expiration-watcher
Fix expiration watcher comparator
2018-04-19 11:28:18 +09:00
Brandon Millman
8634551f53 Merge pull request #539 from 0xProject/feature/website/backend-client
Implement backendClient object to unify calls to the portal api
2018-04-18 22:25:03 -04:00
Brandon Millman
089663ccc1 Merge pull request #534 from 0xProject/feature/website/integrate-prices
Add price information to wallet
2018-04-18 22:20:03 -04:00
Fabio Berger
d1d26f8bf6 Merge branch 'development' into fix/expiration-watcher
* development:
  Publish
  Updated CHANGELOGS
  Move @0xproject/migrations to devDependencies
  Publish
  Updated CHANGELOGS
  Make @0xproject/migrations public

# Conflicts:
#	packages/0x.js/CHANGELOG.json
#	packages/0x.js/package.json
2018-04-19 10:38:43 +09:00
Fabio Berger
1ca86730fa Remove hack above migrations package 2018-04-19 10:37:13 +09:00
Jacob Evans
12ae7c009d Support Tuples from function returns 2018-04-19 11:21:32 +10:00
Brandon Millman
51b2fce8c1 Implement backendClient object to unify calls to the portal api 2018-04-18 20:12:38 -04:00
Leonid Logvinov
62fcb51e1a Publish
- 0x.js@0.36.3
 - contracts@2.1.25
 - @0xproject/sra-report@0.0.11
 - @0xproject/testnet-faucets@1.0.26
 - @0xproject/website@0.0.28
2018-04-18 21:30:28 +02:00
Leonid Logvinov
cbc55f2ef8 Updated CHANGELOGS 2018-04-18 21:30:20 +02:00
Leonid Logvinov
679f828e4e Move @0xproject/migrations to devDependencies 2018-04-18 21:18:18 +02:00
Leonid Logvinov
4a8b4e7398 Publish
- 0x.js@0.36.2
 - contracts@2.1.24
 - @0xproject/migrations@0.0.3
 - @0xproject/sra-report@0.0.10
 - @0xproject/testnet-faucets@1.0.25
 - @0xproject/website@0.0.27
2018-04-18 19:57:42 +02:00
Leonid Logvinov
b6a11ca31e Updated CHANGELOGS 2018-04-18 19:57:36 +02:00
Leonid Logvinov
a30ccf2b25 Make @0xproject/migrations public 2018-04-18 19:32:53 +02:00
Leonid Logvinov
2574405699 Fix expiration watcher comparator 2018-04-18 13:45:04 +02:00
Fabio Berger
3ba78553f0 Publish
- 0x.js@0.36.1
 - @0xproject/abi-gen@0.2.11
 - @0xproject/assert@0.2.7
 - @0xproject/base-contract@0.2.1
 - @0xproject/connect@0.6.10
 - contracts@2.1.23
 - @0xproject/deployer@0.4.1
 - @0xproject/dev-utils@0.3.6
 - @0xproject/json-schemas@0.7.21
 - @0xproject/metacoin@0.0.4
 - @0xproject/migrations@0.0.2
 - @0xproject/monorepo-scripts@0.1.18
 - @0xproject/react-docs-example@0.0.8
 - @0xproject/react-docs@0.0.8
 - @0xproject/react-shared@0.1.3
 - @0xproject/sol-cov@0.0.8
 - @0xproject/sol-resolver@0.0.2
 - @0xproject/sra-report@0.0.9
 - @0xproject/subproviders@0.9.0
 - @0xproject/testnet-faucets@1.0.24
 - @0xproject/tslint-config@0.4.16
 - @0xproject/types@0.6.1
 - @0xproject/typescript-typings@0.2.0
 - @0xproject/utils@0.5.2
 - @0xproject/web3-wrapper@0.6.1
 - @0xproject/website@0.0.26
2018-04-18 20:16:29 +09:00
Fabio Berger
4d485fc424 Print out stderr 2018-04-18 20:03:50 +09:00
Fabio Berger
85f28ade86 Updated CHANGELOGS 2018-04-18 18:36:11 +09:00
Fabio Berger
f6f2991a44 Merge pull request #535 from 0xProject/fix/commentRendering
Docs: Fix Type Comment Rendering
2018-04-18 18:19:27 +09:00
Fabio Berger
4ea222bbff Bold property names 2018-04-18 17:55:16 +09:00
Fabio Berger
f9f5e04b41 Update PR template 2018-04-18 15:33:29 +09:00
Fabio Berger
ea6706a2af Improve rendering of type definition comments 2018-04-18 15:28:36 +09:00
Fabio Berger
64c5c5eb40 Fix comments 2018-04-18 15:22:20 +09:00
Jacob Evans
823f2db09f Merge pull request #531 from 0xProject/feature/deployer/solidity-0.4.22
Solidity 0.4.22
2018-04-18 16:21:56 +10:00
Jacob Evans
a71e511f82 Update test fixtures
allow dependency compiler test to run everywhere
2018-04-18 15:46:06 +10:00
Brandon Millman
39c0064ffb Add price information to wallet 2018-04-18 00:30:52 -04:00
Jacob Evans
12d5c35d14 Merge pull request #532 from 0xProject/bug/0x.js/fix-formatting-and-linting
Fix linter and prettier on development
2018-04-18 14:06:49 +10:00
Jacob Evans
1a161cc02e Fix linter and prettier 2018-04-18 11:24:59 +10:00
Jacob Evans
96f19ba8da Remove prettier change on package.json 2018-04-18 11:20:49 +10:00
Fabio Berger
a63dfb7995 Merge pull request #527 from avonian/redundant_order_removal_bug
Fix redundant expired order removal bug
2018-04-18 09:31:34 +09:00
Jacob Evans
97ea1e300a Update changelog with PR 2018-04-18 10:09:27 +10:00
Jacob Evans
d87d93dfac Update deployer and contracts repo to use solidity 0.4.22 2018-04-18 10:06:13 +10:00
Ara Kevonian
3ffcb03d87 Update CHANGELOG 2018-04-17 08:03:07 -07:00
Ara Kevonian
33b08b90a3 Revert removeOrder flag in favor of noop 2018-04-17 07:42:43 -07:00
Ara Kevonian
cbca2061f7 Fix redundant expired order removal bug 2018-04-17 07:25:13 -07:00
Fabio Berger
bf4873e519 Merge pull request #510 from avonian/development
Implement `zeroEx.exchange.getOrderStateAsync`
2018-04-17 23:09:05 +09:00
Ara Kevonian
8fc1b38ff2 Use this.defaultBlock in OrderFilledCancelledLazyStore 2018-04-17 06:51:26 -07:00
Ara Kevonian
7d957538b4 Add stateLayer param to getOrderState and clean up variable names 2018-04-17 06:47:36 -07:00
Fabio Berger
7a8edb5018 Reduce wiki article padding on mobile and remove commented out code 2018-04-17 22:03:16 +09:00
Jacob Evans
2193d9ae6e Merge pull request #524 from 0xProject/feature/0x.js/remove-hd-wallet-from-test
Remove truffle-hdwallet from 0x.js tests
2018-04-17 15:06:57 +10:00
Jacob Evans
79d01fe2d7 Merge branch 'development' into feature/0x.js/remove-hd-wallet-from-test 2018-04-17 13:47:57 +10:00
Jacob Evans
0d02037a12 Change changelog note as it has no public impact 2018-04-17 13:41:45 +10:00
Leonid Logvinov
d263f7783f Merge pull request #512 from 0xProject/feature/resolver
Dependencies resolver for deployer
2018-04-16 20:47:28 +02:00
Leonid Logvinov
d8ef76fd5e Rename resolver to sol-resolver 2018-04-16 17:43:59 +02:00
Jacob Evans
bc3c7a30c4 Prettier on CHANGELOG.json 2018-04-14 13:33:06 +10:00
Jacob Evans
7b318b3cc2 Update the Changelog with pr number 2018-04-14 13:15:22 +10:00
Leonid Logvinov
e5cf41b313 Uncomment tests 2018-04-13 13:27:52 +02:00
Leonid Logvinov
74012ad584 Rename getAllContracts to getAll 2018-04-13 13:20:54 +02:00
Leonid Logvinov
06b4f007f8 Introduce packagePath 2018-04-13 13:18:59 +02:00
Leonid Logvinov
a9cf425410 Remove artifacts 2018-04-13 13:17:40 +02:00
Ara Kevonian
5355da6cad Rename BalanceAndAllowanceFetchers to BalanceAndProxyAllowanceFetchers 2018-04-13 03:17:09 -07:00
Ara Kevonian
38f7c4a0d2 Implement Simple Fetchers 2018-04-13 03:04:51 -07:00
Fabio Berger
1fcf3c5dc4 Add SignedOrder type to 0x Connect docs 2018-04-13 14:10:03 +09:00
Fabio Berger
20b0afacf5 Standardize external type links 2018-04-13 14:05:57 +09:00
Fabio Berger
6dbe8dbc50 Fix calendar text color to it shows up 2018-04-13 13:38:52 +09:00
Jacob Evans
73e23996a6 Remove truffle-hdwallet from 0x.js tests 2018-04-13 13:16:30 +10:00
Fabio Berger
e40bce253c Add /jobs endpoint to website, link to it and have it re-direct to Angellist 2018-04-13 11:14:01 +09:00
Fabio Berger
74c279ea3a Remove unneeded template strings 2018-04-13 11:13:21 +09:00
Fabio Berger
6c13b792f9 Remove legacy export 2018-04-13 10:21:33 +09:00
Leonid Logvinov
6be7466c4a Fix tests 2018-04-12 14:47:03 +02:00
Leonid Logvinov
1dbdd7ee1f Merge pull request #523 from ritave/patch-1
Remove Greenkeeper from README
2018-04-12 13:20:13 +02:00
Leonid Logvinov
eb89926cee Implement the resolver 2018-04-12 12:52:48 +02:00
Leonid Logvinov
7923ff4ac6 Use solc.compileStandardWrapper 2018-04-12 12:52:21 +02:00
Leonid Logvinov
783314c037 Improve on readability 2018-04-12 12:52:21 +02:00
Leonid Logvinov
15cf64318c Update CHANGELOG's 2018-04-12 12:52:21 +02:00
Leonid Logvinov
442017f93a Use solc.compileStandardWrapper 2018-04-12 12:51:15 +02:00
Leonid Logvinov
4dd9f29769 Add ony abi-gen changes from Greg's PR 2018-04-12 12:50:52 +02:00
Leonid Logvinov
f2f9bd2e7a Revert "Merge pull request #493 from hysz/features/deployer/multipleCodebaseSupport"
This reverts commit 70d403e6f8, reversing
changes made to 073bf738dd.
2018-04-12 12:50:38 +02:00
Olaf Tomalka
d95b8ef3e1 Remove Greenkeeper from README
Greenkeeper doesn't support Monorepos as of yet
2018-04-12 10:51:58 +02:00
Jacob Evans
ed0c64fdcf Merge pull request #507 from 0xProject/feature/subproviders/mnemonic-wallet-subprovider
Mnemonic wallet subprovider and multiple accounts in ledger
2018-04-12 17:35:32 +10:00
Jacob Evans
9a91e39b3f Revert Ledger back to assigning ledgerClient to instance variable 2018-04-12 17:26:17 +10:00
Jacob Evans
ce3f25d48f Rename to parentDerivedKeyInfo to be explicity about how we walk the tree 2018-04-12 17:10:17 +10:00
Jacob Evans
b669508c34 Pluck key off of base path branch for Mnemonic
This reduces the tree walk complexity in wallet utils as it is assumed that we always walk relative. It also removes a HACK :)
2018-04-12 16:59:57 +10:00
Fabio Berger
364d8824af Fix web3-wrapper version 2018-04-12 09:29:58 +09:00
Fabio Berger
749354b1c0 Merge pull request #520 from 0xProject/fix/installation-tests
Fix the publishing/installation test issues
2018-04-12 09:26:42 +09:00
Jacob Evans
be73084e04 Merge branch 'development' into feature/subproviders/mnemonic-wallet-subprovider 2018-04-12 10:20:52 +10:00
Fabio Berger
5eb90697c8 Merge pull request #519 from 0xProject/fix/docImprovements
Doc fixes and improvements
2018-04-12 08:56:33 +09:00
Fabio Berger
faedd2fa0b Merge branch 'development' into fix/docImprovements
* development: (31 commits)
  Prettier ignore Metacoin artifacts
  Publish
  Updated CHANGELOGS
  Improve deployer error message
  Fix 0x.js tests
  Fix lint issue
  Simply export
  Move NULL_BYTES to @0xproject/utils
  Simplify the tests
  Fix lint error
  Add step to publishing that upload staging doc jsons, deploys staging website, opens every docs page and asks the dev to confirm that each one renders properly before publishing
  Fix web3Wrapper build command
  Add top-level `yarn lerna:stage_docs` to upload docJsons to the staging S3 bucket for all packages with a docs page
  Refactor publish script to have it's main execution body be lean and discrete steps
  Removed unused command
  Remove 0x.js test artifacts
  Fix tslint
  Move migrations into separate monorepo subpackage and hook it up to 0x.js and contracts
  Remove unused var
  Refactor RedundantRpcSubprovider into RedundantSubprovider
  ...

# Conflicts:
#	packages/react-docs/CHANGELOG.json
2018-04-12 08:56:13 +09:00
Fabio Berger
c47fb8f9a8 Merge pull request #500 from 0xProject/removeMigrateStep
Run all tests against in-process Ganache
2018-04-12 08:53:32 +09:00
Fabio Berger
27b915789e Merge branch 'development' into removeMigrateStep
* development:
  Publish
  Updated CHANGELOGS

# Conflicts:
#	packages/0x.js/package.json
#	packages/deployer/package.json
#	packages/utils/CHANGELOG.json
2018-04-12 08:53:12 +09:00
Fabio Berger
ddc6dca98c Prettier ignore Metacoin artifacts 2018-04-12 08:42:02 +09:00
Leonid Logvinov
72aa3d3005 Fix some of the publishing/installation issues 2018-04-11 18:39:58 +02:00
Leonid Logvinov
e8d4f6d532 Publish
- 0x.js@0.36.0
 - @0xproject/abi-gen@0.2.10
 - @0xproject/assert@0.2.6
 - @0xproject/base-contract@0.2.0
 - @0xproject/connect@0.6.9
 - contracts@2.1.22
 - @0xproject/deployer@0.4.0
 - @0xproject/dev-utils@0.3.5
 - @0xproject/json-schemas@0.7.20
 - @0xproject/metacoin@0.0.3
 - @0xproject/monorepo-scripts@0.1.17
 - @0xproject/react-docs-example@0.0.7
 - @0xproject/react-docs@0.0.7
 - @0xproject/react-shared@0.1.2
 - @0xproject/sol-cov@0.0.7
 - @0xproject/sra-report@0.0.8
 - @0xproject/subproviders@0.8.5
 - @0xproject/testnet-faucets@1.0.23
 - @0xproject/tslint-config@0.4.15
 - @0xproject/types@0.6.0
 - @0xproject/typescript-typings@0.1.0
 - @0xproject/utils@0.5.1
 - @0xproject/web3-wrapper@0.6.0
 - @0xproject/website@0.0.25
2018-04-11 18:00:46 +02:00
Leonid Logvinov
631e7e9c58 Updated CHANGELOGS 2018-04-11 18:00:39 +02:00
Fabio Berger
3c84ce2050 Improve deployer error message 2018-04-11 22:37:39 +09:00
Fabio Berger
9db1ce7ceb Fix 0x.js tests 2018-04-11 22:37:23 +09:00
Fabio Berger
e472f7899f Fix lint issue 2018-04-11 22:04:26 +09:00
Fabio Berger
b053781453 Simply export 2018-04-11 22:01:00 +09:00
Fabio Berger
f892b7dbf6 Move NULL_BYTES to @0xproject/utils 2018-04-11 22:00:54 +09:00
Fabio Berger
b146acc69e Simplify the tests 2018-04-11 21:59:30 +09:00
Jacob Evans
63b941fbaf Update documentation and add to website docs 2018-04-11 20:59:17 +10:00
Fabio Berger
29dc22e208 Merge branch 'development' into removeMigrateStep
* development:
  Fix lint error
  Fix documentation links in some READMEs
  Fix relative link
  Add step to publishing that upload staging doc jsons, deploys staging website, opens every docs page and asks the dev to confirm that each one renders properly before publishing
  Fix web3Wrapper build command
  Add top-level `yarn lerna:stage_docs` to upload docJsons to the staging S3 bucket for all packages with a docs page
  Added a detailed description of `renameOverloadedMethods` (special thanks to @fabioberger). Updated Javascript styles in the Abi-Gen and Utils packages, around support for function overloading.
  Updated deployer to accept a list of contract directories as input. Contract directories are namespaced to a void clashes. Also in this commit is a fix for overloading contract functions.
  Refactor publish script to have it's main execution body be lean and discrete steps

# Conflicts:
#	packages/contracts/package.json
#	packages/deployer/package.json
2018-04-11 19:00:30 +09:00
Fabio Berger
c44f9e56ad Merge pull request #514 from 0xProject/publishImprovements
Add Doc Page Check To Publish Flow
2018-04-11 18:55:59 +09:00
Fabio Berger
2fe209d5ff Fix lint error 2018-04-11 18:55:42 +09:00
Fabio Berger
41bd0e30d6 Add comment about Provider type 2018-04-11 18:43:58 +09:00
Fabio Berger
40f4dd91e9 Update CHANGELOG 2018-04-11 18:33:01 +09:00
Fabio Berger
5bf43a3560 Merge branch 'development' into fix/docImprovements
* development:
  Fix documentation links in some READMEs
  Fix relative link

# Conflicts:
#	packages/0x.js/README.md
#	packages/web3-wrapper/README.md
2018-04-11 18:17:35 +09:00
Fabio Berger
f0afc0ae45 Update 0x.js and web3-wrapper doc urls so that last segment is identical to package name. Keep legacy endpoints. 2018-04-11 18:14:22 +09:00
Jacob Evans
916b4d3a26 Renamed DerivedHDKey to DerivedHDKeyInfo
Added assertions on addresses for public methods
Throw a helpful error message when signer address is not instantiated address in PrivateKeyWalletSubprovider
Update changelog and rename derivationBasePath to baseDerivationPath
When returning undefined use pattern of IfExists
Added configuration object for MnemonicWallet
Put constants back into each individual wallet rather than in walletUtils
Delete accidental package-lock.json
2018-04-11 19:08:28 +10:00
Fabio Berger
6d1a587c5c Show staging docs on development and staging 2018-04-11 18:04:02 +09:00
Fabio Berger
bce97c2543 Add support for displaying default param values 2018-04-11 17:39:30 +09:00
Fabio Berger
34446cf569 Fix sol-cov, web3-wrapper, subproviders documentation pages given recent changes to the libraries 2018-04-11 17:36:41 +09:00
Fabio Berger
1e13e927d0 Add missing space in property declaration 2018-04-11 17:36:01 +09:00
Fabio Berger
3c0fa0b7e6 Fix 0x.js docs now that many types are no longer references through the Web3 typings 2018-04-11 17:05:35 +09:00
Fabio Berger
ad894fbdbb Add missing types to 0x.js docs 2018-04-11 16:53:30 +09:00
Fabio Berger
7d9c6eafbf Add support for nested methods within type declarations. Make sure they render without a callPath. 2018-04-11 16:53:13 +09:00
Fabio Berger
de6f757ec8 Introduce type JSONRpcErrorCallback 2018-04-11 16:48:56 +09:00
Fabio Berger
3eeb8f4d6d Small fix to README 2018-04-11 16:22:10 +09:00
Jacob Evans
f44ef7ce59 Update website to support latest ledger 2018-04-11 15:12:02 +10:00
Jacob Evans
b08c616713 Move type declaration for hdkey to typescript-typings 2018-04-11 14:53:58 +10:00
Jacob Evans
3ad693d334 Test valid address format but not found 2018-04-11 14:39:55 +10:00
Brandon Millman
7d8badc86e Fix documentation links in some READMEs 2018-04-10 21:24:17 -07:00
Brandon Millman
854d65b51b Merge pull request #517 from lgedeon/development
Fix relative link
2018-04-10 21:21:31 -07:00
Jacob Evans
4aa67e2925 Update JSDoc for methods in ledger and mnemonic wallet 2018-04-11 14:12:38 +10:00
Jacob Evans
260ab2d413 Update changelog and add derivationBasePath 2018-04-11 14:04:27 +10:00
Jacob Evans
a824957de7 Follow file naming pattern for mnemonic and private key subprovider 2018-04-11 13:46:01 +10:00
Jacob Evans
4017c172a2 Iterator pattern for walking derived keys 2018-04-11 13:44:08 +10:00
Jacob Evans
65b2c936ab Tests for signed transactions and multiple accounts 2018-04-11 12:56:52 +10:00
Jacob Evans
eee190826a Test signed messages with the second account 2018-04-11 12:51:57 +10:00
Jacob Evans
20a1deb187 Throw errors when the address is not specified or invalid 2018-04-11 12:47:17 +10:00
Jacob Evans
9169913a2c Add isChildKey to derived key 2018-04-11 12:22:41 +10:00
Luke Gedeon
df773d07f3 Fix relative link
0xproject.com/docs/json-schemas  -->  https://0xproject.com/docs/json-schemas
2018-04-10 21:29:16 -04:00
Ara Kevonian
bf0ef055fb Modify lazy stores to implement abstract fetcher classes 2018-04-10 03:46:43 -07:00
Jacob Evans
4e4842a62f Improve Documentation for functions and constructors 2018-04-10 16:01:34 +10:00
Jacob Evans
a34c9095c3 Rename to IS_CHILD_KEY 2018-04-10 15:51:09 +10:00
Fabio Berger
efdbc1ff6c Add step to publishing that upload staging doc jsons, deploys staging website, opens every docs page and asks the dev to confirm that each one renders properly before publishing 2018-04-10 14:49:13 +09:00
Jacob Evans
84a4b7d1c1 Refactor ledger to support multiple accounts with from address 2018-04-10 14:39:43 +10:00
Fabio Berger
a9b5faa787 Fix web3Wrapper build command 2018-04-10 12:04:51 +09:00
Fabio Berger
49a54c0ff6 Add top-level yarn lerna:stage_docs to upload docJsons to the staging S3 bucket for all packages with a docs page 2018-04-10 12:04:11 +09:00
Amir Bandeali
70d403e6f8 Merge pull request #493 from hysz/features/deployer/multipleCodebaseSupport
Deployer: Support for External Codebases + Overloaded Function Names
2018-04-09 20:02:55 -07:00
Greg Hysen
eecf09f515 Added a detailed description of renameOverloadedMethods (special thanks to @fabioberger). Updated Javascript styles in the Abi-Gen and Utils packages, around support for function overloading. 2018-04-09 19:25:07 -07:00
Jacob Evans
5b69cd4a22 Added walletUtils and address in signMessage 2018-04-10 11:58:12 +10:00
Greg Hysen
61fc3346c2 Updated deployer to accept a list of contract directories as input. Contract directories are namespaced to a void clashes. Also in this commit is a fix for overloading contract functions. 2018-04-09 17:22:58 -07:00
Ara Kevonian
c80b42712a Lint/Prettify 2018-04-09 07:05:46 -07:00
Ara Kevonian
8d76d74a17 Implement zeroEx.exchange.getOrderStateAsync 2018-04-09 04:49:05 -07:00
Fabio Berger
b7e98abc43 Refactor publish script to have it's main execution body be lean and discrete steps 2018-04-09 19:11:18 +09:00
Fabio Berger
6f72fed8b5 Removed unused command 2018-04-09 17:23:27 +09:00
Fabio Berger
27575e9866 Remove 0x.js test artifacts 2018-04-09 17:17:05 +09:00
Fabio Berger
986ba175ce Fix tslint 2018-04-09 17:14:32 +09:00
Fabio Berger
919b327fc5 Move migrations into separate monorepo subpackage and hook it up to 0x.js and contracts 2018-04-09 17:14:25 +09:00
Fabio Berger
e05b55d4a5 merge development 2018-04-09 14:34:36 +09:00
Fabio Berger
073bf738dd Since we moved Web3Wrapper class from index to it's own file, we need to update doc mapping 2018-04-07 10:41:43 +09:00
Fabio Berger
68e8d6f304 Update ERCDex logo 2018-04-07 10:24:47 +09:00
Fabio Berger
6f24337a53 Remove unused var 2018-04-07 10:17:53 +09:00
Jacob Evans
0e8f5004d6 Add Mnemonic wallet subprovider 2018-04-06 19:03:35 +10:00
Jacob Evans
524e4707d2 Merge pull request #506 from 0xProject/feature/subproviders/pk-wallet-subprovider
Private Key subprovider
2018-04-06 16:52:44 +10:00
Fabio Berger
22fa5a57a5 Refactor RedundantRpcSubprovider into RedundantSubprovider 2018-04-06 15:46:27 +09:00
Fabio Berger
e30c76b743 Make all handleRequest methods async, rename _engine to engine to remain compliant with web3-provider-engine 2018-04-06 15:41:42 +09:00
Jacob Evans
a0fac663f7 Update shared fixture data for network 42 2018-04-06 16:07:00 +10:00
Fabio Berger
277e58c2e5 Merge pull request #505 from 0xProject/fix/readmeContributingSection
Improve README contributing sections in all packages
2018-04-06 15:05:34 +09:00
Fabio Berger
75a51af006 Use provider over web3 in deployer, dev-utils and subprovider tests, rename subprovider to ganacheSubprovider in test util 2018-04-06 15:04:17 +09:00
Fabio Berger
24454938e5 Move away from using web3 directly in 0x.js tests 2018-04-06 15:03:14 +09:00
Jacob Evans
774ab8a8ef Feedback
remove id management from testnet faucet
spread over txParams rather than modify in place
2018-04-06 15:21:08 +10:00
Brandon Millman
21dc94b709 Merge pull request #503 from 0xProject/feature/website/relayer-grid
Implement initial relayer grid
2018-04-05 12:15:16 -07:00
Brandon Millman
d6176872f7 Merge pull request #504 from 0xProject/fix/website/wallet-key-warning
Fix missing key warnings in wallet component
2018-04-05 12:14:43 -07:00
Brandon Millman
c396be42b9 Change undefined to null 2018-04-05 12:13:55 -07:00
Fabio Berger
89a72ebf0d Merge branch 'development' into removeMigrateStep
* development:
  Fix tests
  Call static functions as static
  Address feedback
  Move our contract templates to accept Provider instead of Web3Wrapper
2018-04-05 21:06:58 +09:00
Leonid Logvinov
7f7ddee0f9 Merge pull request #501 from 0xProject/feature/provider-over-wrapper
Use Provider over web3Wrapper
2018-04-05 13:52:43 +02:00
Leonid Logvinov
b99c797945 Fix tests 2018-04-05 13:52:19 +02:00
Leonid Logvinov
59edca4166 Call static functions as static 2018-04-05 13:06:16 +02:00
Leonid Logvinov
fbba5e054a Address feedback 2018-04-05 12:37:35 +02:00
Jacob Evans
ea47613d90 Use PKWalletSubprovider in testnet faucet 2018-04-05 15:33:04 +10:00
Jacob Evans
9d18f751c8 Create a private key subprovider 2018-04-05 15:18:38 +10:00
Fabio Berger
9745dfe2f4 Use depcheck async support 2018-04-05 11:43:48 +09:00
Fabio Berger
29d38593d6 Fix contributing links 2018-04-05 10:01:41 +09:00
Fabio Berger
d76bc18bb7 Improve contributing section of all packages so they include building entire monorepo on first contribution 2018-04-05 09:57:21 +09:00
Brandon Millman
cbe61ac315 Fix missing key warnings in wallet component 2018-04-04 13:35:08 -07:00
Brandon Millman
250d97a7c4 Implement initial relayer grid 2018-04-04 12:09:03 -07:00
Leonid Logvinov
249bf0163d Move our contract templates to accept Provider instead of Web3Wrapper 2018-04-04 11:56:32 +03:00
Fabio Berger
20aaab0847 Add --exit to all mocha calls so they exit when called from top-level yarn command (https://github.com/mochajs/mocha/issues/3044) 2018-04-04 16:34:23 +09:00
Fabio Berger
3e648cfb7e Move migrations over from contracts to 0x.js 2018-04-04 16:33:18 +09:00
Fabio Berger
2106d7476d Add contract artifacts to 0x.js tests 2018-04-04 16:32:32 +09:00
Fabio Berger
43e07e7ce3 Update 0x.js to run tests against in-process ganache 2018-04-04 16:31:57 +09:00
Fabio Berger
5e4e27fed5 Update dev-utils and subproviders tests to use ganache in-process provider 2018-04-04 11:35:58 +09:00
Fabio Berger
6c02722f56 Make deployer tests run on inprocess ganache 2018-04-04 09:50:24 +09:00
Fabio Berger
5cfebd2680 Fix typos 2018-04-04 09:48:54 +09:00
Fabio Berger
bd20b1747d Add top-level test command 2018-04-04 09:48:36 +09:00
Fabio Berger
674e56cea6 Merge pull request #496 from 0xProject/removeUnusedDeps
Remove unused deps + Remove Dharma from website
2018-04-04 03:58:18 +09:00
Fabio Berger
61809130a6 Merge branch 'development' into removeUnusedDeps
* development:
  Temporarily remove installation test
  Fix package.json
  Remove `isPublished` from all CHANGELOG.json filesx
  Now that every version of a package published has a corresponding entry in it's CHANGELOG we no longer need the isPublished flag. Remove it.
  Remove temporary convert_changelog script

# Conflicts:
#	packages/monorepo-scripts/package.json
2018-04-04 03:57:42 +09:00
Fabio Berger
f5e6e0eaf7 Used generic declaration to remove need for any 2018-04-04 03:56:17 +09:00
Fabio Berger
b2c423dd84 Use Results type 2018-04-04 03:54:58 +09:00
Fabio Berger
4a9752d7cd Merge pull request #495 from 0xProject/fix/publishProcess
Improve Publish Flow
2018-04-04 03:14:36 +09:00
Leonid Logvinov
7db9a01639 Temporarily remove installation test 2018-04-03 12:50:23 +03:00
Fabio Berger
e9cb5c069a Add comment about ignored packages 2018-04-03 15:44:07 +09:00
Fabio Berger
03e4205700 Remove Dharma integration from Website 2018-04-03 15:39:43 +09:00
Fabio Berger
fd9278ac02 Add find_unused_deps monorepo script 2018-04-03 15:28:07 +09:00
Fabio Berger
1b7c7037b8 Remove remaining unused deps 2018-04-03 15:27:45 +09:00
Fabio Berger
913264c811 Update yarn.lock 2018-04-03 14:54:30 +09:00
Fabio Berger
e70b6630f9 Fix TS error 2018-04-03 14:52:31 +09:00
Fabio Berger
6d53947fd8 Add missing request types 2018-04-03 14:48:05 +09:00
Fabio Berger
1c0d982398 Fix yarn 2018-04-03 13:00:40 +09:00
Fabio Berger
a88b4040ff Stop using utils 2018-04-03 12:58:45 +09:00
Fabio Berger
e8073cd6f2 Update yarn.lock 2018-04-03 12:04:08 +09:00
Fabio Berger
8281be235c Use @0xproject/utils promisify everywhere 2018-04-03 12:03:59 +09:00
Fabio Berger
9ce03e3515 Update tslint-config. To avoid circular deps, this must always be one version back and must be manually updated. 2018-04-03 12:03:10 +09:00
Fabio Berger
667938696d Remove unused contracts deps 2018-04-03 11:43:23 +09:00
Fabio Berger
a165281dcf Remove unused 0x.js deps 2018-04-03 11:43:08 +09:00
Fabio Berger
185f70f2dd Fix package.json 2018-04-03 10:04:16 +09:00
Fabio Berger
cd3e14f45a Remove isPublished from all CHANGELOG.json filesx 2018-04-03 09:45:59 +09:00
Fabio Berger
dd87588dfe Now that every version of a package published has a corresponding entry in it's CHANGELOG we no longer need the isPublished flag. Remove it. 2018-04-03 09:45:30 +09:00
Fabio Berger
29042e1939 Remove temporary convert_changelog script 2018-04-03 09:36:43 +09:00
Leonid Logvinov
4dbf6559aa After publish 2018-04-02 16:12:37 +03:00
Leonid Logvinov
b987b5988d Publish
- 0x.js@0.35.0
 - @0xproject/abi-gen@0.2.9
 - @0xproject/assert@0.2.5
 - @0xproject/base-contract@0.1.0
 - @0xproject/connect@0.6.8
 - contracts@2.1.21
 - @0xproject/deployer@0.3.5
 - @0xproject/dev-utils@0.3.4
 - @0xproject/json-schemas@0.7.19
 - @0xproject/metacoin@0.0.2
 - @0xproject/monorepo-scripts@0.1.16
 - @0xproject/react-docs-example@0.0.6
 - @0xproject/react-docs@0.0.6
 - @0xproject/react-shared@0.1.1
 - @0xproject/sol-cov@0.0.6
 - @0xproject/sra-report@0.0.7
 - @0xproject/subproviders@0.8.4
 - @0xproject/testnet-faucets@1.0.22
 - @0xproject/tslint-config@0.4.14
 - @0xproject/types@0.5.0
 - @0xproject/typescript-typings@0.0.3
 - @0xproject/utils@0.5.0
 - @0xproject/web3-wrapper@0.5.0
 - @0xproject/website@0.0.24
2018-04-02 16:01:51 +03:00
Leonid Logvinov
6ba6bec105 Updated CHANGELOGS 2018-04-02 16:01:45 +03:00
Leonid Logvinov
d95b1e2db4 Merge pull request #485 from 0xProject/feature/metacoin
Add metacoin example project
2018-04-02 14:57:44 +03:00
Leonid Logvinov
c1d6c7ff66 Fix a typo 2018-04-02 14:45:59 +03:00
Leonid Logvinov
6e12794765 Compile only the Exchange contract in compiler tests 2018-04-02 14:20:53 +03:00
Leonid Logvinov
0f4b05e374 Fix version 2018-04-02 13:20:52 +03:00
Fabio Berger
695b697cdf small README fixes 2018-04-02 19:05:27 +09:00
Fabio Berger
3aea0e3b2f Update docs list in README 2018-04-02 19:04:02 +09:00
Leonid Logvinov
c0e92d511e Fix a typo 2018-04-02 13:01:40 +03:00
Leonid Logvinov
51f2a20b2a Merge branch 'development' into feature/metacoin 2018-04-02 12:56:46 +03:00
Leonid Logvinov
333a23f222 Update CHANGELOG.json's 2018-04-02 12:52:49 +03:00
Fabio Berger
3bf3f479f5 Add manual postpublish command to all public packages and update CHANGELOG.json 2018-04-02 18:46:53 +09:00
Fabio Berger
6241d06f27 Fix postpublish util to ignore namespace 2018-04-02 18:44:40 +09:00
Leonid Logvinov
9e81d3c87b Fix contracts and artifacts paths 2018-04-02 12:35:03 +03:00
Leonid Logvinov
a9b2838c5f Stop passing _abiDecoder 2018-04-02 12:35:03 +03:00
Leonid Logvinov
fbc39614c0 Report errors locally 2018-04-02 12:35:03 +03:00
Leonid Logvinov
b2d6ac8dba move all configs to a config file 2018-04-02 12:35:03 +03:00
Leonid Logvinov
b090b7b1f2 Remove a repo section 2018-04-02 12:35:03 +03:00
Leonid Logvinov
ba0696a0d7 Incroduce the Warning constant 2018-04-02 12:35:03 +03:00
Leonid Logvinov
b57850a225 Regroup gitignore entries 2018-04-02 12:34:29 +03:00
Leonid Logvinov
4d9029bb0e Add metacoin example project 2018-04-02 12:34:29 +03:00
Fabio Berger
bc49dde4d5 Fix release notes bug 2018-04-02 18:08:55 +09:00
Fabio Berger
afe07b2926 Should print out lerna publish stdout so we can see if anything went wrong 2018-04-02 17:59:47 +09:00
Fabio Berger
2411bfc20f Publish
- 0x.js@0.34.0
 - @0xproject/abi-gen@0.2.8
 - @0xproject/assert@0.2.4
 - @0xproject/base-contract@0.0.6
 - @0xproject/connect@0.6.7
 - contracts@2.1.20
 - @0xproject/deployer@0.3.4
 - @0xproject/dev-utils@0.3.3
 - @0xproject/json-schemas@0.7.18
 - @0xproject/monorepo-scripts@0.1.15
 - @0xproject/react-docs-example@0.0.5
 - @0xproject/react-docs@0.0.5
 - @0xproject/react-shared@0.1.0
 - @0xproject/sol-cov@0.0.5
 - @0xproject/sra-report@0.0.6
 - @0xproject/subproviders@0.8.3
 - @0xproject/testnet-faucets@1.0.21
 - @0xproject/tslint-config@0.4.13
 - @0xproject/types@0.4.2
 - @0xproject/typescript-typings@0.0.2
 - @0xproject/utils@0.4.4
 - @0xproject/web3-wrapper@0.4.0
 - @0xproject/website@0.0.23
2018-04-02 17:42:10 +09:00
Fabio Berger
4d4ea8a4d0 Updated CHANGELOGS 2018-04-02 17:42:03 +09:00
Fabio Berger
595517e68b Generate CHANGELOG.json files 2018-04-02 17:35:26 +09:00
Fabio Berger
40ab2de393 Merge pull request #489 from 0xProject/refactor/publishProcess
Automate NPM Publish Process
2018-04-02 10:33:13 +02:00
Fabio Berger
723276ae3f Fix hasty find/replace 2018-04-02 16:56:14 +09:00
Fabio Berger
76c5945017 Default to 4sp 2018-04-02 16:40:02 +09:00
Fabio Berger
01c6fd92e8 Update moment, no longer need separate moment types 2018-04-02 16:06:36 +09:00
Fabio Berger
3f230a8fdb Move prettify command to utils and also call it on CHANGELOG.md 2018-04-02 15:53:31 +09:00
Fabio Berger
2a6a71ea6c Add prettier run on generated CHANGELOG.json and fix scripts 2018-04-02 15:49:48 +09:00
Fabio Berger
cd23f220a0 Remove semi-colons from monorepo-scripts package.json 2018-04-02 08:51:10 +09:00
Fabio Berger
fab88ea2cc Get rid of ; in top-level package.json 2018-04-02 08:44:27 +09:00
Fabio Berger
688f8615ff Fix TSLint error 2018-04-02 05:12:03 +09:00
Fabio Berger
d187a31e38 Make dry-run configurable from top-level package.json 2018-04-02 05:10:27 +09:00
Fabio Berger
c6f85464ce Merge branch 'development' into refactor/publishProcess
* development:
  Run prettier, update deployer CHANGELOG
  Create solc_bin dir if does not exist before attempting to compile
  Add missing type import
2018-04-02 04:28:29 +09:00
Fabio Berger
a220b56736 Merge pull request #491 from 0xProject/fix/buildErrors
Fix build errors
2018-04-01 21:15:34 +02:00
Fabio Berger
0e33f45f3d Improve naming 2018-04-02 04:10:18 +09:00
Amir Bandeali
ff7c3012a5 Run prettier, update deployer CHANGELOG 2018-04-01 10:45:30 -07:00
Amir Bandeali
20fec2943b Create solc_bin dir if does not exist before attempting to compile 2018-04-01 10:45:25 -07:00
Fabio Berger
08b30b0706 Merge branch 'development' into refactor/publishProcess
* development:
  Add HACK comment and reorganize use other wallet button
  Fixed comment(s) for PR #488
  OrderStateWatcher fixes for PR #488
  Amended comments to clarify changes on PR #488
  Monitor different state layers with OrderWatcher
  Implement wallet locked and uninstalled states
  Style changes
  Remove props that are covered by the defaults
  Implement ETH/WETH conversion and allowance toggle styling
2018-04-02 02:41:28 +09:00
Fabio Berger
bf52ce7e72 Add temp comment, clean up code 2018-04-02 02:40:48 +09:00
Amir Bandeali
1bac5019e8 Add missing type import 2018-03-31 23:54:09 -07:00
Brandon Millman
19454a92dc Merge pull request #487 from 0xProject/feature/website/wallet-setup
Implement wallet locked and uninstalled states
2018-03-30 15:01:18 -07:00
Brandon Millman
cdbb3a015f Add HACK comment and reorganize use other wallet button 2018-03-30 15:00:02 -07:00
Leonid Logvinov
644da2b0cb Merge pull request #488 from avonian/development
Monitor different state layers with OrderWatcher
2018-03-30 19:56:16 +02:00
Ara Kevonian
57446d78f1 Fixed comment(s) for PR #488 2018-03-30 10:28:13 -07:00
Ara Kevonian
3e285c0ef1 OrderStateWatcher fixes for PR #488 2018-03-30 09:59:57 -07:00
Ara Kevonian
a322148631 Amended comments to clarify changes on PR #488 2018-03-30 08:00:05 -07:00
Fabio Berger
33ec9fdf47 Fixes for clarity 2018-03-30 15:49:09 +02:00
Fabio Berger
323826111a Remove CHANGELOG from website since it's a public package 2018-03-30 15:48:54 +02:00
Fabio Berger
ddd3d284d9 Remove CHANGELOG.json files since will be generated on development 2018-03-30 15:48:39 +02:00
Fabio Berger
f55a300f43 Set IS_DRY_RUN to false 2018-03-30 15:28:08 +02:00
Fabio Berger
08a69ebd6e Add more logging 2018-03-30 15:27:47 +02:00
Fabio Berger
ddb8e26bec Expose publish command from top-level dir 2018-03-30 15:07:24 +02:00
Ara Kevonian
57ca611e12 Monitor different state layers with OrderWatcher
Allow instantiation of stand-alone OrderWatchers
that can monitor different blockchain state
layers (e.g. pending or latest)
2018-03-30 05:59:09 -07:00
Fabio Berger
1eff120f49 Remove top-level internal dep b/c it's not clear to me what it's used for 2018-03-30 14:58:11 +02:00
Fabio Berger
4bc6096ec0 Fetch Github release notes from CHANGELOG.json and update CHANGELOG once they've been successfully published to Github 2018-03-30 14:48:20 +02:00
Fabio Berger
95eb114051 rename variable called path to includePath to avoid conflict with path package 2018-03-30 14:46:15 +02:00
Fabio Berger
9c856de49c Move monorepo root constant to constants file 2018-03-30 14:45:39 +02:00
Fabio Berger
d502f79303 Rename prepublish to publish now that it goes straight to actually publishing the packages 2018-03-30 14:29:30 +02:00
Fabio Berger
5224337323 Call lerna publish and supply it with new package versions 2018-03-30 14:29:07 +02:00
Fabio Berger
ef49192170 Add check that timestamp has been set before generating MD version 2018-03-30 12:43:03 +02:00
Fabio Berger
c9df388731 Add committing and pushing CHANGELOG changes to Github 2018-03-30 12:28:48 +02:00
Brandon Millman
870da2ab22 Implement wallet locked and uninstalled states 2018-03-29 16:57:23 -07:00
Brandon Millman
6122840241 Merge pull request #476 from 0xProject/feature/website/wallet-wrap
Implement ETH/WETH conversion and allowance toggle styling
2018-03-29 14:00:37 -07:00
Brandon Millman
03b00ef8da Style changes 2018-03-29 11:25:50 -07:00
Fabio Berger
84b820abc6 Show semver diff 2018-03-29 20:03:11 +02:00
Fabio Berger
cc4ff568a9 Improve README 2018-03-29 20:02:43 +02:00
Brandon Millman
665011174b Merge branch 'development' into feature/website/wallet-wrap
* development: (35 commits)
  Fix CHANGELOG
  Update Yarn.lock
  Standardize changelog dates and format
  Fix stubbing of a non-existent property
  Remove redundant cast
  Move common types out of web3 types
  Add monorepo_scripts to npmignore
  Add typeRoots
  Add clean-state tests
  Remove nested .gitignore files since `yarn publish` gets confused by them and ignores their contents on the top-level scope
  Remove WETH hack now that updated WETH address is in TokenRegistry
  Revert TokenRegistry address on Kovan
  Improve rounding error message
  Portal fill with mixed decimals
  Add error popover if TokenRegistry on network user is browsing on don't include the requisite default tokens for 0x Portal to function
  Set timeout for compiler tests
  Remove redundant types
  Add missing param comments
  Fix a comment
  Add a comment
  ...
2018-03-29 10:02:46 -07:00
Fabio Berger
37f210e9f0 Fix changelog.json 2018-03-29 17:46:43 +02:00
Fabio Berger
9c01e3a8a0 Merge branch 'development' into refactor/publishProcess
* development:
  Fix CHANGELOG
  Update Yarn.lock
2018-03-29 17:46:24 +02:00
Fabio Berger
c4dd9658e7 Fix CHANGELOG 2018-03-29 17:44:50 +02:00
Fabio Berger
29aa09e448 Generate CHANGELOG.mds 2018-03-29 17:41:39 +02:00
Fabio Berger
1337b6928a Update Yarn.lock 2018-03-29 17:17:41 +02:00
Fabio Berger
ac35d8127e remove console.logs 2018-03-29 17:02:44 +02:00
Fabio Berger
a6ae1efadb Begin global pre-publishing script. Updates changelog.json files in packages to be published 2018-03-29 15:26:47 +02:00
Fabio Berger
bd7b5c51b2 Add 0.x.x edgecase 2018-03-29 15:18:42 +02:00
Fabio Berger
397cd77ef9 Fix semver-sort version 2018-03-29 15:02:46 +02:00
Fabio Berger
743c3dbe01 Generate CHANGELOG.json files and add convert_changelog script 2018-03-29 14:06:29 +02:00
Fabio Berger
9f1c212596 Update Yarn lock and fix dep versions 2018-03-29 13:00:42 +02:00
Fabio Berger
defd249565 Standardize changelog dates and format 2018-03-29 12:49:39 +02:00
Leonid Logvinov
8926dac78c Merge pull request #482 from 0xProject/feature/web3-types
Move common types out of web3 types
2018-03-28 16:26:05 +02:00
Fabio Berger
18cac3f092 Merge pull request #483 from 0xProject/refactor/removeHardcodedWeth
Remove WETH hack now that updated WETH address is in TokenRegistry
2018-03-28 10:41:53 +01:00
Leonid Logvinov
01e27426d6 Fix stubbing of a non-existent property 2018-03-28 10:43:42 +02:00
Leonid Logvinov
0b09cc36b0 Remove redundant cast 2018-03-28 10:26:56 +02:00
Fabio Berger
f3cb484f82 Merge pull request #484 from 0xProject/fix/gitignoreIssue
Remove nested .gitignore & add monorepo_scripts to npmignore
2018-03-27 19:16:36 +01:00
Fabio Berger
0053762760 merge developmentx 2018-03-27 19:16:13 +01:00
Leonid Logvinov
d72b7299c6 Move common types out of web3 types 2018-03-27 17:56:21 +02:00
Fabio Berger
eb89ef79eb Add monorepo_scripts to npmignore 2018-03-27 16:49:19 +01:00
Leonid Logvinov
066d13f5b7 Merge pull request #480 from 0xProject/feature/clean-state-tests
Add clean-state tests
2018-03-27 17:47:45 +02:00
Leonid Logvinov
ec06d8d606 Add typeRoots 2018-03-27 17:47:05 +02:00
Leonid Logvinov
a2e4aaa9a3 Add clean-state tests 2018-03-27 17:47:04 +02:00
Leonid Logvinov
26e9696ddb Merge pull request #460 from 0xProject/feature/deployer-improvements
@0xproject/deployer improvements
2018-03-27 17:43:50 +02:00
Fabio Berger
343191e936 Remove nested .gitignore files since yarn publish gets confused by them and ignores their contents on the top-level scope 2018-03-27 16:24:44 +01:00
Fabio Berger
3e3b667366 Remove WETH hack now that updated WETH address is in TokenRegistry 2018-03-27 11:38:22 +01:00
Fabio Berger
3b45d4727b Revert TokenRegistry address on Kovan 2018-03-26 17:33:39 +01:00
Fabio Berger
b4f3450d4a Merge pull request #479 from 0xProject/bug/website/portal-fill-mixed-decimals
Portal fill with rounding error/mixed decimals
2018-03-26 13:21:26 +01:00
Fabio Berger
0a8b7cb494 Improve rounding error message 2018-03-26 13:21:02 +01:00
Jacob Evans
125ace3519 Portal fill with mixed decimals
When the token pair has different decimal precison we can end up with a remainder when multiplying by an exchange rate (as one is in 18 decimals and the other is 6 for example)
2018-03-26 16:43:12 +11:00
Fabio Berger
109fc41474 Add error popover if TokenRegistry on network user is browsing on don't include the requisite default tokens for 0x Portal to function 2018-03-25 00:22:06 +00:00
Leonid Logvinov
f30353087f Merge branch 'development' into feature/deployer-improvements 2018-03-23 19:18:31 +01:00
Brandon Millman
d106079d9b Remove props that are covered by the defaults 2018-03-22 23:39:13 -07:00
Brandon Millman
dc3be992a3 Implement ETH/WETH conversion and allowance toggle styling 2018-03-22 23:13:49 -07:00
Fabio Berger
bed7d87b7f Get LogEntry type to show up correctly as a Web3 type 2018-03-22 21:05:09 +00:00
Fabio Berger
05daab5dea Fix typos 2018-03-22 20:13:25 +00:00
Fabio Berger
170e5589f9 Fix 0x.js docs to include types from generated contract wrappers 2018-03-22 20:03:42 +00:00
Fabio Berger
538914aa52 Fix S3 bucket name 2018-03-22 16:58:20 +00:00
Fabio Berger
81deb68c8e Use past tense in FAQ 2018-03-22 16:37:23 +00:00
Fabio Berger
36986fe9c9 Replace Auctus with ERCDEX in projects section 2018-03-22 16:22:52 +00:00
Fabio Berger
5791632933 Fix Ethfinex link, looks like they have their own domain now 2018-03-22 16:19:59 +00:00
Fabio Berger
289359bf0d Merge pull request #465 from 0xProject/addExtraDocs
Add Additional Package Doc Pages
2018-03-22 16:11:23 +00:00
Fabio Berger
81f6487865 Use _.filter instead of _.reduce 2018-03-22 16:10:01 +00:00
Fabio Berger
21b797c3f9 Improve list of improvements 2018-03-22 16:00:55 +00:00
Fabio Berger
de8450d5c9 Make handleRequest public and add comment for it 2018-03-22 15:54:13 +00:00
Fabio Berger
bcb9ee4cc2 Make setEngine public 2018-03-22 15:53:54 +00:00
Fabio Berger
7c87447241 Fix lazy load so each doc page is a separate bundle 2018-03-22 15:53:39 +00:00
Fabio Berger
b39d87f357 Remove space 2018-03-22 15:53:20 +00:00
Fabio Berger
552b14b1fa npm -> yarn 2018-03-22 15:53:13 +00:00
Fabio Berger
5779ffd01b Add assertion to notify any developer trying to render a package with files containing multiple classes 2018-03-22 15:52:40 +00:00
Fabio Berger
a7c24a17f4 Fix lint rules directory 2018-03-22 14:33:40 +00:00
Fabio Berger
8743c40911 Use isEmpty 2018-03-22 13:32:14 +00:00
Leonid Logvinov
7ef6bd4b14 Set timeout for compiler tests 2018-03-22 14:26:24 +01:00
Fabio Berger
6af0f08dfc Remove no longer existent command 2018-03-22 12:54:03 +00:00
Fabio Berger
54ae94dde0 Fix benefits list 2018-03-22 12:53:51 +00:00
Fabio Berger
c570f3865f Use yarn instead of npm 2018-03-22 12:53:41 +00:00
Fabio Berger
ed9d1da297 Add default docs icon 2018-03-22 12:46:52 +00:00
Fabio Berger
beb483ea85 Merge branch 'development' into addExtraDocs
* development:
  Change blockchain prop to not optional
  Other style changes
  Updated padding and colors
  Refactor TokenState type
  Fix a bug causing fillOrdersUpTo validation to fail because of some extra orders being passed
  Implement initial wallet interface

# Conflicts:
#	packages/react-shared/CHANGELOG.md
#	packages/website/ts/types.ts
2018-03-22 12:00:41 +00:00
Fabio Berger
46b7fecafe Create helper function for converting dashes names for display 2018-03-22 11:56:12 +00:00
Leonid Logvinov
e476682922 Remove redundant types 2018-03-22 12:37:44 +01:00
Brandon Millman
8478dc8d6d Merge pull request #468 from 0xProject/feature/website/wallet-interface
Implement initial wallet interface
2018-03-21 15:48:13 -07:00
Brandon Millman
9f8e41cbfa Change blockchain prop to not optional 2018-03-21 15:45:11 -07:00
Brandon Millman
3916383dd0 Other style changes 2018-03-21 14:21:19 -07:00
Brandon Millman
a60c8f7d8c Updated padding and colors 2018-03-21 14:17:08 -07:00
Brandon Millman
4e5cd472c2 Refactor TokenState type 2018-03-21 13:02:44 -07:00
Fabio Berger
e1341bc6d9 Move docs to page and add link to docs to README 2018-03-21 18:55:59 +00:00
Fabio Berger
d437a66019 Add comments to JSON-schemas public methods 2018-03-21 18:51:17 +00:00
Fabio Berger
542b46a22f Move usage out of README and replace with link to Docs 2018-03-21 18:40:59 +00:00
Fabio Berger
6fef533fff Improve comments 2018-03-21 18:38:45 +00:00
Fabio Berger
ec219fc395 Add comments to sol-cov 2018-03-21 18:24:54 +00:00
Fabio Berger
a555a8a374 Improve subproviders comment 2018-03-21 18:24:45 +00:00
Fabio Berger
78e9c48803 Move docs from README into docs page and add a link to it. 2018-03-21 18:04:48 +00:00
Fabio Berger
18d3e5458a Fix sectionName and menuItemName to display with spaces rather then dashes 2018-03-21 18:04:27 +00:00
Fabio Berger
ac25764d12 Add changelog entry for making handleRequest private 2018-03-21 17:38:23 +00:00
Fabio Berger
c55e7fa91a Improve all the comments for the subproviders public methods 2018-03-21 17:38:02 +00:00
Leonid Logvinov
e31ba2e12e Add missing param comments 2018-03-21 18:06:50 +01:00
Leonid Logvinov
73f8ae9a47 Fix a comment 2018-03-21 18:01:26 +01:00
Leonid Logvinov
32b85625c1 Add a comment 2018-03-21 17:23:07 +01:00
Leonid Logvinov
629edd3108 Move npm-run-all to devDependencies 2018-03-21 17:20:30 +01:00
Leonid Logvinov
ee77b81551 Revert optimizer config 2018-03-21 17:19:46 +01:00
Leonid Logvinov
2c7fdac5cd Remove .only 2018-03-21 16:39:37 +01:00
Leonid Logvinov
d118116548 Revert version range changes 2018-03-21 16:34:57 +01:00
Leonid Logvinov
8d01956c3e Merge pull request #470 from 0xProject/fix/fillOrdersUpToValidation
Fix a bug causing fillOrdersUpTo validation to fail because of some e…
2018-03-21 15:30:26 +01:00
Leonid Logvinov
1dda8c1468 Fix a bug causing fillOrdersUpTo validation to fail because of some extra orders being passed 2018-03-21 15:30:04 +01:00
Leonid Logvinov
111f7e917e Add function docs 2018-03-21 15:24:41 +01:00
Leonid Logvinov
477daf4168 Add function docs 2018-03-21 15:12:18 +01:00
Leonid Logvinov
8b52793f2f Add tests for compiler utils 2018-03-21 15:12:18 +01:00
Leonid Logvinov
18b9fe5256 Enable strictNullChecks 2018-03-21 15:11:41 +01:00
Leonid Logvinov
439e864085 Change the type of optimizerEnabled to boolean and convert it to number only before passing to a compiler 2018-03-21 15:11:41 +01:00
Leonid Logvinov
f45191d0e8 Support proper semver version ranges 2018-03-21 15:11:41 +01:00
Leonid Logvinov
32feadee42 Change version ranges to only support patch version increments 2018-03-21 15:07:51 +01:00
Leonid Logvinov
c4b4bb9e8e Compile contracts sequentially 2018-03-21 15:07:51 +01:00
Leonid Logvinov
8fd705d2af Throw an error if contract file doesn't contain the contract with the same name 2018-03-21 15:07:51 +01:00
Leonid Logvinov
3c36135d6c Stop printing help on error 2018-03-21 15:07:51 +01:00
Leonid Logvinov
02ede26893 Rename onDeployCommand to onDeployCommandAsync and onCompileCommand to onCompileCommandAsync 2018-03-21 15:07:51 +01:00
Fabio Berger
af21ad1615 Add missing DocComments to Deployer package 2018-03-21 12:33:07 +00:00
Fabio Berger
07fa01528b Move usage out of README and add add link to docs 2018-03-21 12:32:53 +00:00
Fabio Berger
38f716bd77 Make docs link more discoverable in README, move docs out of README 2018-03-20 22:24:26 +00:00
Fabio Berger
6a410b03ff Improve comments 2018-03-20 22:17:39 +00:00
Fabio Berger
3cd7bce0a3 Add DocComments to Web3Wrapper 2018-03-20 21:41:59 +00:00
Fabio Berger
6693540f43 Add changelog entry 2018-03-20 21:41:36 +00:00
Fabio Berger
647bc5a63e Rename method for clarity 2018-03-20 21:41:21 +00:00
Fabio Berger
4f76bb2a12 Remove duplicate method 2018-03-20 21:39:41 +00:00
Fabio Berger
9991ddecc2 Fix var name typo 2018-03-20 21:39:08 +00:00
Brandon Millman
3cf2cb89bb Implement initial wallet interface 2018-03-20 13:42:50 -07:00
Fabio Berger
2875cfa8c7 Move doc related types closer to one another 2018-03-20 15:41:31 +00:00
Fabio Berger
87cbbdad72 Update yarn.lock 2018-03-20 15:39:39 +00:00
Fabio Berger
07de3a1d94 Pass actual iconUrl and add default icon image 2018-03-20 15:39:32 +00:00
Fabio Berger
27880a6059 Remove s3 mapping since s3 folder names are now identical to sub-package names 2018-03-20 15:35:48 +00:00
Fabio Berger
0367e4117a Remove duplicate switch case 2018-03-20 15:34:02 +00:00
Fabio Berger
ec582d6e46 Small doc fixes: remove duplicate types and add function array 2018-03-20 15:28:25 +00:00
Fabio Berger
4ca706d4e6 Remove duplicate ECSignature type def 2018-03-20 13:06:59 +00:00
Fabio Berger
72671c1014 Refactor titleToIcon mapping to idToIcon and move to docPage 2018-03-20 12:26:04 +00:00
Fabio Berger
a3c31f4f4a Fix changelog files and add PR number 2018-03-20 12:05:31 +00:00
Fabio Berger
db8be4a66e Rename stagedocs.ts file to stage_docs.ts in keeping with our file naming conventions. postpublish.ts is the only exception and this is because it is dictated by Lerna 2018-03-20 12:00:22 +00:00
Fabio Berger
2f7c19e80d Merge branch 'development' into addExtraDocs
* development: (29 commits)
  Set Lodash dep to an exact version since newer versions introduced breaking changes
  Update Kovan Ethertoken Address
  Update deployer version since manual re-publish
  Add new entry into CHANGELOG
  Fix bad merge
  Update yarn.lock
  Change title
  Add Blake and Zach to About page
  Re-size Jacob and Tom's images
  Manually publish 0x.js back to a working state
  Publish
  Publish
  Fix 0x.js assets
  Remove assets from connect and _bundles from packages that don't generate the folder
  Publish
  Fix packages that aren't working as expected
  Make new packages default to public on publish
  Add new public packages to top-level README
  Update top-level package.json
  Fix incorrect new versions
  ...

# Conflicts:
#	packages/0x.js/package.json
#	packages/connect/package.json
#	packages/json-schemas/package.json
#	packages/sol-cov/package.json
2018-03-20 11:52:22 +00:00
Fabio Berger
7d9c357409 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Update Kovan Ethertoken Address
2018-03-20 11:40:48 +00:00
Fabio Berger
abf41b073c Set Lodash dep to an exact version since newer versions introduced breaking changes 2018-03-20 11:40:29 +00:00
Jacob Evans
c9b07107f3 Merge pull request #464 from 0xProject/bug/0x.js/kovan-ethertoken-address
Update Kovan Ethertoken Address
2018-03-20 22:24:22 +11:00
Jacob Evans
773be348a3 Update Kovan Ethertoken Address 2018-03-20 22:23:30 +11:00
Fabio Berger
b7bb8d9b2a Update deployer version since manual re-publish 2018-03-20 11:00:52 +00:00
Brandon Millman
c7c12371ef Merge pull request #451 from 0xProject/feature/sra-report/collection-tests
Add scaffolding for sra-report collection unit tests
2018-03-19 10:28:02 -07:00
Brandon Millman
fb40b10501 Add new entry into CHANGELOG 2018-03-19 10:10:17 -07:00
Brandon Millman
d4dce41d3a Fix bad merge 2018-03-19 10:06:54 -07:00
Brandon Millman
293b55e51f Update yarn.lock 2018-03-19 10:03:21 -07:00
Brandon Millman
11bac66046 Merge branch 'development' into feature/sra-report/collection-tests
* development: (26 commits)
  Change title
  Add Blake and Zach to About page
  Re-size Jacob and Tom's images
  Manually publish 0x.js back to a working state
  Publish
  Publish
  Fix 0x.js assets
  Remove assets from connect and _bundles from packages that don't generate the folder
  Publish
  Fix packages that aren't working as expected
  Make new packages default to public on publish
  Add new public packages to top-level README
  Update top-level package.json
  Fix incorrect new versions
  Fix path to assets
  Publish
  Updated CHANGELOGS
  Fix quotation marks
  Add a complex test for ast visitor
  Move opcodes to constants
  ...
2018-03-19 09:56:46 -07:00
Fabio Berger
2a438419ab Merge pull request #461 from 0xProject/updateTeam
Add Zach & Blake to team
2018-03-19 15:28:38 +01:00
Fabio Berger
0f0aca7de5 Change title 2018-03-19 14:51:58 +01:00
Fabio Berger
f699b9a73f Add Blake and Zach to About page 2018-03-19 14:50:50 +01:00
Fabio Berger
214096de9e Re-size Jacob and Tom's images 2018-03-19 14:50:36 +01:00
Fabio Berger
a0ccb609cd Manually publish 0x.js back to a working state 2018-03-19 00:55:10 +01:00
Fabio Berger
4e05554b3e Publish
- 0x.js@0.33.5
 - contracts@2.1.19
 - @0xproject/sra-report@0.0.5
 - @0xproject/testnet-faucets@1.0.20
 - @0xproject/website@0.0.22
2018-03-19 00:48:26 +01:00
Fabio Berger
04c08b9fc8 Publish
- 0x.js@0.33.4
 - @0xproject/assert@0.2.3
 - @0xproject/connect@0.6.6
 - contracts@2.1.18
 - @0xproject/deployer@0.3.2
 - @0xproject/dev-utils@0.3.2
 - @0xproject/json-schemas@0.7.17
 - @0xproject/react-docs-example@0.0.4
 - @0xproject/react-docs@0.0.4
 - @0xproject/react-shared@0.0.4
 - @0xproject/sol-cov@0.0.4
 - @0xproject/sra-report@0.0.4
 - @0xproject/subproviders@0.8.2
 - @0xproject/testnet-faucets@1.0.19
 - @0xproject/website@0.0.21
2018-03-19 00:39:25 +01:00
Fabio Berger
86c1c8082d Fix 0x.js assets 2018-03-19 00:36:44 +01:00
Fabio Berger
c5afc5feb5 Remove assets from connect and _bundles from packages that don't generate the folder 2018-03-19 00:30:33 +01:00
Fabio Berger
8392ee4625 Publish
- 0x.js@0.33.3
 - @0xproject/abi-gen@0.2.7
 - @0xproject/assert@0.2.2
 - @0xproject/base-contract@0.0.5
 - chai-as-promised-typescript-typings@0.0.12
 - chai-typescript-typings@0.0.6
 - @0xproject/connect@0.6.5
 - contracts@2.1.17
 - @0xproject/deployer@0.3.1
 - @0xproject/dev-utils@0.3.1
 - ethers-typescript-typings@0.0.4
 - @0xproject/json-schemas@0.7.16
 - @0xproject/monorepo-scripts@0.1.14
 - @0xproject/react-docs-example@0.0.3
 - @0xproject/react-docs@0.0.3
 - @0xproject/react-shared@0.0.3
 - @0xproject/sol-cov@0.0.3
 - @0xproject/sra-report@0.0.3
 - @0xproject/subproviders@0.8.1
 - @0xproject/testnet-faucets@1.0.18
 - @0xproject/tslint-config@0.4.12
 - @0xproject/types@0.4.1
 - @0xproject/utils@0.4.3
 - web3-typescript-typings@0.10.2
 - @0xproject/web3-wrapper@0.3.1
 - @0xproject/website@0.0.20
2018-03-19 00:24:28 +01:00
Fabio Berger
ac881d149c Fix packages that aren't working as expected 2018-03-19 00:13:19 +01:00
Fabio Berger
cc4e390c91 Make new packages default to public on publish 2018-03-18 20:13:43 +01:00
Fabio Berger
26c726da45 Add new public packages to top-level README 2018-03-18 20:13:29 +01:00
Fabio Berger
358f3d9b42 Update top-level package.json 2018-03-18 20:13:16 +01:00
Fabio Berger
3337625fa0 Fix incorrect new versions 2018-03-18 19:53:37 +01:00
Fabio Berger
ae2daa5a6f Fix path to assets 2018-03-18 19:53:26 +01:00
Fabio Berger
79f521b555 Publish
- 0x.js@0.33.2
 - @0xproject/abi-gen@0.2.6
 - @0xproject/assert@0.2.1
 - @0xproject/base-contract@0.0.4
 - chai-as-promised-typescript-typings@0.0.11
 - chai-typescript-typings@0.0.5
 - @0xproject/connect@0.6.4
 - contracts@2.1.16
 - @0xproject/deployer@0.3.0
 - @0xproject/dev-utils@0.3.0
 - ethers-typescript-typings@0.0.3
 - @0xproject/json-schemas@0.7.15
 - @0xproject/monorepo-scripts@0.1.13
 - @0xproject/react-docs-example@0.0.2
 - @0xproject/react-docs@0.0.2
 - @0xproject/react-shared@0.0.2
 - @0xproject/sol-cov@0.0.2
 - @0xproject/sra-report@0.0.2
 - @0xproject/subproviders@0.8.0
 - @0xproject/testnet-faucets@1.0.17
 - @0xproject/tslint-config@0.4.11
 - @0xproject/types@0.4.0
 - @0xproject/utils@0.4.2
 - web3-typescript-typings@0.10.1
 - @0xproject/web3-wrapper@0.3.0
 - @0xproject/website@0.0.19
2018-03-18 19:49:46 +01:00
Fabio Berger
fffcb98ac4 Updated CHANGELOGS 2018-03-18 19:22:55 +01:00
Fabio Berger
5468358f21 Add Subprovider docs to website 2018-03-18 19:04:16 +01:00
Fabio Berger
87044313c2 Capitalize rather then upper-case section headers 2018-03-18 18:45:06 +01:00
Fabio Berger
794b155827 Add support for displaying exported functions 2018-03-18 18:44:52 +01:00
Fabio Berger
4941ffd354 Add functions to submenu in sidebar 2018-03-18 18:43:38 +01:00
Fabio Berger
aa8a3ee055 Re-order developers dropdown 2018-03-18 16:12:24 +01:00
Fabio Berger
c1d17c83f8 Add sol-cov docs to website 2018-03-18 16:10:02 +01:00
Fabio Berger
db030016fa Refactor CoverageSubprovider to use subproviders types 2018-03-18 16:09:37 +01:00
Fabio Berger
ae04f55882 Export ErrorCallback type from Subproviders package 2018-03-18 16:09:08 +01:00
Fabio Berger
b40fab35f6 Add doc setup to sol-cov 2018-03-18 15:08:52 +01:00
Fabio Berger
644deee8b5 Standardize all doc commands and add docs:stage shortcut 2018-03-18 15:08:37 +01:00
Fabio Berger
c7302c46e5 Add JSON Schemas docs to website 2018-03-18 14:54:12 +01:00
Fabio Berger
4948551703 merge development 2018-03-18 14:01:18 +01:00
Brandon Millman
d4c1b3b0bd Merge pull request #456 from 0xProject/feature/connect/consolidate-types
Add SignedOrder, Order, and ECSignature types to the types package
2018-03-16 11:23:28 -07:00
Brandon Millman
bbdb072634 Fix quotation marks 2018-03-16 11:22:43 -07:00
Fabio Berger
d7bf003d51 Refactor all docJSON's to reside within the same S3 bucket under different folders 2018-03-16 16:56:53 +01:00
Fabio Berger
5a827eb3d4 Fix deployer external type link to point to specific commit 2018-03-16 14:05:05 +01:00
Fabio Berger
b37076136b Add missing type 2018-03-16 14:04:38 +01:00
Fabio Berger
3574ab253f Add missing type to subproviders exports 2018-03-16 14:04:27 +01:00
Fabio Berger
312a30578b Improve deployer docs 2018-03-16 14:04:08 +01:00
Fabio Berger
8243e73413 Use named types and introduce JSONRPCRequestPayloadWithMethod type 2018-03-16 14:03:50 +01:00
Fabio Berger
5175fe8107 Handle reflection type in type rendering 2018-03-16 14:02:55 +01:00
Leonid Logvinov
2acb767640 Merge pull request #457 from 0xProject/feature/sol-cov-tests
Add tests for sol-cov
2018-03-16 13:32:21 +01:00
Leonid Logvinov
a9b1dcb32a Add a complex test for ast visitor 2018-03-16 10:49:20 +01:00
Leonid Logvinov
8f8577b7c6 Move opcodes to constants 2018-03-16 10:27:12 +01:00
Fabio Berger
0225d34b74 Fix issue with bundling subproviders for the browser by ignoring the ganache-core dependency 2018-03-15 19:51:07 +01:00
Fabio Berger
8d1e27a1a5 Merge branch 'development' into addExtraDocs
* development:
  Add changelog entry about pragma addition
  Add pragma above command-line script
  Keep console.log in monorepo-scripts
  Enable coverage for all other packages with tests
  Fix parallel coverage results reporting
  Fix linter issuesx
  Update CHANGELOGs
  Consolidate all console.log into the @0xproject/utils package

# Conflicts:
#	packages/deployer/package.json
2018-03-15 19:44:10 +01:00
Brandon Millman
e4ea6e1ec3 WIP 2018-03-15 11:33:08 -07:00
Fabio Berger
8137d41ce5 Add changelog entry about pragma addition 2018-03-15 19:25:06 +01:00
Fabio Berger
4b7f0bd374 Add pragma above command-line script 2018-03-15 19:23:57 +01:00
Fabio Berger
f9ad97b978 Add Deployer docs to website 2018-03-15 19:23:21 +01:00
Fabio Berger
b145a17d11 Add pragma above command-line script 2018-03-15 19:22:57 +01:00
Brandon Millman
3430e2bdac Fix bad merge 2018-03-15 10:14:51 -07:00
Brandon Millman
cdcf925378 Fix yarn.lock 2018-03-15 09:58:20 -07:00
Brandon Millman
76029cbf09 Merge branch 'development' into feature/sra-report/collection-tests
* development: (97 commits)
  Keep console.log in monorepo-scripts
  Enable coverage for all other packages with tests
  Fix parallel coverage results reporting
  Fix linter issuesx
  Remove outdated comment
  Add script copying to build command
  Add postpublish script to sol-cov
  Move configuration into package.json configs section
  Transform input data before encoding for callAsync and getABIEncodedTransactionData
  Update CHANGELOGs
  Consolidate all console.log into the @0xproject/utils package
  Update coverage badge to show development coverage
  Configure post build hook
  Notify coveralls after all tasks have finished
  Address feedback
  Revert "Report all coverage reports together"
  Separate published packages and typescript typings on README
  Consolidate docs generation and uploading logic
  Use async/await instead of promise syntax
  Move changelog entry
  ...
2018-03-15 09:57:27 -07:00
Brandon Millman
b9c1653c1c Fix quotation marks 2018-03-15 09:48:45 -07:00
Leonid Logvinov
f6c01520ae Add tests for sol-cov 2018-03-15 16:19:01 +01:00
Brandon Millman
0fb4de85c4 Updated CHANGELOGs 2018-03-14 16:36:21 -07:00
Brandon Millman
ffe7363776 Add SignedOrder, Order, and ECSignature types to the types package 2018-03-14 16:33:10 -07:00
Brandon Millman
4a27a7dc58 Merge pull request #452 from 0xProject/feature/utils/console-log
Consolidate all console.log utils into @0xproject/utils
2018-03-14 15:30:59 -07:00
Brandon Millman
3b3d5b12bc Keep console.log in monorepo-scripts 2018-03-14 14:58:16 -07:00
Brandon Millman
380e51ca50 Merge branch 'development' into feature/utils/console-log
* development: (25 commits)
  Enable coverage for all other packages with tests
  Fix parallel coverage results reporting
  Fix linter issuesx
  Remove outdated comment
  Add script copying to build command
  Add postpublish script to sol-cov
  Move configuration into package.json configs section
  Transform input data before encoding for callAsync and getABIEncodedTransactionData
  Consolidate docs generation and uploading logic
  Use async/await instead of promise syntax
  Move changelog entry
  remove unneeded include
  remove unused dep
  Fix lint issues
  Re-add linter to monorepo-scripts but with tslint-config dep at earlier version to avoid cyclical dependency
  small fixes
  move scripts to monorepro-scripts
  Fix gitignore
  Move abi-gen scripts to src
  Add missing dep
  ...
2018-03-14 14:36:04 -07:00
Leonid Logvinov
aea7207b9f Merge pull request #455 from 0xProject/fix/coveralls
Enable coverage reporting for all packages that have tests
2018-03-14 17:36:23 +01:00
Fabio Berger
9593739938 Ignore ganache-core from subproviders in a browser setting & remove previous hack 2018-03-14 17:29:57 +01:00
Leonid Logvinov
40ebb533b3 Enable coverage for all other packages with tests 2018-03-14 17:15:38 +01:00
Leonid Logvinov
7fe26ee719 Fix parallel coverage results reporting 2018-03-14 17:14:25 +01:00
Fabio Berger
28d63ad8e1 Add Web3Wrapper docs to website 2018-03-14 16:37:24 +01:00
Fabio Berger
56eeea1e63 Add fix to webpack for issue: https://github.com/trufflesuite/ganache-core/issues/84 and prettier the configs 2018-03-14 16:37:09 +01:00
Fabio Berger
642a2cf165 Added doc json generation and uploading to Web3Wrapper package 2018-03-14 16:36:00 +01:00
Fabio Berger
e16feb27f4 Merge pull request #450 from 0xProject/convertScriptsToTs
Convert Scripts to TS & Other Misc. Fixes
2018-03-14 15:18:16 +01:00
Fabio Berger
83ae7ba08d Fix linter issuesx 2018-03-14 14:50:09 +01:00
Fabio Berger
a86f8a81a2 Fix linter issuesx 2018-03-14 14:49:09 +01:00
Fabio Berger
28abcef1ca Remove outdated comment 2018-03-14 14:32:45 +01:00
Fabio Berger
32d15d79f1 Add script copying to build command 2018-03-14 14:30:15 +01:00
Fabio Berger
538ac604a8 Add postpublish script to sol-cov 2018-03-14 14:27:36 +01:00
Fabio Berger
009b70f5b2 Merge branch 'development' into convertScriptsToTs
* development: (71 commits)
  Transform input data before encoding for callAsync and getABIEncodedTransactionData
  Update coverage badge to show development coverage
  Configure post build hook
  Notify coveralls after all tasks have finished
  Address feedback
  Revert "Report all coverage reports together"
  Separate published packages and typescript typings on README
  Report all coverage reports together
  Add other statement types
  Properly and consistently parse ENV vars
  Add forgotten file
  Start using solidity-parser-antlr
  Fix the default always overriding to address
  Submit a TD PR
  Add an explanatory comment for making ranges unique
  Fix a typo in handling env variables
  Introduce TESTRPC_FIRST_ADDRESS
  Make BlockchainLifecycle accept only web3Wrapper
  Fix comments
  Fix deployer CHANGELOG
  ...

# Conflicts:
#	README.md
#	packages/deployer/package.json
#	packages/subproviders/src/globals.d.ts
#	yarn.lock
2018-03-14 14:16:08 +01:00
Fabio Berger
f7c1e10b5a Move configuration into package.json configs section 2018-03-14 14:07:24 +01:00
Leonid Logvinov
3f3e8be004 Merge pull request #453 from 0xProject/fix/contract-templates/transformData
Transform input data before encoding
2018-03-14 05:50:02 +01:00
Amir Bandeali
cb612360ca Transform input data before encoding for callAsync and getABIEncodedTransactionData 2018-03-13 20:41:07 -07:00
Brandon Millman
6a8c2cb717 Update CHANGELOGs 2018-03-13 18:16:31 -07:00
Brandon Millman
c8a8b851d8 Consolidate all console.log into the @0xproject/utils package 2018-03-13 18:13:48 -07:00
Brandon Millman
ba9a734ba7 Update README and CHANGELOG 2018-03-13 16:17:02 -07:00
Brandon Millman
b08374f0ba Add scaffolding for sra-report collection unit tests 2018-03-13 15:54:33 -07:00
Leonid Logvinov
c2f8858aab Update coverage badge to show development coverage 2018-03-13 20:47:21 +01:00
Leonid Logvinov
1f81fa1c6c Configure post build hook 2018-03-13 20:38:33 +01:00
Leonid Logvinov
db44a5bca7 Merge pull request #426 from 0xProject/feature/solcov
Sol-cover
2018-03-13 19:49:30 +01:00
Leonid Logvinov
53e1815c1d Notify coveralls after all tasks have finished 2018-03-13 19:30:54 +01:00
Leonid Logvinov
20985d515f Address feedback 2018-03-13 19:13:37 +01:00
Leonid Logvinov
0334004b11 Revert "Report all coverage reports together"
This reverts commit 11ed5d62ba.
2018-03-13 19:09:16 +01:00
Brandon Millman
95e2b37d62 Separate published packages and typescript typings on README 2018-03-13 09:57:28 -07:00
Fabio Berger
dba1b8a7e9 Consolidate docs generation and uploading logic 2018-03-13 17:55:16 +01:00
Fabio Berger
ee29ed26ff Use async/await instead of promise syntax 2018-03-13 17:36:12 +01:00
Fabio Berger
a08ae722c1 Move changelog entry 2018-03-13 17:04:38 +01:00
Fabio Berger
b3c1c0ccad remove unneeded include 2018-03-13 17:04:31 +01:00
Fabio Berger
e1fa65f5ef remove unused dep 2018-03-13 17:04:14 +01:00
Fabio Berger
a2e848a7fa Fix lint issues 2018-03-13 16:55:50 +01:00
Fabio Berger
67fbffc964 Re-add linter to monorepo-scripts but with tslint-config dep at earlier version to avoid cyclical dependency 2018-03-13 16:55:35 +01:00
Fabio Berger
c3b4359e87 small fixes 2018-03-13 16:36:05 +01:00
Leonid Logvinov
11ed5d62ba Report all coverage reports together 2018-03-13 16:34:37 +01:00
Leonid Logvinov
5827170815 Add other statement types 2018-03-13 15:49:46 +01:00
Fabio Berger
ca25b816fa move scripts to monorepro-scripts 2018-03-13 15:29:12 +01:00
Leonid Logvinov
a9db0e8ebe Properly and consistently parse ENV vars 2018-03-13 15:19:31 +01:00
Leonid Logvinov
a0791455e1 Add forgotten file 2018-03-13 14:41:46 +01:00
Leonid Logvinov
efb0ee4c02 Start using solidity-parser-antlr 2018-03-13 11:53:45 +01:00
Fabio Berger
df1968157c Fix gitignore 2018-03-13 10:59:53 +01:00
Fabio Berger
355aac2a1a Move abi-gen scripts to src 2018-03-13 10:42:33 +01:00
Fabio Berger
b93b66edfb Add missing dep 2018-03-13 10:42:14 +01:00
Fabio Berger
92a4e77288 Make git-ignore generic for all package scripts 2018-03-13 10:42:06 +01:00
Fabio Berger
7ac646ff94 Move monorepo_scripts into src dir removing the need for a separate globals.d.ts and tsconfig files 2018-03-13 10:25:10 +01:00
Fabio Berger
ef6aa9f41b Convert 0x.js scripts to TS, move the prepublishUtils script to dev-utils and also convert it to TS. 2018-03-12 22:13:24 +01:00
Fabio Berger
df9e7385ad Merge pull request #449 from 0xProject/bug/website/portal-history-etherscan-tx
Fix the Portal Etherscan Link always overriding to address
2018-03-12 16:53:10 +01:00
Jacob Evans
e065ac45dc Fix the default always overriding to address 2018-03-12 11:34:55 -04:00
Fabio Berger
745af5309d Add missing prettier devDep 2018-03-12 16:04:01 +01:00
Fabio Berger
952f1cf8d0 Use isMetaMask flag rather then constructor name for Metamask provider detection 2018-03-12 15:22:04 +01:00
Fabio Berger
86a55fe55a Add OrderRelevantState to public types in 0x.js docs configs 2018-03-12 13:58:15 +01:00
Leonid Logvinov
88c6694ffc Submit a TD PR 2018-03-12 13:24:07 +01:00
Leonid Logvinov
20826e0f08 Add an explanatory comment for making ranges unique 2018-03-12 12:56:22 +01:00
Leonid Logvinov
e474096119 Fix a typo in handling env variables 2018-03-12 12:53:51 +01:00
Leonid Logvinov
075f286130 Introduce TESTRPC_FIRST_ADDRESS 2018-03-12 12:53:07 +01:00
Leonid Logvinov
32e3cab116 Make BlockchainLifecycle accept only web3Wrapper 2018-03-12 12:51:37 +01:00
Leonid Logvinov
49ff4299c6 Fix comments 2018-03-12 12:42:14 +01:00
Leonid Logvinov
4d18a4802d Fix deployer CHANGELOG 2018-03-12 12:40:00 +01:00
Fabio Berger
d613791104 Merge branch 'feature/solcov' of github.com:0xProject/0x-monorepo into feature/solcov
* 'feature/solcov' of github.com:0xProject/0x-monorepo:
  Add a HACK to detect coverage of the modifiers with no parameters
2018-03-12 12:32:32 +01:00
Fabio Berger
44f7f79bd9 Improve the sol-cov readme 2018-03-12 12:32:07 +01:00
Leonid Logvinov
1cdfbbadaa Add a HACK to detect coverage of the modifiers with no parameters 2018-03-12 12:31:33 +01:00
Fabio Berger
76a31b6fd6 Merge pull request #447 from 0xProject/refactorAnalytics
Refactor Website Analytics
2018-03-12 11:28:34 +01:00
Leonid Logvinov
0ad3d06ef9 Merge pull request #448 from 0xProject/fix/abi-gen-readme
Update README for abi-gen
2018-03-12 11:28:06 +01:00
Leonid Logvinov
fb0fd8ddc4 Update README 2018-03-12 11:24:37 +01:00
Leonid Logvinov
2a9913b8fb Treap transactions to address 0x0 as contract creation 2018-03-12 06:07:01 +01:00
Leonid Logvinov
9b8d2ed469 Add sol-cov README 2018-03-12 04:03:51 +01:00
Leonid Logvinov
17148df06d Add an example deployment script 2018-03-12 03:47:46 +01:00
Leonid Logvinov
d93089fcc0 Fix subproviders CHANGELOG 2018-03-12 03:37:31 +01:00
Leonid Logvinov
870995933a Remove redundant Date.now() 2018-03-12 03:37:30 +01:00
Leonid Logvinov
d6c2e47bbd Make env variables parsing more strict and add docs 2018-03-12 03:37:30 +01:00
Leonid Logvinov
e2b2bf1e0d Fix a typo 2018-03-12 03:37:30 +01:00
Leonid Logvinov
c4a18ee64b Make Deployer configurable by jsonrpcUrl instead of jsonrpcPort 2018-03-12 03:37:30 +01:00
Leonid Logvinov
7143996d26 Use locks instead of semaphores in ledger subprovider 2018-03-12 03:37:30 +01:00
Leonid Logvinov
22f78a2c52 Don't await lock releases 2018-03-12 03:37:30 +01:00
Leonid Logvinov
bd7517cfd4 Add support for async calls under coverage 2018-03-12 03:37:30 +01:00
Leonid Logvinov
9bffce9dc5 Fix coverage:report:html 2018-03-12 03:37:30 +01:00
Leonid Logvinov
10f6a17857 Add builtin modifier 'constant' 2018-03-12 03:37:30 +01:00
Leonid Logvinov
2197c2481a Increase timeout 2018-03-12 03:37:30 +01:00
Leonid Logvinov
8d90e640b0 Keep coverage directory 2018-03-12 03:37:30 +01:00
Leonid Logvinov
368870a2fc Fix sources list generation in a compiler 2018-03-12 03:37:30 +01:00
Leonid Logvinov
945a19bb61 Fix a typo in tests 2018-03-12 03:37:30 +01:00
Leonid Logvinov
b0abc384bc Disable completed docs rule 2018-03-12 03:37:30 +01:00
Leonid Logvinov
8f45e9a518 Run coverage on CI 2018-03-12 03:37:29 +01:00
Leonid Logvinov
b06f1d1982 Use custom fork of ganache-core 2018-03-12 03:37:29 +01:00
Leonid Logvinov
4365350430 Don't do parallel calls 2018-03-12 03:37:29 +01:00
Leonid Logvinov
3b158cb726 Address feedback 2018-03-12 03:37:29 +01:00
Leonid Logvinov
2298a34c37 Make _getSingleFileCoverageForTrace a private static method 2018-03-12 03:37:29 +01:00
Leonid Logvinov
633039c528 Use better variable name 2018-03-12 03:37:29 +01:00
Leonid Logvinov
ee31d5e24d Introduce redundant vars 2018-03-12 03:37:29 +01:00
Leonid Logvinov
f590aa11f7 Throw an error if artifacts not found 2018-03-12 03:37:29 +01:00
Leonid Logvinov
6b7f48644c Fix a typo 2018-03-12 03:37:29 +01:00
Leonid Logvinov
21aac75533 Use string enum for branch types 2018-03-12 03:37:29 +01:00
Leonid Logvinov
95b02a3197 Fix a typo 2018-03-12 03:37:29 +01:00
Leonid Logvinov
be7c444959 Remove initial implementation entry 2018-03-12 03:37:29 +01:00
Leonid Logvinov
f02d3f689d Document env variables 2018-03-12 03:37:29 +01:00
Leonid Logvinov
981752059c Add double negation before using shouldUseInProcessGanache 2018-03-12 03:37:29 +01:00
Leonid Logvinov
6c87ebac01 Rename useInProcessGanache to shouldUseInProcessGanache 2018-03-12 03:37:28 +01:00
Leonid Logvinov
a9479b3c01 Make coverage a module instead of a function 2018-03-12 03:37:28 +01:00
Leonid Logvinov
c5afca53a4 Rename COVERAGE to SOLIDITY_COVERAGS 2018-03-12 03:37:28 +01:00
Leonid Logvinov
b4cb88ab26 Add better error handling in deployer constructor 2018-03-12 03:37:28 +01:00
Leonid Logvinov
ad4f607643 Move compiler URL to constants 2018-03-12 03:37:28 +01:00
Leonid Logvinov
c7d340e822 Handle an error while loading the compiler 2018-03-12 03:37:28 +01:00
Leonid Logvinov
2c501d2380 Introduce isCompilerAvailableLocally 2018-03-12 03:37:28 +01:00
Leonid Logvinov
3787e4a83c Fix variable name 2018-03-12 03:37:28 +01:00
Leonid Logvinov
3b77e4ebf1 Rename getCoverageSubprovider to getCoverageSubproviderSingleton 2018-03-12 03:37:28 +01:00
Leonid Logvinov
6eebf717d5 Improve migrations comment 2018-03-12 03:37:28 +01:00
Leonid Logvinov
98f32d6f1f Stop making an assumption that contract code is immutable 2018-03-12 03:37:28 +01:00
Leonid Logvinov
62f45f7b41 Cache code parsing 2018-03-12 03:37:28 +01:00
Leonid Logvinov
a7d8f6599a use sourceList instead of sources 2018-03-12 03:37:28 +01:00
Leonid Logvinov
4da6db8418 Improve compiler output type 2018-03-12 03:37:28 +01:00
Leonid Logvinov
d991291f2a Use in-process Ganache in contracts 2018-03-12 03:37:27 +01:00
Leonid Logvinov
392fb42973 Revert mocha timeout increase 2018-03-12 03:37:27 +01:00
Leonid Logvinov
13299158d1 Add sol-cover implementation 2018-03-12 03:37:27 +01:00
Fabio Berger
a6571b09d2 Improve README 2018-03-11 13:24:34 +01:00
Fabio Berger
870ba445b8 Merge pull request #444 from 0xProject/dedupWeb3Wrapper
Remove custom web3Wrapper from website
2018-03-11 12:49:15 +01:00
Fabio Berger
caaa70f630 Fix getTokenBalanceAndAllowanceAsync to take ownerAddressIfExists so that we don't sometimes pass an empty string and sometimes undefined 2018-03-11 12:33:34 +01:00
Fabio Berger
56a8e0a09a Fix userAddress bugs 2018-03-11 12:04:46 +01:00
Fabio Berger
4c08667a07 Replace local PRECISION constants with global config.AMOUNT_DISPLAY_PRECISION 2018-03-10 22:43:13 +01:00
Fabio Berger
4ac6b6828c Get rid of getFirstAccountIfExistsAsync since no longer needed 2018-03-10 22:38:31 +01:00
Fabio Berger
c050186014 Use undefined rather then an empty string in blockchainWatcher 2018-03-10 22:36:54 +01:00
Fabio Berger
63f2606863 Refactor blockchain to store userAddress as address or undefined 2018-03-10 22:31:19 +01:00
Fabio Berger
5160e0ba18 Add pr number to changelog 2018-03-10 22:24:13 +01:00
Fabio Berger
0aad2ee005 Merge pull request #442 from 0xProject/addPackagePublishConfig
Add Package Publish Config
2018-03-10 17:07:38 +01:00
Fabio Berger
8a58ffda86 Fix tslint issues 2018-03-10 16:59:59 +01:00
Fabio Berger
cea8dcae3d Refactor Analytics so that calls to ReactGA are all in a single module, combining the provider type util function, moving GA id to configs and using utils.onPageLoadAsync 2018-03-10 16:53:42 +01:00
Brandon Millman
fc7e7d9331 Merge pull request #445 from 0xProject/feature/web3-logging
Fixed merge issue
2018-03-09 16:19:01 -08:00
Tom Schmidt
494bff4bc0 Fixed merge issue 2018-03-09 16:10:25 -08:00
Tom Schmidt
824ee8a3dc Merge pull request #441 from 0xProject/feature/website/web3-logging
Add web3 provider logging to GA
2018-03-09 15:31:21 -08:00
Tom Schmidt
47af38ecb8 Merge branch 'development' into feature/website/web3-logging 2018-03-09 15:22:59 -08:00
Tom Schmidt
654c790c3d Fixed Parity detection 2018-03-09 12:44:11 -08:00
Fabio Berger
7ebebb5bd9 Create blockchainWatcher class and refactor Portal such that Ether amounts are always passed around as baseUnits 2018-03-09 19:02:07 +01:00
Fabio Berger
8f921a61da Add getProvider method to web3Wrapper 2018-03-09 18:52:02 +01:00
Fabio Berger
cfd734d84f remove remaining declaration 2018-03-09 15:09:25 +01:00
Fabio Berger
342a697e42 Remove _exchangeAddress instance var from blockchain class 2018-03-09 15:08:22 +01:00
Fabio Berger
918f3cde94 Remove duplicitous methods from website's webWrapper 2018-03-09 15:08:02 +01:00
Fabio Berger
7b82a8669d Fix comment 2018-03-09 15:07:39 +01:00
Leonid Logvinov
7116f100ee Fix tests by passing DummyToken args 2018-03-09 14:16:38 +01:00
Fabio Berger
42fce45585 Merge pull request #443 from 0xProject/moveReactDocExample
Move `react-doc` example to separate sub-package
2018-03-09 14:10:56 +01:00
Fabio Berger
9da57daa7f Fix tslint error 2018-03-09 13:51:44 +01:00
Fabio Berger
e302d23317 Extend top-level tsconfigs 2018-03-09 13:44:56 +01:00
Fabio Berger
0edfa83951 Update README 2018-03-09 13:44:25 +01:00
Fabio Berger
a5ba049427 Update README 2018-03-09 13:41:31 +01:00
Fabio Berger
adba69a589 rm unnecessary npmignore 2018-03-09 11:06:03 +01:00
Fabio Berger
cc73f72d13 remove example top-level dir 2018-03-09 11:00:47 +01:00
Fabio Berger
e4f90996af Remove example from react-docs package to react-docs-example package 2018-03-09 10:49:57 +01:00
Fabio Berger
974c0d2b95 Fix isse of sourceMapLoader looking at node_modules 2018-03-09 10:18:15 +01:00
Fabio Berger
d1fc2a115e Export DocsState 2018-03-09 10:17:49 +01:00
Fabio Berger
a9373c7fb0 Remove unused dep from subproviders 2018-03-09 10:17:35 +01:00
Fabio Berger
8b604462ac Add missing dependencies 2018-03-09 10:17:23 +01:00
Fabio Berger
51e4a73439 Add missing package.json fields 2018-03-09 09:48:49 +01:00
Fabio Berger
d42cdcfd43 Improve README 2018-03-09 09:38:50 +01:00
Fabio Berger
c18acd0859 Remove screenshot and host it on S3 2018-03-09 09:37:03 +01:00
Fabio Berger
9699ee4eff Merge branch 'development' into addPackagePublishConfig
* development: (94 commits)
  Update CHANGELOG
  Add solc 0.4.20 and 0.4.21
  Prettier sra-report README
  Add new packages to top level README
  Updated @0xproject/utils in top level package.json
  Publish
  Updated CHANGELOGs
  Detail tests in the README
  Add support for ropsten and rinkeby
  Fix yarn.lock
  Update list of packages and organize them alphabetically
  Fix prettier issues
  Add support for going back to previous hashes via the browser back button to wiki
  Scroll to previous hashed elements when user clicks back button
  Add back strict null checks to react-shared package and fix issues
  remove ability to have implicit dependencies and add missing deps
  update license
  remove no-implicit-this
  Add example & screenshot to npmignore
  Remove `;` to be nice to windows users
  ...
2018-03-09 08:39:38 +01:00
Tom Schmidt
c78e504bfb Fixed lint 2018-03-08 17:08:43 -08:00
Amir Bandeali
0eeaac1f2b Update CHANGELOG 2018-03-08 17:01:02 -08:00
Amir Bandeali
b578517f91 Add solc 0.4.20 and 0.4.21 2018-03-08 16:43:32 -08:00
Tom Schmidt
c009e9979e Added web3 provider logging 2018-03-08 16:06:44 -08:00
Brandon Millman
22b6097e95 Prettier sra-report README 2018-03-08 10:44:49 -08:00
Brandon Millman
8e3446a389 Add new packages to top level README 2018-03-08 10:43:54 -08:00
Brandon Millman
1747d7a1bb Updated @0xproject/utils in top level package.json 2018-03-08 10:30:52 -08:00
Brandon Millman
8e5a876b37 Publish
- 0x.js@0.33.1
 - @0xproject/abi-gen@0.2.5
 - @0xproject/assert@0.2.0
 - @0xproject/base-contract@0.0.3
 - @0xproject/connect@0.6.3
 - contracts@2.1.15
 - @0xproject/deployer@0.2.1
 - @0xproject/dev-utils@0.2.1
 - @0xproject/json-schemas@0.7.14
 - @0xproject/react-docs@0.0.1
 - @0xproject/react-shared@0.0.1
 - @0xproject/sra-report@0.0.1
 - @0xproject/subproviders@0.7.0
 - @0xproject/testnet-faucets@1.0.16
 - @0xproject/types@0.3.1
 - @0xproject/utils@0.4.1
 - @0xproject/web3-wrapper@0.2.1
 - @0xproject/website@0.0.18
2018-03-08 10:20:46 -08:00
Brandon Millman
c71b710d7e Updated CHANGELOGs 2018-03-08 10:14:51 -08:00
Brandon Millman
7440b87596 Merge pull request #412 from 0xProject/feature/sra-reporter
Implement initial sra-report command line tool
2018-03-08 08:49:21 -08:00
Brandon Millman
583a17d627 Detail tests in the README 2018-03-08 08:45:05 -08:00
Brandon Millman
caf1a22084 Add support for ropsten and rinkeby 2018-03-08 08:44:45 -08:00
Brandon Millman
29abc5e921 Fix yarn.lock 2018-03-08 08:43:53 -08:00
Brandon Millman
098dae9a7e Merge branch 'development' into feature/sra-reporter
* development: (68 commits)
  Update list of packages and organize them alphabetically
  Fix prettier issues
  Add support for going back to previous hashes via the browser back button to wiki
  Scroll to previous hashed elements when user clicks back button
  Add back strict null checks to react-shared package and fix issues
  remove ability to have implicit dependencies and add missing deps
  update license
  remove no-implicit-this
  Add example & screenshot to npmignore
  Remove `;` to be nice to windows users
  Use unencoded @ symbol, browser will fix
  Fix external type links
  Add comment about commented out CSS exception
  Update prettier since the previous version had a bug when dealing with css files
  Fix css files with prettier
  Added base-contract package to README
  Prettify test jsons
  Update yarn.lock
  Improve README
  Feedback
  ...
2018-03-08 08:43:16 -08:00
Fabio Berger
aaa7affa46 Update list of packages and organize them alphabetically 2018-03-08 17:20:45 +01:00
Fabio Berger
40ca846cdc Merge pull request #438 from 0xProject/extractDocs
Extract Docs Template To Separate Package
2018-03-08 16:58:16 +01:00
Fabio Berger
da277f5b27 Add package.json publishConfig so that these packages are published as public. 2018-03-08 16:57:09 +01:00
Fabio Berger
2a24f6e2ea Fix prettier issues 2018-03-08 16:47:49 +01:00
Fabio Berger
98e8105ec5 Merge branch 'development' into extractDocs
* development:
  Added base-contract package to README
  Update yarn.lock
  Improve README
  Feedback
  README on derivation path
  Use our dev seed derivation path.
  README
  Add ledger-node package as optional dependency
  Force shouldGetChainCode to true in types
  Nuke tests for now
  Remove old ledger
  Update ledgerco packages
  Remove only
  Fix a typo
  Add PR name
  Improve an error message when an inorrect number of constructor params is passed
2018-03-08 16:40:46 +01:00
Fabio Berger
4a94a2b4e8 Add support for going back to previous hashes via the browser back button to wiki 2018-03-08 16:38:25 +01:00
Fabio Berger
2011349eb1 Scroll to previous hashed elements when user clicks back button 2018-03-08 16:35:33 +01:00
Fabio Berger
8057f4a678 Add back strict null checks to react-shared package and fix issues 2018-03-08 16:19:39 +01:00
Fabio Berger
f9ec8a0828 remove ability to have implicit dependencies and add missing deps 2018-03-08 16:00:15 +01:00
Fabio Berger
a0030c7bdb update license 2018-03-08 15:56:56 +01:00
Fabio Berger
0e4448fd3f remove no-implicit-this 2018-03-08 15:56:49 +01:00
Fabio Berger
21d2d59b50 Add example & screenshot to npmignore 2018-03-08 15:51:07 +01:00
Fabio Berger
295f177271 Remove ; to be nice to windows users 2018-03-08 14:44:58 +01:00
Fabio Berger
f3154313a8 Use unencoded @ symbol, browser will fix 2018-03-08 14:43:33 +01:00
Fabio Berger
e37f3b4fa3 Fix external type links 2018-03-08 14:43:09 +01:00
Fabio Berger
7e5c35d06e Add comment about commented out CSS exception 2018-03-08 14:39:28 +01:00
Fabio Berger
60756aa02b Update prettier since the previous version had a bug when dealing with css files 2018-03-08 14:37:25 +01:00
Fabio Berger
3779ab90de Fix css files with prettier 2018-03-08 14:37:05 +01:00
Fabio Berger
5b5037a844 Add publish config to package.json 2018-03-08 13:07:19 +01:00
Leonid Logvinov
03902b0b26 Merge pull request #419 from 0xProject/fix/deployer-args
Improve an error message when an incorrect number of constructor param…
2018-03-08 01:25:31 -08:00
Jacob Evans
883feabb8b Merge pull request #437 from 0xProject/feature/subproviders/update-ledgerco
Update ledgerco packages
2018-03-07 19:11:16 -05:00
Brandon Millman
5fb79e3253 Added base-contract package to README 2018-03-07 14:29:24 -08:00
Fabio Berger
c44811fbc2 Prettify test jsons 2018-03-07 22:01:37 +01:00
Fabio Berger
c3eaa694dd Update yarn.lock 2018-03-07 21:58:18 +01:00
Fabio Berger
bd8b8abfea Improve README 2018-03-07 21:44:11 +01:00
Jacob Evans
1a6c2e2bac Feedback 2018-03-07 15:20:06 -05:00
Jacob Evans
e2e6ae937d README on derivation path 2018-03-07 13:01:55 -05:00
Jacob Evans
5b9c5d2790 Use our dev seed derivation path.
Ensuring our signer address is 0x5409ed021d9299bf6814279a6a1411a7e866a631
2018-03-07 12:03:25 -05:00
Fabio Berger
896a57d4ed Flesh out the README 2018-03-07 16:48:28 +01:00
Fabio Berger
c3de8d3a67 Fix source line numbers in docJson since source needs to be identical to Github version tag for them to line up. 2018-03-07 16:15:10 +01:00
Fabio Berger
d1a92a0a2e fix source link 2018-03-07 16:05:20 +01:00
Fabio Berger
5f626495fd Add command to deploy react-docs example 2018-03-07 16:05:13 +01:00
Fabio Berger
238f3c89a7 Make sure we apply the appropriate syntax highlighting depending on the language of the docs 2018-03-07 15:32:37 +01:00
Fabio Berger
6e724eb8a5 Fix link color 2018-03-07 15:21:33 +01:00
Fabio Berger
9aec1feae3 Move remaining type configs to topLevel DocsInfoConfigs 2018-03-07 15:19:59 +01:00
Fabio Berger
8517de128b Update 0.1.12 json to add types 2018-03-07 14:27:12 +01:00
Fabio Berger
a3e15c910c Update 0.2.0 doc json to include types 2018-03-07 14:23:00 +01:00
Fabio Berger
a6303de4d1 Move RawLogEntry to types package 2018-03-07 14:22:15 +01:00
Fabio Berger
5356b0e118 Small improvements to docs 2018-03-07 14:11:14 +01:00
Fabio Berger
e31309f213 Allow user to change versions in demo example 2018-03-07 13:57:17 +01:00
Fabio Berger
6f8a70834b Add onSelectedVersion callback so it can be handled in any way the caller wishes 2018-03-07 13:25:15 +01:00
Fabio Berger
327cc307b3 Add back icons to example so that link icon renders 2018-03-07 11:05:48 +01:00
Fabio Berger
f191ba6e69 hide sidebar scrollbar unless onHover 2018-03-07 10:50:51 +01:00
Fabio Berger
a2b89411b0 Move example to it's own folder 2018-03-07 10:50:38 +01:00
Fabio Berger
f66efed777 Add example docs to react-docs package 2018-03-07 10:20:15 +01:00
Brandon Millman
f61b59fa89 Disable completed docs linting for globals 2018-03-07 00:17:39 -08:00
Brandon Millman
6288a72036 Add name to environment 2018-03-06 23:55:58 -08:00
Jacob Evans
a941f0ffb6 README 2018-03-06 21:01:39 -05:00
Jacob Evans
d7373a5c04 Add ledger-node package as optional dependency 2018-03-06 20:37:09 -05:00
Brandon Millman
2ff485d2e0 Add relevant newman typings 2018-03-06 16:25:51 -08:00
Brandon Millman
5a67068348 Random fixes 2018-03-06 15:39:38 -08:00
Brandon Millman
d39af6c9eb Print error message when no orders are found from /orders 2018-03-06 15:34:32 -08:00
Brandon Millman
1789025da9 Refactor environment factory and generalize token environment keys 2018-03-06 15:22:56 -08:00
Brandon Millman
696f49497b Flesh out README 2018-03-06 14:46:32 -08:00
Fabio Berger
e88eba1877 Fix tslint errors 2018-03-06 20:55:57 +01:00
Fabio Berger
f8b8a10b8f Make sidebar header configurable 2018-03-06 20:38:45 +01:00
Fabio Berger
01e505a5f4 Add publishConfig to package.json so that packages are published as public under the @0xproject namespace 2018-03-06 20:14:55 +01:00
Fabio Berger
5b2d9a4668 re-org index.ts 2018-03-06 19:50:33 +01:00
Fabio Berger
71008dc819 Remove menuSubsectionsBySection prop from Documentation component 2018-03-06 19:49:00 +01:00
Tom Schmidt
f27e943258 Added provider canonical name mapping 2018-03-06 09:47:13 -08:00
Fabio Berger
9301173f7d Rename docsVersion prop to selectedVersion and docsVersions to versions for clarity 2018-03-06 16:46:07 +01:00
Fabio Berger
60d95475eb Move DocsInfo out of the components folder 2018-03-06 16:45:25 +01:00
Fabio Berger
c8ace2edc0 Remove location prop 2018-03-06 16:37:37 +01:00
Fabio Berger
0b1ba9f997 Move Documentation to the @0xproject/react-docs package 2018-03-06 16:31:55 +01:00
Jacob Evans
f3026e33fd Force shouldGetChainCode to true in types 2018-03-06 08:57:54 -05:00
Fabio Berger
f014a97e9a Merge branch 'development' into extractDocs
* development:
  Also show staging 0x.js docs on development
  Fix source links in docs with a hack to support old and new versions of the TypeDoc JSON files
  remove from devDeps
  Remove date for now
  Add ethers typescript typings to 0x.js deps. The library works without this atm since another dep of 0x.js has it as a dep. But it's more robust to have it here.
  Add  missing instructions to add external types to tsconfig.json after installing the package
2018-03-06 11:11:35 +01:00
Brandon Millman
ddad09a936 Add support for custom environment file 2018-03-06 00:44:18 -08:00
Fabio Berger
5dd0654105 Also show staging 0x.js docs on development 2018-03-06 09:34:22 +01:00
Fabio Berger
b4b664e97a Fix source links in docs with a hack to support old and new versions of the TypeDoc JSON files 2018-03-06 09:33:35 +01:00
Brandon Millman
551771235b Prettier 2018-03-06 00:20:36 -08:00
Brandon Millman
eb201c4084 Add options for exporting environment and collection files 2018-03-06 00:18:58 -08:00
Jacob Evans
7bfc499ec8 Nuke tests for now 2018-03-05 22:36:53 -05:00
Jacob Evans
71e7e9c9c3 Remove old ledger 2018-03-05 21:07:07 -05:00
Jacob Evans
8521775389 Update ledgerco packages 2018-03-05 21:05:30 -05:00
Brandon Millman
61ad8d4c10 Add comment to environment factory 2018-03-05 16:31:39 -08:00
Brandon Millman
38a4ccd9f2 Change all globals in environment variables 2018-03-05 16:13:47 -08:00
Brandon Millman
cf342dd00e Change url command line option to endpoint-url 2018-03-05 15:31:42 -08:00
Brandon Millman
08ab81c54c Rename isHttpUrl to isWebUri in assert package 2018-03-05 15:24:55 -08:00
Brandon Millman
d355382f70 Update 0x package versions and fix yarn.lock 2018-03-05 15:15:03 -08:00
Brandon Millman
d171ce4fba Merge branch 'development' into feature/sra-reporter
* development: (79 commits)
  remove from devDeps
  Remove date for now
  Add ethers typescript typings to 0x.js deps. The library works without this atm since another dep of 0x.js has it as a dep. But it's more robust to have it here.
  Add  missing instructions to add external types to tsconfig.json after installing the package
  Fix bugs in postpublish_utils.js
  Update @0xproject/utils in top-level package.json
  Changelog tweaks
  Publish
  Updated CHANGELOGS
  Fix typo
  Add PR number to changelog entry
  Add changelog update to subproviders package
  Add `numberOfAccounts` param to `LedgerSubprovider` method `getAccountsAsync` and add tests
  Remove unnecessary type assertion
  Fix comments
  Add comments
  Don't need any external packages for 0x connect docs yet
  Instead of adding `@0xproject/types` to tsconfig.json, let's only add it when calling TypeDoc
  Fix styling
  Make prettier ignore postpublish_utils
  ...
2018-03-05 15:08:56 -08:00
Fabio Berger
5a90fece80 Moved over all pages/shared components and dependencies to react-shared 2018-03-05 13:53:13 +01:00
Fabio Berger
994935b5da Merge pull request #434 from 0xProject/addMissingReadmeInstructions
Add Missing README Instructions
2018-03-05 09:38:24 +01:00
Fabio Berger
874e667849 Bug fixes 2018-03-05 07:10:55 +01:00
Fabio Berger
1817f6eaf6 Merge branch 'development' into extractDocs
* development: (22 commits)
  Fix bugs in postpublish_utils.js
  Update @0xproject/utils in top-level package.json
  Changelog tweaks
  Publish
  Updated CHANGELOGS
  Fix typo
  Add PR number to changelog entry
  Add changelog update to subproviders package
  Add `numberOfAccounts` param to `LedgerSubprovider` method `getAccountsAsync` and add tests
  Remove unnecessary type assertion
  Move web3 typings from devDeps to deps
  remove extrenuous comma
  Add PR number
  Add changelog entries from types and utils
  Add changelog entry to subproviders
  Remove extra comma
  Move web3 and ethers types to deps for utils package
  Make web3 typings a dep for web3Wrapper
  Make web3 typings a dep for subproviders
  reorder deps
  ...

# Conflicts:
#	packages/website/package.json
2018-03-05 06:20:15 +01:00
Fabio Berger
2e19930178 remove from devDeps 2018-03-05 06:17:57 +01:00
Fabio Berger
2b01461748 Remove date for now 2018-03-05 06:17:19 +01:00
Fabio Berger
24b9df475c Add ethers typescript typings to 0x.js deps. The library works without this atm since another dep of 0x.js has it as a dep. But it's more robust to have it here. 2018-03-05 06:12:36 +01:00
Fabio Berger
011bab3c80 Add missing instructions to add external types to tsconfig.json after installing the package 2018-03-05 06:11:53 +01:00
Fabio Berger
699c0c3e05 Fix bugs in postpublish_utils.js 2018-03-04 21:24:47 +01:00
Fabio Berger
5f4b28960e Update @0xproject/utils in top-level package.json 2018-03-04 19:38:32 +01:00
Fabio Berger
3837913855 Changelog tweaks 2018-03-04 19:38:16 +01:00
Fabio Berger
65eb3997d9 Publish
- 0x.js@0.33.0
 - @0xproject/abi-gen@0.2.4
 - @0xproject/assert@0.1.0
 - @0xproject/base-contract@0.0.2
 - chai-as-promised-typescript-typings@0.0.10
 - chai-typescript-typings@0.0.4
 - @0xproject/connect@0.6.2
 - contracts@2.1.14
 - @0xproject/deployer@0.2.0
 - @0xproject/dev-utils@0.2.0
 - ethers-typescript-typings@0.0.2
 - @0xproject/json-schemas@0.7.13
 - @0xproject/monorepo-scripts@0.1.12
 - @0xproject/subproviders@0.6.0
 - @0xproject/testnet-faucets@1.0.15
 - @0xproject/tslint-config@0.4.10
 - @0xproject/types@0.3.0
 - @0xproject/utils@0.4.0
 - web3-typescript-typings@0.10.0
 - @0xproject/web3-wrapper@0.2.0
 - @0xproject/website@0.0.17
2018-03-04 19:35:59 +01:00
Fabio Berger
47411b406d Updated CHANGELOGS 2018-03-04 17:02:50 +01:00
Fabio Berger
f710026a8f Merge pull request #432 from 0xProject/improveLedgerSubprovider
Allow LedgerSubprovider to return any number of accounts
2018-03-04 16:57:25 +01:00
Fabio Berger
925e133f50 Fix typo 2018-03-04 16:42:16 +01:00
Fabio Berger
2bdd60ed72 Add PR number to changelog entry 2018-03-04 16:39:18 +01:00
Fabio Berger
9ac1cce26f Merge branch 'development' into improveLedgerSubprovider
* development: (28 commits)
  Remove unnecessary type assertion
  Fix comments
  Add comments
  Don't need any external packages for 0x connect docs yet
  Instead of adding `@0xproject/types` to tsconfig.json, let's only add it when calling TypeDoc
  Fix styling
  Make prettier ignore postpublish_utils
  Add hack comment
  Add comment about typeDoc versions
  Add support for merging multiple topLevel packages under a single section. For now, we simply merge the two package's children (works well for merging 0x.js types and @0xproject/types)
  Because we now include non-0x.js source, the keys changed. Needed to add both for backward compatibility with old doc JSON's
  Add support for backward compatibility for TypeDoc versions <0.9.0
  Consolidate all same exports together
  Add @0xproject/types to 0x.js tsconfig `include` so that TypeDoc also includes these types in the generated doc JSON
  Fix small bug where onHover type declarations with comments was taking up the entire window width
  Update to custom typeDoc fork with latest version (TS 2.7.0 support) + a bug fix allowing us to defer to the `include` in tsconfig.json on which files to run through TypeDoc
  Move web3 typings from devDeps to deps
  remove extrenuous comma
  Add PR number
  Add changelog entries from types and utils
  ...

# Conflicts:
#	packages/subproviders/CHANGELOG.md
2018-03-04 16:33:58 +01:00
Fabio Berger
0a597c94d6 Merge pull request #430 from 0xProject/0x.js/updateTypeDoc
Upgrade TypeDoc Dep & Add Missing @0xproject/types To Docs
2018-03-04 16:32:44 +01:00
Fabio Berger
02f82be094 Add changelog update to subproviders package 2018-03-04 15:52:52 +01:00
Fabio Berger
86e26240a1 Add numberOfAccounts param to LedgerSubprovider method getAccountsAsync and add tests 2018-03-04 15:52:16 +01:00
Fabio Berger
82c5be2564 Remove unnecessary type assertion 2018-03-04 15:29:14 +01:00
Fabio Berger
42f4f07268 Merge pull request #429 from 0xProject/fix/incorrectDeps
Move required typing from devDeps to deps
2018-03-04 15:21:32 +01:00
Fabio Berger
df4db8fa4c Merge branch '0x.js/updateTypeDoc' into extractDocs
* 0x.js/updateTypeDoc:
  Fix comments
  Add comments
  Don't need any external packages for 0x connect docs yet
  Instead of adding `@0xproject/types` to tsconfig.json, let's only add it when calling TypeDoc
  Fix styling
  Make prettier ignore postpublish_utils
  Update yarn.lock
2018-03-03 21:44:44 +01:00
Fabio Berger
bd85fe0af3 Fix comments 2018-03-03 21:43:11 +01:00
Fabio Berger
aee15e5dff Add comments 2018-03-03 21:37:42 +01:00
Fabio Berger
d7a803d9fd Don't need any external packages for 0x connect docs yet 2018-03-03 21:37:36 +01:00
Fabio Berger
839e5895e4 Instead of adding @0xproject/types to tsconfig.json, let's only add it when calling TypeDoc 2018-03-03 21:34:13 +01:00
Fabio Berger
49a4f0c74c Fix styling 2018-03-03 21:33:44 +01:00
Fabio Berger
5bea8e63de Make prettier ignore postpublish_utils 2018-03-03 21:32:10 +01:00
Fabio Berger
e64be284dd Merge branch 'development' into 0x.js/updateTypeDoc
* development:
  Update yarn.lock
  Update yarn.lock
  Update all mentions of the repo name being `0x.js` to `0x-monorepo`
2018-03-03 20:29:40 +01:00
Fabio Berger
e11e26a352 Add clean command 2018-03-03 20:29:24 +01:00
Fabio Berger
bee90abbc4 Add changelog and readme 2018-03-03 20:29:17 +01:00
Fabio Berger
8782559c33 remove top-level configs 2018-03-03 20:29:07 +01:00
Fabio Berger
223ddc0f68 Add react-shared as dep of website 2018-03-03 20:15:48 +01:00
Fabio Berger
4445d1d5a0 Update yarn.lock 2018-03-03 20:09:09 +01:00
Fabio Berger
b7d001da88 Setup initial react-shared sub-package 2018-03-03 19:58:30 +01:00
Fabio Berger
3592ebef08 Move over AnchorTitle and associated elements 2018-03-03 19:55:40 +01:00
Fabio Berger
a783d21409 Merge branch 'development' into extractDocs
* development:
  Update yarn.lock
  Update all mentions of the repo name being `0x.js` to `0x-monorepo`
2018-03-03 19:20:56 +01:00
Fabio Berger
a716e3de74 Update yarn.lock 2018-03-03 19:18:58 +01:00
Fabio Berger
c797c720be Update all mentions of the repo name being 0x.js to 0x-monorepo 2018-03-03 19:11:09 +01:00
Fabio Berger
1b5742fbf0 Add hack comment 2018-03-03 17:03:51 +01:00
Fabio Berger
5794349d97 Add comment about typeDoc versions 2018-03-03 17:02:12 +01:00
Fabio Berger
456f094913 Add support for merging multiple topLevel packages under a single section. For now, we simply merge the two package's children (works well for merging 0x.js types and @0xproject/types) 2018-03-03 16:52:59 +01:00
Fabio Berger
abb9eb0df4 Because we now include non-0x.js source, the keys changed. Needed to add both for backward compatibility with old doc JSON's 2018-03-03 16:51:45 +01:00
Fabio Berger
9e7b45ea4c Add support for backward compatibility for TypeDoc versions <0.9.0 2018-03-03 16:50:58 +01:00
Fabio Berger
6c6bd60a48 Consolidate all same exports together 2018-03-03 16:50:17 +01:00
Fabio Berger
cef82e72dc Add @0xproject/types to 0x.js tsconfig include so that TypeDoc also includes these types in the generated doc JSON 2018-03-03 16:49:56 +01:00
Fabio Berger
45b9647ba0 Fix small bug where onHover type declarations with comments was taking up the entire window width 2018-03-03 13:47:39 +01:00
Fabio Berger
160f74d53e Update to custom typeDoc fork with latest version (TS 2.7.0 support) + a bug fix allowing us to defer to the include in tsconfig.json on which files to run through TypeDoc 2018-03-03 13:46:42 +01:00
Fabio Berger
3ab6139522 Move web3 typings from devDeps to deps 2018-03-03 10:59:43 +01:00
Fabio Berger
9aa54257e7 remove extrenuous comma 2018-03-03 10:38:51 +01:00
Fabio Berger
8eafa62bbe Add PR number 2018-03-03 10:36:53 +01:00
Fabio Berger
968c24f0bc Add changelog entries from types and utils 2018-03-03 10:32:01 +01:00
Fabio Berger
e5c755b1fc Add changelog entry to subproviders 2018-03-03 10:29:14 +01:00
Fabio Berger
6d56f01c40 Remove extra comma 2018-03-03 10:28:51 +01:00
Fabio Berger
eefce48e68 Move web3 and ethers types to deps for utils package 2018-03-03 10:24:29 +01:00
Fabio Berger
c7d97c733a Make web3 typings a dep for web3Wrapper 2018-03-03 10:20:53 +01:00
Fabio Berger
3db42deb42 Make web3 typings a dep for subproviders 2018-03-03 10:20:30 +01:00
Fabio Berger
02603e8926 reorder deps 2018-03-03 10:20:04 +01:00
Fabio Berger
c5003554f4 Move ethers and web3 types to deps since both are required when interacting with this package 2018-03-03 10:06:02 +01:00
Fabio Berger
eb223805ca Move web3 typings to dependencies since the types package cannot function without them being available when imported 2018-03-03 10:02:48 +01:00
Fabio Berger
244c148a80 Improve repo description in README 2018-03-03 07:47:27 +01:00
Fabio Berger
4dbb2ed167 Merge pull request #427 from 0xProject/fix/doc_bugs
Miscellaneous Doc Fixes
2018-03-03 06:07:00 +01:00
Fabio Berger
212d680a47 Small stylistic improvements 2018-03-03 05:46:12 +01:00
Fabio Berger
a853e35dec Improve icon sizes 2018-03-03 05:42:32 +01:00
Fabio Berger
fdaf9f0bfc Fix comment and use named variable in conditional 2018-03-03 05:36:26 +01:00
Fabio Berger
0afe45b3a8 Hash hash instead of prefixedHash to scrollToHash function 2018-03-03 05:36:08 +01:00
Fabio Berger
f9a37168b0 Fix link to intro tutorial wiki article 2018-03-02 17:07:32 +01:00
Fabio Berger
52232e98c7 Make sure the page has loaded (including all images) before scrolling to hash 2018-03-02 17:02:14 +01:00
Fabio Berger
0fbb443e4b Move onPageLoadAsync to utils 2018-03-02 17:01:46 +01:00
Fabio Berger
8021694b81 Give all container files the proper file suffix: ts 2018-03-02 16:21:10 +01:00
Fabio Berger
a2b262c9df Add hash to URL onClick 2018-03-02 15:10:44 +01:00
Fabio Berger
5906f4c995 Add underline to internal linksx 2018-03-02 15:02:50 +01:00
Fabio Berger
da8edd2226 Undo config changes 2018-03-02 14:47:43 +01:00
Fabio Berger
406aedfdc2 Merge branch 'development' into fix/doc_bugs
* development: (21 commits)
  Adjust the tests
  Move tutorials to adhere to current dir structure
  Make tests slightly nicer
  Remove only
  Improve the comments
  Improve the comments
  Add comments to Arbitrage contract
  Don't pass tokenGet and tokenGive because we can get them from 0x order
  Pretty-print ED contracts
  Make external
  Fix a typo
  Change type to uint256
  Make setAllowances external
  Fix the comment
  Put all ED contracts in one folder
  Move tutorials contracts to src folder
  Remove false-positive linter failure because of chai-as-pronmised incorrect types
  Assert that the balances don't change if arbitrage fails
  Initial implementation of Arbitrage contract with tests
  Set max to 2 ETH/2 ZRX
  ...
2018-03-02 14:44:53 +01:00
Fabio Berger
67c834841e Update react-markdown, properly scroll to section for wiki internal links, consolidate scrollTo logic and make external links open in new tabs 2018-03-02 14:40:26 +01:00
Fabio Berger
edaa0b0e34 Update yarn lock 2018-03-02 14:38:46 +01:00
Fabio Berger
31f03fcf3a Use custom fork of react-highlight with support for Solidity syntax highlighting 2018-03-02 02:17:23 +01:00
Leonid Logvinov
4a57f2a762 Merge pull request #425 from 0xProject/feature/build_watch
Arbitrage tutorial contract
2018-03-01 16:57:58 -08:00
Brandon Millman
92b9dbd706 Fix up some postman tests 2018-03-01 14:41:16 -08:00
Leonid Logvinov
6edd7682a9 Adjust the tests 2018-03-01 13:25:01 -08:00
Leonid Logvinov
447891b396 Move tutorials to adhere to current dir structure 2018-03-01 13:23:29 -08:00
Brandon Millman
89bfcafb80 Add ethers types 2018-03-01 13:17:49 -08:00
Brandon Millman
a74a04c5d5 Fix yarn.lock 2018-03-01 13:06:08 -08:00
Brandon Millman
0c16f0ea22 Merge branch 'development' into feature/sra-reporter
* development: (71 commits)
  Set max to 2 ETH/2 ZRX
  Add missing types from website
  Add dependencies
  Update the README
  Move BaseContract to its own package
  Upgrate prettier
  remove unused import
  Move more configs into docsInfo and remove logic that does not belong there elsewhere
  Fix a bug with displaying solidity functions returning multiple return values
  Add ethers-contracts as a dependency
  Include types for ethers-contracts
  Fix the version
  Include types for ethers-contracts
  Rename idx to i
  Remove tslint disable
  Move BaseContract to web3Wrapper
  Merge ifs
  Fix an option description
  Add link to the docs
  Improve CHANGELOG entry
  ...
2018-03-01 13:04:55 -08:00
Brandon Millman
003d43b03a Flesh out postman test cases 2018-03-01 13:02:12 -08:00
Leonid Logvinov
6323496945 Make tests slightly nicer 2018-03-01 12:21:09 -08:00
Leonid Logvinov
fd5e231a93 Remove only 2018-03-01 12:21:09 -08:00
Leonid Logvinov
ae209677de Improve the comments 2018-03-01 12:21:09 -08:00
Leonid Logvinov
d5ca00de95 Improve the comments 2018-03-01 12:21:09 -08:00
Leonid Logvinov
7be84c6ad3 Add comments to Arbitrage contract 2018-03-01 12:21:09 -08:00
Leonid Logvinov
425039e4d3 Don't pass tokenGet and tokenGive because we can get them from 0x order 2018-03-01 12:21:09 -08:00
Leonid Logvinov
6c5333180d Pretty-print ED contracts 2018-03-01 12:21:09 -08:00
Leonid Logvinov
cb47a51b70 Make external 2018-03-01 12:21:09 -08:00
Leonid Logvinov
e36fb654b0 Fix a typo 2018-03-01 12:21:09 -08:00
Leonid Logvinov
6325fac020 Change type to uint256 2018-03-01 12:21:09 -08:00
Leonid Logvinov
c6358d5f22 Make setAllowances external 2018-03-01 12:21:09 -08:00
Leonid Logvinov
413e8b6062 Fix the comment 2018-03-01 12:21:09 -08:00
Leonid Logvinov
e113a8e7af Put all ED contracts in one folder 2018-03-01 12:21:08 -08:00
Leonid Logvinov
e42891ae5b Move tutorials contracts to src folder 2018-03-01 12:21:08 -08:00
Leonid Logvinov
c90770472e Remove false-positive linter failure because of chai-as-pronmised incorrect types 2018-03-01 12:21:08 -08:00
Leonid Logvinov
45df9de5b5 Assert that the balances don't change if arbitrage fails 2018-03-01 12:21:08 -08:00
Leonid Logvinov
2d0940589e Initial implementation of Arbitrage contract with tests 2018-03-01 12:21:08 -08:00
Fabio Berger
5908f189a7 Fix bug where contract event anchor ids were incorrect 2018-03-01 09:18:46 +01:00
Brandon Millman
17328bce53 Add more globals 2018-02-28 16:39:23 -08:00
Jacob Evans
451a0dacbe Merge pull request #418 from 0xProject/feature/facuet/balance-check
Prevent a single account from draining the faucet
2018-02-28 14:40:17 -08:00
Jacob Evans
a46199e37d Set max to 2 ETH/2 ZRX 2018-02-28 14:25:07 -08:00
Fabio Berger
e25cc301fd Add missing types from website 2018-02-28 17:20:09 +01:00
Leonid Logvinov
5bbb0d1f60 Merge pull request #422 from 0xProject/feature/new-prettier
Upgrade prettier
2018-02-27 22:34:23 -08:00
Leonid Logvinov
a5b8875356 Merge pull request #423 from 0xProject/feature/base-contract
Move BaseContract to its own package
2018-02-27 18:44:23 -08:00
Leonid Logvinov
3e86df311d Add dependencies 2018-02-27 18:34:00 -08:00
Leonid Logvinov
002f9ebde7 Update the README 2018-02-27 18:33:05 -08:00
Leonid Logvinov
72e6e1ce8b Move BaseContract to its own package 2018-02-27 17:51:31 -08:00
Brandon Millman
a3c7af95e1 Add stringified order object into globals 2018-02-27 17:25:42 -08:00
Brandon Millman
0987c9a7cf Write to provided output directory 2018-02-27 17:12:45 -08:00
Fabio Berger
bbd87daf6d Merge pull request #421 from 0xProject/moveOutDocGenerator
Docs Refactor Prepping For Moving To Separate Package
2018-02-27 15:49:58 -08:00
Leonid Logvinov
30e4613d0a Upgrate prettier 2018-02-27 15:08:52 -08:00
Fabio Berger
79593f52b0 remove unused import 2018-02-27 14:50:35 -08:00
Leonid Logvinov
bab8c1eeff Remove only 2018-02-27 14:43:29 -08:00
Leonid Logvinov
8b6cc95c1b Fix a typo 2018-02-27 14:42:49 -08:00
Leonid Logvinov
90236b87de Add PR name 2018-02-27 14:42:49 -08:00
Leonid Logvinov
b6a133cc64 Improve an error message when an inorrect number of constructor params is passed 2018-02-27 14:42:49 -08:00
Leonid Logvinov
7aa070f9ea Merge pull request #413 from 0xProject/feature/ethers-contracts
abi-gen V2 abi and ethers-contracts
2018-02-27 14:41:59 -08:00
Leonid Logvinov
c2ec2291e8 Merge pull request #420 from 0xProject/fix/multiple-return-docs
Fix a bug with displaying solidity functions returning multiple retur…
2018-02-27 14:36:59 -08:00
Fabio Berger
97fcfb7f6c Move more configs into docsInfo and remove logic that does not belong there elsewhere 2018-02-27 14:29:22 -08:00
Leonid Logvinov
ce677fd55a Fix a bug with displaying solidity functions returning multiple return values 2018-02-27 14:23:36 -08:00
Brandon Millman
e48a3edacb Get orderHash via 0x connect 2018-02-27 14:11:45 -08:00
Leonid Logvinov
ce0b92d681 Add ethers-contracts as a dependency 2018-02-27 13:19:17 -08:00
Leonid Logvinov
29c5ba5639 Include types for ethers-contracts 2018-02-27 12:50:58 -08:00
Leonid Logvinov
cdea618457 Fix the version 2018-02-27 12:20:44 -08:00
Leonid Logvinov
425a519f97 Include types for ethers-contracts 2018-02-27 12:18:52 -08:00
Leonid Logvinov
c07d64c6ff Rename idx to i 2018-02-27 12:07:59 -08:00
Leonid Logvinov
c07e3a76bb Remove tslint disable 2018-02-27 12:07:58 -08:00
Leonid Logvinov
8fe844bcc9 Move BaseContract to web3Wrapper 2018-02-27 12:07:58 -08:00
Leonid Logvinov
a0390956a9 Merge ifs 2018-02-27 12:07:06 -08:00
Leonid Logvinov
4f1e6296ca Fix an option description 2018-02-27 12:07:06 -08:00
Leonid Logvinov
0ef372e531 Add link to the docs 2018-02-27 12:07:06 -08:00
Leonid Logvinov
06e2894750 Improve CHANGELOG entry 2018-02-27 12:07:06 -08:00
Leonid Logvinov
10e2d4b99c Remove unused param 2018-02-27 12:07:06 -08:00
Leonid Logvinov
ef40cb9687 Add txData to async calls 2018-02-27 12:07:06 -08:00
Leonid Logvinov
758604fc1a Include ethers types 2018-02-27 12:06:02 -08:00
Leonid Logvinov
34c1134b55 Create ethers-typescript-typings 2018-02-27 12:06:02 -08:00
Leonid Logvinov
a5ef1db0c5 Rewrite templates to decode call data on transactions 2018-02-27 12:06:02 -08:00
Leonid Logvinov
748ed40321 Add to context data 2018-02-27 12:06:02 -08:00
Leonid Logvinov
42063f785e Use as a backend to decode event args 2018-02-27 12:06:02 -08:00
Leonid Logvinov
1657451f37 Add as an option to 2018-02-27 12:06:02 -08:00
Leonid Logvinov
0bb0bff0b3 Change backend for contracts contracts 2018-02-27 12:06:02 -08:00
Leonid Logvinov
747732118c Fix namings 2018-02-27 12:06:02 -08:00
Leonid Logvinov
2aec1501d0 Update template link 2018-02-27 12:06:02 -08:00
Leonid Logvinov
39c6bc1106 Add PR number 2018-02-27 12:06:01 -08:00
Leonid Logvinov
4e451479f8 Fix build 2018-02-27 12:05:46 -08:00
Leonid Logvinov
93b2736d65 Use the same templates as 0x.js 2018-02-27 12:05:46 -08:00
Leonid Logvinov
34274a1042 Pass components to parameterType 2018-02-27 12:05:46 -08:00
Leonid Logvinov
fa822caa62 Apply prettier after generating contracts 2018-02-27 12:05:46 -08:00
Leonid Logvinov
ddc30cc2c0 Add CHANGELOG entry 2018-02-27 12:05:46 -08:00
Leonid Logvinov
9d9cab1711 Fix build by using local events types 2018-02-27 12:05:23 -08:00
Leonid Logvinov
fe8f2d8d89 Add support for ABIv2 to abi-gen 2018-02-27 12:05:23 -08:00
Leonid Logvinov
2d561bc8a0 Allow users to specify the contracts backend in abi-gen 2018-02-27 12:05:23 -08:00
Leonid Logvinov
f5275d3ad7 Add data to TxData 2018-02-27 12:05:23 -08:00
Leonid Logvinov
5fbdf9cfb9 Pass whole txData to estimateGas 2018-02-27 12:05:22 -08:00
Leonid Logvinov
0409c9c1e5 Fix default contract set calculation 2018-02-27 12:05:22 -08:00
Leonid Logvinov
42a5da1df4 Fix default paths 2018-02-27 12:05:22 -08:00
Leonid Logvinov
0b326a8bbe Add web3Wrapper.callAsync and remove web3Wrapper.getContractInstance 2018-02-27 12:05:22 -08:00
Brandon Millman
9c8501a84e Refactor environment factory and promisify newman 2018-02-27 11:51:05 -08:00
Leonid Logvinov
2da7f82171 Merge pull request #415 from 0xProject/fix/unsubscribeAll
Rename _unsubscribeAll to unsubscribeAll
2018-02-27 10:25:52 -08:00
Leonid Logvinov
593474031d Merge branch 'development' into fix/unsubscribeAll 2018-02-27 10:24:36 -08:00
Fabio Berger
fce10548d2 Merge pull request #373 from 0xProject/feature/0x.js/lowercase-addresses
Lowercase addresses in the Public API
2018-02-27 09:58:09 -08:00
Jacob Evans
addca63938 Prevent a single account from draining the faucet 2018-02-26 21:15:11 -08:00
Jacob Evans
6961169f89 Merge branch 'development' into feature/0x.js/lowercase-addresses 2018-02-26 18:47:09 -08:00
Jacob Evans
3d66feb89f Lowercase web3 wrapper addresses
Ensure all of the user account addresses are lower case when returned from web3wrapper
2018-02-26 18:10:27 -08:00
Brandon Millman
bb157eefc6 Add exchange contract address to environment files 2018-02-26 17:13:14 -08:00
Leonid Logvinov
7f8f4df0a0 Rename _unsubscribeAll to unsubscribeAll 2018-02-26 14:38:17 -08:00
Brandon Millman
4b325676f7 Add schema validation to each collection folder and flesh out params 2018-02-26 13:32:57 -08:00
Fabio Berger
ecba95250d Update missed docsJsonRoot variables 2018-02-26 10:09:22 -08:00
Fabio Berger
dd116b3cd6 remove docsJsonRoot from docsInfo 2018-02-26 09:52:08 -08:00
Jacob Evans
eabe96fd19 Check isETHAddressHex before lowercase
Flip the check so assertion happens before lowercase
2018-02-26 09:39:46 -08:00
Fabio Berger
7dd9ce2e32 Remove unused props 2018-02-26 07:57:41 -08:00
Fabio Berger
fffaafe4c9 Merge branch 'development' into moveOutDocGenerator
* development: (36 commits)
  Fix english translations
  Fix footer on mobile
  re-add google analytics code
  Fix Russian translation
  Move all dependencies on @0xproject/types out of devDependencies
  Slight improvement to footer
  Fix a few Korean translations
  Address feedback
  Use source tree hash instead of compile flag
  Fix race condition
  Update CHANGELOG
  Delete artifacts directory
  Add generated contract artifacts to gitignore
  Check dependencies when determining if should be recompiled
  Update CHANGELOG
  Remove unused CHANGELOG entry
  Remove unused import
  Change assert.doesConformToShema interface
  Remove a type assertion
  Publish
  ...
2018-02-25 18:32:12 -08:00
Brandon Millman
0b9646136a Update postman collection to load json schemas into tv4 before every test run 2018-02-23 14:26:24 -08:00
Brandon Millman
55f38b9c35 Add an array of schemaKeys to the globals 2018-02-23 14:25:48 -08:00
Fabio Berger
709fa9e02e Fix english translations 2018-02-23 14:15:53 -08:00
Fabio Berger
f42bdb8bab Fix footer on mobile 2018-02-23 14:15:39 -08:00
Fabio Berger
10aed46062 Merge branch 'development' of github.com:0xProject/0x.js into development
* 'development' of github.com:0xProject/0x.js:
  Update CHANGELOG
  Remove unused CHANGELOG entry
  Remove unused import
  Change assert.doesConformToShema interface
  Remove a type assertion
  Remove type-level validation
  Access property over this
  Add type cast
  Fix tests
  Add entries to the CHANGELOG
  Better validate ZeroExConfig on public networks
2018-02-23 14:15:29 -08:00
Fabio Berger
6e43e89b2d re-add google analytics code 2018-02-23 13:49:24 -08:00
Leonid Logvinov
10c0c0b6d2 Merge pull request #385 from 0xProject/feature/0x_config_validation
Better validate ZeroExConfig on private networks
2018-02-23 13:20:28 -08:00
Brandon Millman
e13924cd2d Remove url from kovan environment json 2018-02-23 11:57:33 -08:00
Brandon Millman
7afe00f06a Use Schema interface from @0xproject/json-schemas 2018-02-23 11:56:50 -08:00
Brandon Millman
87b9caa7dc Fix README typo 2018-02-23 11:47:45 -08:00
Jacob Evans
f689d335c0 Check maker is valid address 2018-02-22 18:43:01 -08:00
Jacob Evans
31f9a848f9 Lowercase public addresses
Normalize the public api addresses to lowercase to prevent an avoidable
error
2018-02-22 18:43:00 -08:00
Fabio Berger
3d2c5d67af Fix Russian translation 2018-02-22 16:32:19 -08:00
Brandon Millman
63f8f469b0 Fix @types/lodash version 2018-02-22 13:54:39 -08:00
Brandon Millman
9929f1acf0 Merge pull request #411 from 0xProject/fix/types/dev-dependencies
Move all dependencies on @0xproject/types out of devDependencies
2018-02-22 13:30:35 -08:00
Brandon Millman
42ecc087cb Implement initial sra-report command line tool 2018-02-22 13:12:44 -08:00
Brandon Millman
93adee36b0 Move all dependencies on @0xproject/types out of devDependencies 2018-02-22 00:35:16 -08:00
Fabio Berger
0e95fd0b9b Slight improvement to footer 2018-02-21 17:40:07 -08:00
Fabio Berger
611ddfeeb8 Fix a few Korean translations 2018-02-21 17:17:09 -08:00
Fabio Berger
dfe2579eeb Merge pull request #410 from 0xProject/translateHomepage
Translate Landing Page
2018-02-21 17:09:33 -08:00
Fabio Berger
66b36f6d8f Begin refactoring out doc generator template 2018-02-21 16:34:14 -08:00
Fabio Berger
1b3a9102f1 Move from storing translations in TS files to JSON files 2018-02-21 14:22:02 -08:00
Fabio Berger
9993a50903 Remove Segment.io 2018-02-21 12:06:53 -08:00
Fabio Berger
c226509be0 Remove unused var 2018-02-21 11:56:10 -08:00
Fabio Berger
ef6f52e722 Remove extenuous defaultProps 2018-02-21 11:54:03 -08:00
Fabio Berger
7d8cad8e3a Make translate required by footer 2018-02-21 11:51:41 -08:00
Fabio Berger
15507d3827 Make translate a required prop of TopBar 2018-02-21 11:49:54 -08:00
Fabio Berger
e2d17d122e Keep topBar and footer language to the one picked by the user 2018-02-21 11:46:16 -08:00
Fabio Berger
0d7bf50581 Re-set language to browser 2018-02-21 10:31:31 -08:00
Fabio Berger
a50618fcb0 Fix rocket.chat key 2018-02-21 10:31:15 -08:00
Fabio Berger
fc2a9a756a Mobile optimize translated landing page 2018-02-21 09:59:09 -08:00
Leonid Logvinov
07721eb99f Improve russian translations 2018-02-20 20:15:36 -08:00
Fabio Berger
13fed15e0c Improve homepage and add translations in chinese, russian, korean and spanish 2018-02-20 19:53:07 -08:00
Fabio Berger
38a308ce5b Move translate to redux 2018-02-20 19:52:28 -08:00
Amir Bandeali
be19316dfb Merge pull request #408 from 0xProject/fix/deployer/checkDependencies
Check dependencies when compiling contracts
2018-02-20 15:21:29 -08:00
Fabio Berger
c4f65681a1 Add translation infra and replace english text with calls to translate 2018-02-20 14:11:19 -08:00
Fabio Berger
f600226aa9 Move tsconfig package to devDeps 2018-02-20 14:10:07 -08:00
Amir Bandeali
67f2864501 Address feedback 2018-02-20 13:42:35 -08:00
Amir Bandeali
c1bbcaba73 Use source tree hash instead of compile flag 2018-02-20 13:19:12 -08:00
Amir Bandeali
6685cb3fba Fix race condition 2018-02-20 13:19:12 -08:00
Amir Bandeali
d770e46208 Update CHANGELOG 2018-02-20 13:19:12 -08:00
Amir Bandeali
665636e642 Delete artifacts directory 2018-02-20 13:19:12 -08:00
Amir Bandeali
0028e71ab2 Add generated contract artifacts to gitignore 2018-02-20 13:19:12 -08:00
Amir Bandeali
7fb66bf71a Check dependencies when determining if should be recompiled 2018-02-20 13:19:12 -08:00
Leonid Logvinov
3120d854f8 Update CHANGELOG 2018-02-20 12:09:39 -08:00
Leonid Logvinov
c85c14210f Remove unused CHANGELOG entry 2018-02-20 12:03:33 -08:00
Leonid Logvinov
0fb81a11a8 Remove unused import 2018-02-20 12:03:21 -08:00
Leonid Logvinov
7b67afae06 Change assert.doesConformToShema interface 2018-02-20 11:39:36 -08:00
Leonid Logvinov
fe9e319a61 Remove a type assertion 2018-02-20 11:34:29 -08:00
Leonid
097fc477a2 Merge pull request #401 from 0xProject/feature/web3-abi-v2-types
Add types for ABIv2
2018-02-20 11:55:29 -07:00
Leonid
f60b00d116 Merge branch 'development' into feature/web3-abi-v2-types 2018-02-20 11:55:10 -07:00
Brandon Millman
3a36e0621f Publish
- @0xproject/connect@0.6.1
2018-02-16 22:54:28 -07:00
Brandon Millman
b482473e23 Updated CHANGELOGs 2018-02-16 22:51:29 -07:00
Brandon Millman
9a5fd3f784 Merge pull request #407 from 0xProject/fix/connect/empty-response
Do not JSON parse empty reponse
2018-02-16 21:50:39 -08:00
Brandon Millman
b703ccde9b Do not JSON parse empty reponse 2018-02-16 22:43:37 -07:00
Brandon Millman
80eca30725 Fix incorrect comment on WebSocketOrderbookChannel constructor 2018-02-16 10:11:40 -07:00
Brandon Millman
7dbc14dc43 Fix broken postpublish script in connect 2018-02-16 10:06:47 -07:00
Brandon Millman
b3f9010eb5 Updated top level @0xproject/utils dependency 2018-02-16 10:00:39 -07:00
Brandon Millman
f62d72e548 Publish
- 0x.js@0.32.4
 - @0xproject/abi-gen@0.2.3
 - @0xproject/assert@0.0.20
 - @0xproject/connect@0.6.0
 - contracts@2.1.13
 - @0xproject/deployer@0.1.0
 - @0xproject/dev-utils@0.1.0
 - @0xproject/json-schemas@0.7.12
 - @0xproject/subproviders@0.5.0
 - @0xproject/testnet-faucets@1.0.14
 - @0xproject/types@0.2.3
 - @0xproject/utils@0.3.4
 - web3-typescript-typings@0.9.11
 - @0xproject/web3-wrapper@0.1.14
 - @0xproject/website@0.0.16
2018-02-16 09:53:35 -07:00
Brandon Millman
d12352972e Updated CHANGELOGs 2018-02-16 09:49:02 -07:00
Brandon Millman
03d3d84db3 Merge pull request #406 from 0xProject/feature/connect/heartbeat
Add configurable heartbeat to WebSocketOrderbookChannel
2018-02-16 08:10:00 -08:00
Brandon Millman
6d818c25c7 Add an enforced minimum for the heartbeat interval 2018-02-16 08:48:15 -07:00
Fabio Berger
6a8f624e75 Add Rinkeby network to smart contract docs 2018-02-16 08:47:27 -07:00
Fabio Berger
0801b1ddf9 Updated CHANGELOG 2018-02-16 08:47:10 -07:00
Fabio Berger
4fd64ca492 Merge pull request #405 from 0xProject/refactor/docs-redesign
Re-design Wiki + Doc pages
2018-02-16 07:45:55 -08:00
Brandon Millman
c4bcf24640 Add configurable heartbeat to WebSocketOrderbookChannel 2018-02-16 01:20:27 -07:00
Fabio Berger
0114fc9608 remove hard-coded color 2018-02-16 00:12:27 -07:00
Fabio Berger
8db098eaec Remove section links until they go somewhere 2018-02-16 00:09:10 -07:00
Fabio Berger
05c3a66543 Add more padding on top of section title 2018-02-16 00:08:57 -07:00
Fabio Berger
9349752baa Add hack comment explaining param count short-cut 2018-02-15 23:56:19 -07:00
Fabio Berger
974fab7284 replace repeated conditionals with variable 2018-02-15 23:54:36 -07:00
Fabio Berger
8a52ffe7b7 Remove unneeded props 2018-02-15 23:52:49 -07:00
Fabio Berger
c6ecdbd86e use const over hard-coding 2018-02-15 23:52:40 -07:00
Fabio Berger
03797545f9 uncomment dev logic 2018-02-15 23:51:10 -07:00
Fabio Berger
2778f96483 Re-design docs pages 2018-02-15 21:51:49 -07:00
Fabio Berger
6cd4e7a17e Add icons for all doc pages 2018-02-15 21:51:37 -07:00
Fabio Berger
5c91b4bfc6 Re-designed Wiki and half-redesigned docs pages 2018-02-15 20:12:47 -07:00
Fabio Berger
e2b51c5dc4 Merge branch 'development' of github.com:0xProject/0x.js into development
* 'development' of github.com:0xProject/0x.js: (24 commits)
  Rename variables
  Update CHANGELOG
  Add npm config for contracts list
  Run prettier
  Fix checks, add contract list to compile script in package.json
  Add contracts to compiler options
  Add missing public types from connect docs
  Change imports order
  Change default page params in connect to page 1 and perPage 100
  Add docs staging to 0x.js package
  Fix a typo
  Add an assertion
  Add PR numbers
  Fix entry points
  Add tests for dev-utils package
  Move subproviders from dev-utils to subproviders
  Add missing CHANGELOG entry
  Add support for intersection types in docs
  Add stagedocs script to connect package
  web3 typings fix - web3.net.peerCount returns number
  ...
2018-02-15 20:09:53 -07:00
Fabio Berger
b610b7c192 Prettier fixes 2018-02-15 20:09:24 -07:00
Amir Bandeali
b75fdd6b66 Merge pull request #400 from 0xProject/feature/deployer/selectContracts
Pass in contracts to compile in deployer
2018-02-15 12:27:43 -08:00
Amir Bandeali
060b02eaed Rename variables 2018-02-15 10:20:03 -08:00
Amir Bandeali
003e5da00d Update CHANGELOG 2018-02-15 10:13:06 -08:00
Amir Bandeali
02951d4813 Add npm config for contracts list 2018-02-15 10:13:06 -08:00
Amir Bandeali
db52ed9941 Run prettier 2018-02-15 10:13:06 -08:00
Amir Bandeali
af333b1838 Fix checks, add contract list to compile script in package.json 2018-02-15 10:13:06 -08:00
Amir Bandeali
f62762bd0e Add contracts to compiler options 2018-02-15 10:13:06 -08:00
Brandon Millman
4b67352278 Add missing public types from connect docs 2018-02-15 00:18:48 -08:00
Leonid Logvinov
76afb6b116 Add types for ABIv2 2018-02-14 15:52:06 -08:00
Leonid Logvinov
db52e87740 Remove type-level validation 2018-02-14 15:25:30 -08:00
Leonid
e22788abe8 Merge pull request #392 from 0xProject/feature/subproviders_move
Move subproviders from dev-utils to subproviders package and add tests for dev-utils
2018-02-15 00:13:12 +01:00
Leonid Logvinov
bbfbfcda85 Change imports order 2018-02-14 15:03:52 -08:00
Brandon Millman
0dfb36e675 Merge pull request #398 from 0xProject/feature/website/stage-documentation
Add support for intersection types and staged connect documentation
2018-02-14 14:45:33 -08:00
Brandon Millman
95a9d77301 Change default page params in connect to page 1 and perPage 100 2018-02-14 14:43:43 -08:00
Leonid
ab1f070901 Merge pull request #386 from 0xProject/fix/windows_install
Use system-independent rm command
2018-02-14 23:38:48 +01:00
Brandon Millman
8201d5d1f8 Add docs staging to 0x.js package 2018-02-14 14:35:31 -08:00
Leonid Logvinov
8704c34a0f Fix a typo 2018-02-14 11:54:20 -08:00
Leonid Logvinov
599adaf1bf Add an assertion 2018-02-14 11:53:40 -08:00
Leonid Logvinov
778e399438 Add PR numbers 2018-02-14 11:51:26 -08:00
Leonid Logvinov
485ae4d997 Fix entry points 2018-02-14 11:51:26 -08:00
Leonid Logvinov
8cd2ba3ad6 Add tests for dev-utils package 2018-02-14 11:51:26 -08:00
Leonid Logvinov
dbad7d1869 Move subproviders from dev-utils to subproviders 2018-02-14 11:51:26 -08:00
Leonid Logvinov
4d482438f5 Access property over this 2018-02-14 11:24:42 -08:00
Leonid Logvinov
b53a1b51d6 Add type cast 2018-02-14 11:22:37 -08:00
Leonid Logvinov
49375c73d4 Fix tests 2018-02-14 11:22:36 -08:00
Leonid Logvinov
98b78c56c5 Add entries to the CHANGELOG 2018-02-14 11:22:36 -08:00
Leonid Logvinov
f3e6ef0fa9 Better validate ZeroExConfig on public networks 2018-02-14 11:22:36 -08:00
Leonid Logvinov
18e1c2dea5 Add missing CHANGELOG entry 2018-02-14 10:23:20 -08:00
Leonid
91ae01e484 Merge pull request #397 from gagarin55/typings-fix
web3-typescript-typings fix - web3.net.peerCount returns number
2018-02-14 19:19:48 +01:00
Brandon Millman
2897b72967 Add support for intersection types in docs 2018-02-14 10:16:00 -08:00
Brandon Millman
3510985cf4 Add stagedocs script to connect package 2018-02-14 10:15:53 -08:00
gagarin55
5927e65045 web3 typings fix - web3.net.peerCount returns number 2018-02-14 16:18:49 +03:00
Brandon Millman
13e2041d50 Merge pull request #394 from 0xProject/feature/connect/add-pagination
Add page options to relevant HttpClient methods
2018-02-13 17:30:46 -08:00
Brandon Millman
4bf530ed9e Fix error in paged request schema 2018-02-13 16:55:48 -08:00
Brandon Millman
4c797405ad Addressed PR feedback 2018-02-13 15:50:28 -08:00
Brandon Millman
713c922e35 Add page options to relevant HttpClient methods 2018-02-13 14:15:54 -08:00
Leonid
7f1e789264 Merge branch 'development' into fix/windows_install 2018-02-12 15:01:24 +01:00
Fabio Berger
07d00cc515 Publish
- 0x.js@0.32.3
 - @0xproject/abi-gen@0.2.2
 - @0xproject/assert@0.0.19
 - @0xproject/connect@0.5.8
 - contracts@2.1.12
 - @0xproject/deployer@0.0.9
 - @0xproject/dev-utils@0.0.13
 - @0xproject/json-schemas@0.7.11
 - @0xproject/monorepo-scripts@0.1.11
 - @0xproject/subproviders@0.4.2
 - @0xproject/testnet-faucets@1.0.13
 - @0xproject/tslint-config@0.4.9
 - @0xproject/types@0.2.2
 - @0xproject/utils@0.3.3
 - @0xproject/web3-wrapper@0.1.13
 - @0xproject/website@0.0.15
2018-02-09 18:36:51 -08:00
Fabio Berger
cd55e346af Move tslint and tslint-eslint-rules to dev deps since this package needs them to function 2018-02-09 18:12:29 -08:00
Fabio Berger
6746428fb1 Update utils in top-level package.json 2018-02-09 16:29:09 -08:00
Fabio Berger
634032d5be Publish
- 0x.js@0.32.2
 - @0xproject/abi-gen@0.2.1
 - @0xproject/assert@0.0.18
 - chai-as-promised-typescript-typings@0.0.9
 - chai-typescript-typings@0.0.3
 - @0xproject/connect@0.5.7
 - contracts@2.1.11
 - @0xproject/deployer@0.0.8
 - @0xproject/dev-utils@0.0.12
 - @0xproject/json-schemas@0.7.10
 - @0xproject/monorepo-scripts@0.1.10
 - @0xproject/subproviders@0.4.1
 - @0xproject/testnet-faucets@1.0.12
 - @0xproject/tslint-config@0.4.8
 - @0xproject/types@0.2.1
 - @0xproject/utils@0.3.2
 - web3-typescript-typings@0.9.10
 - @0xproject/web3-wrapper@0.1.12
 - @0xproject/website@0.0.14
2018-02-09 16:19:43 -08:00
Fabio Berger
602abc53dd Fix version in CHANGELOG 2018-02-09 16:18:47 -08:00
Fabio Berger
fdbaa9768a Update changelog version 2018-02-09 16:09:53 -08:00
Fabio Berger
293d7261e0 Fix changelog version 2018-02-09 16:08:26 -08:00
Fabio Berger
efb6eb28ce Merge pull request #389 from 0xProject/fix/npmInclusionIssues
Fix NPM Inclusion Issues
2018-02-09 14:39:05 -08:00
Fabio Berger
ac5531ce85 Fix changelogs 2018-02-09 14:26:48 -08:00
Fabio Berger
bc2415c70e Add yarn-error.log to all .npmignore 2018-02-09 14:03:08 -08:00
Fabio Berger
0fd411f83f Add PR number to CHANGELOGs 2018-02-09 13:31:01 -08:00
Fabio Berger
b74ad0ad12 ignore all files starting with dots in all sub-packages 2018-02-09 13:28:32 -08:00
Fabio Berger
4c58836735 Remove top level .npmignore 2018-02-09 13:19:30 -08:00
Fabio Berger
3206b80dbd Add npmignore to web3-wrapper and update CHANGELOG 2018-02-09 13:18:49 -08:00
Fabio Berger
4910f7a61e Add npmignore and remove .gitignore 2018-02-09 13:16:16 -08:00
Fabio Berger
6e9109eaec Add npmignore to utils and update CHANGELOG 2018-02-09 13:14:31 -08:00
Fabio Berger
a04ec14cf0 Add npmignore to types and update CHANGELOG 2018-02-09 13:12:33 -08:00
Fabio Berger
7d3df3c117 cleanup npmignorex 2018-02-09 13:09:57 -08:00
Fabio Berger
b3a03f8e3e Add npmignore to subproviders and update CHANGELOG 2018-02-09 13:09:00 -08:00
Fabio Berger
e5668c1e5c Add npmignore to json-schemas and update CHANGELOG 2018-02-09 13:05:21 -08:00
Fabio Berger
92e74bc4fa Add npmignore to dev-utils and update CHANGELOG 2018-02-09 12:56:48 -08:00
Fabio Berger
7e12269baf Add npmignore to deployer along with a changelog 2018-02-09 12:52:12 -08:00
Fabio Berger
f3f264f5fd Add tslint.json to deployer package and fix all tslint issues 2018-02-09 12:50:37 -08:00
Brandon Millman
2e3c9b87df Merge pull request #388 from 0xProject/fix/testnet-faucet/base-unit-orders
Convert to baseUnits in signed order
2018-02-09 12:39:43 -08:00
Fabio Berger
0a113e1cf7 Add npmignore to subpackage and update CHANGELOG 2018-02-09 12:37:28 -08:00
Fabio Berger
fd772c48cf Add npmignore to typings packages 2018-02-09 12:37:18 -08:00
Fabio Berger
1c7dce6054 Add npmignore to subpackage and update CHANGELOG 2018-02-09 12:30:06 -08:00
Jacob Evans
0a2947b860 address is not optional in this context 2018-02-09 12:27:28 -08:00
Fabio Berger
c80877af43 Add npmignore to abi-gen and update CHANGELOG 2018-02-09 12:23:03 -08:00
Jacob Evans
e68b9c7e81 Convert to baseUnits in signed order 2018-02-09 12:20:25 -08:00
Fabio Berger
19198737a5 Add correct npmignore to 0x.js and update CHANGELOG 2018-02-09 12:18:23 -08:00
Brandon Millman
fea4b6aecd Merge pull request #387 from 0xProject/fix/testnet-faucet/ecsignature
Testnet Faucet Order conforming to JSON Schema
2018-02-09 12:01:59 -08:00
Fabio Berger
20e2673b82 Fix issue where custom TSLint rules were not being published to NPM 2018-02-09 11:53:38 -08:00
Jacob Evans
ef1375b9dd signature -> ecSignature 2018-02-09 10:50:38 -08:00
Brandon Millman
58f1939ec1 Merge pull request #382 from 0xProject/feature/clean-post-publish-scripts
Simplify standard postpublish script and remove them from some privat…
2018-02-09 10:19:33 -08:00
Leonid Logvinov
ba57c34adb Use system-independent rm command 2018-02-09 11:49:01 +01:00
Leonid
936f6ac10f Merge pull request #379 from 0xProject/portal_json
Make portal order JSON compatible with 0x.js
2018-02-09 09:27:08 +01:00
Fabio Berger
7e04c4f24b Merge pull request #383 from 0xProject/fix/website/addMoreRelayersLanding
Add relayers section to landing page
2018-02-08 18:41:16 -08:00
Fabio Berger
9495c8f46c Fix links 2018-02-08 18:40:06 -08:00
Fabio Berger
b3f91600d3 Center header above relayers 2018-02-08 17:53:31 -08:00
Fabio Berger
ddf4437fb6 Add blog to topBar and as a consequence support external links in topBar menu items 2018-02-08 17:36:17 -08:00
Fabio Berger
4153d57849 Add title above "benefits" section 2018-02-08 16:27:47 -08:00
Fabio Berger
0652790703 Add Relayer section to landing 2018-02-08 16:27:37 -08:00
Brandon Millman
9c934d903d Add new entries to the PR template checklist 2018-02-08 16:20:02 -08:00
Brandon Millman
d7a7e28925 Fix missing references to 'this' 2018-02-08 12:02:13 -08:00
Brandon Millman
6dec29e214 Simplify standard postpublish script and remove them from some private packages 2018-02-08 11:46:33 -08:00
Leonid Logvinov
43cf8d30bd Implement blockchain.portalOrderToZeroExOrder 2018-02-08 18:28:54 +01:00
Leonid
254d3f53e2 Merge pull request #377 from 0xProject/feature/signed_unsigned_order_contracts
Use SignedOrder and Order types from 0x.js
2018-02-08 18:15:10 +01:00
Leonid Logvinov
ec198343b5 Make naming of schemas consistent 2018-02-08 18:14:52 +01:00
Leonid Logvinov
876517d458 Fix namings 2018-02-08 18:03:55 +01:00
Leonid Logvinov
1233c33116 Address feedback 2018-02-08 16:23:20 +01:00
Fabio Berger
eebf205817 Fix flash message when receiving test ether 2018-02-07 16:58:05 -08:00
Brandon Millman
e666bb44c6 Fix incorrect network ids 2018-02-07 16:05:14 -08:00
Brandon Millman
39cb0b5122 Update @0xproject/utils version in top level package.json 2018-02-07 13:36:48 -08:00
Brandon Millman
58003a2811 Publish
- 0x.js@0.32.1
 - @0xproject/abi-gen@0.2.0
 - @0xproject/assert@0.0.17
 - @0xproject/connect@0.5.6
 - contracts@2.1.10
 - @0xproject/deployer@0.0.7
 - @0xproject/dev-utils@0.0.11
 - @0xproject/json-schemas@0.7.9
 - @0xproject/subproviders@0.4.0
 - @0xproject/testnet-faucets@1.0.11
 - @0xproject/types@0.2.0
 - @0xproject/utils@0.3.1
 - @0xproject/web3-wrapper@0.1.11
 - @0xproject/website@0.0.13
2018-02-07 13:25:39 -08:00
Brandon Millman
7f2a7cfa77 Update CHANGELOGs 2018-02-07 13:19:13 -08:00
Leonid Logvinov
8fba0477a6 Remove hash from signatureData 2018-02-07 20:58:19 +01:00
Fabio Berger
7ca1ba7e1e Fix wiki styling 2018-02-07 11:45:50 -08:00
Leonid Logvinov
e6f2c7a382 Remove networkId from orderJSON 2018-02-07 20:38:30 +01:00
Leonid Logvinov
69f5f5e946 Split Order into signedOrder and metadata 2018-02-07 20:26:13 +01:00
Fabio Berger
68a8acbe7b Merge pull request #374 from 0xProject/feature/website/addOtherTestnetFaucets
Feature/website/add other testnet faucets
2018-02-07 11:21:14 -08:00
Brandon Millman
852811b314 Merge pull request #375 from 0xProject/feature/testnet-faucets/queue-by-network
Organize async task queues by network
2018-02-07 11:16:24 -08:00
Brandon Millman
2404ff0304 Prettier 2018-02-07 11:01:21 -08:00
Brandon Millman
9ff4cacf0f Addressed review comments 2018-02-07 11:00:42 -08:00
Jacob Evans
e443cb2a3b Update Subprovider README 2018-02-07 10:37:34 -08:00
Brandon Millman
f3c6cce455 Merge branch 'development' into feature/testnet-faucets/queue-by-network
* development: (24 commits)
  Fix Remco's github name in CODEOWNERS
  Fix ABI error message
  Stop using definite assignment assertion cause prettier doesn't handle that
  Special-case ZRXToken snake case conversion
  Fix linter errors
  Generate contract wrappers on pre-build
  Add missing async
  Remove noImplicitThis
  Tslint disable no-consecutive-blank-lines in generated files
  Change compiled sources in contracts
  Change utils
  Change tests
  Add base_contract.ts
  Remove generated files
  .gitignore gemerated files
  Change the list of generated wrappers
  Change contract templates
  Add indices for index parameters so that their names don't collide
  Use abi-gen for events in 0x.js
  Fix artifacts path
  ...
2018-02-07 10:27:22 -08:00
Leonid Logvinov
ae14b0a71d Reuse ECSignature 2018-02-07 16:13:09 +01:00
Leonid Logvinov
3c7ebe2697 Remove unused types and take their names 2018-02-07 16:11:51 +01:00
Leonid Logvinov
10fb6061cc Introduce makerToken and takerToken fields for unsigned token metadata 2018-02-07 15:26:53 +01:00
Leonid Logvinov
223df8006a Move .taker.amount to .takerTokenAmount and .maker.amount to .makerTokenAmount 2018-02-07 15:09:06 +01:00
Leonid Logvinov
1c9428cbba Move .taker.feeAmount to .takerFee and .maker.feeAmount to .makerFee 2018-02-07 15:02:41 +01:00
Leonid Logvinov
18dc5d17b5 Rename signature to ecSignature 2018-02-07 14:54:37 +01:00
Leonid Logvinov
4d50933189 Rename exchangeContract to exchangeContractAddress 2018-02-07 14:48:59 +01:00
Leonid Logvinov
9b3680780f Rename expiration to expirationUnixTimestampSec 2018-02-07 14:41:40 +01:00
Leonid
a26e77074f Fix Remco's github name in CODEOWNERS 2018-02-07 13:46:14 +01:00
Leonid Logvinov
568e4d33f2 Use Order and SignedOrder type from 0x.js 2018-02-07 13:41:30 +01:00
Leonid Logvinov
fd004032cb Introduce SignedOrder class and remove type assertions 2018-02-07 12:22:22 +01:00
Leonid Logvinov
4b6324050d Make orderHashHex a getter instead of a property 2018-02-07 11:59:40 +01:00
Leonid
12d62e1157 Merge pull request #368 from 0xProject/feature/abigen/addNetworkId
Add CLI option for networkId, add abi-gen to contracts package
2018-02-07 11:40:06 +01:00
Fabio Berger
063c6b66b6 Only show faucet error if not on a testnet 2018-02-06 17:55:15 -08:00
Brandon Millman
d9b1d31e73 Organize async task queues by network 2018-02-06 17:39:49 -08:00
Leonid Logvinov
0bad911a16 Fix ABI error message 2018-02-06 17:34:45 -08:00
Fabio Berger
518efa8ad2 Move isTestNetwork into utils and also check it from showing ZRX request button 2018-02-06 17:29:10 -08:00
Leonid Logvinov
6e87c9e713 Stop using definite assignment assertion cause prettier doesn't handle that 2018-02-06 17:28:55 -08:00
Leonid Logvinov
b61852b1f5 Special-case ZRXToken snake case conversion 2018-02-06 17:27:47 -08:00
Leonid Logvinov
fcbe24a126 Fix linter errors 2018-02-06 17:27:47 -08:00
Leonid Logvinov
55312d00ef Generate contract wrappers on pre-build 2018-02-06 17:27:47 -08:00
Leonid Logvinov
a96e3f3222 Add missing async 2018-02-06 17:27:47 -08:00
Leonid Logvinov
e35519b50f Remove noImplicitThis 2018-02-06 17:27:47 -08:00
Leonid Logvinov
ae775f9664 Tslint disable no-consecutive-blank-lines in generated files 2018-02-06 17:27:47 -08:00
Leonid Logvinov
071b1c47d1 Change compiled sources in contracts 2018-02-06 17:27:47 -08:00
Leonid Logvinov
4cc5bbaf19 Change utils 2018-02-06 17:27:47 -08:00
Leonid Logvinov
a264c36a48 Change tests 2018-02-06 17:27:47 -08:00
Leonid Logvinov
0c2ab22656 Add base_contract.ts 2018-02-06 17:27:47 -08:00
Leonid Logvinov
47adad5122 Remove generated files 2018-02-06 17:27:47 -08:00
Leonid Logvinov
745f209f7e .gitignore gemerated files 2018-02-06 17:27:47 -08:00
Leonid Logvinov
2287597712 Change the list of generated wrappers 2018-02-06 17:27:47 -08:00
Leonid Logvinov
eea8b15180 Change contract templates 2018-02-06 17:27:47 -08:00
Leonid Logvinov
600a2b40af Add indices for index parameters so that their names don't collide 2018-02-06 17:27:47 -08:00
Leonid Logvinov
a7c51593e4 Use abi-gen for events in 0x.js 2018-02-06 17:27:47 -08:00
Amir Bandeali
218876ac19 Fix artifacts path 2018-02-06 17:26:13 -08:00
Amir Bandeali
6cda67df10 Update compile command and run prettier 2018-02-06 17:26:13 -08:00
Amir Bandeali
897515c002 Add CLI option for networkId, add abi-gen to contracts package 2018-02-06 17:26:12 -08:00
Fabio Berger
9deaf612f1 Remove stray log 2018-02-06 17:25:19 -08:00
Fabio Berger
b7676d8c46 Use isTestNetwork instead of isKovanTestNetwork on balances page except for Dharma integration 2018-02-06 17:23:27 -08:00
Fabio Berger
05aa2fa421 Properly detect Rinkeby and Ropsten TokenRegistry tokens as mintable 2018-02-06 17:23:01 -08:00
Fabio Berger
03f5c9b950 Add networkId to faucet requests so that we can request tokens on Kovan, Rinkeby and Ropsten 2018-02-06 17:22:20 -08:00
Fabio Berger
4c9c4c487a Merge branch 'development' of github.com:0xProject/0x.js into development
* 'development' of github.com:0xProject/0x.js:
  Bump subproviders version
  Update yarn.lock
  Change rpcUrls keys back into string literals
  Add types-bn package to 0x.js and testnet-faucets
  Prettier
  Addressed comments and update 0xProject/types-ethereumjs-util deps
  Prettier
  Update testnet-faucets README
  Fix lint errors
  Add order signing and dispensing ability to faucet
2018-02-06 16:26:35 -08:00
Fabio Berger
c172b9e080 Add networkId to event label 2018-02-06 16:25:50 -08:00
Fabio Berger
5533a84dcd Update yarn.lock 2018-02-06 16:25:29 -08:00
Brandon Millman
562bcb8571 Merge pull request #352 from 0xProject/feature/testnet-faucets/order-dispenser
Add order signing and dispensing ability to faucet
2018-02-06 16:15:25 -08:00
Tom Schmidt
00c07b38a4 Merge pull request #370 from 0xProject/feature/ga-portal-logging
Add GA Logging to Portal
2018-02-06 16:01:36 -08:00
Brandon Millman
f44bfa9682 Bump subproviders version 2018-02-06 15:56:40 -08:00
Brandon Millman
7357a0a324 Update yarn.lock 2018-02-06 15:38:23 -08:00
Brandon Millman
36a49966eb Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development:
  Attribute the origins of NonceTracker
  Move BlockParamLiteral to shared types package
  Fixes
  Move BlockParam and BlockParamLiteral to shared types
  Rename called to something more readable
  Newline prettier/lint
  Yarn.lock
  Refactor tests for reuse of the fixture subprovider
  Remove re-fetch of transaction count on error
  Disable linter for multiple class declarations
  Remove double declaration
  Enable CIRCLECI and declare web3
  Test faucets to use new NonceTracker
  Update changelog
  Readability and prettier
  Prettify
  Nonce tracker subprovider Caches the nonce when a request to getTransactionCount is made and increments the pending nonce after successful transactions
2018-02-06 15:36:00 -08:00
Brandon Millman
f818d06b43 Change rpcUrls keys back into string literals 2018-02-06 15:31:12 -08:00
Jacob Evans
548246c05f Merge pull request #355 from 0xProject/feature/subproviders/nonce-tracker
Nonce tracker subprovider
2018-02-06 15:29:19 -08:00
Brandon Millman
2bf1aa975a Add types-bn package to 0x.js and testnet-faucets 2018-02-06 15:24:11 -08:00
Jacob Evans
4be8eca3fe Attribute the origins of NonceTracker
NonceTrackerSubprovider is inspired from Web3ProviderEngine NonceTracker
2018-02-06 15:16:28 -08:00
Jacob Evans
e17ace397c Move BlockParamLiteral to shared types package
Also BlockParam
2018-02-06 13:17:14 -08:00
Brandon Millman
6bdabe72b9 Prettier 2018-02-06 11:48:56 -08:00
Thomas Schmidt
00bfc7f889 Added logging for order filling and order cancelling 2018-02-06 11:47:24 -08:00
Brandon Millman
5fcb77e591 Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development:
  Update utils in top level package to 0.3.0
  Add 0.2.0 back to yarn lock
  Reword comment on any
  Link to the wiki article in the README
  Justify the any usage
  Publish
  Revert "Temp"
  Changelog
  Change the InjectedWeb3Subprovider to accept Web3.Provider
2018-02-06 11:45:55 -08:00
Jacob Evans
df8de7ff51 Fixes
Rename to isFirstGetTransactionCount
assign nextPrefixedHexNonce as a const
2018-02-06 11:34:22 -08:00
Jacob Evans
67d7540907 Move BlockParam and BlockParamLiteral to shared types 2018-02-06 11:27:11 -08:00
Brandon Millman
83d0bad3a1 Addressed comments and update 0xProject/types-ethereumjs-util deps 2018-02-05 18:11:26 -08:00
Thomas Schmidt
9d80a62bb1 Moved to async await 2018-02-05 18:02:05 -08:00
Jacob Evans
629653425d Update utils in top level package to 0.3.0 2018-02-05 17:58:30 -08:00
Jacob Evans
03ce1d8641 Add 0.2.0 back to yarn lock 2018-02-05 17:47:10 -08:00
Jacob Evans
225baeb5cb Merge branch 'development' into feature/subproviders/nonce-tracker 2018-02-05 17:22:45 -08:00
Jacob Evans
cf171d28c7 Reword comment on any 2018-02-05 17:20:45 -08:00
Jacob Evans
61434a9121 Merge pull request #363 from 0xProject/refactor/subproviders/injected-provider-constructor
Change the InjectedWeb3Subprovider to accept Web3.Provider
2018-02-05 17:16:34 -08:00
Jacob Evans
20590b7d35 Rename called to something more readable 2018-02-05 17:11:45 -08:00
Jacob Evans
fce7081215 Newline prettier/lint 2018-02-05 16:57:27 -08:00
Thomas Schmidt
83c7c8110d Formatting and removed old GA code 2018-02-05 16:56:53 -08:00
Jacob Evans
c4680a97a8 Yarn.lock 2018-02-05 16:47:31 -08:00
Thomas Schmidt
91a5bcf380 Converted BigNumber to number for GA logging 2018-02-05 16:43:50 -08:00
Jacob Evans
7e9ae458e2 Merge branch 'development' into feature/subproviders/nonce-tracker 2018-02-05 16:36:46 -08:00
Jacob Evans
4e284f5e6c Refactor tests for reuse of the fixture subprovider 2018-02-05 16:32:43 -08:00
Thomas Schmidt
75ded89790 GA logging for order creation 2018-02-05 16:20:53 -08:00
Thomas Schmidt
598ce0d401 Switch GA to React GA and add logging for Portal 2018-02-05 15:57:29 -08:00
Jacob Evans
fc3058c1e2 Remove re-fetch of transaction count on error 2018-02-05 14:27:58 -08:00
Jacob Evans
d14ae70776 Link to the wiki article in the README 2018-02-05 13:55:01 -08:00
Jacob Evans
882816d609 Justify the any usage 2018-02-05 13:46:59 -08:00
Leonid Logvinov
2205e2b9a0 Publish
- 0x.js@0.32.0
 - @0xproject/abi-gen@0.1.7
 - @0xproject/assert@0.0.16
 - @0xproject/connect@0.5.5
 - contracts@2.1.9
 - @0xproject/deployer@0.0.6
 - @0xproject/dev-utils@0.0.10
 - @0xproject/json-schemas@0.7.8
 - @0xproject/monorepo-scripts@0.1.9
 - @0xproject/subproviders@0.3.6
 - @0xproject/testnet-faucets@1.0.10
 - @0xproject/tslint-config@0.4.7
 - @0xproject/types@0.1.9
 - @0xproject/utils@0.3.0
 - web3-typescript-typings@0.9.9
 - @0xproject/web3-wrapper@0.1.10
 - @0xproject/website@0.0.12
2018-02-05 22:29:42 +01:00
Leonid Logvinov
855fdd7921 Revert "Temp"
This reverts commit 881d32e733.
2018-02-05 22:26:50 +01:00
Brandon Millman
99b1f81e89 Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development: (37 commits)
  Add dates to CHANGELOGs
  Change CHANGELOGs
  Add .editorconfig
  Fix a typo
  Temp
  Use forEach instead of map
  Add PR number
  Fix an exception when a signature collision happens
  Fix prettier
  Add regression tests
  Improve the comment and fix an exception
  Add missing comas
  Lerna-ignore tslint and tsconfig
  Update contract versions, fix tests
  Rename directories
  Rename previous contracts, fix imports, add nested file structure
  Move all contracts into a single directory
  Update import
  Fix import
  Get rid of suffixed contract versioning and replace it with a poor-mans package manager. Versions are stored locally, and are generated in a copy-on-write basis as required
  ...
2018-02-05 13:16:46 -08:00
Leonid Logvinov
46ad7b1b38 Add dates to CHANGELOGs 2018-02-05 22:04:03 +01:00
Leonid Logvinov
7e5b7a7f2a Merge branch 'development' of github.com:0xProject/0x.js into development 2018-02-05 21:56:41 +01:00
Leonid
156e85a6b3 Merge pull request #366 from 0xProject/fix/abi_decoder_colision
Fix an exception when a signature collision happens
2018-02-05 21:56:04 +01:00
Leonid Logvinov
6fce02d25e Change CHANGELOGs 2018-02-05 21:53:41 +01:00
Remco Bloemen
4ddb86df53 Merge pull request #360 from 0xProject/feature/editorconfig
Add .editorconfig
2018-02-05 11:31:06 -08:00
Leonid
3565e96f42 Merge branch 'development' into fix/abi_decoder_colision 2018-02-05 19:31:37 +01:00
Leonid
2c7db23022 Merge pull request #350 from 0xProject/fix/ether_token_address
Add zeroEx.etherToken.getContractAddressIfExists
2018-02-05 19:27:20 +01:00
Remco Bloemen
fe51c9a9a2 Add .editorconfig 2018-02-05 10:25:05 -08:00
Leonid Logvinov
5324dfa5a7 Fix a typo 2018-02-05 19:13:09 +01:00
Leonid Logvinov
881d32e733 Temp 2018-02-05 19:10:17 +01:00
Leonid Logvinov
1f4cbb7479 Use forEach instead of map 2018-02-05 13:04:49 +01:00
Leonid Logvinov
b17bbdaa7d Add PR number 2018-02-05 13:01:53 +01:00
Leonid Logvinov
5458a1c1b7 Fix an exception when a signature collision happens 2018-02-05 12:59:10 +01:00
Leonid Logvinov
fa98450754 Fix prettier 2018-02-05 12:49:57 +01:00
Leonid
7b4f2b47de Merge branch 'development' into fix/ether_token_address 2018-02-05 12:33:40 +01:00
Leonid Logvinov
400a97e7a8 Add regression tests 2018-02-05 12:32:59 +01:00
Leonid Logvinov
a816fb5958 Improve the comment and fix an exception 2018-02-05 12:28:27 +01:00
Leonid
c7ad6ebad6 Merge pull request #358 from 0xProject/feature/build_watch
Add build:watch command to all TS packages
2018-02-05 12:03:36 +01:00
Leonid Logvinov
85b4a82a4b Add missing comas 2018-02-05 12:03:13 +01:00
Leonid
f18fa8e947 Merge branch 'development' into feature/build_watch 2018-02-05 12:00:05 +01:00
Leonid
44cd185c66 Merge pull request #356 from 0xProject/lerna-ignore
Ignore test files and markdown files changes on publish
2018-02-05 11:26:31 +01:00
Leonid Logvinov
890f414b5a Lerna-ignore tslint and tsconfig 2018-02-05 11:25:59 +01:00
Leonid
03b1b12ef1 Merge pull request #359 from 0xProject/feature/ts-2.7
TS 2.7
2018-02-05 11:24:36 +01:00
Jacob Evans
dae6f28f8a Disable linter for multiple class declarations 2018-02-02 15:07:10 -08:00
Jacob Evans
5aca3a2d7d Changelog 2018-02-02 14:53:44 -08:00
Jacob Evans
7f257e258f Change the InjectedWeb3Subprovider to accept Web3.Provider 2018-02-02 14:44:29 -08:00
Amir Bandeali
6a9d3de0f9 Merge pull request #329 from 0xProject/feature/contracts/versioning
Implement stop-gap smart contract versioning
2018-02-02 10:57:18 -08:00
Amir Bandeali
05aae36813 Update contract versions, fix tests 2018-02-02 09:41:19 -08:00
Amir Bandeali
d5d6079b67 Rename directories 2018-02-02 09:39:08 -08:00
Amir Bandeali
bb4c8bf8eb Rename previous contracts, fix imports, add nested file structure 2018-02-02 09:39:08 -08:00
Fabio Berger
3eb40db498 Move all contracts into a single directory 2018-02-02 09:39:08 -08:00
Fabio Berger
576f63d5e4 Update import 2018-02-02 09:39:08 -08:00
Fabio Berger
cda1dc82e9 Fix import 2018-02-02 09:39:08 -08:00
Fabio Berger
2721252d6a Get rid of suffixed contract versioning and replace it with a poor-mans package manager. Versions are stored locally, and are generated in a copy-on-write basis as required 2018-02-02 09:39:08 -08:00
Leonid Logvinov
45ac960308 Add build:watch to README's 2018-02-02 12:42:19 +01:00
Leonid
47d74aa24a Merge pull request #361 from 0xProject/feature/deployer/solc-0.4.19
Add solc 0.4.19
2018-02-02 12:29:58 +01:00
Jacob Evans
48aa1ad57d Remove double declaration 2018-02-01 18:43:32 -08:00
Jacob Evans
2eccb28dee Enable CIRCLECI and declare web3 2018-02-01 17:08:19 -08:00
Brandon Millman
9c3bfd920f Add CODEOWNERS file for automatically adding reviewers to PRs 2018-02-01 16:31:00 -08:00
Jacob Evans
76eb1e9e7f Test faucets to use new NonceTracker 2018-02-02 11:26:49 +11:00
Jacob Evans
b7af597668 Update changelog 2018-02-02 11:06:56 +11:00
Jacob Evans
d635559a30 Readability and prettier 2018-02-02 11:06:23 +11:00
Jacob Evans
58dd90b7b7 Prettify 2018-02-02 11:06:22 +11:00
Jacob Evans
ead990a734 Nonce tracker subprovider
Caches the nonce when a request to getTransactionCount is made
and increments the pending nonce after successful transactions
2018-02-02 11:06:22 +11:00
Remco Bloemen
27400fcd5b Add solc 0.4.19 2018-02-01 15:46:38 -08:00
Leonid Logvinov
d4631e14b2 Publish
- 0x.js@0.31.1
 - @0xproject/abi-gen@0.1.6
 - @0xproject/assert@0.0.15
 - chai-as-promised-typescript-typings@0.0.8
 - @0xproject/connect@0.5.4
 - contracts@2.1.8
 - @0xproject/deployer@0.0.5
 - @0xproject/dev-utils@0.0.9
 - @0xproject/json-schemas@0.7.7
 - @0xproject/monorepo-scripts@0.1.8
 - @0xproject/subproviders@0.3.5
 - @0xproject/testnet-faucets@1.0.9
 - @0xproject/tslint-config@0.4.6
 - @0xproject/types@0.1.8
 - @0xproject/utils@0.2.4
 - web3-typescript-typings@0.9.8
 - @0xproject/web3-wrapper@0.1.9
 - @0xproject/website@0.0.11
2018-02-01 16:39:06 +01:00
Leonid Logvinov
8df2cc103e Fix linter errors 2018-02-01 16:29:16 +01:00
Leonid Logvinov
8e0e9c7d3a Update changelog 2018-02-01 16:27:12 +01:00
Leonid
913930b561 Merge pull request #357 from ERCdEX/luke/zrx_order_watch_cache
BUGFIX: don't remove maker/zrx order from cache twice
2018-02-01 16:25:25 +01:00
Leonid Logvinov
994c8db1f3 Add OrderWatcherConfig to the list of public types 2018-02-01 13:01:10 +01:00
Leonid Logvinov
0c6cbb66b1 Lerna ignore scripts and lib 2018-02-01 12:56:46 +01:00
Leonid Logvinov
f09393d4f4 Ignore test files and markdown files changes on publish 2018-02-01 12:56:10 +01:00
Leonid Logvinov
f6d963d45a Fix errors after TS upgrade 2018-02-01 12:51:04 +01:00
Leonid Logvinov
39e3733be4 Upgrade TS to the newest version 2018-02-01 12:50:55 +01:00
Leonid Logvinov
09659cc304 Add build:watch command to all TS packages 2018-02-01 12:32:05 +01:00
Luke Autry
6811bdec40 don't remove maker/zrx order from cache twice 2018-01-31 22:56:05 -05:00
Brandon Millman
6577d60733 Prettier 2018-01-31 15:52:05 -08:00
Brandon Millman
c7db837214 Update testnet-faucets README 2018-01-31 15:40:13 -08:00
Brandon Millman
03cb7233dc Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development: (49 commits)
  Prettier
  Updated contract generation in 0x to new abi-gen CLI
  Add PR number to changelog
  Fix lint errors
  Removed deprecated CLI options
  Add protected keyword to underscore lint rule
  Remove unused prop
  Fix prettier
  Uppercase Networks enum values
  Make default gasPrice more readable
  Fix prettier mess
  Fix linter errors
  Shrink img
  Fix all setState calls after unmounted errors. Decided to create our own flag rather then using a cancellablePromise since there was little to be gained from this alternative
  Fix bug where we were return undefined instead of the empty object
  Default the derivation path to that found in the Ledger subprovider
  Add browser data to dialog info
  Add Rinkeby support
  Pass in whether we want the personal message prefix appended and never append it for Ledger. This fixes signing when Ledger is used and the backing node is not Parity
  Wholesale replace the tokenByAddress and de-dup properly
  ...
2018-01-31 15:30:09 -08:00
Brandon Millman
6682abf89d Merge pull request #354 from 0xProject/feature/tslint-config/underscore-protected-members
Modify lint rules to enforce underscore for protected members
2018-01-31 14:55:50 -08:00
Brandon Millman
78fbf0f7ba Prettier 2018-01-31 14:41:37 -08:00
Brandon Millman
89547332ee Merge branch 'development' into feature/tslint-config/underscore-protected-members
* development:
  Updated contract generation in 0x to new abi-gen CLI
  Removed deprecated CLI options
  Added PR # to the changelog of abi-gen
  Added CLI options for explicit specifying location of partials and main template
2018-01-31 12:38:12 -08:00
Leonid
75539bf675 Merge pull request #346 from joincivil/feature/abi-gen-partials
Added CLI options for explicit specifying location of partials and main template
2018-01-31 14:50:25 +01:00
Olaf Tomalka
eaeb715e56 Updated contract generation in 0x to new abi-gen CLI 2018-01-31 14:24:20 +01:00
Brandon Millman
ca55cc99ed Add PR number to changelog 2018-01-30 16:48:40 -08:00
Brandon Millman
7cc4a8f5ce Fix lint errors 2018-01-30 16:26:42 -08:00
Olaf Tomalka
fa35768fc9 Removed deprecated CLI options 2018-01-31 00:41:58 +01:00
Brandon Millman
4d0ff0dce4 Add protected keyword to underscore lint rule 2018-01-30 14:02:13 -08:00
Fabio Berger
8aac6e46d4 Remove unused prop 2018-01-30 21:34:13 +01:00
Fabio Berger
1feac1a308 Merge pull request #351 from 0xProject/feature/portal-ledger-support
Portal Ledger Support, Lazy-loading token balances/allowances
2018-01-30 21:27:21 +01:00
Fabio Berger
d3e42e4b3e Fix prettier 2018-01-30 21:16:47 +01:00
Brandon Millman
3a1ca32ff1 Fix lint errors 2018-01-30 12:10:06 -08:00
Fabio Berger
ecf86d1d13 Uppercase Networks enum values 2018-01-30 21:01:16 +01:00
Fabio Berger
adc6170f02 Make default gasPrice more readable 2018-01-30 20:53:22 +01:00
Fabio Berger
02600f40d2 Fix prettier mess 2018-01-30 20:53:09 +01:00
Fabio Berger
16ea0348a9 Fix linter errors 2018-01-30 20:45:09 +01:00
Brandon Millman
44162811bd Add order signing and dispensing ability to faucet 2018-01-30 11:36:39 -08:00
Fabio Berger
57acb8db5c Shrink img 2018-01-30 20:28:15 +01:00
Leonid
2bcb7d5639 Merge pull request #332 from 0xProject/feature/contracts-abi-gen
Contracts refactor. Bye, truffle!!! 👏
2018-01-30 20:27:14 +01:00
Fabio Berger
a99e54330a Merge branch 'development' into feature/portal-ledger-support
* development:
  Prettierignore package.json
  Enable solidity syntax highlighting
2018-01-30 20:13:02 +01:00
Fabio Berger
e219772b2a Fix all setState calls after unmounted errors. Decided to create our own flag rather then using a cancellablePromise since there was little to be gained from this alternative 2018-01-30 20:12:32 +01:00
Fabio Berger
144a507a2e Fix bug where we were return undefined instead of the empty object 2018-01-30 20:11:18 +01:00
Fabio Berger
5019c51940 Default the derivation path to that found in the Ledger subprovider 2018-01-30 20:10:51 +01:00
Fabio Berger
da1071526f Add browser data to dialog info 2018-01-30 19:03:10 +01:00
Leonid Logvinov
7ad314472d Change order 2018-01-30 16:33:52 +01:00
Leonid Logvinov
4f6168a982 Separate npm scripts in contracts 2018-01-30 16:01:37 +01:00
Leonid Logvinov
218a872968 Remove a semicolon 2018-01-30 16:01:37 +01:00
Leonid Logvinov
0043c5e1ac Fix glob patterns 2018-01-30 16:01:37 +01:00
Leonid Logvinov
d0e7046a89 Remove constructor arg 2018-01-30 16:01:37 +01:00
Leonid Logvinov
52ad16b920 Remove authorized address magic from tests 2018-01-30 16:01:37 +01:00
Leonid Logvinov
5a4c0bff6a Remove accounts magic from tests 2018-01-30 16:01:37 +01:00
Leonid Logvinov
6205209fbb Make an RPC constructor param implicit 2018-01-30 16:01:37 +01:00
Leonid Logvinov
6ebf8a57d1 Remove no-unused-variabe rule 2018-01-30 16:01:37 +01:00
Leonid Logvinov
c02dfc4fb1 Fix tslint issues 2018-01-30 16:01:37 +01:00
Leonid Logvinov
9d62e5fb6f Use an enum for contract name 2018-01-30 16:01:37 +01:00
Leonid Logvinov
6f13d107c4 Remove promisified web3 functions from tests 2018-01-30 16:01:37 +01:00
Leonid Logvinov
e56b2ceebb Remove truffle as a dependency 2018-01-30 16:01:37 +01:00
Leonid Logvinov
7de244ed62 Fix prettier 2018-01-30 16:01:37 +01:00
Leonid Logvinov
1e9147b8bb Normalize the dependencies 2018-01-30 16:01:37 +01:00
Leonid Logvinov
2f65fadeaa Add --bail to mocha config 2018-01-30 16:01:37 +01:00
Leonid Logvinov
a17091b394 Make awaitTransactionMinedAsync non-generic again 2018-01-30 16:01:36 +01:00
Leonid Logvinov
ed77c6cb54 Add back the artifacts 2018-01-30 16:01:36 +01:00
Leonid Logvinov
bc37cc8a91 Remove duplicate code 2018-01-30 16:01:36 +01:00
Leonid Logvinov
387363283c Remove truffle from tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
709026bf1a Refactor contracts tests to not use injected web3 instance 2018-01-30 16:01:36 +01:00
Leonid Logvinov
f2b2b86786 Remove truffle from Exchange tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
d0fbea76d8 Remove truffle from ZRXToken tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
8269610a5c Remove truffle from UnlimitedAllowanceToken tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
20c88a46d9 Remove truffle from UnlimitedAllowanceTokenV2 tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
661029f7cc Remove truffle from TokenRegistry tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
850d32d60c Remove truffle from MultiSigWalletWithTimeLock tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
eb881b9729 Remove truffle from MultiSigWalletWithTimeLockExceptRemoveAuthAddr tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
091ba473ff Remove truffle from Ether Token tests 2018-01-30 16:01:36 +01:00
Leonid Logvinov
fca051c565 Remove truffle from tokenTransferProxy tests 2018-01-30 16:01:35 +01:00
Leonid Logvinov
6463cda204 Remove truffle from tokenTransferProxy tests 2018-01-30 16:01:35 +01:00
Leonid Logvinov
d004df56e3 Prettierignore package.json 2018-01-30 16:00:29 +01:00
Leonid Logvinov
359dd482c4 Enable solidity syntax highlighting 2018-01-30 15:46:37 +01:00
Fabio Berger
89e98240b4 Add Rinkeby support 2018-01-30 15:05:55 +01:00
Leonid Logvinov
1c1f2ef1ff Fix PR template 2018-01-30 15:05:16 +01:00
Leonid Logvinov
4fa774f866 Update CHANGELOG 2018-01-30 15:04:42 +01:00
Leonid Logvinov
4671999ea0 Fix linter errors 2018-01-30 14:54:10 +01:00
Leonid Logvinov
0a73bbe279 Add zeroEx.etherToken.getContractAddressifExists 2018-01-30 14:35:04 +01:00
Fabio Berger
8d30058a6d Pass in whether we want the personal message prefix appended and never append it for Ledger. This fixes signing when Ledger is used and the backing node is not Parity 2018-01-30 14:19:58 +01:00
Fabio Berger
69151c06e4 Merge branch 'development' into feature/portal-ledger-support
* development:
  Publish
  Add PR number
  Add config file specifically in prettier command and fix files
  Fix prettier
  Fix prettier
  Add shouldAddPersonalMessagePrefix param to signOrderHashAsync instead of trying to infer whether to add it or not from the nodeVersion
  Publish
  Move @0xproject/types to dependencies
  Updated web3-typescript-typings changelog
  Fixed getTransactionReceipt not returning null
  Run prettier
  Update changelog
  Add Rinkeby addresses to artifacts
  Fix bad merge on package.json
  Respond to GH comments and add /info endpoint
  Change package name to @0xproject/testnet-faucets
  Implement testnet faucets for any testnet available via infura
  Rename to testnet-faucets
  Add to the Pull Request Template
  Create an ISSUE TEMPLATE
2018-01-30 14:00:35 +01:00
Fabio Berger
2e3c02887e Publish
- 0x.js@0.31.0
 - @0xproject/abi-gen@0.1.5
 - @0xproject/assert@0.0.14
 - chai-as-promised-typescript-typings@0.0.7
 - @0xproject/connect@0.5.3
 - contracts@2.1.7
 - @0xproject/deployer@0.0.4
 - @0xproject/dev-utils@0.0.8
 - @0xproject/json-schemas@0.7.6
 - @0xproject/monorepo-scripts@0.1.7
 - @0xproject/subproviders@0.3.4
 - @0xproject/testnet-faucets@1.0.8
 - @0xproject/tslint-config@0.4.5
 - @0xproject/types@0.1.7
 - @0xproject/utils@0.2.3
 - web3-typescript-typings@0.9.7
 - @0xproject/web3-wrapper@0.1.8
 - @0xproject/website@0.0.10
2018-01-30 13:54:36 +01:00
Fabio Berger
7603cef308 Merge pull request #349 from 0xProject/fix/0x.js/signOrderHash
Add shouldAddPersonalMessagePrefix param to signOrderHashAsync
2018-01-30 13:45:44 +01:00
Fabio Berger
be370c4e19 Add PR number 2018-01-30 13:45:20 +01:00
Fabio Berger
c6dece6bd1 Add config file specifically in prettier command and fix files 2018-01-30 13:26:46 +01:00
Fabio Berger
93a5b3f457 Fix prettier 2018-01-30 13:21:01 +01:00
Fabio Berger
4242176d29 Fix prettier 2018-01-30 13:16:31 +01:00
Fabio Berger
1cadbeed88 Add shouldAddPersonalMessagePrefix param to signOrderHashAsync instead of trying to infer whether to add it or not from the nodeVersion 2018-01-30 12:38:44 +01:00
Fabio Berger
86cc011212 Wholesale replace the tokenByAddress and de-dup properly 2018-01-30 11:16:13 +01:00
Fabio Berger
c0facfc28f Call destroy ealier so that web3Wrapper stops polling for userAddress/networkId updates before we prep for the batchDispatch 2018-01-30 11:15:36 +01:00
Jacob Evans
ad52a82190 Merge pull request #335 from 0xProject/feature/issue-template
Issue/Pull Request Template
2018-01-30 11:34:41 +11:00
Leonid Logvinov
60b6ed514f Publish
- 0x.js@0.30.2
 - @0xproject/abi-gen@0.1.4
 - @0xproject/assert@0.0.13
 - chai-as-promised-typescript-typings@0.0.6
 - @0xproject/connect@0.5.2
 - contracts@2.1.6
 - @0xproject/deployer@0.0.3
 - @0xproject/dev-utils@0.0.7
 - @0xproject/json-schemas@0.7.5
 - @0xproject/monorepo-scripts@0.1.6
 - @0xproject/subproviders@0.3.3
 - @0xproject/testnet-faucets@1.0.7
 - @0xproject/tslint-config@0.4.4
 - @0xproject/types@0.1.6
 - @0xproject/utils@0.2.2
 - web3-typescript-typings@0.9.6
 - @0xproject/web3-wrapper@0.1.7
 - @0xproject/website@0.0.9
2018-01-29 21:19:40 +01:00
Fabio Berger
bb0cedd2de Disallow negative amounts 2018-01-29 18:35:06 +01:00
Fabio Berger
8175c7c085 Remove the ability to clear tokenByAddress. It should simply be updated. 2018-01-29 17:56:35 +01:00
Fabio Berger
5c2d725721 Use live backend on development 2018-01-29 16:38:30 +01:00
Fabio Berger
72571628da Fetch default gasPrice from our ethGasStation API mirror and set it for all transactions 2018-01-29 16:38:05 +01:00
Fabio Berger
fa6130c907 remove unused type 2018-01-29 14:10:57 +01:00
Fabio Berger
8ccdd54974 Small improvements 2018-01-29 13:57:05 +01:00
Fabio Berger
6c1409b00d Fix bug related to balance/allowance fetching being async 2018-01-29 13:25:51 +01:00
Fabio Berger
542a1a11b9 Add missing entries for Ropsten and Rinkeby testnets, added Ropsten to Ledger network dropdown 2018-01-29 13:16:40 +01:00
Fabio Berger
63ffa80c5c Re-set Ledger config dialog to connect step if dialog is closed 2018-01-29 12:46:07 +01:00
Fabio Berger
609342be7a Add flash message instructing user to confirm tx on Ledger 2018-01-29 12:45:50 +01:00
Fabio Berger
52394884da Add the stack trace to help with debugging 2018-01-29 12:11:05 +01:00
Fabio Berger
af08177f79 Make it such that users can switch between Ledger accounts without first switching back to an injected provider 2018-01-29 12:10:49 +01:00
Fabio Berger
45fdfc2d3d Use colors module and remove in-lined colors 2018-01-29 10:55:53 +01:00
Fabio Berger
d18554e0e8 Replace heavy loading animation with simple circular loader 2018-01-29 10:46:15 +01:00
Fabio Berger
3c3f9ca85b Add network name to the select provider 2018-01-29 10:44:30 +01:00
Fabio Berger
005a02efeb Fix bug where could not switch to Ledger and back 2018-01-28 17:45:20 +01:00
Fabio Berger
6206ebc994 Implement just-in-time loading of token balances & allowances 2018-01-28 16:19:55 +01:00
Fabio Berger
dd9f5adc2e Initial Ledger support implementation 2018-01-28 10:29:15 +01:00
Fabio Berger
748d805a32 Remove unused Ledgerco import 2018-01-28 10:28:53 +01:00
Fabio Berger
4b59bf01b3 Add light blue as our accent color 2018-01-28 10:28:34 +01:00
Fabio Berger
b4faa4851a Properly detect user signing cancellation on Metamask, Parity signer and Ledger 2018-01-28 10:28:17 +01:00
Olaf Tomalka
f37fcc147c Added PR # to the changelog of abi-gen 2018-01-26 18:30:10 +01:00
Olaf Tomalka
dc5694e544 Added CLI options for explicit specifying location of partials and main template 2018-01-26 18:22:32 +01:00
Fabio Berger
71d68f975c Merge branch 'development' into feature/portal-ledger-support
* development: (437 commits)
  Publish
  Update yarn.lock
  Update the CHANGELOG
  Fix the bug making it impossible to specify the custom ZRX address
  Fix fill/cancel order by looking for NoError instead of empty blockchainErr given the BlockchainErrs type refactor
  Add a comment about a yarn bug
  Add our mainnet and kovan nodes as backups for Portal requests
  Fix bug hiding the user info from topBar
  Add dev-utils package to top level README
  Prettier newline
  Prettier
  Allow Token symbols to be alphanumeric
  Update CHANGELOG, rebase on development
  Should not -> cannot
  Reject negative amounts in isValidBaseUnitAmount
  Re-add changelog for 0x.js
  Fix prettier
  Update yarn.lock
  Move tests to a separate folder
  Change file layout
  ...

# Conflicts:
#	packages/website/README.md
2018-01-25 16:42:58 +01:00
Jacob Evans
ddb64b3ec1 Add to the Pull Request Template 2018-01-23 14:43:25 +11:00
Jacob Evans
5055ec8617 Create an ISSUE TEMPLATE 2018-01-23 14:31:10 +11:00
Fabio Berger
ec3d8a034f Update yarn.lock 2017-12-08 13:06:35 -06:00
Fabio Berger
c452294bcc Change dev domain since .dev is actually owned by Google and Chrome now enforces HSTS by default 2017-12-08 13:06:24 -06:00
Fabio Berger
d5757499bc Merge branch 'feature/addSubproviders' into feature/portal-ledger-support
* feature/addSubproviders:
  remove console.log
  Update README.md
  Fix unit test
  Add missing params
  Debug CircleCi failure
  Update yarn.lock
  Inline network module
  Add todo
  Stop supporting different file extensions in abi-gen
  Refactor networkId out of web3Wrapper
  Update connect types in preperation for publishing
  Add link to random id generator
  Remove `prebuild` command and add `test:circleci`
  Fix CI command
  Address feedback
  Refactor web3Wrapper to a separate package
2017-12-08 11:23:44 -06:00
Fabio Berger
139c8c2e78 Merge branch 'feature/addSubproviders' into feature/portal-ledger-support
* feature/addSubproviders:
  Make sure we don't pass empty maker into getOrderHashHex
  Make sure we always pass in the correct networkId even if no injectedWeb3 found
2017-12-07 15:15:51 -06:00
Fabio Berger
215e33fa6c Merge branch 'feature/addSubproviders' into feature/portal-ledger-support
* feature/addSubproviders:
  remove unneeded reset
  Use rejectedWith
  Add missing calls to configure
  remove unneeded type assertions
  remove unused type
  Simplify interface to signPersonalMessageAsync
  Fix unit test
  Fix ethereumjs-tx declaration and import
  Use assert.isHexString
  Add type defs for ledgerco and ethereumjs-tx
  Make test only run unit tests since cannot run integration tests on CI
  Improve README
  Fix version and remove the UMD build
  Fix tslint error
2017-12-07 11:42:50 -06:00
Fabio Berger
3d12b84f1d Merge branch 'feature/addSubproviders' into feature/portal-ledger-support
* feature/addSubproviders:
  Standardize deps
  Inline function
  Introduce a const
  Make private
  Add version matcher script
  Use same versions of dependencies everywhere
  Add missing await
  Move declaration into proper conditional block
  Fix Party element so that an identicon's height is that which was passed in
2017-12-06 11:01:53 -06:00
Fabio Berger
d8adc88c52 Add missing await 2017-12-05 22:15:31 -06:00
Fabio Berger
5119e49e47 Move declaration into proper conditional block 2017-12-05 22:15:23 -06:00
Fabio Berger
cfb9f87418 Fix Party element so that an identicon's height is that which was passed in 2017-12-05 22:07:25 -06:00
1535 changed files with 227213 additions and 35023 deletions

View File

@@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
environment:
CONTRACTS_COMMIT_HASH: '9ed05f5'
working_directory: ~/repo
@@ -11,112 +11,226 @@ jobs:
- checkout
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-packages-{{ .Branch }}
- yarn-packages-master
- yarn-packages-
- run:
name: yarn
command: yarn --frozen-lockfile
command: yarn --frozen-lockfile install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
name: Save Yarn Package Cache
key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: wget https://s3.amazonaws.com/testrpc-shapshots/${CONTRACTS_COMMIT_HASH}.zip
- run: unzip ${CONTRACTS_COMMIT_HASH}.zip -d testrpc_snapshot
- run: node ./node_modules/lerna/bin/lerna.js bootstrap
- run: yarn lerna:run build
- node_modules/
- run: >
if [ -z "$(git diff --name-only v2-prototype packages/website)" ]; then
yarn build --exclude website
else
yarn build
fi
- save_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo
test-0xjs:
test-contracts-ganache:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn lerna:run --scope 0x.js test:circleci
test-contracts:
- run: yarn wsrun test:circleci contracts
test-contracts-geth:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
- image: albrow/0x-devnet
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn lerna:run --scope contracts test:circleci
test-deployer:
docker:
- image: circleci/node:6.12
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn lerna:run --scope @0xproject/deployer test:circleci
# HACK(albrow): we need to sleep 10 seconds to ensure the devnet is
# initialized
- run: sleep 10 && TEST_PROVIDER=geth yarn wsrun test contracts
test-rest:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn lerna:run --ignore contracts --ignore 0x.js --ignore @0xproject/deployer test:circleci
lint:
- run: yarn wsrun test:circleci @0xproject/0x.js
- run: yarn wsrun test:circleci @0xproject/abi-gen
- run: yarn wsrun test:circleci @0xproject/assert
- run: yarn wsrun test:circleci @0xproject/base-contract
- run: yarn wsrun test:circleci @0xproject/connect
- run: yarn wsrun test:circleci @0xproject/contract-wrappers
- run: yarn wsrun test:circleci @0xproject/dev-utils
- run: yarn wsrun test:circleci @0xproject/json-schemas
- run: yarn wsrun test:circleci @0xproject/metacoin
- run: yarn wsrun test:circleci @0xproject/order-utils
- run: yarn wsrun test:circleci @0xproject/order-watcher
- run: yarn wsrun test:circleci @0xproject/sol-compiler
- run: yarn wsrun test:circleci @0xproject/sol-cov
- run: yarn wsrun test:circleci @0xproject/sra-report
- run: yarn wsrun test:circleci @0xproject/subproviders
- run: yarn wsrun test:circleci @0xproject/web3-wrapper
- save_cache:
key: coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/0x.js/coverage/lcov.info
- save_cache:
key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/abi-gen/coverage/lcov.info
- save_cache:
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/assert/coverage/lcov.info
- save_cache:
key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/base-contract/coverage/lcov.info
- save_cache:
key: coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/connect/coverage/lcov.info
- save_cache:
key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/contract-wrappers/coverage/lcov.info
- save_cache:
key: coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/dev-utils/coverage/lcov.info
- save_cache:
key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/json-schemas/coverage/lcov.info
- save_cache:
key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/metacoin/coverage/lcov.info
- save_cache:
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/order-utils/coverage/lcov.info
- save_cache:
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/order-watcher/coverage/lcov.info
- save_cache:
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/sol-compiler/coverage/lcov.info
- save_cache:
key: coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/sol-cov/coverage/lcov.info
- save_cache:
key: coverage-sra-report-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/sra-report/coverage/lcov.info
- save_cache:
key: coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/subproviders/coverage/lcov.info
- save_cache:
key: coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/web3-wrapper/coverage/lcov.info
static-tests:
working_directory: ~/repo
docker:
- image: circleci/node:6.12
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn lerna:run lint
prettier:
working_directory: ~/repo
docker:
- image: circleci/node:6.12
- image: circleci/node:9
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn prettier:ci
- run: yarn lerna:run lint
submit-coverage:
docker:
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sra-report-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-contracts-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn report_coverage
workflows:
version: 2
main:
jobs:
- build
- test-0xjs:
- test-contracts-ganache:
requires:
- build
- test-contracts:
requires:
- build
- test-deployer:
- test-contracts-geth:
requires:
- build
- test-rest:
requires:
- build
- prettier:
- static-tests:
requires:
- build
- lint:
- submit-coverage:
requires:
- build
- test-rest

12
.editorconfig Normal file
View File

@@ -0,0 +1,12 @@
# EditorConfig http://EditorConfig.org
# top-most EditorConfig file
root = true
# All files
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.sol linguist-language=Solidity

34
.gitignore vendored
View File

@@ -67,7 +67,35 @@ generated_docs/
TODO.md
packages/website/public/bundle*
# VSCode file
.vscode
# generated binaries
bin/
packages/website/public/bundle*
packages/react-docs/example/public/bundle*
# server cli
packages/testnet-faucets/server/
# generated contract artifacts/
packages/sol-cov/test/fixtures/artifacts/
packages/metacoin/artifacts/
packages/order-watcher/test/artifacts/
packages/contract-wrappers/test/artifacts/
# generated contract wrappers
packages/0x.js/src/generated_contract_wrappers/
packages/contracts/generated_contract_wrappers/
packages/contract-wrappers/src/contract_wrappers/generated/
packages/metacoin/src/contract_wrappers
packages/fill-scenarios/src/generated_contract_wrappers/
packages/order-watcher/src/generated_contract_wrappers/
packages/order-utils/src/generated_contract_wrappers/
packages/migrations/src/1.0.0/contract_wrappers
packages/migrations/src/2.0.0/contract_wrappers
packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
# solc-bin in sol-compiler
packages/sol-compiler/solc_bin/
# Monorepo scripts
packages/*/scripts/

View File

@@ -1,6 +0,0 @@
.*
tsconfig.json
tslint.json
webpack.config.js
yarn.lock
docs

View File

@@ -1,4 +1,22 @@
lib
generated
.nyc_output
/packages/contracts/build/contracts
/packages/contract-wrappers/src/contract_wrappers/generated/
/packages/metacoin/src/contract_wrappers
/packages/0x.js/src/generated_contract_wrappers/
/packages/contracts/generated_contract_wrappers/
/packages/fill-scenarios/src/generated_contract_wrappers/
/packages/order-watcher/src/generated_contract_wrappers/
/packages/order-utils/src/generated_contract_wrappers/
/packages/migrations/src/1.0.0/contract_wrappers
/packages/migrations/src/2.0.0/contract_wrappers
/packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
/packages/0x.js/src/artifacts
/packages/contracts/src/artifacts
/packages/metacoin/artifacts
/packages/contract-wrappers/test/artifacts
/packages/order-watcher/test/artifacts
/packages/migrations/artifacts/1.0.0
/packages/migrations/artifacts/2.0.0
/packages/migrations/artifacts/2.0.0-beta-testnet
package.json
scripts/postpublish_utils.js

46
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@0xproject.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -8,9 +8,9 @@ If you'd like to contribute to 0x protocol, please fork the repo, fix, commit an
We encourage a “PR early” approach so create the PR as early as possible even without the fix/feature ready, so that devs and other contributors know you have picked up the issue. These early PRs should indicate an 'in progress' status by adding the '[WIP]' prefix to the PR title. Please make sure your contributions adhere to our coding guidelines:
* Pull requests adding features or refactoring should be opened against the `development` branch
* Pull requests fixing bugs in the latest release version should be opened again the `master` branch
* Write [good commit messages](https://chris.beams.io/posts/git-commit/)
* Pull requests adding features or refactoring should be opened against the `development` branch
* Pull requests fixing bugs in the latest release version should be opened again the `master` branch
* Write [good commit messages](https://chris.beams.io/posts/git-commit/)
### Code quality
@@ -21,9 +21,21 @@ If you're adding a new public function/member, make sure you document it with Ja
If the sub-package you are modifying has a `CHANGELOG.md` file, make sure to add an entry in it for the change made to the package. For published packages, only changes that modify the public interface or behavior of the package need a CHANGELOG entry.
#### Enabling code coverage checks on your fork
If you simply fork the repo and then create a PR sourced from it, your PR will fail its test coverage check. This is because the 0x CircleCI configuration sets the `COVERALLS_REPO_TOKEN` environment variable to the token for 0xProject/0x-monorepo, but when running the check against your fork the token needs to match the repo that is your fork, rather than the 0x repo.
To facilitate this check, after creating your fork, but before creating the branch for your PR, do the following:
1. Log in to [coveralls.io](https://coveralls.io/), go to Add Repos, and enable your fork. Then go to the settings for that repo, and copy the Repo Token identifier.
2. Log in to [CircleCI](https://circleci.com/login), go to Add Projects, click the Set Up Project button corresponding to your fork, and then click Start Building. (Aside from step 3 below, no actual set up is needed, since it will use the `.circleci/config.yml` file in 0x-monorepo, so you can ignore all of the instruction/explanation given on the page with the Start Building button.)
3. In CircleCI, configure your project to add an Environment Variable, with name `COVERALLS_REPO_TOKEN`, and for the value paste in the Repo Token you copied in step 1.
Now, when you push to your branch, CircleCI will automatically run all of the checks in your own instance, and the coverage check will work since it has the proper Repo Token, and the PR will magically refer to your own checks rather than running them in the 0x CircleCI instance.
### Styleguide
We use [TSLint](https://palantir.github.io/tslint/) with [custom configs](https://github.com/0xProject/0x.js/tree/development/packages/tslint-config) to keep our code style consistent.
We use [TSLint](https://palantir.github.io/tslint/) with [custom configs](https://github.com/0xProject/0x-monorepo/tree/development/packages/tslint-config) to keep our code style consistent.
To lint your code just run: `yarn lint`
@@ -31,10 +43,10 @@ We also use [Prettier](https://prettier.io/) to auto-format our code. Be sure to
If using the Atom text editor, we recommend you install the following packages:
* [atom-typescript](https://atom.io/packages/atom-typescript)
* [linter-tslint](https://atom.io/packages/linter-tslint)
* [prettier-atom](https://atom.io/packages/prettier-atom)
* [language-ethereum](https://atom.io/packages/language-ethereum)
* [atom-typescript](https://atom.io/packages/atom-typescript)
* [linter-tslint](https://atom.io/packages/linter-tslint)
* [prettier-atom](https://atom.io/packages/prettier-atom)
* [language-ethereum](https://atom.io/packages/language-ethereum)
Our CI will also run TSLint and Prettier as a part of the test run when you submit your PR. Make sure that the CI tests pass for your contribution.

62
ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,62 @@
<!--- Thank you for taking the time to file an Issue -->
<!--- Before submitting please check to see if this issue was already reported -->
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a package change/improvement, tell us how it should work -->
<!--- If you're suggesting a contract or protocol change/improvement, visit our ZEIPs repo -->
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
```
1.
2.
3.
```
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
| Package | Version |
| ------------------: | :------ |
| `0x.js` | 0.25.0 |
| `Exchange Contract` | v1 |
| Network |
| ------- |
| NAME |
<!-- For example:
| mainnet |
| kovan |
| testrpc |
-->

View File

@@ -1,3 +1,29 @@
This PR:
## Description
\*
<!--- Describe your changes in detail -->
## Testing instructions
<!--- Please describe how reviewers can test your changes -->
## Types of changes
<!--- What types of changes does your code introduce? Uncomment all the bullets that apply: -->
<!-- * Bug fix (non-breaking change which fixes an issue) -->
<!-- * New feature (non-breaking change which adds functionality) -->
<!-- * Breaking change (fix or feature that would cause existing functionality to change) -->
## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
* [ ] Change requires a change to the documentation.
* [ ] Added tests to cover my changes.
* [ ] Added new entries to the relevant CHANGELOG.jsons.
* [ ] Labeled this PR with the 'WIP' label if it is a work in progress.
* [ ] Labeled this PR with the labels corresponding to the changed package.

166
README.md
View File

@@ -4,60 +4,81 @@
[0x][website-url] is an open protocol that facilitates trustless, low friction exchange of Ethereum-based assets. A full description of the protocol may be found in our [whitepaper][whitepaper-url].
This repository contains all the 0x developer tools written in TypeScript. Our hope is that these tools make it easy to build Relayers and other DApps that use the 0x protocol.
This repository is a monorepo including the 0x protocol smart contracts and numerous developer tools. Each public sub-package is independently published to NPM.
If you're developing on 0x now or are interested in using 0x infrastructure in the future, please join our [developer mailing list][dev-mailing-list-url] for updates.
[website-url]: https://0xproject.com/
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
[dev-mailing-list-url]: http://eepurl.com/dx4cPf
[![CircleCI](https://circleci.com/gh/0xProject/0x.js.svg?style=svg&circle-token=61bf7cd8c9b4e11b132089dfcffdd1be277d1e0c)](https://circleci.com/gh/0xProject/0x.js)
[![Coverage Status](https://coveralls.io/repos/github/0xProject/0x.js/badge.svg?branch=master&t=fp0cXD)](https://coveralls.io/github/0xProject/0x.js?branch=master)
[![CircleCI](https://circleci.com/gh/0xProject/0x-monorepo.svg?style=svg&circle-token=61bf7cd8c9b4e11b132089dfcffdd1be277d1e0c)](https://circleci.com/gh/0xProject/0x-monorepo)
[![Coverage Status](https://coveralls.io/repos/github/0xProject/0x-monorepo/badge.svg?branch=development)](https://coveralls.io/github/0xProject/0x-monorepo?branch=development)
[![Discord](https://img.shields.io/badge/chat-rocket.chat-yellow.svg?style=flat)](https://chat.0xproject.com)
[![Join the chat at https://gitter.im/0xProject/Lobby](https://badges.gitter.im/0xProject/Lobby.svg)](https://gitter.im/0xProject/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Greenkeeper badge](https://badges.greenkeeper.io/0xProject/0x.js.svg?token=7c22e5c72acf39d3ead8d29c5d9bb38f9096df3e643024dcedd53ab732847be1&ts=1496426342666)](https://greenkeeper.io/)
### Published Packages
| Package | Version | Description |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
| [`chai-as-promised-typescript-typings`](/packages/chai-as-promised-typescript-typings) | [![npm](https://img.shields.io/npm/v/chai-as-promised-typescript-typings.svg)](https://www.npmjs.com/package/chai-as-promised-typescript-typings) | Chai as promised typescript typings |
| [`chai-typescript-typings`](/packages/chai-typescript-typings) | [![npm](https://img.shields.io/npm/v/chai-typescript-typings.svg)](https://www.npmjs.com/package/chai-typescript-typings) | Chai typescript typings |
| [`web3-typescript-typings`](/packages/web3-typescript-typings) | [![npm](https://img.shields.io/npm/v/web3-typescript-typings.svg)](https://www.npmjs.com/package/web3-typescript-typings) | Web3 typescript typings |
| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
| [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the standard relayer api |
| [`@0xproject/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/dev-utils.svg)](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages |
| [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) |
| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules |
| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities |
| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper |
| Package | Version | Description |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
| [`@0xproject/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0xproject/base-contract.svg)](https://www.npmjs.com/package/@0xproject/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
| [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the Standard Relayer API |
| [`@0xproject/sol-compiler`](/packages/sol-compiler) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-compiler.svg)](https://www.npmjs.com/package/@0xproject/sol-compiler) | A thin wrapper around Solc.js that outputs artifacts, resolves imports, only re-compiles when needed, and other niceties. |
| [`@0xproject/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/dev-utils.svg)](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages |
| [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | [![npm](https://img.shields.io/npm/v/@0xproject/monorepo-scripts.svg)](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts |
| [`@0xproject/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0xproject/react-docs.svg)](https://www.npmjs.com/package/@0xproject/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON |
| [`@0xproject/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0xproject/react-shared.svg)](https://www.npmjs.com/package/@0xproject/react-shared) | 0x shared react components |
| [`@0xproject/sra-report`](/packages/sra-report) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-report.svg)](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance |
| [`@0xproject/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-cov.svg)](https://www.npmjs.com/package/@0xproject/sol-cov) | Solidity test coverage tool |
| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) |
| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules |
| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
| [`@0xproject/typescript-typings`](/packages/typescript-typings) | [![npm](https://img.shields.io/npm/v/@0xproject/typescript-typings.svg)](https://www.npmjs.com/package/@0xproject/typescript-typings) | Repository of types for external packages |
| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities |
| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper |
### Private Packages
| Package | Description |
| ----------------------------------------------------------- | ---------------------------------------------------------------- |
| [`@0xproject/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | Shared monorepo scripts |
| [`@0xproject/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
| [`@0xproject/website`](/packages/website) | 0x website & Portal DApp |
| Package | Description |
| --------------------------------------------------------------- | ---------------------------------------------------------------- |
| [`@0xproject/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
| [`@0xproject/react-docs-example`](/packages/react-docs-example) | Example documentation site created with `@0xproject/react-docs` |
| [`@0xproject/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
| [`@0xproject/website`](/packages/website) | 0x website & Portal DApp |
## Usage
Dedicated documentation pages:
* [0x.js Library](https://0xproject.com/docs/0xjs)
* [0x Connect](https://0xproject.com/docs/connect)
* [Smart contracts](https://0xproject.com/docs/contracts)
* [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/blob/master/README.md)
* [0x.js Library](https://0xproject.com/docs/0xjs)
* [0x Connect](https://0xproject.com/docs/connect)
* [Smart contracts](https://0xproject.com/docs/contracts)
* [Subproviders](https://0xproject.com/docs/subproviders)
* [Sol Compiler](https://0xproject.com/docs/sol-compiler)
* [Web3-wrapper](https://0xproject.com/docs/web3-wrapper)
* [JSON-schemas](https://0xproject.com/docs/json-schemas)
* [Sol-cov](https://0xproject.com/docs/sol-cov)
* [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/blob/master/README.md)
Node version >= 6.12 is required.
Most of the packages require additional typings for external dependencies.
You can include those by prepending @0xproject/typescript-typings package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
```json
"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
```
## Contributing
We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
Please read our [contribution guidelines](./CONTRIBUTING.md) before getting started.
#### Read our [contribution guidelines](./CONTRIBUTING.md).
### Install dependencies
@@ -75,40 +96,87 @@ yarn install
### Build
Build all packages
To build all packages:
```bash
yarn lerna:run build
yarn build
```
To build a specific package:
```bash
PKG=@0xproject/web3-wrapper yarn build
```
### Watch
To re-build all packages on change:
```bash
yarn watch
```
To watch a specific package and all it's dependent packages:
```bash
PKG=[NPM_PACKAGE_NAME] yarn watch
e.g
PKG=@0xproject/web3-wrapper yarn watch
```
### Clean
Clean all packages:
```bash
yarn clean
```
Clean a specific package
```bash
PKG=0x.js yarn clean
```
### Rebuild
To re-build (clean & build) all packages:
```bash
yarn rebuild
```
To re-build (clean & build) a specific package & it's deps:
```bash
PKG=0x.js yarn rebuild
```
### Lint
Lint all packages
Lint all packages:
```bash
yarn lerna:run lint
yarn lint
```
Lint a specific package:
```bash
PKG=0x.js yarn lint
```
### Run Tests
Before running the tests, you will need to spin up a [TestRPC](https://www.npmjs.com/package/ethereumjs-testrpc) instance and deploy all the 0x smart contracts.
In a separate terminal, start TestRPC (a convenience command is provided as part of this repo)
Run all tests:
```bash
yarn testrpc
yarn test
```
Then in your main terminal run
```
cd packages/contracts
yarn migrate
cd ..
```
And finally from the root project directory run
Run a specific package's test:
```bash
yarn lerna:run test
PKG=@0xproject/web3-wrapper yarn test
```

View File

@@ -1,7 +1,17 @@
{
"lerna": "2.5.1",
"packages": ["packages/*"],
"commands": {
"publish": {
"allowBranch": "development"
}
},
"version": "independent",
"commands": {
"publish": {
"ignore": ["test/**/*", "*.md", "scripts", "lib", "tslint.json", "tsconfig.json"]
}
},
"npmClient": "yarn",
"useWorkspaces": true
}

View File

@@ -1,26 +1,53 @@
{
"private": true,
"name": "0x.js",
"workspaces": ["packages/*"],
"name": "0x-monorepo",
"engines": {
"node": ">=6.12"
},
"workspaces": [
"packages/*"
],
"scripts": {
"testrpc": "testrpc -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
"prettier": "prettier --write '**/*.{ts,tsx,json,md}'",
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}'",
"ganache": "ganache-cli -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
"prettier": "prettier --write '**/*.{ts,tsx,json,md}' --config .prettierrc",
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
"report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls",
"test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js",
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild script:publish",
"run:publish:dry": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild script:publish:dry",
"script:prepublish_checks": "node ./packages/monorepo-scripts/lib/prepublish_checks.js",
"script:publish": "node ./packages/monorepo-scripts/lib/publish.js",
"script:publish:dry": "IS_DRY_RUN=true yarn script:publish",
"install:all": "yarn install",
"wsrun": "wsrun",
"lerna:run": "lerna run",
"lerna:rebuild": "lerna run clean; lerna run build;",
"lerna:publish":
"yarn install; lerna run clean; lerna run build; lerna publish --registry=https://registry.npmjs.org/"
"watch": "wsrun watch_without_deps $PKG --fast-exit -r --stages --done-criteria='complete|successfully'",
"build": "wsrun build $PKG --fast-exit -r --stages",
"build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
"remove_node_modules": "lerna clean --yes; rm -rf node_modules",
"rebuild": "run-s clean build",
"test": "wsrun test $PKG --fast-exit --serial --exclude-missing",
"stage_docs": "wsrun docs:stage $PKG --fast-exit --parallel --exclude-missing",
"lint": "wsrun lint $PKG --fast-exit --parallel --exclude-missing",
"comment:postinstall": "HACK: For some reason `yarn` is not setting up symlinks properly for order-utils. We temporarily set them manually. Remove this after V2 refactor is complete.",
"postinstall": "rm -rf `pwd`/packages/0x.js/node_modules/@0xproject; mkdir `pwd`/packages/0x.js/node_modules/@0xproject; ln -s `pwd`/packages/contract-wrappers `pwd`/packages/0x.js/node_modules/@0xproject/contract-wrappers; ln -s `pwd`/packages/order-utils `pwd`/packages/0x.js/node_modules/@0xproject/order-utils; ln -s `pwd`/packages/types `pwd`/packages/0x.js/node_modules/@0xproject/types; rm -rf `pwd`/packages/order-utils/node_modules/@0xproject; mkdir `pwd`/packages/order-utils/node_modules/@0xproject; ln -s `pwd`/packages/json-schemas `pwd`/packages/order-utils/node_modules/@0xproject/json-schemas; ln -s `pwd`/packages/assert `pwd`/packages/order-utils/node_modules/@0xproject/assert; ln -s `pwd`/packages/types `pwd`/packages/order-utils/node_modules/@0xproject/types; rm -f `pwd`/packages/contracts/node_modules/@0xproject/types; ln -s `pwd`/packages/types `pwd`/packages/contracts/node_modules/@0xproject/types; rm -rf `pwd`/packages/fill-scenarios/node_modules/@0xproject; mkdir -p `pwd`/packages/fill-scenarios/node_modules/@0xproject; ln -s `pwd`/packages/types `pwd`/packages/fill-scenarios/node_modules/@0xproject/types; ln -s `pwd`/packages/json-schemas `pwd`/packages/fill-scenarios/node_modules/@0xproject/json-schemas; ln -s `pwd`/packages/order-utils `pwd`/packages/fill-scenarios/node_modules/@0xproject/order-utils; rm -rf `pwd`/packages/contract-wrappers/node_modules/@0xproject; mkdir -p `pwd`/packages/contract-wrappers/node_modules/@0xproject; ln -s `pwd`/packages/order-utils `pwd`/packages/contract-wrappers/node_modules/@0xproject/order-utils; ln -s `pwd`/packages/assert `pwd`/packages/contract-wrappers/node_modules/@0xproject/assert; ln -s `pwd`/packages/json-schemas `pwd`/packages/contract-wrappers/node_modules/@0xproject/json-schemas; ln -s `pwd`/packages/types `pwd`/packages/contract-wrappers/node_modules/@0xproject/types; ln -s `pwd`/packages/fill-scenarios `pwd`/packages/contract-wrappers/node_modules/@0xproject/fill-scenarios; rm -rf `pwd`/packages/assert/node_modules/@0xproject; mkdir -p `pwd`/packages/assert/node_modules/@0xproject; ln -s `pwd`/packages/json-schemas `pwd`/packages/assert/node_modules/@0xproject/json-schemas"
},
"config": {
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic"
},
"devDependencies": {
"@0xproject/utils": "^0.2.0",
"async-child-process": "^1.1.1",
"ethereumjs-testrpc": "^6.0.3",
"coveralls": "^3.0.0",
"ganache-cli": "6.1.3",
"lcov-result-merger": "^3.0.0",
"lerna": "^2.5.1",
"prettier": "1.9.2",
"publish-release": "0xproject/publish-release",
"semver-sort": "^0.0.4"
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"wsrun": "^2.2.0",
"source-map-support": "^0.5.6"
},
"resolutions": {
"ethers": "0xproject/ethers.js#eip-838-reasons"
}
}

11
packages/0x.js/.npmignore Normal file
View File

@@ -0,0 +1,11 @@
.*
tsconfig.json
webpack.config.js
yarn-error.log
test/
/src/
/_bundles/
/contract_templates/
/generated_docs/
/scripts/
/lib/src/monorepo_scripts/

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,144 @@
# CHANGELOG
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
## v0.30.1 - _TBD, 2018_
CHANGELOG
## v0.38.5 - _July 9, 2018_
* Dependencies updated
## v0.38.4 - _June 19, 2018_
* Dependencies updated
## v0.38.3 - _May 29, 2018_
* Dependencies updated
## v0.38.2 - _May 29, 2018_
* Dependencies updated
## v0.38.1 - _May 29, 2018_
* Dependencies updated
## v0.38.0 - _May 22, 2018_
* Renamed createOrderStateWatcher to createOrderWatcherAsync since it is now async (#579)
* Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage (#579)
## v0.37.2 - _May 5, 2018_
* Dependencies updated
## v0.37.1 - _May 4, 2018_
* Dependencies updated
## v0.37.0 - _May 4, 2018_
* Fixed expiration watcher comparator to handle orders with equal expiration times (#526)
* Update Web3 Provider Engine to 14.0.4 (#555)
* Add `zeroEx.getProvider()` (#559)
* Move `ZeroExError.InvalidSignature` to `@0xproject/order-utils` `OrderError.InvalidSignature` (#559)
## v0.36.3 - _April 18, 2018_
* Move @0xproject/migrations to devDependencies
## v0.36.2 - _April 18, 2018_
* Dependencies updated
## v0.36.1 - _April 18, 2018_
* Internal changes and refactoring
* Fix redundant expired order removal bug (#527)
## v0.36.0 - _April 11, 2018_
* Moved Web3.Provider to `@0xproject/types:Provider` (#501)
* Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder (#510)
## v0.35.0 - _April 2, 2018_
* Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout` (#485)
## v0.34.0 - _April 2, 2018_
* Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed (#470)
* Remove automatic instantiation of `zeroEx.orderStateWatcher` (#488)
* Add `zeroEx.createOrderStateWatcher` to allow creating arbitrary number of OrderStateWatchers (#488)
* Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers (#488)
## v0.33.2 - _March 17, 2018_
* Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package (#452)
* Consolidate `Order`, `SignedOrder`, and `ECSignature` into the `@0xproject/types` package (#456)
## v0.33.1 - _March 7, 2018_
* Add missing EthersJs typescript typings as dependency
## v0.33.0 - _March 3, 2018_
* Validate and lowercase all addresses in public methods (#373)
* Improve validation to force passing contract addresses on private networks (#385)
* Change `LogErrorContractEventArgs.errorId` type from `BigNumber` to `number` (#413)
* Rename all public `_unsubscribeAll` methods to `unsubscribeAll` (#415)
* Move web3 typings from devDep to dep since cannot use this package without it (#429)
## v0.32.2 - _February 8, 2018_
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
## v0.32.1 - _February 6, 2018_
* Reorganized `BlockParamLiteral` export into `@0xproject/types` package (#355)
* Now using `abi-gen` package to generate ContractEventArgs types (#371)
## v0.32.0 - _February 4, 2018_
* Add `zeroEx.etherToken.getContractAddressIfExists` (#350)
* Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields (#366)
## v0.31.1 - _January 31, 2018_
* Fix the bug causing order watcher to throw if makerToken === zrx (#357)
## v0.31.0 - _January 29, 2018_
* Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added. (#349)
## v0.30.2 - _January 28, 2018_
* Add Rinkeby testnet addresses to artifacts (#337)
* Move @0xproject/types to dependencies from devDependencies fixing missing type errors
## v0.30.1 - _January 23, 2018_
* Fix a bug allowing negative fill values (#212)
* Fix a bug that made it impossible to pass a custom ZRX address (#341)
* Add Rinkeby testnet addresses to artifacts (#337)
## v0.30.0 - _January 17, 2018_
## v0.30.0 - _January 16, 2018_
* Add an error parameter to the order watcher callback (#312)
* Fix a bug making it impossible to catch some errors from awaitTransactionMinedAsync (#312)
* Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders (#321)
## v0.29.1 - _January 11, 2018_
## v0.29.1 - _January 10, 2018_
* Fixed bignumber config issue #301 (#305)
## v0.29.0 - _December 28, 2017_
## v0.29.0 - _December 27, 2017_
* Assert baseUnit amount supplied to `toUnitAmount` is integer amount. (#287)
* `toBaseUnitAmount` throws if amount supplied has too many decimals (#287)
## v0.28.0 - _December 20, 2017_
## v0.28.0 - _December 19, 2017_
* Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken` (#267)
* Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry` (#267)
@@ -33,11 +150,11 @@
* Support `Deposit` and `Withdraw` events on etherToken (#277)
* Improve the error message when taker is not a string (#278)
## v0.27.1 - _November 28, 2017_
## v0.27.1 - _November 27, 2017_
* Export `TransactionOpts` type
## v0.27.0 - _November 28, 2017_
## v0.27.0 - _November 27, 2017_
* Make `ZeroExConfig` required parameter of `ZeroEx` constructor (#233)
* Add a required property `networkId` to `ZeroExConfig` (#233)
@@ -49,149 +166,149 @@
* All transaction sending methods now call `estimateGas` if no gas amount was supplied (#235)
* Modify order validation methods to validate against the `latest` block, not against the `pending` block (#236)
## v0.26.0 - _November 21, 2017_
## v0.26.0 - _November 20, 2017_
* Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers (#231)
* Remove support for Async callback types when used in Subscribe functions (#222)
* In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different (#225)
## v0.25.1 - _November 13, 2017_
## v0.25.1 - _November 12, 2017_
* Standardise on Cancelled over Canceled (#217)
* Add missing `DecodedLogEvent` type to exported types (#205)
* Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction. (#200)
## v0.23.0 - _November 12, 2017_
## v0.23.0 - _November 11, 2017_
* Fixed unhandled promise rejection error in subscribe methods (#209)
* Subscribe callbacks now receive an error object as their first argument
## v0.22.6 - _November 10, 2017_
## v0.22.6 - _November 9, 2017_
* Add a timeout parameter to transaction awaiting (#206)
## v0.22.5 - _November 7, 2017_
## v0.22.5 - _November 6, 2017_
* Re-publish v0.22.4 to fix publishing issue
## v0.22.4 - _October 25, 2017_
## v0.22.4 - _October 24, 2017_
* Upgraded bignumber.js to a new version that ships with native typings
## v0.22.3 - _October 25, 2017_
## v0.22.3 - _October 24, 2017_
* Fixed an issue with new version of testrpc and unlimited proxy allowance (#199)
## v0.22.2 - _October 24, 2017_
## v0.22.2 - _October 23, 2017_
* Fixed rounding of maker fill amount and incorrect validation of partial fees (#197)
## v0.22.0 - _October 16, 2017_
## v0.22.0 - _October 15, 2017_
* Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill` (#187)
* Removed `OrderFillOrKillRequest` (#187)
## v0.21.4 - _October 13, 2017_
## v0.21.4 - _October 12, 2017_
* Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type (#194)
## v0.21.3 - _October 12, 2017_
## v0.21.3 - _October 11, 2017_
* Fixed a bug causing order fills to throw `INSUFFICIENT_TAKER_ALLOWANCE` (#193)
## v0.21.2 - _October 11, 2017_
## v0.21.2 - _October 10, 2017_
* Exported `ContractEventArg` as a public type (#190)
## v0.21.1 - _October 11, 2017_
## v0.21.1 - _October 10, 2017_
* Fixed a bug in subscriptions (#189)
## v0.21.0 - _October 10, 2017_
## v0.21.0 - _October 9, 2017_
* Complete rewrite of subscription logic (#182)
* Subscriptions no longer return historical logs. If you want them - use `getLogsAsync`
* Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood
* Subscriptions correctly handle block re-orgs (forks)
* Subscriptions correctly backfill logs (connection problems)
* They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider
* Removed `ContractEventEmitter` and added `LogEvent`
* Renamed `zeroEx.token.subscribeAsync` to `zeroEx.token.subscribe`
* Added `zeroEx.token.unsubscribe` and `zeroEx.exchange.unsubscribe`
* Renamed `zeroEx.exchange.stopWatchingAllEventsAsync` to `zeroEx.exhange.unsubscribeAll`
* Renamed `zeroEx.token.stopWatchingAllEventsAsync` to `zeroEx.token.unsubscribeAll`
* Subscriptions no longer return historical logs. If you want them - use `getLogsAsync`
* Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood
* Subscriptions correctly handle block re-orgs (forks)
* Subscriptions correctly backfill logs (connection problems)
* They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider
* Removed `ContractEventEmitter` and added `LogEvent`
* Renamed `zeroEx.token.subscribeAsync` to `zeroEx.token.subscribe`
* Added `zeroEx.token.unsubscribe` and `zeroEx.exchange.unsubscribe`
* Renamed `zeroEx.exchange.stopWatchingAllEventsAsync` to `zeroEx.exhange.unsubscribeAll`
* Renamed `zeroEx.token.stopWatchingAllEventsAsync` to `zeroEx.token.unsubscribeAll`
* Fixed the batch fills validation by emulating all balance & proxy allowance changes (#185)
## v0.20.0 - _October 5, 2017_
## v0.20.0 - _October 4, 2017_
* Add `zeroEx.token.getLogsAsync` (#178)
* Add `zeroEx.exchange.getLogsAsync` (#178)
* Fixed fees validation when one of the tokens transferred is ZRX (#181)
## v0.19.0 - _September 29, 2017_
## v0.19.0 - _September 28, 2017_
* Made order validation optional (#172)
* Added Ropsten testnet support (#173)
* Fixed a bug causing awaitTransactionMinedAsync to DDos backend nodes (#175)
## v0.18.0 - _September 26, 2017_
## v0.18.0 - _September 25, 2017_
* Added `zeroEx.exchange.validateOrderFillableOrThrowAsync` to simplify orderbook pruning (#170)
## v0.17.0 - _September 26, 2017_
## v0.17.0 - _September 25, 2017_
* Made `zeroEx.exchange.getZRXTokenAddressAsync` public (#171)
## v0.16.0 - _September 20, 2017_
## v0.16.0 - _September 19, 2017_
* Added the ability to specify custom contract addresses to be used with 0x.js (#165)
* ZeroExConfig.exchangeContractAddress
* ZeroExConfig.tokenRegistryContractAddress
* ZeroExConfig.etherTokenContractAddress
* ZeroExConfig.exchangeContractAddress
* ZeroExConfig.tokenRegistryContractAddress
* ZeroExConfig.etherTokenContractAddress
* Added `zeroEx.tokenRegistry.getContractAddressAsync` (#165)
## v0.15.0 - _September 8, 2017_
## v0.15.0 - _September 7, 2017_
* Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method (#161)
## v0.14.2 - _September 7, 2017_
## v0.14.2 - _September 6, 2017_
* Fixed an issue with bignumber.js types not found (#160)
## v0.14.1 - _September 7, 2017_
## v0.14.1 - _September 6, 2017_
* Fixed an issue with Artifact type not found (#159)
## v0.14.0 - _September 6, 2017_
## v0.14.0 - _September 5, 2017_
* Added `zeroEx.exchange.throwLogErrorsAsErrors` method to public interface (#157)
* Fixed an issue with overlapping async intervals in `zeroEx.awaitTransactionMinedAsync` (#157)
* Fixed an issue with log decoder returning `BigNumber`s as `strings` (#157)
## v0.13.0 - _September 6, 2017_
## v0.13.0 - _September 5, 2017_
* Made all the functions submitting transactions to the network to immediately return transaction hash (#151)
* Added `zeroEx.awaitTransactionMinedAsync` (#151)
* Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types (#151)
* Added signature validation to `validateFillOrderThrowIfInvalidAsync` (#152)
## v0.12.1 - _September 2, 2017_
## v0.12.1 - _September 1, 2017_
* Added the support for web3@1.x.x provider (#142)
* Added the optional `zeroExConfig` parameter to the constructor of `ZeroEx` (#139)
* Added the ability to specify `gasPrice` when instantiating `ZeroEx` (#139)
## v0.11.0 - _August 24, 2017_
## v0.11.0 - _August 23, 2017_
* Added `zeroEx.token.setUnlimitedProxyAllowanceAsync` (#137)
* Added `zeroEx.token.setUnlimitedAllowanceAsync` (#137)
* Added `zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS` (#137)
## v0.10.4 - _Aug 24, 2017_
## v0.10.4 - _August 23, 2017_
* Fixed a bug where checksummed addresses were being pulled from artifacts and not lower-cased. (#135)
## v0.10.1 - _Aug 24, 2017_
## v0.10.1 - _August 23, 2017_
* Added `zeroEx.exchange.validateFillOrderThrowIfInvalidAsync` (#128)
* Added `zeroEx.exchange.validateFillOrKillOrderThrowIfInvalidAsync` (#128)
@@ -206,20 +323,20 @@
* Added clear error message when checksummed address is passed to a public method (#124)
* Fixes the description of `shouldThrowOnInsufficientBalanceOrAllowance` in docs (#127)
## v0.9.3 - _Aug 22, 2017_
## v0.9.3 - _August 21, 2017_
* Update contract artifacts to include latest Kovan and Mainnet deploys (#118)
## v0.9.2 - _Aug 21, 2017_
## v0.9.2 - _August 20, 2017_
* *This version was unpublished because of a publishing issue.*
* Update contract artifacts to include latest Kovan and Mainnet deploys (#118)
## v0.9.1 - _Aug. 16, 2017_
## v0.9.1 - _August 15, 2017_
* Fixed the bug causing `zeroEx.token.getBalanceAsync()` to fail if no addresses available (#120)
## v0.9.0 - _Jul. 26, 2017_
## v0.9.0 - _July 25, 2017_
* Migrated to the new version of smart contracts (#101)
* Removed the ability to call methods on multiple authorized Exchange smart contracts (#106)
@@ -230,48 +347,48 @@
* Updated to typescript v2.4 (#104)
* Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded (#109)
## v0.8.0 - _Jul. 4, 2017_
## v0.8.0 - _July 3, 2017_
* Added the ability to call methods on different authorized versions of the Exchange smart contract (#82)
* Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)
* Added `zeroEx.proxy.isAuthorizedAsync` and `zeroEx.proxy.getAuthorizedAddressesAsync` (#89)
* Added `zeroEx.token.subscribeAsync` (#90)
* Made contract invalidation functions private (#90)
* `zeroEx.token.invalidateContractInstancesAsync`
* `zeroEx.exchange.invalidateContractInstancesAsync`
* `zeroEx.proxy.invalidateContractInstance`
* `zeroEx.tokenRegistry.invalidateContractInstance`
* `zeroEx.token.invalidateContractInstancesAsync`
* `zeroEx.exchange.invalidateContractInstancesAsync`
* `zeroEx.proxy.invalidateContractInstance`
* `zeroEx.tokenRegistry.invalidateContractInstance`
* Fixed the bug where `zeroEx.setProviderAsync` didn't invalidate etherToken contract's instance
## v0.7.1 - _Jun. 26, 2017_
## v0.7.1 - _June 25, 2017_
* Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync` (#81)
## v0.7.0 - _Jun. 22, 2017_
## v0.7.0 - _June 21, 2017_
* Added Kovan smart contract artifacts (#78)
* Started returning fillAmount from `fillOrderAsync` and `fillUpToAsync` (#72)
* Started returning cancelledAmount from `cancelOrderAsync` (#72)
* Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`
## v0.6.2 - _Jun. 21, 2017_
## v0.6.2 - _June 20, 2017_
* Reduced bundle size
* Improved documentation
## v0.6.1 - _Jun. 19, 2017_
## v0.6.1 - _June 18, 2017_
* Improved documentation
## v0.6.0 - _Jun. 19, 2017_
## v0.6.0 - _June 18, 2017_
* Made `ZeroEx` class accept `Web3Provider` instance instead of `Web3` instance
* Added types for contract event arguments
## v0.5.2 - _Jun. 15, 2017_
## v0.5.2 - _June 14, 2017_
* Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page
## v0.5.1 - _Jun. 15, 2017_
## v0.5.1 - _June 14, 2017_
* Added `postpublish` script to publish to Github Releases with assets.

View File

@@ -1,5 +1,9 @@
## 0x.js
A TypeScript/Javascript library for interacting with the 0x protocol.
### Read the [Documentation](https://0xproject.com/docs/0x.js).
## Installation
0x.js ships as both a [UMD](https://github.com/umdjs/umd) module and a [CommonJS](https://en.wikipedia.org/wiki/CommonJS) package.
@@ -18,11 +22,19 @@ npm install 0x.js --save
import { ZeroEx } from '0x.js';
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
}
```
#### UMD:
**Install**
Download the UMD module from our [releases page](https://github.com/0xProject/0x.js/releases) and add it to your project.
Download the UMD module from our [releases page](https://github.com/0xProject/0x-monorepo/releases) and add it to your project.
**Import**
@@ -30,10 +42,54 @@ Download the UMD module from our [releases page](https://github.com/0xProject/0x
<script type="text/javascript" src="0x.js"></script>
```
## Documentation
## Contributing
Extensive documentation of 0x.js can be found on [our website][docs-url].
We strongly recommend that the community help us make improvements and determine the future direction of 0x protocol. To report bugs within this package, please create an issue in this repository.
[website-url]: https://0xproject.com/
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
[docs-url]: https://0xproject.com/docs/0xjs
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Then install dependencies
```bash
yarn install
```
### Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
PKG=0x.js yarn build
```
Or continuously rebuild on change:
```bash
PKG=0x.js yarn watch
```
### Clean
```bash
yarn clean
```
### Lint
```bash
yarn lint
```
### Run Tests
```bash
yarn test
```

View File

@@ -1,25 +0,0 @@
/**
* This file is auto-generated using abi-gen. Don't edit directly.
* Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
// tslint:disable-next-line:no-unused-variable
import { TxData, TxDataPayable } from '@0xproject/types';
import { BigNumber, classUtils, promisify } from '@0xproject/utils';
import * as Web3 from 'web3';
import {BaseContract} from './base_contract';
export class {{contractName}}Contract extends BaseContract {
{{#each methods}}
{{#this.constant}}
{{> call contractName=../contractName}}
{{/this.constant}}
{{^this.constant}}
{{> tx contractName=../contractName}}
{{/this.constant}}
{{/each}}
constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) {
super(web3ContractInstance, defaults);
classUtils.bindAll(this, ['web3ContractInstance', 'defaults']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,15 +0,0 @@
public {{this.name}} = {
async callAsync(
{{> typed_params inputs=inputs}}
defaultBlock?: Web3.BlockParam,
): Promise<{{> return_type outputs=outputs}}> {
const self = this as {{contractName}}Contract;
const result = await promisify<{{> return_type outputs=outputs}}>(
self.web3ContractInstance.{{this.name}}.call,
self.web3ContractInstance,
)(
{{> params inputs=inputs}}
);
return result;
},
};

View File

@@ -1,3 +0,0 @@
{{#each inputs}}
{{name}},
{{/each}}

View File

@@ -1,6 +0,0 @@
{{#singleReturnValue}}
{{#returnType outputs.0.type}}{{/returnType}}
{{/singleReturnValue}}
{{^singleReturnValue}}
[{{#each outputs}}{{#returnType type}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}]
{{/singleReturnValue}}

View File

@@ -1,51 +0,0 @@
public {{this.name}} = {
async sendTransactionAsync(
{{> typed_params inputs=inputs}}
{{#this.payable}}
txData: TxDataPayable = {},
{{/this.payable}}
{{^this.payable}}
txData: TxData = {},
{{/this.payable}}
): Promise<string> {
const self = this as {{contractName}}Contract;
const txDataWithDefaults = await self.applyDefaultsToTxDataAsync(
txData,
self.{{this.name}}.estimateGasAsync.bind(
self,
{{> params inputs=inputs}}
),
);
const txHash = await promisify<string>(
self.web3ContractInstance.{{this.name}}, self.web3ContractInstance,
)(
{{> params inputs=inputs}}
txDataWithDefaults,
);
return txHash;
},
async estimateGasAsync(
{{> typed_params inputs=inputs}}
txData: TxData = {},
): Promise<number> {
const self = this as {{contractName}}Contract;
const txDataWithDefaults = await self.applyDefaultsToTxDataAsync(
txData,
);
const gas = await promisify<number>(
self.web3ContractInstance.{{this.name}}.estimateGas, self.web3ContractInstance,
)(
{{> params inputs=inputs}}
txDataWithDefaults,
);
return gas;
},
getABIEncodedTransactionData(
{{> typed_params inputs=inputs}}
txData: TxData = {},
): string {
const self = this as {{contractName}}Contract;
const abiEncodedTransactionData = self.web3ContractInstance.{{this.name}}.getData();
return abiEncodedTransactionData;
},
};

View File

@@ -1,3 +0,0 @@
{{#each inputs}}
{{name}}: {{#parameterType type}}{{/parameterType}},
{{/each}}

View File

View File

@@ -1,94 +1,120 @@
{
"name": "0x.js",
"version": "0.30.1",
"version": "0.38.5",
"engines": {
"node": ">=6.12"
},
"description": "A javascript library for interacting with the 0x protocol",
"keywords": ["0x.js", "0xproject", "ethereum", "tokens", "exchange"],
"keywords": [
"0x.js",
"0xproject",
"ethereum",
"tokens",
"exchange"
],
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"prebuild": "run-s clean generate_contract_wrappers",
"build": "run-p build:umd:prod build:commonjs; exit 0;",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
"upload_docs_json":
"aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json",
"generate_contract_wrappers":
"node ../abi-gen/lib/index.js --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --templates contract_templates --output src/contract_wrappers/generated",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"test:circleci": "run-s test:coverage report_test_coverage",
"test": "run-s clean test:commonjs",
"test:coverage": "nyc npm run test --all",
"report_test_coverage": "nyc report --reporter=text-lcov | coveralls",
"update_contracts":
"for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
"clean": "shx rm -rf _bundles lib test_temp",
"watch_without_deps": "yarn pre_build && tsc -w",
"build": "yarn pre_build && yarn build:all && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"build:all": "run-p build:umd:prod build:commonjs; exit 0;",
"pre_build": "run-s update_artifacts generate_contract_wrappers",
"copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts",
"update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/2.0.0/$i.json src/artifacts; done;",
"generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(ZRXToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
"lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*",
"test:circleci": "run-s test:coverage",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"clean": "shx rm -rf _bundles lib test_temp scripts src/generated_contract_wrappers",
"build:umd:prod": "NODE_ENV=production webpack",
"build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;",
"test:commonjs": "run-s build:commonjs run_mocha",
"run_mocha": "mocha lib/test/**/*_test.js --timeout 10000 --bail --exit"
"build:commonjs": "tsc && yarn copy_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
"docs:stage": "node scripts/stage_docs.js",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
},
"config": {
"artifacts": "TokenTransferProxy Exchange TokenRegistry Token EtherToken"
"contracts": "ZRXToken",
"postpublish": {
"assets": [
"packages/0x.js/_bundles/index.js",
"packages/0x.js/_bundles/index.min.js"
],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts",
"../ethereum-types/src/index.ts",
"../contract-wrappers/src/types.ts",
"../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/token_wrapper.ts",
"../order-watcher/src/order_watcher/order_watcher.ts",
"./src/generated_contract_wrappers/ether_token.ts",
"./src/generated_contract_wrappers/token.ts",
"./src/generated_contract_wrappers/exchange.ts"
],
"s3BucketPath": "s3://doc-jsons/0x.js/",
"s3StagingBucketPath": "s3://staging-doc-jsons/0x.js/"
}
}
},
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x.js"
"url": "https://github.com/0xProject/0x-monorepo"
},
"license": "Apache-2.0",
"engines": {
"node": ">=6.0.0"
},
"devDependencies": {
"@0xproject/abi-gen": "^0.1.3",
"@0xproject/dev-utils": "^0.0.6",
"@0xproject/tslint-config": "^0.4.3",
"@types/bintrees": "^1.0.2",
"@types/jsonschema": "^1.1.1",
"@types/lodash": "^4.14.86",
"@0xproject/abi-gen": "^0.3.3",
"@0xproject/dev-utils": "^0.4.5",
"@0xproject/migrations": "^0.0.9",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"@types/sinon": "^2.2.2",
"@types/uuid": "^3.4.2",
"awesome-typescript-loader": "^3.1.3",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-as-promised-typescript-typings": "^0.0.5",
"chai-bignumber": "^2.0.1",
"chai-typescript-typings": "^0.0.2",
"copyfiles": "^1.2.0",
"coveralls": "^3.0.0",
"dirty-chai": "^2.0.1",
"json-loader": "^0.5.4",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"opn-cli": "^3.1.0",
"request": "^2.81.0",
"request-promise-native": "^1.0.4",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"truffle-hdwallet-provider": "^0.0.3",
"tslint": "5.8.0",
"typedoc": "~0.8.0",
"typescript": "~2.6.1",
"web3-provider-engine": "^13.0.1",
"web3-typescript-typings": "^0.9.5",
"tslint": "5.11.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1",
"webpack": "^3.1.0"
},
"dependencies": {
"@0xproject/assert": "^0.0.12",
"@0xproject/json-schemas": "^0.7.4",
"@0xproject/types": "^0.1.5",
"@0xproject/utils": "^0.2.1",
"@0xproject/web3-wrapper": "^0.1.6",
"bintrees": "^1.0.2",
"bn.js": "^4.11.8",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-blockstream": "^2.0.6",
"ethereumjs-util": "^5.1.1",
"js-sha3": "^0.6.1",
"lodash": "^4.17.4",
"uuid": "^3.1.0",
"web3": "^0.20.0"
"@0xproject/assert": "^0.2.13",
"@0xproject/base-contract": "^0.3.5",
"@0xproject/contract-wrappers": "^0.1.0",
"@0xproject/order-utils": "^1.0.0",
"@0xproject/sol-compiler": "^0.5.3",
"@0xproject/subproviders": "^0.10.5",
"@0xproject/types": "^1.0.0",
"@0xproject/typescript-typings": "^0.4.2",
"@0xproject/utils": "^0.7.2",
"@0xproject/web3-wrapper": "^0.7.2",
"ethereum-types": "^0.0.2",
"ethers": "3.0.22",
"lodash": "^4.17.4"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -1,40 +0,0 @@
const execAsync = require('async-child-process').execAsync;
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const cwd = __dirname + '/..';
const subPackageName = packageJSON.name;
const S3BucketPath = 's3://0xjs-docs-jsons/';
let tag;
let version;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
tag = result.tag;
version = result.version;
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
const assets = [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'];
return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
})
.then(function(release) {
console.log('POSTPUBLISH: Release successful, generating docs...');
const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json';
return execAsync('JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', {
cwd,
});
})
.then(function(result) {
if (result.stderr !== '') {
throw new Error(result.stderr);
}
const fileName = 'v' + version + '.json';
console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName);
const s3Url = S3BucketPath + fileName;
return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
cwd,
});
})
.catch(function(err) {
throw err;
});

View File

@@ -1,32 +1,27 @@
import { schemas, SchemaValidator } from '@0xproject/json-schemas';
import { BigNumber, intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
import { artifacts } from './artifacts';
import { EtherTokenWrapper } from './contract_wrappers/ether_token_wrapper';
import { ExchangeWrapper } from './contract_wrappers/exchange_wrapper';
import { TokenRegistryWrapper } from './contract_wrappers/token_registry_wrapper';
import { TokenTransferProxyWrapper } from './contract_wrappers/token_transfer_proxy_wrapper';
import { TokenWrapper } from './contract_wrappers/token_wrapper';
import { OrderStateWatcher } from './order_watcher/order_state_watcher';
import { zeroExConfigSchema } from './schemas/zero_ex_config_schema';
import { assert } from '@0xproject/assert';
import {
ECSignature,
Order,
SignedOrder,
TransactionReceiptWithDecodedLogs,
Web3Provider,
ZeroExConfig,
ZeroExError,
} from './types';
import { AbiDecoder } from './utils/abi_decoder';
import { assert } from './utils/assert';
ContractWrappers,
ContractWrappersConfig,
ERC20ProxyWrapper,
ERC20TokenWrapper,
ERC721ProxyWrapper,
ERC721TokenWrapper,
EtherTokenWrapper,
ExchangeWrapper,
} from '@0xproject/contract-wrappers';
import {
ecSignOrderHashAsync,
generatePseudoRandomSalt,
isValidSignatureAsync,
MessagePrefixOpts,
orderHashUtils,
} from '@0xproject/order-utils';
import { ECSignature, Order, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import { constants } from './utils/constants';
import { decorators } from './utils/decorators';
import { signatureUtils } from './utils/signature_utils';
import { utils } from './utils/utils';
/**
* The ZeroEx class is the single entry-point into the 0x.js library. It contains all of the library's functionality
@@ -39,66 +34,50 @@ export class ZeroEx {
* this constant for your convenience.
*/
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.
* An instance of the ERC20TokenWrapper class containing methods for interacting with any ERC20 token smart contract.
*/
public tokenRegistry: TokenRegistryWrapper;
public erc20Token: ERC20TokenWrapper;
/**
* An instance of the TokenWrapper class containing methods for interacting with any ERC20 token smart contract.
* An instance of the ERC721TokenWrapper class containing methods for interacting with any ERC721 token smart contract.
*/
public token: TokenWrapper;
public erc721Token: ERC721TokenWrapper;
/**
* An instance of the EtherTokenWrapper class containing methods for interacting with the
* wrapped ETH ERC20 token smart contract.
*/
public etherToken: EtherTokenWrapper;
/**
* An instance of the TokenTransferProxyWrapper class containing methods for interacting with the
* tokenTransferProxy smart contract.
* An instance of the ERC20ProxyWrapper class containing methods for interacting with the
* ERC20 proxy smart contract.
*/
public proxy: TokenTransferProxyWrapper;
public erc20Proxy: ERC20ProxyWrapper;
/**
* An instance of the OrderStateWatcher class containing methods for watching a set of orders for relevant
* blockchain state changes.
* An instance of the ERC721ProxyWrapper class containing methods for interacting with the
* ERC721 proxy smart contract.
*/
public orderStateWatcher: OrderStateWatcher;
private _web3Wrapper: Web3Wrapper;
private _abiDecoder: AbiDecoder;
/**
* 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 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.
*/
public static isValidSignature(data: string, signature: ECSignature, signerAddress: string): boolean {
assert.isHexString('data', data);
assert.doesConformToSchema('signature', signature, schemas.ecSignatureSchema);
assert.isETHAddressHex('signerAddress', signerAddress);
const isValidSignature = signatureUtils.isValidSignature(data, signature, signerAddress);
return isValidSignature;
}
public erc721Proxy: ERC721ProxyWrapper;
private readonly _contractWrappers: ContractWrappers;
/**
* Generates a pseudo-random 256-bit salt.
* The salt can be included in an 0x order, ensuring that the order generates a unique orderHash
* The salt can be included in a 0x order, ensuring that the order generates a unique orderHash
* and will not collide with other outstanding orders that are identical in all other parameters.
* @return A pseudo-random 256-bit number that can be used as a salt.
*/
public static generatePseudoRandomSalt(): BigNumber {
// BigNumber.random returns a pseudo-random number between 0 & 1 with a passed in number of decimal places.
// Source: https://mikemcl.github.io/bignumber.js/#random
const randomNumber = BigNumber.random(constants.MAX_DIGITS_IN_UNSIGNED_256_INT);
const factor = new BigNumber(10).pow(constants.MAX_DIGITS_IN_UNSIGNED_256_INT - 1);
const salt = randomNumber.times(factor).round();
return salt;
return generatePseudoRandomSalt();
}
/**
* Computes the orderHash for a supplied order.
* @param order An object that conforms to the Order or SignedOrder interface definitions.
* @return The resulting orderHash from hashing the supplied order.
*/
public static getOrderHashHex(order: Order | SignedOrder): string {
return orderHashUtils.getOrderHashHex(order);
}
/**
* Checks if the supplied hex encoded order hash is valid.
@@ -108,12 +87,7 @@ export class ZeroEx {
* @return Whether the supplied orderHash has the expected format.
*/
public static isValidOrderHash(orderHash: string): boolean {
// Since this method can be called to check if any arbitrary string conforms to an orderHash's
// format, we only assert that we were indeed passed a string.
assert.isString('orderHash', orderHash);
const schemaValidator = new SchemaValidator();
const isValidOrderHash = schemaValidator.validate(orderHash, schemas.orderHashSchema).valid;
return isValidOrderHash;
return orderHashUtils.isValidOrderHash(orderHash);
}
/**
* A unit amount is defined as the amount of a token above the specified decimal places (integer part).
@@ -126,10 +100,8 @@ export class ZeroEx {
public static toUnitAmount(amount: BigNumber, decimals: number): BigNumber {
assert.isValidBaseUnitAmount('amount', amount);
assert.isNumber('decimals', decimals);
const aUnit = new BigNumber(10).pow(decimals);
const unit = amount.div(aUnit);
return unit;
const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals);
return unitAmount;
}
/**
* A baseUnit is defined as the smallest denomination of a token. An amount expressed in baseUnits
@@ -142,70 +114,42 @@ export class ZeroEx {
public static toBaseUnitAmount(amount: BigNumber, decimals: number): BigNumber {
assert.isBigNumber('amount', amount);
assert.isNumber('decimals', decimals);
const unit = new BigNumber(10).pow(decimals);
const baseUnitAmount = amount.times(unit);
const hasDecimals = baseUnitAmount.decimalPlaces() !== 0;
if (hasDecimals) {
throw new Error(`Invalid unit amount: ${amount.toString()} - Too many decimal places`);
}
const baseUnitAmount = Web3Wrapper.toBaseUnitAmount(amount, decimals);
return baseUnitAmount;
}
/**
* Computes the orderHash for a supplied order.
* @param order An object that conforms to the Order or SignedOrder interface definitions.
* @return The resulting orderHash from hashing the supplied order.
*/
@decorators.syncZeroExErrorHandler
public static getOrderHashHex(order: Order | SignedOrder): string {
assert.doesConformToSchema('order', order, schemas.orderSchema);
const orderHashHex = utils.getOrderHashHex(order);
return orderHashHex;
}
/**
* Instantiates a new ZeroEx instance that provides the public interface to the 0x.js library.
* @param provider The Web3.js Provider instance you would like the 0x.js library to use for interacting with
* @param provider The Provider instance you would like the 0x.js library to use for interacting with
* the Ethereum network.
* @param config The configuration object. Look up the type for the description.
* @return An instance of the 0x.js ZeroEx class.
*/
constructor(provider: Web3Provider, config: ZeroExConfig) {
constructor(provider: Provider, config: ContractWrappersConfig) {
assert.isWeb3Provider('provider', provider);
assert.doesConformToSchema('config', config, zeroExConfigSchema);
const artifactJSONs = _.values(artifacts);
const abiArrays = _.map(artifactJSONs, artifact => artifact.abi);
this._abiDecoder = new AbiDecoder(abiArrays);
const defaults = {
gasPrice: config.gasPrice,
};
this._web3Wrapper = new Web3Wrapper(provider, defaults);
this.proxy = new TokenTransferProxyWrapper(
this._web3Wrapper,
config.networkId,
config.tokenTransferProxyContractAddress,
);
this.token = new TokenWrapper(this._web3Wrapper, config.networkId, this._abiDecoder, this.proxy);
this.exchange = new ExchangeWrapper(
this._web3Wrapper,
config.networkId,
this._abiDecoder,
this.token,
config.exchangeContractAddress,
config.zrxContractAddress,
);
this.tokenRegistry = new TokenRegistryWrapper(
this._web3Wrapper,
config.networkId,
config.tokenRegistryContractAddress,
);
this.etherToken = new EtherTokenWrapper(this._web3Wrapper, config.networkId, this._abiDecoder, this.token);
this.orderStateWatcher = new OrderStateWatcher(
this._web3Wrapper,
this._abiDecoder,
this.token,
this.exchange,
config.orderWatcherConfig,
this._contractWrappers = new ContractWrappers(provider, config);
this.erc20Proxy = this._contractWrappers.erc20Proxy;
this.erc721Proxy = this._contractWrappers.erc721Proxy;
this.erc20Token = this._contractWrappers.erc20Token;
this.erc721Token = this._contractWrappers.erc721Token;
this.exchange = this._contractWrappers.exchange;
this.etherToken = this._contractWrappers.etherToken;
}
/**
* Verifies that the provided signature is valid according to the 0x Protocol smart contracts
* @param data The hex encoded data signed by the supplied signature.
* @param signature The hex encoded signature.
* @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.
*/
public async isValidSignatureAsync(data: string, signature: string, signerAddress: string): Promise<boolean> {
const isValid = await isValidSignatureAsync(
this._contractWrappers.getProvider(),
data,
signature,
signerAddress,
);
return isValid;
}
/**
* Sets a new web3 provider for 0x.js. Updating the provider will stop all
@@ -213,25 +157,24 @@ export class ZeroEx {
* @param provider The Web3Provider you would like the 0x.js library to use from now on.
* @param networkId The id of the network your provider is connected to
*/
public setProvider(provider: Web3Provider, networkId: number): void {
this._web3Wrapper.setProvider(provider);
(this.exchange as any)._invalidateContractInstances();
(this.exchange as any)._setNetworkId(networkId);
(this.tokenRegistry as any)._invalidateContractInstance();
(this.tokenRegistry as any)._setNetworkId(networkId);
(this.token as any)._invalidateContractInstances();
(this.token as any)._setNetworkId(networkId);
(this.proxy as any)._invalidateContractInstance();
(this.proxy as any)._setNetworkId(networkId);
(this.etherToken as any)._invalidateContractInstance();
(this.etherToken as any)._setNetworkId(networkId);
public setProvider(provider: Provider, networkId: number): void {
this._contractWrappers.setProvider(provider, networkId);
}
/**
* Get the provider instance currently used by 0x.js
* @return Web3 provider instance
*/
public getProvider(): Provider {
return this._contractWrappers.getProvider();
}
/**
* Get user Ethereum addresses available through the supplied web3 provider available for sending transactions.
* @return An array of available user Ethereum addresses.
*/
public async getAvailableAddressesAsync(): Promise<string[]> {
const availableAddresses = await this._web3Wrapper.getAvailableAddressesAsync();
// Hack: Get Web3Wrapper from ContractWrappers
const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const availableAddresses = await web3Wrapper.getAvailableAddressesAsync();
return availableAddresses;
}
/**
@@ -239,50 +182,22 @@ export class ZeroEx {
* This method currently supports TestRPC, Geth and Parity above and below V1.6.6
* @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.
* must be available via the Provider supplied to 0x.js.
* @param MessagePrefixOpts Options regarding the desired prefix and whether to add it before calling `eth_sign`
* @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);
await assert.isSenderAddressAsync('signerAddress', signerAddress, this._web3Wrapper);
let msgHashHex;
const nodeVersion = await this._web3Wrapper.getNodeVersionAsync();
const isParityNode = utils.isParityNode(nodeVersion);
const isTestRpc = utils.isTestRpc(nodeVersion);
if (isParityNode || isTestRpc) {
// Parity and TestRpc nodes add the personalMessage prefix itself
msgHashHex = orderHash;
} else {
const orderHashBuff = ethUtil.toBuffer(orderHash);
const msgHashBuff = ethUtil.hashPersonalMessage(orderHashBuff);
msgHashHex = ethUtil.bufferToHex(msgHashBuff);
}
const signature = await this._web3Wrapper.signTransactionAsync(signerAddress, msgHashHex);
// HACK: There is no consensus on whether the signatureHex string should be formatted as
// v + r + s OR r + s + v, and different clients (even different versions of the same client)
// return the signature params in different orders. In order to support all client implementations,
// we parse the signature in both ways, and evaluate if either one is a valid signature.
const validVParamValues = [27, 28];
const ecSignatureVRS = signatureUtils.parseSignatureHexAsVRS(signature);
if (_.includes(validVParamValues, ecSignatureVRS.v)) {
const isValidVRSSignature = ZeroEx.isValidSignature(orderHash, ecSignatureVRS, signerAddress);
if (isValidVRSSignature) {
return ecSignatureVRS;
}
}
const ecSignatureRSV = signatureUtils.parseSignatureHexAsRSV(signature);
if (_.includes(validVParamValues, ecSignatureRSV.v)) {
const isValidRSVSignature = ZeroEx.isValidSignature(orderHash, ecSignatureRSV, signerAddress);
if (isValidRSVSignature) {
return ecSignatureRSV;
}
}
throw new Error(ZeroExError.InvalidSignature);
public async ecSignOrderHashAsync(
orderHash: string,
signerAddress: string,
messagePrefixOpts: MessagePrefixOpts,
): Promise<ECSignature> {
const signature = await ecSignOrderHashAsync(
this._contractWrappers.getProvider(),
orderHash,
signerAddress,
messagePrefixOpts,
);
return signature;
}
/**
* Waits for a transaction to be mined and returns the transaction receipt.
@@ -293,56 +208,16 @@ export class ZeroEx {
*/
public async awaitTransactionMinedAsync(
txHash: string,
pollingIntervalMs = 1000,
pollingIntervalMs: number = 1000,
timeoutMs?: number,
): Promise<TransactionReceiptWithDecodedLogs> {
let timeoutExceeded = false;
if (timeoutMs) {
setTimeout(() => (timeoutExceeded = true), timeoutMs);
}
const txReceiptPromise = new Promise(
(resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => {
const intervalId = intervalUtils.setAsyncExcludingInterval(
async () => {
if (timeoutExceeded) {
intervalUtils.clearAsyncExcludingInterval(intervalId);
return reject(ZeroExError.TransactionMiningTimeout);
}
const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash);
if (!_.isNull(transactionReceipt)) {
intervalUtils.clearAsyncExcludingInterval(intervalId);
const logsWithDecodedArgs = _.map(
transactionReceipt.logs,
this._abiDecoder.tryToDecodeLogOrNoop.bind(this._abiDecoder),
);
const transactionReceiptWithDecodedLogArgs: TransactionReceiptWithDecodedLogs = {
...transactionReceipt,
logs: logsWithDecodedArgs,
};
resolve(transactionReceiptWithDecodedLogArgs);
}
},
pollingIntervalMs,
(err: Error) => {
intervalUtils.clearAsyncExcludingInterval(intervalId);
reject(err);
},
);
},
// Hack: Get Web3Wrapper from ContractWrappers
const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const transactionReceiptWithDecodedLogs = await web3Wrapper.awaitTransactionMinedAsync(
txHash,
pollingIntervalMs,
timeoutMs,
);
return txReceiptPromise;
}
/*
* HACK: `TokenWrapper` needs a token transfer proxy address. `TokenTransferProxy` address is fetched from
* an `ExchangeWrapper`. `ExchangeWrapper` needs `TokenWrapper` to validate orders, creating a dependency cycle.
* In order to break this - we create this function here and pass it as a parameter to the `TokenWrapper`
* and `ProxyWrapper`.
*/
private async _getTokenTransferProxyAddressAsync(): Promise<string> {
const tokenTransferProxyAddress = await (this.exchange as any)._getTokenTransferProxyAddressAsync();
return tokenTransferProxyAddress;
return transactionReceiptWithDecodedLogs;
}
}

View File

@@ -1,18 +1,7 @@
import * as DummyTokenArtifact from './artifacts/DummyToken.json';
import * as EtherTokenArtifact from './artifacts/EtherToken.json';
import * as ExchangeArtifact from './artifacts/Exchange.json';
import * as TokenArtifact from './artifacts/Token.json';
import * as TokenRegistryArtifact from './artifacts/TokenRegistry.json';
import * as TokenTransferProxyArtifact from './artifacts/TokenTransferProxy.json';
import * as ZRXArtifact from './artifacts/ZRX.json';
import { Artifact } from './types';
import { ContractArtifact } from '@0xproject/sol-compiler';
import * as ZRXToken from './artifacts/ZRXToken.json';
export const artifacts = {
ZRXArtifact: (ZRXArtifact as any) as Artifact,
DummyTokenArtifact: (DummyTokenArtifact as any) as Artifact,
TokenArtifact: (TokenArtifact as any) as Artifact,
ExchangeArtifact: (ExchangeArtifact as any) as Artifact,
EtherTokenArtifact: (EtherTokenArtifact as any) as Artifact,
TokenRegistryArtifact: (TokenRegistryArtifact as any) as Artifact,
TokenTransferProxyArtifact: (TokenTransferProxyArtifact as any) as Artifact,
ZRXToken: (ZRXToken as any) as ContractArtifact,
};

File diff suppressed because one or more lines are too long

View File

@@ -1,913 +0,0 @@
import { schemas } from '@0xproject/json-schemas';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import * as Web3 from 'web3';
import { artifacts } from '../artifacts';
import {
BlockParamLiteral,
BlockRange,
DecodedLogArgs,
ECSignature,
EventCallback,
ExchangeContractErrCodes,
ExchangeContractErrs,
ExchangeContractEventArgs,
ExchangeEvents,
IndexedFilterValues,
LogErrorContractEventArgs,
LogWithDecodedArgs,
MethodOpts,
Order,
OrderAddresses,
OrderCancellationRequest,
OrderFillRequest,
OrderTransactionOpts,
OrderValues,
SignedOrder,
ValidateOrderFillableOpts,
} from '../types';
import { AbiDecoder } from '../utils/abi_decoder';
import { assert } from '../utils/assert';
import { decorators } from '../utils/decorators';
import { ExchangeTransferSimulator } from '../utils/exchange_transfer_simulator';
import { OrderValidationUtils } from '../utils/order_validation_utils';
import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
import { ExchangeContract } from './generated/exchange';
import { TokenWrapper } from './token_wrapper';
const SHOULD_VALIDATE_BY_DEFAULT = true;
interface ExchangeContractErrCodesToMsgs {
[exchangeContractErrCodes: number]: string;
}
/**
* This class includes all the functionality related to calling methods and subscribing to
* events of the 0x Exchange smart contract.
*/
export class ExchangeWrapper extends ContractWrapper {
private _exchangeContractIfExists?: ExchangeContract;
private _orderValidationUtils: OrderValidationUtils;
private _tokenWrapper: TokenWrapper;
private _exchangeContractErrCodesToMsg: ExchangeContractErrCodesToMsgs = {
[ExchangeContractErrCodes.ERROR_FILL_EXPIRED]: ExchangeContractErrs.OrderFillExpired,
[ExchangeContractErrCodes.ERROR_CANCEL_EXPIRED]: ExchangeContractErrs.OrderFillExpired,
[ExchangeContractErrCodes.ERROR_FILL_NO_VALUE]: ExchangeContractErrs.OrderRemainingFillAmountZero,
[ExchangeContractErrCodes.ERROR_CANCEL_NO_VALUE]: ExchangeContractErrs.OrderRemainingFillAmountZero,
[ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: ExchangeContractErrs.OrderFillRoundingError,
[ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: ExchangeContractErrs.FillBalanceAllowanceError,
};
private _contractAddressIfExists?: string;
private _zrxContractAddressIfExists?: string;
private static _getOrderAddressesAndValues(order: Order): [OrderAddresses, OrderValues] {
const orderAddresses: OrderAddresses = [
order.maker,
order.taker,
order.makerTokenAddress,
order.takerTokenAddress,
order.feeRecipient,
];
const orderValues: OrderValues = [
order.makerTokenAmount,
order.takerTokenAmount,
order.makerFee,
order.takerFee,
order.expirationUnixTimestampSec,
order.salt,
];
return [orderAddresses, orderValues];
}
constructor(
web3Wrapper: Web3Wrapper,
networkId: number,
abiDecoder: AbiDecoder,
tokenWrapper: TokenWrapper,
contractAddressIfExists?: string,
zrxContractAddressIfExists?: string,
) {
super(web3Wrapper, networkId, abiDecoder);
this._tokenWrapper = tokenWrapper;
this._orderValidationUtils = new OrderValidationUtils(this);
this._contractAddressIfExists = contractAddressIfExists;
this._zrxContractAddressIfExists = zrxContractAddressIfExists;
}
/**
* Returns the unavailable takerAmount of an order. Unavailable amount is defined as the total
* amount that has been filled or cancelled. The remaining takerAmount can be calculated by
* subtracting the unavailable amount from the total order takerAmount.
* @param orderHash The hex encoded orderHash for which you would like to retrieve the
* unavailable takerAmount.
* @param methodOpts Optional arguments this method accepts.
* @return The amount of the order (in taker tokens) that has either been filled or cancelled.
*/
public async getUnavailableTakerAmountAsync(orderHash: string, methodOpts?: MethodOpts): Promise<BigNumber> {
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
const exchangeContract = await this._getExchangeContractAsync();
const defaultBlock = _.isUndefined(methodOpts) ? undefined : methodOpts.defaultBlock;
let unavailableTakerTokenAmount = await exchangeContract.getUnavailableTakerTokenAmount.callAsync(
orderHash,
defaultBlock,
);
// Wrap BigNumbers returned from web3 with our own (later) version of BigNumber
unavailableTakerTokenAmount = new BigNumber(unavailableTakerTokenAmount);
return unavailableTakerTokenAmount;
}
/**
* Retrieve the takerAmount of an order that has already been filled.
* @param orderHash The hex encoded orderHash for which you would like to retrieve the filled takerAmount.
* @param methodOpts Optional arguments this method accepts.
* @return The amount of the order (in taker tokens) that has already been filled.
*/
public async getFilledTakerAmountAsync(orderHash: string, methodOpts?: MethodOpts): Promise<BigNumber> {
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
const exchangeContract = await this._getExchangeContractAsync();
const defaultBlock = _.isUndefined(methodOpts) ? undefined : methodOpts.defaultBlock;
let fillAmountInBaseUnits = await exchangeContract.filled.callAsync(orderHash, defaultBlock);
// Wrap BigNumbers returned from web3 with our own (later) version of BigNumber
fillAmountInBaseUnits = new BigNumber(fillAmountInBaseUnits);
return fillAmountInBaseUnits;
}
/**
* Retrieve the takerAmount of an order that has been cancelled.
* @param orderHash The hex encoded orderHash for which you would like to retrieve the
* cancelled takerAmount.
* @param methodOpts Optional arguments this method accepts.
* @return The amount of the order (in taker tokens) that has been cancelled.
*/
public async getCancelledTakerAmountAsync(orderHash: string, methodOpts?: MethodOpts): Promise<BigNumber> {
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
const exchangeContract = await this._getExchangeContractAsync();
const defaultBlock = _.isUndefined(methodOpts) ? undefined : methodOpts.defaultBlock;
let cancelledAmountInBaseUnits = await exchangeContract.cancelled.callAsync(orderHash, defaultBlock);
// Wrap BigNumbers returned from web3 with our own (later) version of BigNumber
cancelledAmountInBaseUnits = new BigNumber(cancelledAmountInBaseUnits);
return cancelledAmountInBaseUnits;
}
/**
* Fills a signed order with an amount denominated in baseUnits of the taker token.
* Since the order in which transactions are included in the next block is indeterminate, race-conditions
* could arise where a users balance or allowance changes before the fillOrder executes. Because of this,
* we allow you to specify `shouldThrowOnInsufficientBalanceOrAllowance`.
* If false, the smart contract will not throw if the parties
* do not have sufficient balances/allowances, preserving gas costs. Setting it to true forgoes this check
* and causes the smart contract to throw (using all the gas supplied) instead.
* @param signedOrder An object that conforms to the SignedOrder interface.
* @param fillTakerTokenAmount The amount of the order (in taker tokens baseUnits) that
* you wish to fill.
* @param shouldThrowOnInsufficientBalanceOrAllowance Whether or not you wish for the contract call to throw
* if upon execution the tokens cannot be transferred.
* @param takerAddress The user Ethereum address who would like to fill this order.
* Must be available via the supplied Web3.Provider
* passed to 0x.js.
* @param orderTransactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async fillOrderAsync(
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
shouldThrowOnInsufficientBalanceOrAllowance: boolean,
takerAddress: string,
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
assert.isValidBaseUnitAmount('fillTakerTokenAmount', fillTakerTokenAmount);
assert.isBoolean('shouldThrowOnInsufficientBalanceOrAllowance', shouldThrowOnInsufficientBalanceOrAllowance);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
const exchangeInstance = await this._getExchangeContractAsync();
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
fillTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
}
const [orderAddresses, orderValues] = ExchangeWrapper._getOrderAddressesAndValues(signedOrder);
const txHash: string = await exchangeInstance.fillOrder.sendTransactionAsync(
orderAddresses,
orderValues,
fillTakerTokenAmount,
shouldThrowOnInsufficientBalanceOrAllowance,
signedOrder.ecSignature.v,
signedOrder.ecSignature.r,
signedOrder.ecSignature.s,
{
from: takerAddress,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Sequentially and atomically fills signedOrders up to the specified takerTokenFillAmount.
* If the fill amount is reached - it succeeds and does not fill the rest of the orders.
* If fill amount is not reached - it fills as much of the fill amount as possible and succeeds.
* @param signedOrders The array of signedOrders that you would like to fill until
* takerTokenFillAmount is reached.
* @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill.
* @param shouldThrowOnInsufficientBalanceOrAllowance Whether or not you wish for the contract call to throw if
* upon execution any of the tokens cannot be transferred.
* If set to false, the call will continue to fill subsequent
* signedOrders even when some cannot be filled.
* @param takerAddress The user Ethereum address who would like to fill these
* orders. Must be available via the supplied Web3.Provider
* passed to 0x.js.
* @param orderTransactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async fillOrdersUpToAsync(
signedOrders: SignedOrder[],
fillTakerTokenAmount: BigNumber,
shouldThrowOnInsufficientBalanceOrAllowance: boolean,
takerAddress: string,
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema('signedOrders', signedOrders, schemas.signedOrdersSchema);
const takerTokenAddresses = _.map(signedOrders, signedOrder => signedOrder.takerTokenAddress);
assert.hasAtMostOneUniqueValue(
takerTokenAddresses,
ExchangeContractErrs.MultipleTakerTokensInFillUpToDisallowed,
);
const exchangeContractAddresses = _.map(signedOrders, signedOrder => signedOrder.exchangeContractAddress);
assert.hasAtMostOneUniqueValue(
exchangeContractAddresses,
ExchangeContractErrs.BatchOrdersMustHaveSameExchangeAddress,
);
assert.isValidBaseUnitAmount('fillTakerTokenAmount', fillTakerTokenAmount);
assert.isBoolean('shouldThrowOnInsufficientBalanceOrAllowance', shouldThrowOnInsufficientBalanceOrAllowance);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
let filledTakerTokenAmount = new BigNumber(0);
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
for (const signedOrder of signedOrders) {
const singleFilledTakerTokenAmount = await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
fillTakerTokenAmount.minus(filledTakerTokenAmount),
takerAddress,
zrxTokenAddress,
);
filledTakerTokenAmount = filledTakerTokenAmount.plus(singleFilledTakerTokenAmount);
}
}
if (_.isEmpty(signedOrders)) {
throw new Error(ExchangeContractErrs.BatchOrdersMustHaveAtLeastOneItem);
}
const orderAddressesValuesAndSignatureArray = _.map(signedOrders, signedOrder => {
return [
...ExchangeWrapper._getOrderAddressesAndValues(signedOrder),
signedOrder.ecSignature.v,
signedOrder.ecSignature.r,
signedOrder.ecSignature.s,
];
});
// We use _.unzip<any> because _.unzip doesn't type check if values have different types :'(
const [orderAddressesArray, orderValuesArray, vArray, rArray, sArray] = _.unzip<any>(
orderAddressesValuesAndSignatureArray,
);
const exchangeInstance = await this._getExchangeContractAsync();
const txHash = await exchangeInstance.fillOrdersUpTo.sendTransactionAsync(
orderAddressesArray,
orderValuesArray,
fillTakerTokenAmount,
shouldThrowOnInsufficientBalanceOrAllowance,
vArray,
rArray,
sArray,
{
from: takerAddress,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Batch version of fillOrderAsync.
* Executes multiple fills atomically in a single transaction.
* If shouldThrowOnInsufficientBalanceOrAllowance is set to false, it will continue filling subsequent orders even
* when earlier ones fail.
* When shouldThrowOnInsufficientBalanceOrAllowance is set to true, if any fill fails, the entire batch fails.
* @param orderFillRequests An array of objects that conform to the
* OrderFillRequest interface.
* @param shouldThrowOnInsufficientBalanceOrAllowance Whether or not you wish for the contract call to throw
* if upon execution any of the tokens cannot be
* transferred. If set to false, the call will continue to
* fill subsequent signedOrders even when some
* cannot be filled.
* @param takerAddress The user Ethereum address who would like to fill
* these orders. Must be available via the supplied
* Web3.Provider passed to 0x.js.
* @param orderTransactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async batchFillOrdersAsync(
orderFillRequests: OrderFillRequest[],
shouldThrowOnInsufficientBalanceOrAllowance: boolean,
takerAddress: string,
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema('orderFillRequests', orderFillRequests, schemas.orderFillRequestsSchema);
const exchangeContractAddresses = _.map(
orderFillRequests,
orderFillRequest => orderFillRequest.signedOrder.exchangeContractAddress,
);
assert.hasAtMostOneUniqueValue(
exchangeContractAddresses,
ExchangeContractErrs.BatchOrdersMustHaveSameExchangeAddress,
);
assert.isBoolean('shouldThrowOnInsufficientBalanceOrAllowance', shouldThrowOnInsufficientBalanceOrAllowance);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
for (const orderFillRequest of orderFillRequests) {
await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
orderFillRequest.signedOrder,
orderFillRequest.takerTokenFillAmount,
takerAddress,
zrxTokenAddress,
);
}
}
if (_.isEmpty(orderFillRequests)) {
throw new Error(ExchangeContractErrs.BatchOrdersMustHaveAtLeastOneItem);
}
const orderAddressesValuesAmountsAndSignatureArray = _.map(orderFillRequests, orderFillRequest => {
return [
...ExchangeWrapper._getOrderAddressesAndValues(orderFillRequest.signedOrder),
orderFillRequest.takerTokenFillAmount,
orderFillRequest.signedOrder.ecSignature.v,
orderFillRequest.signedOrder.ecSignature.r,
orderFillRequest.signedOrder.ecSignature.s,
];
});
// We use _.unzip<any> because _.unzip doesn't type check if values have different types :'(
const [orderAddressesArray, orderValuesArray, fillTakerTokenAmounts, vArray, rArray, sArray] = _.unzip<any>(
orderAddressesValuesAmountsAndSignatureArray,
);
const exchangeInstance = await this._getExchangeContractAsync();
const txHash = await exchangeInstance.batchFillOrders.sendTransactionAsync(
orderAddressesArray,
orderValuesArray,
fillTakerTokenAmounts,
shouldThrowOnInsufficientBalanceOrAllowance,
vArray,
rArray,
sArray,
{
from: takerAddress,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Attempts to fill a specific amount of an order. If the entire amount specified cannot be filled,
* the fill order is abandoned.
* @param signedOrder An object that conforms to the SignedOrder interface. The
* signedOrder you wish to fill.
* @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill.
* @param takerAddress The user Ethereum address who would like to fill this order.
* Must be available via the supplied Web3.Provider passed to 0x.js.
* @param orderTransactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async fillOrKillOrderAsync(
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
takerAddress: string,
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
assert.isValidBaseUnitAmount('fillTakerTokenAmount', fillTakerTokenAmount);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
const exchangeInstance = await this._getExchangeContractAsync();
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
await this._orderValidationUtils.validateFillOrKillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
fillTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
}
const [orderAddresses, orderValues] = ExchangeWrapper._getOrderAddressesAndValues(signedOrder);
const txHash = await exchangeInstance.fillOrKillOrder.sendTransactionAsync(
orderAddresses,
orderValues,
fillTakerTokenAmount,
signedOrder.ecSignature.v,
signedOrder.ecSignature.r,
signedOrder.ecSignature.s,
{
from: takerAddress,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Batch version of fillOrKill. Allows a taker to specify a batch of orders that will either be atomically
* filled (each to the specified fillAmount) or aborted.
* @param orderFillRequests An array of objects that conform to the OrderFillRequest interface.
* @param takerAddress The user Ethereum address who would like to fill there orders.
* Must be available via the supplied Web3.Provider passed to 0x.js.
* @param orderTransactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async batchFillOrKillAsync(
orderFillRequests: OrderFillRequest[],
takerAddress: string,
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema('orderFillRequests', orderFillRequests, schemas.orderFillRequestsSchema);
const exchangeContractAddresses = _.map(
orderFillRequests,
orderFillRequest => orderFillRequest.signedOrder.exchangeContractAddress,
);
assert.hasAtMostOneUniqueValue(
exchangeContractAddresses,
ExchangeContractErrs.BatchOrdersMustHaveSameExchangeAddress,
);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
if (_.isEmpty(orderFillRequests)) {
throw new Error(ExchangeContractErrs.BatchOrdersMustHaveAtLeastOneItem);
}
const exchangeInstance = await this._getExchangeContractAsync();
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
for (const orderFillRequest of orderFillRequests) {
await this._orderValidationUtils.validateFillOrKillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
orderFillRequest.signedOrder,
orderFillRequest.takerTokenFillAmount,
takerAddress,
zrxTokenAddress,
);
}
}
const orderAddressesValuesAndTakerTokenFillAmounts = _.map(orderFillRequests, request => {
return [
...ExchangeWrapper._getOrderAddressesAndValues(request.signedOrder),
request.takerTokenFillAmount,
request.signedOrder.ecSignature.v,
request.signedOrder.ecSignature.r,
request.signedOrder.ecSignature.s,
];
});
// We use _.unzip<any> because _.unzip doesn't type check if values have different types :'(
const [orderAddresses, orderValues, fillTakerTokenAmounts, vParams, rParams, sParams] = _.unzip<any>(
orderAddressesValuesAndTakerTokenFillAmounts,
);
const txHash = await exchangeInstance.batchFillOrKillOrders.sendTransactionAsync(
orderAddresses,
orderValues,
fillTakerTokenAmounts,
vParams,
rParams,
sParams,
{
from: takerAddress,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Cancel a given fill amount of an order. Cancellations are cumulative.
* @param order An object that conforms to the Order or SignedOrder interface.
* The order you would like to cancel.
* @param cancelTakerTokenAmount The amount (specified in taker tokens) that you would like to cancel.
* @param transactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async cancelOrderAsync(
order: Order | SignedOrder,
cancelTakerTokenAmount: BigNumber,
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema('order', order, schemas.orderSchema);
assert.isValidBaseUnitAmount('takerTokenCancelAmount', cancelTakerTokenAmount);
await assert.isSenderAddressAsync('order.maker', order.maker, this._web3Wrapper);
const exchangeInstance = await this._getExchangeContractAsync();
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
const orderHash = utils.getOrderHashHex(order);
const unavailableTakerTokenAmount = await this.getUnavailableTakerAmountAsync(orderHash);
OrderValidationUtils.validateCancelOrderThrowIfInvalid(
order,
cancelTakerTokenAmount,
unavailableTakerTokenAmount,
);
}
const [orderAddresses, orderValues] = ExchangeWrapper._getOrderAddressesAndValues(order);
const txHash = await exchangeInstance.cancelOrder.sendTransactionAsync(
orderAddresses,
orderValues,
cancelTakerTokenAmount,
{
from: order.maker,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Batch version of cancelOrderAsync. Atomically cancels multiple orders in a single transaction.
* All orders must be from the same maker.
* @param orderCancellationRequests An array of objects that conform to the OrderCancellationRequest
* interface.
* @param transactionOpts Optional arguments this method accepts.
* @return Transaction hash.
*/
@decorators.asyncZeroExErrorHandler
public async batchCancelOrdersAsync(
orderCancellationRequests: OrderCancellationRequest[],
orderTransactionOpts: OrderTransactionOpts = {},
): Promise<string> {
assert.doesConformToSchema(
'orderCancellationRequests',
orderCancellationRequests,
schemas.orderCancellationRequestsSchema,
);
const exchangeContractAddresses = _.map(
orderCancellationRequests,
orderCancellationRequest => orderCancellationRequest.order.exchangeContractAddress,
);
assert.hasAtMostOneUniqueValue(
exchangeContractAddresses,
ExchangeContractErrs.BatchOrdersMustHaveSameExchangeAddress,
);
const makers = _.map(orderCancellationRequests, cancellationRequest => cancellationRequest.order.maker);
assert.hasAtMostOneUniqueValue(makers, ExchangeContractErrs.MultipleMakersInSingleCancelBatchDisallowed);
const maker = makers[0];
await assert.isSenderAddressAsync('maker', maker, this._web3Wrapper);
const shouldValidate = _.isUndefined(orderTransactionOpts.shouldValidate)
? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate;
if (shouldValidate) {
for (const orderCancellationRequest of orderCancellationRequests) {
const orderHash = utils.getOrderHashHex(orderCancellationRequest.order);
const unavailableTakerTokenAmount = await this.getUnavailableTakerAmountAsync(orderHash);
OrderValidationUtils.validateCancelOrderThrowIfInvalid(
orderCancellationRequest.order,
orderCancellationRequest.takerTokenCancelAmount,
unavailableTakerTokenAmount,
);
}
}
if (_.isEmpty(orderCancellationRequests)) {
throw new Error(ExchangeContractErrs.BatchOrdersMustHaveAtLeastOneItem);
}
const exchangeInstance = await this._getExchangeContractAsync();
const orderAddressesValuesAndTakerTokenCancelAmounts = _.map(orderCancellationRequests, cancellationRequest => {
return [
...ExchangeWrapper._getOrderAddressesAndValues(cancellationRequest.order),
cancellationRequest.takerTokenCancelAmount,
];
});
// We use _.unzip<any> because _.unzip doesn't type check if values have different types :'(
const [orderAddresses, orderValues, cancelTakerTokenAmounts] = _.unzip<any>(
orderAddressesValuesAndTakerTokenCancelAmounts,
);
const txHash = await exchangeInstance.batchCancelOrders.sendTransactionAsync(
orderAddresses,
orderValues,
cancelTakerTokenAmounts,
{
from: maker,
gas: orderTransactionOpts.gasLimit,
gasPrice: orderTransactionOpts.gasPrice,
},
);
return txHash;
}
/**
* Subscribe to an event type emitted by the Exchange contract.
* @param eventName The exchange contract event you would like to subscribe to.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends ExchangeContractEventArgs>(
eventName: ExchangeEvents,
indexFilterValues: IndexedFilterValues,
callback: EventCallback<ArgsType>,
): string {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
assert.isFunction('callback', callback);
const exchangeContractAddress = this.getContractAddress();
const subscriptionToken = this._subscribe<ArgsType>(
exchangeContractAddress,
eventName,
indexFilterValues,
artifacts.ExchangeArtifact.abi,
callback,
);
return subscriptionToken;
}
/**
* Cancel a subscription
* @param subscriptionToken Subscription token returned by `subscribe()`
*/
public unsubscribe(subscriptionToken: string): void {
this._unsubscribe(subscriptionToken);
}
/**
* Cancels all existing subscriptions
*/
public unsubscribeAll(): void {
super.unsubscribeAll();
}
/**
* Gets historical logs without creating a subscription
* @param eventName The exchange contract event you would like to subscribe to.
* @param blockRange Block range to get logs from.
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_from: aUserAddressHex}`
* @return Array of logs that match the parameters
*/
public async getLogsAsync<ArgsType extends ExchangeContractEventArgs>(
eventName: ExchangeEvents,
blockRange: BlockRange,
indexFilterValues: IndexedFilterValues,
): Promise<Array<LogWithDecodedArgs<ArgsType>>> {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('blockRange', blockRange, schemas.blockRangeSchema);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
const exchangeContractAddress = this.getContractAddress();
const logs = await this._getLogsAsync<ArgsType>(
exchangeContractAddress,
eventName,
blockRange,
indexFilterValues,
artifacts.ExchangeArtifact.abi,
);
return logs;
}
/**
* Retrieves the Ethereum address of the Exchange contract deployed on the network
* that the user-passed web3 provider is connected to.
* @returns The Ethereum address of the Exchange contract being used.
*/
public getContractAddress(): string {
const contractAddress = this._getContractAddress(artifacts.ExchangeArtifact, this._contractAddressIfExists);
return contractAddress;
}
/**
* Checks if order is still fillable and throws an error otherwise. Useful for orderbook
* pruning where you want to remove stale orders without knowing who the taker will be.
* @param signedOrder An object that conforms to the SignedOrder interface. The
* signedOrder you wish to validate.
* @param opts An object that conforms to the ValidateOrderFillableOpts
* interface. Allows specifying a specific fillTakerTokenAmount
* to validate for.
*/
public async validateOrderFillableOrThrowAsync(
signedOrder: SignedOrder,
opts?: ValidateOrderFillableOpts,
): Promise<void> {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
const zrxTokenAddress = this.getZRXTokenAddress();
const expectedFillTakerTokenAmount = !_.isUndefined(opts) ? opts.expectedFillTakerTokenAmount : undefined;
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
await this._orderValidationUtils.validateOrderFillableOrThrowAsync(
exchangeTradeEmulator,
signedOrder,
zrxTokenAddress,
expectedFillTakerTokenAmount,
);
}
/**
* Checks if order fill will succeed and throws an error otherwise.
* @param signedOrder An object that conforms to the SignedOrder interface. The
* signedOrder you wish to fill.
* @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill.
* @param takerAddress The user Ethereum address who would like to fill this order.
* Must be available via the supplied Web3.Provider passed to 0x.js.
*/
public async validateFillOrderThrowIfInvalidAsync(
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
takerAddress: string,
): Promise<void> {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
assert.isValidBaseUnitAmount('fillTakerTokenAmount', fillTakerTokenAmount);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
fillTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
}
/**
* Checks if cancelling a given order will succeed and throws an informative error if it won't.
* @param order An object that conforms to the Order or SignedOrder interface.
* The order you would like to cancel.
* @param cancelTakerTokenAmount The amount (specified in taker tokens) that you would like to cancel.
*/
public async validateCancelOrderThrowIfInvalidAsync(
order: Order,
cancelTakerTokenAmount: BigNumber,
): Promise<void> {
assert.doesConformToSchema('order', order, schemas.orderSchema);
assert.isValidBaseUnitAmount('cancelTakerTokenAmount', cancelTakerTokenAmount);
const orderHash = utils.getOrderHashHex(order);
const unavailableTakerTokenAmount = await this.getUnavailableTakerAmountAsync(orderHash);
OrderValidationUtils.validateCancelOrderThrowIfInvalid(
order,
cancelTakerTokenAmount,
unavailableTakerTokenAmount,
);
}
/**
* Checks if calling fillOrKill on a given order will succeed and throws an informative error if it won't.
* @param signedOrder An object that conforms to the SignedOrder interface. The
* signedOrder you wish to fill.
* @param fillTakerTokenAmount The total amount of the takerTokens you would like to fill.
* @param takerAddress The user Ethereum address who would like to fill this order.
* Must be available via the supplied Web3.Provider passed to 0x.js.
*/
public async validateFillOrKillOrderThrowIfInvalidAsync(
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
takerAddress: string,
): Promise<void> {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
assert.isValidBaseUnitAmount('fillTakerTokenAmount', fillTakerTokenAmount);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
await this._orderValidationUtils.validateFillOrKillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
fillTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
}
/**
* Checks if rounding error will be > 0.1% when computing makerTokenAmount by doing:
* `(fillTakerTokenAmount * makerTokenAmount) / takerTokenAmount`.
* 0x Protocol does not accept any trades that result in large rounding errors. This means that tokens with few or
* no decimals can only be filled in quantities and ratios that avoid large rounding errors.
* @param fillTakerTokenAmount The amount of the order (in taker tokens baseUnits) that you wish to fill.
* @param takerTokenAmount The order size on the taker side
* @param makerTokenAmount The order size on the maker side
*/
public async isRoundingErrorAsync(
fillTakerTokenAmount: BigNumber,
takerTokenAmount: BigNumber,
makerTokenAmount: BigNumber,
): Promise<boolean> {
assert.isValidBaseUnitAmount('fillTakerTokenAmount', fillTakerTokenAmount);
assert.isValidBaseUnitAmount('takerTokenAmount', takerTokenAmount);
assert.isValidBaseUnitAmount('makerTokenAmount', makerTokenAmount);
const exchangeInstance = await this._getExchangeContractAsync();
const isRoundingError = await exchangeInstance.isRoundingError.callAsync(
fillTakerTokenAmount,
takerTokenAmount,
makerTokenAmount,
);
return isRoundingError;
}
/**
* Checks if logs contain LogError, which is emmited by Exchange contract on transaction failure.
* @param logs Transaction logs as returned by `zeroEx.awaitTransactionMinedAsync`
*/
public throwLogErrorsAsErrors(logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.LogEntry>): void {
const errLog = _.find(logs, {
event: ExchangeEvents.LogError,
}) as LogWithDecodedArgs<LogErrorContractEventArgs> | undefined;
if (!_.isUndefined(errLog)) {
const logArgs = errLog.args;
const errCode = logArgs.errorId.toNumber();
const errMessage = this._exchangeContractErrCodesToMsg[errCode];
throw new Error(errMessage);
}
}
/**
* Returns the ZRX token address used by the exchange contract.
* @return Address of ZRX token
*/
public getZRXTokenAddress(): string {
const contractAddress = this._getContractAddress(artifacts.ZRXArtifact, this._zrxContractAddressIfExists);
return contractAddress;
}
private _invalidateContractInstances(): void {
this.unsubscribeAll();
delete this._exchangeContractIfExists;
}
private async _isValidSignatureUsingContractCallAsync(
dataHex: string,
ecSignature: ECSignature,
signerAddressHex: string,
): Promise<boolean> {
assert.isHexString('dataHex', dataHex);
assert.doesConformToSchema('ecSignature', ecSignature, schemas.ecSignatureSchema);
assert.isETHAddressHex('signerAddressHex', signerAddressHex);
const exchangeInstance = await this._getExchangeContractAsync();
const isValidSignature = await exchangeInstance.isValidSignature.callAsync(
signerAddressHex,
dataHex,
ecSignature.v,
ecSignature.r,
ecSignature.s,
);
return isValidSignature;
}
private async _getOrderHashHexUsingContractCallAsync(order: Order | SignedOrder): Promise<string> {
const exchangeInstance = await this._getExchangeContractAsync();
const [orderAddresses, orderValues] = ExchangeWrapper._getOrderAddressesAndValues(order);
const orderHashHex = await exchangeInstance.getOrderHash.callAsync(orderAddresses, orderValues);
return orderHashHex;
}
private async _getExchangeContractAsync(): Promise<ExchangeContract> {
if (!_.isUndefined(this._exchangeContractIfExists)) {
return this._exchangeContractIfExists;
}
const web3ContractInstance = await this._instantiateContractIfExistsAsync(
artifacts.ExchangeArtifact,
this._contractAddressIfExists,
);
const contractInstance = new ExchangeContract(web3ContractInstance, this._web3Wrapper.getContractDefaults());
this._exchangeContractIfExists = contractInstance;
return this._exchangeContractIfExists;
}
private async _getTokenTransferProxyAddressAsync(): Promise<string> {
const exchangeInstance = await this._getExchangeContractAsync();
const tokenTransferProxyAddress = await exchangeInstance.TOKEN_TRANSFER_PROXY_CONTRACT.callAsync();
const tokenTransferProxyAddressLowerCase = tokenTransferProxyAddress.toLowerCase();
return tokenTransferProxyAddressLowerCase;
}
} // tslint:disable:max-file-line-count

View File

@@ -1,6 +0,0 @@
dummy_token.ts
ether_token.ts
exchange.ts
token_registry.ts
token_transfer_proxy.ts
token.ts

View File

@@ -1,33 +0,0 @@
import {TxData, TxDataPayable} from '@0xproject/types';
import * as _ from 'lodash';
import * as Web3 from 'web3';
export class BaseContract {
protected web3ContractInstance: Web3.ContractInstance;
protected defaults: Partial<TxData>;
protected async applyDefaultsToTxDataAsync<T extends TxData|TxDataPayable>(
txData: T,
estimateGasAsync?: (txData: T) => Promise<number>,
): Promise<TxData> {
// Gas amount sourced with the following priorities:
// 1. Optional param passed in to public method call
// 2. Global config passed in at library instantiation
// 3. Gas estimate calculation + safety margin
const removeUndefinedProperties = _.pickBy;
const txDataWithDefaults = {
...removeUndefinedProperties(this.defaults),
...removeUndefinedProperties(txData as any),
// HACK: TS can't prove that T is spreadable.
// Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged
};
if (_.isUndefined(txDataWithDefaults.gas) && !_.isUndefined(estimateGasAsync)) {
const estimatedGas = await estimateGasAsync(txData);
txDataWithDefaults.gas = estimatedGas;
}
return txDataWithDefaults;
}
constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) {
this.web3ContractInstance = web3ContractInstance;
this.defaults = defaults;
}
}

View File

@@ -1,129 +0,0 @@
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import { artifacts } from '../artifacts';
import { Token, TokenMetadata } from '../types';
import { assert } from '../utils/assert';
import { constants } from '../utils/constants';
import { ContractWrapper } from './contract_wrapper';
import { TokenRegistryContract } from './generated/token_registry';
/**
* This class includes all the functionality related to interacting with the 0x Token Registry smart contract.
*/
export class TokenRegistryWrapper extends ContractWrapper {
private _tokenRegistryContractIfExists?: TokenRegistryContract;
private _contractAddressIfExists?: string;
private static _createTokenFromMetadata(metadata: TokenMetadata): Token | undefined {
if (metadata[0] === constants.NULL_ADDRESS) {
return undefined;
}
const token = {
address: metadata[0],
name: metadata[1],
symbol: metadata[2],
decimals: metadata[3].toNumber(),
};
return token;
}
constructor(web3Wrapper: Web3Wrapper, networkId: number, contractAddressIfExists?: string) {
super(web3Wrapper, networkId);
this._contractAddressIfExists = contractAddressIfExists;
}
/**
* Retrieves all the tokens currently listed in the Token Registry smart contract
* @return An array of objects that conform to the Token interface.
*/
public async getTokensAsync(): Promise<Token[]> {
const addresses = await this.getTokenAddressesAsync();
const tokenPromises: Array<Promise<Token | undefined>> = _.map(addresses, async (address: string) =>
this.getTokenIfExistsAsync(address),
);
const tokens = await Promise.all(tokenPromises);
return tokens as Token[];
}
/**
* Retrieves all the addresses of the tokens currently listed in the Token Registry smart contract
* @return An array of token addresses.
*/
public async getTokenAddressesAsync(): Promise<string[]> {
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const addresses = await tokenRegistryContract.getTokenAddresses.callAsync();
return addresses;
}
/**
* Retrieves a token by address currently listed in the Token Registry smart contract
* @return An object that conforms to the Token interface or undefined if token not found.
*/
public async getTokenIfExistsAsync(address: string): Promise<Token | undefined> {
assert.isETHAddressHex('address', address);
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const metadata = await tokenRegistryContract.getTokenMetaData.callAsync(address);
const token = TokenRegistryWrapper._createTokenFromMetadata(metadata);
return token;
}
public async getTokenAddressBySymbolIfExistsAsync(symbol: string): Promise<string | undefined> {
assert.isString('symbol', symbol);
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const addressIfExists = await tokenRegistryContract.getTokenAddressBySymbol.callAsync(symbol);
if (addressIfExists === constants.NULL_ADDRESS) {
return undefined;
}
return addressIfExists;
}
public async getTokenAddressByNameIfExistsAsync(name: string): Promise<string | undefined> {
assert.isString('name', name);
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const addressIfExists = await tokenRegistryContract.getTokenAddressByName.callAsync(name);
if (addressIfExists === constants.NULL_ADDRESS) {
return undefined;
}
return addressIfExists;
}
public async getTokenBySymbolIfExistsAsync(symbol: string): Promise<Token | undefined> {
assert.isString('symbol', symbol);
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const metadata = await tokenRegistryContract.getTokenBySymbol.callAsync(symbol);
const token = TokenRegistryWrapper._createTokenFromMetadata(metadata);
return token;
}
public async getTokenByNameIfExistsAsync(name: string): Promise<Token | undefined> {
assert.isString('name', name);
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const metadata = await tokenRegistryContract.getTokenByName.callAsync(name);
const token = TokenRegistryWrapper._createTokenFromMetadata(metadata);
return token;
}
/**
* Retrieves the Ethereum address of the TokenRegistry contract deployed on the network
* that the user-passed web3 provider is connected to.
* @returns The Ethereum address of the TokenRegistry contract being used.
*/
public getContractAddress(): string {
const contractAddress = this._getContractAddress(
artifacts.TokenRegistryArtifact,
this._contractAddressIfExists,
);
return contractAddress;
}
private _invalidateContractInstance(): void {
delete this._tokenRegistryContractIfExists;
}
private async _getTokenRegistryContractAsync(): Promise<TokenRegistryContract> {
if (!_.isUndefined(this._tokenRegistryContractIfExists)) {
return this._tokenRegistryContractIfExists;
}
const web3ContractInstance = await this._instantiateContractIfExistsAsync(
artifacts.TokenRegistryArtifact,
this._contractAddressIfExists,
);
const contractInstance = new TokenRegistryContract(
web3ContractInstance,
this._web3Wrapper.getContractDefaults(),
);
this._tokenRegistryContractIfExists = contractInstance;
return this._tokenRegistryContractIfExists;
}
}

View File

@@ -1,68 +0,0 @@
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import { artifacts } from '../artifacts';
import { ContractWrapper } from './contract_wrapper';
import { TokenTransferProxyContract } from './generated/token_transfer_proxy';
/**
* This class includes the functionality related to interacting with the TokenTransferProxy contract.
*/
export class TokenTransferProxyWrapper extends ContractWrapper {
private _tokenTransferProxyContractIfExists?: TokenTransferProxyContract;
private _contractAddressIfExists?: string;
constructor(web3Wrapper: Web3Wrapper, networkId: number, contractAddressIfExists?: string) {
super(web3Wrapper, networkId);
this._contractAddressIfExists = contractAddressIfExists;
}
/**
* Check if the Exchange contract address is authorized by the TokenTransferProxy contract.
* @param exchangeContractAddress The hex encoded address of the Exchange contract to call.
* @return Whether the exchangeContractAddress is authorized.
*/
public async isAuthorizedAsync(exchangeContractAddress: string): Promise<boolean> {
const tokenTransferProxyContractInstance = await this._getTokenTransferProxyContractAsync();
const isAuthorized = await tokenTransferProxyContractInstance.authorized.callAsync(exchangeContractAddress);
return isAuthorized;
}
/**
* Get the list of all Exchange contract addresses authorized by the TokenTransferProxy contract.
* @return The list of authorized addresses.
*/
public async getAuthorizedAddressesAsync(): Promise<string[]> {
const tokenTransferProxyContractInstance = await this._getTokenTransferProxyContractAsync();
const authorizedAddresses = await tokenTransferProxyContractInstance.getAuthorizedAddresses.callAsync();
return authorizedAddresses;
}
/**
* Retrieves the Ethereum address of the TokenTransferProxy contract deployed on the network
* that the user-passed web3 provider is connected to.
* @returns The Ethereum address of the TokenTransferProxy contract being used.
*/
public getContractAddress(): string {
const contractAddress = this._getContractAddress(
artifacts.TokenTransferProxyArtifact,
this._contractAddressIfExists,
);
return contractAddress;
}
private _invalidateContractInstance(): void {
delete this._tokenTransferProxyContractIfExists;
}
private async _getTokenTransferProxyContractAsync(): Promise<TokenTransferProxyContract> {
if (!_.isUndefined(this._tokenTransferProxyContractIfExists)) {
return this._tokenTransferProxyContractIfExists;
}
const web3ContractInstance = await this._instantiateContractIfExistsAsync(
artifacts.TokenTransferProxyArtifact,
this._contractAddressIfExists,
);
const contractInstance = new TokenTransferProxyContract(
web3ContractInstance,
this._web3Wrapper.getContractDefaults(),
);
this._tokenTransferProxyContractIfExists = contractInstance;
return this._tokenTransferProxyContractIfExists;
}
}

View File

@@ -1,59 +1,6 @@
declare module 'web3_beta';
declare module 'chai-bignumber';
declare module 'dirty-chai';
declare module 'request-promise-native';
declare module 'web3-provider-engine';
declare module 'web3-provider-engine/subproviders/rpc';
// HACK: In order to merge the bignumber declaration added by chai-bignumber to the chai Assertion
// interface we must use `namespace` as the Chai definitelyTyped definition does. Since we otherwise
// disallow `namespace`, we disable tslint for the following.
/* tslint:disable */
declare namespace Chai {
interface Assertion {
bignumber: Assertion;
// HACK: In order to comply with chai-as-promised we make eventually a `PromisedAssertion` not an `Assertion`
eventually: PromisedAssertion;
}
}
/* tslint:enable */
declare module '*.json' {
const json: any;
/* tslint:disable */
export default json;
/* tslint:enable */
}
declare module 'ethereumjs-abi' {
const soliditySHA3: (argTypes: string[], args: any[]) => Buffer;
}
// truffle-hdwallet-provider declarations
declare module 'truffle-hdwallet-provider' {
import * as Web3 from 'web3';
class HDWalletProvider implements Web3.Provider {
constructor(mnemonic: string, rpcUrl: string);
public sendAsync(
payload: Web3.JSONRPCRequestPayload,
callback: (err: Error, result: Web3.JSONRPCResponsePayload) => void,
): void;
}
export = HDWalletProvider;
}
// abi-decoder declarations
interface DecodedLogArg {}
interface DecodedLog {
name: string;
events: DecodedLogArg[];
}
declare module 'abi-decoder' {
import * as Web3 from 'web3';
const addABI: (abi: Web3.AbiDefinition) => void;
const decodeLogs: (logs: Web3.LogEntry[]) => DecodedLog[];
}
declare module 'web3/lib/solidity/coder' {
const decodeParams: (types: string[], data: string) => any[];
}

View File

@@ -1,23 +0,0 @@
import { BigNumber } from '@0xproject/utils';
// HACK: This module overrides the Chai namespace so that we can use BigNumber types inside.
// Source: https://github.com/Microsoft/TypeScript/issues/7352#issuecomment-191547232
declare global {
// HACK: In order to merge the bignumber declaration added by chai-bignumber to the chai Assertion
// interface we must use `namespace` as the Chai definitelyTyped definition does. Since we otherwise
// disallow `namespace`, we disable tslint for the following.
/* tslint:disable */
namespace Chai {
interface NumberComparer {
(value: number | BigNumber, message?: string): Assertion;
}
interface NumericComparison {
greaterThan: NumberComparer;
}
}
/* tslint:enable */
interface DecodedLogArg {
name: string;
value: string | BigNumber;
}
}

View File

@@ -1,50 +1,62 @@
export { ZeroEx } from './0x';
export { MessagePrefixType, MessagePrefixOpts } from '@0xproject/order-utils';
export { Web3ProviderEngine, RPCSubprovider } from '@0xproject/subproviders';
export {
ExchangeContractErrs,
Order,
BlockParamLiteral,
SignedOrder,
ECSignature,
ZeroExError,
EventCallback,
ExchangeContractErrs,
ContractEvent,
Token,
ExchangeEvents,
TokenEvents,
IndexedFilterValues,
BlockRange,
BlockParam,
OrderCancellationRequest,
OrderFillRequest,
LogErrorContractEventArgs,
LogCancelContractEventArgs,
LogFillContractEventArgs,
ExchangeContractEventArgs,
TransferContractEventArgs,
ApprovalContractEventArgs,
TokenContractEventArgs,
EtherTokenContractEventArgs,
WithdrawalContractEventArgs,
DepositContractEventArgs,
ContractEventArgs,
ContractEventArg,
Web3Provider,
ZeroExConfig,
EtherTokenEvents,
TransactionReceiptWithDecodedLogs,
LogWithDecodedArgs,
MethodOpts,
OrderTransactionOpts,
TransactionOpts,
FilterObject,
LogEvent,
DecodedLogEvent,
EventWatcherCallback,
OnOrderStateChangeCallback,
OrderStateValid,
OrderStateInvalid,
OrderState,
} from './types';
Token,
} from '@0xproject/types';
export { TransactionReceipt } from '@0xproject/types';
export {
BlockParamLiteral,
FilterObject,
BlockParam,
LogWithDecodedArgs,
ContractEventArg,
Provider,
TransactionReceipt,
TransactionReceiptWithDecodedLogs,
} from 'ethereum-types';
export {
EventCallback,
ContractEvent,
IndexedFilterValues,
BlockRange,
OrderFillRequest,
ContractEventArgs,
MethodOpts,
OrderTransactionOpts,
TransactionOpts,
LogEvent,
DecodedLogEvent,
OnOrderStateChangeCallback,
ContractWrappersError,
WETH9Events,
WETH9WithdrawalEventArgs,
WETH9ApprovalEventArgs,
WETH9EventArgs,
WETH9DepositEventArgs,
WETH9TransferEventArgs,
ERC20TokenTransferEventArgs,
ERC20TokenApprovalEventArgs,
ERC20TokenEvents,
ERC20TokenEventArgs,
ERC721TokenApprovalEventArgs,
ERC721TokenApprovalForAllEventArgs,
ERC721TokenTransferEventArgs,
ERC721TokenEvents,
ExchangeCancelUpToEventArgs,
ExchangeAssetProxyRegisteredEventArgs,
ExchangeFillEventArgs,
ExchangeCancelEventArgs,
ExchangeEventArgs,
ContractWrappersConfig,
} from '@0xproject/contract-wrappers';

View File

@@ -0,0 +1,8 @@
import { postpublishUtils } from '@0xproject/monorepo-scripts';
import * as packageJSON from '../package.json';
import * as tsConfigJSON from '../tsconfig.json';
const cwd = `${__dirname}/..`;
// tslint:disable-next-line:no-floating-promises
postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd);

View File

@@ -0,0 +1,8 @@
import { postpublishUtils } from '@0xproject/monorepo-scripts';
import * as packageJSON from '../package.json';
import * as tsConfigJSON from '../tsconfig.json';
const cwd = `${__dirname}/..`;
// tslint:disable-next-line:no-floating-promises
postpublishUtils.publishDocsToStagingAsync(packageJSON, tsConfigJSON, cwd);

View File

@@ -1,93 +0,0 @@
import { intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import * as Web3 from 'web3';
import { BlockParamLiteral, EventWatcherCallback, ZeroExError } from '../types';
import { assert } from '../utils/assert';
const DEFAULT_EVENT_POLLING_INTERVAL_MS = 200;
enum LogEventState {
Removed,
Added,
}
/*
* The EventWatcher watches for blockchain events at the specified block confirmation
* depth.
*/
export class EventWatcher {
private _web3Wrapper: Web3Wrapper;
private _pollingIntervalMs: number;
private _intervalIdIfExists?: NodeJS.Timer;
private _lastEvents: Web3.LogEntry[] = [];
constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number) {
this._web3Wrapper = web3Wrapper;
this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs)
? DEFAULT_EVENT_POLLING_INTERVAL_MS
: pollingIntervalIfExistsMs;
}
public subscribe(callback: EventWatcherCallback): void {
assert.isFunction('callback', callback);
if (!_.isUndefined(this._intervalIdIfExists)) {
throw new Error(ZeroExError.SubscriptionAlreadyPresent);
}
this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
this._pollForBlockchainEventsAsync.bind(this, callback),
this._pollingIntervalMs,
(err: Error) => {
this.unsubscribe();
callback(err);
},
);
}
public unsubscribe(): void {
this._lastEvents = [];
if (!_.isUndefined(this._intervalIdIfExists)) {
intervalUtils.clearAsyncExcludingInterval(this._intervalIdIfExists);
delete this._intervalIdIfExists;
}
}
private async _pollForBlockchainEventsAsync(callback: EventWatcherCallback): Promise<void> {
const pendingEvents = await this._getEventsAsync();
if (_.isUndefined(pendingEvents)) {
// HACK: This should never happen, but happens frequently on CI due to a ganache bug
return;
}
if (pendingEvents.length === 0) {
// HACK: Sometimes when node rebuilds the pending block we get back the empty result.
// We don't want to emit a lot of removal events and bring them back after a couple of miliseconds,
// that's why we just ignore those cases.
return;
}
const removedEvents = _.differenceBy(this._lastEvents, pendingEvents, JSON.stringify);
const newEvents = _.differenceBy(pendingEvents, this._lastEvents, JSON.stringify);
await this._emitDifferencesAsync(removedEvents, LogEventState.Removed, callback);
await this._emitDifferencesAsync(newEvents, LogEventState.Added, callback);
this._lastEvents = pendingEvents;
}
private async _getEventsAsync(): Promise<Web3.LogEntry[]> {
const eventFilter = {
fromBlock: BlockParamLiteral.Pending,
toBlock: BlockParamLiteral.Pending,
};
const events = await this._web3Wrapper.getLogsAsync(eventFilter);
return events;
}
private async _emitDifferencesAsync(
logs: Web3.LogEntry[],
logEventState: LogEventState,
callback: EventWatcherCallback,
): Promise<void> {
for (const log of logs) {
const logEvent = {
removed: logEventState === LogEventState.Removed,
...log,
};
if (!_.isUndefined(this._intervalIdIfExists)) {
callback(null, logEvent);
}
}
}
}

View File

@@ -1,96 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import { SignedOrder } from '../types';
export class RemainingFillableCalculator {
private _signedOrder: SignedOrder;
private _isMakerTokenZRX: boolean;
// Transferrable Amount is the minimum of Approval and Balance
private _transferrableMakerTokenAmount: BigNumber;
private _transferrableMakerFeeTokenAmount: BigNumber;
private _remainingMakerTokenAmount: BigNumber;
private _remainingMakerFeeAmount: BigNumber;
constructor(
signedOrder: SignedOrder,
isMakerTokenZRX: boolean,
transferrableMakerTokenAmount: BigNumber,
transferrableMakerFeeTokenAmount: BigNumber,
remainingMakerTokenAmount: BigNumber,
) {
this._signedOrder = signedOrder;
this._isMakerTokenZRX = isMakerTokenZRX;
this._transferrableMakerTokenAmount = transferrableMakerTokenAmount;
this._transferrableMakerFeeTokenAmount = transferrableMakerFeeTokenAmount;
this._remainingMakerTokenAmount = remainingMakerTokenAmount;
this._remainingMakerFeeAmount = remainingMakerTokenAmount
.times(signedOrder.makerFee)
.dividedToIntegerBy(signedOrder.makerTokenAmount);
}
public computeRemainingMakerFillable(): BigNumber {
if (this._hasSufficientFundsForFeeAndTransferAmount()) {
return this._remainingMakerTokenAmount;
}
if (this._signedOrder.makerFee.isZero()) {
return BigNumber.min(this._remainingMakerTokenAmount, this._transferrableMakerTokenAmount);
}
return this._calculatePartiallyFillableMakerTokenAmount();
}
public computeRemainingTakerFillable(): BigNumber {
return this.computeRemainingMakerFillable()
.times(this._signedOrder.takerTokenAmount)
.dividedToIntegerBy(this._signedOrder.makerTokenAmount);
}
private _hasSufficientFundsForFeeAndTransferAmount(): boolean {
if (this._isMakerTokenZRX) {
const totalZRXTransferAmountRequired = this._remainingMakerTokenAmount.plus(this._remainingMakerFeeAmount);
const hasSufficientFunds = this._transferrableMakerTokenAmount.greaterThanOrEqualTo(
totalZRXTransferAmountRequired,
);
return hasSufficientFunds;
} else {
const hasSufficientFundsForTransferAmount = this._transferrableMakerTokenAmount.greaterThanOrEqualTo(
this._remainingMakerTokenAmount,
);
const hasSufficientFundsForFeeAmount = this._transferrableMakerFeeTokenAmount.greaterThanOrEqualTo(
this._remainingMakerFeeAmount,
);
const hasSufficientFunds = hasSufficientFundsForTransferAmount && hasSufficientFundsForFeeAmount;
return hasSufficientFunds;
}
}
private _calculatePartiallyFillableMakerTokenAmount(): BigNumber {
// Given an order for 200 wei for 2 ZRXwei fee, find 100 wei for 1 ZRXwei. Order ratio is then 100:1
const orderToFeeRatio = this._signedOrder.makerTokenAmount.dividedBy(this._signedOrder.makerFee);
// The number of times the maker can fill the order, if each fill only required the transfer of a single
// baseUnit of fee tokens.
// Given 2 ZRXwei, the maximum amount of times Maker can fill this order, in terms of fees, is 2
const fillableTimesInFeeTokenBaseUnits = BigNumber.min(
this._transferrableMakerFeeTokenAmount,
this._remainingMakerFeeAmount,
);
// The number of times the Maker can fill the order, given the Maker Token Balance
// Assuming a balance of 150 wei, and an orderToFeeRatio of 100:1, maker can fill this order 1 time.
let fillableTimesInMakerTokenUnits = this._transferrableMakerTokenAmount.dividedBy(orderToFeeRatio);
if (this._isMakerTokenZRX) {
// If ZRX is the maker token, the Fee and the Maker amount need to be removed from the same pool;
// 200 ZRXwei for 2ZRXwei fee can only be filled once (need 202 ZRXwei)
const totalZRXTokenPooled = this._transferrableMakerTokenAmount;
// The purchasing power here is less as the tokens are taken from the same Pool
// For every one number of fills, we have to take an extra ZRX out of the pool
fillableTimesInMakerTokenUnits = totalZRXTokenPooled.dividedBy(orderToFeeRatio.plus(new BigNumber(1)));
}
// When Ratio is not fully divisible there can be remainders which cannot be represented, so they are floored.
// This can result in a RoundingError being thrown by the Exchange Contract.
const partiallyFillableMakerTokenAmount = fillableTimesInMakerTokenUnits
.times(this._signedOrder.makerTokenAmount)
.dividedToIntegerBy(this._signedOrder.makerFee);
const partiallyFillableFeeTokenAmount = fillableTimesInFeeTokenBaseUnits
.times(this._signedOrder.makerTokenAmount)
.dividedToIntegerBy(this._signedOrder.makerFee);
const partiallyFillableAmount = BigNumber.min(
partiallyFillableMakerTokenAmount,
partiallyFillableFeeTokenAmount,
);
return partiallyFillableAmount;
}
}

View File

@@ -1,27 +1,5 @@
export const zeroExConfigSchema = {
id: '/ZeroExConfig',
properties: {
networkId: {
type: 'number',
minimum: 0,
},
gasPrice: { $ref: '/Number' },
exchangeContractAddress: { $ref: '/Address' },
tokenRegistryContractAddress: { $ref: '/Address' },
orderWatcherConfig: {
type: 'object',
properties: {
pollingIntervalMs: {
type: 'number',
minimum: 0,
},
numConfirmations: {
type: 'number',
minimum: 0,
},
},
},
},
oneOf: [{ $ref: '/ZeroExPrivateNetworkConfig' }, { $ref: '/ZeroExPublicNetworkConfig' }],
type: 'object',
required: ['networkId'],
};

View File

@@ -0,0 +1,35 @@
export const zeroExPrivateNetworkConfigSchema = {
id: '/ZeroExPrivateNetworkConfig',
properties: {
networkId: {
type: 'number',
minimum: 1,
},
gasPrice: { $ref: '/Number' },
zrxContractAddress: { $ref: '/Address' },
exchangeContractAddress: { $ref: '/Address' },
erc20ProxyContractAddress: { $ref: '/Address' },
erc721ProxyContractAddress: { $ref: '/Address' },
orderWatcherConfig: {
type: 'object',
properties: {
pollingIntervalMs: {
type: 'number',
minimum: 0,
},
numConfirmations: {
type: 'number',
minimum: 0,
},
},
},
},
type: 'object',
required: [
'networkId',
'zrxContractAddress',
'exchangeContractAddress',
'erc20ProxyContractAddress',
'erc721ProxyContractAddress',
],
};

View File

@@ -0,0 +1,43 @@
const networkNameToId: { [networkName: string]: number } = {
mainnet: 1,
ropsten: 3,
rinkeby: 4,
kovan: 42,
ganache: 50,
};
export const zeroExPublicNetworkConfigSchema = {
id: '/ZeroExPublicNetworkConfig',
properties: {
networkId: {
type: 'number',
enum: [
networkNameToId.mainnet,
networkNameToId.ropsten,
networkNameToId.rinkeby,
networkNameToId.kovan,
networkNameToId.ganache,
],
},
gasPrice: { $ref: '/Number' },
zrxContractAddress: { $ref: '/Address' },
exchangeContractAddress: { $ref: '/Address' },
erc20ProxyContractAddress: { $ref: '/Address' },
erc721ProxyContractAddress: { $ref: '/Address' },
orderWatcherConfig: {
type: 'object',
properties: {
pollingIntervalMs: {
type: 'number',
minimum: 0,
},
numConfirmations: {
type: 'number',
minimum: 0,
},
},
},
},
type: 'object',
required: ['networkId'],
};

View File

@@ -1,86 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
import { BlockParamLiteral } from '../types';
/**
* Copy on read store for balances/proxyAllowances of tokens/accounts
*/
export class BalanceAndProxyAllowanceLazyStore {
private _token: TokenWrapper;
private _defaultBlock: BlockParamLiteral;
private _balance: {
[tokenAddress: string]: {
[userAddress: string]: BigNumber;
};
};
private _proxyAllowance: {
[tokenAddress: string]: {
[userAddress: string]: BigNumber;
};
};
constructor(token: TokenWrapper, defaultBlock: BlockParamLiteral) {
this._token = token;
this._defaultBlock = defaultBlock;
this._balance = {};
this._proxyAllowance = {};
}
public async getBalanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber> {
if (_.isUndefined(this._balance[tokenAddress]) || _.isUndefined(this._balance[tokenAddress][userAddress])) {
const methodOpts = {
defaultBlock: this._defaultBlock,
};
const balance = await this._token.getBalanceAsync(tokenAddress, userAddress, methodOpts);
this.setBalance(tokenAddress, userAddress, balance);
}
const cachedBalance = this._balance[tokenAddress][userAddress];
return cachedBalance;
}
public setBalance(tokenAddress: string, userAddress: string, balance: BigNumber): void {
if (_.isUndefined(this._balance[tokenAddress])) {
this._balance[tokenAddress] = {};
}
this._balance[tokenAddress][userAddress] = balance;
}
public deleteBalance(tokenAddress: string, userAddress: string): void {
if (!_.isUndefined(this._balance[tokenAddress])) {
delete this._balance[tokenAddress][userAddress];
if (_.isEmpty(this._balance[tokenAddress])) {
delete this._balance[tokenAddress];
}
}
}
public async getProxyAllowanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber> {
if (
_.isUndefined(this._proxyAllowance[tokenAddress]) ||
_.isUndefined(this._proxyAllowance[tokenAddress][userAddress])
) {
const methodOpts = {
defaultBlock: this._defaultBlock,
};
const proxyAllowance = await this._token.getProxyAllowanceAsync(tokenAddress, userAddress, methodOpts);
this.setProxyAllowance(tokenAddress, userAddress, proxyAllowance);
}
const cachedProxyAllowance = this._proxyAllowance[tokenAddress][userAddress];
return cachedProxyAllowance;
}
public setProxyAllowance(tokenAddress: string, userAddress: string, proxyAllowance: BigNumber): void {
if (_.isUndefined(this._proxyAllowance[tokenAddress])) {
this._proxyAllowance[tokenAddress] = {};
}
this._proxyAllowance[tokenAddress][userAddress] = proxyAllowance;
}
public deleteProxyAllowance(tokenAddress: string, userAddress: string): void {
if (!_.isUndefined(this._proxyAllowance[tokenAddress])) {
delete this._proxyAllowance[tokenAddress][userAddress];
if (_.isEmpty(this._proxyAllowance[tokenAddress])) {
delete this._proxyAllowance[tokenAddress];
}
}
}
public deleteAll(): void {
this._balance = {};
this._proxyAllowance = {};
}
}

View File

@@ -1,61 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
import { BlockParamLiteral } from '../types';
/**
* Copy on read store for filled/cancelled taker amounts
*/
export class OrderFilledCancelledLazyStore {
private _exchange: ExchangeWrapper;
private _filledTakerAmount: {
[orderHash: string]: BigNumber;
};
private _cancelledTakerAmount: {
[orderHash: string]: BigNumber;
};
constructor(exchange: ExchangeWrapper) {
this._exchange = exchange;
this._filledTakerAmount = {};
this._cancelledTakerAmount = {};
}
public async getFilledTakerAmountAsync(orderHash: string): Promise<BigNumber> {
if (_.isUndefined(this._filledTakerAmount[orderHash])) {
const methodOpts = {
defaultBlock: BlockParamLiteral.Pending,
};
const filledTakerAmount = await this._exchange.getFilledTakerAmountAsync(orderHash, methodOpts);
this.setFilledTakerAmount(orderHash, filledTakerAmount);
}
const cachedFilled = this._filledTakerAmount[orderHash];
return cachedFilled;
}
public setFilledTakerAmount(orderHash: string, filledTakerAmount: BigNumber): void {
this._filledTakerAmount[orderHash] = filledTakerAmount;
}
public deleteFilledTakerAmount(orderHash: string): void {
delete this._filledTakerAmount[orderHash];
}
public async getCancelledTakerAmountAsync(orderHash: string): Promise<BigNumber> {
if (_.isUndefined(this._cancelledTakerAmount[orderHash])) {
const methodOpts = {
defaultBlock: BlockParamLiteral.Pending,
};
const cancelledTakerAmount = await this._exchange.getCancelledTakerAmountAsync(orderHash, methodOpts);
this.setCancelledTakerAmount(orderHash, cancelledTakerAmount);
}
const cachedCancelled = this._cancelledTakerAmount[orderHash];
return cachedCancelled;
}
public setCancelledTakerAmount(orderHash: string, cancelledTakerAmount: BigNumber): void {
this._cancelledTakerAmount[orderHash] = cancelledTakerAmount;
}
public deleteCancelledTakerAmount(orderHash: string): void {
delete this._cancelledTakerAmount[orderHash];
}
public deleteAll(): void {
this._filledTakerAmount = {};
this._cancelledTakerAmount = {};
}
}

View File

@@ -1,412 +1,7 @@
import { TransactionReceipt } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as Web3 from 'web3';
export enum ZeroExError {
ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST',
ZRXContractDoesNotExist = 'ZRX_CONTRACT_DOES_NOT_EXIST',
EtherTokenContractDoesNotExist = 'ETHER_TOKEN_CONTRACT_DOES_NOT_EXIST',
TokenTransferProxyContractDoesNotExist = 'TOKEN_TRANSFER_PROXY_CONTRACT_DOES_NOT_EXIST',
TokenRegistryContractDoesNotExist = 'TOKEN_REGISTRY_CONTRACT_DOES_NOT_EXIST',
TokenContractDoesNotExist = 'TOKEN_CONTRACT_DOES_NOT_EXIST',
UnhandledError = 'UNHANDLED_ERROR',
UserHasNoAssociatedAddress = 'USER_HAS_NO_ASSOCIATED_ADDRESSES',
InvalidSignature = 'INVALID_SIGNATURE',
ContractNotDeployedOnNetwork = 'CONTRACT_NOT_DEPLOYED_ON_NETWORK',
InsufficientAllowanceForTransfer = 'INSUFFICIENT_ALLOWANCE_FOR_TRANSFER',
InsufficientBalanceForTransfer = 'INSUFFICIENT_BALANCE_FOR_TRANSFER',
InsufficientEthBalanceForDeposit = 'INSUFFICIENT_ETH_BALANCE_FOR_DEPOSIT',
InsufficientWEthBalanceForWithdrawal = 'INSUFFICIENT_WETH_BALANCE_FOR_WITHDRAWAL',
InvalidJump = 'INVALID_JUMP',
OutOfGas = 'OUT_OF_GAS',
NoNetworkId = 'NO_NETWORK_ID',
SubscriptionNotFound = 'SUBSCRIPTION_NOT_FOUND',
SubscriptionAlreadyPresent = 'SUBSCRIPTION_ALREADY_PRESENT',
TransactionMiningTimeout = 'TRANSACTION_MINING_TIMEOUT',
}
export enum InternalZeroExError {
NoAbiDecoder = 'NO_ABI_DECODER',
ZrxNotInTokenRegistry = 'ZRX_NOT_IN_TOKEN_REGISTRY',
WethNotInTokenRegistry = 'WETH_NOT_IN_TOKEN_REGISTRY',
}
/**
* Elliptic Curve signature
*/
export interface ECSignature {
v: number;
r: string;
s: string;
}
export type OrderAddresses = [string, string, string, string, string];
export type OrderValues = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber];
export type LogEvent = Web3.LogEntryEvent;
export interface DecodedLogEvent<ArgsType> {
isRemoved: boolean;
log: LogWithDecodedArgs<ArgsType>;
}
export type EventCallback<ArgsType> = (err: null | Error, log?: DecodedLogEvent<ArgsType>) => void;
export type EventWatcherCallback = (err: null | Error, log?: LogEvent) => void;
export enum SolidityTypes {
Address = 'address',
Uint256 = 'uint256',
Uint8 = 'uint8',
Uint = 'uint',
}
export enum ExchangeContractErrCodes {
ERROR_FILL_EXPIRED, // Order has already expired
ERROR_FILL_NO_VALUE, // Order has already been fully filled or cancelled
ERROR_FILL_TRUNCATION, // Rounding error too large
ERROR_FILL_BALANCE_ALLOWANCE, // Insufficient balance or allowance for token transfer
ERROR_CANCEL_EXPIRED, // Order has already expired
ERROR_CANCEL_NO_VALUE, // Order has already been fully filled or cancelled
}
export enum ExchangeContractErrs {
OrderFillExpired = 'ORDER_FILL_EXPIRED',
OrderCancelExpired = 'ORDER_CANCEL_EXPIRED',
OrderCancelAmountZero = 'ORDER_CANCEL_AMOUNT_ZERO',
OrderAlreadyCancelledOrFilled = 'ORDER_ALREADY_CANCELLED_OR_FILLED',
OrderFillAmountZero = 'ORDER_FILL_AMOUNT_ZERO',
OrderRemainingFillAmountZero = 'ORDER_REMAINING_FILL_AMOUNT_ZERO',
OrderFillRoundingError = 'ORDER_FILL_ROUNDING_ERROR',
FillBalanceAllowanceError = 'FILL_BALANCE_ALLOWANCE_ERROR',
InsufficientTakerBalance = 'INSUFFICIENT_TAKER_BALANCE',
InsufficientTakerAllowance = 'INSUFFICIENT_TAKER_ALLOWANCE',
InsufficientMakerBalance = 'INSUFFICIENT_MAKER_BALANCE',
InsufficientMakerAllowance = 'INSUFFICIENT_MAKER_ALLOWANCE',
InsufficientTakerFeeBalance = 'INSUFFICIENT_TAKER_FEE_BALANCE',
InsufficientTakerFeeAllowance = 'INSUFFICIENT_TAKER_FEE_ALLOWANCE',
InsufficientMakerFeeBalance = 'INSUFFICIENT_MAKER_FEE_BALANCE',
InsufficientMakerFeeAllowance = 'INSUFFICIENT_MAKER_FEE_ALLOWANCE',
TransactionSenderIsNotFillOrderTaker = 'TRANSACTION_SENDER_IS_NOT_FILL_ORDER_TAKER',
MultipleMakersInSingleCancelBatchDisallowed = 'MULTIPLE_MAKERS_IN_SINGLE_CANCEL_BATCH_DISALLOWED',
InsufficientRemainingFillAmount = 'INSUFFICIENT_REMAINING_FILL_AMOUNT',
MultipleTakerTokensInFillUpToDisallowed = 'MULTIPLE_TAKER_TOKENS_IN_FILL_UP_TO_DISALLOWED',
BatchOrdersMustHaveSameExchangeAddress = 'BATCH_ORDERS_MUST_HAVE_SAME_EXCHANGE_ADDRESS',
BatchOrdersMustHaveAtLeastOneItem = 'BATCH_ORDERS_MUST_HAVE_AT_LEAST_ONE_ITEM',
}
export type RawLog = Web3.LogEntry;
export interface ContractEvent {
logIndex: number;
transactionIndex: number;
transactionHash: string;
blockHash: string;
blockNumber: number;
address: string;
type: string;
event: string;
args: ContractEventArgs;
}
export interface LogFillContractEventArgs {
maker: string;
taker: string;
feeRecipient: string;
makerToken: string;
takerToken: string;
filledMakerTokenAmount: BigNumber;
filledTakerTokenAmount: BigNumber;
paidMakerFee: BigNumber;
paidTakerFee: BigNumber;
tokens: string;
orderHash: string;
}
export interface LogCancelContractEventArgs {
maker: string;
feeRecipient: string;
makerToken: string;
takerToken: string;
cancelledMakerTokenAmount: BigNumber;
cancelledTakerTokenAmount: BigNumber;
tokens: string;
orderHash: string;
}
export interface LogErrorContractEventArgs {
errorId: BigNumber;
orderHash: string;
}
export type ExchangeContractEventArgs =
| LogFillContractEventArgs
| LogCancelContractEventArgs
| LogErrorContractEventArgs;
export interface TransferContractEventArgs {
_from: string;
_to: string;
_value: BigNumber;
}
export interface ApprovalContractEventArgs {
_owner: string;
_spender: string;
_value: BigNumber;
}
export interface DepositContractEventArgs {
_owner: string;
_value: BigNumber;
}
export interface WithdrawalContractEventArgs {
_owner: string;
_value: BigNumber;
}
export type TokenContractEventArgs = TransferContractEventArgs | ApprovalContractEventArgs;
export type EtherTokenContractEventArgs =
| TokenContractEventArgs
| DepositContractEventArgs
| WithdrawalContractEventArgs;
export type ContractEventArgs = ExchangeContractEventArgs | TokenContractEventArgs | EtherTokenContractEventArgs;
export type ContractEventArg = string | BigNumber;
export interface Order {
maker: string;
taker: string;
makerFee: BigNumber;
takerFee: BigNumber;
makerTokenAmount: BigNumber;
takerTokenAmount: BigNumber;
makerTokenAddress: string;
takerTokenAddress: string;
salt: BigNumber;
exchangeContractAddress: string;
feeRecipient: string;
expirationUnixTimestampSec: BigNumber;
}
export interface SignedOrder extends Order {
ecSignature: ECSignature;
}
// [address, name, symbol, decimals, ipfsHash, swarmHash]
export type TokenMetadata = [string, string, string, BigNumber, string, string];
export interface Token {
name: string;
address: string;
symbol: string;
decimals: number;
}
export interface TxOpts {
from: string;
gas?: number;
value?: BigNumber;
gasPrice?: BigNumber;
}
export interface TokenAddressBySymbol {
[symbol: string]: string;
}
export enum ExchangeEvents {
LogFill = 'LogFill',
LogCancel = 'LogCancel',
LogError = 'LogError',
}
export enum TokenEvents {
Transfer = 'Transfer',
Approval = 'Approval',
}
export enum EtherTokenEvents {
Transfer = 'Transfer',
Approval = 'Approval',
Deposit = 'Deposit',
Withdrawal = 'Withdrawal',
}
export type ContractEvents = TokenEvents | ExchangeEvents | EtherTokenEvents;
export interface IndexedFilterValues {
[index: string]: ContractEventArg;
}
// Earliest is omitted by design. It is simply an alias for the `0` constant and
// is thus not very helpful. Moreover, this type is used in places that only accept
// `latest` or `pending`.
export enum BlockParamLiteral {
Latest = 'latest',
Pending = 'pending',
}
export type BlockParam = BlockParamLiteral | number;
export interface BlockRange {
fromBlock: BlockParam;
toBlock: BlockParam;
}
export type DoneCallback = (err?: Error) => void;
export interface OrderCancellationRequest {
order: Order | SignedOrder;
takerTokenCancelAmount: BigNumber;
}
export interface OrderFillRequest {
signedOrder: SignedOrder;
takerTokenFillAmount: BigNumber;
}
export type AsyncMethod = (...args: any[]) => Promise<any>;
export type SyncMethod = (...args: any[]) => any;
/**
* We re-export the `Web3.Provider` type specified in the Web3 Typescript typings
* since it is the type of the `provider` argument to the `ZeroEx` constructor.
* It is however a `Web3` library type, not a native `0x.js` type. To learn more
* about providers, visit https://0xproject.com/wiki#Web3-Provider-Explained
*/
export type Web3Provider = Web3.Provider;
export interface JSONRPCPayload {
params: any[];
method: string;
}
/*
* orderExpirationCheckingIntervalMs: How often to check for expired orders. Default: 50
* eventPollingIntervalMs: How often to poll the Ethereum node for new events. Defaults: 200
* expirationMarginMs: Amount of time before order expiry that you'd like to be notified
* of an orders expiration. Defaults: 0
* cleanupJobIntervalMs: How often to run a cleanup job which revalidates all the orders. Defaults: 1h
*/
export interface OrderStateWatcherConfig {
orderExpirationCheckingIntervalMs?: number;
eventPollingIntervalMs?: number;
expirationMarginMs?: number;
cleanupJobIntervalMs?: number;
}
/*
* networkId: The id of the underlying ethereum network your provider is connected to. (1-mainnet, 42-kovan, 50-testrpc)
* gasPrice: Gas price to use with every transaction
* exchangeContractAddress: The address of an exchange contract to use
* zrxContractAddress: The address of the ZRX contract to use
* tokenRegistryContractAddress: The address of a token registry contract to use
* tokenTransferProxyContractAddress: The address of the token transfer proxy contract to use
* orderWatcherConfig: All the configs related to the orderWatcher
*/
export interface ZeroExConfig {
networkId: number;
gasPrice?: BigNumber;
exchangeContractAddress?: string;
zrxContractAddress?: string;
tokenRegistryContractAddress?: string;
tokenTransferProxyContractAddress?: string;
orderWatcherConfig?: OrderStateWatcherConfig;
}
export enum AbiType {
Function = 'function',
Constructor = 'constructor',
Event = 'event',
Fallback = 'fallback',
}
export interface DecodedLogArgs {
[argName: string]: ContractEventArg;
}
export interface LogWithDecodedArgs<ArgsType> extends Web3.DecodedLogEntry<ArgsType> {}
export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt {
logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.LogEntry>;
}
export type ArtifactContractName = 'ZRX' | 'TokenTransferProxy' | 'TokenRegistry' | 'Token' | 'Exchange' | 'EtherToken';
export interface Artifact {
contract_name: ArtifactContractName;
abi: Web3.ContractAbi;
networks: {
[networkId: number]: {
address: string;
};
};
}
/*
* expectedFillTakerTokenAmount: If specified, the validation method will ensure that the
* supplied order maker has a sufficient allowance/balance to fill this amount of the order's
* takerTokenAmount. If not specified, the validation method ensures that the maker has a sufficient
* allowance/balance to fill the entire remaining order amount.
*/
export interface ValidateOrderFillableOpts {
expectedFillTakerTokenAmount?: BigNumber;
}
/*
* defaultBlock: The block up to which to query the blockchain state. Setting this to a historical block number
* let's the user query the blockchain's state at an arbitrary point in time. In order for this to work, the
* backing Ethereum node must keep the entire historical state of the chain (e.g setting `--pruning=archive`
* flag when running Parity).
*/
export interface MethodOpts {
defaultBlock?: Web3.BlockParam;
}
/*
* gasPrice: Gas price in Wei to use for a transaction
* gasLimit: The amount of gas to send with a transaction
*/
export interface TransactionOpts {
gasPrice?: BigNumber;
gasLimit?: number;
}
/*
* shouldValidate: Flag indicating whether the library should make attempts to validate a transaction before
* broadcasting it. For example, order has a valid signature, maker has sufficient funds, etc. Default: true
*/
export interface OrderTransactionOpts extends TransactionOpts {
shouldValidate?: boolean;
}
export type FilterObject = Web3.FilterObject;
export enum TradeSide {
Maker = 'maker',
Taker = 'taker',
}
export enum TransferType {
Trade = 'trade',
Fee = 'fee',
}
export interface OrderRelevantState {
makerBalance: BigNumber;
makerProxyAllowance: BigNumber;
makerFeeBalance: BigNumber;
makerFeeProxyAllowance: BigNumber;
filledTakerTokenAmount: BigNumber;
cancelledTakerTokenAmount: BigNumber;
remainingFillableMakerTokenAmount: BigNumber;
remainingFillableTakerTokenAmount: BigNumber;
}
export interface OrderStateValid {
isValid: true;
orderHash: string;
orderRelevantState: OrderRelevantState;
}
export interface OrderStateInvalid {
isValid: false;
orderHash: string;
error: ExchangeContractErrs;
}
export type OrderState = OrderStateValid | OrderStateInvalid;
export type OnOrderStateChangeCallback = (err: Error | null, orderState?: OrderState) => void;
// tslint:disable:max-file-line-count

View File

@@ -1,72 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import * as Web3 from 'web3';
import * as SolidityCoder from 'web3/lib/solidity/coder';
import { AbiType, ContractEventArgs, DecodedLogArgs, LogWithDecodedArgs, RawLog, SolidityTypes } from '../types';
export class AbiDecoder {
private _savedABIs: Web3.AbiDefinition[] = [];
private _methodIds: { [signatureHash: string]: Web3.EventAbi } = {};
private static _padZeros(address: string) {
let formatted = address;
if (_.startsWith(formatted, '0x')) {
formatted = formatted.slice(2);
}
formatted = _.padStart(formatted, 40, '0');
return `0x${formatted}`;
}
constructor(abiArrays: Web3.AbiDefinition[][]) {
_.map(abiArrays, this._addABI.bind(this));
}
// This method can only decode logs from the 0x & ERC20 smart contracts
public tryToDecodeLogOrNoop<ArgsType extends ContractEventArgs>(
log: Web3.LogEntry,
): LogWithDecodedArgs<ArgsType> | RawLog {
const methodId = log.topics[0];
const event = this._methodIds[methodId];
if (_.isUndefined(event)) {
return log;
}
const logData = log.data;
const decodedParams: DecodedLogArgs = {};
let dataIndex = 0;
let topicsIndex = 1;
const nonIndexedInputs = _.filter(event.inputs, input => !input.indexed);
const dataTypes = _.map(nonIndexedInputs, input => input.type);
const decodedData = SolidityCoder.decodeParams(dataTypes, logData.slice('0x'.length));
_.map(event.inputs, (param: Web3.EventParameter) => {
// Indexed parameters are stored in topics. Non-indexed ones in decodedData
let value = param.indexed ? log.topics[topicsIndex++] : decodedData[dataIndex++];
if (param.type === SolidityTypes.Address) {
value = AbiDecoder._padZeros(new BigNumber(value).toString(16));
} else if (
param.type === SolidityTypes.Uint256 ||
param.type === SolidityTypes.Uint8 ||
param.type === SolidityTypes.Uint
) {
value = new BigNumber(value);
}
decodedParams[param.name] = value;
});
return {
...log,
event: event.name,
args: decodedParams,
};
}
private _addABI(abiArray: Web3.AbiDefinition[]): void {
_.map(abiArray, (abi: Web3.AbiDefinition) => {
if (abi.type === AbiType.Event) {
const signature = `${abi.name}(${_.map(abi.inputs, input => input.type).join(',')})`;
const signatureHash = new Web3().sha3(signature);
this._methodIds[signatureHash] = abi;
}
});
this._savedABIs = this._savedABIs.concat(abiArray);
}
}

View File

@@ -1,35 +0,0 @@
import { assert as sharedAssert } from '@0xproject/assert';
// We need those two unused imports because they're actually used by sharedAssert which gets injected here
// tslint:disable-next-line:no-unused-variable
import { Schema } from '@0xproject/json-schemas';
// tslint:disable-next-line:no-unused-variable
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import { ECSignature } from '../types';
import { signatureUtils } from '../utils/signature_utils';
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`);
},
async isSenderAddressAsync(
variableName: string,
senderAddressHex: string,
web3Wrapper: Web3Wrapper,
): Promise<void> {
sharedAssert.isETHAddressHex(variableName, senderAddressHex);
const isSenderAddressAvailable = await web3Wrapper.isSenderAddressAvailableAsync(senderAddressHex);
sharedAssert.assert(
isSenderAddressAvailable,
`Specified ${variableName} ${senderAddressHex} isn't available through the supplied web3 provider`,
);
},
async isUserAddressAvailableAsync(web3Wrapper: Web3Wrapper): Promise<void> {
const availableAddresses = await web3Wrapper.getAvailableAddressesAsync();
this.assert(!_.isEmpty(availableAddresses), 'No addresses were available on the provided web3 provider');
},
};

View File

@@ -1,12 +1,4 @@
import { BigNumber } from '@0xproject/utils';
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
TESTRPC_NETWORK_ID: 50,
MAX_DIGITS_IN_UNSIGNED_256_INT: 78,
INVALID_JUMP_PATTERN: 'invalid JUMP at',
OUT_OF_GAS_PATTERN: 'out of gas',
INVALID_TAKER_FORMAT: 'instance.taker is not of a type(s) string',
UNLIMITED_ALLOWANCE_IN_BASE_UNITS: new BigNumber(2).pow(256).minus(1),
DEFAULT_BLOCK_POLLING_INTERVAL: 1000,
};

View File

@@ -1,144 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { ZeroEx } from '../0x';
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
import { RemainingFillableCalculator } from '../order_watcher/remaining_fillable_calculator';
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store';
import {
ExchangeContractErrs,
OrderRelevantState,
OrderState,
OrderStateInvalid,
OrderStateValid,
SignedOrder,
} from '../types';
const ACCEPTABLE_RELATIVE_ROUNDING_ERROR = 0.0001;
export class OrderStateUtils {
private _balanceAndProxyAllowanceLazyStore: BalanceAndProxyAllowanceLazyStore;
private _orderFilledCancelledLazyStore: OrderFilledCancelledLazyStore;
private static _validateIfOrderIsValid(signedOrder: SignedOrder, orderRelevantState: OrderRelevantState): void {
const unavailableTakerTokenAmount = orderRelevantState.cancelledTakerTokenAmount.add(
orderRelevantState.filledTakerTokenAmount,
);
const availableTakerTokenAmount = signedOrder.takerTokenAmount.minus(unavailableTakerTokenAmount);
if (availableTakerTokenAmount.eq(0)) {
throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero);
}
if (orderRelevantState.makerBalance.eq(0)) {
throw new Error(ExchangeContractErrs.InsufficientMakerBalance);
}
if (orderRelevantState.makerProxyAllowance.eq(0)) {
throw new Error(ExchangeContractErrs.InsufficientMakerAllowance);
}
if (!signedOrder.makerFee.eq(0)) {
if (orderRelevantState.makerFeeBalance.eq(0)) {
throw new Error(ExchangeContractErrs.InsufficientMakerFeeBalance);
}
if (orderRelevantState.makerFeeProxyAllowance.eq(0)) {
throw new Error(ExchangeContractErrs.InsufficientMakerFeeAllowance);
}
}
const minFillableTakerTokenAmountWithinNoRoundingErrorRange = signedOrder.takerTokenAmount
.dividedBy(ACCEPTABLE_RELATIVE_ROUNDING_ERROR)
.dividedBy(signedOrder.makerTokenAmount);
if (
orderRelevantState.remainingFillableTakerTokenAmount.lessThan(
minFillableTakerTokenAmountWithinNoRoundingErrorRange,
)
) {
throw new Error(ExchangeContractErrs.OrderFillRoundingError);
}
}
constructor(
balanceAndProxyAllowanceLazyStore: BalanceAndProxyAllowanceLazyStore,
orderFilledCancelledLazyStore: OrderFilledCancelledLazyStore,
) {
this._balanceAndProxyAllowanceLazyStore = balanceAndProxyAllowanceLazyStore;
this._orderFilledCancelledLazyStore = orderFilledCancelledLazyStore;
}
public async getOrderStateAsync(signedOrder: SignedOrder): Promise<OrderState> {
const orderRelevantState = await this.getOrderRelevantStateAsync(signedOrder);
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
try {
OrderStateUtils._validateIfOrderIsValid(signedOrder, orderRelevantState);
const orderState: OrderStateValid = {
isValid: true,
orderHash,
orderRelevantState,
};
return orderState;
} catch (err) {
const orderState: OrderStateInvalid = {
isValid: false,
orderHash,
error: err.message,
};
return orderState;
}
}
public async getOrderRelevantStateAsync(signedOrder: SignedOrder): Promise<OrderRelevantState> {
// HACK: We access the private property here but otherwise the interface will be less nice.
// If we pass it from the instantiator - there is no opportunity to get it there
// because JS doesn't support async constructors.
// Moreover - it's cached under the hood so it's equivalent to an async constructor.
const exchange = (this._orderFilledCancelledLazyStore as any)._exchange as ExchangeWrapper;
const zrxTokenAddress = exchange.getZRXTokenAddress();
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
const makerBalance = await this._balanceAndProxyAllowanceLazyStore.getBalanceAsync(
signedOrder.makerTokenAddress,
signedOrder.maker,
);
const makerProxyAllowance = await this._balanceAndProxyAllowanceLazyStore.getProxyAllowanceAsync(
signedOrder.makerTokenAddress,
signedOrder.maker,
);
const makerFeeBalance = await this._balanceAndProxyAllowanceLazyStore.getBalanceAsync(
zrxTokenAddress,
signedOrder.maker,
);
const makerFeeProxyAllowance = await this._balanceAndProxyAllowanceLazyStore.getProxyAllowanceAsync(
zrxTokenAddress,
signedOrder.maker,
);
const filledTakerTokenAmount = await this._orderFilledCancelledLazyStore.getFilledTakerAmountAsync(orderHash);
const cancelledTakerTokenAmount = await this._orderFilledCancelledLazyStore.getCancelledTakerAmountAsync(
orderHash,
);
const unavailableTakerTokenAmount = await exchange.getUnavailableTakerAmountAsync(orderHash);
const totalMakerTokenAmount = signedOrder.makerTokenAmount;
const totalTakerTokenAmount = signedOrder.takerTokenAmount;
const remainingTakerTokenAmount = totalTakerTokenAmount.minus(unavailableTakerTokenAmount);
const remainingMakerTokenAmount = remainingTakerTokenAmount
.times(totalMakerTokenAmount)
.dividedToIntegerBy(totalTakerTokenAmount);
const transferrableMakerTokenAmount = BigNumber.min([makerProxyAllowance, makerBalance]);
const transferrableFeeTokenAmount = BigNumber.min([makerFeeProxyAllowance, makerFeeBalance]);
const isMakerTokenZRX = signedOrder.makerTokenAddress === zrxTokenAddress;
const remainingFillableCalculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableFeeTokenAmount,
remainingMakerTokenAmount,
);
const remainingFillableMakerTokenAmount = remainingFillableCalculator.computeRemainingMakerFillable();
const remainingFillableTakerTokenAmount = remainingFillableCalculator.computeRemainingTakerFillable();
const orderRelevantState = {
makerBalance,
makerProxyAllowance,
makerFeeBalance,
makerFeeProxyAllowance,
filledTakerTokenAmount,
cancelledTakerTokenAmount,
remainingFillableMakerTokenAmount,
remainingFillableTakerTokenAmount,
};
return orderRelevantState;
}
}

View File

@@ -1,216 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { ZeroEx } from '../0x';
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
import { ExchangeContractErrs, Order, SignedOrder, TradeSide, TransferType, ZeroExError } from '../types';
import { constants } from '../utils/constants';
import { utils } from '../utils/utils';
import { ExchangeTransferSimulator } from './exchange_transfer_simulator';
export class OrderValidationUtils {
private _exchangeWrapper: ExchangeWrapper;
public static validateCancelOrderThrowIfInvalid(
order: Order,
cancelTakerTokenAmount: BigNumber,
unavailableTakerTokenAmount: BigNumber,
): void {
if (cancelTakerTokenAmount.eq(0)) {
throw new Error(ExchangeContractErrs.OrderCancelAmountZero);
}
if (order.takerTokenAmount.eq(unavailableTakerTokenAmount)) {
throw new Error(ExchangeContractErrs.OrderAlreadyCancelledOrFilled);
}
const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec();
if (order.expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) {
throw new Error(ExchangeContractErrs.OrderCancelExpired);
}
}
public static async validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
exchangeTradeEmulator: ExchangeTransferSimulator,
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
senderAddress: string,
zrxTokenAddress: string,
): Promise<void> {
const fillMakerTokenAmount = OrderValidationUtils._getPartialAmount(
fillTakerTokenAmount,
signedOrder.takerTokenAmount,
signedOrder.makerTokenAmount,
);
await exchangeTradeEmulator.transferFromAsync(
signedOrder.makerTokenAddress,
signedOrder.maker,
senderAddress,
fillMakerTokenAmount,
TradeSide.Maker,
TransferType.Trade,
);
await exchangeTradeEmulator.transferFromAsync(
signedOrder.takerTokenAddress,
senderAddress,
signedOrder.maker,
fillTakerTokenAmount,
TradeSide.Taker,
TransferType.Trade,
);
const makerFeeAmount = OrderValidationUtils._getPartialAmount(
fillTakerTokenAmount,
signedOrder.takerTokenAmount,
signedOrder.makerFee,
);
await exchangeTradeEmulator.transferFromAsync(
zrxTokenAddress,
signedOrder.maker,
signedOrder.feeRecipient,
makerFeeAmount,
TradeSide.Maker,
TransferType.Fee,
);
const takerFeeAmount = OrderValidationUtils._getPartialAmount(
fillTakerTokenAmount,
signedOrder.takerTokenAmount,
signedOrder.takerFee,
);
await exchangeTradeEmulator.transferFromAsync(
zrxTokenAddress,
senderAddress,
signedOrder.feeRecipient,
takerFeeAmount,
TradeSide.Taker,
TransferType.Fee,
);
}
private static _validateRemainingFillAmountNotZeroOrThrow(
takerTokenAmount: BigNumber,
unavailableTakerTokenAmount: BigNumber,
) {
if (takerTokenAmount.eq(unavailableTakerTokenAmount)) {
throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero);
}
}
private static _validateOrderNotExpiredOrThrow(expirationUnixTimestampSec: BigNumber) {
const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec();
if (expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) {
throw new Error(ExchangeContractErrs.OrderFillExpired);
}
}
private static _getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber {
const fillMakerTokenAmount = numerator
.mul(target)
.div(denominator)
.round(0);
return fillMakerTokenAmount;
}
constructor(exchangeWrapper: ExchangeWrapper) {
this._exchangeWrapper = exchangeWrapper;
}
public async validateOrderFillableOrThrowAsync(
exchangeTradeEmulator: ExchangeTransferSimulator,
signedOrder: SignedOrder,
zrxTokenAddress: string,
expectedFillTakerTokenAmount?: BigNumber,
): Promise<void> {
const orderHash = utils.getOrderHashHex(signedOrder);
const unavailableTakerTokenAmount = await this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash);
OrderValidationUtils._validateRemainingFillAmountNotZeroOrThrow(
signedOrder.takerTokenAmount,
unavailableTakerTokenAmount,
);
OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationUnixTimestampSec);
let fillTakerTokenAmount = signedOrder.takerTokenAmount.minus(unavailableTakerTokenAmount);
if (!_.isUndefined(expectedFillTakerTokenAmount)) {
fillTakerTokenAmount = expectedFillTakerTokenAmount;
}
const fillMakerTokenAmount = OrderValidationUtils._getPartialAmount(
fillTakerTokenAmount,
signedOrder.takerTokenAmount,
signedOrder.makerTokenAmount,
);
await exchangeTradeEmulator.transferFromAsync(
signedOrder.makerTokenAddress,
signedOrder.maker,
signedOrder.taker,
fillMakerTokenAmount,
TradeSide.Maker,
TransferType.Trade,
);
const makerFeeAmount = OrderValidationUtils._getPartialAmount(
fillTakerTokenAmount,
signedOrder.takerTokenAmount,
signedOrder.makerFee,
);
await exchangeTradeEmulator.transferFromAsync(
zrxTokenAddress,
signedOrder.maker,
signedOrder.feeRecipient,
makerFeeAmount,
TradeSide.Maker,
TransferType.Fee,
);
}
public async validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator: ExchangeTransferSimulator,
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
takerAddress: string,
zrxTokenAddress: string,
): Promise<BigNumber> {
if (fillTakerTokenAmount.eq(0)) {
throw new Error(ExchangeContractErrs.OrderFillAmountZero);
}
const orderHash = utils.getOrderHashHex(signedOrder);
if (!ZeroEx.isValidSignature(orderHash, signedOrder.ecSignature, signedOrder.maker)) {
throw new Error(ZeroExError.InvalidSignature);
}
const unavailableTakerTokenAmount = await this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash);
OrderValidationUtils._validateRemainingFillAmountNotZeroOrThrow(
signedOrder.takerTokenAmount,
unavailableTakerTokenAmount,
);
if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== takerAddress) {
throw new Error(ExchangeContractErrs.TransactionSenderIsNotFillOrderTaker);
}
OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationUnixTimestampSec);
const remainingTakerTokenAmount = signedOrder.takerTokenAmount.minus(unavailableTakerTokenAmount);
const filledTakerTokenAmount = remainingTakerTokenAmount.lessThan(fillTakerTokenAmount)
? remainingTakerTokenAmount
: fillTakerTokenAmount;
await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
filledTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
const wouldRoundingErrorOccur = await this._exchangeWrapper.isRoundingErrorAsync(
filledTakerTokenAmount,
signedOrder.takerTokenAmount,
signedOrder.makerTokenAmount,
);
if (wouldRoundingErrorOccur) {
throw new Error(ExchangeContractErrs.OrderFillRoundingError);
}
return filledTakerTokenAmount;
}
public async validateFillOrKillOrderThrowIfInvalidAsync(
exchangeTradeEmulator: ExchangeTransferSimulator,
signedOrder: SignedOrder,
fillTakerTokenAmount: BigNumber,
takerAddress: string,
zrxTokenAddress: string,
): Promise<void> {
const filledTakerTokenAmount = await this.validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator,
signedOrder,
fillTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
if (filledTakerTokenAmount !== fillTakerTokenAmount) {
throw new Error(ExchangeContractErrs.InsufficientRemainingFillAmount);
}
}
}

View File

@@ -1,46 +0,0 @@
import * as ethUtil from 'ethereumjs-util';
import { ECSignature } from '../types';
export const signatureUtils = {
isValidSignature(data: string, signature: ECSignature, signerAddress: string): boolean {
const dataBuff = ethUtil.toBuffer(data);
const msgHashBuff = ethUtil.hashPersonalMessage(dataBuff);
try {
const pubKey = ethUtil.ecrecover(
msgHashBuff,
signature.v,
ethUtil.toBuffer(signature.r),
ethUtil.toBuffer(signature.s),
);
const retrievedAddress = ethUtil.bufferToHex(ethUtil.pubToAddress(pubKey));
return retrievedAddress === signerAddress;
} catch (err) {
return false;
}
},
parseSignatureHexAsVRS(signatureHex: string): ECSignature {
const signatureBuffer = ethUtil.toBuffer(signatureHex);
let v = signatureBuffer[0];
if (v < 27) {
v += 27;
}
const r = signatureBuffer.slice(1, 33);
const s = signatureBuffer.slice(33, 65);
const ecSignature: ECSignature = {
v,
r: ethUtil.bufferToHex(r),
s: ethUtil.bufferToHex(s),
};
return ecSignature;
},
parseSignatureHexAsRSV(signatureHex: string): ECSignature {
const { v, r, s } = ethUtil.fromRpcSig(signatureHex);
const ecSignature: ECSignature = {
v,
r: ethUtil.bufferToHex(r),
s: ethUtil.bufferToHex(s),
};
return ecSignature;
},
};

View File

@@ -1,74 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import BN = require('bn.js');
import * as ethABI from 'ethereumjs-abi';
import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
import { Order, SignedOrder, SolidityTypes } from '../types';
export const utils = {
/**
* Converts BigNumber instance to BN
* The only reason we convert to BN is to remain compatible with `ethABI. soliditySHA3` that
* expects values of Solidity type `uint` to be passed as type `BN`.
* We do not use BN anywhere else in the codebase.
*/
bigNumberToBN(value: BigNumber) {
return new BN(value.toString(), 10);
},
consoleLog(message: string): void {
// tslint:disable-next-line: no-console
console.log(message);
},
isParityNode(nodeVersion: string): boolean {
return _.includes(nodeVersion, 'Parity');
},
isTestRpc(nodeVersion: string): boolean {
return _.includes(nodeVersion, 'TestRPC');
},
spawnSwitchErr(name: string, value: any): Error {
return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
},
getOrderHashHex(order: Order | SignedOrder): string {
const orderParts = [
{ value: order.exchangeContractAddress, type: SolidityTypes.Address },
{ value: order.maker, type: SolidityTypes.Address },
{ value: order.taker, type: SolidityTypes.Address },
{ value: order.makerTokenAddress, type: SolidityTypes.Address },
{ value: order.takerTokenAddress, type: SolidityTypes.Address },
{ value: order.feeRecipient, type: SolidityTypes.Address },
{
value: utils.bigNumberToBN(order.makerTokenAmount),
type: SolidityTypes.Uint256,
},
{
value: utils.bigNumberToBN(order.takerTokenAmount),
type: SolidityTypes.Uint256,
},
{
value: utils.bigNumberToBN(order.makerFee),
type: SolidityTypes.Uint256,
},
{
value: utils.bigNumberToBN(order.takerFee),
type: SolidityTypes.Uint256,
},
{
value: utils.bigNumberToBN(order.expirationUnixTimestampSec),
type: SolidityTypes.Uint256,
},
{ value: utils.bigNumberToBN(order.salt), type: SolidityTypes.Uint256 },
];
const types = _.map(orderParts, o => o.type);
const values = _.map(orderParts, o => o.value);
const hashBuff = ethABI.soliditySHA3(types, values);
const hashHex = ethUtil.bufferToHex(hashBuff);
return hashHex;
},
getCurrentUnixTimestampSec(): BigNumber {
return new BigNumber(Date.now() / 1000).round();
},
getCurrentUnixTimestampMs(): BigNumber {
return new BigNumber(Date.now());
},
};

View File

@@ -1,119 +1,77 @@
import { ContractWrappers } from '@0xproject/contract-wrappers';
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
import * as Sinon from 'sinon';
import { ApprovalContractEventArgs, LogWithDecodedArgs, Order, TokenEvents, ZeroEx } from '../src';
import { ERC20TokenApprovalEventArgs, ERC20TokenEvents, LogWithDecodedArgs, ZeroEx } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { TokenUtils } from './utils/token_utils';
import { web3Factory } from './utils/web3_factory';
import { tokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
chaiSetup.configure();
const expect = chai.expect;
describe('ZeroEx library', () => {
const web3 = web3Factory.create();
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroEx = new ZeroEx(web3.currentProvider, config);
let zeroEx: ZeroEx;
before(async () => {
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
zeroEx = new ZeroEx(provider, config);
});
describe('#setProvider', () => {
it('overrides provider in nested web3s and invalidates contractInstances', async () => {
// Instantiate the contract instances with the current provider
await (zeroEx.exchange as any)._getExchangeContractAsync();
await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync();
expect((zeroEx.exchange as any)._exchangeContractIfExists).to.not.be.undefined();
expect((zeroEx.tokenRegistry as any)._tokenRegistryContractIfExists).to.not.be.undefined();
const newProvider = web3Factory.getRpcProvider();
// Add property to newProvider so that we can differentiate it from old provider
(newProvider as any).zeroExTestId = 1;
zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
(provider as any).zeroExTestId = 1;
zeroEx.setProvider(provider, constants.TESTRPC_NETWORK_ID);
// Check that contractInstances with old provider are removed after provider update
expect((zeroEx.exchange as any)._exchangeContractIfExists).to.be.undefined();
expect((zeroEx.tokenRegistry as any)._tokenRegistryContractIfExists).to.be.undefined();
// Check that all nested web3 wrapper instances return the updated provider
const nestedWeb3WrapperProvider = (zeroEx as any)._web3Wrapper.getCurrentProvider();
expect(nestedWeb3WrapperProvider.zeroExTestId).to.be.a('number');
const exchangeWeb3WrapperProvider = (zeroEx.exchange as any)._web3Wrapper.getCurrentProvider();
// Check that all nested zeroExContract/web3Wrapper instances return the updated provider
const nestedWeb3WrapperProvider = ((zeroEx as any)._contractWrappers as ContractWrappers).getProvider();
expect((nestedWeb3WrapperProvider as any).zeroExTestId).to.be.a('number');
const exchangeWeb3WrapperProvider = (zeroEx.exchange as any)._web3Wrapper.getProvider();
expect(exchangeWeb3WrapperProvider.zeroExTestId).to.be.a('number');
const tokenRegistryWeb3WrapperProvider = (zeroEx.tokenRegistry as any)._web3Wrapper.getCurrentProvider();
expect(tokenRegistryWeb3WrapperProvider.zeroExTestId).to.be.a('number');
});
});
describe('#isValidSignature', () => {
// The Exchange smart contract `isValidSignature` method only validates orderHashes and assumes
// the length of the data is exactly 32 bytes. Thus for these tests, we use data of this size.
const dataHex = '0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0';
const signature = {
v: 27,
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
};
const ethSignSignature =
'0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace225403';
const address = '0x5409ed021d9299bf6814279a6a1411a7e866a631';
it("should return false if the data doesn't pertain to the signature & address", async () => {
expect(ZeroEx.isValidSignature('0x0', signature, address)).to.be.false();
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync('0x0', signature, address),
).to.become(false);
return expect((zeroEx.exchange as any).isValidSignatureAsync('0x0', address, ethSignSignature)).to.become(
false,
);
});
it("should return false if the address doesn't pertain to the signature & data", async () => {
const validUnrelatedAddress = '0x8b0292b11a196601ed2ce54b665cafeca0347d42';
expect(ZeroEx.isValidSignature(dataHex, signature, validUnrelatedAddress)).to.be.false();
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(
dataHex,
signature,
validUnrelatedAddress,
),
(zeroEx.exchange as any).isValidSignatureAsync(dataHex, validUnrelatedAddress, ethSignSignature),
).to.become(false);
});
it("should return false if the signature doesn't pertain to the dataHex & address", async () => {
const wrongSignature = _.assign({}, signature, { v: 28 });
expect(ZeroEx.isValidSignature(dataHex, wrongSignature, address)).to.be.false();
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(dataHex, wrongSignature, address),
).to.become(false);
const signatureArray = ethSignSignature.split('');
// tslint:disable-next-line:custom-no-magic-numbers
signatureArray[5] = 'C'; // V = 28, instead of 27
const wrongSignature = signatureArray.join('');
return expect((zeroEx.exchange as any).isValidSignatureAsync(dataHex, address, wrongSignature)).to.become(
false,
);
});
it('should return true if the signature does pertain to the dataHex & address', async () => {
const isValidSignatureLocal = ZeroEx.isValidSignature(dataHex, signature, address);
expect(isValidSignatureLocal).to.be.true();
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(dataHex, signature, address),
).to.become(true);
});
});
describe('#generateSalt', () => {
it('generates different salts', () => {
const equal = ZeroEx.generatePseudoRandomSalt().eq(ZeroEx.generatePseudoRandomSalt());
expect(equal).to.be.false();
});
it('generates salt in range [0..2^256)', () => {
const salt = ZeroEx.generatePseudoRandomSalt();
expect(salt.greaterThanOrEqualTo(0)).to.be.true();
const twoPow256 = new BigNumber(2).pow(256);
expect(salt.lessThan(twoPow256)).to.be.true();
});
});
describe('#isValidOrderHash', () => {
it('returns false if the value is not a hex string', () => {
const isValid = ZeroEx.isValidOrderHash('not a hex');
expect(isValid).to.be.false();
});
it('returns false if the length is wrong', () => {
const isValid = ZeroEx.isValidOrderHash('0xdeadbeef');
expect(isValid).to.be.false();
});
it('returns true if order hash is correct', () => {
const isValid = ZeroEx.isValidOrderHash('0x' + Array(65).join('0'));
expect(isValid).to.be.true();
return expect((zeroEx.exchange as any).isValidSignatureAsync(dataHex, address, ethSignSignature)).to.become(
true,
);
});
});
describe('#toUnitAmount', () => {
@@ -148,94 +106,6 @@ describe('ZeroEx library', () => {
);
});
});
describe('#getOrderHashHex', () => {
const expectedOrderHash = '0x39da987067a3c9e5f1617694f1301326ba8c8b0498ebef5df4863bed394e3c83';
const fakeExchangeContractAddress = '0xb69e673309512a9d726f87304c6984054f87a93b';
const order: Order = {
maker: constants.NULL_ADDRESS,
taker: constants.NULL_ADDRESS,
feeRecipient: constants.NULL_ADDRESS,
makerTokenAddress: constants.NULL_ADDRESS,
takerTokenAddress: constants.NULL_ADDRESS,
exchangeContractAddress: fakeExchangeContractAddress,
salt: new BigNumber(0),
makerFee: new BigNumber(0),
takerFee: new BigNumber(0),
makerTokenAmount: new BigNumber(0),
takerTokenAmount: new BigNumber(0),
expirationUnixTimestampSec: new BigNumber(0),
};
it('calculates the order hash', async () => {
const orderHash = ZeroEx.getOrderHashHex(order);
expect(orderHash).to.be.equal(expectedOrderHash);
});
it('throws a readable error message if taker format is invalid', async () => {
const orderWithInvalidtakerFormat = {
...order,
taker: (null as any) as string,
};
const expectedErrorMessage =
'Order taker must be of type string. If you want anyone to be able to fill an order - pass ZeroEx.NULL_ADDRESS';
expect(() => ZeroEx.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage);
});
});
describe('#signOrderHashAsync', () => {
let stubs: Sinon.SinonStub[] = [];
let makerAddress: string;
before(async () => {
const availableAddreses = await zeroEx.getAvailableAddressesAsync();
makerAddress = availableAddreses[0];
});
afterEach(() => {
// clean up any stubs after the test has completed
_.each(stubs, s => s.restore());
stubs = [];
});
it('Should return the correct ECSignature', async () => {
const orderHash = '0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0';
const expectedECSignature = {
v: 27,
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
};
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
expect(ecSignature).to.deep.equal(expectedECSignature);
});
it('should return the correct ECSignature for signatureHex concatenated as R + S + V', async () => {
const orderHash = '0x34decbedc118904df65f379a175bb39ca18209d6ce41d5ed549d54e6e0a95004';
const signature =
'0x22109d11d79cb8bf96ed88625e1cd9558800c4073332a9a02857499883ee5ce3050aa3cc1f2c435e67e114cdce54b9527b4f50548342401bc5d2b77adbdacb021b';
const expectedECSignature = {
v: 27,
r: '0x22109d11d79cb8bf96ed88625e1cd9558800c4073332a9a02857499883ee5ce3',
s: '0x050aa3cc1f2c435e67e114cdce54b9527b4f50548342401bc5d2b77adbdacb02',
};
stubs = [
Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)),
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
];
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
expect(ecSignature).to.deep.equal(expectedECSignature);
});
it('should return the correct ECSignature for signatureHex concatenated as V + R + S', async () => {
const orderHash = '0xc793e33ffded933b76f2f48d9aa3339fc090399d5e7f5dec8d3660f5480793f7';
const signature =
'0x1bc80bedc6756722672753413efdd749b5adbd4fd552595f59c13427407ee9aee02dea66f25a608bbae457e020fb6decb763deb8b7192abab624997242da248960';
const expectedECSignature = {
v: 27,
r: '0xc80bedc6756722672753413efdd749b5adbd4fd552595f59c13427407ee9aee0',
s: '0x2dea66f25a608bbae457e020fb6decb763deb8b7192abab624997242da248960',
};
stubs = [
Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)),
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
];
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
expect(ecSignature).to.deep.equal(expectedECSignature);
});
});
describe('#awaitTransactionMinedAsync', () => {
beforeEach(async () => {
await blockchainLifecycle.startAsync();
@@ -246,17 +116,16 @@ describe('ZeroEx library', () => {
it('returns transaction receipt with decoded logs', async () => {
const availableAddresses = await zeroEx.getAvailableAddressesAsync();
const coinbase = availableAddresses[0];
const tokens = await zeroEx.tokenRegistry.getTokensAsync();
const tokenUtils = new TokenUtils(tokens);
const zrxTokenAddress = tokenUtils.getProtocolTokenOrThrow().address;
const proxyAddress = zeroEx.proxy.getContractAddress();
const txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(zrxTokenAddress, coinbase);
const zrxTokenAddress = tokenUtils.getProtocolTokenAddress();
const erc20ProxyAddress = zeroEx.erc20Proxy.getContractAddress();
const txHash = await zeroEx.erc20Token.setUnlimitedProxyAllowanceAsync(zrxTokenAddress, coinbase);
const txReceiptWithDecodedLogs = await zeroEx.awaitTransactionMinedAsync(txHash);
const log = txReceiptWithDecodedLogs.logs[0] as LogWithDecodedArgs<ApprovalContractEventArgs>;
expect(log.event).to.be.equal(TokenEvents.Approval);
// tslint:disable-next-line:no-unnecessary-type-assertion
const log = txReceiptWithDecodedLogs.logs[0] as LogWithDecodedArgs<ERC20TokenApprovalEventArgs>;
expect(log.event).to.be.equal(ERC20TokenEvents.Approval);
expect(log.args._owner).to.be.equal(coinbase);
expect(log.args._spender).to.be.equal(proxyAddress);
expect(log.args._value).to.be.bignumber.equal(zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
expect(log.args._spender).to.be.equal(erc20ProxyAddress);
expect(log.args._value).to.be.bignumber.equal(zeroEx.erc20Token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
});
describe('#config', () => {
@@ -265,18 +134,16 @@ describe('ZeroEx library', () => {
exchangeContractAddress: ZeroEx.NULL_ADDRESS,
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroExWithWrongExchangeAddress = new ZeroEx(web3.currentProvider, zeroExConfig);
const zeroExWithWrongExchangeAddress = new ZeroEx(provider, zeroExConfig);
expect(zeroExWithWrongExchangeAddress.exchange.getContractAddress()).to.be.equal(ZeroEx.NULL_ADDRESS);
});
it('allows to specify token registry token contract address', async () => {
it('allows to specify erc20Proxy contract address', async () => {
const zeroExConfig = {
tokenRegistryContractAddress: ZeroEx.NULL_ADDRESS,
erc20ProxyContractAddress: ZeroEx.NULL_ADDRESS,
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroExWithWrongTokenRegistryAddress = new ZeroEx(web3.currentProvider, zeroExConfig);
expect(zeroExWithWrongTokenRegistryAddress.tokenRegistry.getContractAddress()).to.be.equal(
ZeroEx.NULL_ADDRESS,
);
const zeroExWithWrongERC20ProxyAddress = new ZeroEx(provider, zeroExConfig);
expect(zeroExWithWrongERC20ProxyAddress.erc20Proxy.getContractAddress()).to.be.equal(ZeroEx.NULL_ADDRESS);
});
});
});

View File

@@ -1,55 +0,0 @@
import * as fs from 'fs';
import HDWalletProvider = require('truffle-hdwallet-provider');
import { ZeroEx } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
chaiSetup.configure();
// Those tests are slower cause they're talking to a remote node
const TIMEOUT = 10000;
describe('Artifacts', () => {
describe('contracts are deployed on kovan', () => {
const kovanRpcUrl = constants.KOVAN_RPC_URL;
const packageJSONContent = fs.readFileSync('package.json', 'utf-8');
const packageJSON = JSON.parse(packageJSONContent);
const mnemonic = packageJSON.config.mnemonic;
const web3Provider = new HDWalletProvider(mnemonic, kovanRpcUrl);
const config = {
networkId: constants.KOVAN_NETWORK_ID,
};
const zeroEx = new ZeroEx(web3Provider, config);
it('token registry contract is deployed', async () => {
await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync();
}).timeout(TIMEOUT);
it('proxy contract is deployed', async () => {
await (zeroEx.proxy as any)._getTokenTransferProxyContractAsync();
}).timeout(TIMEOUT);
it('exchange contract is deployed', async () => {
await (zeroEx.exchange as any)._getExchangeContractAsync();
}).timeout(TIMEOUT);
});
describe('contracts are deployed on ropsten', () => {
const ropstenRpcUrl = constants.ROPSTEN_RPC_URL;
const packageJSONContent = fs.readFileSync('package.json', 'utf-8');
const packageJSON = JSON.parse(packageJSONContent);
const mnemonic = packageJSON.config.mnemonic;
const web3Provider = new HDWalletProvider(mnemonic, ropstenRpcUrl);
const config = {
networkId: constants.ROPSTEN_NETWORK_ID,
};
const zeroEx = new ZeroEx(web3Provider, config);
it('token registry contract is deployed', async () => {
await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync();
}).timeout(TIMEOUT);
it('proxy contract is deployed', async () => {
await (zeroEx.proxy as any)._getTokenTransferProxyContractAsync();
}).timeout(TIMEOUT);
it('exchange contract is deployed', async () => {
await (zeroEx.exchange as any)._getExchangeContractAsync();
}).timeout(TIMEOUT);
});
});

View File

@@ -1,43 +0,0 @@
import * as chai from 'chai';
import 'mocha';
import { ZeroEx } from '../src';
import { assert } from '../src/utils/assert';
import { constants } from './utils/constants';
import { web3Factory } from './utils/web3_factory';
const expect = chai.expect;
describe('Assertion library', () => {
const web3 = web3Factory.create();
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroEx = new ZeroEx(web3.currentProvider, config);
describe('#isSenderAddressHexAsync', () => {
it('throws when address is invalid', async () => {
const address = '0xdeadbeef';
const varName = 'address';
return expect(
assert.isSenderAddressAsync(varName, address, (zeroEx as any)._web3Wrapper),
).to.be.rejectedWith(`Expected ${varName} to be of type ETHAddressHex, encountered: ${address}`);
});
it('throws when address is unavailable', async () => {
const validUnrelatedAddress = '0x8b0292b11a196601eddce54b665cafeca0347d42';
const varName = 'address';
return expect(
assert.isSenderAddressAsync(varName, validUnrelatedAddress, (zeroEx as any)._web3Wrapper),
).to.be.rejectedWith(
`Specified ${varName} ${validUnrelatedAddress} isn't available through the supplied web3 provider`,
);
});
it("doesn't throw if address is available", async () => {
const availableAddress = (await zeroEx.getAvailableAddressesAsync())[0];
const varName = 'address';
return expect(
assert.isSenderAddressAsync(varName, availableAddress, (zeroEx as any)._web3Wrapper),
).to.become(undefined);
});
});
});

View File

@@ -1,126 +0,0 @@
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
import * as Sinon from 'sinon';
import * as Web3 from 'web3';
import { LogEvent } from '../src';
import { EventWatcher } from '../src/order_watcher/event_watcher';
import { DoneCallback } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
import { web3Factory } from './utils/web3_factory';
chaiSetup.configure();
const expect = chai.expect;
describe('EventWatcher', () => {
let web3: Web3;
let stubs: Sinon.SinonStub[] = [];
let eventWatcher: EventWatcher;
let web3Wrapper: Web3Wrapper;
const logA: Web3.LogEntry = {
address: '0x71d271f8b14adef568f8f28f1587ce7271ac4ca5',
blockHash: null,
blockNumber: null,
data: '',
logIndex: null,
topics: [],
transactionHash: '0x004881d38cd4a8f72f1a0d68c8b9b8124504706041ff37019c1d1ed6bfda8e17',
transactionIndex: 0,
};
const logB: Web3.LogEntry = {
address: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819',
blockHash: null,
blockNumber: null,
data: '',
logIndex: null,
topics: ['0xf341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567'],
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
transactionIndex: 0,
};
const logC: Web3.LogEntry = {
address: '0x1d271f8b174adef58f1587ce68f8f27271ac4ca5',
blockHash: null,
blockNumber: null,
data: '',
logIndex: null,
topics: ['0xf341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567'],
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
transactionIndex: 0,
};
before(async () => {
web3 = web3Factory.create();
const pollingIntervalMs = 10;
web3Wrapper = new Web3Wrapper(web3.currentProvider);
eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalMs);
});
afterEach(() => {
// clean up any stubs after the test has completed
_.each(stubs, s => s.restore());
stubs = [];
eventWatcher.unsubscribe();
});
it('correctly emits initial log events', (done: DoneCallback) => {
const logs: Web3.LogEntry[] = [logA, logB];
const expectedLogEvents = [
{
removed: false,
...logA,
},
{
removed: false,
...logB,
},
];
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
getLogsStub.onCall(0).returns(logs);
stubs.push(getLogsStub);
const expectedToBeCalledOnce = false;
const callback = reportNodeCallbackErrors(done, expectedToBeCalledOnce)((event: LogEvent) => {
const expectedLogEvent = expectedLogEvents.shift();
expect(event).to.be.deep.equal(expectedLogEvent);
if (_.isEmpty(expectedLogEvents)) {
done();
}
});
eventWatcher.subscribe(callback);
});
it('correctly computes the difference and emits only changes', (done: DoneCallback) => {
const initialLogs: Web3.LogEntry[] = [logA, logB];
const changedLogs: Web3.LogEntry[] = [logA, logC];
const expectedLogEvents = [
{
removed: false,
...logA,
},
{
removed: false,
...logB,
},
{
removed: true,
...logB,
},
{
removed: false,
...logC,
},
];
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
getLogsStub.onCall(0).returns(initialLogs);
getLogsStub.onCall(1).returns(changedLogs);
stubs.push(getLogsStub);
const expectedToBeCalledOnce = false;
const callback = reportNodeCallbackErrors(done, expectedToBeCalledOnce)((event: LogEvent) => {
const expectedLogEvent = expectedLogEvents.shift();
expect(event).to.be.deep.equal(expectedLogEvent);
if (_.isEmpty(expectedLogEvents)) {
done();
}
});
eventWatcher.subscribe(callback);
});
});

View File

@@ -1,117 +0,0 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import { ExchangeContractErrs, Token, ZeroEx } from '../src';
import { BlockParamLiteral, TradeSide, TransferType } from '../src/types';
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { web3Factory } from './utils/web3_factory';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
describe('ExchangeTransferSimulator', () => {
const web3 = web3Factory.create();
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroEx = new ZeroEx(web3.currentProvider, config);
const transferAmount = new BigNumber(5);
let userAddresses: string[];
let tokens: Token[];
let coinbase: string;
let sender: string;
let recipient: string;
let exampleTokenAddress: string;
let exchangeTransferSimulator: ExchangeTransferSimulator;
let txHash: string;
before(async () => {
userAddresses = await zeroEx.getAvailableAddressesAsync();
[coinbase, sender, recipient] = userAddresses;
tokens = await zeroEx.tokenRegistry.getTokensAsync();
exampleTokenAddress = tokens[0].address;
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('#transferFromAsync', () => {
beforeEach(() => {
exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token, BlockParamLiteral.Latest);
});
it("throws if the user doesn't have enough allowance", async () => {
return expect(
exchangeTransferSimulator.transferFromAsync(
exampleTokenAddress,
sender,
recipient,
transferAmount,
TradeSide.Taker,
TransferType.Trade,
),
).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerAllowance);
});
it("throws if the user doesn't have enough balance", async () => {
txHash = await zeroEx.token.setProxyAllowanceAsync(exampleTokenAddress, sender, transferAmount);
await zeroEx.awaitTransactionMinedAsync(txHash);
return expect(
exchangeTransferSimulator.transferFromAsync(
exampleTokenAddress,
sender,
recipient,
transferAmount,
TradeSide.Maker,
TransferType.Trade,
),
).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance);
});
it('updates balances and proxyAllowance after transfer', async () => {
txHash = await zeroEx.token.transferAsync(exampleTokenAddress, coinbase, sender, transferAmount);
await zeroEx.awaitTransactionMinedAsync(txHash);
txHash = await zeroEx.token.setProxyAllowanceAsync(exampleTokenAddress, sender, transferAmount);
await zeroEx.awaitTransactionMinedAsync(txHash);
await exchangeTransferSimulator.transferFromAsync(
exampleTokenAddress,
sender,
recipient,
transferAmount,
TradeSide.Taker,
TransferType.Trade,
);
const store = (exchangeTransferSimulator as any)._store;
const senderBalance = await store.getBalanceAsync(exampleTokenAddress, sender);
const recipientBalance = await store.getBalanceAsync(exampleTokenAddress, recipient);
const senderProxyAllowance = await store.getProxyAllowanceAsync(exampleTokenAddress, sender);
expect(senderBalance).to.be.bignumber.equal(0);
expect(recipientBalance).to.be.bignumber.equal(transferAmount);
expect(senderProxyAllowance).to.be.bignumber.equal(0);
});
it("doesn't update proxyAllowance after transfer if unlimited", async () => {
txHash = await zeroEx.token.transferAsync(exampleTokenAddress, coinbase, sender, transferAmount);
await zeroEx.awaitTransactionMinedAsync(txHash);
txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(exampleTokenAddress, sender);
await zeroEx.awaitTransactionMinedAsync(txHash);
await exchangeTransferSimulator.transferFromAsync(
exampleTokenAddress,
sender,
recipient,
transferAmount,
TradeSide.Taker,
TransferType.Trade,
);
const store = (exchangeTransferSimulator as any)._store;
const senderBalance = await store.getBalanceAsync(exampleTokenAddress, sender);
const recipientBalance = await store.getBalanceAsync(exampleTokenAddress, recipient);
const senderProxyAllowance = await store.getProxyAllowanceAsync(exampleTokenAddress, sender);
expect(senderBalance).to.be.bignumber.equal(0);
expect(recipientBalance).to.be.bignumber.equal(transferAmount);
expect(senderProxyAllowance).to.be.bignumber.equal(zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
});
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
import { devConstants } from '@0xproject/dev-utils';
import { runV2MigrationsAsync } from '@0xproject/migrations';
import { provider } from './utils/web3_wrapper';
before('migrate contracts', async function(): Promise<void> {
// HACK: Since the migrations take longer then our global mocha timeout limit
// we manually increase it for this before hook.
const mochaTestTimeoutMs = 20000;
this.timeout(mochaTestTimeoutMs); // tslint:disable-line:no-invalid-this
const txDefaults = {
gas: devConstants.GAS_LIMIT,
from: devConstants.TESTRPC_FIRST_ADDRESS,
};
const artifactsDir = `../migrations/artifacts/2.0.0`;
await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
});

View File

@@ -1,474 +0,0 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as Sinon from 'sinon';
import * as Web3 from 'web3';
import { ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError } from '../src';
import { BlockParamLiteral, TradeSide, TransferType } from '../src/types';
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
import { OrderValidationUtils } from '../src/utils/order_validation_utils';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { FillScenarios } from './utils/fill_scenarios';
import { TokenUtils } from './utils/token_utils';
import { web3Factory } from './utils/web3_factory';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
describe('OrderValidation', () => {
let web3: Web3;
let zeroEx: ZeroEx;
let userAddresses: string[];
let tokens: Token[];
let tokenUtils: TokenUtils;
let exchangeContractAddress: string;
let zrxTokenAddress: string;
let fillScenarios: FillScenarios;
let makerTokenAddress: string;
let takerTokenAddress: string;
let coinbase: string;
let makerAddress: string;
let takerAddress: string;
let feeRecipient: string;
const fillableAmount = new BigNumber(5);
const fillTakerAmount = new BigNumber(5);
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
before(async () => {
web3 = web3Factory.create();
zeroEx = new ZeroEx(web3.currentProvider, config);
exchangeContractAddress = zeroEx.exchange.getContractAddress();
userAddresses = await zeroEx.getAvailableAddressesAsync();
[coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses;
tokens = await zeroEx.tokenRegistry.getTokensAsync();
tokenUtils = new TokenUtils(tokens);
zrxTokenAddress = tokenUtils.getProtocolTokenOrThrow().address;
fillScenarios = new FillScenarios(zeroEx, userAddresses, tokens, zrxTokenAddress, exchangeContractAddress);
const [makerToken, takerToken] = tokenUtils.getDummyTokens();
makerTokenAddress = makerToken.address;
takerTokenAddress = takerToken.address;
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('validateOrderFillableOrThrowAsync', () => {
it('should succeed if the order is fillable', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
await zeroEx.exchange.validateOrderFillableOrThrowAsync(signedOrder);
});
it('should succeed if the order is asymmetric and fillable', async () => {
const makerFillableAmount = fillableAmount;
const takerFillableAmount = fillableAmount.minus(4);
const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
makerFillableAmount,
takerFillableAmount,
);
await zeroEx.exchange.validateOrderFillableOrThrowAsync(signedOrder);
});
it('should throw when the order is fully filled or cancelled', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
await zeroEx.exchange.cancelOrderAsync(signedOrder, fillableAmount);
return expect(zeroEx.exchange.validateOrderFillableOrThrowAsync(signedOrder)).to.be.rejectedWith(
ExchangeContractErrs.OrderRemainingFillAmountZero,
);
});
it('should throw when order is expired', async () => {
const expirationInPast = new BigNumber(1496826058); // 7th Jun 2017
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
expirationInPast,
);
return expect(zeroEx.exchange.validateOrderFillableOrThrowAsync(signedOrder)).to.be.rejectedWith(
ExchangeContractErrs.OrderFillExpired,
);
});
});
describe('validateFillOrderAndThrowIfInvalidAsync', () => {
it('should throw when the fill amount is zero', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
const zeroFillAmount = new BigNumber(0);
return expect(
zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(signedOrder, zeroFillAmount, takerAddress),
).to.be.rejectedWith(ExchangeContractErrs.OrderFillAmountZero);
});
it('should throw when the signature is invalid', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
// 27 <--> 28
signedOrder.ecSignature.v = 28 - signedOrder.ecSignature.v + 27;
return expect(
zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(signedOrder, fillableAmount, takerAddress),
).to.be.rejectedWith(ZeroExError.InvalidSignature);
});
it('should throw when the order is fully filled or cancelled', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
await zeroEx.exchange.cancelOrderAsync(signedOrder, fillableAmount);
return expect(
zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(signedOrder, fillableAmount, takerAddress),
).to.be.rejectedWith(ExchangeContractErrs.OrderRemainingFillAmountZero);
});
it('should throw when sender is not a taker', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
const nonTakerAddress = userAddresses[6];
return expect(
zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(signedOrder, fillTakerAmount, nonTakerAddress),
).to.be.rejectedWith(ExchangeContractErrs.TransactionSenderIsNotFillOrderTaker);
});
it('should throw when order is expired', async () => {
const expirationInPast = new BigNumber(1496826058); // 7th Jun 2017
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
expirationInPast,
);
return expect(
zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(signedOrder, fillTakerAmount, takerAddress),
).to.be.rejectedWith(ExchangeContractErrs.OrderFillExpired);
});
it('should throw when there a rounding error would have occurred', async () => {
const makerAmount = new BigNumber(3);
const takerAmount = new BigNumber(5);
const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
makerAmount,
takerAmount,
);
const fillTakerAmountThatCausesRoundingError = new BigNumber(3);
return expect(
zeroEx.exchange.validateFillOrderThrowIfInvalidAsync(
signedOrder,
fillTakerAmountThatCausesRoundingError,
takerAddress,
),
).to.be.rejectedWith(ExchangeContractErrs.OrderFillRoundingError);
});
});
describe('#validateFillOrKillOrderAndThrowIfInvalidAsync', () => {
it('should throw if remaining fillAmount is less then the desired fillAmount', async () => {
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
const tooLargeFillAmount = new BigNumber(7);
const fillAmountDifference = tooLargeFillAmount.minus(fillableAmount);
await zeroEx.token.transferAsync(takerTokenAddress, coinbase, takerAddress, fillAmountDifference);
await zeroEx.token.setProxyAllowanceAsync(takerTokenAddress, takerAddress, tooLargeFillAmount);
await zeroEx.token.transferAsync(makerTokenAddress, coinbase, makerAddress, fillAmountDifference);
await zeroEx.token.setProxyAllowanceAsync(makerTokenAddress, makerAddress, tooLargeFillAmount);
return expect(
zeroEx.exchange.validateFillOrKillOrderThrowIfInvalidAsync(
signedOrder,
tooLargeFillAmount,
takerAddress,
),
).to.be.rejectedWith(ExchangeContractErrs.InsufficientRemainingFillAmount);
});
});
describe('validateCancelOrderAndThrowIfInvalidAsync', () => {
let signedOrder: SignedOrder;
const cancelAmount = new BigNumber(3);
beforeEach(async () => {
[coinbase, makerAddress, takerAddress] = userAddresses;
const [makerToken, takerToken] = tokenUtils.getDummyTokens();
makerTokenAddress = makerToken.address;
takerTokenAddress = takerToken.address;
signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
);
});
it('should throw when cancel amount is zero', async () => {
const zeroCancelAmount = new BigNumber(0);
return expect(
zeroEx.exchange.validateCancelOrderThrowIfInvalidAsync(signedOrder, zeroCancelAmount),
).to.be.rejectedWith(ExchangeContractErrs.OrderCancelAmountZero);
});
it('should throw when order is expired', async () => {
const expirationInPast = new BigNumber(1496826058); // 7th Jun 2017
const expiredSignedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
expirationInPast,
);
return expect(
zeroEx.exchange.validateCancelOrderThrowIfInvalidAsync(expiredSignedOrder, cancelAmount),
).to.be.rejectedWith(ExchangeContractErrs.OrderCancelExpired);
});
it('should throw when order is already cancelled or filled', async () => {
await zeroEx.exchange.cancelOrderAsync(signedOrder, fillableAmount);
return expect(
zeroEx.exchange.validateCancelOrderThrowIfInvalidAsync(signedOrder, fillableAmount),
).to.be.rejectedWith(ExchangeContractErrs.OrderAlreadyCancelledOrFilled);
});
});
describe('#validateFillOrderBalancesAllowancesThrowIfInvalidAsync', () => {
let exchangeTransferSimulator: ExchangeTransferSimulator;
let transferFromAsync: Sinon.SinonSpy;
const bigNumberMatch = (expected: BigNumber) => {
return Sinon.match((value: BigNumber) => value.eq(expected));
};
beforeEach('create exchangeTransferSimulator', async () => {
exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token, BlockParamLiteral.Latest);
transferFromAsync = Sinon.spy();
exchangeTransferSimulator.transferFromAsync = transferFromAsync as any;
});
it('should call exchangeTransferSimulator.transferFrom in a correct order', async () => {
const makerFee = new BigNumber(2);
const takerFee = new BigNumber(2);
const signedOrder = await fillScenarios.createFillableSignedOrderWithFeesAsync(
makerTokenAddress,
takerTokenAddress,
makerFee,
takerFee,
makerAddress,
takerAddress,
fillableAmount,
feeRecipient,
);
await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
exchangeTransferSimulator,
signedOrder,
fillableAmount,
takerAddress,
zrxTokenAddress,
);
expect(transferFromAsync.callCount).to.be.equal(4);
expect(
transferFromAsync
.getCall(0)
.calledWith(
makerTokenAddress,
makerAddress,
takerAddress,
bigNumberMatch(fillableAmount),
TradeSide.Maker,
TransferType.Trade,
),
).to.be.true();
expect(
transferFromAsync
.getCall(1)
.calledWith(
takerTokenAddress,
takerAddress,
makerAddress,
bigNumberMatch(fillableAmount),
TradeSide.Taker,
TransferType.Trade,
),
).to.be.true();
expect(
transferFromAsync
.getCall(2)
.calledWith(
zrxTokenAddress,
makerAddress,
feeRecipient,
bigNumberMatch(makerFee),
TradeSide.Maker,
TransferType.Fee,
),
).to.be.true();
expect(
transferFromAsync
.getCall(3)
.calledWith(
zrxTokenAddress,
takerAddress,
feeRecipient,
bigNumberMatch(takerFee),
TradeSide.Taker,
TransferType.Fee,
),
).to.be.true();
});
it('should call exchangeTransferSimulator.transferFrom with correct values for an open order', async () => {
const makerFee = new BigNumber(2);
const takerFee = new BigNumber(2);
const signedOrder = await fillScenarios.createFillableSignedOrderWithFeesAsync(
makerTokenAddress,
takerTokenAddress,
makerFee,
takerFee,
makerAddress,
ZeroEx.NULL_ADDRESS,
fillableAmount,
feeRecipient,
);
await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
exchangeTransferSimulator,
signedOrder,
fillableAmount,
takerAddress,
zrxTokenAddress,
);
expect(transferFromAsync.callCount).to.be.equal(4);
expect(
transferFromAsync
.getCall(0)
.calledWith(
makerTokenAddress,
makerAddress,
takerAddress,
bigNumberMatch(fillableAmount),
TradeSide.Maker,
TransferType.Trade,
),
).to.be.true();
expect(
transferFromAsync
.getCall(1)
.calledWith(
takerTokenAddress,
takerAddress,
makerAddress,
bigNumberMatch(fillableAmount),
TradeSide.Taker,
TransferType.Trade,
),
).to.be.true();
expect(
transferFromAsync
.getCall(2)
.calledWith(
zrxTokenAddress,
makerAddress,
feeRecipient,
bigNumberMatch(makerFee),
TradeSide.Maker,
TransferType.Fee,
),
).to.be.true();
expect(
transferFromAsync
.getCall(3)
.calledWith(
zrxTokenAddress,
takerAddress,
feeRecipient,
bigNumberMatch(takerFee),
TradeSide.Taker,
TransferType.Fee,
),
).to.be.true();
});
it('should correctly round the fillMakerTokenAmount', async () => {
const makerTokenAmount = new BigNumber(3);
const takerTokenAmount = new BigNumber(1);
const signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
makerTokenAmount,
takerTokenAmount,
);
await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
exchangeTransferSimulator,
signedOrder,
takerTokenAmount,
takerAddress,
zrxTokenAddress,
);
expect(transferFromAsync.callCount).to.be.equal(4);
const makerFillAmount = transferFromAsync.getCall(0).args[3];
expect(makerFillAmount).to.be.bignumber.equal(makerTokenAmount);
});
it('should correctly round the makerFeeAmount', async () => {
const makerFee = new BigNumber(2);
const takerFee = new BigNumber(4);
const signedOrder = await fillScenarios.createFillableSignedOrderWithFeesAsync(
makerTokenAddress,
takerTokenAddress,
makerFee,
takerFee,
makerAddress,
takerAddress,
fillableAmount,
ZeroEx.NULL_ADDRESS,
);
const fillTakerTokenAmount = fillableAmount.div(2).round(0);
await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync(
exchangeTransferSimulator,
signedOrder,
fillTakerTokenAmount,
takerAddress,
zrxTokenAddress,
);
const makerPartialFee = makerFee.div(2);
const takerPartialFee = takerFee.div(2);
expect(transferFromAsync.callCount).to.be.equal(4);
const partialMakerFee = transferFromAsync.getCall(2).args[3];
expect(partialMakerFee).to.be.bignumber.equal(makerPartialFee);
const partialTakerFee = transferFromAsync.getCall(3).args[3];
expect(partialTakerFee).to.be.bignumber.equal(takerPartialFee);
});
});
});

View File

@@ -1,234 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import 'mocha';
import { ZeroEx } from '../src/0x';
import { RemainingFillableCalculator } from '../src/order_watcher/remaining_fillable_calculator';
import { ECSignature, SignedOrder } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
chaiSetup.configure();
const expect = chai.expect;
describe('RemainingFillableCalculator', () => {
let calculator: RemainingFillableCalculator;
let signedOrder: SignedOrder;
let transferrableMakerTokenAmount: BigNumber;
let transferrableMakerFeeTokenAmount: BigNumber;
let remainingMakerTokenAmount: BigNumber;
let makerAmount: BigNumber;
let takerAmount: BigNumber;
let makerFeeAmount: BigNumber;
let isMakerTokenZRX: boolean;
const makerToken: string = '0x1';
const takerToken: string = '0x2';
const decimals: number = 4;
const zero: BigNumber = new BigNumber(0);
const zeroAddress = '0x0';
const signature: ECSignature = { v: 27, r: '', s: '' };
beforeEach(async () => {
[makerAmount, takerAmount, makerFeeAmount] = [
ZeroEx.toBaseUnitAmount(new BigNumber(50), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(5), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(1), decimals),
];
[transferrableMakerTokenAmount, transferrableMakerFeeTokenAmount] = [
ZeroEx.toBaseUnitAmount(new BigNumber(50), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(5), decimals),
];
});
function buildSignedOrder(): SignedOrder {
return {
ecSignature: signature,
exchangeContractAddress: zeroAddress,
feeRecipient: zeroAddress,
maker: zeroAddress,
taker: zeroAddress,
makerFee: makerFeeAmount,
takerFee: zero,
makerTokenAmount: makerAmount,
takerTokenAmount: takerAmount,
makerTokenAddress: makerToken,
takerTokenAddress: takerToken,
salt: zero,
expirationUnixTimestampSec: zero,
};
}
describe('Maker token is NOT ZRX', () => {
before(async () => {
isMakerTokenZRX = false;
});
it('calculates the correct amount when unfilled and funds available', () => {
signedOrder = buildSignedOrder();
remainingMakerTokenAmount = signedOrder.makerTokenAmount;
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(remainingMakerTokenAmount);
});
it('calculates the correct amount when partially filled and funds available', () => {
signedOrder = buildSignedOrder();
remainingMakerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(1), decimals);
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(remainingMakerTokenAmount);
});
it('calculates the amount to be 0 when all fee funds are transferred', () => {
signedOrder = buildSignedOrder();
transferrableMakerFeeTokenAmount = zero;
remainingMakerTokenAmount = signedOrder.makerTokenAmount;
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(zero);
});
it('calculates the correct amount when balance is less than remaining fillable', () => {
signedOrder = buildSignedOrder();
const partiallyFilledAmount = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals);
remainingMakerTokenAmount = signedOrder.makerTokenAmount.minus(partiallyFilledAmount);
transferrableMakerTokenAmount = remainingMakerTokenAmount.minus(partiallyFilledAmount);
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(transferrableMakerTokenAmount);
});
describe('Order to Fee Ratio is < 1', () => {
beforeEach(async () => {
[makerAmount, takerAmount, makerFeeAmount] = [
ZeroEx.toBaseUnitAmount(new BigNumber(3), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(6), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(6), decimals),
];
});
it('calculates the correct amount when funds unavailable', () => {
signedOrder = buildSignedOrder();
remainingMakerTokenAmount = signedOrder.makerTokenAmount;
const transferredAmount = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals);
transferrableMakerTokenAmount = remainingMakerTokenAmount.minus(transferredAmount);
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(transferrableMakerTokenAmount);
});
});
describe('Ratio is not evenly divisble', () => {
beforeEach(async () => {
[makerAmount, takerAmount, makerFeeAmount] = [
ZeroEx.toBaseUnitAmount(new BigNumber(3), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(7), decimals),
ZeroEx.toBaseUnitAmount(new BigNumber(7), decimals),
];
});
it('calculates the correct amount when funds unavailable', () => {
signedOrder = buildSignedOrder();
remainingMakerTokenAmount = signedOrder.makerTokenAmount;
const transferredAmount = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals);
transferrableMakerTokenAmount = remainingMakerTokenAmount.minus(transferredAmount);
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
const calculatedFillableAmount = calculator.computeRemainingMakerFillable();
expect(calculatedFillableAmount.lessThanOrEqualTo(transferrableMakerTokenAmount)).to.be.true();
expect(calculatedFillableAmount).to.be.bignumber.greaterThan(new BigNumber(0));
const orderToFeeRatio = signedOrder.makerTokenAmount.dividedBy(signedOrder.makerFee);
const calculatedFeeAmount = calculatedFillableAmount.dividedBy(orderToFeeRatio);
expect(calculatedFeeAmount).to.be.bignumber.lessThan(transferrableMakerFeeTokenAmount);
});
});
});
describe('Maker Token is ZRX', () => {
before(async () => {
isMakerTokenZRX = true;
});
it('calculates the correct amount when unfilled and funds available', () => {
signedOrder = buildSignedOrder();
transferrableMakerTokenAmount = makerAmount.plus(makerFeeAmount);
transferrableMakerFeeTokenAmount = transferrableMakerTokenAmount;
remainingMakerTokenAmount = signedOrder.makerTokenAmount;
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(remainingMakerTokenAmount);
});
it('calculates the correct amount when partially filled and funds available', () => {
signedOrder = buildSignedOrder();
remainingMakerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(1), decimals);
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(remainingMakerTokenAmount);
});
it('calculates the amount to be 0 when all fee funds are transferred', () => {
signedOrder = buildSignedOrder();
transferrableMakerTokenAmount = zero;
transferrableMakerFeeTokenAmount = zero;
remainingMakerTokenAmount = signedOrder.makerTokenAmount;
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
expect(calculator.computeRemainingMakerFillable()).to.be.bignumber.equal(zero);
});
it('calculates the correct amount when balance is less than remaining fillable', () => {
signedOrder = buildSignedOrder();
const partiallyFilledAmount = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals);
remainingMakerTokenAmount = signedOrder.makerTokenAmount.minus(partiallyFilledAmount);
transferrableMakerTokenAmount = remainingMakerTokenAmount.minus(partiallyFilledAmount);
transferrableMakerFeeTokenAmount = transferrableMakerTokenAmount;
const orderToFeeRatio = signedOrder.makerTokenAmount.dividedToIntegerBy(signedOrder.makerFee);
const expectedFillableAmount = new BigNumber(450980);
calculator = new RemainingFillableCalculator(
signedOrder,
isMakerTokenZRX,
transferrableMakerTokenAmount,
transferrableMakerFeeTokenAmount,
remainingMakerTokenAmount,
);
const calculatedFillableAmount = calculator.computeRemainingMakerFillable();
const numberOfFillsInRatio = calculatedFillableAmount.dividedToIntegerBy(orderToFeeRatio);
const calculatedFillableAmountPlusFees = calculatedFillableAmount.plus(numberOfFillsInRatio);
expect(calculatedFillableAmountPlusFees).to.be.bignumber.lessThan(transferrableMakerTokenAmount);
expect(calculatedFillableAmountPlusFees).to.be.bignumber.lessThan(remainingMakerTokenAmount);
expect(calculatedFillableAmount).to.be.bignumber.equal(expectedFillableAmount);
expect(numberOfFillsInRatio.decimalPlaces()).to.be.equal(0);
});
});
});

View File

@@ -1,85 +0,0 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import 'mocha';
import * as Sinon from 'sinon';
import * as Web3 from 'web3';
import { ApprovalContractEventArgs, DecodedLogEvent, Token, TokenEvents, ZeroEx } from '../src';
import { DoneCallback } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { assertNodeCallbackError } from './utils/report_callback_errors';
import { web3Factory } from './utils/web3_factory';
chaiSetup.configure();
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
describe('SubscriptionTest', () => {
let web3: Web3;
let zeroEx: ZeroEx;
let userAddresses: string[];
let tokens: Token[];
let coinbase: string;
let addressWithoutFunds: string;
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
before(async () => {
web3 = web3Factory.create();
zeroEx = new ZeroEx(web3.currentProvider, config);
userAddresses = await zeroEx.getAvailableAddressesAsync();
tokens = await zeroEx.tokenRegistry.getTokensAsync();
coinbase = userAddresses[0];
addressWithoutFunds = userAddresses[1];
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('#subscribe', () => {
const indexFilterValues = {};
let tokenAddress: string;
const allowanceAmount = new BigNumber(42);
let stubs: Sinon.SinonStub[] = [];
before(() => {
const token = tokens[0];
tokenAddress = token.address;
});
afterEach(() => {
zeroEx.token.unsubscribeAll();
_.each(stubs, s => s.restore());
stubs = [];
});
it('Should receive the Error when an error occurs while fetching the block', (done: DoneCallback) => {
(async () => {
const errMsg = 'Error fetching block';
const callback = assertNodeCallbackError(done, errMsg);
stubs = [Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync').throws(new Error(errMsg))];
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
await zeroEx.token.setAllowanceAsync(tokenAddress, coinbase, addressWithoutFunds, allowanceAmount);
})().catch(done);
});
it('Should receive the Error when an error occurs while reconciling the new block', (done: DoneCallback) => {
(async () => {
const errMsg = 'Error fetching logs';
const callback = assertNodeCallbackError(done, errMsg);
stubs = [Sinon.stub((zeroEx as any)._web3Wrapper, 'getLogsAsync').throws(new Error(errMsg))];
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
await zeroEx.token.setAllowanceAsync(tokenAddress, coinbase, addressWithoutFunds, allowanceAmount);
})().catch(done);
});
it('Should allow unsubscribeAll to be called successfully after an error', (done: DoneCallback) => {
(async () => {
const callback = (err: Error | null, logEvent?: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
stubs = [Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync').throws(new Error('JSON RPC error'))];
zeroEx.token.unsubscribeAll();
done();
})().catch(done);
});
});
});

View File

@@ -1,129 +0,0 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { schemas, SchemaValidator } from '@0xproject/json-schemas';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
import { Token, ZeroEx } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { web3Factory } from './utils/web3_factory';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
const TOKEN_REGISTRY_SIZE_AFTER_MIGRATION = 7;
describe('TokenRegistryWrapper', () => {
let zeroEx: ZeroEx;
let tokens: Token[];
const tokenAddressBySymbol: { [symbol: string]: string } = {};
const tokenAddressByName: { [symbol: string]: string } = {};
const tokenBySymbol: { [symbol: string]: Token } = {};
const tokenByName: { [symbol: string]: Token } = {};
const registeredSymbol = 'ZRX';
const registeredName = '0x Protocol Token';
const unregisteredSymbol = 'MAL';
const unregisteredName = 'Malicious Token';
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
before(async () => {
const web3 = web3Factory.create();
zeroEx = new ZeroEx(web3.currentProvider, config);
tokens = await zeroEx.tokenRegistry.getTokensAsync();
_.map(tokens, token => {
tokenAddressBySymbol[token.symbol] = token.address;
tokenAddressByName[token.name] = token.address;
tokenBySymbol[token.symbol] = token;
tokenByName[token.name] = token;
});
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('#getTokensAsync', () => {
it('should return all the tokens added to the tokenRegistry during the migration', async () => {
expect(tokens).to.have.lengthOf(TOKEN_REGISTRY_SIZE_AFTER_MIGRATION);
const schemaValidator = new SchemaValidator();
_.each(tokens, token => {
const validationResult = schemaValidator.validate(token, schemas.tokenSchema);
expect(validationResult.errors).to.have.lengthOf(0);
});
});
});
describe('#getTokenAddressesAsync', () => {
it('should return all the token addresses added to the tokenRegistry during the migration', async () => {
const tokenAddresses = await zeroEx.tokenRegistry.getTokenAddressesAsync();
expect(tokenAddresses).to.have.lengthOf(TOKEN_REGISTRY_SIZE_AFTER_MIGRATION);
const schemaValidator = new SchemaValidator();
_.each(tokenAddresses, tokenAddress => {
const validationResult = schemaValidator.validate(tokenAddress, schemas.addressSchema);
expect(validationResult.errors).to.have.lengthOf(0);
expect(tokenAddress).to.not.be.equal(ZeroEx.NULL_ADDRESS);
});
});
});
describe('#getTokenAddressBySymbol', () => {
it('should return correct address for a token in the registry', async () => {
const tokenAddress = await zeroEx.tokenRegistry.getTokenAddressBySymbolIfExistsAsync(registeredSymbol);
expect(tokenAddress).to.be.equal(tokenAddressBySymbol[registeredSymbol]);
});
it('should return undefined for a token out of registry', async () => {
const tokenAddress = await zeroEx.tokenRegistry.getTokenAddressBySymbolIfExistsAsync(unregisteredSymbol);
expect(tokenAddress).to.be.undefined();
});
});
describe('#getTokenAddressByName', () => {
it('should return correct address for a token in the registry', async () => {
const tokenAddress = await zeroEx.tokenRegistry.getTokenAddressByNameIfExistsAsync(registeredName);
expect(tokenAddress).to.be.equal(tokenAddressByName[registeredName]);
});
it('should return undefined for a token out of registry', async () => {
const tokenAddress = await zeroEx.tokenRegistry.getTokenAddressByNameIfExistsAsync(unregisteredName);
expect(tokenAddress).to.be.undefined();
});
});
describe('#getTokenBySymbol', () => {
it('should return correct token for a token in the registry', async () => {
const token = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(registeredSymbol);
expect(token).to.be.deep.equal(tokenBySymbol[registeredSymbol]);
});
it('should return undefined for a token out of registry', async () => {
const token = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(unregisteredSymbol);
expect(token).to.be.undefined();
});
});
describe('#getTokenByName', () => {
it('should return correct token for a token in the registry', async () => {
const token = await zeroEx.tokenRegistry.getTokenByNameIfExistsAsync(registeredName);
expect(token).to.be.deep.equal(tokenByName[registeredName]);
});
it('should return undefined for a token out of registry', async () => {
const token = await zeroEx.tokenRegistry.getTokenByNameIfExistsAsync(unregisteredName);
expect(token).to.be.undefined();
});
});
describe('#getTokenIfExistsAsync', () => {
it('should return the token added to the tokenRegistry during the migration', async () => {
const aToken = tokens[0];
const token = await zeroEx.tokenRegistry.getTokenIfExistsAsync(aToken.address);
const schemaValidator = new SchemaValidator();
const validationResult = schemaValidator.validate(token, schemas.tokenSchema);
expect(validationResult.errors).to.have.lengthOf(0);
});
it('should return return undefined when passed a token address not in the tokenRegistry', async () => {
const unregisteredTokenAddress = '0x5409ed021d9299bf6814279a6a1411a7e866a631';
const tokenIfExists = await zeroEx.tokenRegistry.getTokenIfExistsAsync(unregisteredTokenAddress);
expect(tokenIfExists).to.be.undefined();
});
});
});

View File

@@ -1,521 +0,0 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import 'mocha';
import * as Web3 from 'web3';
import {
ApprovalContractEventArgs,
BlockParamLiteral,
BlockRange,
DecodedLogEvent,
Token,
TokenEvents,
TransferContractEventArgs,
ZeroEx,
ZeroExError,
} from '../src';
import { DoneCallback } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
import { TokenUtils } from './utils/token_utils';
import { web3Factory } from './utils/web3_factory';
chaiSetup.configure();
const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
describe('TokenWrapper', () => {
let web3: Web3;
let zeroEx: ZeroEx;
let userAddresses: string[];
let tokens: Token[];
let tokenUtils: TokenUtils;
let coinbase: string;
let addressWithoutFunds: string;
let web3Wrapper: Web3Wrapper;
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
before(async () => {
web3 = web3Factory.create();
zeroEx = new ZeroEx(web3.currentProvider, config);
web3Wrapper = new Web3Wrapper(web3.currentProvider);
userAddresses = await zeroEx.getAvailableAddressesAsync();
tokens = await zeroEx.tokenRegistry.getTokensAsync();
tokenUtils = new TokenUtils(tokens);
coinbase = userAddresses[0];
addressWithoutFunds = userAddresses[1];
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
describe('#transferAsync', () => {
let token: Token;
let transferAmount: BigNumber;
before(() => {
token = tokens[0];
transferAmount = new BigNumber(42);
});
it('should successfully transfer tokens', async () => {
const fromAddress = coinbase;
const toAddress = addressWithoutFunds;
const preBalance = await zeroEx.token.getBalanceAsync(token.address, toAddress);
expect(preBalance).to.be.bignumber.equal(0);
await zeroEx.token.transferAsync(token.address, fromAddress, toAddress, transferAmount);
const postBalance = await zeroEx.token.getBalanceAsync(token.address, toAddress);
return expect(postBalance).to.be.bignumber.equal(transferAmount);
});
it('should fail to transfer tokens if fromAddress has an insufficient balance', async () => {
const fromAddress = addressWithoutFunds;
const toAddress = coinbase;
return expect(
zeroEx.token.transferAsync(token.address, fromAddress, toAddress, transferAmount),
).to.be.rejectedWith(ZeroExError.InsufficientBalanceForTransfer);
});
it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
const fromAddress = coinbase;
const toAddress = coinbase;
return expect(
zeroEx.token.transferAsync(nonExistentTokenAddress, fromAddress, toAddress, transferAmount),
).to.be.rejectedWith(ZeroExError.TokenContractDoesNotExist);
});
});
describe('#transferFromAsync', () => {
let token: Token;
let toAddress: string;
let senderAddress: string;
before(async () => {
token = tokens[0];
toAddress = addressWithoutFunds;
senderAddress = userAddresses[2];
});
it('should fail to transfer tokens if fromAddress has insufficient allowance set', async () => {
const fromAddress = coinbase;
const transferAmount = new BigNumber(42);
const fromAddressBalance = await zeroEx.token.getBalanceAsync(token.address, fromAddress);
expect(fromAddressBalance).to.be.bignumber.greaterThan(transferAmount);
const fromAddressAllowance = await zeroEx.token.getAllowanceAsync(token.address, fromAddress, toAddress);
expect(fromAddressAllowance).to.be.bignumber.equal(0);
return expect(
zeroEx.token.transferFromAsync(token.address, fromAddress, toAddress, senderAddress, transferAmount),
).to.be.rejectedWith(ZeroExError.InsufficientAllowanceForTransfer);
});
it('[regression] should fail to transfer tokens if set allowance for toAddress instead of senderAddress', async () => {
const fromAddress = coinbase;
const transferAmount = new BigNumber(42);
await zeroEx.token.setAllowanceAsync(token.address, fromAddress, toAddress, transferAmount);
return expect(
zeroEx.token.transferFromAsync(token.address, fromAddress, toAddress, senderAddress, transferAmount),
).to.be.rejectedWith(ZeroExError.InsufficientAllowanceForTransfer);
});
it('should fail to transfer tokens if fromAddress has insufficient balance', async () => {
const fromAddress = addressWithoutFunds;
const transferAmount = new BigNumber(42);
const fromAddressBalance = await zeroEx.token.getBalanceAsync(token.address, fromAddress);
expect(fromAddressBalance).to.be.bignumber.equal(0);
await zeroEx.token.setAllowanceAsync(token.address, fromAddress, senderAddress, transferAmount);
const fromAddressAllowance = await zeroEx.token.getAllowanceAsync(
token.address,
fromAddress,
senderAddress,
);
expect(fromAddressAllowance).to.be.bignumber.equal(transferAmount);
return expect(
zeroEx.token.transferFromAsync(token.address, fromAddress, toAddress, senderAddress, transferAmount),
).to.be.rejectedWith(ZeroExError.InsufficientBalanceForTransfer);
});
it('should successfully transfer tokens', async () => {
const fromAddress = coinbase;
const preBalance = await zeroEx.token.getBalanceAsync(token.address, toAddress);
expect(preBalance).to.be.bignumber.equal(0);
const transferAmount = new BigNumber(42);
await zeroEx.token.setAllowanceAsync(token.address, fromAddress, senderAddress, transferAmount);
await zeroEx.token.transferFromAsync(token.address, fromAddress, toAddress, senderAddress, transferAmount);
const postBalance = await zeroEx.token.getBalanceAsync(token.address, toAddress);
return expect(postBalance).to.be.bignumber.equal(transferAmount);
});
it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
const fromAddress = coinbase;
const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
return expect(
zeroEx.token.transferFromAsync(
nonExistentTokenAddress,
fromAddress,
toAddress,
senderAddress,
new BigNumber(42),
),
).to.be.rejectedWith(ZeroExError.TokenContractDoesNotExist);
});
});
describe('#getBalanceAsync', () => {
describe('With web3 provider with accounts', () => {
it('should return the balance for an existing ERC20 token', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const balance = await zeroEx.token.getBalanceAsync(token.address, ownerAddress);
const expectedBalance = new BigNumber('1000000000000000000000000000');
return expect(balance).to.be.bignumber.equal(expectedBalance);
});
it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => {
const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065';
const ownerAddress = coinbase;
return expect(zeroEx.token.getBalanceAsync(nonExistentTokenAddress, ownerAddress)).to.be.rejectedWith(
ZeroExError.TokenContractDoesNotExist,
);
});
it('should return a balance of 0 for a non-existent owner address', async () => {
const token = tokens[0];
const nonExistentOwner = '0x198c6ad858f213fb31b6fe809e25040e6b964593';
const balance = await zeroEx.token.getBalanceAsync(token.address, nonExistentOwner);
const expectedBalance = new BigNumber(0);
return expect(balance).to.be.bignumber.equal(expectedBalance);
});
});
describe('With web3 provider without accounts', () => {
let zeroExWithoutAccounts: ZeroEx;
before(async () => {
const hasAddresses = false;
const web3WithoutAccounts = web3Factory.create(hasAddresses);
zeroExWithoutAccounts = new ZeroEx(web3WithoutAccounts.currentProvider, config);
});
it('should return balance even when called with Web3 provider instance without addresses', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const balance = await zeroExWithoutAccounts.token.getBalanceAsync(token.address, ownerAddress);
const expectedBalance = new BigNumber('1000000000000000000000000000');
return expect(balance).to.be.bignumber.equal(expectedBalance);
});
});
});
describe('#setAllowanceAsync', () => {
it("should set the spender's allowance", async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const spenderAddress = addressWithoutFunds;
const allowanceBeforeSet = await zeroEx.token.getAllowanceAsync(
token.address,
ownerAddress,
spenderAddress,
);
const expectedAllowanceBeforeAllowanceSet = new BigNumber(0);
expect(allowanceBeforeSet).to.be.bignumber.equal(expectedAllowanceBeforeAllowanceSet);
const amountInBaseUnits = new BigNumber(50);
await zeroEx.token.setAllowanceAsync(token.address, ownerAddress, spenderAddress, amountInBaseUnits);
const allowanceAfterSet = await zeroEx.token.getAllowanceAsync(token.address, ownerAddress, spenderAddress);
const expectedAllowanceAfterAllowanceSet = amountInBaseUnits;
return expect(allowanceAfterSet).to.be.bignumber.equal(expectedAllowanceAfterAllowanceSet);
});
});
describe('#setUnlimitedAllowanceAsync', () => {
it("should set the unlimited spender's allowance", async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const spenderAddress = addressWithoutFunds;
await zeroEx.token.setUnlimitedAllowanceAsync(token.address, ownerAddress, spenderAddress);
const allowance = await zeroEx.token.getAllowanceAsync(token.address, ownerAddress, spenderAddress);
return expect(allowance).to.be.bignumber.equal(zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
it('should reduce the gas cost for transfers including tokens with unlimited allowance support', async () => {
const transferAmount = new BigNumber(5);
const zrx = tokenUtils.getProtocolTokenOrThrow();
const [, userWithNormalAllowance, userWithUnlimitedAllowance] = userAddresses;
await zeroEx.token.setAllowanceAsync(zrx.address, coinbase, userWithNormalAllowance, transferAmount);
await zeroEx.token.setUnlimitedAllowanceAsync(zrx.address, coinbase, userWithUnlimitedAllowance);
const initBalanceWithNormalAllowance = await web3Wrapper.getBalanceInWeiAsync(userWithNormalAllowance);
const initBalanceWithUnlimitedAllowance = await web3Wrapper.getBalanceInWeiAsync(
userWithUnlimitedAllowance,
);
await zeroEx.token.transferFromAsync(
zrx.address,
coinbase,
userWithNormalAllowance,
userWithNormalAllowance,
transferAmount,
);
await zeroEx.token.transferFromAsync(
zrx.address,
coinbase,
userWithUnlimitedAllowance,
userWithUnlimitedAllowance,
transferAmount,
);
const finalBalanceWithNormalAllowance = await web3Wrapper.getBalanceInWeiAsync(userWithNormalAllowance);
const finalBalanceWithUnlimitedAllowance = await web3Wrapper.getBalanceInWeiAsync(
userWithUnlimitedAllowance,
);
const normalGasCost = initBalanceWithNormalAllowance.minus(finalBalanceWithNormalAllowance);
const unlimitedGasCost = initBalanceWithUnlimitedAllowance.minus(finalBalanceWithUnlimitedAllowance);
// In theory the gas cost with unlimited allowance should be smaller, but with testrpc it's actually bigger.
// This needs to be investigated in ethereumjs-vm. This test is essentially a repro.
// TODO: Make this test pass with inverted assertion.
expect(unlimitedGasCost.toNumber()).to.be.gt(normalGasCost.toNumber());
});
});
describe('#getAllowanceAsync', () => {
describe('With web3 provider with accounts', () => {
it('should get the proxy allowance', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const spenderAddress = addressWithoutFunds;
const amountInBaseUnits = new BigNumber(50);
await zeroEx.token.setAllowanceAsync(token.address, ownerAddress, spenderAddress, amountInBaseUnits);
const allowance = await zeroEx.token.getAllowanceAsync(token.address, ownerAddress, spenderAddress);
const expectedAllowance = amountInBaseUnits;
return expect(allowance).to.be.bignumber.equal(expectedAllowance);
});
it('should return 0 if no allowance set yet', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const spenderAddress = addressWithoutFunds;
const allowance = await zeroEx.token.getAllowanceAsync(token.address, ownerAddress, spenderAddress);
const expectedAllowance = new BigNumber(0);
return expect(allowance).to.be.bignumber.equal(expectedAllowance);
});
});
describe('With web3 provider without accounts', () => {
let zeroExWithoutAccounts: ZeroEx;
before(async () => {
const hasAddresses = false;
const web3WithoutAccounts = web3Factory.create(hasAddresses);
zeroExWithoutAccounts = new ZeroEx(web3WithoutAccounts.currentProvider, config);
});
it('should get the proxy allowance', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const spenderAddress = addressWithoutFunds;
const amountInBaseUnits = new BigNumber(50);
await zeroEx.token.setAllowanceAsync(token.address, ownerAddress, spenderAddress, amountInBaseUnits);
const allowance = await zeroExWithoutAccounts.token.getAllowanceAsync(
token.address,
ownerAddress,
spenderAddress,
);
const expectedAllowance = amountInBaseUnits;
return expect(allowance).to.be.bignumber.equal(expectedAllowance);
});
});
});
describe('#getProxyAllowanceAsync', () => {
it('should get the proxy allowance', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const amountInBaseUnits = new BigNumber(50);
await zeroEx.token.setProxyAllowanceAsync(token.address, ownerAddress, amountInBaseUnits);
const allowance = await zeroEx.token.getProxyAllowanceAsync(token.address, ownerAddress);
const expectedAllowance = amountInBaseUnits;
return expect(allowance).to.be.bignumber.equal(expectedAllowance);
});
});
describe('#setProxyAllowanceAsync', () => {
it('should set the proxy allowance', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
const allowanceBeforeSet = await zeroEx.token.getProxyAllowanceAsync(token.address, ownerAddress);
const expectedAllowanceBeforeAllowanceSet = new BigNumber(0);
expect(allowanceBeforeSet).to.be.bignumber.equal(expectedAllowanceBeforeAllowanceSet);
const amountInBaseUnits = new BigNumber(50);
await zeroEx.token.setProxyAllowanceAsync(token.address, ownerAddress, amountInBaseUnits);
const allowanceAfterSet = await zeroEx.token.getProxyAllowanceAsync(token.address, ownerAddress);
const expectedAllowanceAfterAllowanceSet = amountInBaseUnits;
return expect(allowanceAfterSet).to.be.bignumber.equal(expectedAllowanceAfterAllowanceSet);
});
});
describe('#setUnlimitedProxyAllowanceAsync', () => {
it('should set the unlimited proxy allowance', async () => {
const token = tokens[0];
const ownerAddress = coinbase;
await zeroEx.token.setUnlimitedProxyAllowanceAsync(token.address, ownerAddress);
const allowance = await zeroEx.token.getProxyAllowanceAsync(token.address, ownerAddress);
return expect(allowance).to.be.bignumber.equal(zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
});
describe('#subscribe', () => {
const indexFilterValues = {};
let tokenAddress: string;
const transferAmount = new BigNumber(42);
const allowanceAmount = new BigNumber(42);
before(() => {
const token = tokens[0];
tokenAddress = token.address;
});
afterEach(() => {
zeroEx.token.unsubscribeAll();
});
// Hack: Mocha does not allow a test to be both async and have a `done` callback
// Since we need to await the receipt of the event in the `subscribe` callback,
// we do need both. A hack is to make the top-level a sync fn w/ a done callback and then
// wrap the rest of the test in an async block
// Source: https://github.com/mochajs/mocha/issues/2407
it('Should receive the Transfer event when tokens are transfered', (done: DoneCallback) => {
(async () => {
const callback = reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<TransferContractEventArgs>) => {
expect(logEvent.isRemoved).to.be.false();
expect(logEvent.log.logIndex).to.be.equal(0);
expect(logEvent.log.transactionIndex).to.be.equal(0);
expect(logEvent.log.blockNumber).to.be.a('number');
const args = logEvent.log.args;
expect(args._from).to.be.equal(coinbase);
expect(args._to).to.be.equal(addressWithoutFunds);
expect(args._value).to.be.bignumber.equal(transferAmount);
},
);
zeroEx.token.subscribe(tokenAddress, TokenEvents.Transfer, indexFilterValues, callback);
await zeroEx.token.transferAsync(tokenAddress, coinbase, addressWithoutFunds, transferAmount);
})().catch(done);
});
it('Should receive the Approval event when allowance is being set', (done: DoneCallback) => {
(async () => {
const callback = reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => {
expect(logEvent).to.not.be.undefined();
expect(logEvent.isRemoved).to.be.false();
const args = logEvent.log.args;
expect(args._owner).to.be.equal(coinbase);
expect(args._spender).to.be.equal(addressWithoutFunds);
expect(args._value).to.be.bignumber.equal(allowanceAmount);
},
);
zeroEx.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
await zeroEx.token.setAllowanceAsync(tokenAddress, coinbase, addressWithoutFunds, allowanceAmount);
})().catch(done);
});
it('Outstanding subscriptions are cancelled when zeroEx.setProvider called', (done: DoneCallback) => {
(async () => {
const callbackNeverToBeCalled = reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => {
done(new Error('Expected this subscription to have been cancelled'));
},
);
zeroEx.token.subscribe(tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackNeverToBeCalled);
const callbackToBeCalled = reportNodeCallbackErrors(done)();
const newProvider = web3Factory.getRpcProvider();
zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
zeroEx.token.subscribe(tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackToBeCalled);
await zeroEx.token.transferAsync(tokenAddress, coinbase, addressWithoutFunds, transferAmount);
})().catch(done);
});
it('Should cancel subscription when unsubscribe called', (done: DoneCallback) => {
(async () => {
const callbackNeverToBeCalled = reportNodeCallbackErrors(done)(
(logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => {
done(new Error('Expected this subscription to have been cancelled'));
},
);
const subscriptionToken = zeroEx.token.subscribe(
tokenAddress,
TokenEvents.Transfer,
indexFilterValues,
callbackNeverToBeCalled,
);
zeroEx.token.unsubscribe(subscriptionToken);
await zeroEx.token.transferAsync(tokenAddress, coinbase, addressWithoutFunds, transferAmount);
done();
})().catch(done);
});
});
describe('#getLogsAsync', () => {
let tokenAddress: string;
let tokenTransferProxyAddress: string;
const blockRange: BlockRange = {
fromBlock: 0,
toBlock: BlockParamLiteral.Latest,
};
let txHash: string;
before(() => {
const token = tokens[0];
tokenAddress = token.address;
tokenTransferProxyAddress = zeroEx.proxy.getContractAddress();
});
it('should get logs with decoded args emitted by Approval', async () => {
txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(tokenAddress, coinbase);
await zeroEx.awaitTransactionMinedAsync(txHash);
const eventName = TokenEvents.Approval;
const indexFilterValues = {};
const logs = await zeroEx.token.getLogsAsync<ApprovalContractEventArgs>(
tokenAddress,
eventName,
blockRange,
indexFilterValues,
);
expect(logs).to.have.length(1);
const args = logs[0].args;
expect(logs[0].event).to.be.equal(eventName);
expect(args._owner).to.be.equal(coinbase);
expect(args._spender).to.be.equal(tokenTransferProxyAddress);
expect(args._value).to.be.bignumber.equal(zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS);
});
it('should only get the logs with the correct event name', async () => {
txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(tokenAddress, coinbase);
await zeroEx.awaitTransactionMinedAsync(txHash);
const differentEventName = TokenEvents.Transfer;
const indexFilterValues = {};
const logs = await zeroEx.token.getLogsAsync(
tokenAddress,
differentEventName,
blockRange,
indexFilterValues,
);
expect(logs).to.have.length(0);
});
it('should only get the logs with the correct indexed fields', async () => {
txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(tokenAddress, coinbase);
await zeroEx.awaitTransactionMinedAsync(txHash);
txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(tokenAddress, addressWithoutFunds);
await zeroEx.awaitTransactionMinedAsync(txHash);
const eventName = TokenEvents.Approval;
const indexFilterValues = {
_owner: coinbase,
};
const logs = await zeroEx.token.getLogsAsync<ApprovalContractEventArgs>(
tokenAddress,
eventName,
blockRange,
indexFilterValues,
);
expect(logs).to.have.length(1);
const args = logs[0].args;
expect(args._owner).to.be.equal(coinbase);
});
});
});
// tslint:disable:max-file-line-count

View File

@@ -4,7 +4,7 @@ import ChaiBigNumber = require('chai-bignumber');
import * as dirtyChai from 'dirty-chai';
export const chaiSetup = {
configure() {
configure(): void {
chai.config.includeStack = true;
chai.use(ChaiBigNumber());
chai.use(dirtyChai);

View File

@@ -1,11 +1,9 @@
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
RPC_URL: 'http://localhost:8545',
ROPSTEN_NETWORK_ID: 3,
KOVAN_NETWORK_ID: 42,
TESTRPC_NETWORK_ID: 50,
KOVAN_RPC_URL: 'https://kovan.infura.io/',
ROPSTEN_RPC_URL: 'https://ropsten.infura.io/',
ZRX_DECIMALS: 18,
GAS_ESTIMATE: 500000,
};

View File

@@ -1,202 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { SignedOrder, Token, ZeroEx } from '../../src';
import { artifacts } from '../../src/artifacts';
import { DummyTokenContract } from '../../src/contract_wrappers/generated/dummy_token';
import { orderFactory } from '../utils/order_factory';
import { constants } from './constants';
const INITIAL_COINBASE_TOKEN_SUPPLY_IN_UNITS = new BigNumber(100);
export class FillScenarios {
private _zeroEx: ZeroEx;
private _userAddresses: string[];
private _tokens: Token[];
private _coinbase: string;
private _zrxTokenAddress: string;
private _exchangeContractAddress: string;
constructor(
zeroEx: ZeroEx,
userAddresses: string[],
tokens: Token[],
zrxTokenAddress: string,
exchangeContractAddress: string,
) {
this._zeroEx = zeroEx;
this._userAddresses = userAddresses;
this._tokens = tokens;
this._coinbase = userAddresses[0];
this._zrxTokenAddress = zrxTokenAddress;
this._exchangeContractAddress = exchangeContractAddress;
}
public async initTokenBalancesAsync() {
const web3Wrapper = (this._zeroEx as any)._web3Wrapper as Web3Wrapper;
for (const token of this._tokens) {
if (token.symbol !== 'ZRX' && token.symbol !== 'WETH') {
const contractInstance = web3Wrapper.getContractInstance(
artifacts.DummyTokenArtifact.abi,
token.address,
);
const defaults = {};
const dummyToken = new DummyTokenContract(contractInstance, defaults);
const tokenSupply = ZeroEx.toBaseUnitAmount(INITIAL_COINBASE_TOKEN_SUPPLY_IN_UNITS, token.decimals);
const txHash = await dummyToken.setBalance.sendTransactionAsync(this._coinbase, tokenSupply, {
from: this._coinbase,
});
await this._zeroEx.awaitTransactionMinedAsync(txHash);
}
}
}
public async createFillableSignedOrderAsync(
makerTokenAddress: string,
takerTokenAddress: string,
makerAddress: string,
takerAddress: string,
fillableAmount: BigNumber,
expirationUnixTimestampSec?: BigNumber,
): Promise<SignedOrder> {
return this.createAsymmetricFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
fillableAmount,
expirationUnixTimestampSec,
);
}
public async createFillableSignedOrderWithFeesAsync(
makerTokenAddress: string,
takerTokenAddress: string,
makerFee: BigNumber,
takerFee: BigNumber,
makerAddress: string,
takerAddress: string,
fillableAmount: BigNumber,
feeRecepient: string,
expirationUnixTimestampSec?: BigNumber,
): Promise<SignedOrder> {
return this._createAsymmetricFillableSignedOrderWithFeesAsync(
makerTokenAddress,
takerTokenAddress,
makerFee,
takerFee,
makerAddress,
takerAddress,
fillableAmount,
fillableAmount,
feeRecepient,
expirationUnixTimestampSec,
);
}
public async createAsymmetricFillableSignedOrderAsync(
makerTokenAddress: string,
takerTokenAddress: string,
makerAddress: string,
takerAddress: string,
makerFillableAmount: BigNumber,
takerFillableAmount: BigNumber,
expirationUnixTimestampSec?: BigNumber,
): Promise<SignedOrder> {
const makerFee = new BigNumber(0);
const takerFee = new BigNumber(0);
const feeRecepient = constants.NULL_ADDRESS;
return this._createAsymmetricFillableSignedOrderWithFeesAsync(
makerTokenAddress,
takerTokenAddress,
makerFee,
takerFee,
makerAddress,
takerAddress,
makerFillableAmount,
takerFillableAmount,
feeRecepient,
expirationUnixTimestampSec,
);
}
public async createPartiallyFilledSignedOrderAsync(
makerTokenAddress: string,
takerTokenAddress: string,
takerAddress: string,
fillableAmount: BigNumber,
partialFillAmount: BigNumber,
) {
const [makerAddress] = this._userAddresses;
const signedOrder = await this.createAsymmetricFillableSignedOrderAsync(
makerTokenAddress,
takerTokenAddress,
makerAddress,
takerAddress,
fillableAmount,
fillableAmount,
);
const shouldThrowOnInsufficientBalanceOrAllowance = false;
await this._zeroEx.exchange.fillOrderAsync(
signedOrder,
partialFillAmount,
shouldThrowOnInsufficientBalanceOrAllowance,
takerAddress,
);
return signedOrder;
}
private async _createAsymmetricFillableSignedOrderWithFeesAsync(
makerTokenAddress: string,
takerTokenAddress: string,
makerFee: BigNumber,
takerFee: BigNumber,
makerAddress: string,
takerAddress: string,
makerFillableAmount: BigNumber,
takerFillableAmount: BigNumber,
feeRecepient: string,
expirationUnixTimestampSec?: BigNumber,
): Promise<SignedOrder> {
await Promise.all([
this._increaseBalanceAndAllowanceAsync(makerTokenAddress, makerAddress, makerFillableAmount),
this._increaseBalanceAndAllowanceAsync(takerTokenAddress, takerAddress, takerFillableAmount),
]);
await Promise.all([
this._increaseBalanceAndAllowanceAsync(this._zrxTokenAddress, makerAddress, makerFee),
this._increaseBalanceAndAllowanceAsync(this._zrxTokenAddress, takerAddress, takerFee),
]);
const signedOrder = await orderFactory.createSignedOrderAsync(
this._zeroEx,
makerAddress,
takerAddress,
makerFee,
takerFee,
makerFillableAmount,
makerTokenAddress,
takerFillableAmount,
takerTokenAddress,
this._exchangeContractAddress,
feeRecepient,
expirationUnixTimestampSec,
);
return signedOrder;
}
private async _increaseBalanceAndAllowanceAsync(
tokenAddress: string,
address: string,
amount: BigNumber,
): Promise<void> {
if (amount.isZero() || address === ZeroEx.NULL_ADDRESS) {
return; // noop
}
await Promise.all([
this._increaseBalanceAsync(tokenAddress, address, amount),
this._increaseAllowanceAsync(tokenAddress, address, amount),
]);
}
private async _increaseBalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
await this._zeroEx.token.transferAsync(tokenAddress, this._coinbase, address, amount);
}
private async _increaseAllowanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
const oldMakerAllowance = await this._zeroEx.token.getProxyAllowanceAsync(tokenAddress, address);
const newMakerAllowance = oldMakerAllowance.plus(amount);
await this._zeroEx.token.setProxyAllowanceAsync(tokenAddress, address, newMakerAllowance);
}
}

View File

@@ -1,44 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { SignedOrder, ZeroEx } from '../../src';
export const orderFactory = {
async createSignedOrderAsync(
zeroEx: ZeroEx,
maker: string,
taker: string,
makerFee: BigNumber,
takerFee: BigNumber,
makerTokenAmount: BigNumber,
makerTokenAddress: string,
takerTokenAmount: BigNumber,
takerTokenAddress: string,
exchangeContractAddress: string,
feeRecipient: string,
expirationUnixTimestampSecIfExists?: BigNumber,
): Promise<SignedOrder> {
const defaultExpirationUnixTimestampSec = new BigNumber(2524604400); // Close to infinite
const expirationUnixTimestampSec = _.isUndefined(expirationUnixTimestampSecIfExists)
? defaultExpirationUnixTimestampSec
: expirationUnixTimestampSecIfExists;
const order = {
maker,
taker,
makerFee,
takerFee,
makerTokenAmount,
takerTokenAmount,
makerTokenAddress,
takerTokenAddress,
salt: ZeroEx.generatePseudoRandomSalt(),
exchangeContractAddress,
feeRecipient,
expirationUnixTimestampSec,
};
const orderHash = ZeroEx.getOrderHashHex(order);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker);
const signedOrder: SignedOrder = _.assign(order, { ecSignature });
return signedOrder;
},
};

View File

@@ -1,66 +0,0 @@
import * as chai from 'chai';
import * as _ from 'lodash';
import { DoneCallback } from '../../src/types';
const expect = chai.expect;
export const reportNoErrorCallbackErrors = (done: DoneCallback, expectToBeCalledOnce = true) => {
return <T>(f?: (value: T) => void) => {
const wrapped = (value: T) => {
if (_.isUndefined(f)) {
done();
return;
}
try {
f(value);
if (expectToBeCalledOnce) {
done();
}
} catch (err) {
done(err);
}
};
return wrapped;
};
};
export const reportNodeCallbackErrors = (done: DoneCallback, expectToBeCalledOnce = true) => {
return <T>(f?: (value: T) => void) => {
const wrapped = (error: Error | null, value: T | undefined) => {
if (!_.isNull(error)) {
done(error);
} else {
if (_.isUndefined(f)) {
done();
return;
}
try {
f(value as T);
if (expectToBeCalledOnce) {
done();
}
} catch (err) {
done(err);
}
}
};
return wrapped;
};
};
export const assertNodeCallbackError = (done: DoneCallback, errMsg: string) => {
const wrapped = <T>(error: Error | null, value: T | undefined) => {
if (_.isNull(error)) {
done(new Error('Expected callback to receive an error'));
} else {
try {
expect(error.message).to.be.equal(errMsg);
done();
} catch (err) {
done(err);
}
}
};
return wrapped;
};

View File

@@ -1,27 +0,0 @@
import { JSONRPCPayload } from '../../../src/types';
/*
* This class implements the web3-provider-engine subprovider interface and returns
* that the provider has no addresses when queried.
* Source: https://github.com/MetaMask/provider-engine/blob/master/subproviders/subprovider.js
*/
export class EmptyWalletSubprovider {
// This method needs to be here to satisfy the interface but linter wants it to be static.
// tslint:disable-next-line:prefer-function-over-method
public handleRequest(payload: JSONRPCPayload, next: () => void, end: (err: Error | null, result: any) => void) {
switch (payload.method) {
case 'eth_accounts':
end(null, []);
return;
default:
next();
return;
}
}
// Required to implement this method despite not needing it for this subprovider
// tslint:disable-next-line:prefer-function-over-method
public setEngine(engine: any) {
// noop
}
}

View File

@@ -1,34 +0,0 @@
import { JSONRPCPayload } from '../../../src/types';
/*
* This class implements the web3-provider-engine subprovider interface and returns
* the constant gas estimate when queried.
* HACK: We need this so that our tests don't use testrpc gas estimation which sometimes kills the node.
* Source: https://github.com/trufflesuite/ganache-cli/issues/417
* Source: https://github.com/trufflesuite/ganache-cli/issues/437
* Source: https://github.com/MetaMask/provider-engine/blob/master/subproviders/subprovider.js
*/
export class FakeGasEstimateSubprovider {
private _constantGasAmount: number;
constructor(constantGasAmount: number) {
this._constantGasAmount = constantGasAmount;
}
// This method needs to be here to satisfy the interface but linter wants it to be static.
// tslint:disable-next-line:prefer-function-over-method
public handleRequest(payload: JSONRPCPayload, next: () => void, end: (err: Error | null, result: any) => void) {
switch (payload.method) {
case 'eth_estimateGas':
end(null, this._constantGasAmount);
return;
default:
next();
return;
}
}
// Required to implement this method despite not needing it for this subprovider
// tslint:disable-next-line:prefer-function-over-method
public setEngine(engine: any) {
// noop
}
}

View File

@@ -1,33 +1,9 @@
import * as _ from 'lodash';
import { artifacts } from '../../src/artifacts';
import { InternalZeroExError, Token } from '../../src/types';
import { constants } from './constants';
const PROTOCOL_TOKEN_SYMBOL = 'ZRX';
const WETH_TOKEN_SYMBOL = 'WETH';
export class TokenUtils {
private _tokens: Token[];
constructor(tokens: Token[]) {
this._tokens = tokens;
}
public getProtocolTokenOrThrow(): Token {
const zrxToken = _.find(this._tokens, { symbol: PROTOCOL_TOKEN_SYMBOL });
if (_.isUndefined(zrxToken)) {
throw new Error(InternalZeroExError.ZrxNotInTokenRegistry);
}
return zrxToken;
}
public getWethTokenOrThrow(): Token {
const wethToken = _.find(this._tokens, { symbol: WETH_TOKEN_SYMBOL });
if (_.isUndefined(wethToken)) {
throw new Error(InternalZeroExError.WethNotInTokenRegistry);
}
return wethToken;
}
public getDummyTokens(): Token[] {
const dummyTokens = _.filter(this._tokens, token => {
return !_.includes([PROTOCOL_TOKEN_SYMBOL, WETH_TOKEN_SYMBOL], token.symbol);
});
return dummyTokens;
}
}
export const tokenUtils = {
getProtocolTokenAddress(): string {
return artifacts.ZRXToken.networks[constants.TESTRPC_NETWORK_ID].address;
},
};

View File

@@ -1,42 +0,0 @@
// HACK: web3 injects XMLHttpRequest into the global scope and ProviderEngine checks XMLHttpRequest
// to know whether it is running in a browser or node environment. We need it to be undefined since
// we are not running in a browser env.
// Filed issue: https://github.com/ethereum/web3.js/issues/844
(global as any).XMLHttpRequest = undefined;
import ProviderEngine = require('web3-provider-engine');
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
import { EmptyWalletSubprovider } from './subproviders/empty_wallet_subprovider';
import { FakeGasEstimateSubprovider } from './subproviders/fake_gas_estimate_subprovider';
import { constants } from './constants';
// HACK: web3 leaks XMLHttpRequest into the global scope and causes requests to hang
// because they are using the wrong XHR package.
// importing web3 after subproviders fixes this issue
// Filed issue: https://github.com/ethereum/web3.js/issues/844
// tslint:disable-next-line:ordered-imports
import * as Web3 from 'web3';
export const web3Factory = {
create(hasAddresses: boolean = true): Web3 {
const provider = this.getRpcProvider(hasAddresses);
const web3 = new Web3();
web3.setProvider(provider);
return web3;
},
getRpcProvider(hasAddresses: boolean = true): Web3.Provider {
const provider = new ProviderEngine();
if (!hasAddresses) {
provider.addProvider(new EmptyWalletSubprovider());
}
provider.addProvider(new FakeGasEstimateSubprovider(constants.GAS_ESTIMATE));
provider.addProvider(
new RpcSubprovider({
rpcUrl: constants.RPC_URL,
}),
);
provider.start();
return provider;
},
};

View File

@@ -0,0 +1,12 @@
import { devConstants, web3Factory } from '@0xproject/dev-utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider } from 'ethereum-types';
const txDefaults = {
from: devConstants.TESTRPC_FIRST_ADDRESS,
gas: devConstants.GAS_LIMIT,
};
const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true });
const web3Wrapper = new Web3Wrapper(provider);
export { provider, web3Wrapper, txDefaults };

View File

@@ -1,16 +1,7 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
"noImplicitThis": false
"outDir": "lib"
},
"include": [
"./src/**/*",
"./test/**/*",
"../../node_modules/types-bn/index.d.ts",
"../../node_modules/types-ethereumjs-util/index.d.ts",
"../../node_modules/web3-typescript-typings/index.d.ts",
"../../node_modules/chai-typescript-typings/index.d.ts",
"../../node_modules/chai-as-promised-typescript-typings/index.d.ts"
]
"include": ["./src/**/*", "./test/**/*"]
}

View File

@@ -0,0 +1,6 @@
.*
yarn-error.log
/src/
/scripts/
tsconfig.json
/lib/monorepo_scripts/

View File

@@ -0,0 +1,183 @@
[
{
"version": "0.4.0",
"changes": [
{
"note": "Convert e_r_c to erc in generated file names",
"pr": 822
},
{
"note": "Remove the output directory before writing to it",
"pr": 822
},
{
"note": "skip generation of wrappers that are already up to date",
"pr": 788
}
]
},
{
"timestamp": 1531149657,
"version": "0.3.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.3.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.3.1",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"version": "0.3.0",
"changes": [
{
"note": "Properly export the executable binary",
"pr": 588
}
],
"timestamp": 1527008270
},
{
"timestamp": 1525477860,
"version": "0.2.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1525428773,
"version": "0.2.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1524044013,
"version": "0.2.11",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1523462196,
"version": "0.2.10",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1522673609,
"version": "0.2.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1522658513,
"version": "0.2.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.2.5",
"changes": [
{
"note": "Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package",
"pr": 452
}
],
"timestamp": 1521298800
},
{
"version": "0.2.4",
"changes": [
{
"note":
"Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`",
"pr": 413
},
{
"note":
"Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)",
"pr": 413
},
{
"note": "Add `hasReturnValue` to context data",
"pr": 413
}
],
"timestamp": 1520089200
},
{
"version": "0.2.1",
"changes": [
{
"note": "Fix publishing issue where .npmignore was not properly excluding undesired content",
"pr": 389
}
],
"timestamp": 1518102000
},
{
"version": "0.2.0",
"changes": [
{
"note": "Added CLI options for explicit specifying location of partials and main template",
"pr": 346
},
{
"note":
"Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts",
"pr": 388
}
],
"timestamp": 1517929200
},
{
"version": "0.1.0",
"changes": [
{
"note": "Fixed array typings with union types",
"pr": 295
},
{
"note": "Add event ABIs to context data passed to templates",
"pr": 302
},
{
"note": "Add constructor ABIs to context data passed to templates",
"pr": 304
}
],
"timestamp": 1515596400
}
]

View File

@@ -1,7 +1,71 @@
# CHANGELOG
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
## v0.1.0 - _January 11, 2018_
CHANGELOG
* Fixed array typings with union types (#295)
* Add event ABIs to context data passed to templates (#302)
* Add constructor ABIs to context data passed to templates (#304)
## v0.3.3 - _July 9, 2018_
* Dependencies updated
## v0.3.2 - _June 19, 2018_
* Dependencies updated
## v0.3.1 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.3.0 - _May 22, 2018_
* Properly export the executable binary (#588)
## v0.2.13 - _May 5, 2018_
* Dependencies updated
## v0.2.12 - _May 4, 2018_
* Dependencies updated
## v0.2.11 - _April 18, 2018_
* Dependencies updated
## v0.2.10 - _April 11, 2018_
* Dependencies updated
## v0.2.9 - _April 2, 2018_
* Dependencies updated
## v0.2.8 - _April 2, 2018_
* Dependencies updated
## v0.2.5 - _March 17, 2018_
* Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package (#452)
## v0.2.4 - _March 3, 2018_
* Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3` (#413)
* Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types) (#413)
* Add `hasReturnValue` to context data (#413)
## v0.2.1 - _February 8, 2018_
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
## v0.2.0 - _February 6, 2018_
* Added CLI options for explicit specifying location of partials and main template (#346)
* Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts (#388)
## v0.1.0 - _January 10, 2018_
* Fixed array typings with union types (#295)
* Add event ABIs to context data passed to templates (#302)
* Add constructor ABIs to context data passed to templates (#304)

View File

@@ -4,8 +4,7 @@ This package allows you to generate TypeScript contract wrappers from ABI files.
It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) but takes a different approach.
You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.
For an example of the generated [wrapper files](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/src/contract_wrappers/generated) check out 0x.js.
[Here](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates) are the templates used to generate those files.
[Here](https://github.com/0xProject/0x-monorepo/tree/development/packages/0x.js/contract_templates) are the templates used to generate the contract wrappers used by 0x.js.e
## Installation
@@ -16,35 +15,90 @@ For an example of the generated [wrapper files](https://github.com/0xProject/0x.
```
abi-gen
Options:
--help Show help [boolean]
--version Show version number [boolean]
--abiGlob Glob pattern to search for ABI JSON files [string] [required]
--templates Folder where to search for templates [string] [required]
--output Folder where to put the output files [string] [required]
--help Show help [boolean]
--version Show version number [boolean]
--abis Glob pattern to search for ABI JSON files
[string] [required]
--output, -o, --out Folder where to put the output files [string] [required]
--partials Glob pattern for the partial template files [string]
--template Path for the main template file that will be used to
generate each contract [string] [required]
--backend The backing Ethereum library your app uses. Either 'web3'
or 'ethers'. Ethers auto-converts small ints to numbers
whereas Web3 doesn't.
[string] [choices: "web3", "ethers"] [default: "web3"]
--network-id ID of the network where contract ABIs are nested in
artifacts [number] [default: 50]
```
## ABI files
You're required to pass a [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) template where your abi files are located.
TL;DR - here is the example from 0x.js.
`--abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json`
`--abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json`
We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude some of the abi files.
We could've just used `--abis 'src/artifacts/*.json` but we wanted to exclude some of the abi files.
The abi file should be either a [Truffle](http://truffleframework.com/) contract artifact (a JSON object with an abi key) or a JSON abi array.
You need to also specify the location of your main template used for every contract `--template` as well as the partial templates `--partials` that can later be used from the main one.
## How to write custom templates?
The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates) and start adjusting them for your needs.
The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x-monorepo/tree/development/packages/contract_templates) and start adjusting them for your needs.
We use [handlebars](http://handlebarsjs.com/) template engine under the hood.
You need to have a master template called `contract.mustache`. it will be used to generate each contract wrapper. Although - you don't need and probably shouldn't write all your logic in a single template file. You can write [partial templates](http://handlebarsjs.com/partials.html) and as long as they are within a partials folder - they will be registered and available.
## Which data/context do I get in my templates?
For now you don't get much on top of methods abi, some useful helpers and a contract name because it was enough for our use-case, but if you need something else - create a PR.
See the [type definition](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen/src/types.ts) of what we pass to the render method.
See the [type definition](https://github.com/0xProject/0x-monorepo/tree/development/packages/abi-gen/src/types.ts) of what we pass to the render method.
## Output files
Output files will be generated within an output folder with names converted to camel case and taken from abi file names. If you already have some files in that folder they will be overwritten.
## Contributing
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Then install dependencies
```bash
yarn install
```
### Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
PKG=@0xproject/abi-gen yarn build
```
Or continuously rebuild on change:
```bash
PKG=@0xproject/abi-gen yarn watch
```
### Clean
```bash
yarn clean
```
### Lint
```bash
yarn lint
```

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/src/index.js')

View File

View File

@@ -1,48 +1,72 @@
{
"name": "@0xproject/abi-gen",
"version": "0.1.3",
"version": "0.3.3",
"engines": {
"node": ">=6.12"
},
"description": "Generate contract wrappers from ABI and handlebars templates",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"lint": "tslint --project . 'src/**/*.ts'",
"clean": "shx rm -rf lib",
"build": "tsc"
"watch_without_deps": "tsc -w",
"lint": "tslint --project .",
"clean": "shx rm -rf lib scripts",
"build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts",
"test": "yarn run_mocha",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
"test:circleci": "yarn test:coverage",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"bin": {
"abi-gen": "lib/index.js"
"abi-gen": "bin/abi-gen.js"
},
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x.js.git"
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/0xProject/0x.js/issues"
"url": "https://github.com/0xProject/0x-monorepo/issues"
},
"homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md",
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
"@0xproject/utils": "^0.2.1",
"@0xproject/typescript-typings": "^0.4.2",
"@0xproject/utils": "^0.7.2",
"ethereum-types": "^0.0.2",
"chalk": "^2.3.0",
"ethereum-types": "^0.0.2",
"glob": "^7.1.2",
"handlebars": "^4.0.11",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"sleep": "^5.1.1",
"tmp": "^0.0.33",
"to-snake-case": "^1.0.0",
"web3": "^0.20.0",
"yargs": "^10.0.3"
},
"devDependencies": {
"@0xproject/tslint-config": "^0.4.3",
"@types/glob": "^5.0.33",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/glob": "5.0.35",
"@types/handlebars": "^4.0.36",
"@types/mkdirp": "^0.5.1",
"@types/node": "^8.0.53",
"@types/sleep": "^0.0.7",
"@types/tmp": "^0.0.33",
"@types/yargs": "^10.0.0",
"chai": "^4.1.2",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^5.2.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.5"
"tslint": "5.11.0",
"typescript": "2.7.1"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -1,15 +0,0 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -1,4 +1,6 @@
declare function toSnakeCase(str: string): string;
declare module 'to-snake-case' {
export = toSnakeCase;
declare module '*.json' {
const json: any;
/* tslint:disable */
export default json;
/* tslint:enable */
}

View File

@@ -1,103 +1,144 @@
#!/usr/bin/env node
import { abiUtils, logUtils } from '@0xproject/utils';
import chalk from 'chalk';
import * as fs from 'fs';
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from 'ethereum-types';
import { sync as globSync } from 'glob';
import * as Handlebars from 'handlebars';
import * as _ from 'lodash';
import * as mkdirp from 'mkdirp';
import * as yargs from 'yargs';
import toSnakeCase = require('to-snake-case');
import * as Web3 from 'web3';
import { ContextData, ParamKind } from './types';
import { ContextData, ContractsBackend, ParamKind } from './types';
import { utils } from './utils';
const ABI_TYPE_CONSTRUCTOR = 'constructor';
const ABI_TYPE_METHOD = 'function';
const ABI_TYPE_EVENT = 'event';
const MAIN_TEMPLATE_NAME = 'contract.mustache';
const DEFAULT_NETWORK_ID = 50;
const DEFAULT_BACKEND = 'web3';
const args = yargs
.option('abiGlob', {
.option('abis', {
describe: 'Glob pattern to search for ABI JSON files',
type: 'string',
demand: true,
})
.option('templates', {
describe: 'Folder where to search for templates',
type: 'string',
demand: true,
demandOption: true,
})
.option('output', {
alias: ['o', 'out'],
describe: 'Folder where to put the output files',
type: 'string',
demand: true,
}).argv;
normalize: true,
demandOption: true,
})
.option('partials', {
describe: 'Glob pattern for the partial template files',
type: 'string',
implies: 'template',
})
.option('template', {
describe: 'Path for the main template file that will be used to generate each contract',
type: 'string',
demandOption: true,
normalize: true,
})
.option('backend', {
describe: `The backing Ethereum library your app uses. Either 'web3' or 'ethers'. Ethers auto-converts small ints to numbers whereas Web3 doesn't.`,
type: 'string',
choices: [ContractsBackend.Web3, ContractsBackend.Ethers],
default: DEFAULT_BACKEND,
})
.option('network-id', {
describe: 'ID of the network where contract ABIs are nested in artifacts',
type: 'number',
default: DEFAULT_NETWORK_ID,
})
.example(
"$0 --abis 'src/artifacts/**/*.json' --out 'src/contracts/generated/' --partials 'src/templates/partials/**/*.handlebars' --template 'src/templates/contract.handlebars'",
'Full usage example',
).argv;
function writeOutputFile(name: string, renderedTsCode: string): void {
const fileName = toSnakeCase(name);
const filePath = `${args.output}/${fileName}.ts`;
fs.writeFileSync(filePath, renderedTsCode);
utils.log(`Created: ${chalk.bold(filePath)}`);
function registerPartials(partialsGlob: string): void {
const partialTemplateFileNames = globSync(partialsGlob);
logUtils.log(`Found ${chalk.green(`${partialTemplateFileNames.length}`)} ${chalk.bold('partial')} templates`);
for (const partialTemplateFileName of partialTemplateFileNames) {
const namedContent = utils.getNamedContent(partialTemplateFileName);
Handlebars.registerPartial(namedContent.name, namedContent.content);
}
}
Handlebars.registerHelper('parameterType', utils.solTypeToTsType.bind(utils, ParamKind.Input));
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output));
const partialTemplateFileNames = globSync(`${args.templates}/partials/**/*.mustache`);
for (const partialTemplateFileName of partialTemplateFileNames) {
const namedContent = utils.getNamedContent(partialTemplateFileName);
Handlebars.registerPartial(namedContent.name, namedContent.content);
Handlebars.registerHelper('parameterType', utils.solTypeToTsType.bind(utils, ParamKind.Input, args.backend));
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output, args.backend));
if (args.partials) {
registerPartials(args.partials);
}
const mainTemplate = utils.getNamedContent(`${args.templates}/${MAIN_TEMPLATE_NAME}`);
const mainTemplate = utils.getNamedContent(args.template);
const template = Handlebars.compile<ContextData>(mainTemplate.content);
const abiFileNames = globSync(args.abiGlob);
const abiFileNames = globSync(args.abis);
if (_.isEmpty(abiFileNames)) {
utils.log(`${chalk.red(`No ABI files found.`)}`);
utils.log(`Please make sure you've passed the correct folder name and that the files have
logUtils.log(`${chalk.red(`No ABI files found.`)}`);
logUtils.log(`Please make sure you've passed the correct folder name and that the files have
${chalk.bold('*.json')} extensions`);
process.exit(1);
} else {
utils.log(`Found ${chalk.green(`${abiFileNames.length}`)} ${chalk.bold('ABI')} files`);
logUtils.log(`Found ${chalk.green(`${abiFileNames.length}`)} ${chalk.bold('ABI')} files`);
mkdirp.sync(args.output);
}
for (const abiFileName of abiFileNames) {
const namedContent = utils.getNamedContent(abiFileName);
utils.log(`Processing: ${chalk.bold(namedContent.name)}...`);
logUtils.log(`Processing: ${chalk.bold(namedContent.name)}...`);
const parsedContent = JSON.parse(namedContent.content);
const ABI = _.isArray(parsedContent)
? parsedContent // ABI file
: parsedContent.abi; // Truffle contracts file
let ABI;
if (_.isArray(parsedContent)) {
ABI = parsedContent; // ABI file
} else if (!_.isUndefined(parsedContent.abi)) {
ABI = parsedContent.abi; // Truffle artifact
} else if (!_.isUndefined(parsedContent.compilerOutput.abi)) {
ABI = parsedContent.compilerOutput.abi; // 0x artifact
}
if (_.isUndefined(ABI)) {
utils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`);
utils.log(`Please make sure your ABI file is either an array with ABI entries or an object with the abi key`);
logUtils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`);
logUtils.log(
`Please make sure your ABI file is either an array with ABI entries or a truffle artifact or 0x sol-compiler artifact`,
);
process.exit(1);
}
let ctor = ABI.find((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as Web3.ConstructorAbi;
const outFileName = utils.makeOutputFileName(namedContent.name);
const outFilePath = `${args.output}/${outFileName}.ts`;
if (utils.isOutputFileUpToDate(abiFileName, outFilePath)) {
logUtils.log(`Aready up to date: ${chalk.bold(outFilePath)}`);
continue;
}
let ctor = ABI.find((abi: AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as ConstructorAbi;
if (_.isUndefined(ctor)) {
ctor = utils.getEmptyConstructor(); // The constructor exists, but it's implicit in JSON's ABI definition
}
const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[];
const methodsData = _.map(methodAbis, methodAbi => {
_.map(methodAbi.inputs, input => {
const methodAbis = ABI.filter((abi: AbiDefinition) => abi.type === ABI_TYPE_METHOD) as MethodAbi[];
const sanitizedMethodAbis = abiUtils.renameOverloadedMethods(methodAbis) as MethodAbi[];
const methodsData = _.map(methodAbis, (methodAbi, methodAbiIndex: number) => {
_.forEach(methodAbi.inputs, (input, inputIndex: number) => {
if (_.isEmpty(input.name)) {
// Auto-generated getters don't have parameter names
input.name = 'index';
input.name = `index_${inputIndex}`;
}
});
// This will make templates simpler
const methodData = {
...methodAbi,
singleReturnValue: methodAbi.outputs.length === 1,
hasReturnValue: methodAbi.outputs.length !== 0,
tsName: sanitizedMethodAbis[methodAbiIndex].name,
functionSignature: abiUtils.getFunctionSignature(methodAbi),
};
return methodData;
});
const eventAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_EVENT) as Web3.EventAbi[];
const eventAbis = ABI.filter((abi: AbiDefinition) => abi.type === ABI_TYPE_EVENT) as EventAbi[];
const contextData = {
contractName: namedContent.name,
@@ -106,5 +147,6 @@ for (const abiFileName of abiFileNames) {
events: eventAbis,
};
const renderedTsCode = template(contextData);
writeOutputFile(namedContent.name, renderedTsCode);
utils.writeOutputFile(outFilePath, renderedTsCode);
logUtils.log(`Created: ${chalk.bold(outFilePath)}`);
}

View File

@@ -0,0 +1,8 @@
import { postpublishUtils } from '@0xproject/monorepo-scripts';
import * as packageJSON from '../package.json';
import * as tsConfigJSON from '../tsconfig.json';
const cwd = `${__dirname}/..`;
// tslint:disable-next-line:no-floating-promises
postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd);

View File

@@ -1,23 +1,24 @@
import * as Web3 from 'web3';
import { EventAbi, MethodAbi } from 'ethereum-types';
export enum ParamKind {
Input = 'input',
Output = 'output',
}
export enum AbiType {
Function = 'function',
Constructor = 'constructor',
Event = 'event',
Fallback = 'fallback',
export enum ContractsBackend {
Web3 = 'web3',
Ethers = 'ethers',
}
export interface Method extends Web3.MethodAbi {
export interface Method extends MethodAbi {
singleReturnValue: boolean;
hasReturnValue: boolean;
tsName: string;
functionSignature: string;
}
export interface ContextData {
contractName: string;
methods: Method[];
events: Web3.EventAbi[];
events: EventAbi[];
}

View File

@@ -1,19 +1,21 @@
import { AbiType, ConstructorAbi, DataItem } from 'ethereum-types';
import * as fs from 'fs';
import * as _ from 'lodash';
import * as path from 'path';
import * as Web3 from 'web3';
import toSnakeCase = require('to-snake-case');
import { AbiType, ParamKind } from './types';
import { ContractsBackend, ParamKind } from './types';
export const utils = {
solTypeToTsType(paramKind: ParamKind, solType: string): string {
solTypeToTsType(paramKind: ParamKind, backend: ContractsBackend, solType: string, components?: DataItem[]): string {
const trailingArrayRegex = /\[\d*\]$/;
if (solType.match(trailingArrayRegex)) {
const arrayItemSolType = solType.replace(trailingArrayRegex, '');
const arrayItemTsType = utils.solTypeToTsType(paramKind, arrayItemSolType);
const arrayTsType = utils.isUnionType(arrayItemTsType)
? `Array<${arrayItemTsType}>`
: `${arrayItemTsType}[]`;
const arrayItemTsType = utils.solTypeToTsType(paramKind, backend, arrayItemSolType, components);
const arrayTsType =
utils.isUnionType(arrayItemTsType) || utils.isObjectType(arrayItemTsType)
? `Array<${arrayItemTsType}>`
: `${arrayItemTsType}[]`;
return arrayTsType;
} else {
const solTypeRegexToTsType = [
@@ -24,27 +26,48 @@ export const utils = {
{ regex: '^bytes\\d*$', tsType: 'string' },
];
if (paramKind === ParamKind.Input) {
// web3 allows to pass those an non-bignumbers and that's nice
// but it always returns stuff as BigNumbers
// web3 and ethers allow to pass those as numbers instead of bignumbers
solTypeRegexToTsType.unshift({
regex: '^u?int(8|16|32)?$',
tsType: 'number|BigNumber',
});
}
if (backend === ContractsBackend.Ethers && paramKind === ParamKind.Output) {
// ethers-contracts automatically converts small BigNumbers to numbers
solTypeRegexToTsType.unshift({
regex: '^u?int(8|16|32|48)?$',
tsType: 'number',
});
}
for (const regexAndTxType of solTypeRegexToTsType) {
const { regex, tsType } = regexAndTxType;
if (solType.match(regex)) {
return tsType;
}
}
const TUPLE_TYPE_REGEX = '^tuple$';
if (solType.match(TUPLE_TYPE_REGEX)) {
const componentsType = _.map(components, component => {
const componentValueType = utils.solTypeToTsType(
paramKind,
backend,
component.type,
component.components,
);
const componentType = `${component.name}: ${componentValueType}`;
return componentType;
});
const tsType = `{${componentsType.join(';')}}`;
return tsType;
}
throw new Error(`Unknown Solidity type found: ${solType}`);
}
},
isUnionType(tsType: string): boolean {
return tsType === 'number|BigNumber';
},
log(...args: any[]): void {
console.log(...args); // tslint:disable-line:no-console
isObjectType(tsType: string): boolean {
return /^{.*}$/.test(tsType);
},
getPartialNameFromFileName(filename: string): string {
const name = path.parse(filename).name;
@@ -62,7 +85,7 @@ export const utils = {
throw new Error(`Failed to read ${filename}: ${err}`);
}
},
getEmptyConstructor(): Web3.ConstructorAbi {
getEmptyConstructor(): ConstructorAbi {
return {
type: AbiType.Constructor,
stateMutability: 'nonpayable',
@@ -70,4 +93,27 @@ export const utils = {
inputs: [],
};
},
makeOutputFileName(name: string): string {
let fileName = toSnakeCase(name);
// HACK: Snake case doesn't make a lot of sense for abbreviated names but we can't reliably detect abbreviations
// so we special-case the abbreviations we use.
fileName = fileName.replace('z_r_x', 'zrx').replace('e_r_c', 'erc');
return fileName;
},
writeOutputFile(filePath: string, renderedTsCode: string): void {
fs.writeFileSync(filePath, renderedTsCode);
},
isOutputFileUpToDate(abiFile: string, outputFile: string): boolean {
const abiFileModTimeMs = fs.statSync(abiFile).mtimeMs;
try {
const outFileModTimeMs = fs.statSync(outputFile).mtimeMs;
return outFileModTimeMs > abiFileModTimeMs;
} catch (err) {
if (err.code === 'ENOENT') {
return false;
} else {
throw err;
}
}
},
};

View File

@@ -0,0 +1,86 @@
import * as chai from 'chai';
import * as dirtyChai from 'dirty-chai';
import * as fs from 'fs';
import 'mocha';
import * as tmp from 'tmp';
import { utils } from '../src/utils';
tmp.setGracefulCleanup(); // remove tmp files even if there are failures
chai.use(dirtyChai);
const expect = chai.expect;
describe('makeOutputFileName()', () => {
it('should handle Metacoin usage', () => {
expect(utils.makeOutputFileName('Metacoin')).to.equal('metacoin');
});
it('should handle special zrx_token case', () => {
expect(utils.makeOutputFileName('ZRXToken')).to.equal('zrx_token');
});
it('should handle special erc_token case', () => {
expect(utils.makeOutputFileName('ERC20Token')).to.equal('erc20_token');
});
});
describe('writeOutputFile()', () => {
let tempFilePath: string;
before(() => {
tempFilePath = tmp.fileSync(
{ discardDescriptor: true }, // close file (so we can update it)
).name;
});
it('should write content to output file', () => {
const content = 'hello world';
utils.writeOutputFile(tempFilePath, content);
expect(fs.readFileSync(tempFilePath).toString()).to.equal(content);
});
});
describe('isOutputFileUpToDate()', () => {
it('should throw ENOENT when there is no abi file', () => {
expect(utils.isOutputFileUpToDate.bind('nonexistant1', 'nonexistant2')).to.throw('ENOENT');
});
describe('when the abi input file exists', () => {
let abiFile: string;
before(() => {
abiFile = tmp.fileSync(
{ discardDescriptor: true }, // close file (set timestamp)
).name;
});
describe('without an existing output file', () => {
it('should return false', () => {
expect(utils.isOutputFileUpToDate(abiFile, 'nonexistant_file')).to.be.false();
});
});
describe('with an existing output file', () => {
let outputFile: string;
before(() => {
outputFile = tmp.fileSync(
{ discardDescriptor: true }, // close file (set timestamp)
).name;
const abiFileModTimeMs = fs.statSync(abiFile).mtimeMs;
const outfileModTimeMs = abiFileModTimeMs + 1;
fs.utimesSync(outputFile, outfileModTimeMs, outfileModTimeMs);
});
it('should return true when output file is newer than abi file', async () => {
expect(utils.isOutputFileUpToDate(abiFile, outputFile)).to.be.true();
});
it('should return false when output file exists but is older than abi file', () => {
const outFileModTimeMs = fs.statSync(outputFile).mtimeMs;
const abiFileModTimeMs = outFileModTimeMs + 1;
fs.utimesSync(abiFile, abiFileModTimeMs, abiFileModTimeMs);
expect(utils.isOutputFileUpToDate(abiFile, outputFile)).to.be.false();
});
});
});
});

View File

@@ -3,5 +3,5 @@
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"]
"include": ["./src/**/*", "./test/**/*"]
}

View File

@@ -0,0 +1,7 @@
.*
yarn-error.log
/src/
/scripts/
test/
tsconfig.json
/lib/src/monorepo_scripts/

View File

@@ -0,0 +1,149 @@
[
{
"version": "0.2.14",
"changes": [
{
"note":
"Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values",
"pr": 821
}
]
},
{
"timestamp": 1531149657,
"version": "0.2.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.2.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.2.11",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527008270,
"version": "0.2.10",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1525477860,
"version": "0.2.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1525428773,
"version": "0.2.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1524044013,
"version": "0.2.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1523462196,
"version": "0.2.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1522673609,
"version": "0.2.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1522658513,
"version": "0.2.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.2.0",
"changes": [
{
"note": "Rename `isHttpUrl` to `isWebUri`",
"pr": 412
}
],
"timestamp": 1520434800
},
{
"version": "0.1.0",
"changes": [
{
"note": "Remove isETHAddressHex checksum address check and assume address will be lowercased ",
"pr": 373
},
{
"note": "Add an optional parameter `subSchemas` to `doesConformToSchema` method",
"pr": 385
}
],
"timestamp": 1520089200
},
{
"version": "0.0.18",
"changes": [
{
"note": "Fix publishing issue where .npmignore was not properly excluding undesired content",
"pr": 389
}
],
"timestamp": 1486566000
},
{
"version": "0.0.4",
"changes": [
{
"note": "Re-publish Assert previously published under NPM package @0xproject/0x-assert"
},
{
"note":
"Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals."
}
],
"timestamp": 1510585200
}
]

View File

@@ -1,6 +1,64 @@
# CHANGELOG
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
## v0.0.4 - _Nov. 14, 2017_
CHANGELOG
## v0.2.13 - _July 9, 2018_
* Dependencies updated
## v0.2.12 - _June 19, 2018_
* Dependencies updated
## v0.2.11 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.2.10 - _May 22, 2018_
* Dependencies updated
## v0.2.9 - _May 5, 2018_
* Dependencies updated
## v0.2.8 - _May 4, 2018_
* Dependencies updated
## v0.2.7 - _April 18, 2018_
* Dependencies updated
## v0.2.6 - _April 11, 2018_
* Dependencies updated
## v0.2.5 - _April 2, 2018_
* Dependencies updated
## v0.2.4 - _April 2, 2018_
* Dependencies updated
## v0.2.0 - _March 7, 2018_
* Rename `isHttpUrl` to `isWebUri` (#412)
## v0.1.0 - _March 3, 2018_
* Remove isETHAddressHex checksum address check and assume address will be lowercased (#373)
* Add an optional parameter `subSchemas` to `doesConformToSchema` method (#385)
## v0.0.18 - _February 8, 2017_
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
## v0.0.4 - _November 13, 2017_
* Re-publish Assert previously published under NPM package @0xproject/0x-assert
* Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals.

View File

@@ -16,13 +16,21 @@ import { assert } from '@0xproject/assert';
assert.isValidBaseUnitAmount('baseUnitAmount', baseUnitAmount);
```
If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
```json
"compilerOptions": {
"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
}
```
## Contributing
We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install Dependencies
### Install dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
@@ -38,8 +46,22 @@ yarn install
### Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
yarn build
PKG=@0xproject/assert yarn build
```
Or continuously rebuild on change:
```bash
PKG=@0xproject/assert yarn watch
```
### Clean
```bash
yarn clean
```
### Lint

View File

View File

@@ -1,45 +1,60 @@
{
"name": "@0xproject/assert",
"version": "0.0.12",
"version": "0.3.0",
"engines": {
"node": ">=6.12"
},
"description": "Provides a standard way of performing type and schema validation across 0x projects",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "shx rm -rf _bundles lib test_temp",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"run_mocha": "mocha lib/test/**/*_test.js",
"watch_without_deps": "tsc -w",
"build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib test_temp scripts",
"lint": "tslint --project .",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
"prepublishOnly": "run-p build",
"test": "run-s clean build run_mocha",
"test:circleci": "yarn test"
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"test:circleci": "yarn test:coverage",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x.js.git"
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"bugs": {
"url": "https://github.com/0xProject/0x.js/issues"
"url": "https://github.com/0xProject/0x-monorepo/issues"
},
"homepage": "https://github.com/0xProject/0x.js/packages/assert/README.md",
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
"devDependencies": {
"@0xproject/tslint-config": "^0.4.3",
"@types/lodash": "^4.14.86",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/valid-url": "^1.0.2",
"chai": "^4.0.1",
"chai-typescript-typings": "^0.0.2",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1"
"tslint": "5.11.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/json-schemas": "^0.7.4",
"@0xproject/utils": "^0.2.1",
"@0xproject/json-schemas": "^1.0.0",
"@0xproject/typescript-typings": "^0.4.2",
"@0xproject/utils": "^0.7.2",
"lodash": "^4.17.4",
"valid-url": "^1.0.9"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -1,15 +0,0 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -1 +1,6 @@
declare module 'dirty-chai';
declare module '*.json' {
const json: any;
/* tslint:disable */
export default json;
/* tslint:enable */
}

Some files were not shown because too many files have changed in this diff Show More