Leonid Logvinov
c60d7e2db8
Fix getting events from non-mempool
2017-11-09 17:44:45 -05:00
Fabio Berger
50d3a14825
Remove finished TODOs
2017-11-09 17:39:03 -05:00
Fabio Berger
0ff3ba5250
Merge branch 'orderWatcher' of github.com:0xProject/0x.js into orderWatcher
...
* 'orderWatcher' of github.com:0xProject/0x.js:
Revert test amount changes
2017-11-09 17:20:49 -05:00
Fabio Berger
02cc3f9116
Create assert.isValidSignature method and use it in addOrder
2017-11-09 17:18:30 -05:00
Fabio Berger
62861d1e13
Move isValidSignature implementation into signatureUtils
2017-11-09 17:18:03 -05:00
Leonid Logvinov
cd3c7f1b97
Revert test amount changes
2017-11-09 17:14:10 -05:00
Fabio Berger
0c8886ad0c
Fix comment
2017-11-09 17:03:54 -05:00
Fabio Berger
9d24325207
Merge branch 'orderWatcher' of github.com:0xProject/0x.js into orderWatcher
...
* 'orderWatcher' of github.com:0xProject/0x.js:
Revert "Use _.get for optional configs"
# Conflicts:
# src/0x.ts
2017-11-09 17:01:30 -05:00
Fabio Berger
126a165f55
Add nested config for orderWatcher
2017-11-09 16:59:41 -05:00
Leonid Logvinov
1c6e6842c6
Revert "Use _.get for optional configs"
...
This reverts commit ecc54b07c7 .
2017-11-09 16:48:45 -05:00
Fabio Berger
6f5a55b5fe
Rename MempoolEventCallback to EventWatcherCallback
2017-11-09 16:43:19 -05:00
Fabio Berger
530f5a700e
Merge branch 'orderWatcher' of github.com:0xProject/0x.js into orderWatcher
...
* 'orderWatcher' of github.com:0xProject/0x.js:
Fix namings
2017-11-09 16:42:06 -05:00
Fabio Berger
441c1f9ab7
rename folder to order_watcher
2017-11-09 16:41:57 -05:00
Leonid Logvinov
d98d885924
Fix namings
2017-11-09 16:37:00 -05:00
Leonid Logvinov
6aa91d89e0
Remove redundant assertions
2017-11-09 16:30:40 -05:00
Fabio Berger
ecc54b07c7
Use _.get for optional configs
2017-11-09 16:30:14 -05:00
Fabio Berger
ce11a38d70
Improve comment
2017-11-09 16:23:39 -05:00
Leonid Logvinov
c9e0b29878
Add SubscriptionAlreadyPresent error
2017-11-09 16:20:31 -05:00
Leonid Logvinov
3a96fec03b
Pass numConfirmations
2017-11-09 15:38:23 -05:00
Leonid Logvinov
7a231b3166
Removed unused order adding in tests
2017-11-09 15:30:41 -05:00
Leonid Logvinov
31f6934787
Add a test that a second subscription fails
2017-11-09 15:30:22 -05:00
Fabio Berger
c5dc89886d
fix merge conflicts
2017-11-09 15:13:56 -05:00
Fabio Berger
545cc0b026
Add comments to public methods
2017-11-09 15:02:44 -05:00
Fabio Berger
9ff42053c3
Add numConfirmations arg so that caller can decide on numConfirmations at which they want to watch orders
2017-11-09 15:02:28 -05:00
Leonid Logvinov
41a0ce146d
Add tests for order removals
2017-11-09 14:54:55 -05:00
Leonid Logvinov
709fa06af6
Pass orderHash instead of an order to removeOrder and adjust the tests
2017-11-09 14:23:53 -05:00
Fabio Berger
5623400557
Merge branch 'orderWatcher' of github.com:0xProject/0x.js into orderWatcher
...
* 'orderWatcher' of github.com:0xProject/0x.js: (32 commits)
Remove check for now, we need a more robust check
Rename test file and add test for a partial fill
Fix tests by making the expected balance be 2^27 not 2^26
Add assert.isValidBaseUnitAmount that checks for decimals in amounts that should be in baseUnits. This can sometimes alert developers whenever they accidentally pass in unitAmounts.
Look for relevant events in the decodedLogs and emit orderState events for orders impacted by the blockchain state changes
Remove unused import
Fix typo
Add todo comments
fix styling
remove unused type
Add naive order state watcher implementation
Change fields in OrderState to represent taker side values
Introduce OrderState interface
Fix config schema
Add empty implementation of order state watcher
Add new public types
Move mempoolPollingIntervalMs to OrderWatcherConfig
Adjust tests for mempool event watcher
Clear event cache on unsubscribe
Remove mempool event watcher config
...
2017-11-09 14:12:17 -05:00
Fabio Berger
1351e02065
Remove check for now, we need a more robust check
2017-11-09 14:11:46 -05:00
Fabio Berger
4f030ac45c
Rename test file and add test for a partial fill
2017-11-09 14:11:46 -05:00
Fabio Berger
c7c81a1f7e
Fix tests by making the expected balance be 2^27 not 2^26
2017-11-09 14:11:46 -05:00
Fabio Berger
ae74965774
Add assert.isValidBaseUnitAmount that checks for decimals in amounts that should be in baseUnits. This can sometimes alert developers whenever they accidentally pass in unitAmounts.
2017-11-09 14:11:46 -05:00
Fabio Berger
e952c98ca8
Look for relevant events in the decodedLogs and emit orderState events for orders impacted by the blockchain state changes
2017-11-09 14:11:46 -05:00
Fabio Berger
6f00c422c7
Remove unused import
2017-11-09 14:11:46 -05:00
Fabio Berger
e592cedbb4
Fix typo
2017-11-09 14:11:46 -05:00
Fabio Berger
a10bb4b2fa
Add todo comments
2017-11-09 14:11:46 -05:00
Fabio Berger
c89eec4261
fix styling
2017-11-09 14:11:46 -05:00
Fabio Berger
edc0fec808
remove unused type
2017-11-09 14:11:46 -05:00
Leonid Logvinov
bb5474660c
Add naive order state watcher implementation
...
Revalidate all orders upon event received and emit order states even if
not changed
2017-11-09 14:11:46 -05:00
Leonid Logvinov
63f16b5f99
Change fields in OrderState to represent taker side values
2017-11-09 14:11:46 -05:00
Leonid Logvinov
0b84c469d3
Introduce OrderState interface
2017-11-09 14:11:45 -05:00
Leonid Logvinov
ff5d18d327
Fix config schema
2017-11-09 14:11:45 -05:00
Leonid Logvinov
1980b3fae4
Add empty implementation of order state watcher
2017-11-09 14:11:45 -05:00
Leonid Logvinov
6714b8958b
Add new public types
2017-11-09 14:11:45 -05:00
Leonid Logvinov
f601a5d356
Move mempoolPollingIntervalMs to OrderWatcherConfig
2017-11-09 14:11:45 -05:00
Leonid Logvinov
e7f60032bc
Adjust tests for mempool event watcher
2017-11-09 14:11:45 -05:00
Leonid Logvinov
589bd8694f
Clear event cache on unsubscribe
2017-11-09 14:11:45 -05:00
Leonid Logvinov
eace1a9840
Remove mempool event watcher config
2017-11-09 14:11:45 -05:00
Leonid Logvinov
3ddb203317
Move provider altering logic to Web3Wrapper
2017-11-09 14:11:45 -05:00
Leonid Logvinov
84b8e77aaa
Add types for order state watcher
2017-11-09 14:11:45 -05:00
Leonid Logvinov
247eefc33a
Add initial interface of an OrderWatcher
2017-11-09 14:11:45 -05:00