Compare commits

...

1462 Commits

Author SHA1 Message Date
Fabio Berger
174b360593 Publish
- 0x.js@1.0.1
 - @0xproject/abi-gen@1.0.8
 - @0xproject/assert@1.0.8
 - @0xproject/base-contract@2.0.2
 - @0xproject/connect@2.0.0
 - @0xproject/contract-wrappers@1.0.1
 - contracts@2.1.43
 - @0xproject/dev-utils@1.0.7
 - ethereum-types@1.0.6
 - @0xproject/fill-scenarios@1.0.1
 - @0xproject/forwarder-helper@1.0.1
 - @0xproject/json-schemas@1.0.1
 - @0xproject/metacoin@0.0.18
 - @0xproject/migrations@1.0.7
 - @0xproject/monorepo-scripts@1.0.8
 - @0xproject/order-utils@1.0.1
 - @0xproject/order-watcher@1.0.1
 - @0xproject/react-docs@1.0.8
 - @0xproject/react-shared@1.0.9
 - @0xproject/sol-compiler@1.1.2
 - @0xproject/sol-cov@2.1.2
 - @0xproject/sol-resolver@1.0.8
 - @0xproject/sra-report@1.0.8
 - @0xproject/sra-spec@1.0.1
 - @0xproject/subproviders@2.0.2
 - @0xproject/testnet-faucets@1.0.44
 - @0xproject/tslint-config@1.0.7
 - @0xproject/types@1.0.1
 - @0xproject/typescript-typings@2.0.0
 - @0xproject/utils@1.0.8
 - @0xproject/web3-wrapper@2.0.2
 - @0xproject/website@0.0.47
2018-09-05 11:16:45 +01:00
Fabio Berger
481a752e70 Updated CHANGELOGS 2018-09-05 11:16:34 +01:00
Fabio Berger
38acdfd632 Update CHANGELOG's to publish non-RC versions 2018-09-05 11:06:11 +01:00
Francesco Agosti
561e525778 Merge pull request #1058 from 0xProject/fix/connect/use-big-number-in-requests
[connect] Use BigNumber instead of string where appropriate in OrderConfigRequest
2018-09-04 17:25:51 -07:00
fragosti
69eb820d0d Change orderConfig from POST to GET like in spec 2018-09-04 15:49:30 -07:00
Alex Browne
447f16fc4f Merge pull request #1057 from 0xProject/deployment/copy-testnet-artifacts
Remove/rename/update all artifacts in preparation for v2 launch
2018-09-04 18:31:48 -04:00
Alex Browne
1769609245 Update order-watcher/package.json 2018-09-04 18:17:51 -04:00
Alex Browne
e1dcdac1bb add packages/sol-cov/test/fixtures/artifacts to .prettierignore 2018-09-04 18:14:59 -04:00
Alex Browne
9d45d19c80 More small artifacts updates/changes 2018-09-04 18:10:23 -04:00
Alex Browne
9858bb0ce4 Fix bug in contracts tests 2018-09-04 18:10:13 -04:00
fragosti
a3527a77a6 Add to CHANGELOG 2018-09-04 14:49:39 -07:00
fragosti
33a45fa739 Use BigNumber instead of string where appropriate in OrderConfigRequest 2018-09-04 14:44:56 -07:00
Alex Browne
e70882a657 More small chnages/bug fixes 2018-09-04 17:22:22 -04:00
Alex Browne
e456332da7 Rename and update some artifact locations 2018-09-04 16:47:28 -04:00
Alex Browne
4ed84c5dc5 Rename 2.0.0-beta-testnet to 2.0.0-testnet 2018-09-04 16:11:17 -04:00
Alex Browne
2fe3f40be9 Add missing testnet addresses to 2.0.0-mainnet artifacts 2018-09-04 16:09:59 -04:00
Alex Browne
44bfdb718f Copy artifacts from 2.0.0-beta-testnet that do not appear in 2.0.0-mainnet 2018-09-04 16:09:44 -04:00
Alex Browne
3524efc41c Merge pull request #1055 from 0xProject/deployment/2.0.0-beta-testnet/ropsten
Ropsten/Kovan Contract deployment
2018-09-04 15:54:48 -04:00
Francesco Agosti
01210c291c Merge pull request #1044 from 0xProject/feature/website/update-portal-v2
[website] Update portal for v2
2018-09-04 12:37:53 -07:00
Jacob Evans
192d4b4dbf Merge branch 'deployment/2.0.0-beta-testnet/ropsten' of github.com:0xProject/0x-monorepo into deployment/2.0.0-beta-testnet/ropsten 2018-09-04 20:32:43 +01:00
Jacob Evans
68246fc335 Revert Forwarder address for Ganache 2018-09-04 20:29:01 +01:00
Fabio Berger
7ef86636aa merge development 2018-09-04 20:26:02 +01:00
Fabio Berger
a5859c6cee Merge pull request #1038 from 0xProject/feature/contracts/mainnetMigrations
Mainnet migrations
2018-09-04 20:23:48 +01:00
Fabio Berger
3463903d02 Merge branch 'deployment/2.0.0-beta-testnet/ropsten' of github.com:0xProject/0x-monorepo into deployment/2.0.0-beta-testnet/ropsten
* 'deployment/2.0.0-beta-testnet/ropsten' of github.com:0xProject/0x-monorepo:
  Revert the exchange address change
  Tslint magic-number
2018-09-04 20:22:32 +01:00
Jacob Evans
4b0f1a8431 Remove Rinkeby from Exchange.json 2018-09-04 20:21:50 +01:00
Jacob Evans
603e8aa671 Revert the exchange address change 2018-09-04 20:18:23 +01:00
fragosti
6eb980abe2 Add to changelog 2018-09-04 12:11:17 -07:00
fragosti
46b168e10f Run linter 2018-09-04 12:09:24 -07:00
Jacob Evans
508e6ccf89 Tslint magic-number 2018-09-04 19:57:05 +01:00
fragosti
a173c5fc38 Merge branch 'feature/website/update-portal-v2' of https://github.com/0xProject/0x-monorepo into feature/website/update-portal-v2 2018-09-04 11:55:42 -07:00
fragosti
f5237f7971 Use order parser utils from order utils 2018-09-04 11:55:08 -07:00
Amir Bandeali
6f7a5d00e6 Update prettierignore 2018-09-04 11:47:26 -07:00
Fabio Berger
4061723863 merge back weth9 2018-09-04 19:42:54 +01:00
Jacob Evans
ab1b52ba87 Ropsten/Kovan Contract deployment 2018-09-04 19:41:05 +01:00
Fabio Berger
16e94ecb40 Merge branch 'deployment/2.0.0-beta-testnet/ropsten' of github.com:0xProject/0x-monorepo into deployment/2.0.0-beta-testnet/ropsten
* 'deployment/2.0.0-beta-testnet/ropsten' of github.com:0xProject/0x-monorepo:
  Ropsten/Kovan Contract deployment
2018-09-04 19:35:48 +01:00
Jacob Evans
6bb2c5877c Ropsten/Kovan Contract deployment 2018-09-04 19:29:40 +01:00
fragosti
a14450f367 Add order parsers to order-util 2018-09-04 11:22:31 -07:00
Amir Bandeali
85df313a7a Update mainnet artifacts 2018-09-04 11:07:56 -07:00
Amir Bandeali
66ed6b9b88 Update mainnet configs 2018-09-04 11:07:56 -07:00
Amir Bandeali
9304d09da6 Add mainnet migrations 2018-09-04 11:07:56 -07:00
fragosti
e61dbbb6cf Merge https://github.com/0xProject/0x-monorepo into feature/website/update-portal-v2 2018-09-04 10:53:18 -07:00
Fabio Berger
1690f59857 Remove unused imports and console.log 2018-09-04 18:42:50 +01:00
Fabio Berger
c916dd6ebb Add back order validation logic 2018-09-04 18:39:53 +01:00
Fabio Berger
8a683b8541 Fix imports 2018-09-04 18:37:41 +01:00
Fabio Berger
4883b8be10 remove console log 2018-09-04 18:37:33 +01:00
Fabio Berger
51760f9bdd merge development 2018-09-04 18:37:24 +01:00
Fabio Berger
6a619a4084 Merge pull request #1054 from 0xProject/addValidationMethods
Temporarily Add Back Validation Methods
2018-09-04 18:04:03 +01:00
Jacob Evans
feeafa193a Ropsten/Kovan Contract deployment 2018-09-04 18:01:21 +01:00
Fabio Berger
8d8528996a Export abstract fetchers 2018-09-04 17:44:27 +01:00
Amir Bandeali
965d609829 Merge pull request #1050 from 0xProject/refactor/contracts/multisig
Update MultiSig and add more tests
2018-09-04 09:12:16 -07:00
Leonid Logvinov
a52714bcf3 Merge pull request #1052 from 0xProject/feature/remove-types
[typescript-typings] Remove types that were moved to DefinitelyTyped
2018-09-04 17:54:54 +02:00
Fabio Berger
bbfd7647a8 Export missing type 2018-09-04 16:52:21 +01:00
Fabio Berger
0aba5a3be4 Merge branch 'development' into addValidationMethods
* development:
  Remove unused imports
2018-09-04 16:51:27 +01:00
Fabio Berger
61bf5864a8 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Remove unused imports
2018-09-04 16:51:15 +01:00
Fabio Berger
56847a53f4 Add PR nr 2018-09-04 16:41:43 +01:00
Fabio Berger
8324ab3af7 Update yarn.lock 2018-09-04 16:27:26 +01:00
Fabio Berger
d496a7585c Add validateFillOrderThrowIfInvalidAsync and validateOrderFillableOrThrowAsync to ExchangeWrapper 2018-09-04 16:27:16 +01:00
Fabio Berger
8d7f2a993a Import fetchers from contract-wrappers 2018-09-04 16:24:01 +01:00
Fabio Berger
ed786f3e8f Export fetchers from contract-wrappers 2018-09-04 16:23:29 +01:00
Fabio Berger
539c243733 Move fetchers to contract-wrappers 2018-09-04 16:23:02 +01:00
Leonid Logvinov
40e0c829b3 Fix the version 2018-09-04 17:06:09 +02:00
Amir Bandeali
e34b1f2f8b Remove TODOs that will not be addressed 2018-09-04 07:57:47 -07:00
Amir Bandeali
f6b6619c08 Fix geth tests 2018-09-04 07:57:47 -07:00
Amir Bandeali
e480e08aa4 Add test for external_call visibility 2018-09-04 07:57:47 -07:00
Amir Bandeali
652cf7a976 Add MultiSigWalletWithTimeLock revert reasons to tests 2018-09-04 07:57:47 -07:00
Amir Bandeali
7a8ab6fbe8 Update MultiSigWalletWithTimeLock to 0.4.24 2018-09-04 07:57:47 -07:00
Amir Bandeali
9deec8ec35 Add more tests for MultiSigWalletWithTimeLock 2018-09-04 07:57:47 -07:00
Amir Bandeali
3f1586045c Add test for executeRemoveAuthorizedAddressAtIndex when called by non-owner 2018-09-04 07:57:47 -07:00
Amir Bandeali
ada5563b1f Update to most recent multisig 2018-09-04 07:57:47 -07:00
Leonid Logvinov
6b41a570a5 Change doc gen configs 2018-09-04 16:36:18 +02:00
Leonid Logvinov
cebf6bfb34 Move types used in public interfaces to dependencies 2018-09-04 16:36:18 +02:00
Leonid Logvinov
47a1b48ad8 Add temporarily missing web3-provider-engine types in website 2018-09-04 16:36:18 +02:00
Leonid Logvinov
ef82a9d2a6 Add CHANGELOG entry 2018-09-04 16:36:18 +02:00
Leonid Logvinov
ba6351841d Add temporarily missing web3-provider-engine types in subproviders 2018-09-04 16:36:18 +02:00
Leonid Logvinov
cdc786a1e3 Remove types for web3-provider-engine from typescript-typings 2018-09-04 16:36:18 +02:00
Leonid Logvinov
3ea137a78f Remove types for eth-lightwallet from typescript-typings 2018-09-04 16:36:18 +02:00
Leonid Logvinov
b525ccc825 Remove types for detect-node from typescript-typings 2018-09-04 16:36:18 +02:00
Leonid Logvinov
77acbdd3ea Remove types for ganache-core from typescript-typings 2018-09-04 16:36:18 +02:00
Leonid Logvinov
c13190ceab Remove types for newman from typescript-typings 2018-09-04 16:36:18 +02:00
Leonid Logvinov
78d4fc59a5 Merge pull request #1053 from 0xProject/fix/linter_issues
[website] Remove unused imports
2018-09-04 16:35:54 +02:00
Leonid Logvinov
f9e86c057d Remove unused imports 2018-09-04 16:08:35 +02:00
Amir Bandeali
1d8e133a30 Merge pull request #1051 from 0xProject/fix/contracts/style
Apply styling fixes to contracts
2018-09-03 21:22:03 -07:00
Amir Bandeali
99fbf384fd Apply styling fixes 2018-09-03 20:55:37 -07:00
Amir Bandeali
cb4fcf4de7 Revert in Forwarder constructor if ERC20 proxy isn't registered 2018-09-03 20:35:00 -07:00
Brandon Millman
675964dc5c Merge pull request #1048 from 0xProject/feature/website/patch-v2-landing
[website] Final tweaks for landing page
2018-08-30 17:26:47 -07:00
Brandon Millman
6432f85eb0 Wording change for first benefit 2018-08-30 17:14:17 -07:00
Francesco Agosti
66eef758c6 Merge pull request #1047 from 0xProject/feature/re-add-no-unused-variables
Re-add no-unused-variable tslint rule
2018-08-30 15:38:21 -07:00
Brandon Millman
c64f0ba34b Tweaks to benefits and use cases 2018-08-30 15:26:03 -07:00
Brandon Millman
6deffb6b28 Update yarn lock 2018-08-30 15:19:33 -07:00
Greg Hysen
5802713801 Merge pull request #1046 from 0xProject/fix/contracts/roundingFeeTestsMatchOrders
Test cases for rounding fees in matchOrders
2018-08-30 14:27:01 -07:00
Brandon Millman
11df29fa8e Update exchange ABI for decoding logs 2018-08-30 14:23:09 -07:00
Brandon Millman
f4a41e80b8 Remove LogError legacy stuff 2018-08-30 14:04:55 -07:00
Brandon Millman
5c655b55d3 Update comment for validation 2018-08-30 14:01:04 -07:00
Brandon Millman
63c15b6f4f Remove commented out block 2018-08-30 14:00:10 -07:00
Brandon Millman
4f2bc29744 Remove cancel check 2018-08-30 13:59:42 -07:00
fragosti
2cac431c41 Final tweaks for landing page 2018-08-30 13:53:30 -07:00
fragosti
80b7a7842c run prettier 2018-08-30 13:47:33 -07:00
Brandon Millman
8c7cec9822 Merge pull request #1040 from 0xProject/feature/website/v2-tweaks
[website] Landing page tweaks for v2 launch
2018-08-30 13:46:37 -07:00
Brandon Millman
971a4087d2 Update yarn lock 2018-08-30 13:36:44 -07:00
Brandon Millman
660e670d38 Update generate and fill order flows 2018-08-30 13:36:44 -07:00
Brandon Millman
052824f4e3 Token registry from old 0x version 2018-08-30 13:36:44 -07:00
fragosti
1d5ef4d0ca Fix unused vars for react-shared and website 2018-08-30 13:28:07 -07:00
Brandon Millman
a6440b94f4 Fix import 2018-08-30 13:24:24 -07:00
Brandon Millman
01685b7622 Fix contract not deployed on network bug in ContractWrapper class 2018-08-30 13:24:24 -07:00
Brandon Millman
397fefa8d7 Update typings version 2018-08-30 13:24:24 -07:00
Brandon Millman
82a01ef020 Initial changes for v2 portal 2018-08-30 13:24:24 -07:00
Brandon Millman
a224ce347e Revert whats new text 2018-08-30 13:21:07 -07:00
Amir Bandeali
81ba2a8411 Merge pull request #1045 from 0xProject/feature/contracts/cancelOrderInternal
Add cancelOrderInternal, use within batchCancelOrders
2018-08-30 13:07:51 -07:00
Amir Bandeali
a6e8b28da5 Merge pull request #1043 from 0xProject/feature/contracts/edgeCaseTests
Add edge case tests
2018-08-30 13:07:19 -07:00
Brandon Millman
e90dbf66f3 Add new exchange everywhere graphic 2018-08-30 12:29:47 -07:00
Greg Hysen
0be2219beb Test cases for rounding fees in matchOrders 2018-08-30 12:23:11 -07:00
Amir Bandeali
09b4d5e0e4 Add cancelOrderInternal, use within batchCancelOrders 2018-08-30 12:10:24 -07:00
Brandon Millman
60f1bcf51f Remove unused render methods in landing page 2018-08-30 12:09:54 -07:00
Brandon Millman
431ac3b401 Update yarn lock 2018-08-30 12:05:29 -07:00
Francesco Agosti
50781bd77a Merge pull request #1042 from 0xProject/feature/website/v2-tweaks-fra
[website] Add rotating text to landing header and careers button to topbar
2018-08-30 11:55:28 -07:00
fragosti
c3361bb86e Remove conflict strings 2018-08-30 11:52:08 -07:00
fragosti
fd5ad69c26 Add careers page to top bar 2018-08-30 11:49:27 -07:00
fragosti
b1f97a27f3 Final tweaks 2018-08-30 11:49:27 -07:00
fragosti
febddcb356 Remove redundant import 2018-08-30 11:49:27 -07:00
fragosti
74d5af34eb Add TypedText component and use it on landing page 2018-08-30 11:49:27 -07:00
fragosti
365890291f Add generic title changes 2018-08-30 11:48:49 -07:00
Brandon Millman
0368de701f Added todo comments for missing items 2018-08-30 11:44:09 -07:00
Brandon Millman
f5e7b7e7e0 Add title header to use cases section 2018-08-30 11:39:25 -07:00
Brandon Millman
038c21324e Make hero image responsive 2018-08-30 11:39:25 -07:00
Brandon Millman
5d008ee83e Update what's new styling 2018-08-30 11:39:25 -07:00
Amir Bandeali
d0f6933980 Add tests for token that returns >32 bytes 2018-08-30 09:27:28 -07:00
Amir Bandeali
14793f30b5 Add more proxy tests 2018-08-30 09:27:28 -07:00
Amir Bandeali
86319291e3 Update used addresses for authorizable tests 2018-08-30 09:27:28 -07:00
Amir Bandeali
afa2dd7374 Add test for fillOrder and dispatchTransferFrom where maker == taker 2018-08-30 09:26:44 -07:00
fragosti
1312e4caf2 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/website/v2-tweaks 2018-08-29 16:39:25 -07:00
Amir Bandeali
eb4517d737 Merge pull request #1041 from 0xProject/refactor/contracts/assetProxyOwnerVersion
Update AssetProxyOwner to 0.4.24, remove redundant code
2018-08-29 15:57:53 -07:00
Amir Bandeali
d80701c277 Fix geth tests 2018-08-29 15:35:09 -07:00
Amir Bandeali
bf3ab1127d Remove unused imports 2018-08-29 14:42:42 -07:00
Amir Bandeali
dcb12b6ad6 Update AssetProxyOwner to 0.4.24 2018-08-29 14:12:10 -07:00
Francesco Agosti
f87420a776 Merge pull request #1023 from 0xProject/website/feature/react-16
[website] Upgrade all the things to React 16
2018-08-29 14:04:17 -07:00
Greg Hysen
6cedf5362b Merge pull request #1039 from 0xProject/fix/contracts/audit2Fixes
Fixes as-per Audit for LibBytes + ERC20 Proxy Comments
2018-08-29 13:53:49 -07:00
Greg Hysen
aa833ef074 Typos in LibBytes tests 2018-08-29 13:26:46 -07:00
Greg Hysen
5f1c9cfee5 Reverted syntax used by readBytes4 in AssetProxyOwner to be compatible with Solidity v0.4.10 2018-08-29 13:15:40 -07:00
Greg Hysen
62b93cf2eb More tests for LibBytes 2018-08-29 13:14:51 -07:00
Brandon Millman
b1c5f6e8f1 Update use cases section 2018-08-29 12:45:24 -07:00
Brandon Millman
3bc9b309f6 Update tokenization section 2018-08-29 12:45:24 -07:00
Brandon Millman
6924a2b681 Update benefits 2018-08-29 12:45:24 -07:00
Brandon Millman
d93d4c34f5 Update whats new 2018-08-29 12:45:24 -07:00
Brandon Millman
557267477e Add new header image 2018-08-29 12:45:16 -07:00
Brandon Millman
b9f7979e91 Replace projects section with relayers 2018-08-29 12:45:15 -07:00
Greg Hysen
8c803ab232 Updated comments for ERC20 proxy to clarify how we load the token address from calldata (3.18 from audit) 2018-08-29 12:25:06 -07:00
fragosti
422e5e4dd7 Apply prettier 2018-08-29 11:57:52 -07:00
fragosti
2aea820d89 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into website/feature/react-16 2018-08-29 11:42:44 -07:00
Greg Hysen
1c3b2b7141 Updated readBytes4 to match spec + added unit tests. These are 3.5/3.6 from audit 2018-08-29 11:39:52 -07:00
Alex Browne
e7d5ceb9c5 feat: Add support for TypeScript project references (#991)
* Update all package.json and tsconfig.json

* fix(contracts): Make test/utils/web3_wrapper.ts compatible with project refs

* Fix webpack config for 0x.js

* Fix linter errors by adding rootDir to tsconfig.json as needed

* Add build:ts and watch:ts commands to package.json

* Update sra-spec to work with project references

* Update tsconfig.json with latest new/removed packages

* Add TypeScript as devDependency at root

* Add missing rootDir to forwarder-helper package

* Use a separate tsconfig file for typedoc

* Fix linter errors

* Apply PR feedback (add comments)

* Fix 0x.js tsconfig
2018-08-29 11:15:30 -07:00
fragosti
68af0e9eb7 Change VersionDropDown to use material-ui 3 2018-08-28 18:08:06 -07:00
fragosti
a18d0f6229 Upgrade version of react-shared in website 2018-08-28 17:49:15 -07:00
fragosti
031807df9c Upgrade react-copy-to-clipboard 2018-08-28 15:52:09 -07:00
fragosti
72710be04b Remove react-tap-event-plugin from react-shared 2018-08-28 15:37:20 -07:00
fragosti
ac135d55d3 Upgrade material ui in react-docs 2018-08-28 15:32:15 -07:00
fragosti
1d55e94659 Update lockfile 2018-08-28 15:27:24 -07:00
fragosti
86284f1c7e Merge branch 'development' of https://github.com/0xProject/0x-monorepo into website/feature/react-16 2018-08-28 15:25:08 -07:00
fragosti
61a4ae7fc4 Update material-ui in react-shared 2018-08-28 15:15:54 -07:00
fragosti
55fab3d98f Revert "Simplify dropdown component"
This reverts commit 91a9014a50.
2018-08-28 15:07:29 -07:00
fragosti
de11b62e30 Revert "Have new Popover component working in React 16"
This reverts commit 5785ec0713.
2018-08-28 15:07:28 -07:00
fragosti
8e14e65b60 Revert "Enable hovering state for dropdown"
This reverts commit ac1640140c.
2018-08-28 15:07:24 -07:00
fragosti
2d1d14d2e4 Upgrade material ui to 0.20.0 2018-08-28 15:04:34 -07:00
Brandon Millman
f44644ad90 Merge pull request #1022 from 0xProject/feature/contract-wrappers/order-validator
[contract-wrappers] Write wrapper for OrderValidator contract
2018-08-28 14:20:57 -07:00
fragosti
ac1640140c Enable hovering state for dropdown 2018-08-28 13:53:49 -07:00
Greg Hysen
1402a0aa22 Merge pull request #1036 from 0xProject/fix/contracts/calculateFillResults
Making rounding consistent in calculateFillResults
2018-08-28 13:51:38 -07:00
Amir Bandeali
f225f9e7c8 Making rounding consistent in calculateFillResults 2018-08-28 13:25:05 -07:00
Amir Bandeali
14fdb71a71 safeGetPartialAmount (#1035)
* Added Test "Should transfer correct amounts when left order is fully filled and values pass isRoundingErrorCeil but fail isRoundingErrorFloor"

* Added RoundingError exception to reference function for getPartialAmount

* Added RoundingError exception to reference function for getPartialAmount

* Added isRoundingErrorCeil to getPartialAmountCeil reference funtion

* Computed new values  for "Should give right maker a better buy price when correct price is not integral" that does not have a rounding error

* Almost all tests for match orders are passing after adding isRoundingErrorCeil check

* WIP commit: Added rounding error checks to getPartialAmount

* WIP commit: Added rounding error checks to getPartialAmount

* Use safe versions of getPartialAmount

* Update Exchange internals tests

* Run linter

* Found new values for "Should transfer correct amounts when right order fill amount deviates from amount derived by `Exchange.fillOrder`"

* Fixed merge conflicts

* Run all tests

* Cleaned up some comments on match Orders tests

* Fix tests for geth
2018-08-28 13:00:49 -07:00
Brandon Millman
9c4c4fb19a Export missing types and add OrderValidatorWrapper to hidden constructors 2018-08-28 12:03:21 -07:00
fragosti
5785ec0713 Have new Popover component working in React 16 2018-08-27 18:29:35 -07:00
Alex Browne
2eab0e30b7 fix(contracts): Catch cases where the actual error differs from the expected error (#1032)
* Catch cases where the actual error differs from the expected error

* Add tests for testWithReferenceFuncAsync

* Small style and comment fixes
2018-08-27 16:07:38 -07:00
Brandon Millman
2c846ff145 Add OrderValidatorWrapper to public interface 2018-08-27 16:06:34 -07:00
Brandon Millman
ca0dfc6610 Add contract-wrappers changelog entry for OrderValidatorWrapper 2018-08-27 13:57:48 -07:00
Brandon Millman
0fd44ee2c1 Fix broken test 2018-08-27 13:53:51 -07:00
Brandon Millman
7271fc0bab Add getBalancesAndAllowances to wrapper 2018-08-27 13:49:44 -07:00
Brandon Millman
6c039bbeb1 Update OrderValidator artifact to include getBalancesAndAllowances function 2018-08-27 13:43:19 -07:00
Brandon Millman
38e6d26145 Add params to all function comments 2018-08-27 13:31:12 -07:00
Brandon Millman
b0f210dea9 Add getERC721Owner to wrapper 2018-08-27 13:21:14 -07:00
Brandon Millman
f7469080f9 Update getOrdersAndTradersInfo to return an array instead 2018-08-27 13:21:10 -07:00
Amir Bandeali
fb5ea5d99f Merge pull request #1030 from 0xProject/fix/contracts/forwarderFillOrderNoThrow
Remove redundant mstores from fillOrderNoThrow
2018-08-27 13:07:57 -07:00
Brandon Millman
be2f4cbdca Add getBalanceAndAllowance to wrapper 2018-08-27 13:04:54 -07:00
Brandon Millman
68f2dc11b4 Add getTraderInfo and getTradersInfo to wrapper 2018-08-27 13:04:54 -07:00
Brandon Millman
d6c670dfcb Add getOrderAndTraderInfoAsync to wrapper 2018-08-27 13:04:54 -07:00
Brandon Millman
0736c41357 Add test for order validator 2018-08-27 13:04:54 -07:00
Brandon Millman
898bd75a18 Remove some unused variables in forwarder wrapper test 2018-08-27 13:04:54 -07:00
Brandon Millman
260313a6ae Initial OrderValidator wrapper 2018-08-27 13:04:54 -07:00
Amir Bandeali
6a99bfa68e Add clarifying comments 2018-08-27 12:01:58 -07:00
Amir Bandeali
f60adbdd72 Remove redundant mstores from fillOrderNoThrow 2018-08-27 11:54:20 -07:00
Alex Browne
1be310cef4 Merge pull request #1031 from 0xProject/fix/internal-tests-division-by-zero-assertion
Use correct error message for division by zero
2018-08-27 11:48:47 -07:00
Alex Browne
ff4f86f1d6 fix(contracts): Use correct error message for division by zero 2018-08-27 11:19:25 -07:00
Fabio Berger
f4a4fefe42 Exit with non-error code at end of publishRelease 2018-08-27 15:02:12 +01:00
Fabio Berger
00a4fa5f7c Publish
- 0x.js@1.0.1-rc.6
 - @0xproject/abi-gen@1.0.7
 - @0xproject/assert@1.0.7
 - @0xproject/base-contract@2.0.1
 - @0xproject/connect@2.0.0-rc.2
 - @0xproject/contract-wrappers@1.0.1-rc.5
 - contracts@2.1.42
 - @0xproject/dev-utils@1.0.6
 - @0xproject/fill-scenarios@1.0.1-rc.5
 - @0xproject/forwarder-helper@1.0.1-rc.2
 - @0xproject/json-schemas@1.0.1-rc.6
 - @0xproject/metacoin@0.0.17
 - @0xproject/migrations@1.0.6
 - @0xproject/monorepo-scripts@1.0.7
 - @0xproject/order-utils@1.0.1-rc.6
 - @0xproject/order-watcher@1.0.1-rc.5
 - @0xproject/react-docs@1.0.7
 - @0xproject/react-shared@1.0.8
 - @0xproject/sol-compiler@1.1.1
 - @0xproject/sol-cov@2.1.1
 - @0xproject/sol-resolver@1.0.7
 - @0xproject/sra-report@1.0.7
 - @0xproject/sra-spec@1.0.1-rc.6
 - @0xproject/subproviders@2.0.1
 - @0xproject/testnet-faucets@1.0.43
 - @0xproject/types@1.0.1-rc.6
 - @0xproject/utils@1.0.7
 - @0xproject/web3-wrapper@2.0.1
 - @0xproject/website@0.0.46
2018-08-27 14:48:24 +01:00
Fabio Berger
4475fefd07 Updated CHANGELOGS 2018-08-27 14:47:56 +01:00
Fabio Berger
cd08a9c121 Fix prettier 2018-08-27 13:43:29 +01:00
Fabio Berger
b0c4eb8333 Update changelog files for RC packages 2018-08-27 13:16:31 +01:00
Fabio Berger
368dbda8f0 Merge pull request #1028 from 0xProject/fix-ci
Fix `test_publish` CI Test
2018-08-27 13:09:11 +01:00
Fabio Berger
bc4149683e Skip doc generation for local publishes since we test this in a separate CI test 2018-08-27 12:39:10 +01:00
Fabio Berger
6174d9ebb7 Fix typo 2018-08-27 12:34:34 +01:00
Fabio Berger
e4fc8a8414 Use absolute path 2018-08-27 12:05:55 +01:00
Fabio Berger
907972c466 Merge branch 'development' into fix-ci
* development:
  Run yarn a second time if the first fails
2018-08-27 11:43:35 +01:00
Fabio Berger
49f5fe635f Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Run yarn a second time if the first fails
2018-08-27 11:43:22 +01:00
Fabio Berger
77290c1efa Run yarn a second time if the first fails 2018-08-27 10:51:38 +01:00
Fabio Berger
4ac43a9fd2 Try relative to root dir 2018-08-27 10:38:06 +01:00
Fabio Berger
cc77d1dd49 merge development 2018-08-27 10:35:16 +01:00
Fabio Berger
51161784e8 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Fix command
  Move md files to lib folder during build
  Change exit code to failure
  Fix sra-spec `main` and `types` in package.json
  Issue #1025 BlockParam unroll
  fix: Use yarn version 1.9.4 on CI
2018-08-27 10:34:45 +01:00
Fabio Berger
cb7660fbe7 Merge pull request #1009 from 0xProject/fix/ci-yarn-1.9.4
fix: Use yarn version 1.9.4 on CI
2018-08-27 10:33:02 +01:00
Fabio Berger
82e51b8787 Fix command 2018-08-27 10:15:27 +01:00
Fabio Berger
fffa96bba7 Move md files to lib folder during build 2018-08-27 10:15:13 +01:00
Fabio Berger
e6cb2e0fcd Change exit code to failure 2018-08-27 10:14:43 +01:00
Fabio Berger
38abeaed9c Fix sra-spec main and types in package.json 2018-08-27 10:13:17 +01:00
Fabio Berger
90c9e3496a Actual relative path 2018-08-27 10:10:07 +01:00
Fabio Berger
9fc8a6e214 Try relative path 2018-08-27 10:09:51 +01:00
Fabio Berger
9df87a199a Merge pull request #1026 from 0xProject/fix/contract-wrappers/block-param-literal
[contract_templates] Issue #1025 BlockParam unroll
2018-08-27 10:07:06 +01:00
Jacob Evans
7e9ba50502 Issue #1025 BlockParam unroll
BlockParam unrolls into number | BlockParamLiteral, though BlockParamLiteral does not get imported. This results in type build errors in downstream projects where tslint checks libs
2018-08-27 15:59:43 +10:00
Fabio Berger
41559c39b9 Fix command 2018-08-26 23:43:19 +01:00
Fabio Berger
6a6b424c86 Move md files to lib folder during build 2018-08-26 23:35:47 +01:00
Fabio Berger
3a5c6ed00f Fix sra-spec main and types in package.json 2018-08-26 23:05:04 +01:00
Fabio Berger
db54588d05 Add BlockParamLiteral to template 2018-08-26 22:00:51 +01:00
Fabio Berger
52fde551e4 Remove check since this method is now used in multiple places 2018-08-26 21:16:32 +01:00
Fabio Berger
40cf805e5e Also use failure exit code if unexpected error occurs 2018-08-26 20:54:15 +01:00
Fabio Berger
09d6496135 Change exit code to failure 2018-08-26 20:53:21 +01:00
Fabio Berger
c4dadf4bfd Combine imports 2018-08-26 17:49:06 +01:00
Fabio Berger
35ba3e6f7c Bumop 0x.js version 2018-08-26 17:35:17 +01:00
Fabio Berger
3ac182ee91 Fix file path to main and types in package.json 2018-08-26 17:12:13 +01:00
Amir Bandeali
00e7c70b4d Merge pull request #986 from 0xProject/feature/contracts/assertions
Add more assertions to assertValidFill
2018-08-24 20:03:28 -07:00
Amir Bandeali
0aa9ed3839 Merge pull request #1008 from 0xProject/fix/contracts/robustMatching
Robustness in Order Matching
2018-08-24 19:00:53 -07:00
Remco Bloemen
d652deea23 Merge branch 'fix/contracts/robustMatching' of github.com:0xProject/0x.js into fix/contracts/robustMatching 2018-08-24 18:54:15 -07:00
Greg Hysen
878db3b849 Added comments to order matching 2018-08-24 18:48:29 -07:00
Greg Hysen
ec2e726be0 Rephrased some of the math in MixinMatchOrders to improve readability 2018-08-24 18:20:26 -07:00
Greg Hysen
287830d6e0 Run all tests 2018-08-24 18:20:26 -07:00
Greg Hysen
c7a7ae7e18 Give right maker better price when correct value is not integral 2018-08-24 18:20:26 -07:00
Greg Hysen
1c7ba6a315 Extract only fill event logs 2018-08-24 18:20:26 -07:00
Greg Hysen
0a6f107243 Added temporary @todo to MixinMatchOrders 2018-08-24 18:20:25 -07:00
Greg Hysen
a93f95c55e Wording in MixinMatchOrders 2018-08-24 18:20:25 -07:00
Greg Hysen
6833e243b7 Addressed linter errors in match order tesster 2018-08-24 18:20:25 -07:00
Greg Hysen
81dc893d1d Removed a redundant comment from matchOrders 2018-08-24 18:20:25 -07:00
Greg Hysen
f8e565bc06 Tests for matchOrders edge cases 2018-08-24 18:20:25 -07:00
Greg Hysen
ba15fb6a06 Swapped direction of expect values to match output in failure cases 2018-08-24 18:20:25 -07:00
Greg Hysen
1e6b83719a Renaming verify -> assert in order matching 2018-08-24 18:20:25 -07:00
Greg Hysen
9fcb2dda73 Fixed a function comment 2018-08-24 18:20:25 -07:00
Greg Hysen
9a5ec8d030 Added function signature comments 2018-08-24 18:20:25 -07:00
Greg Hysen
ac872e5181 Added expect messages for checking left/right order states 2018-08-24 18:20:25 -07:00
Greg Hysen
70863cca08 Ran prettier and linter 2018-08-24 18:20:25 -07:00
Greg Hysen
5a1dce15be Updated all existing match order tests to use new format 2018-08-24 18:19:43 -07:00
Greg Hysen
d291256158 Passes comprehensive test 2018-08-24 18:18:30 -07:00
Greg Hysen
8c706ac639 Verify logs 2018-08-24 18:18:30 -07:00
Greg Hysen
f697814849 First balance test with intentional values 2018-08-24 18:18:30 -07:00
Greg Hysen
ca5c9e77c0 Ironing out the new set of test cases for order matchubng 2018-08-24 18:17:27 -07:00
Greg Hysen
a32b201afe Rounding for fees in match orders addressed, plus example 2018-08-24 18:17:27 -07:00
Greg Hysen
0ecdf1e213 All existing tests pass. 2018-08-24 18:17:26 -07:00
Greg Hysen
057891b342 Added fees to matchOrders (previously in calculateFillResults 2018-08-24 18:17:26 -07:00
Greg Hysen
407f63ef20 Removed calculateFillResults from matchOrders workflow. Eliminates compounded rounding errors. 2018-08-24 18:17:26 -07:00
Amir Bandeali
f938c989e3 Merge pull request #1002 from 0xProject/feature/contracts/mutex
[contracts] Add mutexes and reentrancy guards
2018-08-24 18:15:22 -07:00
Amir Bandeali
c8500cab10 Fix build 2018-08-24 17:30:56 -07:00
Amir Bandeali
c28c3db63f Only use one nonReentrant modifier, remove modifier from fillOrderNoThrow variations 2018-08-24 17:30:56 -07:00
Amir Bandeali
a09ee90739 Add tests for matchOrders 2018-08-24 17:30:56 -07:00
Amir Bandeali
7d5a23969d Add reentrancy tests for fillOrder and wrapper functions 2018-08-24 17:30:56 -07:00
Amir Bandeali
56c3c29feb Update ReentrantERC20Token with new functions and check that revert is occuring for correct reason 2018-08-24 17:30:56 -07:00
Amir Bandeali
c75212bef0 Add nonReentrant modifiers on functions that use getCurrentContextAddress only, add lockMutex modifier on functions that make external calls 2018-08-24 17:30:56 -07:00
Amir Bandeali
6d0dedc62c Split modifiers into check only and check, lock, unlock 2018-08-24 17:30:56 -07:00
Amir Bandeali
cf12daea2f Add ReentrantToken 2018-08-24 17:30:56 -07:00
Amir Bandeali
6f88e9bdbd Add internal fill functions, add reentrancy guard to public functions that make external calls 2018-08-24 17:30:56 -07:00
Amir Bandeali
d8cb56caa3 Add ReentrancyGuard contract 2018-08-24 17:30:56 -07:00
Amir Bandeali
044415e23d Remove redundant sload from getCurrentContextAddress 2018-08-24 17:30:56 -07:00
Remco Bloemen
6b866d6053 Revert maker not equal taker check 2018-08-24 17:29:52 -07:00
Amir Bandeali
74ce893f52 Merge pull request #1003 from 0xProject/feature/contracts/roundup
[contracts] Add getPartialAmountCeil and isRoundingErrorCeil
2018-08-24 17:29:09 -07:00
Amir Bandeali
cc1fac9bbe Fix linting errors 2018-08-24 17:02:42 -07:00
Amir Bandeali
94e01be9ed Merge pull request #1021 from 0xProject/feature/contracts/skipselftransfer
[Contracts] Skip self transfers
2018-08-24 16:58:46 -07:00
fragosti
91a9014a50 Simplify dropdown component 2018-08-24 16:48:48 -07:00
Remco Bloemen
e215992859 Fix mixin api 2018-08-24 16:46:24 -07:00
Remco Bloemen
e6f5cac878 Fix double definition of error 2018-08-24 16:46:24 -07:00
Remco Bloemen
29971f36cf Split into assertFillable and assertValidFill 2018-08-24 16:46:24 -07:00
Remco Bloemen
3e4493b389 Disallow self filling 2018-08-24 16:46:24 -07:00
Remco Bloemen
749c6ecc30 Add revert reasons to types 2018-08-24 16:46:24 -07:00
Remco Bloemen
e6e7bae445 Remove BUG_ from revert reasons 2018-08-24 16:46:23 -07:00
Remco Bloemen
a1d8943552 Document accetable price check 2018-08-24 16:46:23 -07:00
Remco Bloemen
07e56b3cc7 Fix taker overpay check 2018-08-24 16:46:23 -07:00
Remco Bloemen
b16f5f55fb Check fillable early 2018-08-24 16:46:23 -07:00
Remco Bloemen
d92fd43791 Update for new assertValidFill signature 2018-08-24 16:46:23 -07:00
Remco Bloemen
e706fa76ac Add overfill and price assertion to assertValidFill 2018-08-24 16:46:23 -07:00
Remco Bloemen
11328bd93d Skip self-transfers 2018-08-24 16:26:48 -07:00
Remco Bloemen
bc686fcbf3 Stylistic fixes 2018-08-24 16:17:02 -07:00
Remco Bloemen
80291caf7c Append -Floor to getPartialAmount and isRoundingError 2018-08-24 16:16:44 -07:00
Brandon Millman
cd5e9a5115 Merge pull request #1018 from 0xProject/fix/migrations/order-validator-testnet
[migrations] Add testnet network info to OrderValidator artifact
2018-08-24 16:06:10 -07:00
fragosti
ad161a973e Change all onTouchTap to onClick 2018-08-24 15:59:14 -07:00
fragosti
103e1aa250 Upgrade typescript version used by sra-spec 2018-08-24 15:45:43 -07:00
fragosti
641d86cb98 Add typescript dependency to typescript-typings (no idea how it was working) 2018-08-24 15:40:04 -07:00
fragosti
813b2ca1fb Bump react-highlight in react-shared once more 2018-08-24 15:29:22 -07:00
fragosti
ec96c3bb77 Upgrade react-shared used by website to one that depends on react 16 2018-08-24 15:15:55 -07:00
fragosti
65120e84e2 Upgrade react-highlight to version that depends on React 16 2018-08-24 15:11:14 -07:00
Amir Bandeali
82b51db17e Merge pull request #1015 from 0xProject/feature/contracts/removeCallerSigType
Remove SignatureType.Caller
2018-08-24 15:09:39 -07:00
fragosti
374ee2db32 Upgrade react in react-docs 2018-08-24 15:05:46 -07:00
Brandon Millman
3557cd93fc Add testnet network info to OrderValidator artifact 2018-08-24 14:42:07 -07:00
Amir Bandeali
0629a7d143 Remove remaining Trezor references 2018-08-24 14:40:00 -07:00
Greg Hysen
a27112cbef SignatureType.Trezor -> SignatureType.EthSign in Signature Validator tests 2018-08-24 14:40:00 -07:00
Greg Hysen
d039a1adda Fixed linter in signatureUtils 2018-08-24 14:40:00 -07:00
Greg Hysen
bb4d449e92 Test case for Trezor Model T signature 2018-08-24 14:40:00 -07:00
Greg Hysen
241534a63d Fixed trezor personal message in client+contracts; added a test using message signed by Trezor One (firmware v1.6.2) 2018-08-24 14:40:00 -07:00
Amir Bandeali
1932aff35c Remove Trezor SignatureType 2018-08-24 14:40:00 -07:00
Amir Bandeali
4f27991959 Remove SigntureType.Caller from signingUtils 2018-08-24 14:39:08 -07:00
Amir Bandeali
8ce4f9c784 Remove SignatureType.Caller 2018-08-24 14:39:08 -07:00
Amir Bandeali
7351bf0b14 Merge pull request #1012 from 0xProject/feature/contracts/staticcall
Use staticcall for external function calls in MixinSignatureValidator
2018-08-24 14:38:54 -07:00
fragosti
48ab151ec2 Update react and remove tap event plugin [deprecated] 2018-08-24 14:20:55 -07:00
Remco Bloemen
f6080367fe Disambiguate the operator precedence 2018-08-24 14:11:45 -07:00
Remco Bloemen
7f78d7da9d Add tests 2018-08-24 14:09:51 -07:00
Remco Bloemen
6734f2f1bc Add docs 2018-08-24 14:09:51 -07:00
Remco Bloemen
0fb7617a78 Fix incorect modulus 2018-08-24 14:09:51 -07:00
Remco Bloemen
4219af1430 Add DIVISION_BY_ZERO to getPartialAmount for consistency 2018-08-24 14:09:51 -07:00
Remco Bloemen
c109d1f545 Remove .only 2018-08-24 14:09:51 -07:00
Remco Bloemen
50fab9feb3 Improve getPartialAmountCeil docs 2018-08-24 14:09:51 -07:00
Remco Bloemen
3dad6ee55e Add tests for getPartialAmountCeil 2018-08-24 14:09:51 -07:00
Remco Bloemen
5d70df771b Add isRoundingErrorCeil 2018-08-24 14:09:50 -07:00
Remco Bloemen
ab5df342e1 Add getPartialAmountCeil 2018-08-24 14:09:50 -07:00
Amir Bandeali
6a9669a409 Rethrow Wallet and Validator errors 2018-08-24 14:06:46 -07:00
Remco Bloemen
e68942ee78 Handle zero case 2018-08-24 13:45:10 -07:00
Remco Bloemen
4159e45aff Update tests 2018-08-24 13:45:10 -07:00
Remco Bloemen
92497d7df4 Fix isRoundingError 2018-08-24 13:45:10 -07:00
fragosti
44a430802e Merge branch 'development' of https://github.com/0xProject/0x-monorepo into website/feature/react-16 2018-08-24 13:38:30 -07:00
Amir Bandeali
070eff6f3a Rename TestStaticCall => TestStaticCallReceiver 2018-08-24 13:32:04 -07:00
Amir Bandeali
681ed822ec Revert if undefined function called in AssetProxies 2018-08-24 13:19:07 -07:00
Amir Bandeali
0a1ae2c311 Remove pragma experimental v0.5.0 and use staticcall is assembly 2018-08-24 13:19:07 -07:00
Amir Bandeali
c5f8b9c2d2 Add pragma experimental v0.5.0 to SignatureValidator and add tests 2018-08-24 13:19:07 -07:00
fragosti
6b03cfd40d Add new react and types 2018-08-24 12:05:54 -07:00
Francesco Agosti
7f36574a57 Merge pull request #1011 from 0xProject/sra-api/rename/sra-spec
[sra-spec] Rename the sra-api package to sra-spec
2018-08-24 12:00:39 -07:00
fragosti
b637ca105a Merge branch 'development' of https://github.com/0xProject/0x-monorepo into sra-api/rename/sra-spec 2018-08-24 11:16:28 -07:00
fragosti
9ffddb47b8 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into sra-api/rename/sra-spec 2018-08-24 11:14:34 -07:00
fragosti
7bcaac4e10 Ignore api.json in public 2018-08-24 11:11:56 -07:00
Fabio Berger
7f585a15f5 Publish
- 0x.js@1.0.1-rc.4
 - @0xproject/abi-gen@1.0.6
 - @0xproject/assert@1.0.6
 - @0xproject/base-contract@2.0.0
 - @0xproject/connect@2.0.0-rc.1
 - @0xproject/contract-wrappers@1.0.1-rc.4
 - contracts@2.1.41
 - @0xproject/dev-utils@1.0.5
 - ethereum-types@1.0.5
 - @0xproject/fill-scenarios@1.0.1-rc.4
 - @0xproject/forwarder-helper@1.0.1-rc.1
 - @0xproject/json-schemas@1.0.1-rc.5
 - @0xproject/metacoin@0.0.16
 - @0xproject/migrations@1.0.5
 - @0xproject/monorepo-scripts@1.0.6
 - @0xproject/order-utils@1.0.1-rc.4
 - @0xproject/order-watcher@1.0.1-rc.4
 - @0xproject/react-docs@1.0.6
 - @0xproject/react-shared@1.0.7
 - @0xproject/sol-compiler@1.1.0
 - @0xproject/sol-cov@2.1.0
 - @0xproject/sol-resolver@1.0.6
 - @0xproject/sra-api@1.0.1-rc.5
 - @0xproject/sra-report@1.0.6
 - @0xproject/subproviders@2.0.0
 - @0xproject/testnet-faucets@1.0.42
 - @0xproject/tslint-config@1.0.6
 - @0xproject/types@1.0.1-rc.5
 - @0xproject/typescript-typings@1.0.5
 - @0xproject/utils@1.0.6
 - @0xproject/web3-wrapper@2.0.0
 - @0xproject/website@0.0.45
2018-08-24 19:11:27 +01:00
Fabio Berger
b38ef579fb Updated CHANGELOGS 2018-08-24 19:11:10 +01:00
Fabio Berger
8427db36e9 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Add documentation for connect v2
2018-08-24 18:59:01 +01:00
Fabio Berger
2d1c88c20d Updated api.json 2018-08-24 18:58:34 +01:00
Fabio Berger
029ea52979 Small fixes to publish script 2018-08-24 18:58:12 +01:00
Francesco Agosti
a2b6255f40 Merge pull request #1010 from 0xProject/feature/website/connect-2-docs
[website] Add documentation for connect v2
2018-08-24 10:35:45 -07:00
fragosti
d4592c0a60 Run prettier 2018-08-24 10:20:17 -07:00
Fabio Berger
fb6d511811 Added missing entry for RC package 2018-08-24 17:44:14 +01:00
Fabio Berger
c1b4fe999c Excessive command 2018-08-24 17:41:33 +01:00
Fabio Berger
1354f794a1 Merge pull request #1014 from 0xProject/feature/json-schemas/remove-superfluous-id
[json-schemas] Remove superflous id from relayer api fee recipients json schema
2018-08-24 16:32:04 +01:00
fragosti
8f6a96740e Remove superflous id from relayer api fee recipients json schema 2018-08-24 08:25:34 -07:00
fragosti
1d6699585e Add sra-spec to prettier ignore 2018-08-23 17:53:21 -07:00
Brandon Millman
e96f36751a Merge pull request #997 from 0xProject/feature/forwarder-helper/init
[forwarder-helper] Initial scaffolding for the forwarder-helper package
2018-08-23 17:42:48 -07:00
fragosti
a75c298de0 Point to new s3 bucket 2018-08-23 17:31:11 -07:00
fragosti
d603d8da47 Rename sra-api to sra-spec 2018-08-23 17:30:20 -07:00
fragosti
1040826b8b Add documentation for connect v2 2018-08-23 17:17:45 -07:00
Alex Browne
a551d0a6dd fix: Use yarn version 1.9.4 on CI 2018-08-23 16:45:18 -07:00
Brandon Millman
21c37ba62f Upgrade changelog version to get around test-publis CI job 2018-08-23 16:15:08 -07:00
Brandon Millman
2c660e62d3 Merge pull request #1006 from 0xProject/fix/0x.js/uglify-plugin
[0x.js] Update uglify plugin to support es6
2018-08-23 15:21:54 -07:00
Brandon Millman
6b667f8eca Remove CHANGELOG.md 2018-08-23 14:56:39 -07:00
Brandon Millman
d52c1310b2 Update uglify plugin to support es6 2018-08-23 14:42:03 -07:00
Brandon Millman
6338b5bd3c Move sorting phase into its own utils file 2018-08-23 13:47:24 -07:00
Brandon Millman
2713cca6ac Remove legacy docs stuff 2018-08-23 11:10:40 -07:00
Brandon Millman
57c104119c Merge branch 'development' into feature/forwarder-helper/init
* development: (187 commits)
  Remove trailing slash
  Fix linter
  Stop nesting interfaces and add necessary type exports
  Remove duplicate type and remove nested interface
  Add support for rending the Tuple type
  Add missing keyu
  Remove excessive timestamp
  Improve doc commebnt
  Remove docs catch-all endpoint
  Fix comments
  Look for all TS mapped types
  Add catch and exit with non-zero
  Remove superfluous dep
  Fix CHANGELOG entry
  Fix double assignment
  Upgrade Typedoc to 0.12.0, which works with TS 3.x
  Fix prettier issues
  Enable dry run of release publishing and handle git tags existing
  update yarn.lock
  Missing/superfluous type exports from connect
  ...
2018-08-23 10:58:33 -07:00
Brandon Millman
cd5c73550b Update _sortedConfigs naming 2018-08-23 10:53:59 -07:00
Brandon Millman
68b060cb6a Update yarn lock 2018-08-23 10:53:40 -07:00
Brandon Millman
7ad1a18a4a Merge branch 'development' into feature/forwarder-helper/init
* development: (31 commits)
  Update CI config to check development instead of v2-prototype branch
  fix: Make non-interactive npm login for publish tests more robust
  Run prettier
  Remove comment in updates json-schemas doc
  Add documentation for json-schemas
  Fix typo
  Remove artifacts
  Update variable names, make release candidate
  Update more names in docs
  Improve documentation
  Pin sra-report to 0xproject/connect v1.0.4
  Run prettier
  lint everything
  Update websocket for SRA v2
  Remove default query parameters
  Add networkId request param option
  Rename websocket files and types
  Use uuid as string for requestId
  Update changelogs
  Add fee recipients test
  ...
2018-08-23 10:52:09 -07:00
Fabio Berger
6e27324a34 Merge pull request #924 from 0xProject/wrap-typedoc
Improved Docs & Removed monorepo-scripts from packages
2018-08-23 18:12:39 +01:00
Fabio Berger
8eb4b6f917 Remove trailing slash 2018-08-23 17:50:42 +01:00
Fabio Berger
0ca64e394b Fix linter 2018-08-23 17:37:40 +01:00
Fabio Berger
c4c47d9665 Stop nesting interfaces and add necessary type exports 2018-08-23 17:28:27 +01:00
Fabio Berger
f9b222c127 Remove duplicate type and remove nested interface 2018-08-23 17:06:38 +01:00
Fabio Berger
28f077b16f Add support for rending the Tuple type 2018-08-23 16:55:41 +01:00
Fabio Berger
3563fabe88 Add missing keyu 2018-08-23 16:15:47 +01:00
Fabio Berger
1ca176e992 Remove excessive timestamp 2018-08-23 15:12:43 +01:00
Fabio Berger
52e2c60361 Improve doc commebnt 2018-08-23 15:12:34 +01:00
Fabio Berger
ae154f43df Remove docs catch-all endpoint 2018-08-23 15:08:12 +01:00
Fabio Berger
610caef73f Fix comments 2018-08-23 15:08:02 +01:00
Fabio Berger
29a9e1fc4e Look for all TS mapped types 2018-08-23 14:53:32 +01:00
Fabio Berger
ae937cfcce Add catch and exit with non-zero 2018-08-23 14:53:16 +01:00
Fabio Berger
6c7dca7d07 Remove superfluous dep 2018-08-23 14:53:04 +01:00
Fabio Berger
aa9efd79db Fix CHANGELOG entry 2018-08-23 14:52:52 +01:00
Fabio Berger
f0f4f873a9 Fix double assignment 2018-08-23 14:29:32 +01:00
Fabio Berger
0577ab96b8 Upgrade Typedoc to 0.12.0, which works with TS 3.x 2018-08-23 14:29:22 +01:00
Fabio Berger
15a34dca79 Fix prettier issues 2018-08-23 13:58:49 +01:00
Fabio Berger
2b38163274 Enable dry run of release publishing and handle git tags existing 2018-08-23 13:56:40 +01:00
Brandon Millman
572ad4615a Fix prettier 2018-08-22 23:02:44 -07:00
Alex Browne
b013cf2e14 Merge pull request #1001 from 0xProject/fix/npm-login-with-package
fix: Make non-interactive npm login for publish tests more robust
2018-08-22 17:20:14 -07:00
Alex Browne
3e56990db7 Update CI config to check development instead of v2-prototype branch 2018-08-22 16:58:48 -07:00
Alex Browne
2de7a49000 fix: Make non-interactive npm login for publish tests more robust 2018-08-22 16:40:10 -07:00
Fabio Berger
2a63592994 update yarn.lock 2018-08-23 00:23:33 +01:00
Fabio Berger
2cef8d3a3e Missing/superfluous type exports from connect 2018-08-23 00:23:19 +01:00
Fabio Berger
1417ee2ccb Break with -1 so that the exit code of the loop if hit is non-zero 2018-08-23 00:08:45 +01:00
Fabio Berger
04e4fe251a Prettier fix 2018-08-23 00:08:21 +01:00
Fabio Berger
61255309d2 merge development 2018-08-22 23:46:45 +01:00
Fabio Berger
27d329ff25 Replace complicated camelCase to spaces logic with change-case package 2018-08-22 23:44:46 +01:00
Francesco Agosti
cb19623a3a Merge pull request #974 from 0xProject/feature/connect/sra-api-v2
[connect][sra-api][json-schemas] Update Connect to SRA v2
2018-08-22 15:39:14 -07:00
Brandon Millman
44ca6c4b71 Fix lint errors 2018-08-22 15:39:03 -07:00
Brandon Millman
bfabdf6010 Prettier 2018-08-22 15:39:03 -07:00
Brandon Millman
cbcf8e8477 Add changelog entry and fix order-util changelog PR numbers 2018-08-22 15:39:03 -07:00
Brandon Millman
b0b3f9e339 Add assertions to factory 2018-08-22 15:39:03 -07:00
Brandon Millman
a5c7ddcff5 Add more comments 2018-08-22 15:39:03 -07:00
Brandon Millman
6cef847a27 Write initial forwarderHelperFactory 2018-08-22 15:39:03 -07:00
Brandon Millman
68dfd1bb22 Add tests for getMarketBuyOrdersInfo 2018-08-22 15:39:03 -07:00
Brandon Millman
67d33ec10c Fix rounding bug in marketUtils 2018-08-22 15:39:03 -07:00
Brandon Millman
05ba049f59 Add test for sorting that happens in constructor 2018-08-22 15:39:03 -07:00
Brandon Millman
867ff3c5ec Update yarn lock 2018-08-22 15:39:03 -07:00
Brandon Millman
c2454d1428 Add more TODO items 2018-08-22 15:39:03 -07:00
Brandon Millman
7e0e195c88 Make config public readonly 2018-08-22 15:39:03 -07:00
Brandon Millman
e8a1950a74 Add ForwarderHelperImplConfig 2018-08-22 15:39:03 -07:00
Brandon Millman
3c973ba9f6 Remove marketSell and add to marketBuy implementation 2018-08-22 15:39:03 -07:00
Brandon Millman
2ef867f398 Add stubs for ForwarderHelper interface in ForwarderHelperImpl 2018-08-22 15:39:03 -07:00
Brandon Millman
90f2813d0e Flesh out types 2018-08-22 15:39:03 -07:00
Brandon Millman
dd9c4b6e5d Initial skeleton of forwarder-helper package 2018-08-22 15:39:03 -07:00
Fabio Berger
a6cdc38d53 Add/improve comments 2018-08-22 23:25:06 +01:00
Fabio Berger
167c4f8519 Fix changelogs 2018-08-22 23:24:54 +01:00
Fabio Berger
799db64541 Merge branch 'development' into wrap-typedoc
* development:
  fix: Increase delay for non-interactive npm login
2018-08-22 23:14:45 +01:00
Fabio Berger
69b436babe Refactor publish script so that root package.json configs.packagesWithDocs is canonical source of which packages have doc pages 2018-08-22 23:13:59 +01:00
fragosti
c83f2a070c Run prettier 2018-08-22 14:31:53 -07:00
fragosti
ba9e31d3c1 Remove comment in updates json-schemas doc 2018-08-22 14:11:41 -07:00
Fabio Berger
e915d72202 Merge pull request #996 from 0xProject/fix/npm-auto-login-delay
fix: Increase delay for non-interactive npm login
2018-08-22 21:02:21 +01:00
fragosti
74e7fa13d6 Add documentation for json-schemas 2018-08-22 12:04:03 -07:00
Fabio Berger
b7c119b2aa Fix many linter errors that showed up upon upgrading tsutil 2018-08-22 18:52:17 +01:00
Fabio Berger
3c2af2067f Remove monorepo-scripts from tslintconfig.json 2018-08-22 16:24:45 +01:00
Fabio Berger
7c29cadb17 Use actual packageName for external example imports 2018-08-22 16:11:42 +01:00
Fabio Berger
40b202f8c0 Update all CHANGELOGs 2018-08-22 15:53:19 +01:00
Fabio Berger
392c00a698 Fix prettier 2018-08-22 15:10:32 +01:00
Fabio Berger
fb4fbc0e13 Update contract-wrappers CHANGELOG 2018-08-22 15:10:02 +01:00
Fabio Berger
730226081c Ignore error of first yarn install 2018-08-22 14:53:01 +01:00
Fabio Berger
1fdd7466b2 Double install catching first ones error 2018-08-22 14:49:05 +01:00
Fabio Berger
00b7620af1 Add yarn cache clean 2018-08-22 14:45:00 +01:00
Fabio Berger
a39d79352d Remove duplicate install cmd 2018-08-22 14:27:24 +01:00
Fabio Berger
3b5c8a847b Run yarn twice on CI 2018-08-22 14:24:23 +01:00
Fabio Berger
4b84081795 Check yarn info on CircleCi 2018-08-22 14:19:19 +01:00
Fabio Berger
27ba218ed7 Improve README 2018-08-22 14:07:31 +01:00
Fabio Berger
d907b40378 Fix remaining merge issues 2018-08-22 13:12:42 +01:00
Fabio Berger
0248add542 Merge development branch 2018-08-22 11:41:42 +01:00
Fabio Berger
c12f0d04bb Fix bugs in doc gen due to clone vs cloneDeep and pre-maturely removing placeholder undefined's in array iteration 2018-08-22 11:30:24 +01:00
Fabio Berger
22de88035c Fix index.ts given fix in doc generation 2018-08-22 11:28:31 +01:00
Amir Bandeali
80e52464a6 Merge pull request #985 from 0xProject/feature/contracts/orderValidator
[contracts] Add contract for batch validating orders
2018-08-21 20:43:23 -07:00
Amir Bandeali
3760eb5baf Add getBalancesAndAllowances 2018-08-21 18:14:22 -07:00
fragosti
c905b20ce6 Fix typo 2018-08-21 16:51:01 -07:00
Fabio Berger
301cb296ec Move types from sol-compiler to types so they can be used in other places without requiring sol-compiler as a dep 2018-08-21 23:58:06 +01:00
Fabio Berger
1bbd7bf870 Add generated_docs dir to clean command 2018-08-21 23:20:01 +01:00
Fabio Berger
da15df2c2d Stop logging to console for each packages without a package.json 2018-08-21 23:07:12 +01:00
Fabio Berger
fe43f84abd Use bash for loop for generating docs for each package, revert changes to script 2018-08-21 23:06:21 +01:00
Amir Bandeali
7fa5b474eb Add ZRX balances and allowances to TraderInfo 2018-08-21 13:53:44 -07:00
Amir Bandeali
3d25758b1d Add OrderValidator to migrations 2018-08-21 13:53:38 -07:00
fragosti
f1ddbc9387 Remove artifacts 2018-08-21 13:17:37 -07:00
Amir Bandeali
dafb282432 Add tests 2018-08-21 11:47:28 -07:00
Amir Bandeali
0918f95421 Don't throw if ERC721 token isn't owned 2018-08-21 11:47:28 -07:00
Amir Bandeali
be67c25b0a Add OrderValidator contract 2018-08-21 11:47:28 -07:00
Amir Bandeali
f53157414f Merge pull request #995 from 0xProject/refactor/contracts/forwarderConstructor
[contracts] Remove redundant constructor args
2018-08-21 11:45:50 -07:00
Fabio Berger
6b838c034a Modify script so it can generate docs for a specific package or all packages with doc pages, add doc gen test to CircleCi runs 2018-08-21 19:07:20 +01:00
Alex Browne
86cb89feef fix: Increase delay for non-interactive npm login 2018-08-21 11:04:27 -07:00
Amir Bandeali
1ba26ea5e8 Remove redundant constructor args 2018-08-21 10:59:54 -07:00
fragosti
8b79868c36 Update variable names, make release candidate 2018-08-21 10:58:35 -07:00
Fabio Berger
8bb7b5b543 Add shouldUpload flag to docGenAndUpload command 2018-08-21 18:49:56 +01:00
Fabio Berger
809d301d58 Fix lowercase names involving ERC acronym 2018-08-21 17:48:24 +01:00
Fabio Berger
c00c477307 Add doc comments to AbiDecoder 2018-08-21 17:39:35 +01:00
Fabio Berger
6216714be1 Merge pull request #994 from feuGeneA/remove-more-v2-artifacts
[0x.js, migrations] remove more v2 contract artifacts
2018-08-21 17:35:59 +01:00
Fabio Berger
cc90c806b0 Fix sol-cov index.ts 2018-08-21 17:16:42 +01:00
Fabio Berger
04bbd60c11 Fix sol-compiler index.ts 2018-08-21 17:16:34 +01:00
Fabio Berger
ad9bb3ea59 Fix order-watcher index.ts 2018-08-21 17:16:24 +01:00
Fabio Berger
1ddac0bc7b Fix type 2018-08-21 17:16:16 +01:00
Fabio Berger
a7468eb858 Don't check if types are used for libraries only include types 2018-08-21 17:16:00 +01:00
F. Eugene Aumson
213d82a2c2 remove more v2 contract artifacts 2018-08-21 11:41:01 -04:00
Fabio Berger
7553411fb2 Fix up order-utils 2018-08-21 16:37:03 +01:00
Fabio Berger
c52c94214f Rather then look for typeArguments, we want to ignore Partial & Promise references, but still continue to search below them, as they might surround a type 2018-08-21 16:36:48 +01:00
Fabio Berger
151cf03f5b Add link to Array type 2018-08-21 16:35:39 +01:00
Fabio Berger
141c51eaf5 Add missing exports to 0x.js and contract-wrappers index.ts 2018-08-21 16:35:13 +01:00
Fabio Berger
ab7d083aa5 Add missing key 2018-08-21 15:39:39 +01:00
Fabio Berger
12881e60e3 Fix file name from camel to snake case 2018-08-21 14:23:06 +01:00
Fabio Berger
1f65de60b4 Move sol-compiler dep to dependencies now that types from it are exported in index.ts 2018-08-21 11:18:12 +01:00
Fabio Berger
635373febb Implement ignoring config types 2018-08-21 11:17:12 +01:00
Fabio Berger
e7c7af8ef4 Add more types and ignores to docGenConfigs 2018-08-21 11:15:59 +01:00
fragosti
cd2bbd850d Update more names in docs 2018-08-20 17:23:38 -07:00
fragosti
83a36bc4b6 Improve documentation 2018-08-20 17:18:08 -07:00
fragosti
1c95f685bb Pin sra-report to 0xproject/connect v1.0.4 2018-08-20 16:56:57 -07:00
fragosti
e45d320fc5 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/connect/sra-api-v2 2018-08-20 16:50:24 -07:00
Francesco Agosti
dd2e54d60d Merge pull request #987 from 0xProject/feature/add-sra-to-readme
Add sra-api to README
2018-08-20 16:34:12 -07:00
Brandon Millman
64eac5f37f Merge pull request #990 from 0xProject/feature/website/update-onboarding-lock-image
[Website] Update lock icon in onboarding
2018-08-20 16:25:53 -07:00
Alex Browne
78ed6e0339 Merge pull request #989 from 0xProject/fix/sol-cov-incorrect-files
fix(sol-cov): Remove old files and update config.contractsDir
2018-08-20 14:25:36 -07:00
Brandon Millman
79aff1c57a Update lock icon in onboarding 2018-08-20 14:25:31 -07:00
Amir Bandeali
a21bfc5f2c Merge pull request #976 from feuGeneA/remove-v2-artifacts
[migrations, 0x.js, contract-wrappers, fill-scenarios, order-utils, order-watcher] remove v2 contract artifacts
2018-08-20 14:23:44 -07:00
Alex Browne
da3dc7affc fix(sol-cov): Remove old files and update config.contractsDir 2018-08-20 13:56:55 -07:00
Brandon Millman
254d88ffa0 Add Matt Taylor to website 2018-08-20 13:56:31 -07:00
Brandon Millman
4ded591624 Merge pull request #988 from 0xProject/fix/website/build-error
[website] Revert changes to website causing it to fail building
2018-08-20 13:55:22 -07:00
Brandon Millman
2af99a1fe2 Add CODEOWNERS file 2018-08-20 13:35:55 -07:00
fragosti
135fbf67ad Apply prettir 2018-08-20 13:15:30 -07:00
F. Eugene Aumson
6405c70d07 change clean to also remove generated artifacts 2018-08-20 16:12:09 -04:00
F. Eugene Aumson
1255570b95 remove disabled scripts 2018-08-20 16:12:09 -04:00
F. Eugene Aumson
a263e7dfce remove v2 contract artifacts 2018-08-20 16:12:09 -04:00
Brandon Millman
cbe0ffb3ce Remove exit 0 from website build command 2018-08-20 12:19:26 -07:00
Brandon Millman
67b4ba2a57 Revert error renames 2018-08-20 12:18:35 -07:00
fragosti
ab71f54128 Add sra-api to README 2018-08-20 12:10:58 -07:00
fragosti
cabce8cb67 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/connect/sra-api-v2 2018-08-20 12:01:58 -07:00
fragosti
44cc5e45cc Run prettier 2018-08-20 11:53:49 -07:00
fragosti
1ae11ed8ae lint everything 2018-08-20 11:51:26 -07:00
fragosti
075e3a41c8 Update websocket for SRA v2 2018-08-20 11:42:29 -07:00
Brandon Millman
756787c61f Update yarn lock 2018-08-20 11:28:55 -07:00
Fabio Berger
b67677f476 Fix website given that it still depends on an old version of @0xproject/Types 2018-08-20 13:51:23 +01:00
Fabio Berger
b4cf69b021 Cleanup web3-wrapper and subproviders index.ts 2018-08-20 13:50:28 +01:00
Fabio Berger
d149b6cdec Cleanup connect index.ts 2018-08-20 13:49:50 +01:00
Fabio Berger
f29263c477 Cleanup contract-wrappers index.ts 2018-08-20 13:49:29 +01:00
Fabio Berger
61ef6edaa5 Change Yarn verson in README 2018-08-18 12:27:15 -07:00
Fabio Berger
fae58ca695 Merge pull request #975 from 0xProject/feature/contract-wrappers/executeTransaction
[Contract-wrappers] Exchange execute transaction encoder
2018-08-18 12:23:16 -07:00
Jacob Evans
1c68057999 Rename to Transaction Encoder.
Add tests for all encoding methods.
2018-08-18 09:32:29 +10:00
Fabio Berger
fb637d9234 Make sure we don't render protected properties 2018-08-17 16:09:04 -07:00
Fabio Berger
0f7ced3625 Make sure export isn't internal to the package 2018-08-17 14:12:23 -07:00
Fabio Berger
ea4d7f153a Also ignore implementationOf 2018-08-17 14:12:04 -07:00
fragosti
f2d1d95355 Remove default query parameters 2018-08-17 13:58:55 -07:00
Amir Bandeali
ddf85112d7 Merge pull request #933 from 0xProject/refactor/contracts/tokens
[contracts] Refactor token implementations
2018-08-17 13:28:01 -07:00
Fabio Berger
05ce002435 Refactor DocGenerateAndUploadUtils to be a class, and decompose large methods for readability 2018-08-17 12:53:27 -07:00
fragosti
48ec78d3aa Add networkId request param option 2018-08-17 10:43:44 -07:00
Amir Bandeali
e35788e2c8 Update artifacts 2018-08-16 17:32:20 -07:00
Amir Bandeali
8bce73dc67 Fix typos, run prettier, and allow anyone to call on DummyERC721Token 2018-08-16 17:32:16 -07:00
Amir Bandeali
c13f538400 Update CHANGELOGs 2018-08-16 17:31:21 -07:00
Amir Bandeali
09d3d15db0 Fix Geth tests 2018-08-16 17:31:21 -07:00
Amir Bandeali
633e6c38c8 Fix linting errors 2018-08-16 17:31:21 -07:00
Amir Bandeali
a4d6bc3190 Fix tests that assumed logs were being filtered 2018-08-16 17:31:21 -07:00
Amir Bandeali
0b9a9d92af Add tests for ERC721Token 2018-08-16 17:31:21 -07:00
Amir Bandeali
a82e36c1d4 Add ERC721Receiver that returns incorrect value 2018-08-16 17:31:21 -07:00
Amir Bandeali
61ba012b1f Add ERC721 revert reasons to types 2018-08-16 17:31:21 -07:00
Amir Bandeali
aeb9ffbf5a Store methodId and number of indexed args in AbiDecoder to differentiate between events with same function signature 2018-08-16 17:31:21 -07:00
Amir Bandeali
6dde6d7cb7 Increase max mintable amount 2018-08-16 17:31:21 -07:00
Amir Bandeali
1d70724bcf Fix DummyERC721Receiver 2018-08-16 17:31:21 -07:00
Amir Bandeali
77c87cd009 Update artifacts 2018-08-16 17:31:21 -07:00
Amir Bandeali
4dd59a370d Add tests for ERC20 token with no return values 2018-08-16 17:31:21 -07:00
Amir Bandeali
7a6e647386 Add constructor back to DummyERC721Token 2018-08-16 17:31:21 -07:00
Amir Bandeali
f5459164d2 Restructure directories 2018-08-16 17:31:21 -07:00
Amir Bandeali
2743eee044 Update checking for erc721 existence 2018-08-16 17:31:21 -07:00
Amir Bandeali
bb3c345891 Update ERC20Token 2018-08-16 17:31:21 -07:00
Amir Bandeali
0f3201d72a Optimize ERC721Token 2018-08-16 17:31:21 -07:00
Alex Browne
8131a87046 Merge pull request #978 from 0xProject/feature/lenra-3.0.0-beta.25
feat: Update lerna to version 3.0.0-beta.25 of our fork
2018-08-16 17:10:28 -07:00
fragosti
64a85dfb9c Rename websocket files and types 2018-08-16 17:03:11 -07:00
Fabio Berger
68d7eb5712 Fix comment 2018-08-16 17:02:47 -07:00
Fabio Berger
f7375fca98 Move doc configs to a separate file 2018-08-16 17:02:37 -07:00
fragosti
e079790f7f Use uuid as string for requestId 2018-08-16 16:51:55 -07:00
Fabio Berger
2604d40751 Merge pull request #965 from feuGeneA/sol-compile-lot
[sol-compiler] Compile in batches rather than one at a time
2018-08-16 16:42:37 -07:00
fragosti
89174cd63f Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/connect/sra-api-v2 2018-08-16 16:08:02 -07:00
fragosti
8cb1d2a0af Update changelogs 2018-08-16 16:05:34 -07:00
F. Eugene Aumson
c1ec849554 Merge branch 'development' into sol-compile-lot 2018-08-16 15:32:09 -07:00
Fabio Berger
def575b995 Remove outdating comment 2018-08-16 15:31:43 -07:00
dependabot[bot]
d0d6a6a500 Merge pull request #970 from 0xProject/dependabot/npm_and_yarn/copy-webpack-plugin-4.5.2 2018-08-16 22:30:15 +00:00
F. Eugene Aumson
445177bf42 move doesFileExist to fsWrapper 2018-08-16 15:26:20 -07:00
Fabio Berger
a4c3a0d39f Undo prettier 2018-08-16 15:15:30 -07:00
Fabio Berger
7c08f6d30a Update yarn.lock 2018-08-16 15:13:28 -07:00
Fabio Berger
0337b5a401 Merge development 2018-08-16 15:10:12 -07:00
dependabot[bot]
4d81ab679d Bump copy-webpack-plugin from 4.5.1 to 4.5.2
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v4.5.1...v4.5.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-16 22:09:01 +00:00
Fabio Berger
72752bcb68 Merge pull request #928 from 0xProject/dependabot/npm_and_yarn/copyfiles-2.0.0
Bump copyfiles from 1.2.0 to 2.0.0
2018-08-16 15:05:47 -07:00
Fabio Berger
e47e9c5b34 Fix external exports section name 2018-08-16 15:01:52 -07:00
F. Eugene Aumson
402ca27fbf change some *Sync to *Async 2018-08-16 15:01:33 -07:00
Fabio Berger
8e3df2b5ae Render external dep exports 2018-08-16 14:57:45 -07:00
Fabio Berger
bf9ee82d9f Remove stray console log 2018-08-16 13:59:50 -07:00
Fabio Berger
ae7bce7674 Add links for external dep exports to docJson 2018-08-16 13:56:29 -07:00
Fabio Berger
7d09a94428 Remove unused ContractWrapper export 2018-08-16 13:50:03 -07:00
Alex Browne
b7079e9616 feat: Update lerna to version 3.0.0-beta.25 of our fork 2018-08-16 13:20:07 -07:00
F. Eugene Aumson
85427a84df clarify variable names for artifact mod times 2018-08-16 11:17:57 -07:00
F. Eugene Aumson
a59f18927d flatten out interface to verifyAndPersist* method 2018-08-16 10:57:31 -07:00
F. Eugene Aumson
a607a61bde clarify iteration range 2018-08-16 10:48:33 -07:00
F. Eugene Aumson
421a7394df scrap comments in favor of self-documentation 2018-08-16 10:47:33 -07:00
F. Eugene Aumson
acb3c0d0aa declare contractData before adding to map 2018-08-16 10:42:03 -07:00
F. Eugene Aumson
11231795cd change return Promise<void> to await... 2018-08-16 10:32:27 -07:00
F. Eugene Aumson
6b6b368bf6 consolidate binPaths... ref's into fullSolcVersion 2018-08-16 10:29:36 -07:00
Fabio Berger
60f026e6fd Export Web3ProviderEngine directly instead of indirectly via subproviders 2018-08-16 08:45:43 -07:00
Jacob Evans
36668f9409 [Contract-wrappers] Exchange execute transaction encoder 2018-08-16 16:51:55 +10:00
Jacob Evans
480d28ea26 Merge pull request #959 from 0xProject/bug/order-utils/rounding-error-small-maker
[Order-utils] Order is valid when maker amount is very small
2018-08-16 12:13:27 +10:00
Jacob Evans
88c99396a2 Rename OrderAlreadyCancelledOrFilled -> OrderCancelled.
Remove try catch of throwing errors in favour of returning the Errors in a OrderValidationResult
2018-08-16 11:12:35 +10:00
fragosti
ca5e52920d Add fee recipients test 2018-08-15 17:52:13 -07:00
fragosti
30dfb7511d All previous tests passing 2018-08-15 17:36:54 -07:00
fragosti
1c87e5f698 Get orders async tests passing 2018-08-15 17:31:39 -07:00
F. Eugene Aumson
badcb35525 extract method _shouldCompile() 2018-08-15 17:22:35 -07:00
fragosti
c325d638c9 getAssetPairsAsync tests passing 2018-08-15 17:18:19 -07:00
Fabio Berger
baab0f27b5 Check for superfluous types in a packages index.ts and throw if they exist 2018-08-15 16:50:23 -07:00
Fabio Berger
9e7657ac5d Improve Error external link 2018-08-15 16:38:30 -07:00
Fabio Berger
237bac920a Remove unused types from 0x.js index.ts discovered 2018-08-15 16:38:07 -07:00
F. Eugene Aumson
89202b7bdf clarify recompilation tests 2018-08-15 16:01:57 -07:00
F. Eugene Aumson
20ac6936ac change .rejectedWith(error) to .rejected() 2018-08-15 16:01:04 -07:00
F. Eugene Aumson
976d159e52 follow chai_setup pattern 2018-08-15 15:51:25 -07:00
fragosti
e7f19e350e Project now builds 2018-08-15 15:10:39 -07:00
fragosti
41768617a9 Update test fixtures 2018-08-15 14:41:09 -07:00
F. Eugene Aumson
455c78dfb1 renamed variable compiled to compilerOutput 2018-08-15 14:09:57 -07:00
F. Eugene Aumson
ec41e314b0 use for...of _.keys instead of for...in 2018-08-15 13:39:33 -07:00
F. Eugene Aumson
8959b0993e raise error for unknown compiler version 2018-08-15 13:38:41 -07:00
F. Eugene Aumson
7c96fa45f8 comments 2018-08-15 13:10:49 -07:00
F. Eugene Aumson
ad9a7d72ce remedy missing *IfExists identifier suffix 2018-08-15 13:10:45 -07:00
F. Eugene Aumson
558286467b extract interfaces for re-used complex data types 2018-08-15 12:53:41 -07:00
F. Eugene Aumson
f0f94f199e move getSolcAsync to static private method 2018-08-15 12:53:33 -07:00
Fabio Berger
6e74d1519b Add externalTypeToLink to docJson 2018-08-15 11:37:06 -07:00
Fabio Berger
a8d44ccc48 Move external types to link mapping to doc generation util and refactor typedocUtils to be a class to avoid excessive param passing 2018-08-15 11:36:45 -07:00
F. Eugene Aumson
d744468479 rename variable inputsByVersion to versionToInputs 2018-08-15 11:21:46 -07:00
F. Eugene Aumson
c01810f0d7 move getSolcAsync to static private method 2018-08-15 11:13:09 -07:00
Jacob Evans
622509c508 [Order-utils] Order is valid when maker amount is very small
Previously our min fillable calculation would throw a rounding error
when encountering a valid order (with a small maker amount). This was
inconsistent with the on-chain logic which allowed this order to be
filled.
2018-08-15 13:06:32 +10:00
fragosti
bb992f8a49 Update parsing code 2018-08-14 19:16:36 -07:00
F. Eugene Aumson
c11d805469 Update changelog 2018-08-14 18:02:39 -07:00
Fabio Berger
3b8a343711 Add version to our custom DocJson format 2018-08-14 17:55:38 -07:00
Fabio Berger
83e3bb899e Move purging private underscored items to the doc json generation phase 2018-08-14 17:41:03 -07:00
F. Eugene Aumson
bb4558e0be test compiler 2018-08-14 17:40:31 -07:00
fragosti
3eeb9ddfa6 Update connect json-schemas 2018-08-14 17:31:19 -07:00
Fabio Berger
cb5d8d75bf Link class reference types exported in same package to their declaration 2018-08-14 17:24:48 -07:00
Fabio Berger
267078ed6c Remove duplicate Typescript import 2018-08-14 17:23:36 -07:00
fragosti
80e5127a46 Update types and add missing param to SRA spec 2018-08-14 17:16:03 -07:00
Fabio Berger
19e17ba128 Add ability to hide specific class constructors 2018-08-14 16:34:48 -07:00
Fabio Berger
04e00e0c28 Improve missing type detection 2018-08-14 16:34:21 -07:00
Fabio Berger
8bebffb147 Flesh out 0x.js index.ts and added some exports to other index.ts in the process 2018-08-14 16:25:37 -07:00
fragosti
5c40c466f6 Update json-schemas, update HTTPClient types 2018-08-14 16:06:09 -07:00
Brandon Millman
f9f232f5d9 Merge pull request #954 from 0xProject/refactor/order-utils/market-utils-api
[order-utils] Update marketUtils api to be friendlier
2018-08-14 15:45:21 -07:00
Brandon Millman
7b7b97dd7b Merge branch 'development' into refactor/order-utils/market-utils-api
* development:
  Bump @types/fetch-mock from 5.12.2 to 6.0.3
2018-08-14 15:21:28 -07:00
dependabot[bot]
b6cdc00a31 Bump copyfiles from 1.2.0 to 2.0.0
Bumps [copyfiles](https://github.com/calvinmetcalf/copyfiles) from 1.2.0 to 2.0.0.
- [Release notes](https://github.com/calvinmetcalf/copyfiles/releases)
- [Commits](https://github.com/calvinmetcalf/copyfiles/compare/v1.2.0...v2.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-14 21:51:13 +00:00
Fabio Berger
644fe1de8f Merge in new 0x.js interface 2018-08-14 14:45:10 -07:00
fragosti
ce88086e08 Update types to reflect v2 2018-08-14 14:40:52 -07:00
Fabio Berger
1d9408a8e0 Fix additional merge conflicts 2018-08-14 14:39:59 -07:00
Fabio Berger
c743f010e3 Merge pull request #920 from 0xProject/dependabot/npm_and_yarn/@types/fetch-mock-6.0.3
Bump @types/fetch-mock from 5.12.2 to 6.0.3
2018-08-14 14:38:49 -07:00
Fabio Berger
2f2582a0da Merge development 2018-08-14 14:21:47 -07:00
fragosti
c1cc92a46f Change names of basic types in Client interface 2018-08-14 14:00:16 -07:00
Brandon Millman
9c3d10d5be Merge branch 'development' into refactor/order-utils/market-utils-api
* development:
  feat: Upgrade TypeScript to 3.0.1
  Add defaults for networkId and pagination
  Update sortingUtils to support Order and SignedOrder
  Change rateUtils to use Order
  Updated CHANGELOG
  Fix lint errors
  Update tests for optional feeRate
  Make feeRate optional with a default of 0
  Add tests for sortingUtils
  Implement sorting utils
  Add tests for rateUtils
  Implement rate utils
2018-08-14 13:48:21 -07:00
Brandon Millman
3afe405bbe Merge pull request #953 from 0xProject/feature/order-utils/order-sorting-utils
[order-utils] Add rate and sorting utilities
2018-08-14 13:45:04 -07:00
Alex Browne
7eff195d61 Merge pull request #966 from 0xProject/feature/typescript-3.0.1
feat: Upgrade TypeScript to 3.0.1
2018-08-14 11:46:08 -07:00
F. Eugene Aumson
e79c7632e6 simplify method interface 2018-08-14 11:42:06 -07:00
F. Eugene Aumson
aa27346f93 simplify method parameter 2018-08-14 11:42:06 -07:00
F. Eugene Aumson
db6de490b2 corrected whitespace (no functional changes) 2018-08-14 11:42:06 -07:00
F. Eugene Aumson
014d71d5ae compile contracts in batches
one batch per compiler version needed.
2018-08-14 11:42:06 -07:00
F. Eugene Aumson
783bc873db extract method _verifyAndPersistCompilationAsync() 2018-08-14 11:42:06 -07:00
F. Eugene Aumson
478bf14289 extract method _compile() 2018-08-14 11:42:06 -07:00
F. Eugene Aumson
d89934954d extract function getSolcAsync() 2018-08-14 11:42:06 -07:00
Alex Browne
6baa5ef311 feat: Upgrade TypeScript to 3.0.1 2018-08-14 11:02:04 -07:00
dependabot[bot]
db20ad1c5d Bump @types/fetch-mock from 5.12.2 to 6.0.3
Bumps [@types/fetch-mock](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.12.2 to 6.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-08-14 06:21:07 +00:00
Francesco Agosti
56eb444ea4 Merge pull request #964 from 0xProject/feature/sra-api/add-defaults
[sra-api] Add defaults for networkId and pagination
2018-08-13 23:05:37 -07:00
Brandon Millman
6a2634d362 Make marketUtils interface compatible with Order and SignedOrder 2018-08-13 21:31:23 -07:00
Brandon Millman
a2192e62df Update CHANGELOG 2018-08-13 21:31:23 -07:00
Brandon Millman
66745c5260 Remove remaining amounts that are now defaults in tests 2018-08-13 21:31:22 -07:00
Brandon Millman
c10c4cec1d Update marketUtils api 2018-08-13 21:31:22 -07:00
Fabio Berger
f2d9dfb56b Remove 0x.js from Circle CI 2018-08-13 20:51:04 -07:00
fragosti
228387f995 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra-api/add-defaults 2018-08-13 18:52:32 -07:00
Fabio Berger
336519a690 Add PR nr. 2018-08-13 18:50:12 -07:00
Fabio Berger
10dc3ea81c Fix merge 2018-08-13 18:49:35 -07:00
fragosti
dd7e03c7d7 Add defaults for networkId and pagination 2018-08-13 18:46:54 -07:00
Alex Browne
fadd292ecf Publish
- 0x.js@1.0.1-rc.3
 - @0xproject/abi-gen@1.0.5
 - @0xproject/assert@1.0.5
 - @0xproject/base-contract@2.0.0-rc.1
 - @0xproject/connect@1.0.5
 - @0xproject/contract-wrappers@1.0.1-rc.3
 - contracts@2.1.40
 - @0xproject/dev-utils@1.0.4
 - ethereum-types@1.0.4
 - @0xproject/fill-scenarios@1.0.1-rc.3
 - @0xproject/json-schemas@1.0.1-rc.4
 - @0xproject/metacoin@0.0.15
 - @0xproject/migrations@1.0.4
 - @0xproject/monorepo-scripts@1.0.5
 - @0xproject/order-utils@1.0.1-rc.3
 - @0xproject/order-watcher@1.0.1-rc.3
 - @0xproject/react-docs@1.0.5
 - @0xproject/react-docs-example@0.0.20
 - @0xproject/react-shared@1.0.6
 - @0xproject/sol-compiler@1.0.5
 - @0xproject/sol-cov@2.0.0
 - @0xproject/sol-resolver@1.0.5
 - @0xproject/sra-api@1.0.1-rc.4
 - @0xproject/sra-report@1.0.5
 - @0xproject/subproviders@1.0.5
 - @0xproject/testnet-faucets@1.0.41
 - @0xproject/tslint-config@1.0.5
 - @0xproject/types@1.0.1-rc.4
 - @0xproject/typescript-typings@1.0.4
 - @0xproject/utils@1.0.5
 - @0xproject/web3-wrapper@1.2.0
 - @0xproject/website@0.0.44
2018-08-13 18:34:51 -07:00
Alex Browne
7c8a7a2420 Updated CHANGELOGS 2018-08-13 18:34:37 -07:00
Brandon Millman
99b744ba52 Update sortingUtils to support Order and SignedOrder 2018-08-13 18:32:15 -07:00
Fabio Berger
c320c8742e Add CHANGELOG entry about public interface refactor 2018-08-13 18:20:45 -07:00
Fabio Berger
3a086cae1a Merge branch 'development' into refactor/0x-js-exported-interface
* development:
  fix(0x.js, order-utils): Fix CHANGELOG.json versions
2018-08-13 18:15:50 -07:00
Fabio Berger
b10cba600d Refactor 0x.js to simply re-export it's own sub-dependencies rather then wrapping them in a ZeroEx object 2018-08-13 18:10:11 -07:00
Alex Browne
3b0fa1aa87 fix(0x.js, order-utils): Fix CHANGELOG.json versions 2018-08-13 18:06:27 -07:00
Brandon Millman
d859399841 Change rateUtils to use Order 2018-08-13 17:46:43 -07:00
Fabio Berger
8169155a65 Update yarn.lock 2018-08-13 16:56:05 -07:00
Fabio Berger
952367d532 Add missing types from 0x.js index.ts 2018-08-13 16:55:52 -07:00
Fabio Berger
67666446bf Add a check to make sure types part of the exported interface are also exported from the packages index.ts 2018-08-13 16:55:37 -07:00
Fabio Berger
3d1c8dfe06 Remove old comment 2018-08-13 16:52:45 -07:00
Alex Browne
283175df98 Run publish/installation tests in CircleCI (#951)
feat(monorepo-scripts): Run publish tests in CircleCI
2018-08-13 16:49:50 -07:00
Fabio Berger
aeb368a1d9 Merge pull request #932 from 0xProject/fix-ganache-fork
Fix ganache fork
2018-08-13 19:45:01 -04:00
Jacob Evans
e51deb93ee Merge pull request #914 from 0xProject/feature/0x.js/ec-signature-string
0x.js Return signature as a hex encoded string
2018-08-14 09:36:11 +10:00
Jacob Evans
a351757493 Update version numbers.
Add source for Metamask future fix.
Consolidate switch statement to one return
2018-08-14 09:18:13 +10:00
Francesco Agosti
0025c6640b Merge pull request #958 from 0xProject/feature/sra-api/camel-case-everything
[sra-api] Enforce camelCase for all parameters and other changes.
2018-08-13 15:12:01 -07:00
Alex Browne
25a8554be1 fix(sol-compiler, sol-resolver): Bug where sol-resolver tried to read a directory (#961)
fix(sol-compiler, sol-resolver): Fix bug where sol-resolver tried to read a directory
2018-08-13 14:17:05 -07:00
Fabio Berger
cd76c129da Merge pull request #955 from feuGeneA/patch-6
[PR template] a to-do list should be in the imperative mood
2018-08-13 16:46:34 -04:00
Fabio Berger
7340338626 Merge pull request #938 from 0xProject/sol-cov-fixes
Sol cov fixes
2018-08-13 16:40:46 -04:00
Fabio Berger
9d3c287918 Merge branch 'sol-cov-fixes' of github.com:0xProject/0x-monorepo into sol-cov-fixes
* 'sol-cov-fixes' of github.com:0xProject/0x-monorepo: (49 commits)
  Add @return comments
  Import marshaller directly
  Update comment about ethers checksummed address behavior
  Add packages/coverage/.gitkeep file
  Update CI config and package.json to run @0xproject/utils tests on CI
  Update remaining CHANGELOG.json files
  Change amir picture
  Update CHANGELOG.json for contract-wrappers
  Update ethers typings for TypeScript 2.9.2
  Update CHANGELOG.json for base-contract
  Move some ethers-related types to typescript-typings/ethers
  Apply prettier
  Add strictArgumentEncodingCheck to BaseContract and use it in contract templates
  fix(monorepo-scripts): Fix typo in git tag command
  feat(monorepo-scripts): Add confirmation prompt before publishing
  fix comments and styling for MixinSignatureValidator
  Update TypeScript to version 2.9.2
  Use asm for hashEIP712Message, increment free memory pointer after asm hashing functions
  Fix comments, styling, and optimize hashOrder
  Remove assertion comments
  ...
2018-08-13 13:01:32 -07:00
Fabio Berger
c2b5fe3d84 Remove test for unknown prop now that we are allowing additional props fro txData 2018-08-13 13:01:10 -07:00
fragosti
5ef84d61fa Ignore api.json in prettier 2018-08-13 12:58:15 -07:00
fragosti
58321a36dc apply prettier 2018-08-13 11:45:13 -07:00
Jacob Evans
ca4905c343 Rename from SignerProviderType.EthSign to SignerType.Default 2018-08-11 18:27:21 +10:00
fragosti
b6d793aec4 Enforce camelCase for all parameters and change the way the site is deployed and hosted 2018-08-10 15:56:47 -07:00
F. Eugene Aumson
83fb9df63d a to-do list should be in the imperative mood 2018-08-10 00:34:31 -07:00
Amir Bandeali
083319786f Merge pull request #948 from 0xProject/feature/contracts/forwarderFoK
[contracts] Make marketBuy functions revert if entire amount not filled
2018-08-09 17:22:56 -07:00
Francesco Agosti
719699eb30 Merge pull request #916 from 0xProject/feature/sra/add-sra-package
Add the sra-api package (OpenAPI Spec)
2018-08-09 17:02:43 -07:00
fragosti
889ec81ff3 Fix order-watcher json-schemas 2018-08-09 16:43:16 -07:00
fragosti
2f66f26048 Fix linting issues 2018-08-09 16:41:43 -07:00
fragosti
713f285f37 fix contract-wrappers json-schemas 2018-08-09 16:22:20 -07:00
Brandon Millman
ab64ea7377 Updated CHANGELOG 2018-08-09 19:20:07 -04:00
Brandon Millman
b86210332f Fix lint errors 2018-08-09 19:12:42 -04:00
Brandon Millman
af52598d32 Update tests for optional feeRate 2018-08-09 19:12:42 -04:00
Brandon Millman
cbe639866e Make feeRate optional with a default of 0 2018-08-09 19:12:42 -04:00
Brandon Millman
fcd57d2743 Add tests for sortingUtils 2018-08-09 19:12:42 -04:00
Brandon Millman
c0924d8067 Implement sorting utils 2018-08-09 19:12:42 -04:00
Brandon Millman
a1860b076d Add tests for rateUtils 2018-08-09 19:12:42 -04:00
Brandon Millman
32ab4dcac7 Implement rate utils 2018-08-09 19:12:42 -04:00
fragosti
938a99f435 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package 2018-08-09 15:57:12 -07:00
Alex Browne
f97ec000e1 Merge pull request #949 from 0xProject/fix/update-dependencies
fix: Update dependencies
2018-08-09 14:22:16 -07:00
Amir Bandeali
1b5c5e7a3b Change withdrawERC20 => withdrawAsset, reuse transfer logic 2018-08-09 14:07:27 -07:00
fragosti
c804e2230d Update Clays linkedin 2018-08-09 12:25:26 -07:00
fragosti
3f610d4865 Merge https://github.com/0xProject/0x-monorepo into development 2018-08-09 12:15:30 -07:00
fragosti
8404e0e73f Add clay to website 2018-08-09 12:15:18 -07:00
fragosti
b2c666bb1f Apply prettier 2018-08-09 11:42:05 -07:00
Alex Browne
f3761af567 fix: Update dependencies 2018-08-09 11:35:54 -07:00
Amir Bandeali
b9d8d2d5e3 Make marketBuy functions revert if entire amount not filled 2018-08-09 11:26:32 -07:00
Amir Bandeali
b60a74c8bc Merge pull request #941 from 0xProject/feature/contracts/returnValuesTests
[contracts] Test fillOrder return values and abiEncodeFillOrder
2018-08-09 10:39:14 -07:00
fragosti
0113ecee96 Change scripts folder to build_scripts 2018-08-09 10:13:37 -07:00
fragosti
eb20e86947 Force case change in file 2018-08-09 09:39:29 -07:00
Leonid Logvinov
15e15f994a Merge branch 'development' into sol-cov-fixes 2018-08-09 17:03:41 +02:00
Leonid Logvinov
d44ff6a915 Add @return comments 2018-08-09 17:02:13 +02:00
Leonid Logvinov
68605ca261 Import marshaller directly 2018-08-09 17:00:05 +02:00
Jacob Evans
5d4dd406f2 Update Changelogs. Rebased from development 2018-08-09 12:05:17 +10:00
Jacob Evans
9dd6ba7825 Update jsdoc 2018-08-09 12:02:17 +10:00
Jacob Evans
45e9fbe8f9 Introduce SignerProviderType
This allows the developer to indicate the nuanced signer provider. Some have different implementations (trezor, ledger) and others have different implementations (metamask). Breaking the abstraction of eth_sign. EthSign assumes a spec compliant implementation and can be used as a default
2018-08-09 12:02:12 +10:00
Alex Browne
53713188fe Merge pull request #915 from 0xProject/feature/encode-decode-checks
Add strictArgumentEncodingCheck to BaseContract and use it in contract templates
2018-08-08 18:28:15 -07:00
Alex Browne
c4c37cafa0 Update comment about ethers checksummed address behavior 2018-08-08 17:58:04 -07:00
Alex Browne
5b7774f9d0 Add packages/coverage/.gitkeep file 2018-08-08 17:33:20 -07:00
Alex Browne
ca7d8a8940 Update CI config and package.json to run @0xproject/utils tests on CI 2018-08-08 16:47:36 -07:00
Alex Browne
762bbe9bcd Update remaining CHANGELOG.json files 2018-08-08 16:44:52 -07:00
fragosti
03fb73d1d2 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into development 2018-08-08 15:50:59 -07:00
Amir Bandeali
d10e2652ae Revert incrementing memory ptr in dispatchTransferFrom 2018-08-08 15:44:43 -07:00
Amir Bandeali
9a5d7b7635 Test abiEncodeFillOrder as part of combinatorial follOrder tests 2018-08-08 15:44:43 -07:00
Amir Bandeali
1fb3da6b53 Increment free memory pointer for internal Exchange functions that use asm 2018-08-08 15:44:43 -07:00
Amir Bandeali
970bef717e Add return values to combinatorial fillOrder tests 2018-08-08 15:44:43 -07:00
fragosti
2a85f79040 Change amir picture 2018-08-08 15:42:09 -07:00
Amir Bandeali
651a468b44 Merge pull request #946 from 0xProject/fix/contracts/signatureValidatorComments
[contracts] Fix comments and styling for MixinSignatureValidator
2018-08-08 15:35:34 -07:00
fragosti
5e8ad0aef4 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package 2018-08-08 15:12:10 -07:00
Alex Browne
44d909c0c7 Update CHANGELOG.json for contract-wrappers 2018-08-08 14:54:35 -07:00
Alex Browne
44b01f2069 Update ethers typings for TypeScript 2.9.2 2018-08-08 14:52:05 -07:00
fragosti
d7d51791a6 Remove md hints because the static site cannot handle them 2018-08-08 14:50:06 -07:00
fragosti
9e3fe7092b Add section about json-schemas and sra report 2018-08-08 14:47:43 -07:00
fragosti
083d42c8f7 Fix links in markdown 2018-08-08 14:36:38 -07:00
fragosti
6121a6d2bf Add to changelog and fix OrderBook typo 2018-08-08 14:28:09 -07:00
Alex Browne
09af23f950 Update CHANGELOG.json for base-contract 2018-08-08 14:27:30 -07:00
Alex Browne
52e094addc Move some ethers-related types to typescript-typings/ethers 2018-08-08 14:27:30 -07:00
Alex Browne
6a6739ebbe Apply prettier 2018-08-08 14:27:30 -07:00
Alex Browne
6a5965d73b Add strictArgumentEncodingCheck to BaseContract and use it in contract templates 2018-08-08 14:27:30 -07:00
Alex Browne
19cda0eb03 Merge pull request #947 from 0xProject/feature/confirm-before-publish
Add confirmation prompt before publishing
2018-08-08 14:23:52 -07:00
fragosti
cc67c0df51 Correct orderbook typo 2018-08-08 14:18:24 -07:00
fragosti
76b91cbcda Enforce that error code are ints not number 2018-08-08 14:16:59 -07:00
Alex Browne
13f0d27f7c Merge pull request #945 from 0xProject/fix/typescript-2.9.2
Update TypeScript to version 2.9.2
2018-08-08 14:12:18 -07:00
Alex Browne
5ccf41c566 fix(monorepo-scripts): Fix typo in git tag command 2018-08-08 14:01:57 -07:00
Alex Browne
797fd38e00 feat(monorepo-scripts): Add confirmation prompt before publishing 2018-08-08 14:01:12 -07:00
fragosti
9aacceb0e4 Remove tests directory, use swagger api, make json api compliant 2018-08-08 14:00:50 -07:00
Amir Bandeali
68fb1bf376 fix comments and styling for MixinSignatureValidator 2018-08-08 13:58:29 -07:00
Amir Bandeali
a6ccfaf9ca Merge pull request #925 from 0xProject/refactor/contracts/hashing
[contracts] Fix comments, styling and small optimization for hashOrder
2018-08-08 13:48:31 -07:00
fragosti
c9e1b7c5dc Change remainingFillableAmount to metaData 2018-08-08 11:57:16 -07:00
Alex Browne
6e2e658162 Update TypeScript to version 2.9.2 2018-08-08 11:27:38 -07:00
Amir Bandeali
149c07dfd2 Use asm for hashEIP712Message, increment free memory pointer after asm hashing functions 2018-08-08 11:15:38 -07:00
Fabio Berger
9f42ceb5a3 Split publish_utils since it was becoming too big and unwieldy 2018-08-08 09:47:06 -04:00
Fabio Berger
386b5bb122 Add back hashSpy 2018-08-08 09:33:20 -04:00
Fabio Berger
ca67e7d36f Remove console.log 2018-08-08 09:32:32 -04:00
Fabio Berger
d49af66add Add additional special-case acronym 2018-08-08 09:32:14 -04:00
fragosti
853b5aa38b Change some static side configs 2018-08-07 18:18:37 -07:00
fragosti
4e30bc3e16 Add POST order endpoint 2018-08-07 17:58:38 -07:00
fragosti
95b656f360 Add GET fee_recipients 2018-08-07 17:42:52 -07:00
fragosti
b0a7db81cb Add GET order_config 2018-08-07 16:52:34 -07:00
fragosti
e6c91493f2 token_pairs -> asset_pairs 2018-08-07 16:26:25 -07:00
fragosti
3771df728c Add GET OrderBook endpoint 2018-08-07 16:24:31 -07:00
fragosti
f6dbc23995 Add GET order endpoint spec 2018-08-07 16:10:59 -07:00
fragosti
f36a43a83f Add orders endpoint 2018-08-07 15:39:33 -07:00
fragosti
f4c2fabbf8 Minor refactoring 2018-08-07 15:03:52 -07:00
Amir Bandeali
3d6cf50364 Fix comments, styling, and optimize hashOrder 2018-08-07 14:34:28 -07:00
fragosti
0a616ad3b8 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package 2018-08-07 13:52:53 -07:00
fragosti
57a4429123 Add discharge config and deploy 2018-08-07 13:50:56 -07:00
fragosti
3b542bf356 Add static site build 2018-08-07 13:36:59 -07:00
fragosti
be472b61e7 Add markdown section 2018-08-07 13:22:11 -07:00
Brandon Millman
8199e87943 Merge pull request #937 from 0xProject/feature/contract-wrappers/forwarder-estimation-utils
Add marketUtils object for assisting with market buy calculations
2018-08-06 16:36:32 -04:00
Brandon Millman
35201af4b1 Remove assertion comments 2018-08-06 16:35:49 -04:00
Fabio Berger
1a89905ab9 Remove hash spy for now 2018-08-06 15:39:21 -04:00
Fabio Berger
b2b3c24fd2 Remove console.log 2018-08-06 15:39:11 -04:00
Fabio Berger
bc5835229d Remove stray console log 2018-08-06 15:31:52 -04:00
Fabio Berger
6182d2c7f6 Pass in typeDefinitionByName so that type declarations also link to inner-types and show the popover 2018-08-06 15:28:21 -04:00
Fabio Berger
af90a777c6 Update types 2018-08-06 15:27:39 -04:00
Fabio Berger
fdcb42d8e1 Fix bug where we only rendered one TypeDoc JSON key per export, instead of all of them 2018-08-06 15:27:28 -04:00
Fabio Berger
4e6322beb5 Add missing type exports 2018-08-06 15:26:39 -04:00
Fabio Berger
6e122691d1 Fix bug related to react-scroll's scrollSpy and the render order of elements 2018-08-06 11:57:56 -04:00
Fabio Berger
ea5684e054 Remove unused imports 2018-08-06 11:01:12 -04:00
Fabio Berger
50bbd793c6 Fix key 2018-08-06 10:55:19 -04:00
Fabio Berger
a1a777e715 Add missing type 2018-08-06 10:49:17 -04:00
Fabio Berger
d234ee12de Update yarn.lock 2018-08-06 10:49:11 -04:00
Fabio Berger
50e0ddcf79 Update dep 2018-08-06 10:49:02 -04:00
Fabio Berger
da304de3fc Re-order deps 2018-08-06 10:48:45 -04:00
Fabio Berger
ff3c77f7c4 Remove stray console.lgos 2018-08-06 10:48:18 -04:00
Brandon Millman
0bc775cdb8 Remove 0x test case from hexSchema test 2018-08-05 21:02:10 -04:00
Brandon Millman
2273798df9 Update CHANGELOGs 2018-08-05 20:58:57 -04:00
Brandon Millman
7d0bec9b2a Add some test cases that stress slippageBufferAmount param 2018-08-05 20:54:29 -04:00
Brandon Millman
8382161f75 Add tests for findFeeOrdersThatCoverFeesForTargetOrders 2018-08-05 20:48:56 -04:00
Brandon Millman
bc5f8e52de Change orderStates param name to remaingFillableMakerAssetAmounts 2018-08-05 18:33:52 -04:00
Brandon Millman
09c0fc94fc Implement first round of tests for findOrdersThatCoverMakerAssetFillAmount 2018-08-05 18:33:52 -04:00
Brandon Millman
e5d65b585a Update hex schema to match 0x 2018-08-05 18:33:52 -04:00
Brandon Millman
d9933237a0 Move helper functions into order-utils 2018-08-05 18:33:52 -04:00
Brandon Millman
a016747c36 Add findFeeOrdersThatCoverFeesForTargetOrders to ForwarderWrapper 2018-08-05 18:33:52 -04:00
Brandon Millman
1c06380ef5 Add findOrdersThatCoverMakerAssetFillAmount static method on ForwarderWrapper 2018-08-05 18:33:52 -04:00
Brandon Millman
47fef1f8ff Merge pull request #936 from 0xProject/feature/contract-wrappers/forwader-optimizations
ForwarderWrapper order optimizations
2018-08-05 17:47:42 -04:00
Brandon Millman
3cb955c136 Move CreateOrderOpts into shared types 2018-08-05 17:15:58 -04:00
Brandon Millman
47673ba4bb Update createFactory to accept one createOrderOpts param to encompass all optional params 2018-08-05 16:54:35 -04:00
Fabio Berger
4527e9ce00 Remove prefix hack and add prefix for objectLiteral functions 2018-08-04 10:09:59 +02:00
Fabio Berger
7759e67a5a Rename EIP712Utils to eip712Utils since objectLiterals shouldn't start with caps 2018-08-04 10:09:08 +02:00
Brandon Millman
3865a081a0 Prettier 2018-08-03 16:46:55 -04:00
Fabio Berger
4d75689790 Fix commebt 2018-08-03 22:42:17 +02:00
Fabio Berger
6df8746871 Omit certain exports and re-org index.ts 2018-08-03 22:37:02 +02:00
Fabio Berger
c68e183953 Add missing sol-cov comments 2018-08-03 22:36:44 +02:00
Fabio Berger
f42119c928 Add missing compiler comments 2018-08-03 22:36:32 +02:00
Fabio Berger
30be039570 Add missing comments 2018-08-03 22:24:42 +02:00
Brandon Millman
d00ee5df0d Fix CHANGELOGs 2018-08-03 16:04:59 -04:00
Brandon Millman
4f381ca1d9 Update orderFactory interface 2018-08-03 16:04:47 -04:00
Fabio Berger
bcc1ad2086 Re-order index.ts and add missing types 2018-08-03 21:30:57 +02:00
Fabio Berger
343cd05363 Add missing comments 2018-08-03 21:27:01 +02:00
Fabio Berger
d9f09b5e1e Make rendering of individually exported functions lighter-weight 2018-08-03 19:45:09 +02:00
Fabio Berger
9337d207a1 Stop exporting constants from order-utils 2018-08-03 19:41:55 +02:00
Fabio Berger
c17d6c47c3 Properly render class/objectLiteral properties that are simple variables 2018-08-03 19:24:58 +02:00
Fabio Berger
a728247d6c Display camelCase names all-caps properly 2018-08-03 18:28:56 +02:00
Fabio Berger
36d615318d Omit several exports from order-utils docs 2018-08-03 17:52:09 +02:00
Fabio Berger
1588f4ac39 Stop exporting crypto 2018-08-03 17:51:58 +02:00
Fabio Berger
0e82be1bda Remove react-docs-example package and links to it 2018-08-03 17:18:18 +02:00
Fabio Berger
d85ce6ac75 Make signature_util into an object literal so related functions are rendered together in the docs 2018-08-03 17:15:14 +02:00
Fabio Berger
0d3d9dad84 Don't process functions beginning with underscores 2018-08-03 17:14:14 +02:00
Fabio Berger
b8c8258404 Don't render object literal properties that start with underscore since are private 2018-08-03 17:13:38 +02:00
Fabio Berger
3ee3fc2fb3 Add missing doc comments 2018-08-03 17:13:10 +02:00
Leonid Logvinov
bb4d15005a Add comments 2018-08-03 16:45:26 +02:00
Leonid Logvinov
477c3dc4f6 Add PR numbers 2018-08-03 16:28:00 +02:00
Leonid Logvinov
81f689e693 Add sol-cov CHANGELOG 2018-08-03 13:57:19 +02:00
Leonid Logvinov
e80fa6e311 Read truffle compiler config from truffle.js and assert that the passed solidity version matches the one in artifacts 2018-08-03 13:42:47 +02:00
Leonid Logvinov
c94168981c Use CallDataRPC in subprovider 2018-08-03 13:42:05 +02:00
Leonid Logvinov
749ec0cefe Add a TODO for failed transactions 2018-08-03 13:38:40 +02:00
Leonid Logvinov
bd488020df Export RPC data types from web3-wrapper 2018-08-03 13:36:16 +02:00
Leonid Logvinov
ab398751e1 Alow additional properties in txData json-schema 2018-08-03 13:34:40 +02:00
Leonid Logvinov
74d5f2f0b9 Export marshaller from web3-wrapper 2018-08-03 13:32:45 +02:00
Fabio Berger
10f6647ab3 Add missing types to web3-wrapper index.ts 2018-08-03 13:27:20 +02:00
Fabio Berger
406b7c33f5 Re-order subproviders index.ts and add missing types 2018-08-03 13:27:08 +02:00
Fabio Berger
13520dbd94 Add missing types to sol-cov index.ts 2018-08-03 13:02:29 +02:00
Fabio Berger
d136df7679 Color-code basic type arrays orange aswell 2018-08-03 13:02:14 +02:00
Fabio Berger
8c96a31152 Fix sol-compiler doc configs 2018-08-03 12:40:47 +02:00
Fabio Berger
d4bd4ec441 Add comments for types and unnest type declarations 2018-08-03 12:40:35 +02:00
Fabio Berger
e4aed98a3d Add missing type exports 2018-08-03 12:40:01 +02:00
Fabio Berger
4a2a22a43b Refactor logic for clarity 2018-08-03 11:44:50 +02:00
Fabio Berger
47584b18e9 Fix-up Order-utils doc page 2018-08-03 11:14:16 +02:00
Fabio Berger
6dd656bdfc Add OrderWatcher docs page 2018-08-03 11:14:01 +02:00
fragosti
260640feed Refactor using some utility methods 2018-08-02 20:19:50 -07:00
fragosti
36e7cb16aa Add errors and headers 2018-08-02 18:24:24 -07:00
fragosti
0390a5ecbf Limit error codes with ranges 2018-08-02 18:08:36 -07:00
Brandon Millman
82092ab50a Rename to calldata utils 2018-08-02 16:03:19 -07:00
Brandon Millman
c3e6be7956 Add missing PR numbers 2018-08-02 15:53:02 -07:00
fragosti
1ce6579c3a Create asset_pairs SRA endpoint (and establish conventions) 2018-08-02 15:25:40 -07:00
Fabio Berger
b5d98a2803 Fix link in 0x.js intro 2018-08-02 21:09:48 +02:00
Fabio Berger
c7a5b8c776 Add MD sections to contract-wrappers docs 2018-08-02 21:09:38 +02:00
Fabio Berger
90ead59d34 Add support for rendering nested IndexSignatures 2018-08-02 21:09:18 +02:00
Fabio Berger
faa980ffc3 Add ability to omit rendering specific exports and also support direct exports from index.ts 2018-08-02 21:08:21 +02:00
fragosti
afc5c2616a Enforce stronger naming convention for json schema ids 2018-08-02 11:57:23 -07:00
Fabio Berger
9a3b630b19 prettier 2018-08-02 17:27:29 +02:00
Fabio Berger
b3473ff89f Remove unused var 2018-08-02 17:27:10 +02:00
Fabio Berger
987971bd59 Fix bug where if there were multiple matches, it wouldn't always take the longest match 2018-08-02 17:26:53 +02:00
Fabio Berger
71a2f2d721 We need to always include the globals.d.ts otherwise TS complains about .json imports 2018-08-02 17:25:18 +02:00
Brandon Millman
6e74896620 CHANGELOG 2018-08-01 20:49:10 -07:00
Brandon Millman
30c6fe08ec Add tests 2018-08-01 20:47:59 -07:00
Brandon Millman
7c864b81e0 Add createOrder with no signing to orderFactory 2018-08-01 20:47:59 -07:00
Brandon Millman
4f006fdc5c Create marketBuyOrdersOptimizations 2018-08-01 20:23:44 -07:00
Brandon Millman
9f7f61085c Update contract-wrappers CHANGELOG.json 2018-08-01 15:29:47 -07:00
Brandon Millman
2414b47a30 Merge pull request #934 from 0xProject/feature/contract-wrappers/forwader
Initial forwarder contract wrapper
2018-08-01 15:26:45 -07:00
Fabio Berger
238eef6bae Fix connect docs 2018-08-02 00:01:23 +02:00
Fabio Berger
b92b745ab7 Don't ignore compiler errors 2018-08-02 00:01:16 +02:00
Fabio Berger
0132286cab Add contract-wrappers page and make topBar component more concise 2018-08-02 00:01:02 +02:00
fragosti
f8a252d142 All schema tests padding 2018-08-01 13:55:16 -07:00
fragosti
962d6e71b6 update orders channel subscribe schema 2018-08-01 13:52:40 -07:00
fragosti
48aaf22855 Update order book schema test 2018-08-01 13:34:10 -07:00
fragosti
8351f5998a Add relayerApiOrdersResponseTest 2018-08-01 13:27:01 -07:00
Fabio Berger
2494af99aa Prefix menu and sections with markdown as that is all the should now be defined 2018-08-01 21:00:45 +02:00
Fabio Berger
e5b93d1f02 Add callpath to properties 2018-08-01 20:48:19 +02:00
fragosti
86eafeb826 Add tests for asset pair endpoint 2018-08-01 11:44:59 -07:00
Fabio Berger
32e1c2ac97 Add padding above anchor titles so they show up nice when scrolled to 2018-08-01 19:02:20 +02:00
Fabio Berger
5e3bbbbb3c Use our fork of react-scroll that fixes scrolling within an absolutely positioned div to work correctly. See: https://github.com/fisshy/react-scroll/pull/330 2018-08-01 18:56:31 +02:00
Fabio Berger
3bdf6004ca Start refactoring docs to remove unnecessary configs given more concise TypeDoc JSON 2018-08-01 17:36:37 +02:00
Fabio Berger
11869122b4 Update React-scroll, getting rid of the need to manually set the url hash 2018-08-01 17:33:28 +02:00
Fabio Berger
9b24459108 Add /src/artifacts in order-utils to gitignore 2018-08-01 17:29:24 +02:00
Fabio Berger
c5fbc5c991 Also add artifacts to src 2018-08-01 17:28:48 +02:00
Fabio Berger
0413e3e77f Change order of index.ts since it not dictates to ordering of the docs 2018-08-01 17:27:33 +02:00
Fabio Berger
92fda0a940 Remove unused dep so that it's not re-compiled onWatcher 2018-08-01 17:27:10 +02:00
fragosti
63e088730a Group all standard relayer api tests together 2018-07-31 17:46:57 -07:00
fragosti
a78d35f84e Add test for relayerApiOrderSchema 2018-07-31 17:22:26 -07:00
fragosti
63e869f6d0 Add paginated collection test case 2018-07-31 17:04:22 -07:00
fragosti
4aff9515d8 Get schema tests running (not crashiing) 2018-07-31 16:37:51 -07:00
Leonid Logvinov
6f0daa5463 Add the CHANGELOG entry for #909 2018-07-31 15:28:17 +02:00
Leonid Logvinov
a658aaaf30 Merge pull request #909 from joincivil/ritave/resolver-check-dirs
Fixed the relative resolver not checking if the file can be read in the
2018-07-31 14:49:50 +02:00
Leonid Logvinov
37590d5f5e Merge branch 'development' into ritave/resolver-check-dirs 2018-07-31 14:47:51 +02:00
Brandon Millman
ca1f926d6d Clarify ethAmount is in wei 2018-07-31 00:26:53 -07:00
Brandon Millman
5d44a67e62 Update forwarder_wrapper_test 2018-07-31 00:11:29 -07:00
Brandon Millman
8ed3d59f96 Add more assertions 2018-07-31 00:11:29 -07:00
Brandon Millman
bc93ff0cb5 Write initial test for forwarder_wrapper 2018-07-31 00:11:29 -07:00
Brandon Millman
44498f2263 Fix spelling error in exchange wrapper tests 2018-07-31 00:11:29 -07:00
Brandon Millman
045751a430 Add getOrdersInfo to exchange_wrapper 2018-07-31 00:11:28 -07:00
fragosti
162fe797fc Update schemas export 2018-07-30 17:53:01 -07:00
fragosti
e671563f1e Update json-schemas for SRA v1 2018-07-30 17:16:14 -07:00
Brandon Millman
a7238d0fdb Implement initial forwarder wrapper 2018-07-30 13:58:19 -07:00
Fabio Berger
2a899f5295 Move to dep 2018-07-30 22:42:22 +02:00
Fabio Berger
b7cd84fad6 Remove outdated parts of Dockerfile 2018-07-30 22:42:05 +02:00
Fabio Berger
36b6da7c4f Fix github dep to point to branch 2018-07-30 22:41:51 +02:00
Brandon Millman
02eb575813 Merge pull request #931 from 0xProject/feature/website/meta-tags
Add MetaTags component for easily adding customizable meta tags for a new page
2018-07-30 13:28:09 -07:00
Brandon Millman
ca8a6665ba Add back tags in html 2018-07-30 13:27:27 -07:00
Fabio Berger
ba00cd916a Remove console 2018-07-30 21:09:56 +02:00
Fabio Berger
b4f916d214 Standardize child naming 2018-07-30 21:09:17 +02:00
Fabio Berger
79faf7d3cb Update yarn.lock 2018-07-30 15:40:20 +02:00
Fabio Berger
79b1b6c8e0 Fix bugs in doc gen 2018-07-30 15:40:10 +02:00
Brandon Millman
2ecf7a3349 Fix jobs page overflow issue 2018-07-30 00:58:30 -07:00
Brandon Millman
5283dcce2e Create MetaTags component 2018-07-30 00:48:39 -07:00
Fabio Berger
b56fc697c4 Move logic to publishUtils so can use as command-line and script import 2018-07-29 23:55:28 +02:00
Fabio Berger
b7ff1fe5d3 Move type 2018-07-29 23:34:49 +02:00
Fabio Berger
1b24064c9f Move publish_release_notes to own script and other publish cleanup 2018-07-29 23:34:42 +02:00
Fabio Berger
bb9237b0f4 Make monorepo-scripts a private package now that no other package depends on it 2018-07-29 23:01:21 +02:00
Fabio Berger
fe2787fcc1 Add back the 'clean' command 2018-07-29 23:00:44 +02:00
Fabio Berger
11778db05a Remove no longer necessary include 2018-07-29 23:00:33 +02:00
Fabio Berger
454af2bda3 Fix package.json 2018-07-29 22:49:34 +02:00
Fabio Berger
9f7479711e Improve doc gen script 2018-07-29 22:29:56 +02:00
Fabio Berger
4579e1637d Add missing exports discovered by generating compact typedoc JSON 2018-07-29 21:59:09 +02:00
Fabio Berger
f4a2e227e1 Remove all in-package monorepo-scripts by adding doc gen/upload and aggregate release note publishing to publish script 2018-07-29 21:58:39 +02:00
Francesco Agosti
48e538f5c7 Merge pull request #910 from 0xProject/feature/website/upgrade-allowance-toggles-to-locks-and-checks
[website] Use new designs with tooltips for allowance toggles
2018-07-27 12:02:29 -07:00
fragosti
c851c37630 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/website/upgrade-allowance-toggles-to-locks-and-checks 2018-07-27 11:51:30 -07:00
fragosti
a0d7b1efa5 Remove unused variable 2018-07-27 11:49:06 -07:00
fragosti
1a06e6b305 Add loading state for initial load and other PR feedback 2018-07-27 11:48:04 -07:00
fragosti
43d7045a5b Add scripts 2018-07-27 10:19:20 -07:00
Olaf Tomalka
9199a56b7a Added fix to CHANGELOG 2018-07-27 15:20:24 +02:00
Fabio Berger
44d1be27e6 Add note about needing Yarn 1.6 to README 2018-07-27 12:22:43 +02:00
Alex Browne
554d5f97df Add combinatorial tests for internal Exchange functions (#807)
* WIP add combinatorial tests for internal Exchange functions

* Change combinitorial testing strategy based on feedback

* Check value of filled[orderHash] in updateFilledState tests

* Add combinatorial tests for addFillResults

* Add combinatorial tests for getPartialAmount

* Implement generic `testWithReferenceFuncAsync`

* Implement generic `testCombinatoriallyWithReferenceFuncAsync`

* Add combinatorial tests for isRoundingError

* Add combinatorial tests for calculateFillResults

* Add support for Geth in internal contract tests

* Fix contract artifacts

* Change DECIMAL_PLACES to 78 and add a note.

* Document new functions in utils

* Optimize tests by only reseting state when needed

* Rename/move some files

* Print parameter names on failure in testWithReferenceFuncAsync

* Add to changelog for utils package

* Appease various linters

* Rename some more things related to FillOrderCombinatorialUtils

* Remove .only from test/exchange/internal.ts

* Remove old test for isRoundingError and getPartialAmount

* Appease linters again

* Remove old todos

* Fix typos, add comments, rename some things

* Re-add some LibMath tests

* Update contract internal tests to use new SafeMath revert reasons

* Apply PR feedback from Amir

* Apply PR feedback from Remco

* Re-add networks to ZRXToken artifact

* Remove duplicate Whitelist in compiler.json
2018-07-26 22:09:55 -07:00
fragosti
78a4b9897c Add to README 2018-07-26 16:58:27 -07:00
fragosti
c1fcbe3f04 Create API development environment and json distribution 2018-07-26 16:49:43 -07:00
fragosti
efa67d87aa Rename to sra-api 2018-07-26 14:52:23 -07:00
fragosti
4fe410a277 Add typescript typings for Open API spec 2018-07-26 14:47:02 -07:00
fragosti
3235606644 Reset CHANGELOG 2018-07-26 14:32:22 -07:00
fragosti
260976914d Add basic smoke test 2018-07-26 14:30:24 -07:00
fragosti
3ca4b7e7a7 Initial commit 2018-07-26 13:24:34 -07:00
Fabio Berger
95c627f581 Publish
- 0x.js@1.0.1-rc.2
 - @0xproject/abi-gen@1.0.4
 - @0xproject/assert@1.0.4
 - @0xproject/base-contract@1.0.4
 - @0xproject/connect@1.0.4
 - @0xproject/contract-wrappers@1.0.1-rc.2
 - contracts@2.1.39
 - @0xproject/dev-utils@1.0.3
 - @0xproject/fill-scenarios@1.0.1-rc.2
 - @0xproject/json-schemas@1.0.1-rc.3
 - @0xproject/metacoin@0.0.14
 - @0xproject/migrations@1.0.3
 - @0xproject/order-utils@1.0.1-rc.2
 - @0xproject/order-watcher@1.0.1-rc.2
 - @0xproject/react-docs@1.0.4
 - @0xproject/react-docs-example@0.0.19
 - @0xproject/react-shared@1.0.5
 - @0xproject/sol-compiler@1.0.4
 - @0xproject/sol-cov@1.0.3
 - @0xproject/sol-resolver@1.0.4
 - @0xproject/sra-report@1.0.4
 - @0xproject/subproviders@1.0.4
 - @0xproject/testnet-faucets@1.0.40
 - @0xproject/types@1.0.1-rc.3
 - @0xproject/utils@1.0.4
 - @0xproject/web3-wrapper@1.1.2
 - @0xproject/website@0.0.43
2018-07-26 17:42:30 +02:00
Fabio Berger
512dbb448b Updated CHANGELOGS 2018-07-26 17:42:22 +02:00
Fabio Berger
b793c1cc73 Update yarn.lock 2018-07-26 17:20:48 +02:00
Fabio Berger
aea048ecc7 Point to actual current version 2018-07-26 17:19:26 +02:00
Fabio Berger
d0e6413fcf Add changelog entries for other RCs that did publish 2018-07-26 17:12:17 +02:00
Fabio Berger
3b7ad1688b Fix changelogs and package versions for ones that weren't published 2018-07-26 17:10:59 +02:00
Fabio Berger
e907b99314 Fix circle.yml 2018-07-26 16:57:08 +02:00
Fabio Berger
973bcb0483 Publish
- 0x.js@1.0.1-rc.2
 - @0xproject/abi-gen@1.0.3
 - @0xproject/assert@1.0.3
 - @0xproject/base-contract@1.0.3
 - @0xproject/connect@1.0.3
 - @0xproject/contract-wrappers@1.0.1-rc.2
 - contracts@2.1.38
 - @0xproject/dev-utils@1.0.3
 - ethereum-types@1.0.3
 - @0xproject/fill-scenarios@1.0.1-rc.2
 - @0xproject/json-schemas@1.0.1-rc.2
 - @0xproject/metacoin@0.0.13
 - @0xproject/migrations@1.0.3
 - @0xproject/monorepo-scripts@1.0.4
 - @0xproject/order-utils@1.0.1-rc.2
 - @0xproject/order-watcher@1.0.1-rc.2
 - @0xproject/react-docs@1.0.3
 - @0xproject/react-docs-example@0.0.18
 - @0xproject/react-shared@1.0.4
 - @0xproject/sol-compiler@1.0.3
 - @0xproject/sol-cov@1.0.3
 - @0xproject/sol-resolver@1.0.3
 - @0xproject/sra-report@1.0.3
 - @0xproject/subproviders@1.0.3
 - @0xproject/testnet-faucets@1.0.39
 - @0xproject/tslint-config@1.0.4
 - @0xproject/types@1.0.1-rc.2
 - @0xproject/typescript-typings@1.0.3
 - @0xproject/utils@1.0.3
 - @0xproject/web3-wrapper@1.1.1
 - @0xproject/website@0.0.42
2018-07-26 16:27:08 +02:00
Fabio Berger
87fb9a76ce Updated CHANGELOGS 2018-07-26 16:26:57 +02:00
Fabio Berger
0187e0c47d Still test unrunnable packages for compilation issues 2018-07-26 16:20:20 +02:00
Fabio Berger
8732d8ece8 Add changelog entries for next RC publish 2018-07-26 16:02:49 +02:00
Fabio Berger
2e7c130f62 Expose lerna dep 2018-07-26 16:00:46 +02:00
Fabio Berger
a90f434df5 Split running packages that cannot be run in a node.js script 2018-07-26 15:58:35 +02:00
Fabio Berger
3b005ad47c Fix accidental import from test folder 2018-07-26 15:34:00 +02:00
Fabio Berger
735bc2f178 Re-enable deleted the dir after test runs 2018-07-26 15:32:53 +02:00
Fabio Berger
e3cfa6363d Change test:installation so it also causes run-time errors to appear 2018-07-26 15:32:30 +02:00
Fabio Berger
331b1cb9a0 Fix lint issue 2018-07-26 15:27:50 +02:00
Fabio Berger
55dbb0ece0 Always append monorepo root path so script can be called from anywhere 2018-07-26 14:42:07 +02:00
Fabio Berger
af4071e119 Delete any remenants of test-env dir before creating a new one 2018-07-26 14:23:45 +02:00
Fabio Berger
9947e643d0 Print version that will be tested 2018-07-26 14:23:07 +02:00
Fabio Berger
d3be4f2852 Add ending slash 2018-07-26 14:22:51 +02:00
Fabio Berger
e320f343f8 Add support for testing installations post-publish as well 2018-07-26 14:14:14 +02:00
Fabio Berger
f6cc7d9c3c Fix asset path 2018-07-26 14:04:47 +02:00
Fabio Berger
b756f76b0e Publish
- 0x.js@1.0.1-rc.1
 - @0xproject/abi-gen@1.0.2
 - @0xproject/assert@1.0.2
 - @0xproject/base-contract@1.0.2
 - @0xproject/connect@1.0.2
 - @0xproject/contract-wrappers@1.0.1-rc.1
 - contracts@2.1.37
 - @0xproject/dev-utils@1.0.2
 - ethereum-types@1.0.2
 - @0xproject/fill-scenarios@1.0.1-rc.1
 - @0xproject/json-schemas@1.0.1-rc.1
 - @0xproject/metacoin@0.0.12
 - @0xproject/migrations@1.0.2
 - @0xproject/monorepo-scripts@1.0.3
 - @0xproject/order-utils@1.0.1-rc.1
 - @0xproject/order-watcher@1.0.1-rc.1
 - @0xproject/react-docs@1.0.2
 - @0xproject/react-docs-example@0.0.17
 - @0xproject/react-shared@1.0.3
 - @0xproject/sol-compiler@1.0.2
 - @0xproject/sol-cov@1.0.2
 - @0xproject/sol-resolver@1.0.2
 - @0xproject/sra-report@1.0.2
 - @0xproject/subproviders@1.0.2
 - @0xproject/testnet-faucets@1.0.38
 - @0xproject/tslint-config@1.0.3
 - @0xproject/types@1.0.1-rc.1
 - @0xproject/typescript-typings@1.0.2
 - @0xproject/utils@1.0.2
 - @0xproject/web3-wrapper@1.1.0
 - @0xproject/website@0.0.41
2018-07-26 13:53:36 +02:00
Fabio Berger
034948065d Updated CHANGELOGS 2018-07-26 13:53:27 +02:00
Fabio Berger
0c2df7e589 Fix linter 2018-07-26 13:40:37 +02:00
Fabio Berger
2ae6a71ca3 Revert to using execAsync 2018-07-26 13:27:21 +02:00
Fabio Berger
206fd0f78e update yarn.lock 2018-07-26 13:20:35 +02:00
Fabio Berger
b84225ac70 Revert to publishing ethereum-types 2018-07-26 13:05:36 +02:00
Fabio Berger
5ebcea53d6 Fix marshaller import 2018-07-26 12:59:48 +02:00
Fabio Berger
a491e01144 Update yarn.lock 2018-07-26 12:52:25 +02:00
Fabio Berger
1236efc008 Temporarily have all packages depend on an older, published version of ethereum-types since we cannot publish a new one 2018-07-26 12:50:15 +02:00
Fabio Berger
e63bbdeb87 Temporarily make ethereum-types private to exclude from publishing 2018-07-26 12:40:31 +02:00
Fabio Berger
084ccb62a6 Add order-watcher artifacts to gitignore 2018-07-26 12:35:22 +02:00
Fabio Berger
015469885d Fix changelogs 2018-07-26 12:34:41 +02:00
Fabio Berger
061f223269 Remove artifacts for git 2018-07-26 12:15:01 +02:00
Fabio Berger
88ee35d5f9 Call 'lerna publish' with spawn so we see stderr and stdout in real-time 2018-07-26 12:14:13 +02:00
Francesco Agosti
6c5b33ec71 Merge pull request #902 from 0xProject/feature/web3-wrapper/unexport-marshaller
Stop exporting marshaller from web3-wrapper
2018-07-25 16:32:04 -07:00
Brandon Millman
31b8dd1bfc Remove careers page feature flag 2018-07-26 06:55:06 +08:00
Brandon Millman
35113487f1 Merge pull request #893 from 0xProject/feature/website/jobs-page-part2
Jobs page
2018-07-25 15:31:54 -07:00
Brandon Millman
9ce8e10115 Header copy change 2018-07-26 06:28:17 +08:00
Brandon Millman
d07d059eda Margin polish 2018-07-26 06:00:35 +08:00
Fabio Berger
d836b0f815 Also skip prompt when publishing for real 2018-07-25 22:34:50 +02:00
Fabio Berger
1b1733ce7c Merge pull request #911 from 0xProject/fix-v2-beta-migration
Update/Fix V2-beta-testnet migration & Use it in all RC packages
2018-07-25 22:21:32 +02:00
Fabio Berger
5fd64a969b Add order-watcher artifacts to prettierignore 2018-07-25 22:04:12 +02:00
Fabio Berger
9a762e584c Add contract-wrappers artifacts to prettierignore 2018-07-25 21:51:36 +02:00
Fabio Berger
7fc0fd9fb6 Prettier fixes 2018-07-25 21:36:56 +02:00
fragosti
da4b70fcae Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/web3-wrapper/unexport-marshaller 2018-07-25 10:33:13 -07:00
Fabio Berger
a0db69ee05 Missing artifact 2018-07-25 19:10:36 +02:00
Fabio Berger
2c62504b79 Replace hard-coded compact_artifacts with migrations artifacts 2018-07-25 18:47:40 +02:00
Fabio Berger
67303106dc Update order-utils to use 2.0.0-beta-testnet artifacts 2018-07-25 18:28:09 +02:00
Fabio Berger
600d574042 Remove artifacts which should no longer be commited 2018-07-25 18:18:28 +02:00
Fabio Berger
07d4f21807 Add artifacts to gitignore 2018-07-25 18:16:09 +02:00
Fabio Berger
4da12067b9 New WETH9 artifacts 2018-07-25 18:12:28 +02:00
Fabio Berger
24ab24879c Modify WETH9 event arg names to be identical to ERC20 standard suggested names 2018-07-25 18:10:10 +02:00
Fabio Berger
dc51741b83 Update artifacts in contract-wrappers, generate artifacts and improve README 2018-07-25 18:07:12 +02:00
Fabio Berger
dd979dbf6d Update the kovan addresses in artifacts 2018-07-25 14:58:04 +02:00
Fabio Berger
0cfea5613a Improve the README instructions for migrations 2018-07-25 14:57:38 +02:00
Fabio Berger
98dd3ecab7 Use infura 2018-07-25 14:49:33 +02:00
Fabio Berger
fe05e0bac3 Fix typo 2018-07-25 14:48:28 +02:00
Fabio Berger
d3f9b72c84 Update v2-beta-testnet migration 2018-07-25 13:12:26 +02:00
Fabio Berger
05b35c0fdc Merge pull request #908 from 0xProject/publish-fixes-rc
Publish Flow Fixes For RC releases
2018-07-25 12:33:08 +02:00
Fabio Berger
36b61650b3 Update yarn.lock to not use local npm registry 2018-07-25 12:13:45 +02:00
Brandon Millman
c37b6f0eeb Update open positions section 2018-07-25 18:08:05 +08:00
Fabio Berger
28114c3b5a Remove unused import 2018-07-25 12:04:45 +02:00
Fabio Berger
2617df4ec7 Update artifact 2018-07-25 12:04:00 +02:00
Fabio Berger
0d28c48eb9 update yarn.lock 2018-07-25 12:02:16 +02:00
Fabio Berger
c6a6a54cce Fix dep collision 2018-07-25 12:02:10 +02:00
Fabio Berger
e5aa03da64 merge v2-prototype 2018-07-25 11:59:29 +02:00
Fabio Berger
47c0195b07 Leave react-dom type version also unspecified 2018-07-25 11:57:17 +02:00
Fabio Berger
f13d43dbf5 Remove unused typwe 2018-07-25 11:54:51 +02:00
Fabio Berger
f9e99a27d3 Remove force publish 2018-07-25 11:51:06 +02:00
Brandon Millman
854b8fad22 Update benefits section 2018-07-25 17:48:12 +08:00
Fabio Berger
91c7105d43 Revert "Temporarily add changelog & package.json version changes"
This reverts commit 97268d2253.
2018-07-25 11:48:01 +02:00
Fabio Berger
c1e3533287 Add back build step 2018-07-25 11:47:52 +02:00
Brandon Millman
bb7c308081 Update mission section 2018-07-25 15:35:26 +08:00
Brandon Millman
fcbaf2f4e3 Header copy updates 2018-07-25 14:41:26 +08:00
Brandon Millman
109c5df973 Use isMobileWidth util 2018-07-25 14:24:00 +08:00
Brandon Millman
b0fab3ea4a Use our image component in mission 2018-07-25 14:21:39 +08:00
fragosti
490fed6228 Make a non-jank Spinner component and use it 2018-07-24 19:09:02 -07:00
fragosti
9c81692d48 Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/upgrade-allowance-toggles-to-locks-and-checks 2018-07-24 16:02:21 -07:00
fragosti
c505ba6f3e Center allowance toggles in account page 2018-07-24 15:58:33 -07:00
fragosti
ee71f57453 Increase allowance toggle loading spinner size by 1 2018-07-24 15:51:07 -07:00
Olaf Tomalka
f133aebfaf Fixed the relative resolver not checking if the file can be read in the
first place
2018-07-25 00:37:48 +02:00
fragosti
88556d31e2 Add unlocking and locking token copy 2018-07-24 15:32:12 -07:00
fragosti
c0d75c6476 Hide tooltip after allowance toggle click 2018-07-24 15:19:06 -07:00
fragosti
5b6cf447e5 Make tooltip appear to the left of the toggle when onboarding in progress 2018-07-24 15:11:46 -07:00
fragosti
3890f8224d Fix tooltip wrapping issue in onboardin 2018-07-24 14:44:31 -07:00
fragosti
b9f5c93830 Fix wrap button alignment issue 2018-07-24 14:19:19 -07:00
Leonid Logvinov
c40b3dea6c Specify registry url only if local publish attempted 2018-07-24 21:57:47 +02:00
Leonid Logvinov
dbc798596b Replace dry mode with local publishing mode 2018-07-24 21:57:47 +02:00
Amir Bandeali
fac90c446c Update orderEpoch comments 2018-07-24 10:46:08 -07:00
Fabio Berger
c5859b65a3 Install our fork of lerna and use it 2018-07-24 19:35:13 +02:00
Francesco Agosti
14bb697924 Merge pull request #891 from 0xProject/bug/website/wiki-page-topbar
Make topbar zIndex 1
2018-07-24 10:22:18 -07:00
Fabio Berger
dbd815c1e0 Merge pull request #905 from 0xProject/fix-rc-packages
Fix Published Packages Type Issues
2018-07-24 18:45:10 +02:00
Fabio Berger
9592a9a821 Omit specific version of react types 2018-07-24 17:15:25 +02:00
Fabio Berger
dd9f020c9b Correct next version 2018-07-24 17:15:18 +02:00
Fabio Berger
56f21f4bab Merge v2-prototype 2018-07-24 17:13:21 +02:00
Fabio Berger
91bc1b468b Omit specific version of react types 2018-07-24 16:44:40 +02:00
Fabio Berger
97268d2253 Temporarily add changelog & package.json version changes 2018-07-24 16:33:16 +02:00
Fabio Berger
14b3c50b69 Fix lerna verson 2018-07-24 16:29:55 +02:00
Fabio Berger
333bf9de05 Correct next version 2018-07-24 16:29:37 +02:00
Fabio Berger
16a38c687e Merge fix-rc-packages 2018-07-24 16:20:25 +02:00
Leonid Logvinov
24aa5cd1bf Make the test:installation work with the local npm registry 2018-07-24 16:08:17 +02:00
Leonid Logvinov
f699da90ba Pretend we defined types for @lerna/batch-packages 2018-07-24 16:07:32 +02:00
Leonid Logvinov
d1e33a3dff Add utils.getTopologicallySortedPackages 2018-07-24 16:07:11 +02:00
Leonid Logvinov
f50ac932d6 Introduce PackageJson file 2018-07-24 16:06:51 +02:00
Leonid Logvinov
cab32d7593 Add .npmrc to gitignore 2018-07-24 16:05:25 +02:00
Leonid Logvinov
2073aa9abc Test installation on latest version, not the packed one 2018-07-24 15:19:57 +02:00
Leonid Logvinov
0386025395 Temp: Force publish 2018-07-24 15:19:36 +02:00
Leonid Logvinov
0772403ea9 Fix(lerna): Change lerna version 2018-07-24 15:18:46 +02:00
Fabio Berger
8acfc9a2f9 improve logs 2018-07-24 13:43:27 +02:00
Fabio Berger
de087abc8d remove legacy prepublishOnly 2018-07-24 13:32:39 +02:00
Fabio Berger
98b2875512 Add --yes flag 2018-07-24 13:28:02 +02:00
Fabio Berger
e9e73aa0a3 Add node 2018-07-24 13:21:28 +02:00
Fabio Berger
d280311734 Use relative path to lerna executable 2018-07-24 13:19:31 +02:00
Fabio Berger
789762617f Upgrade to new lerna 2018-07-24 13:05:18 +02:00
Fabio Berger
6f38d1bee5 Add missing 'publish' 2018-07-24 12:46:40 +02:00
Fabio Berger
73d75bc405 Fix publish command 2018-07-24 12:44:38 +02:00
Fabio Berger
91dcfd5ee8 Use cdVersions flag instead of interactive prompt 2018-07-24 12:39:41 +02:00
Fabio Berger
5fe0e9f2e7 Temporarily use local lerna 2018-07-24 12:36:53 +02:00
Brandon Millman
51fb6e6a23 Always go to open positions when clicking CTA 2018-07-24 14:06:53 +08:00
Brandon Millman
9392d5c84f Fix hiding of dots on small screens 2018-07-24 13:51:37 +08:00
Brandon Millman
e49d136b99 Merge branch 'v2-prototype' into feature/website/jobs-page-part2
* v2-prototype: (38 commits)
  Revert "Publish"
  Publish
  Remove ERC721 callback functions
  Use != instead of > in loops, add sanity checks to market fill functions
  Add more tests and fixes
  Remove MConstants and MixinConstants for LibConstants
  Remove redundant external call by reimplementing fillOrderNoThrow
  Remove orders length check
  Add assertValidFillResults
  Update web3Wrapper CHANGELOG
  Get actual gasPrice from transaction instead of setting default
  Store orders length in varible before looping over orders
  Use transferFrom instead of safeTransferFrom
  Fix minimal tests
  Fix rounding error issues, use different logic when makerAsset is ZRX
  Rename marketSellEth => marketSellWeth
  Update percentage constants
  Update transferEthFeeAndRefund, add check to ERC721 transfer
  Refactor forwarding contract architecture, remove batch functions
  Updated CHANGELOGS
  ...
2018-07-24 13:43:26 +08:00
Fabio Berger
d50174b89e Add ignore flag 2018-07-23 21:33:03 +02:00
Fabio Berger
1d9a77027e Use include 2018-07-23 21:23:09 +02:00
Fabio Berger
b4cd8897b2 Dedup versionPrompt being triggered multiple times 2018-07-23 21:20:09 +02:00
Fabio Berger
df341717f7 Remove regex 2018-07-23 21:14:51 +02:00
Fabio Berger
68974313e1 Make regex less strict 2018-07-23 21:12:47 +02:00
Fabio Berger
39a06e1d3b Add timeout before writing to stdin 2018-07-23 21:10:44 +02:00
Fabio Berger
bfe57b84d6 Use string equals and remove returns 2018-07-23 20:59:41 +02:00
Fabio Berger
dae975b08c Add in print statements 2018-07-23 20:51:25 +02:00
Fabio Berger
27d44e3021 Add missing vars 2018-07-23 20:46:10 +02:00
Fabio Berger
df00d93b9c Also add private package new versions to packageToNextVersion 2018-07-23 20:44:47 +02:00
Fabio Berger
15bbbb3762 Make sure private packages have a next version 2018-07-23 20:36:03 +02:00
Fabio Berger
c9ee526d8b more bogus 2018-07-23 20:30:51 +02:00
Fabio Berger
b110d95de1 testing 2018-07-23 20:29:14 +02:00
Fabio Berger
76eab5d3ec Fix publish to give lerna actual version rather then the semver diff 2018-07-23 20:21:49 +02:00
Fabio Berger
4a2715e61f Update lerna.json 2018-07-23 20:19:04 +02:00
Fabio Berger
7fbcc3999f Changed artifacts 2018-07-23 20:16:16 +02:00
Fabio Berger
e873b8948f And also temporarily remove rebuilding from publish flow 2018-07-23 20:15:35 +02:00
Fabio Berger
c8108a1db2 Temporarily uncommented parts of publish flow 2018-07-23 20:12:18 +02:00
Fabio Berger
195c3af84e Fix lerna publish to include publishing prerelease versions 2018-07-23 19:56:53 +02:00
Fabio Berger
39724292e3 Omit building website before publish 2018-07-23 19:28:27 +02:00
Fabio Berger
24b5aa0e82 Add new RC versions to changelog so that these packages are publised as RC's 2018-07-23 19:18:09 +02:00
Fabio Berger
3af2ef8439 Revert "Revert "Publish""
This reverts commit a66ccaa1da.
2018-07-23 19:11:48 +02:00
Fabio Berger
e2d027e252 Add skip-git for testing 2018-07-23 19:09:35 +02:00
Fabio Berger
bddcebfbb1 Allow registry to be configured in lerna.json 2018-07-23 19:09:24 +02:00
Amir Bandeali
a05b14e4d9 Merge pull request #847 from 0xProject/refactor/contracts/simplify-forwarder
Refactor forwarding contract architecture, remove batch functions
2018-07-23 10:50:39 -05:00
Fabio Berger
9a36e73f4e Move solidity-parser-antlr type to dependencies since it's used as part of the packages public interface 2018-07-23 17:35:16 +02:00
Leonid Logvinov
a66ccaa1da Revert "Publish"
This reverts commit 3dc94051713e4a32796ce3b4ae4b70b527e24cfe.
2018-07-23 17:13:44 +02:00
Leonid Logvinov
f05a563802 Publish
- 0x.js@1.0.0
 - @0xproject/abi-gen@1.0.1
 - @0xproject/assert@1.0.1
 - @0xproject/base-contract@1.0.1
 - @0xproject/connect@1.0.1
 - @0xproject/contract-wrappers@1.0.0
 - contracts@2.1.36
 - @0xproject/dev-utils@1.0.1
 - ethereum-types@1.0.1
 - @0xproject/fill-scenarios@1.0.0
 - @0xproject/json-schemas@1.0.0
 - @0xproject/metacoin@0.0.11
 - @0xproject/migrations@1.0.1
 - @0xproject/monorepo-scripts@1.0.1
 - @0xproject/order-utils@1.0.0
 - @0xproject/order-watcher@1.0.0
 - @0xproject/react-docs@1.0.1
 - @0xproject/react-docs-example@0.0.16
 - @0xproject/react-shared@1.0.1
 - @0xproject/sol-compiler@1.0.1
 - @0xproject/sol-cov@1.0.1
 - @0xproject/sol-resolver@1.0.1
 - @0xproject/sra-report@1.0.1
 - @0xproject/subproviders@1.0.1
 - @0xproject/testnet-faucets@1.0.37
 - @0xproject/tslint-config@1.0.1
 - @0xproject/types@1.0.0
 - @0xproject/typescript-typings@1.0.1
 - @0xproject/utils@1.0.1
 - @0xproject/web3-wrapper@1.0.1
 - @0xproject/website@0.0.40
2018-07-23 17:13:44 +02:00
Amir Bandeali
06396b8874 Remove ERC721 callback functions 2018-07-23 10:02:51 -05:00
Amir Bandeali
e5e68de2d7 Use != instead of > in loops, add sanity checks to market fill functions 2018-07-23 10:02:51 -05:00
Amir Bandeali
dcc0908617 Add more tests and fixes 2018-07-23 10:02:51 -05:00
Amir Bandeali
45d68285f1 Remove MConstants and MixinConstants for LibConstants 2018-07-23 10:02:51 -05:00
Amir Bandeali
e20f3a0f97 Remove redundant external call by reimplementing fillOrderNoThrow 2018-07-23 10:02:51 -05:00
Amir Bandeali
c5029e61e3 Remove orders length check 2018-07-23 10:02:51 -05:00
Amir Bandeali
e90ed01105 Add assertValidFillResults 2018-07-23 10:02:51 -05:00
Amir Bandeali
d8099d53fe Update web3Wrapper CHANGELOG 2018-07-23 10:02:51 -05:00
Amir Bandeali
0a976a3fb8 Get actual gasPrice from transaction instead of setting default 2018-07-23 10:00:23 -05:00
Amir Bandeali
4636d5fbc2 Store orders length in varible before looping over orders 2018-07-23 10:00:23 -05:00
Amir Bandeali
3506ec1caa Use transferFrom instead of safeTransferFrom 2018-07-23 10:00:23 -05:00
Amir Bandeali
1f0e819756 Fix minimal tests 2018-07-23 10:00:23 -05:00
Amir Bandeali
799ff2a5c3 Fix rounding error issues, use different logic when makerAsset is ZRX 2018-07-23 10:00:23 -05:00
Amir Bandeali
ec5f768f9b Rename marketSellEth => marketSellWeth 2018-07-23 10:00:23 -05:00
Amir Bandeali
66ab010055 Update percentage constants 2018-07-23 10:00:23 -05:00
Amir Bandeali
6fb157488c Update transferEthFeeAndRefund, add check to ERC721 transfer 2018-07-23 10:00:23 -05:00
Amir Bandeali
814518dd80 Refactor forwarding contract architecture, remove batch functions 2018-07-23 10:00:23 -05:00
Amir Bandeali
554b18a466 Merge pull request #906 from 0xProject/refactor/contracts/examples
[contracts] Add `examples` directory
2018-07-23 10:00:06 -05:00
Leonid Logvinov
855b6b1dc5 Updated CHANGELOGS 2018-07-23 16:58:40 +02:00
Amir Bandeali
c2ae9f62a4 Add tests to verify ZRX_ASSET_DATA 2018-07-23 09:34:47 -05:00
Amir Bandeali
4159a8fe6e Add comments for deploying with constant ZRX_ASSET_DATA 2018-07-23 09:34:47 -05:00
Amir Bandeali
d8b44283a2 Move example contracts into new examples dir 2018-07-23 09:34:47 -05:00
Leonid Logvinov
2c1daf9c9a Add missing timestamps in CHANGELOGs 2018-07-23 16:24:13 +02:00
Fabio Berger
c7962216e9 Omit verson of react types 2018-07-23 16:02:03 +02:00
Leonid Logvinov
ffdaf88fd0 Add missing timestamps in CHANGELOGs 2018-07-23 15:57:16 +02:00
Fabio Berger
f84f879950 Stop specifying a specific version of @types/react so there can't be two instances of the type installed 2018-07-23 14:39:34 +02:00
Fabio Berger
eb6027fba7 Move hdkey typings to dependencies since it's part of the exported interface 2018-07-23 13:45:43 +02:00
Fabio Berger
9a1f0ac8e2 Add dependent types of the react-popper typings 2018-07-23 11:43:01 +02:00
Fabio Berger
51b6f8bc71 Revert "Move frontend package types out of typescript-typings since this package will be used in both node and browser contexts"
This reverts commit 74483631d0.
2018-07-23 11:42:01 +02:00
Fabio Berger
4f73b81b9c Add troubleshooting section to utils README 2018-07-23 11:00:27 +02:00
Amir Bandeali
195d11f9d0 Merge pull request #877 from 0xProject/feature/contracts/removeERC721Callback
Removed receiverData and `onReceive` callback from ERC721 proxy.
2018-07-22 18:14:09 -05:00
Fabio Berger
b325ad1735 Add additional required tsconfig option for utils package since it now relies on RequestInit & Response types defined in lib.dom.d.ts 2018-07-22 18:27:36 +02:00
Fabio Berger
74483631d0 Move frontend package types out of typescript-typings since this package will be used in both node and browser contexts 2018-07-22 16:22:19 +02:00
Fabio Berger
89b24a21a0 Add bn.js types as dep of typescript-typings since they are needed by ethereumjs-utils types 2018-07-22 15:57:47 +02:00
Fabio Berger
f0f13aa1dd Move ECSignature type from types package into eth-light-wallet type dec since only used there 2018-07-22 15:52:52 +02:00
Fabio Berger
06f61949f9 Merge pull request #880 from feuGeneA/patch-5
make PR template checklist more useful
2018-07-22 15:35:15 +02:00
Francesco Agosti
0e72b67865 Merge pull request #895 from 0xProject/feature/website/send-eth-from-portal
Send Ether from Portal
2018-07-22 03:45:21 -07:00
Fabio Berger
b987eebf21 Fix version of ethereumjs-abi to 0.6.5 to fix decoding bug 2018-07-22 07:37:12 +02:00
Fabio Berger
c808d12b74 Merge pull request #904 from lukeautry/luke/leading_zero_encode
0x.js v2: fix decodeAssetData for addresses starting in 0
2018-07-22 07:16:49 +02:00
Luke Autry
b466431ede fix decodeAssetData for addresses starting in 0 2018-07-21 18:05:33 -04:00
Amir Bandeali
bf69ca6e53 Merge pull request #899 from kroitor/patch-1
Deduplicate assert web3-wrapper signMessageAsync
2018-07-20 20:28:29 -07:00
Brandon Millman
6ffa907f0e Merge branch 'v2-prototype' into feature/website/jobs-page-part2
* v2-prototype: (103 commits)
  Add changelog entry for @0xproject/utils
  Add AbortController polyfill to fetchAsync in utils
  Increase node heap size for webpack command
  Add missing timestamp to CHANGELOG entries
  Upgrade some @0xproject packages to 1.0.0 in website
  Hard code fillOrder selector into abiEncodeFillOrder
  Returns byte array instead of memory range for encoding fillOrder calldata
  Created LibAbiEncoder with `fillOrderNoThrow`
  Add missing dep in migrations
  Fix the abi-gen entry point
  Fix linter error
  Remove the postinstall hook
  Update website package.json with original imports
  @0xproject/sra-report@1.0.0
  Change all package to depend on the new @0xproject/connect@1.0.0
  @0xproject/connect@1.0.0
  Use old assert version in @0xproject/connect
  FIx a typo
  Remove rc versions from unmigrated packages
  0x.js@1.0.0-rc.2
  ...
2018-07-20 16:15:04 -07:00
Brandon Millman
e54501522d Merge pull request #903 from 0xProject/bug/website/fix-website
Add AbortController polyfill to fetchAsync in utils
2018-07-20 13:51:12 -07:00
Brandon Millman
f2baeddc30 Merge branch 'v2-prototype' into bug/website/fix-website
* v2-prototype:
  Add missing timestamp to CHANGELOG entries
2018-07-20 12:07:27 -07:00
Brandon Millman
fd349b618a Add changelog entry for @0xproject/utils 2018-07-20 12:05:47 -07:00
Brandon Millman
6ca2a02766 Add AbortController polyfill to fetchAsync in utils 2018-07-20 11:58:38 -07:00
Brandon Millman
d9a282bd92 Increase node heap size for webpack command 2018-07-20 11:56:20 -07:00
Fabio Berger
dc151f7290 Add missing timestamp to CHANGELOG entries 2018-07-20 20:13:53 +02:00
Brandon Millman
cce2127f72 Upgrade some @0xproject packages to 1.0.0 in website 2018-07-20 10:55:47 -07:00
fragosti
0f8e6b395e WIP for allowance toggle redesign working 2018-07-20 10:44:59 -07:00
fragosti
b28cc6d7d3 Show token name dynamically in tooltip 2018-07-20 10:14:17 -07:00
fragosti
3bf12a98a7 Implement tooltips 2018-07-20 09:55:08 -07:00
fragosti
f27084ced4 Add loading state 2018-07-20 09:16:55 -07:00
fragosti
cdcf624e9e Have basic lock and check working in walelt 2018-07-20 08:52:14 -07:00
fragosti
ad4c2b95e4 Add remove marshaller to changelog notes 2018-07-20 08:51:16 -07:00
Amir Bandeali
8e7c395f59 Merge pull request #892 from 0xProject/refactor/contracts/LibAbiEncoder
Created LibAbiEncoder with `fillOrderNoThrow`
2018-07-20 07:43:40 -07:00
Amir Bandeali
02d50a513a Hard code fillOrder selector into abiEncodeFillOrder 2018-07-20 07:37:40 -07:00
Greg Hysen
d61759f6dd Returns byte array instead of memory range for encoding fillOrder calldata 2018-07-20 07:37:40 -07:00
Greg Hysen
5790ed7ba9 Created LibAbiEncoder with fillOrderNoThrow 2018-07-20 07:37:40 -07:00
fragosti
067adbfb62 Stop exporting marshaller from web3-wrapper 2018-07-20 07:37:17 -07:00
Leonid Logvinov
7fadba59e7 Merge pull request #901 from 0xProject/feature/abi-gen-fix
Fix the abi-gen entry point
2018-07-20 16:34:17 +02:00
Fabio Berger
bcde0731db Merge branch 'v2-prototype' of github.com:0xProject/0x-monorepo into v2-prototype
* 'v2-prototype' of github.com:0xProject/0x-monorepo:
  Fix linter error
  Remove the postinstall hook
2018-07-20 16:31:49 +02:00
Fabio Berger
052afb67a4 Add missing dep in migrations 2018-07-20 16:31:39 +02:00
Leonid Logvinov
6e15d7bb0f Fix the abi-gen entry point 2018-07-20 16:30:47 +02:00
Igor Kroitor
5bb68974ec Deduplicate assert web3-wrapper signMessageAsync 2018-07-20 08:49:16 +03:00
Leonid Logvinov
0a3ba4d27d Fix linter error 2018-07-20 02:06:11 +02:00
Leonid Logvinov
482a226dc5 Remove the postinstall hook 2018-07-20 02:02:16 +02:00
Fabio Berger
9e69458ba8 Merge branch 'v2-prototype' of github.com:0xProject/0x-monorepo into v2-prototype
* 'v2-prototype' of github.com:0xProject/0x-monorepo:
  @0xproject/sra-report@1.0.0
  Change all package to depend on the new @0xproject/connect@1.0.0
2018-07-20 01:24:19 +02:00
Fabio Berger
71e386d5fa Update website package.json with original imports 2018-07-20 01:22:48 +02:00
Leonid Logvinov
60b501b137 @0xproject/sra-report@1.0.0 2018-07-20 01:07:44 +02:00
Leonid Logvinov
36f8e9f1d5 Change all package to depend on the new @0xproject/connect@1.0.0 2018-07-20 01:06:14 +02:00
Leonid Logvinov
78707bd3ca @0xproject/connect@1.0.0 2018-07-20 01:03:15 +02:00
Leonid Logvinov
56137d0605 Use old assert version in @0xproject/connect 2018-07-20 01:01:54 +02:00
Leonid Logvinov
681a582630 FIx a typo 2018-07-20 00:54:44 +02:00
Leonid Logvinov
846a447c4d Remove rc versions from unmigrated packages 2018-07-20 00:50:13 +02:00
Leonid Logvinov
f76be4f016 0x.js@1.0.0-rc.2 2018-07-20 00:45:19 +02:00
Fabio Berger
ed19067096 Move methods in ZeroEx.assetData to ZeroEx itself 2018-07-20 00:39:23 +02:00
Leonid Logvinov
eb9f7c2c9d Fix scoping of assets in 0x.js 2018-07-20 00:21:59 +02:00
Leonid Logvinov
52693f7d0a 0x.js@1.0.0-rc.1 2018-07-20 00:11:00 +02:00
Leonid Logvinov
5e015872ef Remove bundles config 2018-07-20 00:07:25 +02:00
Leonid Logvinov
08c291bd3f @0xproject/order-watcher@1.0.0-rc.1 2018-07-20 00:05:44 +02:00
Leonid Logvinov
48c5d69c9d Add monorepo-scripts postpublish.ts 2018-07-20 00:05:25 +02:00
Leonid Logvinov
0f9c262bb0 Change all package to depend on the new @0xproject/contract-wrappers@1.0.0-rc.1 2018-07-20 00:01:24 +02:00
Leonid Logvinov
dff0fc65bf @0xproject/contract-wrappers@1.0.0-rc.1 2018-07-19 23:56:46 +02:00
Leonid Logvinov
161f96c07d Change all package to depend on the new @0xproject/migrations@1.0.0 2018-07-19 23:50:46 +02:00
Leonid Logvinov
67ad21b368 @0xproject/migrations@1.0.0 2018-07-19 23:46:23 +02:00
Leonid Logvinov
d5e633c38f Change all package to depend on the new @0xproject/sol-cov@1.0.0 2018-07-19 23:44:51 +02:00
Leonid Logvinov
617ef5b6ce @0xproject/sol-cov@1.0.0 2018-07-19 23:42:28 +02:00
Leonid Logvinov
8bd4e38d02 Change all package to depend on the new @0xproject/react-docs@1.0.0 2018-07-19 23:39:28 +02:00
Leonid Logvinov
f364b5c5ab @0xproject/react-docs@1.0.0 2018-07-19 23:38:13 +02:00
Leonid Logvinov
6486fced34 Change all package to depend on the new @0xproject/react-shared@1.0.0 2018-07-19 23:37:01 +02:00
Leonid Logvinov
bc9f2a51a2 @0xproject/react-shared@1.0.0 2018-07-19 23:35:14 +02:00
Leonid Logvinov
9c03b54d75 Copy postpublish scripts on build in fill-scenarios 2018-07-19 23:32:46 +02:00
Leonid Logvinov
eae08ea1e4 Change all package to depend on the new @0xproject/fill-scenarios@1.0.0-rc.1 2018-07-19 23:32:31 +02:00
Leonid Logvinov
6f276223c6 @0xproject/fill-scenarios@1.0.0-rc.1 2018-07-19 23:28:05 +02:00
Leonid Logvinov
21effcaa8b Change all package to depend on the new @0xproject/order-utils@1.0.0-rc.1 2018-07-19 23:26:32 +02:00
Leonid Logvinov
114b31a813 @0xproject/order-utils@1.0.0-rc.1 2018-07-19 23:23:37 +02:00
Leonid Logvinov
1a1b7a2bc4 Change all package to depend on the new @0xproject/sol-compiler@1.0.0 2018-07-19 23:21:29 +02:00
Leonid Logvinov
c9b213839a @0xproject/sol-compiler@1.0.0 2018-07-19 23:19:38 +02:00
Leonid Logvinov
4043fa76cc Change all package to depend on the new @0xproject/dev-utils@1.0.0 2018-07-19 23:16:47 +02:00
Leonid Logvinov
9c8e3bc4c9 @0xproject/dev-utils@1.0.0 2018-07-19 23:14:30 +02:00
Leonid Logvinov
18b1f01641 Change all package to depend on the new @0xproject/subproviders@1.0.0 2018-07-19 23:12:44 +02:00
Leonid Logvinov
9085c674e4 @0xproject/subproviders@1.0.0 2018-07-19 23:10:57 +02:00
Leonid Logvinov
b5d19d3fb1 Change all package to depend on the new @0xproject/base-contract@1.0.0 2018-07-19 23:05:01 +02:00
Leonid Logvinov
cc0477153b Fix the scripts build 2018-07-19 23:03:55 +02:00
Leonid Logvinov
76008b41c5 @0xproject/base-contract@1.0.0 2018-07-19 23:02:15 +02:00
Leonid Logvinov
8193fdc304 Change all package to depend on the new @0xproject/web3-wrapper@1.0.0 2018-07-19 22:57:27 +02:00
Leonid Logvinov
9d06c81078 FIx a typo 2018-07-19 22:56:17 +02:00
Leonid Logvinov
cdf85e5eee @0xproject/web3-wrapper@1.0.0 2018-07-19 22:54:32 +02:00
Leonid Logvinov
d774dbc432 Change all package to depend on the new @0xproject/abi-gen@1.0.0 2018-07-19 22:47:58 +02:00
Leonid Logvinov
0369f5ebc4 @0xproject/abi-gen@1.0.0 2018-07-19 22:46:33 +02:00
Leonid Logvinov
1e6b11b27e Change all package to depend on the new @0xproject/assert@1.0.0 2018-07-19 22:45:22 +02:00
Leonid Logvinov
7a8231435b Add forgotten file to git 2018-07-19 22:43:56 +02:00
Leonid Logvinov
b1aa7725df @0xproject/assert@1.0.0 2018-07-19 22:41:35 +02:00
Leonid Logvinov
bfe0ba3e9a Change all package to depend on the new @0xproject/sol-resolver@1.0.0 2018-07-19 22:39:42 +02:00
Leonid Logvinov
2d39329ee7 Add monorepo-scripts to sol-resolver 2018-07-19 22:38:19 +02:00
Leonid Logvinov
761b0063a0 @0xproject/sol-resolver@1.0.0 2018-07-19 22:33:24 +02:00
Leonid Logvinov
0f27ce3424 Change all package to depend on the new @0xproject/json-schemas@1.0.0-rc.1 2018-07-19 22:30:09 +02:00
Leonid Logvinov
2b0c0a6ff7 @0xproject/json-schemas@1.0.0-rc.1 2018-07-19 22:26:35 +02:00
Leonid Logvinov
5bd96f6fe9 Change the next @0xproject/json-schemas version to be 1.0.0-rc.1 2018-07-19 22:26:13 +02:00
Leonid Logvinov
37ac6749ba Change all package to depend on the new @0xproject/utils@1.0.0 2018-07-19 22:22:51 +02:00
Leonid Logvinov
bf955bd87f @0xproject/utils@1.0.0 2018-07-19 22:20:35 +02:00
Leonid Logvinov
6bd921d0bc Add a missing CHANGELOG entry 2018-07-19 22:20:08 +02:00
Leonid Logvinov
534decea95 Change all package to depend on the new @0xproject/types@1.0.0-rc.1 2018-07-19 22:17:55 +02:00
Leonid Logvinov
267830d463 FIx a typo 2018-07-19 22:15:31 +02:00
Leonid Logvinov
e82d0c21ec @0xproject/types@1.0.0-rc.1 2018-07-19 22:06:05 +02:00
Leonid Logvinov
ece6417699 Change the next @0xproject/types version to be 1.0.0-rc.1 2018-07-19 22:05:22 +02:00
Leonid Logvinov
74d5449719 Change all package to depend on the new @0xproject/tslint-config@1.0.0 2018-07-19 22:03:23 +02:00
Leonid Logvinov
4af7ff9cc3 @0xproject/tslint-config@1.0.0 2018-07-19 22:01:18 +02:00
Leonid Logvinov
46dedfcb67 Change the next @0xproject/tslint-config version to be 1.0.0 2018-07-19 22:00:58 +02:00
Leonid Logvinov
a9fa1a0df6 Change all package to depend on the new @0xproject/typescript-typings@1.0.0 2018-07-19 21:54:44 +02:00
Leonid Logvinov
a8572b4944 @0xproject/typescript-typings@1.0.0 2018-07-19 21:51:38 +02:00
Leonid Logvinov
91c0d47ad4 Change the next @0xproject/typescript-typings version to be 1.0.0 2018-07-19 21:51:12 +02:00
Leonid Logvinov
fd2611794a Change all package to depend on the new @0xproject/monorepo-scripts@1.0.0 2018-07-19 21:49:03 +02:00
Leonid Logvinov
1fe1c5321b @0xproject/monorepo-scripts@1.0.0 2018-07-19 21:45:38 +02:00
Leonid Logvinov
f063a5db0f Change all package to depend on the new ethereum-types@1.0.0 2018-07-19 21:44:09 +02:00
Leonid Logvinov
3883315447 Make PR numbers links on Github releases 2018-07-19 21:40:50 +02:00
Leonid Logvinov
7679e07957 v1.0.0 2018-07-19 21:28:51 +02:00
Leonid Logvinov
c39ba37ad8 Change the next ethereum-types version to be 1.0.0 2018-07-19 21:28:06 +02:00
Fabio Berger
f1c3840c3b Merge pull request #897 from 0xProject/doc-changes
Doc Changes for RC publish
2018-07-19 21:10:06 +02:00
Fabio Berger
e5c5b36a73 Specify exact version 2018-07-19 21:05:37 +02:00
Fabio Berger
c51f7a8375 Add PR nr. 2018-07-19 20:51:33 +02:00
Fabio Berger
e53e2ac31b Fix version dropdown so it also renders RC versions properly 2018-07-19 20:45:20 +02:00
Fabio Berger
b72857cd8b Update doc md files for v2 packages 2018-07-19 20:45:00 +02:00
Fabio Berger
cc223b9eab Compare host rather then origin so that it comes without the http/https prefix 2018-07-19 19:01:25 +02:00
Fabio Berger
f2c49e8b37 Merge branch 'v2-prototype' into doc-changes
* v2-prototype:
  Add missing import
  Remove comment and add assertion
  Add ability to nest doc ref markdown under specific versions
2018-07-19 18:15:35 +02:00
Fabio Berger
9b6476a6b7 Merge pull request #844 from 0xProject/support-multiple-doc-md
Support version-specific doc ref markdown sections
2018-07-19 18:14:58 +02:00
Fabio Berger
d8898cf9a3 merge v2-prototype 2018-07-19 17:48:06 +02:00
Fabio Berger
34df5af295 Don't export object literal because the docs cannot yet render them, moved type to types file 2018-07-19 17:46:24 +02:00
Fabio Berger
3de88d5345 Merge pull request #896 from 0xProject/update-lerna
Update Lerna & other small changes
2018-07-19 17:37:04 +02:00
Fabio Berger
9ab6ab1bf9 Improve log 2018-07-19 17:22:26 +02:00
Fabio Berger
b6de0bdd43 Merge branch 'v2-prototype' into update-lerna
* v2-prototype: (48 commits)
  Update CHANGELOG
  Rename call data schema id to CallData. Check for TypedArray when hashing data in order-utils crypto
  Fix broken links in sol-cov documentation
  Fix 0x.js ts warnings
  Update yarn.lock
  Fix 0x.js ts warnings
  Fix 0x.js tests on CI
  Fix a bad merge
  Update package versions
  Merge
  Update changelogs
  Add a test for ERC721 Allowance
  Use allowance instead of approval for all in fill-scenarios
  Upgrade sha3 to 1.2.2 to work with node v10
  Check if the token doesn't exist before minting in fill scenarios
  Make downlevelIteration a global config
  Fix tests descriptions
  DRY up the code in order-watcher collision-resistant abi decoder
  Await transactions in fillScenarios
  Rename decodeAssetData to decodeAssetDataOrThrow
  ...
2018-07-19 16:38:33 +02:00
Fabio Berger
a2b62fd808 Update yarn.lock 2018-07-19 16:38:02 +02:00
fragosti
fc166dea26 Add zIndex 1 to topbar and fix issue where no box-shadow present on /docs 2018-07-19 07:36:41 -07:00
Fabio Berger
f9c4d0925e Add additional pattern removal and added HACK comment 2018-07-19 16:32:03 +02:00
Fabio Berger
1df9370bc2 Renames to remove mention of Lerna 2018-07-19 16:26:45 +02:00
Fabio Berger
7d840c7a18 Remove unused declaration 2018-07-19 16:26:00 +02:00
fragosti
ff12aafc0f Remove TODO 2018-07-19 07:04:48 -07:00
fragosti
c08b4aa6a1 Remove unused Token import 2018-07-19 06:59:35 -07:00
fragosti
52a6e6357b Add lifecycle messages 2018-07-19 06:57:00 -07:00
Fabio Berger
74c0fd419b Upgrade Lerna to 3.0-Beta14 2018-07-19 15:51:38 +02:00
Fabio Berger
6f540e3e58 Replace lerna-get-packages with our own implementation 2018-07-19 15:50:21 +02:00
fragosti
dead04dce8 WIP for sending ether from portal (works) 2018-07-19 04:11:44 -07:00
Jacob Evans
886a03fdcd Merge pull request #894 from 0xProject/bug/minor-fixes-json-schema-order-utils
Rename json schema call data id to CallData.
2018-07-19 20:06:37 +10:00
Jacob Evans
81007c453c Update CHANGELOG 2018-07-19 19:51:07 +10:00
Jacob Evans
6529e06057 Rename call data schema id to CallData.
Check for TypedArray when hashing data in order-utils crypto
2018-07-19 17:51:03 +10:00
Brandon Millman
55336f96d7 Fix broken links in sol-cov documentation 2018-07-18 15:53:33 -07:00
Brandon Millman
938aabde3d Update hr color 2018-07-18 14:47:02 -07:00
Brandon Millman
c7f196b579 Fix lint errors 2018-07-18 14:30:44 -07:00
Brandon Millman
b28a88dbb2 Add /careers route and fix hr styling 2018-07-18 14:27:06 -07:00
Brandon Millman
e6558b7135 Fix typos 2018-07-18 14:10:17 -07:00
Brandon Millman
2c8fb9aa31 Fix key errors and typo 2018-07-18 13:59:50 -07:00
Brandon Millman
f48c6b6285 Fix padding on open positions section 2018-07-18 13:59:50 -07:00
Brandon Millman
4f42f60bde Add dots on hero 2018-07-18 13:59:50 -07:00
Brandon Millman
3942647910 Padding fixes 2018-07-18 13:59:50 -07:00
Brandon Millman
e0fbc78925 Update open positions section 2018-07-18 13:59:50 -07:00
Brandon Millman
f3e43d7d94 Benefits and values sections 2018-07-18 13:59:50 -07:00
Brandon Millman
f36547241c Remove sections 2018-07-18 13:59:49 -07:00
Brandon Millman
7ad29950a8 Update mission section 2018-07-18 13:59:49 -07:00
Brandon Millman
cbf91ad45c Updates to the Join 0x section 2018-07-18 13:59:49 -07:00
Brandon Millman
a039b66533 Fix development environment check 2018-07-18 13:59:49 -07:00
Fabio Berger
3a18c249f5 Merge pull request #889 from 0xProject/update_versions
Update Versions & Changelogs
2018-07-18 17:20:38 +02:00
Fabio Berger
7c0775aa1b Fix 0x.js ts warnings 2018-07-18 17:06:05 +02:00
fragosti
6514c34ed8 Make topbar zIndex 1 2018-07-18 08:05:19 -07:00
Fabio Berger
ba92754669 Update yarn.lock 2018-07-18 17:00:14 +02:00
Fabio Berger
30afd39129 Fix 0x.js ts warnings 2018-07-18 17:00:07 +02:00
Leonid Logvinov
41699406cf Fix 0x.js tests on CI 2018-07-18 16:44:45 +02:00
Greg Hysen
9aa49e59d0 Fixed merge errors 2018-07-18 16:44:24 +02:00
Fabio Berger
29d5034260 merge v2-prototype 2018-07-18 16:43:25 +02:00
Leonid Logvinov
00d1622b3f Merge pull request #887 from 0xProject/feature/order-watcher-v2
Order watcher v2
2018-07-18 16:38:16 +02:00
Leonid Logvinov
a1acf19ff3 Fix a bad merge 2018-07-18 16:31:17 +02:00
Greg Hysen
86328af6b7 Fixed merge error 2018-07-18 16:27:26 +02:00
Greg Hysen
36c27bdbf8 Ran prettier 2018-07-18 16:18:54 +02:00
Fabio Berger
c839965c05 Update to Lerna v3.0-beta 2018-07-18 16:06:39 +02:00
Greg Hysen
e1a9f3435f Removed receiverData from ERC721 Proxy Id generation 2018-07-18 15:52:14 +02:00
Greg Hysen
9f74feb347 Removed receiverData and onReceive callback from ERC721 proxy. 2018-07-18 15:50:58 +02:00
Fabio Berger
f99232095b Update package versions 2018-07-18 15:48:09 +02:00
Leonid Logvinov
5044fe4fe4 Merge branch 'v2-prototype' into feature/order-watcher-v2 2018-07-18 15:40:45 +02:00
Leonid Logvinov
8e49169e6b Merge branch 'feature/order-watcher-v2' of github.com:0xProject/0x-monorepo into feature/order-watcher-v2 2018-07-18 15:39:11 +02:00
Leonid Logvinov
c71781d9ab Merge 2018-07-18 15:38:10 +02:00
Fabio Berger
8a2a4052f3 Update changelogs 2018-07-18 15:30:38 +02:00
Leonid Logvinov
dad557164e Merge branch 'v2-prototype' into feature/order-watcher-v2 2018-07-18 15:27:38 +02:00
Fabio Berger
e2fb49a8f8 Merge pull request #884 from 0xProject/export-more-0x.js
Export missing V2 pieces from 0x.js
2018-07-18 15:18:54 +02:00
Leonid Logvinov
f3241ff86a Merge pull request #883 from 0xProject/feature/tslint-improvements
New tslint rules
2018-07-18 14:54:47 +02:00
Fabio Berger
b9e7973a0f edit changelog message 2018-07-18 14:53:38 +02:00
Fabio Berger
004b1f5288 Fix prettier 2018-07-18 14:53:31 +02:00
Leonid Logvinov
857bd24c6d Merge branch 'v2-prototype' into feature/order-watcher-v2 2018-07-18 14:51:24 +02:00
Leonid Logvinov
904968cf4a Fix an inconsistency in abi-gen CHANGELOG.json 2018-07-18 14:31:03 +02:00
Fabio Berger
83747934ad Fix linter 2018-07-18 12:11:11 +02:00
Fabio Berger
7f90f5ecd4 merge v2-prototype 2018-07-18 12:04:57 +02:00
Fabio Berger
12f02b9814 Rename decodeAssetDataId to decodeAssetProxyId for consistency 2018-07-18 11:49:30 +02:00
Fabio Berger
8931388309 Add java doc comments to assetDataUtils 2018-07-18 11:47:42 +02:00
Fabio Berger
25160d7344 Move encodeUint256 & decodeUint256 out of assetDataUtils since we don't want them exported 2018-07-18 11:32:01 +02:00
Leonid Logvinov
ab6bf6edc7 Merge pull request #879 from 0xProject/feature/order-watcher-erc721-tests
Add ERC721 tests for order watcher v2
2018-07-18 10:38:07 +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
Leonid Logvinov
f20b496dca Add a test for ERC721 Allowance 2018-07-17 18:46:58 +02:00
Leonid Logvinov
cca17f70b8 Use allowance instead of approval for all in fill-scenarios 2018-07-17 18:45:35 +02:00
Leonid Logvinov
b8e69718a1 Upgrade sha3 to 1.2.2 to work with node v10 2018-07-17 16:54:25 +02:00
Fabio Berger
50ed7d2af2 Export missing types and add to doc ref whitelist 2018-07-17 16:41:55 +02:00
Fabio Berger
698de932ed Remove unused dep 2018-07-17 16:27:59 +02:00
Fabio Berger
a3d8858bb1 Fix typing 2018-07-17 16:27:46 +02:00
Fabio Berger
83f3ba21b8 Move type decl. to typescript-typings 2018-07-17 16:01:01 +02:00
Leonid Logvinov
2aa729b212 Check if the token doesn't exist before minting in fill scenarios 2018-07-17 15:56:10 +02:00
Fabio Berger
1de70e4474 Add PR 2018-07-17 15:40:06 +02:00
Fabio Berger
f2393de59b Make assetData a static property and add to CHANGELOG 2018-07-17 15:33:49 +02:00
Fabio Berger
94ea7cc451 Export assetDataUtils from 0x.js 2018-07-17 15:31:25 +02:00
Fabio Berger
f8dbf57582 Rename assetProxyUtils to assetDataUtils 2018-07-17 15:26:55 +02:00
Leonid Logvinov
c59cd36da6 Make downlevelIteration a global config 2018-07-17 15:25:20 +02:00
Fabio Berger
15e92958d6 Merge pull request #875 from 0xProject/fix-order-watcher
OrderWatcher Fixes
2018-07-17 13:47:23 +02:00
Leonid Logvinov
96c648c4b4 Fix tests descriptions 2018-07-17 13:29:59 +02:00
Fabio Berger
f56a7d0cb2 Fix linter 2018-07-17 13:29:36 +02:00
Leonid Logvinov
01e617bb83 DRY up the code in order-watcher collision-resistant abi decoder 2018-07-17 13:28:27 +02:00
Fabio Berger
59fd5c69c0 Remove no-longer needed tests 2018-07-17 13:27:41 +02:00
Leonid Logvinov
28a9a8c380 Await transactions in fillScenarios 2018-07-17 13:26:49 +02:00
Leonid Logvinov
6c2796b433 Rename decodeAssetData to decodeAssetDataOrThrow 2018-07-17 13:16:47 +02:00
Leonid Logvinov
82ad5f7897 Use normalizedAddress 2018-07-17 13:13:05 +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
F. Eugene Aumson
bffffffc95 make PR template checklist more useful
Goal is to make it so that every PR should check off every checklist
item before it is considered complete.

Removed mention of labels.  Since contributors outside the org don't
have permission to add labels, it's not possible for any such
contributor to ever check those items off.  Opted instead to prescribe
bracketed PR title prefixes, which are accessible to all.

Re-ordered checklist items to better represent chronological progress.
2018-07-16 17:50:24 -04:00
Leonid Logvinov
e9589ff786 Sort the config file lexicographically 2018-07-16 15:59:00 +02:00
Leonid Logvinov
c3bd3437f5 Make addOrder async 2018-07-16 15:50:06 +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
Leonid Logvinov
90d72a3683 Await the promise in order watcher assertion 2018-07-16 14:54:36 +02:00
Leonid Logvinov
f9bcf936ed Merge branch 'feature/order-watcher-v2' into feature/order-watcher-erc721-tests 2018-07-16 14:38:51 +02:00
Leonid Logvinov
acff177c54 Merge branch 'v2-prototype' into feature/order-watcher-v2 2018-07-16 14:38:27 +02:00
Leonid Logvinov
658214a2e2 Yarn lock changes 2018-07-16 14:31:46 +02:00
Leonid Logvinov
55f6f02c9b Import AssetproxyId 2018-07-16 14:31:33 +02:00
Leonid Logvinov
c5ba52910a Add ERC721 tests to order watcher 2018-07-16 14:30:48 +02:00
Leonid Logvinov
994ccd6694 Enable downlevelIteration 2018-07-16 14:29:59 +02:00
Leonid Logvinov
4921a83813 Register asset types within collisionResistantAbiDecoder 2018-07-16 14:29:23 +02:00
Leonid Logvinov
a97ba41b86 Add ERC721 support to fill-scenarios 2018-07-16 14:28:44 +02:00
Leonid Logvinov
67e2623d2c Remove no-unused-variable rule from tslint as it's buggy and has side-effects 2018-07-16 14:28:22 +02:00
Leonid Logvinov
4111095da3 Don't throw on transferFrom is the sender is an owner 2018-07-16 14:27:53 +02:00
Leonid Logvinov
6c21ddcedb Pass erc721ProxyAddress to fillScenarios 2018-07-16 14:27:34 +02:00
Leonid Logvinov
d86349658f Fix postinstall hook for contracts -> types 2018-07-16 14:26:23 +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
Leonid Logvinov
ffeb3194a8 Fix a dependency version 2018-07-13 17:46:53 +02:00
Leonid Logvinov
95e9f33f6a Migrate order-watcher to v2 2018-07-13 17:45:25 +02:00
Leonid Logvinov
c599a20b34 Enable prefer-readonly rule 2018-07-13 17:44:39 +02:00
Leonid Logvinov
ca59528a32 Add OrderWatcherPartialConfigSchema 2018-07-13 17:44:00 +02:00
Leonid Logvinov
6f4fd06d38 Use migrated package versions as order-watcher dependencies 2018-07-13 17:43:32 +02:00
Leonid Logvinov
4715c2d006 Update compact_artifacts in order-watcher 2018-07-13 17:42:50 +02:00
Leonid Logvinov
fcfa43b6f1 Export newly created store from order-utils 2018-07-13 17:42:27 +02:00
Leonid Logvinov
56b4c55654 Add OrderFilledCancelledLazyStore 2018-07-13 17:41:30 +02:00
Leonid Logvinov
830790eeac Add AbstractOrderFilledCancelledLazyStore 2018-07-13 17:39:41 +02:00
Leonid Logvinov
39de9c7879 Export forgotten stuff from contract-wrappers 2018-07-13 17:38:02 +02:00
Leonid Logvinov
7b6cc14b71 Make getZRXAssetData not async 2018-07-13 17:37:33 +02:00
Leonid Logvinov
ec749a4033 Add order-watcher to a postinstall HACK 2018-07-13 17:36:20 +02:00
Leonid Logvinov
fe32214613 Add no-return-await, no-duplicate-switch-case, no-implicit-dependencies rules 2018-07-13 17:30:44 +02:00
Leonid Logvinov
f6fcb775b7 Upgrade tslint to use prefer-readonly 2018-07-13 17:30:44 +02:00
Leonid Logvinov
d209108a95 Update contract artifacts 2018-07-13 17:30:00 +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
1aaf633df8 Add missing import 2018-07-09 19:59:26 +02:00
Fabio Berger
82771ec64a Remove comment and add assertion 2018-07-09 19:53:54 +02:00
Fabio Berger
ada8a402da merge v2-prototype 2018-07-09 19:46: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
324b1079e7 Add ability to nest doc ref markdown under specific versions 2018-07-09 19:05:38 +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
F. Eugene Aumson
cfe57f52f4 use bullets, not a task list, for Types of Changes 2018-07-01 20:44:28 -04:00
963 changed files with 65654 additions and 42625 deletions

View File

@@ -17,16 +17,19 @@ jobs:
- yarn-packages-{{ .Branch }}
- yarn-packages-master
- yarn-packages-
- run:
name: install-yarn
command: sudo npm install --global yarn@1.9.4
- run:
name: yarn
command: yarn --frozen-lockfile install
command: yarn --frozen-lockfile install || yarn --frozen-lockfile install
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
- run: >
if [ -z "$(git diff --name-only v2-prototype packages/website)" ]; then
if [ -z "$(git diff --name-only development packages/website)" ]; then
yarn build --exclude website
else
yarn build
@@ -56,6 +59,25 @@ jobs:
# 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-publish:
docker:
- image: circleci/node:9
- image: verdaccio/verdaccio
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:publish:circleci
test-doc-generation:
docker:
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:generate_docs:circleci
test-rest:
docker:
- image: circleci/node:9
@@ -64,7 +86,7 @@ jobs:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- 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
@@ -79,10 +101,11 @@ jobs:
- run: yarn wsrun test:circleci @0xproject/sra-report
- run: yarn wsrun test:circleci @0xproject/subproviders
- run: yarn wsrun test:circleci @0xproject/web3-wrapper
- run: yarn wsrun test:circleci @0xproject/utils
- save_cache:
key: coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/0x.js/coverage/lcov.info
- ~/repo/packages/abi-gen/coverage/lcov.info
- save_cache:
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
paths:
@@ -148,7 +171,7 @@ jobs:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn prettier:ci
- run: yarn lerna:run lint
- run: yarn lerna run lint
submit-coverage:
docker:
- image: circleci/node:9
@@ -159,7 +182,7 @@ jobs:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
- coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
@@ -223,6 +246,12 @@ workflows:
- static-tests:
requires:
- build
- test-publish:
requires:
- build
- test-doc-generation:
requires:
- build
- submit-coverage:
requires:
- test-rest

13
.gitignore vendored
View File

@@ -41,6 +41,7 @@ typings/
# Optional npm cache directory
.npm
.npmrc
# Optional eslint cache
.eslintcache
@@ -81,8 +82,15 @@ packages/sol-cov/test/fixtures/artifacts/
packages/metacoin/artifacts/
packages/order-watcher/test/artifacts/
packages/contract-wrappers/test/artifacts/
packages/contract-wrappers/src/artifacts/
packages/order-watcher/src/artifacts/
packages/0x.js/src/artifacts/
packages/order-utils/src/artifacts/
# generated contract wrappers
# unstable generated contract artifacts:
packages/migrations/artifacts/development/
# generated contract watcher
packages/0x.js/src/generated_contract_wrappers/
packages/contracts/generated_contract_wrappers/
packages/contract-wrappers/src/contract_wrappers/generated/
@@ -91,8 +99,9 @@ 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-testnet/contract_wrappers
packages/migrations/src/2.0.0/contract_wrappers
packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
packages/migrations/src/development/contract_wrappers
# solc-bin in sol-compiler
packages/sol-compiler/solc_bin/

View File

@@ -8,15 +8,20 @@ lib
/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-testnet/contract_wrappers
/packages/migrations/src/2.0.0/contract_wrappers
/packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
/packages/0x.js/test/artifacts
/packages/0x.js/src/artifacts
/packages/contracts/src/artifacts
/packages/contract-wrappers/src/artifacts
/packages/order-watcher/src/artifacts
/packages/metacoin/artifacts
/packages/sra-spec/public/
/packages/contract-wrappers/test/artifacts
/packages/order-watcher/test/artifacts
/packages/migrations/artifacts/1.0.0
/packages/migrations/artifacts/2.0.0-testnet
/packages/migrations/artifacts/2.0.0
/packages/migrations/artifacts/2.0.0-beta-testnet
/packages/migrations/artifacts/development
package.json
scripts/postpublish_utils.js
packages/sol-cov/test/fixtures/artifacts

8
CODEOWNERS Normal file
View File

@@ -0,0 +1,8 @@
# See https://help.github.com/articles/about-codeowners/
# for more info about CODEOWNERS file
# It uses the same pattern rule for gitignore file
# https://git-scm.com/docs/gitignore#_pattern_format
# Website
packages/website/ @BMillman19 @fragosti

View File

@@ -8,20 +8,20 @@
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
<!--- 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)
<!-- * 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. -->
<!--- The following points should be used to indicate the progress of your PR. Put an `x` in all the boxes that apply right now, and come back over time and check them off as you make progress. If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
<!--- 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.
* [ ] Prefix PR title with `[WIP]` if necessary.
* [ ] Prefix PR title with bracketed package name(s) corresponding to the changed package(s). For example: `[sol-cov] Fixed bug`.
* [ ] Add tests to cover changes as needed.
* [ ] Update documentation as needed.
* [ ] Add new entries to the relevant CHANGELOG.jsons.

View File

@@ -8,7 +8,7 @@ This repository is a monorepo including the 0x protocol smart contracts and nume
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/
[website-url]: https://0xproject.com
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
[dev-mailing-list-url]: http://eepurl.com/dx4cPf
@@ -33,6 +33,7 @@ If you're developing on 0x now or are interested in using 0x infrastructure in t
| [`@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-spec`](/packages/sra-spec) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-spec.svg)](https://www.npmjs.com/package/@0xproject/sra-spec) | OpenAPI specification for the standard relayer API |
| [`@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) |
@@ -68,7 +69,7 @@ Dedicated documentation pages:
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.
You can include those by prepending the `@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"],
@@ -82,11 +83,7 @@ We strongly recommend that the community help us make improvements and determine
### Install dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Make sure you are using Yarn v1.9.4. To install using brew:
Then install dependencies

View File

@@ -1,15 +1,10 @@
{
"lerna": "2.5.1",
"lerna": "3.0.0-beta.23",
"packages": ["packages/*"],
"commands": {
"publish": {
"allowBranch": "development"
}
},
"version": "independent",
"commands": {
"command": {
"publish": {
"ignore": ["test/**/*", "*.md", "scripts", "lib", "tslint.json", "tsconfig.json"]
"ignoreChanges": ["test/**/*", "*.md", "scripts", "lib", "tslint.json", "tsconfig.json"]
}
},
"npmClient": "yarn",

View File

@@ -13,39 +13,47 @@
"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",
"test:installation:local": "IS_LOCAL_PUBLISH=true node ./packages/monorepo-scripts/lib/test_installation.js",
"test:publish:circleci:comment": "HACK(albrow) We need an automated way to login to npm and echo+sleep piped to stdin was the only way I could find to do it.",
"test:publish:circleci": "yarn npm-cli-login -u test -p test -e test@example.com -r http://localhost:4873 && IS_LOCAL_PUBLISH=true run-s script:publish test:installation:local",
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild:no_website script:publish",
"run:publish:local": "IS_LOCAL_PUBLISH=true yarn run:publish",
"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",
"watch": "wsrun watch_without_deps $PKG --fast-exit -r --stages --done-criteria='complete|successfully'",
"lerna": "lerna",
"build": "wsrun build $PKG --fast-exit -r --stages",
"build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0xproject/website",
"build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
"build:ts": "tsc -b",
"watch:ts": "tsc -b -w",
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
"remove_node_modules": "lerna clean --yes; rm -rf node_modules",
"rebuild": "run-s clean build",
"rebuild:no_website": "run-s clean build:no_website",
"test": "wsrun test $PKG --fast-exit --serial --exclude-missing",
"stage_docs": "wsrun docs:stage $PKG --fast-exit --parallel --exclude-missing",
"generate_doc": "node ./packages/monorepo-scripts/lib/doc_generate_and_upload.js",
"test:generate_docs:circleci": "for i in ${npm_package_config_packagesWithDocPages}; do yarn generate_doc --package $i --shouldUpload false --isStaging true || break -1; done;",
"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/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"
"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."
},
"config": {
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic"
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic",
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-cov ethereum-types"
},
"devDependencies": {
"@0x-lerna-fork/lerna": "3.0.0-beta.25",
"async-child-process": "^1.1.1",
"coveralls": "^3.0.0",
"ganache-cli": "6.1.3",
"lcov-result-merger": "^3.0.0",
"lerna": "^2.5.1",
"npm-cli-login": "^0.0.10",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"wsrun": "^2.2.0",
"source-map-support": "^0.5.6"
"source-map-support": "^0.5.6",
"typescript": "3.0.1",
"wsrun": "^2.2.0"
},
"resolutions": {
"ethers": "0xproject/ethers.js#eip-838-reasons"

View File

@@ -1,4 +1,150 @@
[
{
"timestamp": 1536142250,
"version": "1.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.0.1-rc.6",
"changes": [
{
"note": "Fix missing `BlockParamLiteral` type import issue"
}
],
"timestamp": 1535377027
},
{
"version": "1.0.1-rc.5",
"changes": [
{
"note":
"Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js"
}
]
},
{
"version": "1.0.1-rc.4",
"changes": [
{
"note":
"Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`",
"pr": 963
}
],
"timestamp": 1535133899
},
{
"version": "1.0.1-rc.3",
"changes": [
{
"note": "Dependencies updated"
},
{
"pr": 914,
"note": "Update ecSignOrderHashAsync to return the signature as a string for immediate use in contracts"
}
],
"timestamp": 1534210131
},
{
"version": "1.0.1-rc.2",
"changes": [
{
"note": "Fixed bug caused by importing non-existent dep"
}
],
"timestamp": 1532619515
},
{
"version": "1.0.1-rc.1",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1532605697
},
{
"timestamp": 1532357734,
"version": "1.0.0",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532043100,
"version": "1.0.0-rc.2",
"changes": [
{
"note": "Remove `zeroEx.assetData` and instead re-export it's static functions directly off `ZeroEx`"
}
]
},
{
"timestamp": 1532043000,
"version": "1.0.0-rc.1",
"changes": [
{
"note": "Remove tokenRegistry wrapper",
"pr": 863
},
{
"note": "Rename `zeroEx.token` to `zeroEx.erc20Token`, and add `zeroEx.erc721Token`",
"pr": 863
},
{
"note": "Rename `zeroEx.proxy` to `zeroEx.erc20Proxy` and add `zeroEx.erc721Proxy`",
"pr": 863
},
{
"note":
"Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types",
"pr": 863
},
{
"note":
"Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.",
"pr": 863
},
{
"note":
"Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2",
"pr": 863
},
{
"note": "0x.js exports renamed contract events and event arg types",
"pr": 863
},
{
"note": "Export `ZeroEx.assetData` with methods to decode/encode assetData fields found in 0x orders",
"pr": 884
}
]
},
{
"timestamp": 1531919263,
"version": "0.38.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.38.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.38.4",

View File

@@ -1,10 +1,66 @@
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v1.0.1 - _September 5, 2018_
* Dependencies updated
## v1.0.1-rc.6 - _August 27, 2018_
* Fix missing `BlockParamLiteral` type import issue
## v1.0.1-rc.5 - _Invalid date_
* Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js
## v1.0.1-rc.4 - _August 24, 2018_
* Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher` (#963)
## v1.0.1-rc.3 - _August 14, 2018_
* Dependencies updated
* Update ecSignOrderHashAsync to return the signature as a string for immediate use in contracts (#914)
## v1.0.1-rc.2 - _July 26, 2018_
* Fixed bug caused by importing non-existent dep
## v1.0.1-rc.1 - _July 26, 2018_
* Dependencies updated
## v1.0.0 - _July 23, 2018_
* Dependencies updated
## v1.0.0-rc.2 - _July 20, 2018_
* Remove `zeroEx.assetData` and instead re-export it's static functions directly off `ZeroEx`
## v1.0.0-rc.1 - _July 20, 2018_
* Remove tokenRegistry wrapper (#863)
* Rename `zeroEx.token` to `zeroEx.erc20Token`, and add `zeroEx.erc721Token` (#863)
* Rename `zeroEx.proxy` to `zeroEx.erc20Proxy` and add `zeroEx.erc721Proxy` (#863)
* Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types (#863)
* Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too. (#863)
* Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2 (#863)
* 0x.js exports renamed contract events and event arg types (#863)
* Export `ZeroEx.assetData` with methods to decode/encode assetData fields found in 0x orders (#884)
## v0.38.6 - _July 18, 2018_
* Dependencies updated
## v0.38.5 - _July 9, 2018_
* Dependencies updated
## v0.38.4 - _June 19, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "0x.js",
"version": "0.38.4",
"version": "1.0.1",
"engines": {
"node": ">=6.12"
},
@@ -12,55 +12,27 @@
"tokens",
"exchange"
],
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"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 generate_contract_wrappers copy_artifacts",
"copy_artifacts": "copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_artifacts",
"generate_contract_wrappers": "abi-gen --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
"build": "yarn build:all",
"build:all": "run-p build:umd:prod build:commonjs",
"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",
"clean": "shx rm -rf _bundles lib test_temp src/generated_contract_wrappers generated_docs",
"build:umd:prod": "NODE_ENV=production webpack",
"build:commonjs": "tsc && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_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"
"build:commonjs": "tsc -b",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry",
"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": {
@@ -69,50 +41,52 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@0xproject/abi-gen": "^0.3.2",
"@0xproject/dev-utils": "^0.4.4",
"@0xproject/migrations": "^0.0.8",
"@0xproject/monorepo-scripts": "^0.2.1",
"@0xproject/sol-compiler": "^0.5.2",
"@0xproject/tslint-config": "^0.4.20",
"@0xproject/abi-gen": "^1.0.8",
"@0xproject/dev-utils": "^1.0.7",
"@0xproject/migrations": "^1.0.7",
"@0xproject/monorepo-scripts": "^1.0.8",
"@0xproject/tslint-config": "^1.0.7",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"@types/sinon": "^2.2.2",
"@types/web3-provider-engine": "^14.0.0",
"awesome-typescript-loader": "^3.1.3",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^1.2.0",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"json-loader": "^0.5.4",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"opn-cli": "^3.1.0",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1",
"tslint": "5.11.0",
"typedoc": "0.12.0",
"typescript": "3.0.1",
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack": "^3.1.0"
},
"dependencies": {
"@0xproject/assert": "^0.2.12",
"@0xproject/base-contract": "^0.3.4",
"@0xproject/contract-wrappers": "^0.0.5",
"@0xproject/order-utils": "^0.0.7",
"@0xproject/order-watcher": "^0.0.6",
"@0xproject/sol-compiler": "^0.5.2",
"@0xproject/types": "^0.8.1",
"@0xproject/typescript-typings": "^0.4.1",
"@0xproject/utils": "^0.7.1",
"@0xproject/web3-wrapper": "^0.7.1",
"ethereum-types": "^0.0.2",
"@0xproject/assert": "^1.0.8",
"@0xproject/base-contract": "^2.0.2",
"@0xproject/contract-wrappers": "^1.0.1",
"@0xproject/order-utils": "^1.0.1",
"@0xproject/order-watcher": "^1.0.1",
"@0xproject/subproviders": "^2.0.2",
"@0xproject/types": "^1.0.1",
"@0xproject/typescript-typings": "^2.0.0",
"@0xproject/utils": "^1.0.8",
"@0xproject/web3-wrapper": "^2.0.2",
"ethereum-types": "^1.0.6",
"ethers": "3.0.22",
"lodash": "^4.17.4"
"lodash": "^4.17.5",
"web3-provider-engine": "14.0.6"
},
"publishConfig": {
"access": "public"

View File

@@ -1,228 +0,0 @@
import { assert } from '@0xproject/assert';
import {
ContractWrappers,
ContractWrappersConfig,
EtherTokenWrapper,
ExchangeWrapper,
TokenRegistryWrapper,
TokenTransferProxyWrapper,
TokenWrapper,
} from '@0xproject/contract-wrappers';
import {
generatePseudoRandomSalt,
getOrderHashHex,
isValidOrderHash,
isValidSignature,
signOrderHashAsync,
} from '@0xproject/order-utils';
import { OrderWatcher, OrderWatcherConfig } from '@0xproject/order-watcher';
import { ECSignature, Order, Provider, SignedOrder, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { constants } from './utils/constants';
/**
* The ZeroEx class is the single entry-point into the 0x.js library. It contains all of the library's functionality
* and all calls to the library should be made through a ZeroEx instance.
*/
export class ZeroEx {
/**
* When creating an order without a specified taker or feeRecipient you must supply the Solidity
* address null type (as opposed to Javascripts `null`, `undefined` or empty string). We expose
* 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.
*/
public tokenRegistry: TokenRegistryWrapper;
/**
* An instance of the TokenWrapper class containing methods for interacting with any ERC20 token smart contract.
*/
public token: TokenWrapper;
/**
* 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.
*/
public proxy: TokenTransferProxyWrapper;
private _contractWrappers: ContractWrappers;
/**
* Generates a pseudo-random 256-bit salt.
* 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 {
return generatePseudoRandomSalt();
}
/**
* 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 {
return isValidSignature(data, signature, signerAddress);
}
/**
* 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 getOrderHashHex(order);
}
/**
* Checks if the supplied hex encoded order hash is valid.
* Note: Valid means it has the expected format, not that an order with the orderHash exists.
* Use this method when processing orderHashes submitted as user input.
* @param orderHash Hex encoded orderHash.
* @return Whether the supplied orderHash has the expected format.
*/
public static isValidOrderHash(orderHash: string): boolean {
return isValidOrderHash(orderHash);
}
/**
* A unit amount is defined as the amount of a token above the specified decimal places (integer part).
* E.g: If a currency has 18 decimal places, 1e18 or one quintillion of the currency is equivalent
* to 1 unit.
* @param amount The amount in baseUnits that you would like converted to units.
* @param decimals The number of decimal places the unit amount has.
* @return The amount in units.
*/
public static toUnitAmount(amount: BigNumber, decimals: number): BigNumber {
assert.isValidBaseUnitAmount('amount', amount);
assert.isNumber('decimals', decimals);
const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals);
return unitAmount;
}
/**
* A baseUnit is defined as the smallest denomination of a token. An amount expressed in baseUnits
* is the amount expressed in the smallest denomination.
* E.g: 1 unit of a token with 18 decimal places is expressed in baseUnits as 1000000000000000000
* @param amount The amount of units that you would like converted to baseUnits.
* @param decimals The number of decimal places the unit amount has.
* @return The amount in baseUnits.
*/
public static toBaseUnitAmount(amount: BigNumber, decimals: number): BigNumber {
assert.isBigNumber('amount', amount);
assert.isNumber('decimals', decimals);
const baseUnitAmount = Web3Wrapper.toBaseUnitAmount(amount, decimals);
return baseUnitAmount;
}
/**
* Instantiates a new ZeroEx instance that provides the public interface to the 0x.js library.
* @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: Provider, config: ContractWrappersConfig) {
assert.isWeb3Provider('provider', provider);
this._contractWrappers = new ContractWrappers(provider, config);
this.proxy = this._contractWrappers.proxy;
this.token = this._contractWrappers.token;
this.exchange = this._contractWrappers.exchange;
this.tokenRegistry = this._contractWrappers.tokenRegistry;
this.etherToken = this._contractWrappers.etherToken;
}
/**
* Sets a new web3 provider for 0x.js. Updating the provider will stop all
* subscriptions so you will need to re-subscribe to all events relevant to your app after this call.
* @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: 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[]> {
// Hack: Get Web3Wrapper from ContractWrappers
const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const availableAddresses = await web3Wrapper.getAvailableAddressesAsync();
return availableAddresses;
}
/**
* Signs an orderHash and returns it's elliptic curve signature.
* 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 Provider supplied to 0x.js.
* @param shouldAddPersonalMessagePrefix Some signers add the personal message prefix `\x19Ethereum Signed Message`
* themselves (e.g Parity Signer, Ledger, TestRPC) and others expect it to already be done by the client
* (e.g Metamask). Depending on which signer this request is going to, decide on whether to add the prefix
* before sending the request.
* @return An object containing the Elliptic curve signature parameters generated by signing the orderHash.
*/
public async signOrderHashAsync(
orderHash: string,
signerAddress: string,
shouldAddPersonalMessagePrefix: boolean,
): Promise<ECSignature> {
return signOrderHashAsync(
this._contractWrappers.getProvider(),
orderHash,
signerAddress,
shouldAddPersonalMessagePrefix,
);
}
/**
* Waits for a transaction to be mined and returns the transaction receipt.
* @param txHash Transaction hash
* @param pollingIntervalMs How often (in ms) should we check if the transaction is mined.
* @param timeoutMs How long (in ms) to poll for transaction mined until aborting.
* @return Transaction receipt with decoded log args.
*/
public async awaitTransactionMinedAsync(
txHash: string,
pollingIntervalMs: number = 1000,
timeoutMs?: number,
): Promise<TransactionReceiptWithDecodedLogs> {
// Hack: Get Web3Wrapper from ContractWrappers
const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const transactionReceiptWithDecodedLogs = await web3Wrapper.awaitTransactionMinedAsync(
txHash,
pollingIntervalMs,
timeoutMs,
);
return transactionReceiptWithDecodedLogs;
}
/**
* Instantiates and returns a new OrderWatcher instance.
* Defaults to watching the pending state.
* @param config The configuration object. Look up the type for the description.
* @return An instance of the 0x.js OrderWatcher class.
*/
public async createOrderWatcherAsync(config?: OrderWatcherConfig): Promise<OrderWatcher> {
// Hack: Get Web3Wrapper from ContractWrappers
const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const networkId = await web3Wrapper.getNetworkIdAsync();
const provider = this._contractWrappers.getProvider();
const orderWatcher = new OrderWatcher(provider, networkId, config);
return orderWatcher;
}
}

View File

@@ -1,22 +0,0 @@
{
"contract_name": "DummyToken",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_target",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "setBalance",
"outputs": [],
"payable": false,
"type": "function"
}
]
}

View File

@@ -1,287 +0,0 @@
{
"contract_name": "EtherToken",
"abi": [
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "decimals",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "symbol",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "deposit",
"outputs": [],
"payable": true,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"payable": true,
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": true,
"name": "_spender",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Deposit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
}
],
"networks": {
"1": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"3": {
"address": "0xc00fd9820cd2898cc4c054b7bf142de637ad129a"
},
"4": {
"address": "0xc778417e063141139fce010982780140aa0cd5ab"
},
"42": {
"address": "0x653e49e301e508a13237c0ddc98ae7d4cd2667a1"
},
"50": {
"address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c"
}
}
}

View File

@@ -1,610 +0,0 @@
{
"contract_name": "Exchange",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "numerator",
"type": "uint256"
},
{
"name": "denominator",
"type": "uint256"
},
{
"name": "target",
"type": "uint256"
}
],
"name": "isRoundingError",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "filled",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "cancelled",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5][]"
},
{
"name": "orderValues",
"type": "uint256[6][]"
},
{
"name": "fillTakerTokenAmount",
"type": "uint256"
},
{
"name": "shouldThrowOnInsufficientBalanceOrAllowance",
"type": "bool"
},
{
"name": "v",
"type": "uint8[]"
},
{
"name": "r",
"type": "bytes32[]"
},
{
"name": "s",
"type": "bytes32[]"
}
],
"name": "fillOrdersUpTo",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5]"
},
{
"name": "orderValues",
"type": "uint256[6]"
},
{
"name": "cancelTakerTokenAmount",
"type": "uint256"
}
],
"name": "cancelOrder",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ZRX_TOKEN_CONTRACT",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5][]"
},
{
"name": "orderValues",
"type": "uint256[6][]"
},
{
"name": "fillTakerTokenAmounts",
"type": "uint256[]"
},
{
"name": "v",
"type": "uint8[]"
},
{
"name": "r",
"type": "bytes32[]"
},
{
"name": "s",
"type": "bytes32[]"
}
],
"name": "batchFillOrKillOrders",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5]"
},
{
"name": "orderValues",
"type": "uint256[6]"
},
{
"name": "fillTakerTokenAmount",
"type": "uint256"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "fillOrKillOrder",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "orderHash",
"type": "bytes32"
}
],
"name": "getUnavailableTakerTokenAmount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "signer",
"type": "address"
},
{
"name": "hash",
"type": "bytes32"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "isValidSignature",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "numerator",
"type": "uint256"
},
{
"name": "denominator",
"type": "uint256"
},
{
"name": "target",
"type": "uint256"
}
],
"name": "getPartialAmount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "TOKEN_TRANSFER_PROXY_CONTRACT",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5][]"
},
{
"name": "orderValues",
"type": "uint256[6][]"
},
{
"name": "fillTakerTokenAmounts",
"type": "uint256[]"
},
{
"name": "shouldThrowOnInsufficientBalanceOrAllowance",
"type": "bool"
},
{
"name": "v",
"type": "uint8[]"
},
{
"name": "r",
"type": "bytes32[]"
},
{
"name": "s",
"type": "bytes32[]"
}
],
"name": "batchFillOrders",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5][]"
},
{
"name": "orderValues",
"type": "uint256[6][]"
},
{
"name": "cancelTakerTokenAmounts",
"type": "uint256[]"
}
],
"name": "batchCancelOrders",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5]"
},
{
"name": "orderValues",
"type": "uint256[6]"
},
{
"name": "fillTakerTokenAmount",
"type": "uint256"
},
{
"name": "shouldThrowOnInsufficientBalanceOrAllowance",
"type": "bool"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "fillOrder",
"outputs": [
{
"name": "filledTakerTokenAmount",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "orderAddresses",
"type": "address[5]"
},
{
"name": "orderValues",
"type": "uint256[6]"
}
],
"name": "getOrderHash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "EXTERNAL_QUERY_GAS_LIMIT",
"outputs": [
{
"name": "",
"type": "uint16"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "VERSION",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"inputs": [
{
"name": "_zrxToken",
"type": "address"
},
{
"name": "_tokenTransferProxy",
"type": "address"
}
],
"payable": false,
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "maker",
"type": "address"
},
{
"indexed": false,
"name": "taker",
"type": "address"
},
{
"indexed": true,
"name": "feeRecipient",
"type": "address"
},
{
"indexed": false,
"name": "makerToken",
"type": "address"
},
{
"indexed": false,
"name": "takerToken",
"type": "address"
},
{
"indexed": false,
"name": "filledMakerTokenAmount",
"type": "uint256"
},
{
"indexed": false,
"name": "filledTakerTokenAmount",
"type": "uint256"
},
{
"indexed": false,
"name": "paidMakerFee",
"type": "uint256"
},
{
"indexed": false,
"name": "paidTakerFee",
"type": "uint256"
},
{
"indexed": true,
"name": "tokens",
"type": "bytes32"
},
{
"indexed": false,
"name": "orderHash",
"type": "bytes32"
}
],
"name": "LogFill",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "maker",
"type": "address"
},
{
"indexed": true,
"name": "feeRecipient",
"type": "address"
},
{
"indexed": false,
"name": "makerToken",
"type": "address"
},
{
"indexed": false,
"name": "takerToken",
"type": "address"
},
{
"indexed": false,
"name": "cancelledMakerTokenAmount",
"type": "uint256"
},
{
"indexed": false,
"name": "cancelledTakerTokenAmount",
"type": "uint256"
},
{
"indexed": true,
"name": "tokens",
"type": "bytes32"
},
{
"indexed": false,
"name": "orderHash",
"type": "bytes32"
}
],
"name": "LogCancel",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "errorId",
"type": "uint8"
},
{
"indexed": true,
"name": "orderHash",
"type": "bytes32"
}
],
"name": "LogError",
"type": "event"
}
],
"networks": {
"1": {
"address": "0x12459c951127e0c374ff9105dda097662a027093"
},
"3": {
"address": "0x479cc461fecd078f766ecc58533d6f69580cf3ac"
},
"4": {
"address": "0x1d16ef40fac01cec8adac2ac49427b9384192c05"
},
"42": {
"address": "0x90fe2af704b34e0224bf2299c838e04d4dcf1364"
},
"50": {
"address": "0x48bacb9266a570d521063ef5dd96e61686dbe788"
}
}
}

View File

@@ -1,172 +0,0 @@
{
"contract_name": "Token",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "supply",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "remaining",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_owner",
"type": "address"
},
{
"indexed": true,
"name": "_spender",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
}
]
}

View File

@@ -1,547 +0,0 @@
{
"contract_name": "TokenRegistry",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_index",
"type": "uint256"
}
],
"name": "removeToken",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_name",
"type": "string"
}
],
"name": "getTokenAddressByName",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_symbol",
"type": "string"
}
],
"name": "getTokenAddressBySymbol",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_swarmHash",
"type": "bytes"
}
],
"name": "setTokenSwarmHash",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_token",
"type": "address"
}
],
"name": "getTokenMetaData",
"outputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "uint8"
},
{
"name": "",
"type": "bytes"
},
{
"name": "",
"type": "bytes"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_name",
"type": "string"
},
{
"name": "_symbol",
"type": "string"
},
{
"name": "_decimals",
"type": "uint8"
},
{
"name": "_ipfsHash",
"type": "bytes"
},
{
"name": "_swarmHash",
"type": "bytes"
}
],
"name": "addToken",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_name",
"type": "string"
}
],
"name": "setTokenName",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "tokens",
"outputs": [
{
"name": "token",
"type": "address"
},
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "decimals",
"type": "uint8"
},
{
"name": "ipfsHash",
"type": "bytes"
},
{
"name": "swarmHash",
"type": "bytes"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "tokenAddresses",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_name",
"type": "string"
}
],
"name": "getTokenByName",
"outputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "uint8"
},
{
"name": "",
"type": "bytes"
},
{
"name": "",
"type": "bytes"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getTokenAddresses",
"outputs": [
{
"name": "",
"type": "address[]"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_ipfsHash",
"type": "bytes"
}
],
"name": "setTokenIpfsHash",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_symbol",
"type": "string"
}
],
"name": "getTokenBySymbol",
"outputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "uint8"
},
{
"name": "",
"type": "bytes"
},
{
"name": "",
"type": "bytes"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_symbol",
"type": "string"
}
],
"name": "setTokenSymbol",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "name",
"type": "string"
},
{
"indexed": false,
"name": "symbol",
"type": "string"
},
{
"indexed": false,
"name": "decimals",
"type": "uint8"
},
{
"indexed": false,
"name": "ipfsHash",
"type": "bytes"
},
{
"indexed": false,
"name": "swarmHash",
"type": "bytes"
}
],
"name": "LogAddToken",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "name",
"type": "string"
},
{
"indexed": false,
"name": "symbol",
"type": "string"
},
{
"indexed": false,
"name": "decimals",
"type": "uint8"
},
{
"indexed": false,
"name": "ipfsHash",
"type": "bytes"
},
{
"indexed": false,
"name": "swarmHash",
"type": "bytes"
}
],
"name": "LogRemoveToken",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "oldName",
"type": "string"
},
{
"indexed": false,
"name": "newName",
"type": "string"
}
],
"name": "LogTokenNameChange",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "oldSymbol",
"type": "string"
},
{
"indexed": false,
"name": "newSymbol",
"type": "string"
}
],
"name": "LogTokenSymbolChange",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "oldIpfsHash",
"type": "bytes"
},
{
"indexed": false,
"name": "newIpfsHash",
"type": "bytes"
}
],
"name": "LogTokenIpfsHashChange",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "oldSwarmHash",
"type": "bytes"
},
{
"indexed": false,
"name": "newSwarmHash",
"type": "bytes"
}
],
"name": "LogTokenSwarmHashChange",
"type": "event"
}
],
"networks": {
"1": {
"address": "0x926a74c5c36adf004c87399e65f75628b0f98d2c"
},
"3": {
"address": "0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed"
},
"4": {
"address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6"
},
"42": {
"address": "0xf18e504561f4347bea557f3d4558f559dddbae7f"
},
"50": {
"address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082"
}
}
}

View File

@@ -1,187 +0,0 @@
{
"contract_name": "TokenTransferProxy",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "from",
"type": "address"
},
{
"name": "to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "target",
"type": "address"
}
],
"name": "addAuthorizedAddress",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "authorities",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "target",
"type": "address"
}
],
"name": "removeAuthorizedAddress",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "authorized",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getAuthorizedAddresses",
"outputs": [
{
"name": "",
"type": "address[]"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "target",
"type": "address"
},
{
"indexed": true,
"name": "caller",
"type": "address"
}
],
"name": "LogAuthorizedAddressAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "target",
"type": "address"
},
{
"indexed": true,
"name": "caller",
"type": "address"
}
],
"name": "LogAuthorizedAddressRemoved",
"type": "event"
}
],
"networks": {
"1": {
"address": "0x8da0d80f5007ef1e431dd2127178d224e32c2ef4"
},
"3": {
"address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6"
},
"4": {
"address": "0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d"
},
"42": {
"address": "0x087eed4bc1ee3de49befbd66c662b434b15d49d4"
},
"50": {
"address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48"
}
}
}

View File

@@ -1,20 +0,0 @@
{
"contract_name": "ZRX",
"networks": {
"1": {
"address": "0xe41d2489571d322189246dafa5ebde1f4699f498"
},
"3": {
"address": "0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d"
},
"4": {
"address": "0x00f58d6d585f84b2d7267940cede30ce2fe6eae8"
},
"42": {
"address": "0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570"
},
"50": {
"address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401"
}
}
}

View File

@@ -1,53 +1,104 @@
export { ZeroEx } from './0x';
export { assetDataUtils, signatureUtils, generatePseudoRandomSalt, orderHashUtils } from '@0xproject/order-utils';
export {
ContractWrappers,
ERC20TokenWrapper,
ERC721TokenWrapper,
EtherTokenWrapper,
ExchangeWrapper,
ERC20ProxyWrapper,
ERC721ProxyWrapper,
ForwarderWrapper,
OrderValidatorWrapper,
IndexedFilterValues,
BlockRange,
ContractWrappersConfig,
MethodOpts,
OrderTransactionOpts,
TransactionOpts,
OrderStatus,
OrderInfo,
WETH9Events,
WETH9WithdrawalEventArgs,
WETH9ApprovalEventArgs,
WETH9EventArgs,
WETH9DepositEventArgs,
WETH9TransferEventArgs,
ERC20TokenTransferEventArgs,
ERC20TokenApprovalEventArgs,
ERC20TokenEvents,
ERC20TokenEventArgs,
ERC721TokenApprovalEventArgs,
ERC721TokenApprovalForAllEventArgs,
ERC721TokenTransferEventArgs,
ERC721TokenEvents,
ERC721TokenEventArgs,
ExchangeCancelUpToEventArgs,
ExchangeAssetProxyRegisteredEventArgs,
ExchangeSignatureValidatorApprovalEventArgs,
ExchangeFillEventArgs,
ExchangeCancelEventArgs,
ExchangeEvents,
EventCallback,
DecodedLogEvent,
ExchangeEventArgs,
TransactionEncoder,
BalanceAndAllowance,
OrderAndTraderInfo,
TraderInfo,
ValidateOrderFillableOpts,
} from '@0xproject/contract-wrappers';
export { OrderWatcher, OnOrderStateChangeCallback, OrderWatcherConfig } from '@0xproject/order-watcher';
export import Web3ProviderEngine = require('web3-provider-engine');
export { RPCSubprovider, Callback, JSONRPCRequestPayloadWithMethod, ErrorCallback } from '@0xproject/subproviders';
export { AbiDecoder } from '@0xproject/utils';
export { BigNumber } from '@0xproject/utils';
export {
BlockParamLiteral,
FilterObject,
BlockParam,
ContractEventArg,
ExchangeContractErrs,
LogWithDecodedArgs,
Order,
Provider,
SignedOrder,
ECSignature,
OrderStateValid,
OrderStateInvalid,
OrderState,
Token,
TransactionReceipt,
TransactionReceiptWithDecodedLogs,
AssetProxyId,
SignerType,
ERC20AssetData,
ERC721AssetData,
SignatureType,
OrderRelevantState,
} from '@0xproject/types';
export { OrderWatcherConfig } from '@0xproject/order-watcher';
export {
EventCallback,
ContractEvent,
IndexedFilterValues,
BlockRange,
OrderCancellationRequest,
OrderFillRequest,
ContractEventArgs,
MethodOpts,
OrderTransactionOpts,
TransactionOpts,
LogEvent,
DecodedLogEvent,
OnOrderStateChangeCallback,
ContractWrappersError,
EtherTokenContractEventArgs,
WithdrawalContractEventArgs,
DepositContractEventArgs,
EtherTokenEvents,
TransferContractEventArgs,
ApprovalContractEventArgs,
TokenContractEventArgs,
TokenEvents,
LogErrorContractEventArgs,
LogCancelContractEventArgs,
LogFillContractEventArgs,
ExchangeContractEventArgs,
ExchangeEvents,
ContractWrappersConfig,
} from '@0xproject/contract-wrappers';
BlockParamLiteral,
ContractAbi,
BlockParam,
LogWithDecodedArgs,
ContractEventArg,
Provider,
JSONRPCRequestPayload,
JSONRPCResponsePayload,
JSONRPCErrorCallback,
LogEntry,
DecodedLogArgs,
LogEntryEvent,
DecodedLogEntry,
DecodedLogEntryEvent,
RawLog,
AbiDefinition,
FunctionAbi,
EventAbi,
EventParameter,
MethodAbi,
ConstructorAbi,
FallbackAbi,
DataItem,
ConstructorStateMutability,
StateMutability,
} from 'ethereum-types';

View File

@@ -1,8 +0,0 @@
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,8 +0,0 @@
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,5 +0,0 @@
export const zeroExConfigSchema = {
id: '/ZeroExConfig',
oneOf: [{ $ref: '/ZeroExPrivateNetworkConfig' }, { $ref: '/ZeroExPublicNetworkConfig' }],
type: 'object',
};

View File

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

View File

@@ -1,43 +0,0 @@
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' },
tokenRegistryContractAddress: { $ref: '/Address' },
tokenTransferProxyContractAddress: { $ref: '/Address' },
orderWatcherConfig: {
type: 'object',
properties: {
pollingIntervalMs: {
type: 'number',
minimum: 0,
},
numConfirmations: {
type: 'number',
minimum: 0,
},
},
},
},
type: 'object',
required: ['networkId'],
};

View File

@@ -1,7 +0,0 @@
export enum InternalZeroExError {
NoAbiDecoder = 'NO_ABI_DECODER',
ZrxNotInTokenRegistry = 'ZRX_NOT_IN_TOKEN_REGISTRY',
WethNotInTokenRegistry = 'WETH_NOT_IN_TOKEN_REGISTRY',
}
// tslint:disable:max-file-line-count

View File

@@ -1,4 +0,0 @@
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
TESTRPC_NETWORK_ID: 50,
};

View File

@@ -1,165 +0,0 @@
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 { ApprovalContractEventArgs, LogWithDecodedArgs, TokenEvents, ZeroEx } from '../src';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
import { TokenUtils } from './utils/token_utils';
import { provider, web3Wrapper } from './utils/web3_wrapper';
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
chaiSetup.configure();
const expect = chai.expect;
describe('ZeroEx library', () => {
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();
// Add property to newProvider so that we can differentiate it from old provider
(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 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.getProvider();
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 address = '0x5409ed021d9299bf6814279a6a1411a7e866a631';
it("should return false if the data doesn't pertain to the signature & address", async () => {
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync('0x0', signature, address),
).to.become(false);
});
it("should return false if the address doesn't pertain to the signature & data", async () => {
const validUnrelatedAddress = '0x8b0292b11a196601ed2ce54b665cafeca0347d42';
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(
dataHex,
signature,
validUnrelatedAddress,
),
).to.become(false);
});
it("should return false if the signature doesn't pertain to the dataHex & address", async () => {
const wrongSignature = _.assign({}, signature, { v: 28 });
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(dataHex, wrongSignature, address),
).to.become(false);
});
it('should return true if the signature does pertain to the dataHex & address', async () => {
return expect(
(zeroEx.exchange as any)._isValidSignatureUsingContractCallAsync(dataHex, signature, address),
).to.become(true);
});
});
describe('#toUnitAmount', () => {
it('should throw if invalid baseUnit amount supplied as argument', () => {
const invalidBaseUnitAmount = new BigNumber(1000000000.4);
const decimals = 6;
expect(() => ZeroEx.toUnitAmount(invalidBaseUnitAmount, decimals)).to.throw(
'amount should be in baseUnits (no decimals), found value: 1000000000.4',
);
});
it('Should return the expected unit amount for the decimals passed in', () => {
const baseUnitAmount = new BigNumber(1000000000);
const decimals = 6;
const unitAmount = ZeroEx.toUnitAmount(baseUnitAmount, decimals);
const expectedUnitAmount = new BigNumber(1000);
expect(unitAmount).to.be.bignumber.equal(expectedUnitAmount);
});
});
describe('#toBaseUnitAmount', () => {
it('Should return the expected base unit amount for the decimals passed in', () => {
const unitAmount = new BigNumber(1000);
const decimals = 6;
const baseUnitAmount = ZeroEx.toBaseUnitAmount(unitAmount, decimals);
const expectedUnitAmount = new BigNumber(1000000000);
expect(baseUnitAmount).to.be.bignumber.equal(expectedUnitAmount);
});
it('should throw if unitAmount has more decimals then specified as the max decimal precision', () => {
const unitAmount = new BigNumber(0.823091);
const decimals = 5;
expect(() => ZeroEx.toBaseUnitAmount(unitAmount, decimals)).to.throw(
'Invalid unit amount: 0.823091 - Too many decimal places',
);
});
});
describe('#awaitTransactionMinedAsync', () => {
beforeEach(async () => {
await blockchainLifecycle.startAsync();
});
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
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 txReceiptWithDecodedLogs = await zeroEx.awaitTransactionMinedAsync(txHash);
// tslint:disable-next-line:no-unnecessary-type-assertion
const log = txReceiptWithDecodedLogs.logs[0] as LogWithDecodedArgs<ApprovalContractEventArgs>;
expect(log.event).to.be.equal(TokenEvents.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);
});
});
describe('#config', () => {
it('allows to specify exchange contract address', async () => {
const zeroExConfig = {
exchangeContractAddress: ZeroEx.NULL_ADDRESS,
networkId: constants.TESTRPC_NETWORK_ID,
};
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 () => {
const zeroExConfig = {
tokenRegistryContractAddress: ZeroEx.NULL_ADDRESS,
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroExWithWrongTokenRegistryAddress = new ZeroEx(provider, zeroExConfig);
expect(zeroExWithWrongTokenRegistryAddress.tokenRegistry.getContractAddress()).to.be.equal(
ZeroEx.NULL_ADDRESS,
);
});
});
});

View File

@@ -1,48 +0,0 @@
import { web3Factory } from '@0xproject/dev-utils';
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 provider = web3Factory.getRpcProvider({ rpcUrl: kovanRpcUrl });
const config = {
networkId: constants.KOVAN_NETWORK_ID,
};
const zeroEx = new ZeroEx(provider, 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 provider = web3Factory.getRpcProvider({ rpcUrl: ropstenRpcUrl });
const config = {
networkId: constants.ROPSTEN_NETWORK_ID,
};
const zeroEx = new ZeroEx(provider, 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,17 +0,0 @@
import { devConstants } from '@0xproject/dev-utils';
import { runV1MigrationsAsync } 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);
const txDefaults = {
gas: devConstants.GAS_LIMIT,
from: devConstants.TESTRPC_FIRST_ADDRESS,
};
const artifactsDir = `../migrations/artifacts/1.0.0`;
await runV1MigrationsAsync(provider, artifactsDir, txDefaults);
});

View File

@@ -1,9 +0,0 @@
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
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,
};

View File

@@ -1,34 +0,0 @@
import { Token } from '@0xproject/types';
import * as _ from 'lodash';
import { InternalZeroExError } from '../../src/types';
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;
}
}

View File

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

View File

@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "src"
},
"include": ["./src/**/*", "./test/**/*"]
"include": ["./src/**/*"]
}

View File

@@ -0,0 +1,7 @@
{
"extends": "../../typedoc-tsconfig",
"compilerOptions": {
"outDir": "lib"
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@@ -3,6 +3,7 @@
*/
const _ = require('lodash');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const path = require('path');
const production = process.env.NODE_ENV === 'production';
@@ -27,10 +28,16 @@ module.exports = {
},
devtool: 'source-map',
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
// TODO: Revert to webpack bundled version with webpack v4.
// The v3 series bundled version does not support ES6 and
// fails to build.
new UglifyJsPlugin({
sourceMap: true,
include: /\.min\.js$/,
uglifyOptions: {
mangle: {
reserved: ['BigNumber'],
},
},
}),
],
module: {
@@ -40,8 +47,13 @@ module.exports = {
use: [
{
loader: 'awesome-typescript-loader',
// tsconfig.json contains some options required for
// project references which do not work with webback.
// We override those options here.
query: {
declaration: false,
declarationMap: false,
composite: false,
},
},
],

View File

@@ -1,6 +1,80 @@
[
{
"version": "0.4.0",
"timestamp": 1536142250,
"version": "1.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1535377027,
"version": "1.0.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1535133899,
"version": "1.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1534210131,
"version": "1.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532619515,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.0.1",
"changes": [
{
"note": "Fix the abi-gen entry point in package.json",
"pr": 901
}
],
"timestamp": 1532357734
},
{
"timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
"note": "Convert e_r_c to erc in generated file names",
@@ -9,6 +83,28 @@
{
"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": 1531919263,
"version": "0.3.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.3.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},

View File

@@ -1,10 +1,56 @@
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v1.0.8 - _September 5, 2018_
* Dependencies updated
## v1.0.7 - _August 27, 2018_
* Dependencies updated
## v1.0.6 - _August 24, 2018_
* Dependencies updated
## v1.0.5 - _August 14, 2018_
* Dependencies updated
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1 - _July 23, 2018_
* Fix the abi-gen entry point in package.json (#901)
## v1.0.0 - _July 20, 2018_
* Convert e_r_c to erc in generated file names (#822)
* Remove the output directory before writing to it (#822)
* skip generation of wrappers that are already up to date (#788)
## v0.3.4 - _July 18, 2018_
* Dependencies updated
## v0.3.3 - _July 9, 2018_
* Dependencies updated
## v0.3.2 - _June 19, 2018_
* Dependencies updated

View File

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

View File

View File

@@ -1,18 +1,21 @@
{
"name": "@0xproject/abi-gen",
"version": "0.3.2",
"version": "1.0.8",
"engines": {
"node": ">=6.12"
},
"description": "Generate contract wrappers from ABI and handlebars templates",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"lint": "tslint --project .",
"clean": "shx rm -rf lib scripts",
"build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
"clean": "shx rm -rf lib",
"build": "tsc -b",
"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"
},
"bin": {
"abi-gen": "bin/abi-gen.js"
@@ -27,33 +30,37 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
"@0xproject/typescript-typings": "^0.4.1",
"@0xproject/utils": "^0.7.1",
"ethereum-types": "^0.0.2",
"@0xproject/typescript-typings": "^2.0.0",
"@0xproject/utils": "^1.0.8",
"chalk": "^2.3.0",
"ethereum-types": "^1.0.6",
"glob": "^7.1.2",
"handlebars": "^4.0.11",
"lodash": "^4.17.4",
"rimraf": "^2.6.2",
"lodash": "^4.17.5",
"mkdirp": "^0.5.1",
"sleep": "^5.1.1",
"tmp": "^0.0.33",
"to-snake-case": "^1.0.0",
"yargs": "^10.0.3"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.2.1",
"@0xproject/tslint-config": "^0.4.20",
"@types/glob": "^5.0.33",
"@types/rimraf": "^2.0.2",
"@0xproject/tslint-config": "^1.0.7",
"@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",
"copyfiles": "^1.2.0",
"chai": "^4.1.2",
"copyfiles": "^2.0.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.7.1"
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"publishConfig": {
"access": "public"

View File

@@ -3,16 +3,12 @@
import { abiUtils, logUtils } from '@0xproject/utils';
import chalk from 'chalk';
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from 'ethereum-types';
import * as fs from 'fs';
import { sync as globSync } from 'glob';
import * as Handlebars from 'handlebars';
import * as _ from 'lodash';
import * as mkdirp from 'mkdirp';
import * as rimraf from 'rimraf';
import * as yargs from 'yargs';
import toSnakeCase = require('to-snake-case');
import { ContextData, ContractsBackend, ParamKind } from './types';
import { utils } from './utils';
@@ -71,16 +67,6 @@ function registerPartials(partialsGlob: string): void {
}
}
function writeOutputFile(name: string, renderedTsCode: string): void {
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');
const filePath = `${args.output}/${fileName}.ts`;
fs.writeFileSync(filePath, renderedTsCode);
logUtils.log(`Created: ${chalk.bold(filePath)}`);
}
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) {
@@ -97,7 +83,6 @@ if (_.isEmpty(abiFileNames)) {
process.exit(1);
} else {
logUtils.log(`Found ${chalk.green(`${abiFileNames.length}`)} ${chalk.bold('ABI')} files`);
rimraf.sync(args.output);
mkdirp.sync(args.output);
}
for (const abiFileName of abiFileNames) {
@@ -120,6 +105,14 @@ for (const abiFileName of abiFileNames) {
process.exit(1);
}
const outFileName = utils.makeOutputFileName(namedContent.name);
const outFilePath = `${args.output}/${outFileName}.ts`;
if (utils.isOutputFileUpToDate(abiFileName, outFilePath)) {
logUtils.log(`Already 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
@@ -154,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

@@ -1,8 +0,0 @@
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

@@ -2,6 +2,7 @@ import { AbiType, ConstructorAbi, DataItem } from 'ethereum-types';
import * as fs from 'fs';
import * as _ from 'lodash';
import * as path from 'path';
import toSnakeCase = require('to-snake-case');
import { ContractsBackend, ParamKind } from './types';
@@ -92,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

@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@@ -1,6 +1,79 @@
[
{
"version": "0.2.13",
"timestamp": 1536142250,
"version": "1.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1535377027,
"version": "1.0.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1535133899,
"version": "1.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1534210131,
"version": "1.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532619515,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532357734,
"version": "1.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
"note":
@@ -9,6 +82,24 @@
}
]
},
{
"timestamp": 1531919263,
"version": "0.2.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.2.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.2.12",

View File

@@ -1,10 +1,54 @@
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v1.0.8 - _September 5, 2018_
* Dependencies updated
## v1.0.7 - _August 27, 2018_
* Dependencies updated
## v1.0.6 - _August 24, 2018_
* Dependencies updated
## v1.0.5 - _August 14, 2018_
* Dependencies updated
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1 - _July 23, 2018_
* Dependencies updated
## v1.0.0 - _July 20, 2018_
* Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values (#821)
## v0.2.14 - _July 18, 2018_
* Dependencies updated
## v0.2.13 - _July 9, 2018_
* Dependencies updated
## v0.2.12 - _June 19, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/assert",
"version": "0.3.0",
"version": "1.0.8",
"engines": {
"node": ">=6.12"
},
@@ -8,18 +8,15 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib test_temp scripts",
"build": "tsc -b",
"clean": "shx rm -rf lib test_temp",
"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": "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"
"test:circleci": "yarn test:coverage"
},
"license": "Apache-2.0",
"repository": {
@@ -31,27 +28,26 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.2.1",
"@0xproject/tslint-config": "^0.4.20",
"@0xproject/tslint-config": "^1.0.7",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/valid-url": "^1.0.2",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
"@0xproject/json-schemas": "^1.0.0",
"@0xproject/typescript-typings": "^0.4.1",
"@0xproject/utils": "^0.7.1",
"lodash": "^4.17.4",
"@0xproject/json-schemas": "^1.0.1",
"@0xproject/typescript-typings": "^2.0.0",
"@0xproject/utils": "^1.0.8",
"lodash": "^4.17.5",
"valid-url": "^1.0.9"
},
"publishConfig": {

View File

@@ -8,33 +8,33 @@ const HEX_REGEX = /^0x[0-9A-F]*$/i;
export const assert = {
isBigNumber(variableName: string, value: BigNumber): void {
const isBigNumber = _.isObject(value) && (value as any).isBigNumber;
this.assert(isBigNumber, this.typeAssertionMessage(variableName, 'BigNumber', value));
assert.assert(isBigNumber, assert.typeAssertionMessage(variableName, 'BigNumber', value));
},
isValidBaseUnitAmount(variableName: string, value: BigNumber): void {
assert.isBigNumber(variableName, value);
const isNegative = value.lessThan(0);
this.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}`);
assert.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}`);
const hasDecimals = value.decimalPlaces() !== 0;
this.assert(
assert.assert(
!hasDecimals,
`${variableName} should be in baseUnits (no decimals), found value: ${value.toNumber()}`,
);
},
isString(variableName: string, value: string): void {
this.assert(_.isString(value), this.typeAssertionMessage(variableName, 'string', value));
assert.assert(_.isString(value), assert.typeAssertionMessage(variableName, 'string', value));
},
isFunction(variableName: string, value: any): void {
this.assert(_.isFunction(value), this.typeAssertionMessage(variableName, 'function', value));
assert.assert(_.isFunction(value), assert.typeAssertionMessage(variableName, 'function', value));
},
isHexString(variableName: string, value: string): void {
this.assert(
assert.assert(
_.isString(value) && HEX_REGEX.test(value),
this.typeAssertionMessage(variableName, 'HexString', value),
assert.typeAssertionMessage(variableName, 'HexString', value),
);
},
isETHAddressHex(variableName: string, value: string): void {
this.assert(_.isString(value), this.typeAssertionMessage(variableName, 'string', value));
this.assert(addressUtils.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value));
assert.assert(_.isString(value), assert.typeAssertionMessage(variableName, 'string', value));
assert.assert(addressUtils.isAddress(value), assert.typeAssertionMessage(variableName, 'ETHAddressHex', value));
},
doesBelongToStringEnum(
variableName: string,
@@ -51,17 +51,17 @@ export const assert = {
);
},
hasAtMostOneUniqueValue(value: any[], errMsg: string): void {
this.assert(_.uniq(value).length <= 1, errMsg);
assert.assert(_.uniq(value).length <= 1, errMsg);
},
isNumber(variableName: string, value: number): void {
this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value));
assert.assert(_.isFinite(value), assert.typeAssertionMessage(variableName, 'number', value));
},
isBoolean(variableName: string, value: boolean): void {
this.assert(_.isBoolean(value), this.typeAssertionMessage(variableName, 'boolean', value));
assert.assert(_.isBoolean(value), assert.typeAssertionMessage(variableName, 'boolean', value));
},
isWeb3Provider(variableName: string, value: any): void {
const isWeb3Provider = _.isFunction(value.send) || _.isFunction(value.sendAsync);
this.assert(isWeb3Provider, this.typeAssertionMessage(variableName, 'Provider', value));
assert.assert(isWeb3Provider, assert.typeAssertionMessage(variableName, 'Provider', value));
},
doesConformToSchema(variableName: string, value: any, schema: Schema, subSchemas?: Schema[]): void {
if (_.isUndefined(value)) {
@@ -76,15 +76,15 @@ export const assert = {
const msg = `Expected ${variableName} to conform to schema ${schema.id}
Encountered: ${JSON.stringify(value, null, '\t')}
Validation errors: ${validationResult.errors.join(', ')}`;
this.assert(!hasValidationErrors, msg);
assert.assert(!hasValidationErrors, msg);
},
isWebUri(variableName: string, value: any): void {
const isValidUrl = !_.isUndefined(validUrl.isWebUri(value));
this.assert(isValidUrl, this.typeAssertionMessage(variableName, 'web uri', value));
assert.assert(isValidUrl, assert.typeAssertionMessage(variableName, 'web uri', value));
},
isUri(variableName: string, value: any): void {
const isValidUri = !_.isUndefined(validUrl.isUri(value));
this.assert(isValidUri, this.typeAssertionMessage(variableName, 'uri', value));
assert.assert(isValidUri, assert.typeAssertionMessage(variableName, 'uri', value));
},
assert(condition: boolean, message: string): void {
if (!condition) {

View File

@@ -1,8 +0,0 @@
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

@@ -49,7 +49,7 @@ describe('Assertions', () => {
});
describe('#isFunction', () => {
it('should not throw for valid input', () => {
const validInputs = [BigNumber, assert.isString];
const validInputs = [BigNumber, assert.isString.bind(assert)];
validInputs.forEach(input => expect(assert.isFunction.bind(assert, variableName, input)).to.not.throw());
});
it('should throw for invalid input', () => {

View File

@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["./src/**/*", "./test/**/*"]
}

View File

@@ -1,4 +1,104 @@
[
{
"timestamp": 1536142250,
"version": "2.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1535377027,
"version": "2.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1535133899,
"version": "2.0.0",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "2.0.0-rc.1",
"changes": [
{
"pr": 915,
"note": "Added strict encoding/decoding checks for sendTransaction and call"
}
],
"timestamp": 1534210131
},
{
"timestamp": 1532619515,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532357734,
"version": "1.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531919263,
"version": "0.3.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.3.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.3.4",
"changes": [

View File

@@ -1,10 +1,54 @@
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v2.0.2 - _September 5, 2018_
* Dependencies updated
## v2.0.1 - _August 27, 2018_
* Dependencies updated
## v2.0.0 - _August 24, 2018_
* Dependencies updated
## v2.0.0-rc.1 - _August 14, 2018_
* Added strict encoding/decoding checks for sendTransaction and call (#915)
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1 - _July 23, 2018_
* Dependencies updated
## v1.0.0 - _July 20, 2018_
* Dependencies updated
## v0.3.6 - _July 18, 2018_
* Dependencies updated
## v0.3.5 - _July 9, 2018_
* Dependencies updated
## v0.3.4 - _June 19, 2018_
* Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/base-contract",
"version": "0.3.4",
"version": "2.0.2",
"engines": {
"node": ">=6.12"
},
@@ -8,17 +8,15 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib scripts",
"build": "tsc -b",
"clean": "shx rm -rf lib",
"test": "yarn run_mocha",
"rebuild_and_test": "run-s clean build test",
"test:circleci": "yarn test:coverage",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"lint": "tslint --project . --exclude **/src/contract_wrappers/**/*",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
"lint": "tslint --project . --exclude **/src/contract_wrappers/**/*"
},
"license": "Apache-2.0",
"repository": {
@@ -30,25 +28,24 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md",
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.2.1",
"@0xproject/tslint-config": "^0.4.20",
"@0xproject/tslint-config": "^1.0.7",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"copyfiles": "^2.0.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
"ethereum-types": "^0.0.2",
"@0xproject/typescript-typings": "^0.4.1",
"@0xproject/utils": "^0.7.1",
"@0xproject/web3-wrapper": "^0.7.1",
"@0xproject/typescript-typings": "^2.0.0",
"@0xproject/utils": "^1.0.8",
"@0xproject/web3-wrapper": "^2.0.2",
"ethereum-types": "^1.0.6",
"ethers": "3.0.22",
"lodash": "^4.17.4"
"lodash": "^4.17.5"
},
"publishConfig": {
"access": "public"

View File

@@ -72,18 +72,37 @@ export class BaseContract {
// 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: TxData = {
const removeUndefinedProperties = _.pickBy.bind(_);
const txDataWithDefaults = {
...removeUndefinedProperties(txDefaults),
...removeUndefinedProperties(txData as any),
// HACK: TS can't prove that T is spreadable.
// Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged
} as any;
...removeUndefinedProperties(txData),
};
if (_.isUndefined(txDataWithDefaults.gas) && !_.isUndefined(estimateGasAsync)) {
txDataWithDefaults.gas = await estimateGasAsync(txDataWithDefaults as any);
txDataWithDefaults.gas = await estimateGasAsync(txDataWithDefaults);
}
return txDataWithDefaults;
}
// Throws if the given arguments cannot be safely/correctly encoded based on
// the given inputAbi. An argument may not be considered safely encodeable
// if it overflows the corresponding Solidity type, there is a bug in the
// encoder, or the encoder performs unsafe type coercion.
public static strictArgumentEncodingCheck(inputAbi: DataItem[], args: any[]): void {
const coder = ethers.utils.AbiCoder.defaultCoder;
const params = abiUtils.parseEthersParams(inputAbi);
const rawEncoded = coder.encode(params.names, params.types, args);
const rawDecoded = coder.decode(params.names, params.types, rawEncoded);
for (let i = 0; i < rawDecoded.length; i++) {
const original = args[i];
const decoded = rawDecoded[i];
if (!abiUtils.isAbiDataEqual(params.names[i], params.types[i], original, decoded)) {
throw new Error(
`Cannot safely encode argument: ${params.names[i]} (${original}) of type ${
params.types[i]
}. (Possible type overflow or other encoding error)`,
);
}
}
}
protected _lookupEthersInterface(functionSignature: string): ethers.Interface {
const ethersInterface = this._ethersInterfacesByFunctionSignature[functionSignature];
if (_.isUndefined(ethersInterface)) {

View File

@@ -1,8 +0,0 @@
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,114 @@
import * as chai from 'chai';
import 'mocha';
import { BaseContract } from '../src';
const { expect } = chai;
describe('BaseContract', () => {
describe('strictArgumentEncodingCheck', () => {
it('works for simple types', () => {
BaseContract.strictArgumentEncodingCheck(
[{ name: 'to', type: 'address' }],
['0xe834ec434daba538cd1b9fe1582052b880bd7e63'],
);
});
it('works for array types', () => {
const inputAbi = [
{
name: 'takerAssetFillAmounts',
type: 'uint256[]',
},
];
const args = [
['9000000000000000000', '79000000000000000000', '979000000000000000000', '7979000000000000000000'],
];
BaseContract.strictArgumentEncodingCheck(inputAbi, args);
});
it('works for tuple/struct types', () => {
const inputAbi = [
{
components: [
{
name: 'makerAddress',
type: 'address',
},
{
name: 'takerAddress',
type: 'address',
},
{
name: 'feeRecipientAddress',
type: 'address',
},
{
name: 'senderAddress',
type: 'address',
},
{
name: 'makerAssetAmount',
type: 'uint256',
},
{
name: 'takerAssetAmount',
type: 'uint256',
},
{
name: 'makerFee',
type: 'uint256',
},
{
name: 'takerFee',
type: 'uint256',
},
{
name: 'expirationTimeSeconds',
type: 'uint256',
},
{
name: 'salt',
type: 'uint256',
},
{
name: 'makerAssetData',
type: 'bytes',
},
{
name: 'takerAssetData',
type: 'bytes',
},
],
name: 'order',
type: 'tuple',
},
];
const args = [
{
makerAddress: '0x6ecbe1db9ef729cbe972c83fb886247691fb6beb',
takerAddress: '0x0000000000000000000000000000000000000000',
feeRecipientAddress: '0xe834ec434daba538cd1b9fe1582052b880bd7e63',
senderAddress: '0x0000000000000000000000000000000000000000',
makerAssetAmount: '0',
takerAssetAmount: '200000000000000000000',
makerFee: '1000000000000000000',
takerFee: '1000000000000000000',
expirationTimeSeconds: '1532563026',
salt: '59342956082154660870994022243365949771115859664887449740907298019908621891376',
makerAssetData: '0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48',
takerAssetData: '0xf47261b00000000000000000000000001d7022f5b17d2f8b695918fb48fa1089c9f85401',
},
];
BaseContract.strictArgumentEncodingCheck(inputAbi, args);
});
it('throws for integer overflows', () => {
expect(() =>
BaseContract.strictArgumentEncodingCheck([{ name: 'amount', type: 'uint8' }], ['256']),
).to.throw();
});
it('throws for fixed byte array overflows', () => {
expect(() =>
BaseContract.strictArgumentEncodingCheck([{ name: 'hash', type: 'bytes8' }], ['0x001122334455667788']),
).to.throw();
});
});
});

View File

@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"rootDir": "."
},
"include": ["src/**/*", "test/**/*"]
}

View File

@@ -1,4 +1,110 @@
[
{
"version": "2.0.0",
"changes": [
{
"note": "Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields.",
"pr": 1058
}
],
"timestamp": 1536142250
},
{
"version": "2.0.0-rc.2",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1535377027
},
{
"version": "2.0.0-rc.1",
"changes": [
{
"note": "Updated for SRA v2",
"pr": 974
},
{
"note": "Stopped exporting `Order` type",
"pr": 924
}
],
"timestamp": 1535133899
},
{
"timestamp": 1534210131,
"version": "1.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532619515,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532614997,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532605697,
"version": "1.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532357734,
"version": "1.0.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1532043000,
"version": "1.0.0",
"changes": [
{
"note":
"Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`"
}
]
},
{
"timestamp": 1531919263,
"version": "0.6.17",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.6.16",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.6.15",

View File

@@ -1,10 +1,55 @@
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v2.0.0 - _September 5, 2018_
* Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields. (#1058)
## v2.0.0-rc.2 - _August 27, 2018_
* Dependencies updated
## v2.0.0-rc.1 - _August 24, 2018_
* Updated for SRA v2 (#974)
* Stopped exporting `Order` type (#924)
## v1.0.5 - _August 14, 2018_
* Dependencies updated
## v1.0.4 - _July 26, 2018_
* Dependencies updated
## v1.0.3 - _July 26, 2018_
* Dependencies updated
## v1.0.2 - _July 26, 2018_
* Dependencies updated
## v1.0.1 - _July 23, 2018_
* Dependencies updated
## v1.0.0 - _July 20, 2018_
* Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`
## v0.6.17 - _July 18, 2018_
* Dependencies updated
## v0.6.16 - _July 9, 2018_
* Dependencies updated
## v0.6.15 - _June 19, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/connect",
"version": "0.6.15",
"version": "2.0.0",
"engines": {
"node": ">=6.12"
},
@@ -15,9 +15,8 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"watch_without_deps": "tsc -w",
"build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib test_temp scripts",
"build": "tsc -b",
"clean": "shx rm -rf lib test_temp generated_docs",
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
"lint": "tslint --project .",
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit",
@@ -26,18 +25,11 @@
"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",
"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"
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
"config": {
"postpublish": {
"assets": [],
"docPublishConfigs": {
"s3BucketPath": "s3://doc-jsons/connect/",
"s3StagingBucketPath": "s3://staging-doc-jsons/connect/"
}
"assets": []
}
},
"repository": {
@@ -51,38 +43,41 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
"dependencies": {
"@0xproject/assert": "^0.2.12",
"@0xproject/json-schemas": "0.8.1",
"@0xproject/types": "^0.8.1",
"@0xproject/typescript-typings": "^0.4.1",
"@0xproject/utils": "^0.7.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
"@0xproject/assert": "^1.0.8",
"@0xproject/json-schemas": "^1.0.1",
"@0xproject/order-utils": "^1.0.1",
"@0xproject/types": "^1.0.1",
"@0xproject/typescript-typings": "^2.0.0",
"@0xproject/utils": "^1.0.8",
"lodash": "^4.17.5",
"query-string": "^5.0.1",
"sinon": "^4.0.0",
"uuid": "^3.3.2",
"websocket": "^1.0.25"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.2.1",
"@0xproject/tslint-config": "^0.4.20",
"@types/fetch-mock": "^5.12.1",
"@0xproject/tslint-config": "^1.0.7",
"@types/fetch-mock": "^6.0.3",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/query-string": "^5.0.1",
"@types/websocket": "^0.0.34",
"@types/sinon": "^2.2.2",
"@types/uuid": "^3.4.3",
"@types/websocket": "^0.0.39",
"async-child-process": "^1.1.1",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"copyfiles": "^1.2.0",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"fetch-mock": "^5.13.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typedoc": "~0.8.0",
"typescript": "2.7.1"
"tslint": "5.11.0",
"typedoc": "0.12.0",
"typescript": "3.0.1"
},
"publishConfig": {
"access": "public"

View File

@@ -1,44 +1,38 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
import { SignedOrder } from '@0xproject/types';
import 'isomorphic-fetch';
import { fetchAsync } from '@0xproject/utils';
import * as _ from 'lodash';
import * as queryString from 'query-string';
import { schemas as clientSchemas } from './schemas/schemas';
import {
APIOrder,
AssetPairsRequestOpts,
AssetPairsResponse,
Client,
FeesRequest,
FeesResponse,
FeeRecipientsResponse,
HttpRequestOptions,
HttpRequestType,
OrderbookRequest,
OrderbookResponse,
OrderConfigRequest,
OrderConfigResponse,
OrdersRequestOpts,
OrdersResponse,
PagedRequestOpts,
TokenPairsItem,
TokenPairsRequestOpts,
RequestOpts,
} from './types';
import { relayerResponseJsonParsers } from './utils/relayer_response_json_parsers';
const TRAILING_SLASHES_REGEX = /\/+$/;
const DEFAULT_PAGED_REQUEST_OPTS: PagedRequestOpts = {
page: 1,
perPage: 100,
};
/**
* This mapping defines how an option property name gets converted into an HTTP request query field
*/
const OPTS_TO_QUERY_FIELD_MAP = {
perPage: 'per_page',
};
/**
* This class includes all the functionality related to interacting with a set of HTTP endpoints
* that implement the standard relayer API v0
*/
export class HttpClient implements Client {
private _apiEndpointUrl: string;
private readonly _apiEndpointUrl: string;
/**
* Format parameters to be appended to http requests into query string form
*/
@@ -47,12 +41,8 @@ export class HttpClient implements Client {
if (_.isUndefined(params) || _.isEmpty(params)) {
return '';
}
// format params into a form the api expects
const formattedParams = _.mapKeys(params, (_value: any, key: string) => {
return _.get(OPTS_TO_QUERY_FIELD_MAP, key, key);
});
// stringify the formatted object
const stringifiedParams = queryString.stringify(formattedParams);
const stringifiedParams = queryString.stringify(params);
return `?${stringifiedParams}`;
}
/**
@@ -65,34 +55,40 @@ export class HttpClient implements Client {
this._apiEndpointUrl = url.replace(TRAILING_SLASHES_REGEX, ''); // remove trailing slashes
}
/**
* Retrieve token pair info from the API
* @param requestOpts Options specifying token information to retrieve and page information, defaults to { page: 1, perPage: 100 }
* @return The resulting TokenPairsItems that match the request
* Retrieve assetData pair info from the API
* @param requestOpts Options specifying assetData information to retrieve, page information, and network id.
* @return The resulting AssetPairsResponse that match the request
*/
public async getTokenPairsAsync(requestOpts?: TokenPairsRequestOpts & PagedRequestOpts): Promise<TokenPairsItem[]> {
public async getAssetPairsAsync(
requestOpts?: RequestOpts & AssetPairsRequestOpts & PagedRequestOpts,
): Promise<AssetPairsResponse> {
if (!_.isUndefined(requestOpts)) {
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.tokenPairsRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.assetPairsRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema);
}
const httpRequestOpts = {
params: _.defaults({}, requestOpts, DEFAULT_PAGED_REQUEST_OPTS),
params: requestOpts,
};
const responseJson = await this._requestAsync('/token_pairs', HttpRequestType.Get, httpRequestOpts);
const tokenPairs = relayerResponseJsonParsers.parseTokenPairsJson(responseJson);
return tokenPairs;
const responseJson = await this._requestAsync('/asset_pairs', HttpRequestType.Get, httpRequestOpts);
const assetDataPairs = relayerResponseJsonParsers.parseAssetDataPairsJson(responseJson);
return assetDataPairs;
}
/**
* Retrieve orders from the API
* @param requestOpts Options specifying orders to retrieve and page information, defaults to { page: 1, perPage: 100 }
* @return The resulting SignedOrders that match the request
* @param requestOpts Options specifying orders to retrieve and page information, page information, and network id.
* @return The resulting OrdersResponse that match the request
*/
public async getOrdersAsync(requestOpts?: OrdersRequestOpts & PagedRequestOpts): Promise<SignedOrder[]> {
public async getOrdersAsync(
requestOpts?: RequestOpts & OrdersRequestOpts & PagedRequestOpts,
): Promise<OrdersResponse> {
if (!_.isUndefined(requestOpts)) {
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.ordersRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema);
}
const httpRequestOpts = {
params: _.defaults({}, requestOpts, DEFAULT_PAGED_REQUEST_OPTS),
params: requestOpts,
};
const responseJson = await this._requestAsync(`/orders`, HttpRequestType.Get, httpRequestOpts);
const orders = relayerResponseJsonParsers.parseOrdersJson(responseJson);
@@ -101,30 +97,37 @@ export class HttpClient implements Client {
/**
* Retrieve a specific order from the API
* @param orderHash An orderHash generated from the desired order
* @return The SignedOrder that matches the supplied orderHash
* @return The APIOrder that matches the supplied orderHash
*/
public async getOrderAsync(orderHash: string): Promise<SignedOrder> {
public async getOrderAsync(orderHash: string, requestOpts?: RequestOpts): Promise<APIOrder> {
if (!_.isUndefined(requestOpts)) {
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema);
}
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
const responseJson = await this._requestAsync(`/order/${orderHash}`, HttpRequestType.Get);
const order = relayerResponseJsonParsers.parseOrderJson(responseJson);
const httpRequestOpts = {
params: requestOpts,
};
const responseJson = await this._requestAsync(`/order/${orderHash}`, HttpRequestType.Get, httpRequestOpts);
const order = relayerResponseJsonParsers.parseAPIOrderJson(responseJson);
return order;
}
/**
* Retrieve an orderbook from the API
* @param request An OrderbookRequest instance describing the specific orderbook to retrieve
* @param requestOpts Options specifying page information, defaults to { page: 1, perPage: 100 }
* @param requestOpts Options specifying page information, and network id.
* @return The resulting OrderbookResponse that matches the request
*/
public async getOrderbookAsync(
request: OrderbookRequest,
requestOpts?: PagedRequestOpts,
requestOpts?: RequestOpts & PagedRequestOpts,
): Promise<OrderbookResponse> {
assert.doesConformToSchema('request', request, clientSchemas.orderBookRequestSchema);
if (!_.isUndefined(requestOpts)) {
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema);
}
const httpRequestOpts = {
params: _.defaults({}, request, requestOpts, DEFAULT_PAGED_REQUEST_OPTS),
params: _.defaults({}, request, requestOpts),
};
const responseJson = await this._requestAsync('/orderbook', HttpRequestType.Get, httpRequestOpts);
const orderbook = relayerResponseJsonParsers.parseOrderbookResponseJson(responseJson);
@@ -132,28 +135,55 @@ export class HttpClient implements Client {
}
/**
* Retrieve fee information from the API
* @param request A FeesRequest instance describing the specific fees to retrieve
* @return The resulting FeesResponse that matches the request
* @param request A OrderConfigRequest instance describing the specific fees to retrieve
* @param requestOpts Options specifying network id.
* @return The resulting OrderConfigResponse that matches the request
*/
public async getFeesAsync(request: FeesRequest): Promise<FeesResponse> {
assert.doesConformToSchema('request', request, clientSchemas.feesRequestSchema);
public async getOrderConfigAsync(
request: OrderConfigRequest,
requestOpts?: RequestOpts,
): Promise<OrderConfigResponse> {
if (!_.isUndefined(requestOpts)) {
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema);
}
assert.doesConformToSchema('request', request, clientSchemas.orderConfigRequestSchema);
const httpRequestOpts = {
params: requestOpts,
payload: request,
};
const responseJson = await this._requestAsync('/fees', HttpRequestType.Post, httpRequestOpts);
const fees = relayerResponseJsonParsers.parseFeesResponseJson(responseJson);
const responseJson = await this._requestAsync('/order_config', HttpRequestType.Get, httpRequestOpts);
const fees = relayerResponseJsonParsers.parseOrderConfigResponseJson(responseJson);
return fees;
}
/**
* Retrieve the list of fee recipient addresses used by the relayer.
* @param requestOpts Options specifying page information, and network id.
* @return The resulting FeeRecipientsResponse
*/
public async getFeeRecipientsAsync(requestOpts?: RequestOpts & PagedRequestOpts): Promise<FeeRecipientsResponse> {
if (!_.isUndefined(requestOpts)) {
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema);
assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema);
}
const httpRequestOpts = {
params: requestOpts,
};
const feeRecipients = await this._requestAsync('/fee_recipients', HttpRequestType.Get, httpRequestOpts);
assert.doesConformToSchema('feeRecipients', feeRecipients, schemas.relayerApiFeeRecipientsResponseSchema);
return feeRecipients;
}
/**
* Submit a signed order to the API
* @param signedOrder A SignedOrder instance to submit
* @param requestOpts Options specifying network id.
*/
public async submitOrderAsync(signedOrder: SignedOrder): Promise<void> {
public async submitOrderAsync(signedOrder: SignedOrder, requestOpts?: RequestOpts): Promise<void> {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
const requestOpts = {
const httpRequestOpts = {
params: requestOpts,
payload: signedOrder,
};
await this._requestAsync('/order', HttpRequestType.Post, requestOpts);
await this._requestAsync('/order', HttpRequestType.Post, httpRequestOpts);
}
private async _requestAsync(
path: string,
@@ -167,7 +197,7 @@ export class HttpClient implements Client {
const headers = new Headers({
'content-type': 'application/json',
});
const response = await fetch(url, {
const response = await fetchAsync(url, {
method: requestType,
body: JSON.stringify(payload),
headers,

View File

@@ -1,20 +1,23 @@
export { HttpClient } from './http_client';
export { WebSocketOrderbookChannel } from './ws_orderbook_channel';
export { ordersChannelFactory } from './orders_channel_factory';
export {
Client,
FeesRequest,
FeesResponse,
OrderbookChannel,
OrderbookChannelHandler,
OrderbookChannelSubscriptionOpts,
OrderConfigRequest,
OrderConfigResponse,
OrdersChannel,
OrdersChannelHandler,
OrdersChannelSubscriptionOpts,
OrderbookRequest,
OrderbookResponse,
OrdersRequestOpts,
PagedRequestOpts,
TokenPairsItem,
TokenPairsRequestOpts,
TokenTradeInfo,
WebSocketOrderbookChannelConfig,
AssetPairsRequestOpts,
RequestOpts,
AssetPairsResponse,
FeeRecipientsResponse,
APIOrder,
OrdersResponse,
PaginatedCollection,
} from './types';
export { Order, SignedOrder } from '@0xproject/types';
export { SignedOrder } from '@0xproject/types';

View File

@@ -1,8 +0,0 @@
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,8 +0,0 @@
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

@@ -0,0 +1,29 @@
import * as WebSocket from 'websocket';
import { OrdersChannel, OrdersChannelHandler } from './types';
import { assert } from './utils/assert';
import { WebSocketOrdersChannel } from './ws_orders_channel';
export const ordersChannelFactory = {
/**
* Instantiates a new WebSocketOrdersChannel instance
* @param url The relayer API base WS url you would like to interact with
* @param handler An OrdersChannelHandler instance that responds to various
* channel updates
* @return An OrdersChannel Promise
*/
async createWebSocketOrdersChannelAsync(url: string, handler: OrdersChannelHandler): Promise<OrdersChannel> {
assert.isUri('url', url);
assert.isOrdersChannelHandler('handler', handler);
return new Promise<OrdersChannel>((resolve, reject) => {
const client = new WebSocket.w3cwebsocket(url);
client.onopen = () => {
const ordersChannel = new WebSocketOrdersChannel(client, handler);
resolve(ordersChannel);
};
client.onerror = err => {
reject(err);
};
});
},
};

View File

@@ -0,0 +1,8 @@
export const assetPairsRequestOptsSchema = {
id: '/AssetPairsRequestOpts',
type: 'object',
properties: {
assetDataA: { $ref: '/hexSchema' },
assetDataB: { $ref: '/hexSchema' },
},
};

View File

@@ -1,26 +0,0 @@
export const feesRequestSchema = {
id: '/FeesRequest',
type: 'object',
properties: {
exchangeContractAddress: { $ref: '/Address' },
maker: { $ref: '/Address' },
taker: { $ref: '/Address' },
makerTokenAddress: { $ref: '/Address' },
takerTokenAddress: { $ref: '/Address' },
makerTokenAmount: { $ref: '/Number' },
takerTokenAmount: { $ref: '/Number' },
expirationUnixTimestampSec: { $ref: '/Number' },
salt: { $ref: '/Number' },
},
required: [
'exchangeContractAddress',
'maker',
'taker',
'makerTokenAddress',
'takerTokenAddress',
'makerTokenAmount',
'takerTokenAmount',
'expirationUnixTimestampSec',
'salt',
],
};

View File

@@ -0,0 +1,24 @@
export const orderConfigRequestSchema = {
id: '/OrderConfigRequest',
type: 'object',
properties: {
makerAddress: { $ref: '/addressSchema' },
takerAddress: { $ref: '/addressSchema' },
makerAssetAmount: { $ref: '/numberSchema' },
takerAssetAmount: { $ref: '/numberSchema' },
makerAssetData: { $ref: '/hexSchema' },
takerAssetData: { $ref: '/hexSchema' },
exchangeAddress: { $ref: '/addressSchema' },
expirationTimeSeconds: { $ref: '/numberSchema' },
},
required: [
'makerAddress',
'takerAddress',
'makerAssetAmount',
'takerAssetAmount',
'makerAssetData',
'takerAssetData',
'exchangeAddress',
'expirationTimeSeconds',
],
};

View File

@@ -2,8 +2,8 @@ export const orderBookRequestSchema = {
id: '/OrderBookRequest',
type: 'object',
properties: {
baseTokenAddress: { $ref: '/Address' },
quoteTokenAddress: { $ref: '/Address' },
baseAssetData: { $ref: '/hexSchema' },
quoteAssetData: { $ref: '/hexSchema' },
},
required: ['baseTokenAddress', 'quoteTokenAddress'],
required: ['baseAssetData', 'quoteAssetData'],
};

View File

@@ -2,15 +2,18 @@ export const ordersRequestOptsSchema = {
id: '/OrdersRequestOpts',
type: 'object',
properties: {
exchangeContractAddress: { $ref: '/Address' },
tokenAddress: { $ref: '/Address' },
makerTokenAddress: { $ref: '/Address' },
takerTokenAddress: { $ref: '/Address' },
tokenA: { $ref: '/Address' },
tokenB: { $ref: '/Address' },
maker: { $ref: '/Address' },
taker: { $ref: '/Address' },
trader: { $ref: '/Address' },
feeRecipient: { $ref: '/Address' },
makerAssetProxyId: { $ref: '/hexSchema' },
takerAssetProxyId: { $ref: '/hexSchema' },
makerAssetAddress: { $ref: '/addressSchema' },
takerAssetAddress: { $ref: '/addressSchema' },
exchangeAddress: { $ref: '/addressSchema' },
senderAddress: { $ref: '/addressSchema' },
makerAssetData: { $ref: '/hexSchema' },
takerAssetData: { $ref: '/hexSchema' },
traderAssetData: { $ref: '/hexSchema' },
makerAddress: { $ref: '/addressSchema' },
takerAddress: { $ref: '/addressSchema' },
traderAddress: { $ref: '/addressSchema' },
feeRecipientAddress: { $ref: '/addressSchema' },
},
};

View File

@@ -0,0 +1,7 @@
export const requestOptsSchema = {
id: '/RequestOpts',
type: 'object',
properties: {
networkId: { type: 'number' },
},
};

View File

@@ -1,15 +1,15 @@
import { feesRequestSchema } from './fees_request_schema';
import { assetPairsRequestOptsSchema } from './asset_pairs_request_opts_schema';
import { orderConfigRequestSchema } from './order_config_request_schema';
import { orderBookRequestSchema } from './orderbook_request_schema';
import { ordersRequestOptsSchema } from './orders_request_opts_schema';
import { pagedRequestOptsSchema } from './paged_request_opts_schema';
import { tokenPairsRequestOptsSchema } from './token_pairs_request_opts_schema';
import { webSocketOrderbookChannelConfigSchema } from './websocket_orderbook_channel_config_schema';
import { requestOptsSchema } from './request_opts_schema';
export const schemas = {
feesRequestSchema,
orderConfigRequestSchema,
orderBookRequestSchema,
ordersRequestOptsSchema,
pagedRequestOptsSchema,
tokenPairsRequestOptsSchema,
webSocketOrderbookChannelConfigSchema,
requestOptsSchema,
assetPairsRequestOptsSchema,
};

View File

@@ -1,8 +0,0 @@
export const tokenPairsRequestOptsSchema = {
id: '/TokenPairsRequestOpts',
type: 'object',
properties: {
tokenA: { $ref: '/Address' },
tokenB: { $ref: '/Address' },
},
};

View File

@@ -1,10 +0,0 @@
export const webSocketOrderbookChannelConfigSchema = {
id: '/WebSocketOrderbookChannelConfig',
type: 'object',
properties: {
heartbeatIntervalMs: {
type: 'number',
minimum: 10,
},
},
};

View File

@@ -2,80 +2,55 @@ import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
export interface Client {
getTokenPairsAsync: (requestOpts?: TokenPairsRequestOpts & PagedRequestOpts) => Promise<TokenPairsItem[]>;
getOrdersAsync: (requestOpts?: OrdersRequestOpts & PagedRequestOpts) => Promise<SignedOrder[]>;
getOrderAsync: (orderHash: string) => Promise<SignedOrder>;
getAssetPairsAsync: (
requestOpts?: AssetPairsRequestOpts & PagedRequestOpts,
) => Promise<PaginatedCollection<AssetPairsItem>>;
getOrdersAsync: (requestOpts?: OrdersRequestOpts & PagedRequestOpts) => Promise<PaginatedCollection<APIOrder>>;
getOrderAsync: (orderHash: string) => Promise<APIOrder>;
getOrderbookAsync: (request: OrderbookRequest, requestOpts?: PagedRequestOpts) => Promise<OrderbookResponse>;
getFeesAsync: (request: FeesRequest) => Promise<FeesResponse>;
getOrderConfigAsync: (request: OrderConfigRequest) => Promise<OrderConfigResponse>;
getFeeRecipientsAsync: (requestOpts?: PagedRequestOpts) => Promise<FeeRecipientsResponse>;
submitOrderAsync: (signedOrder: SignedOrder) => Promise<void>;
}
export interface OrderbookChannel {
subscribe: (subscriptionOpts: OrderbookChannelSubscriptionOpts, handler: OrderbookChannelHandler) => void;
export interface OrdersChannel {
subscribe: (subscriptionOpts: OrdersChannelSubscriptionOpts) => void;
close: () => void;
}
/**
* heartbeatInterval: Interval in milliseconds that the orderbook channel should ping the underlying websocket. Default: 15000
*/
export interface WebSocketOrderbookChannelConfig {
heartbeatIntervalMs?: number;
}
/**
* baseTokenAddress: The address of token designated as the baseToken in the currency pair calculation of price
* quoteTokenAddress: The address of token designated as the quoteToken in the currency pair calculation of price
* snapshot: If true, a snapshot of the orderbook will be sent before the updates to the orderbook
* baseAssetData: The address of assetData designated as the baseToken in the currency pair calculation of price
* quoteAssetData: The address of assetData designated as the quoteToken in the currency pair calculation of price
* limit: Maximum number of bids and asks in orderbook snapshot
*/
export interface OrderbookChannelSubscriptionOpts {
baseTokenAddress: string;
quoteTokenAddress: string;
snapshot: boolean;
export interface OrdersChannelSubscriptionOpts {
baseAssetData: string;
quoteAssetData: string;
limit: number;
}
export interface OrderbookChannelHandler {
onSnapshot: (
channel: OrderbookChannel,
subscriptionOpts: OrderbookChannelSubscriptionOpts,
snapshot: OrderbookResponse,
) => void;
onUpdate: (
channel: OrderbookChannel,
subscriptionOpts: OrderbookChannelSubscriptionOpts,
order: SignedOrder,
) => void;
onError: (channel: OrderbookChannel, subscriptionOpts: OrderbookChannelSubscriptionOpts, err: Error) => void;
onClose: (channel: OrderbookChannel, subscriptionOpts: OrderbookChannelSubscriptionOpts) => void;
export interface OrdersChannelHandler {
onUpdate: (channel: OrdersChannel, subscriptionOpts: OrdersChannelSubscriptionOpts, orders: APIOrder[]) => void;
onError: (channel: OrdersChannel, err: Error, subscriptionOpts?: OrdersChannelSubscriptionOpts) => void;
onClose: (channel: OrdersChannel) => void;
}
export type OrderbookChannelMessage =
| SnapshotOrderbookChannelMessage
| UpdateOrderbookChannelMessage
| UnknownOrderbookChannelMessage;
export type OrdersChannelMessage = UpdateOrdersChannelMessage | UnknownOrdersChannelMessage;
export enum OrderbookChannelMessageTypes {
Snapshot = 'snapshot',
export enum OrdersChannelMessageTypes {
Update = 'update',
Unknown = 'unknown',
}
export interface SnapshotOrderbookChannelMessage {
type: OrderbookChannelMessageTypes.Snapshot;
requestId: number;
payload: OrderbookResponse;
export interface UpdateOrdersChannelMessage {
type: OrdersChannelMessageTypes.Update;
requestId: string;
payload: APIOrder[];
}
export interface UpdateOrderbookChannelMessage {
type: OrderbookChannelMessageTypes.Update;
requestId: number;
payload: SignedOrder;
}
export interface UnknownOrderbookChannelMessage {
type: OrderbookChannelMessageTypes.Unknown;
requestId: number;
export interface UnknownOrdersChannelMessage {
type: OrdersChannelMessageTypes.Unknown;
requestId: string;
payload: undefined;
}
@@ -90,60 +65,86 @@ export enum WebsocketClientEventType {
ConnectFailed = 'connectFailed',
}
export interface TokenPairsRequestOpts {
tokenA?: string;
tokenB?: string;
export type OrdersResponse = PaginatedCollection<APIOrder>;
export interface APIOrder {
order: SignedOrder;
metaData: object;
}
export interface TokenPairsItem {
tokenA: TokenTradeInfo;
tokenB: TokenTradeInfo;
export interface AssetPairsRequestOpts {
assetDataA?: string;
assetDataB?: string;
}
export interface TokenTradeInfo {
address: string;
export type AssetPairsResponse = PaginatedCollection<AssetPairsItem>;
export interface AssetPairsItem {
assetDataA: Asset;
assetDataB: Asset;
}
export interface Asset {
assetData: string;
minAmount: BigNumber;
maxAmount: BigNumber;
precision: number;
}
export interface OrdersRequestOpts {
exchangeContractAddress?: string;
tokenAddress?: string;
makerTokenAddress?: string;
takerTokenAddress?: string;
maker?: string;
taker?: string;
trader?: string;
feeRecipient?: string;
makerAssetProxyId?: string;
takerAssetProxyId?: string;
makerAssetAddress?: string;
takerAssetAddress?: string;
exchangeAddress?: string;
senderAddress?: string;
makerAssetData?: string;
takerAssetData?: string;
makerAddress?: string;
takerAddress?: string;
traderAddress?: string;
feeRecipientAddress?: string;
}
export interface OrderbookRequest {
baseTokenAddress: string;
quoteTokenAddress: string;
baseAssetData: string;
quoteAssetData: string;
}
export interface OrderbookResponse {
bids: SignedOrder[];
asks: SignedOrder[];
bids: PaginatedCollection<APIOrder>;
asks: PaginatedCollection<APIOrder>;
}
export interface FeesRequest {
exchangeContractAddress: string;
maker: string;
taker: string;
makerTokenAddress: string;
takerTokenAddress: string;
makerTokenAmount: BigNumber;
takerTokenAmount: BigNumber;
expirationUnixTimestampSec: BigNumber;
salt: BigNumber;
export interface PaginatedCollection<T> {
total: number;
page: number;
perPage: number;
records: T[];
}
export interface FeesResponse {
feeRecipient: string;
export interface OrderConfigRequest {
makerAddress: string;
takerAddress: string;
makerAssetAmount: BigNumber;
takerAssetAmount: BigNumber;
makerAssetData: string;
takerAssetData: string;
exchangeAddress: string;
expirationTimeSeconds: BigNumber;
}
export interface OrderConfigResponse {
makerFee: BigNumber;
takerFee: BigNumber;
feeRecipientAddress: string;
senderAddress: string;
}
export type FeeRecipientsResponse = PaginatedCollection<string>;
export interface RequestOpts {
networkId?: number;
}
export interface PagedRequestOpts {

View File

@@ -0,0 +1,25 @@
import { assert as sharedAssert } from '@0xproject/assert';
// HACK: 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, schemas } from '@0xproject/json-schemas';
// tslint:disable-next-line:no-unused-variable
import { ECSignature } from '@0xproject/types';
// tslint:disable-next-line:no-unused-variable
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
export const assert = {
...sharedAssert,
isOrdersChannelSubscriptionOpts(variableName: string, subscriptionOpts: any): void {
sharedAssert.doesConformToSchema(
variableName,
subscriptionOpts,
schemas.relayerApiOrdersChannelSubscribePayload,
);
},
isOrdersChannelHandler(variableName: string, handler: any): void {
sharedAssert.isFunction(`${variableName}.onUpdate`, _.get(handler, 'onUpdate'));
sharedAssert.isFunction(`${variableName}.onError`, _.get(handler, 'onError'));
sharedAssert.isFunction(`${variableName}.onClose`, _.get(handler, 'onClose'));
},
};

View File

@@ -1,37 +0,0 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
import * as _ from 'lodash';
import { OrderbookChannelMessage, OrderbookChannelMessageTypes } from '../types';
import { relayerResponseJsonParsers } from './relayer_response_json_parsers';
export const orderbookChannelMessageParser = {
parse(utf8Data: string): OrderbookChannelMessage {
const messageObj = JSON.parse(utf8Data);
const type: string = _.get(messageObj, 'type');
assert.assert(!_.isUndefined(type), `Message is missing a type parameter: ${utf8Data}`);
assert.isString('type', type);
switch (type) {
case OrderbookChannelMessageTypes.Snapshot: {
assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrderbookChannelSnapshotSchema);
const orderbookJson = messageObj.payload;
const orderbook = relayerResponseJsonParsers.parseOrderbookResponseJson(orderbookJson);
return _.assign(messageObj, { payload: orderbook });
}
case OrderbookChannelMessageTypes.Update: {
assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrderbookChannelUpdateSchema);
const orderJson = messageObj.payload;
const order = relayerResponseJsonParsers.parseOrderJson(orderJson);
return _.assign(messageObj, { payload: order });
}
default: {
return {
type: OrderbookChannelMessageTypes.Unknown,
requestId: 0,
payload: undefined,
};
}
}
},
};

View File

@@ -0,0 +1,37 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
import * as _ from 'lodash';
import { OrdersChannelMessage, OrdersChannelMessageTypes } from '../types';
import { relayerResponseJsonParsers } from './relayer_response_json_parsers';
export const ordersChannelMessageParser = {
parse(utf8Data: string): OrdersChannelMessage {
// parse the message
const messageObj = JSON.parse(utf8Data);
// ensure we have a type parameter to switch on
const type: string = _.get(messageObj, 'type');
assert.assert(!_.isUndefined(type), `Message is missing a type parameter: ${utf8Data}`);
assert.isString('type', type);
// ensure we have a request id for the resulting message
const requestId: string = _.get(messageObj, 'requestId');
assert.assert(!_.isUndefined(requestId), `Message is missing a requestId parameter: ${utf8Data}`);
assert.isString('requestId', requestId);
switch (type) {
case OrdersChannelMessageTypes.Update: {
assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrdersChannelUpdateSchema);
const ordersJson = messageObj.payload;
const orders = relayerResponseJsonParsers.parseAPIOrdersJson(ordersJson);
return _.assign(messageObj, { payload: orders });
}
default: {
return {
type: OrdersChannelMessageTypes.Unknown,
requestId,
payload: undefined,
};
}
}
},
};

View File

@@ -1,37 +1,50 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
import { SignedOrder } from '@0xproject/types';
import { orderParsingUtils } from '@0xproject/order-utils';
import { FeesResponse, OrderbookResponse, TokenPairsItem } from '../types';
import {
APIOrder,
AssetPairsItem,
AssetPairsResponse,
OrderbookResponse,
OrderConfigResponse,
OrdersResponse,
} from '../types';
import { typeConverters } from './type_converters';
export const relayerResponseJsonParsers = {
parseTokenPairsJson(json: any): TokenPairsItem[] {
assert.doesConformToSchema('tokenPairs', json, schemas.relayerApiTokenPairsResponseSchema);
return json.map((tokenPair: any) => {
return typeConverters.convertStringsFieldsToBigNumbers(tokenPair, [
'tokenA.minAmount',
'tokenA.maxAmount',
'tokenB.minAmount',
'tokenB.maxAmount',
parseAssetDataPairsJson(json: any): AssetPairsResponse {
assert.doesConformToSchema('assetDataPairsResponse', json, schemas.relayerApiAssetDataPairsResponseSchema);
return { ...json, records: relayerResponseJsonParsers.parseAssetPairsItemsJson(json.records) };
},
parseAssetPairsItemsJson(json: any): AssetPairsItem[] {
return json.map((assetDataPair: any) => {
return orderParsingUtils.convertStringsFieldsToBigNumbers(assetDataPair, [
'assetDataA.minAmount',
'assetDataA.maxAmount',
'assetDataB.minAmount',
'assetDataB.maxAmount',
]);
});
},
parseOrdersJson(json: any): SignedOrder[] {
assert.doesConformToSchema('orders', json, schemas.signedOrdersSchema);
return json.map((order: object) => typeConverters.convertOrderStringFieldsToBigNumber(order));
parseOrdersJson(json: any): OrdersResponse {
assert.doesConformToSchema('relayerApiOrdersResponse', json, schemas.relayerApiOrdersResponseSchema);
return { ...json, records: relayerResponseJsonParsers.parseAPIOrdersJson(json.records) };
},
parseOrderJson(json: any): SignedOrder {
assert.doesConformToSchema('order', json, schemas.signedOrderSchema);
return typeConverters.convertOrderStringFieldsToBigNumber(json);
parseAPIOrdersJson(json: any): APIOrder[] {
return json.map(relayerResponseJsonParsers.parseAPIOrderJson.bind(relayerResponseJsonParsers));
},
parseAPIOrderJson(json: any): APIOrder {
assert.doesConformToSchema('relayerApiOrder', json, schemas.relayerApiOrderSchema);
return typeConverters.convertAPIOrderStringFieldsToBigNumber(json);
},
parseOrderbookResponseJson(json: any): OrderbookResponse {
assert.doesConformToSchema('orderBook', json, schemas.relayerApiOrderBookResponseSchema);
assert.doesConformToSchema('orderBookResponse', json, schemas.relayerApiOrderbookResponseSchema);
return typeConverters.convertOrderbookStringFieldsToBigNumber(json);
},
parseFeesResponseJson(json: any): FeesResponse {
assert.doesConformToSchema('fees', json, schemas.relayerApiFeesResponseSchema);
return typeConverters.convertStringsFieldsToBigNumbers(json, ['makerFee', 'takerFee']);
parseOrderConfigResponseJson(json: any): OrderConfigResponse {
assert.doesConformToSchema('orderConfigResponse', json, schemas.relayerApiOrderConfigResponseSchema);
return orderParsingUtils.convertStringsFieldsToBigNumbers(json, ['makerFee', 'takerFee']);
},
};

View File

@@ -1,30 +1,26 @@
import { BigNumber } from '@0xproject/utils';
import { orderParsingUtils } from '@0xproject/order-utils';
import * as _ from 'lodash';
import { APIOrder } from '../types';
export const typeConverters = {
convertOrderbookStringFieldsToBigNumber(orderbook: any): any {
const bids = _.get(orderbook, 'bids', []);
const asks = _.get(orderbook, 'asks', []);
const convertedBids = {
...bids,
records: bids.records.map((order: any) => typeConverters.convertAPIOrderStringFieldsToBigNumber(order)),
};
const convertedAsks = {
...asks,
records: asks.records.map((order: any) => typeConverters.convertAPIOrderStringFieldsToBigNumber(order)),
};
return {
bids: bids.map((order: any) => this.convertOrderStringFieldsToBigNumber(order)),
asks: asks.map((order: any) => this.convertOrderStringFieldsToBigNumber(order)),
bids: convertedBids,
asks: convertedAsks,
};
},
convertOrderStringFieldsToBigNumber(order: any): any {
return this.convertStringsFieldsToBigNumbers(order, [
'makerTokenAmount',
'takerTokenAmount',
'makerFee',
'takerFee',
'expirationUnixTimestampSec',
'salt',
]);
},
convertStringsFieldsToBigNumbers(obj: any, fields: string[]): any {
const result = _.assign({}, obj);
_.each(fields, field => {
_.update(result, field, (value: string) => new BigNumber(value));
});
return result;
convertAPIOrderStringFieldsToBigNumber(apiOrder: any): APIOrder {
return { ...apiOrder, order: orderParsingUtils.convertOrderStringFieldsToBigNumber(apiOrder.order) };
},
};

View File

@@ -1,166 +0,0 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
import * as _ from 'lodash';
import * as WebSocket from 'websocket';
import { schemas as clientSchemas } from './schemas/schemas';
import {
OrderbookChannel,
OrderbookChannelHandler,
OrderbookChannelMessageTypes,
OrderbookChannelSubscriptionOpts,
WebsocketClientEventType,
WebsocketConnectionEventType,
WebSocketOrderbookChannelConfig,
} from './types';
import { orderbookChannelMessageParser } from './utils/orderbook_channel_message_parser';
const DEFAULT_HEARTBEAT_INTERVAL_MS = 15000;
const MINIMUM_HEARTBEAT_INTERVAL_MS = 10;
/**
* This class includes all the functionality related to interacting with a websocket endpoint
* that implements the standard relayer API v0
*/
export class WebSocketOrderbookChannel implements OrderbookChannel {
private _apiEndpointUrl: string;
private _client: WebSocket.client;
private _connectionIfExists?: WebSocket.connection;
private _heartbeatTimerIfExists?: NodeJS.Timer;
private _subscriptionCounter = 0;
private _heartbeatIntervalMs: number;
/**
* Instantiates a new WebSocketOrderbookChannel instance
* @param url The relayer API base WS url you would like to interact with
* @param config The configuration object. Look up the type for the description.
* @return An instance of WebSocketOrderbookChannel
*/
constructor(url: string, config?: WebSocketOrderbookChannelConfig) {
assert.isUri('url', url);
if (!_.isUndefined(config)) {
assert.doesConformToSchema('config', config, clientSchemas.webSocketOrderbookChannelConfigSchema);
}
this._apiEndpointUrl = url;
this._heartbeatIntervalMs =
_.isUndefined(config) || _.isUndefined(config.heartbeatIntervalMs)
? DEFAULT_HEARTBEAT_INTERVAL_MS
: config.heartbeatIntervalMs;
this._client = new WebSocket.client();
}
/**
* Subscribe to orderbook snapshots and updates from the websocket
* @param subscriptionOpts An OrderbookChannelSubscriptionOpts instance describing which
* token pair to subscribe to
* @param handler An OrderbookChannelHandler instance that responds to various
* channel updates
*/
public subscribe(subscriptionOpts: OrderbookChannelSubscriptionOpts, handler: OrderbookChannelHandler): void {
assert.doesConformToSchema(
'subscriptionOpts',
subscriptionOpts,
schemas.relayerApiOrderbookChannelSubscribePayload,
);
assert.isFunction('handler.onSnapshot', _.get(handler, 'onSnapshot'));
assert.isFunction('handler.onUpdate', _.get(handler, 'onUpdate'));
assert.isFunction('handler.onError', _.get(handler, 'onError'));
assert.isFunction('handler.onClose', _.get(handler, 'onClose'));
this._subscriptionCounter += 1;
const subscribeMessage = {
type: 'subscribe',
channel: 'orderbook',
requestId: this._subscriptionCounter,
payload: subscriptionOpts,
};
this._getConnection((error, connection) => {
if (!_.isUndefined(error)) {
handler.onError(this, subscriptionOpts, error);
} else if (!_.isUndefined(connection) && connection.connected) {
connection.on(WebsocketConnectionEventType.Error, wsError => {
handler.onError(this, subscriptionOpts, wsError);
});
connection.on(WebsocketConnectionEventType.Close, (_code: number, _desc: string) => {
handler.onClose(this, subscriptionOpts);
});
connection.on(WebsocketConnectionEventType.Message, message => {
this._handleWebSocketMessage(subscribeMessage.requestId, subscriptionOpts, message, handler);
});
connection.sendUTF(JSON.stringify(subscribeMessage));
}
});
}
/**
* Close the websocket and stop receiving updates
*/
public close(): void {
if (!_.isUndefined(this._connectionIfExists)) {
this._connectionIfExists.close();
}
if (!_.isUndefined(this._heartbeatTimerIfExists)) {
clearInterval(this._heartbeatTimerIfExists);
}
}
private _getConnection(callback: (error?: Error, connection?: WebSocket.connection) => void): void {
if (!_.isUndefined(this._connectionIfExists) && this._connectionIfExists.connected) {
callback(undefined, this._connectionIfExists);
} else {
this._client.on(WebsocketClientEventType.Connect, connection => {
this._connectionIfExists = connection;
if (this._heartbeatIntervalMs >= MINIMUM_HEARTBEAT_INTERVAL_MS) {
this._heartbeatTimerIfExists = setInterval(() => {
connection.ping('');
}, this._heartbeatIntervalMs);
} else {
callback(
new Error(
`Heartbeat interval is ${
this._heartbeatIntervalMs
}ms which is less than the required minimum of ${MINIMUM_HEARTBEAT_INTERVAL_MS}ms`,
),
undefined,
);
}
callback(undefined, this._connectionIfExists);
});
this._client.on(WebsocketClientEventType.ConnectFailed, error => {
callback(error, undefined);
});
this._client.connect(this._apiEndpointUrl);
}
}
private _handleWebSocketMessage(
requestId: number,
subscriptionOpts: OrderbookChannelSubscriptionOpts,
message: WebSocket.IMessage,
handler: OrderbookChannelHandler,
): void {
if (!_.isUndefined(message.utf8Data)) {
try {
const utf8Data = message.utf8Data;
const parserResult = orderbookChannelMessageParser.parse(utf8Data);
if (parserResult.requestId === requestId) {
switch (parserResult.type) {
case OrderbookChannelMessageTypes.Snapshot: {
handler.onSnapshot(this, subscriptionOpts, parserResult.payload);
break;
}
case OrderbookChannelMessageTypes.Update: {
handler.onUpdate(this, subscriptionOpts, parserResult.payload);
break;
}
default: {
handler.onError(
this,
subscriptionOpts,
new Error(`Message has missing a type parameter: ${utf8Data}`),
);
}
}
}
} catch (error) {
handler.onError(this, subscriptionOpts, error);
}
} else {
handler.onError(this, subscriptionOpts, new Error(`Message does not contain utf8Data`));
}
}
}

View File

@@ -0,0 +1,101 @@
import * as _ from 'lodash';
import { v4 as uuid } from 'uuid';
import * as WebSocket from 'websocket';
import { OrdersChannel, OrdersChannelHandler, OrdersChannelMessageTypes, OrdersChannelSubscriptionOpts } from './types';
import { assert } from './utils/assert';
import { ordersChannelMessageParser } from './utils/orders_channel_message_parser';
export interface OrdersChannelSubscriptionOptsMap {
[key: string]: OrdersChannelSubscriptionOpts;
}
/**
* This class includes all the functionality related to interacting with a websocket endpoint
* that implements the standard relayer API v0
*/
export class WebSocketOrdersChannel implements OrdersChannel {
private readonly _client: WebSocket.w3cwebsocket;
private readonly _handler: OrdersChannelHandler;
private readonly _subscriptionOptsMap: OrdersChannelSubscriptionOptsMap = {};
/**
* Instantiates a new WebSocketOrdersChannel instance
* @param client A WebSocket client
* @param handler An OrdersChannelHandler instance that responds to various
* channel updates
* @return An instance of WebSocketOrdersChannel
*/
constructor(client: WebSocket.w3cwebsocket, handler: OrdersChannelHandler) {
assert.isOrdersChannelHandler('handler', handler);
// set private members
this._client = client;
this._handler = handler;
// attach client callbacks
this._client.onerror = err => {
this._handler.onError(this, err);
};
this._client.onclose = () => {
this._handler.onClose(this);
};
this._client.onmessage = message => {
this._handleWebSocketMessage(message);
};
}
/**
* Subscribe to orderbook snapshots and updates from the websocket
* @param subscriptionOpts An OrdersChannelSubscriptionOpts instance describing which
* assetData pair to subscribe to
*/
public subscribe(subscriptionOpts: OrdersChannelSubscriptionOpts): void {
assert.isOrdersChannelSubscriptionOpts('subscriptionOpts', subscriptionOpts);
assert.assert(this._client.readyState === WebSocket.w3cwebsocket.OPEN, 'WebSocket connection is closed');
const requestId = uuid();
this._subscriptionOptsMap[requestId] = subscriptionOpts;
const subscribeMessage = {
type: 'subscribe',
channel: 'orders',
requestId,
payload: subscriptionOpts,
};
this._client.send(JSON.stringify(subscribeMessage));
}
/**
* Close the websocket and stop receiving updates
*/
public close(): void {
this._client.close();
}
private _handleWebSocketMessage(message: any): void {
if (_.isUndefined(message.data)) {
this._handler.onError(this, new Error(`Message does not contain data. Url: ${this._client.url}`));
return;
}
try {
const data = message.data;
const parserResult = ordersChannelMessageParser.parse(data);
const subscriptionOpts = this._subscriptionOptsMap[parserResult.requestId];
if (_.isUndefined(subscriptionOpts)) {
this._handler.onError(
this,
new Error(`Message has unknown requestId. Url: ${this._client.url} Message: ${data}`),
);
return;
}
switch (parserResult.type) {
case OrdersChannelMessageTypes.Update: {
this._handler.onUpdate(this, subscriptionOpts, parserResult.payload);
break;
}
default: {
this._handler.onError(
this,
new Error(`Message has unknown type parameter. Url: ${this._client.url} Message: ${data}`),
subscriptionOpts,
);
}
}
} catch (error) {
this._handler.onError(this, error);
}
}
}

View File

@@ -0,0 +1,21 @@
{
"total": 43,
"page": 1,
"perPage": 100,
"records": [
{
"assetDataA": {
"minAmount": "0",
"maxAmount": "10000000000000000000",
"precision": 5,
"assetData": "0xf47261b04c32345ced77393b3530b1eed0f346429d"
},
"assetDataB": {
"minAmount": "0",
"maxAmount": "50000000000000000000",
"precision": 5,
"assetData": "0x0257179264389b814a946f3e92105513705ca6b990"
}
}
]
}

View File

@@ -0,0 +1,25 @@
import { BigNumber } from '@0xproject/utils';
import { AssetPairsResponse } from '../../../src/types';
export const assetDataPairsResponse: AssetPairsResponse = {
total: 43,
page: 1,
perPage: 100,
records: [
{
assetDataA: {
minAmount: new BigNumber('0'),
maxAmount: new BigNumber('10000000000000000000'),
precision: 5,
assetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
},
assetDataB: {
minAmount: new BigNumber('0'),
maxAmount: new BigNumber('50000000000000000000'),
precision: 5,
assetData: '0x0257179264389b814a946f3e92105513705ca6b990',
},
},
],
};

View File

@@ -0,0 +1,10 @@
{
"total": 3,
"page": 1,
"perPage": 10,
"records": [
"0x6ec92694ea172ebc430c30fa31de87620967a082",
"0x9e56625509c2f60af937f23b7b532600390e8c8b",
"0xa2b31dacf30a9c50ca473337c01d8a201ae33e32"
]
}

View File

@@ -0,0 +1,12 @@
import { FeeRecipientsResponse } from '../../../src/types';
export const feeRecipientsResponse: FeeRecipientsResponse = {
total: 3,
page: 1,
perPage: 10,
records: [
'0x6ec92694ea172ebc430c30fa31de87620967a082',
'0x9e56625509c2f60af937f23b7b532600390e8c8b',
'0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
],
};

View File

@@ -1,5 +0,0 @@
{
"feeRecipient": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
"makerFee": "10000000000000000",
"takerFee": "30000000000000000"
}

View File

@@ -1,9 +0,0 @@
import { BigNumber } from '@0xproject/utils';
import { FeesResponse } from '../../../src/types';
export const feesResponse: FeesResponse = {
feeRecipient: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
makerFee: new BigNumber('10000000000000000'),
takerFee: new BigNumber('30000000000000000'),
};

View File

@@ -1,19 +1,19 @@
{
"maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"makerTokenAmount": "10000000000000000",
"takerTokenAmount": "20000000000000000",
"makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
"takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
"salt": "256",
"feeRecipient": "0xb046140686d052fff581f63f8136cce132e857da",
"exchangeContractAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"expirationUnixTimestampSec": "42",
"ecSignature": {
"v": 27,
"r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
"s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
}
"order": {
"makerAddress": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"takerAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"feeRecipientAddress": "0xb046140686d052fff581f63f8136cce132e857da",
"senderAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerAssetAmount": "10000000000000000",
"takerAssetAmount": "20000000000000000",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"expirationTimeSeconds": "1532560590",
"salt": "1532559225",
"makerAssetData": "0xf47261b04c32345ced77393b3530b1eed0f346429d",
"takerAssetData": "0x0257179264389b814a946f3e92105513705ca6b990",
"exchangeAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"signature": "0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33"
},
"metaData": {}
}

View File

@@ -1,21 +1,21 @@
import { BigNumber } from '@0xproject/utils';
export const orderResponse = {
maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
makerTokenAmount: new BigNumber('10000000000000000'),
takerTokenAmount: new BigNumber('20000000000000000'),
makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
salt: new BigNumber('256'),
feeRecipient: '0xb046140686d052fff581f63f8136cce132e857da',
exchangeContractAddress: '0x12459c951127e0c374ff9105dda097662a027093',
expirationUnixTimestampSec: new BigNumber('42'),
ecSignature: {
v: 27,
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
order: {
makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerAssetAmount: new BigNumber('10000000000000000'),
takerAssetAmount: new BigNumber('20000000000000000'),
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
expirationTimeSeconds: new BigNumber('1532560590'),
salt: new BigNumber('1532559225'),
makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
},
metaData: {},
};

View File

@@ -0,0 +1,6 @@
{
"senderAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"feeRecipientAddress": "0xb046140686d052fff581f63f8136cce132e857da",
"makerFee": "100000000000000",
"takerFee": "200000000000000"
}

View File

@@ -0,0 +1,10 @@
import { BigNumber } from '@0xproject/utils';
import { OrderConfigResponse } from '../../../src/types';
export const orderConfigResponse: OrderConfigResponse = {
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
};

View File

@@ -1,44 +1,54 @@
{
"bids": [
{
"maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"makerTokenAmount": "10000000000000000",
"takerTokenAmount": "20000000000000000",
"makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
"takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
"salt": "256",
"feeRecipient": "0xb046140686d052fff581f63f8136cce132e857da",
"exchangeContractAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"expirationUnixTimestampSec": "42",
"ecSignature": {
"v": 27,
"r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
"s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
"bids": {
"total": 325,
"page": 2,
"perPage": 100,
"records": [
{
"order": {
"makerAddress": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"takerAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"feeRecipientAddress": "0xb046140686d052fff581f63f8136cce132e857da",
"senderAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerAssetAmount": "10000000000000000",
"takerAssetAmount": "20000000000000000",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"expirationTimeSeconds": "1532560590",
"salt": "1532559225",
"makerAssetData": "0xf47261b04c32345ced77393b3530b1eed0f346429d",
"takerAssetData": "0x0257179264389b814a946f3e92105513705ca6b990",
"exchangeAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"signature": "0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33"
},
"metaData": {}
}
}
],
"asks": [
{
"maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"makerTokenAmount": "10000000000000000",
"takerTokenAmount": "20000000000000000",
"makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
"takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
"salt": "256",
"feeRecipient": "0xb046140686d052fff581f63f8136cce132e857da",
"exchangeContractAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"expirationUnixTimestampSec": "42",
"ecSignature": {
"v": 27,
"r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
"s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
]
},
"asks": {
"total": 500,
"page": 2,
"perPage": 100,
"records": [
{
"order": {
"makerAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"takerAddress": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"feeRecipientAddress": "0xb046140686d052fff581f63f8136cce132e857da",
"senderAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerAssetAmount": "20000000000000000",
"takerAssetAmount": "10000000000000000",
"makerFee": "200000000000000",
"takerFee": "100000000000000",
"expirationTimeSeconds": "1532560590",
"salt": "1532559225",
"makerAssetData": "0x0257179264389b814a946f3e92105513705ca6b990",
"takerAssetData": "0xf47261b04c32345ced77393b3530b1eed0f346429d",
"exchangeAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"signature": "0x013842a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b3518891"
},
"metaData": {}
}
}
]
]
}
}

View File

@@ -1,46 +1,58 @@
import { BigNumber } from '@0xproject/utils';
export const orderbookResponse = {
bids: [
{
maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
makerTokenAmount: new BigNumber('10000000000000000'),
takerTokenAmount: new BigNumber('20000000000000000'),
makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
salt: new BigNumber('256'),
feeRecipient: '0xb046140686d052fff581f63f8136cce132e857da',
exchangeContractAddress: '0x12459c951127e0c374ff9105dda097662a027093',
expirationUnixTimestampSec: new BigNumber('42'),
ecSignature: {
v: 27,
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
import { OrderbookResponse } from '../../../src/types';
export const orderbookResponse: OrderbookResponse = {
bids: {
total: 325,
page: 2,
perPage: 100,
records: [
{
order: {
makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerAssetAmount: new BigNumber('10000000000000000'),
takerAssetAmount: new BigNumber('20000000000000000'),
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
expirationTimeSeconds: new BigNumber('1532560590'),
salt: new BigNumber('1532559225'),
makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
},
metaData: {},
},
},
],
asks: [
{
maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
makerTokenAmount: new BigNumber('10000000000000000'),
takerTokenAmount: new BigNumber('20000000000000000'),
makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
salt: new BigNumber('256'),
feeRecipient: '0xb046140686d052fff581f63f8136cce132e857da',
exchangeContractAddress: '0x12459c951127e0c374ff9105dda097662a027093',
expirationUnixTimestampSec: new BigNumber('42'),
ecSignature: {
v: 27,
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
],
},
asks: {
total: 500,
page: 2,
perPage: 100,
records: [
{
order: {
makerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
takerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerAssetAmount: new BigNumber('20000000000000000'),
takerAssetAmount: new BigNumber('10000000000000000'),
makerFee: new BigNumber('200000000000000'),
takerFee: new BigNumber('100000000000000'),
expirationTimeSeconds: new BigNumber('1532560590'),
salt: new BigNumber('1532559225'),
makerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
takerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
signature: '0x013842a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b3518891',
},
metaData: {},
},
},
],
],
},
};

View File

@@ -1,21 +1,26 @@
[
{
"maker": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"taker": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"makerTokenAmount": "10000000000000000",
"takerTokenAmount": "20000000000000000",
"makerTokenAddress": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
"takerTokenAddress": "0xef7fff64389b814a946f3e92105513705ca6b990",
"salt": "256",
"feeRecipient": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"exchangeContractAddress": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"expirationUnixTimestampSec": "42",
"ecSignature": {
"v": 27,
"r": "0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33",
"s": "0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254"
{
"total": 984,
"page": 1,
"perPage": 100,
"records": [
{
"order": {
"makerAddress": "0x9e56625509c2f60af937f23b7b532600390e8c8b",
"takerAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"feeRecipientAddress": "0xb046140686d052fff581f63f8136cce132e857da",
"senderAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
"makerAssetAmount": "10000000000000000",
"takerAssetAmount": "20000000000000000",
"makerFee": "100000000000000",
"takerFee": "200000000000000",
"expirationTimeSeconds": "1532560590",
"salt": "1532559225",
"makerAssetData": "0xf47261b04c32345ced77393b3530b1eed0f346429d",
"takerAssetData": "0x0257179264389b814a946f3e92105513705ca6b990",
"exchangeAddress": "0x12459c951127e0c374ff9105dda097662a027093",
"signature": "0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33"
},
"metaData": {}
}
}
]
]
}

View File

@@ -1,23 +1,30 @@
import { BigNumber } from '@0xproject/utils';
export const ordersResponse = [
{
maker: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
taker: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
makerTokenAmount: new BigNumber('10000000000000000'),
takerTokenAmount: new BigNumber('20000000000000000'),
makerTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
takerTokenAddress: '0xef7fff64389b814a946f3e92105513705ca6b990',
salt: new BigNumber('256'),
feeRecipient: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
exchangeContractAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
expirationUnixTimestampSec: new BigNumber('42'),
ecSignature: {
v: 27,
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
import { OrdersResponse } from '../../../src/types';
export const ordersResponse: OrdersResponse = {
total: 984,
page: 1,
perPage: 100,
records: [
{
order: {
makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerAssetAmount: new BigNumber('10000000000000000'),
takerAssetAmount: new BigNumber('20000000000000000'),
makerFee: new BigNumber('100000000000000'),
takerFee: new BigNumber('200000000000000'),
expirationTimeSeconds: new BigNumber('1532560590'),
salt: new BigNumber('1532559225'),
makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
},
metaData: {},
},
},
];
],
};

View File

@@ -1,17 +0,0 @@
import * as orderbookJSON from './orderbook.json';
const orderbookJsonString = JSON.stringify(orderbookJSON);
export const snapshotOrderbookChannelMessage = `{
"type": "snapshot",
"channel": "orderbook",
"requestId": 1,
"payload": ${orderbookJsonString}
}`;
export const malformedSnapshotOrderbookChannelMessage = `{
"type": "snapshot",
"channel": "orderbook",
"requestId": 1,
"payload": {}
}`;

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