Compare commits
1462 Commits
@0xproject
...
@0xproject
Author | SHA1 | Date | |
---|---|---|---|
|
174b360593 | ||
|
481a752e70 | ||
|
38acdfd632 | ||
|
561e525778 | ||
|
69eb820d0d | ||
|
447f16fc4f | ||
|
1769609245 | ||
|
e1dcdac1bb | ||
|
9d45d19c80 | ||
|
9858bb0ce4 | ||
|
a3527a77a6 | ||
|
33a45fa739 | ||
|
e70882a657 | ||
|
e456332da7 | ||
|
4ed84c5dc5 | ||
|
2fe3f40be9 | ||
|
44bfdb718f | ||
|
3524efc41c | ||
|
01210c291c | ||
|
192d4b4dbf | ||
|
68246fc335 | ||
|
7ef86636aa | ||
|
a5859c6cee | ||
|
3463903d02 | ||
|
4b0f1a8431 | ||
|
603e8aa671 | ||
|
6eb980abe2 | ||
|
46b168e10f | ||
|
508e6ccf89 | ||
|
a173c5fc38 | ||
|
f5237f7971 | ||
|
6f7a5d00e6 | ||
|
4061723863 | ||
|
ab1b52ba87 | ||
|
16e94ecb40 | ||
|
6bb2c5877c | ||
|
a14450f367 | ||
|
85df313a7a | ||
|
66ed6b9b88 | ||
|
9304d09da6 | ||
|
e61dbbb6cf | ||
|
1690f59857 | ||
|
c916dd6ebb | ||
|
8a683b8541 | ||
|
4883b8be10 | ||
|
51760f9bdd | ||
|
6a619a4084 | ||
|
feeafa193a | ||
|
8d8528996a | ||
|
965d609829 | ||
|
a52714bcf3 | ||
|
bbfd7647a8 | ||
|
0aba5a3be4 | ||
|
61bf5864a8 | ||
|
56847a53f4 | ||
|
8324ab3af7 | ||
|
d496a7585c | ||
|
8d7f2a993a | ||
|
ed786f3e8f | ||
|
539c243733 | ||
|
40e0c829b3 | ||
|
e34b1f2f8b | ||
|
f6b6619c08 | ||
|
e480e08aa4 | ||
|
652cf7a976 | ||
|
7a8ab6fbe8 | ||
|
9deec8ec35 | ||
|
3f1586045c | ||
|
ada5563b1f | ||
|
6b41a570a5 | ||
|
cebf6bfb34 | ||
|
47a1b48ad8 | ||
|
ef82a9d2a6 | ||
|
ba6351841d | ||
|
cdc786a1e3 | ||
|
3ea137a78f | ||
|
b525ccc825 | ||
|
77acbdd3ea | ||
|
c13190ceab | ||
|
78d4fc59a5 | ||
|
f9e86c057d | ||
|
1d8e133a30 | ||
|
99fbf384fd | ||
|
cb4fcf4de7 | ||
|
675964dc5c | ||
|
6432f85eb0 | ||
|
66eef758c6 | ||
|
c64f0ba34b | ||
|
6deffb6b28 | ||
|
5802713801 | ||
|
11df29fa8e | ||
|
f4a41e80b8 | ||
|
5c655b55d3 | ||
|
63c15b6f4f | ||
|
4f2bc29744 | ||
|
2cac431c41 | ||
|
80b7a7842c | ||
|
8c7cec9822 | ||
|
971a4087d2 | ||
|
660e670d38 | ||
|
052824f4e3 | ||
|
1d5ef4d0ca | ||
|
a6440b94f4 | ||
|
01685b7622 | ||
|
397fefa8d7 | ||
|
82a01ef020 | ||
|
a224ce347e | ||
|
81ba2a8411 | ||
|
a6e8b28da5 | ||
|
e90dbf66f3 | ||
|
0be2219beb | ||
|
09b4d5e0e4 | ||
|
60f1bcf51f | ||
|
431ac3b401 | ||
|
50781bd77a | ||
|
c3361bb86e | ||
|
fd5ad69c26 | ||
|
b1f97a27f3 | ||
|
febddcb356 | ||
|
74d5af34eb | ||
|
365890291f | ||
|
0368de701f | ||
|
f5e7b7e7e0 | ||
|
038c21324e | ||
|
5d008ee83e | ||
|
d0f6933980 | ||
|
14793f30b5 | ||
|
86319291e3 | ||
|
afa2dd7374 | ||
|
1312e4caf2 | ||
|
eb4517d737 | ||
|
d80701c277 | ||
|
bf3ab1127d | ||
|
dcb12b6ad6 | ||
|
f87420a776 | ||
|
6cedf5362b | ||
|
aa833ef074 | ||
|
5f1c9cfee5 | ||
|
62b93cf2eb | ||
|
b1c5f6e8f1 | ||
|
3bc9b309f6 | ||
|
6924a2b681 | ||
|
d93d4c34f5 | ||
|
557267477e | ||
|
b9f7979e91 | ||
|
8c803ab232 | ||
|
422e5e4dd7 | ||
|
2aea820d89 | ||
|
1c3b2b7141 | ||
|
e7d5ceb9c5 | ||
|
68af0e9eb7 | ||
|
a18d0f6229 | ||
|
031807df9c | ||
|
72710be04b | ||
|
ac135d55d3 | ||
|
1d55e94659 | ||
|
86284f1c7e | ||
|
61a4ae7fc4 | ||
|
55fab3d98f | ||
|
de11b62e30 | ||
|
8e14e65b60 | ||
|
2d1d14d2e4 | ||
|
f44644ad90 | ||
|
ac1640140c | ||
|
1402a0aa22 | ||
|
f225f9e7c8 | ||
|
14fdb71a71 | ||
|
9c4c4fb19a | ||
|
5785ec0713 | ||
|
2eab0e30b7 | ||
|
2c846ff145 | ||
|
ca0dfc6610 | ||
|
0fd44ee2c1 | ||
|
7271fc0bab | ||
|
6c039bbeb1 | ||
|
38e6d26145 | ||
|
b0f210dea9 | ||
|
f7469080f9 | ||
|
fb5ea5d99f | ||
|
be2f4cbdca | ||
|
68f2dc11b4 | ||
|
d6c670dfcb | ||
|
0736c41357 | ||
|
898bd75a18 | ||
|
260313a6ae | ||
|
6a99bfa68e | ||
|
f60adbdd72 | ||
|
1be310cef4 | ||
|
ff4f86f1d6 | ||
|
f4a4fefe42 | ||
|
00a4fa5f7c | ||
|
4475fefd07 | ||
|
cd08a9c121 | ||
|
b0c4eb8333 | ||
|
368dbda8f0 | ||
|
bc4149683e | ||
|
6174d9ebb7 | ||
|
e4fc8a8414 | ||
|
907972c466 | ||
|
49f5fe635f | ||
|
77290c1efa | ||
|
4ac43a9fd2 | ||
|
cc77d1dd49 | ||
|
51161784e8 | ||
|
cb7660fbe7 | ||
|
82e51b8787 | ||
|
fffa96bba7 | ||
|
e6cb2e0fcd | ||
|
38abeaed9c | ||
|
90c9e3496a | ||
|
9fc8a6e214 | ||
|
9df87a199a | ||
|
7e9ba50502 | ||
|
41559c39b9 | ||
|
6a6b424c86 | ||
|
3a5c6ed00f | ||
|
db54588d05 | ||
|
52fde551e4 | ||
|
40cf805e5e | ||
|
09d6496135 | ||
|
c4dadf4bfd | ||
|
35ba3e6f7c | ||
|
3ac182ee91 | ||
|
00e7c70b4d | ||
|
0aa9ed3839 | ||
|
d652deea23 | ||
|
878db3b849 | ||
|
ec2e726be0 | ||
|
287830d6e0 | ||
|
c7a7ae7e18 | ||
|
1c7ba6a315 | ||
|
0a6f107243 | ||
|
a93f95c55e | ||
|
6833e243b7 | ||
|
81dc893d1d | ||
|
f8e565bc06 | ||
|
ba15fb6a06 | ||
|
1e6b83719a | ||
|
9fcb2dda73 | ||
|
9a5ec8d030 | ||
|
ac872e5181 | ||
|
70863cca08 | ||
|
5a1dce15be | ||
|
d291256158 | ||
|
8c706ac639 | ||
|
f697814849 | ||
|
ca5c9e77c0 | ||
|
a32b201afe | ||
|
0ecdf1e213 | ||
|
057891b342 | ||
|
407f63ef20 | ||
|
f938c989e3 | ||
|
c8500cab10 | ||
|
c28c3db63f | ||
|
a09ee90739 | ||
|
7d5a23969d | ||
|
56c3c29feb | ||
|
c75212bef0 | ||
|
6d0dedc62c | ||
|
cf12daea2f | ||
|
6f88e9bdbd | ||
|
d8cb56caa3 | ||
|
044415e23d | ||
|
6b866d6053 | ||
|
74ce893f52 | ||
|
cc1fac9bbe | ||
|
94e01be9ed | ||
|
91a9014a50 | ||
|
e215992859 | ||
|
e6f5cac878 | ||
|
29971f36cf | ||
|
3e4493b389 | ||
|
749c6ecc30 | ||
|
e6e7bae445 | ||
|
a1d8943552 | ||
|
07e56b3cc7 | ||
|
b16f5f55fb | ||
|
d92fd43791 | ||
|
e706fa76ac | ||
|
11328bd93d | ||
|
bc686fcbf3 | ||
|
80291caf7c | ||
|
cd5e9a5115 | ||
|
ad161a973e | ||
|
103e1aa250 | ||
|
641d86cb98 | ||
|
813b2ca1fb | ||
|
ec96c3bb77 | ||
|
65120e84e2 | ||
|
82b51db17e | ||
|
374ee2db32 | ||
|
3557cd93fc | ||
|
0629a7d143 | ||
|
a27112cbef | ||
|
d039a1adda | ||
|
bb4d449e92 | ||
|
241534a63d | ||
|
1932aff35c | ||
|
4f27991959 | ||
|
8ce4f9c784 | ||
|
7351bf0b14 | ||
|
48ab151ec2 | ||
|
f6080367fe | ||
|
7f78d7da9d | ||
|
6734f2f1bc | ||
|
0fb7617a78 | ||
|
4219af1430 | ||
|
c109d1f545 | ||
|
50fab9feb3 | ||
|
3dad6ee55e | ||
|
5d70df771b | ||
|
ab5df342e1 | ||
|
6a9669a409 | ||
|
e68942ee78 | ||
|
4159e45aff | ||
|
92497d7df4 | ||
|
44a430802e | ||
|
070eff6f3a | ||
|
681ed822ec | ||
|
0a1ae2c311 | ||
|
c5f8b9c2d2 | ||
|
6b03cfd40d | ||
|
7f36574a57 | ||
|
b637ca105a | ||
|
9ffddb47b8 | ||
|
7bcaac4e10 | ||
|
7f585a15f5 | ||
|
b38ef579fb | ||
|
8427db36e9 | ||
|
2d1c88c20d | ||
|
029ea52979 | ||
|
a2b6255f40 | ||
|
d4592c0a60 | ||
|
fb6d511811 | ||
|
c1b4fe999c | ||
|
1354f794a1 | ||
|
8f6a96740e | ||
|
1d6699585e | ||
|
e96f36751a | ||
|
a75c298de0 | ||
|
d603d8da47 | ||
|
1040826b8b | ||
|
a551d0a6dd | ||
|
21c37ba62f | ||
|
2c660e62d3 | ||
|
6b667f8eca | ||
|
d52c1310b2 | ||
|
6338b5bd3c | ||
|
2713cca6ac | ||
|
57c104119c | ||
|
cd5c73550b | ||
|
68b060cb6a | ||
|
7ad1a18a4a | ||
|
6e27324a34 | ||
|
8eb4b6f917 | ||
|
0ca64e394b | ||
|
c4c47d9665 | ||
|
f9b222c127 | ||
|
28f077b16f | ||
|
3563fabe88 | ||
|
1ca176e992 | ||
|
52e2c60361 | ||
|
ae154f43df | ||
|
610caef73f | ||
|
29a9e1fc4e | ||
|
ae937cfcce | ||
|
6c7dca7d07 | ||
|
aa9efd79db | ||
|
f0f4f873a9 | ||
|
0577ab96b8 | ||
|
15a34dca79 | ||
|
2b38163274 | ||
|
572ad4615a | ||
|
b013cf2e14 | ||
|
3e56990db7 | ||
|
2de7a49000 | ||
|
2a63592994 | ||
|
2cef8d3a3e | ||
|
1417ee2ccb | ||
|
04e4fe251a | ||
|
61255309d2 | ||
|
27d329ff25 | ||
|
cb19623a3a | ||
|
44ca6c4b71 | ||
|
bfabdf6010 | ||
|
cbcf8e8477 | ||
|
b0b3f9e339 | ||
|
a5c7ddcff5 | ||
|
6cef847a27 | ||
|
68dfd1bb22 | ||
|
67d33ec10c | ||
|
05ba049f59 | ||
|
867ff3c5ec | ||
|
c2454d1428 | ||
|
7e0e195c88 | ||
|
e8a1950a74 | ||
|
3c973ba9f6 | ||
|
2ef867f398 | ||
|
90f2813d0e | ||
|
dd9c4b6e5d | ||
|
a6cdc38d53 | ||
|
167c4f8519 | ||
|
799db64541 | ||
|
69b436babe | ||
|
c83f2a070c | ||
|
ba9e31d3c1 | ||
|
e915d72202 | ||
|
74e7fa13d6 | ||
|
b7c119b2aa | ||
|
3c2af2067f | ||
|
7c29cadb17 | ||
|
40b202f8c0 | ||
|
392c00a698 | ||
|
fb4fbc0e13 | ||
|
730226081c | ||
|
1fdd7466b2 | ||
|
00b7620af1 | ||
|
a39d79352d | ||
|
3b5c8a847b | ||
|
4b84081795 | ||
|
27ba218ed7 | ||
|
d907b40378 | ||
|
0248add542 | ||
|
c12f0d04bb | ||
|
22de88035c | ||
|
80e52464a6 | ||
|
3760eb5baf | ||
|
c905b20ce6 | ||
|
301cb296ec | ||
|
1bbd7bf870 | ||
|
da15df2c2d | ||
|
fe43f84abd | ||
|
7fa5b474eb | ||
|
3d25758b1d | ||
|
f1ddbc9387 | ||
|
dafb282432 | ||
|
0918f95421 | ||
|
be67c25b0a | ||
|
f53157414f | ||
|
6b838c034a | ||
|
86cb89feef | ||
|
1ba26ea5e8 | ||
|
8b79868c36 | ||
|
8bb7b5b543 | ||
|
809d301d58 | ||
|
c00c477307 | ||
|
6216714be1 | ||
|
cc90c806b0 | ||
|
04bbd60c11 | ||
|
ad9bb3ea59 | ||
|
1ddac0bc7b | ||
|
a7468eb858 | ||
|
213d82a2c2 | ||
|
7553411fb2 | ||
|
c52c94214f | ||
|
151cf03f5b | ||
|
141c51eaf5 | ||
|
ab7d083aa5 | ||
|
12881e60e3 | ||
|
1f65de60b4 | ||
|
635373febb | ||
|
e7c7af8ef4 | ||
|
cd2bbd850d | ||
|
83a36bc4b6 | ||
|
1c95f685bb | ||
|
e45d320fc5 | ||
|
dd2e54d60d | ||
|
64eac5f37f | ||
|
78ed6e0339 | ||
|
79aff1c57a | ||
|
a21bfc5f2c | ||
|
da3dc7affc | ||
|
254d88ffa0 | ||
|
4ded591624 | ||
|
2af99a1fe2 | ||
|
135fbf67ad | ||
|
6405c70d07 | ||
|
1255570b95 | ||
|
a263e7dfce | ||
|
cbe0ffb3ce | ||
|
67b4ba2a57 | ||
|
ab71f54128 | ||
|
cabce8cb67 | ||
|
44cc5e45cc | ||
|
1ae11ed8ae | ||
|
075e3a41c8 | ||
|
756787c61f | ||
|
b67677f476 | ||
|
b4cf69b021 | ||
|
d149b6cdec | ||
|
f29263c477 | ||
|
61ef6edaa5 | ||
|
fae58ca695 | ||
|
1c68057999 | ||
|
fb637d9234 | ||
|
0f7ced3625 | ||
|
ea4d7f153a | ||
|
f2d1d95355 | ||
|
ddf85112d7 | ||
|
05ce002435 | ||
|
48ec78d3aa | ||
|
e35788e2c8 | ||
|
8bce73dc67 | ||
|
c13f538400 | ||
|
09d3d15db0 | ||
|
633e6c38c8 | ||
|
a4d6bc3190 | ||
|
0b9a9d92af | ||
|
a82e36c1d4 | ||
|
61ba012b1f | ||
|
aeb9ffbf5a | ||
|
6dde6d7cb7 | ||
|
1d70724bcf | ||
|
77c87cd009 | ||
|
4dd59a370d | ||
|
7a6e647386 | ||
|
f5459164d2 | ||
|
2743eee044 | ||
|
bb3c345891 | ||
|
0f3201d72a | ||
|
8131a87046 | ||
|
64a85dfb9c | ||
|
68d7eb5712 | ||
|
f7375fca98 | ||
|
e079790f7f | ||
|
2604d40751 | ||
|
89174cd63f | ||
|
8cb1d2a0af | ||
|
c1ec849554 | ||
|
def575b995 | ||
|
d0d6a6a500 | ||
|
445177bf42 | ||
|
a4c3a0d39f | ||
|
7c08f6d30a | ||
|
0337b5a401 | ||
|
4d81ab679d | ||
|
72752bcb68 | ||
|
e47e9c5b34 | ||
|
402ca27fbf | ||
|
8e3df2b5ae | ||
|
bf9ee82d9f | ||
|
ae7bce7674 | ||
|
7d09a94428 | ||
|
b7079e9616 | ||
|
85427a84df | ||
|
a59f18927d | ||
|
a607a61bde | ||
|
421a7394df | ||
|
acb3c0d0aa | ||
|
11231795cd | ||
|
6b6b368bf6 | ||
|
60f026e6fd | ||
|
36668f9409 | ||
|
480d28ea26 | ||
|
88c99396a2 | ||
|
ca5e52920d | ||
|
30dfb7511d | ||
|
1c87e5f698 | ||
|
badcb35525 | ||
|
c325d638c9 | ||
|
baab0f27b5 | ||
|
9e7657ac5d | ||
|
237bac920a | ||
|
89202b7bdf | ||
|
20ac6936ac | ||
|
976d159e52 | ||
|
e7f19e350e | ||
|
41768617a9 | ||
|
455c78dfb1 | ||
|
ec41e314b0 | ||
|
8959b0993e | ||
|
7c96fa45f8 | ||
|
ad9a7d72ce | ||
|
558286467b | ||
|
f0f94f199e | ||
|
6e74d1519b | ||
|
a8d44ccc48 | ||
|
d744468479 | ||
|
c01810f0d7 | ||
|
622509c508 | ||
|
bb992f8a49 | ||
|
c11d805469 | ||
|
3b8a343711 | ||
|
83e3bb899e | ||
|
bb4558e0be | ||
|
3eeb9ddfa6 | ||
|
cb5d8d75bf | ||
|
267078ed6c | ||
|
80e5127a46 | ||
|
19e17ba128 | ||
|
04e00e0c28 | ||
|
8bebffb147 | ||
|
5c40c466f6 | ||
|
f9f232f5d9 | ||
|
7b7b97dd7b | ||
|
b6cdc00a31 | ||
|
644fe1de8f | ||
|
ce88086e08 | ||
|
1d9408a8e0 | ||
|
c743f010e3 | ||
|
2f2582a0da | ||
|
c1cc92a46f | ||
|
9c3d10d5be | ||
|
3afe405bbe | ||
|
7eff195d61 | ||
|
e79c7632e6 | ||
|
aa27346f93 | ||
|
db6de490b2 | ||
|
014d71d5ae | ||
|
783bc873db | ||
|
478bf14289 | ||
|
d89934954d | ||
|
6baa5ef311 | ||
|
db20ad1c5d | ||
|
56eb444ea4 | ||
|
6a2634d362 | ||
|
a2192e62df | ||
|
66745c5260 | ||
|
c10c4cec1d | ||
|
f2d9dfb56b | ||
|
228387f995 | ||
|
336519a690 | ||
|
10dc3ea81c | ||
|
dd7e03c7d7 | ||
|
fadd292ecf | ||
|
7c8a7a2420 | ||
|
99b744ba52 | ||
|
c320c8742e | ||
|
3a086cae1a | ||
|
b10cba600d | ||
|
3b0fa1aa87 | ||
|
d859399841 | ||
|
8169155a65 | ||
|
952367d532 | ||
|
67666446bf | ||
|
3d1c8dfe06 | ||
|
283175df98 | ||
|
aeb368a1d9 | ||
|
e51deb93ee | ||
|
a351757493 | ||
|
0025c6640b | ||
|
25a8554be1 | ||
|
cd76c129da | ||
|
7340338626 | ||
|
9d3c287918 | ||
|
c2b5fe3d84 | ||
|
5ef84d61fa | ||
|
58321a36dc | ||
|
ca4905c343 | ||
|
b6d793aec4 | ||
|
83fb9df63d | ||
|
083319786f | ||
|
719699eb30 | ||
|
889ec81ff3 | ||
|
2f66f26048 | ||
|
713f285f37 | ||
|
ab64ea7377 | ||
|
b86210332f | ||
|
af52598d32 | ||
|
cbe639866e | ||
|
fcd57d2743 | ||
|
c0924d8067 | ||
|
a1860b076d | ||
|
32ab4dcac7 | ||
|
938a99f435 | ||
|
f97ec000e1 | ||
|
1b5c5e7a3b | ||
|
c804e2230d | ||
|
3f610d4865 | ||
|
8404e0e73f | ||
|
b2c666bb1f | ||
|
f3761af567 | ||
|
b9d8d2d5e3 | ||
|
b60a74c8bc | ||
|
0113ecee96 | ||
|
eb20e86947 | ||
|
15e15f994a | ||
|
d44ff6a915 | ||
|
68605ca261 | ||
|
5d4dd406f2 | ||
|
9dd6ba7825 | ||
|
45e9fbe8f9 | ||
|
53713188fe | ||
|
c4c37cafa0 | ||
|
5b7774f9d0 | ||
|
ca7d8a8940 | ||
|
762bbe9bcd | ||
|
03fb73d1d2 | ||
|
d10e2652ae | ||
|
9a5d7b7635 | ||
|
1fb3da6b53 | ||
|
970bef717e | ||
|
2a85f79040 | ||
|
651a468b44 | ||
|
5e8ad0aef4 | ||
|
44d909c0c7 | ||
|
44b01f2069 | ||
|
d7d51791a6 | ||
|
9e3fe7092b | ||
|
083d42c8f7 | ||
|
6121a6d2bf | ||
|
09af23f950 | ||
|
52e094addc | ||
|
6a6739ebbe | ||
|
6a5965d73b | ||
|
19cda0eb03 | ||
|
cc67c0df51 | ||
|
76b91cbcda | ||
|
13f0d27f7c | ||
|
5ccf41c566 | ||
|
797fd38e00 | ||
|
9aacceb0e4 | ||
|
68fb1bf376 | ||
|
a6ccfaf9ca | ||
|
c9e1b7c5dc | ||
|
6e2e658162 | ||
|
149c07dfd2 | ||
|
9f42ceb5a3 | ||
|
386b5bb122 | ||
|
ca67e7d36f | ||
|
d49af66add | ||
|
853b5aa38b | ||
|
4e30bc3e16 | ||
|
95b656f360 | ||
|
b0a7db81cb | ||
|
e6c91493f2 | ||
|
3771df728c | ||
|
f6dbc23995 | ||
|
f36a43a83f | ||
|
f4c2fabbf8 | ||
|
3d6cf50364 | ||
|
0a616ad3b8 | ||
|
57a4429123 | ||
|
3b542bf356 | ||
|
be472b61e7 | ||
|
8199e87943 | ||
|
35201af4b1 | ||
|
1a89905ab9 | ||
|
b2b3c24fd2 | ||
|
bc5835229d | ||
|
6182d2c7f6 | ||
|
af90a777c6 | ||
|
fdcb42d8e1 | ||
|
4e6322beb5 | ||
|
6e122691d1 | ||
|
ea5684e054 | ||
|
50bbd793c6 | ||
|
a1a777e715 | ||
|
d234ee12de | ||
|
50e0ddcf79 | ||
|
da304de3fc | ||
|
ff3c77f7c4 | ||
|
0bc775cdb8 | ||
|
2273798df9 | ||
|
7d0bec9b2a | ||
|
8382161f75 | ||
|
bc5f8e52de | ||
|
09c0fc94fc | ||
|
e5d65b585a | ||
|
d9933237a0 | ||
|
a016747c36 | ||
|
1c06380ef5 | ||
|
47fef1f8ff | ||
|
3cb955c136 | ||
|
47673ba4bb | ||
|
4527e9ce00 | ||
|
7759e67a5a | ||
|
3865a081a0 | ||
|
4d75689790 | ||
|
6df8746871 | ||
|
c68e183953 | ||
|
f42119c928 | ||
|
30be039570 | ||
|
d00ee5df0d | ||
|
4f381ca1d9 | ||
|
bcc1ad2086 | ||
|
343cd05363 | ||
|
d9f09b5e1e | ||
|
9337d207a1 | ||
|
c17d6c47c3 | ||
|
a728247d6c | ||
|
36d615318d | ||
|
1588f4ac39 | ||
|
0e82be1bda | ||
|
d85ce6ac75 | ||
|
0d3d9dad84 | ||
|
b8c8258404 | ||
|
3ee3fc2fb3 | ||
|
bb4d15005a | ||
|
477c3dc4f6 | ||
|
81f689e693 | ||
|
e80fa6e311 | ||
|
c94168981c | ||
|
749ec0cefe | ||
|
bd488020df | ||
|
ab398751e1 | ||
|
74d5f2f0b9 | ||
|
10f6647ab3 | ||
|
406b7c33f5 | ||
|
13520dbd94 | ||
|
d136df7679 | ||
|
8c96a31152 | ||
|
d4bd4ec441 | ||
|
e4aed98a3d | ||
|
4a2a22a43b | ||
|
47584b18e9 | ||
|
6dd656bdfc | ||
|
260640feed | ||
|
36e7cb16aa | ||
|
0390a5ecbf | ||
|
82092ab50a | ||
|
c3e6be7956 | ||
|
1ce6579c3a | ||
|
b5d98a2803 | ||
|
c7a5b8c776 | ||
|
90ead59d34 | ||
|
faa980ffc3 | ||
|
afc5c2616a | ||
|
9a3b630b19 | ||
|
b3473ff89f | ||
|
987971bd59 | ||
|
71a2f2d721 | ||
|
6e74896620 | ||
|
30c6fe08ec | ||
|
7c864b81e0 | ||
|
4f006fdc5c | ||
|
9f7f61085c | ||
|
2414b47a30 | ||
|
238eef6bae | ||
|
b92b745ab7 | ||
|
0132286cab | ||
|
f8a252d142 | ||
|
962d6e71b6 | ||
|
48aaf22855 | ||
|
8351f5998a | ||
|
2494af99aa | ||
|
e5b93d1f02 | ||
|
86eafeb826 | ||
|
32e1c2ac97 | ||
|
5e3bbbbb3c | ||
|
3bdf6004ca | ||
|
11869122b4 | ||
|
9b24459108 | ||
|
c5fbc5c991 | ||
|
0413e3e77f | ||
|
92fda0a940 | ||
|
63e088730a | ||
|
a78d35f84e | ||
|
63e869f6d0 | ||
|
4aff9515d8 | ||
|
6f0daa5463 | ||
|
a658aaaf30 | ||
|
37590d5f5e | ||
|
ca1f926d6d | ||
|
5d44a67e62 | ||
|
8ed3d59f96 | ||
|
bc93ff0cb5 | ||
|
44498f2263 | ||
|
045751a430 | ||
|
162fe797fc | ||
|
e671563f1e | ||
|
a7238d0fdb | ||
|
2a899f5295 | ||
|
b7cd84fad6 | ||
|
36b6da7c4f | ||
|
02eb575813 | ||
|
ca8a6665ba | ||
|
ba00cd916a | ||
|
b4f916d214 | ||
|
79faf7d3cb | ||
|
79b1b6c8e0 | ||
|
2ecf7a3349 | ||
|
5283dcce2e | ||
|
b56fc697c4 | ||
|
b7ff1fe5d3 | ||
|
1b24064c9f | ||
|
bb9237b0f4 | ||
|
fe2787fcc1 | ||
|
11778db05a | ||
|
454af2bda3 | ||
|
9f7479711e | ||
|
4579e1637d | ||
|
f4a2e227e1 | ||
|
48e538f5c7 | ||
|
c851c37630 | ||
|
a0d7b1efa5 | ||
|
1a06e6b305 | ||
|
43d7045a5b | ||
|
9199a56b7a | ||
|
44d1be27e6 | ||
|
554d5f97df | ||
|
78a4b9897c | ||
|
c1fcbe3f04 | ||
|
efa67d87aa | ||
|
4fe410a277 | ||
|
3235606644 | ||
|
260976914d | ||
|
3ca4b7e7a7 | ||
|
95c627f581 | ||
|
512dbb448b | ||
|
b793c1cc73 | ||
|
aea048ecc7 | ||
|
d0e6413fcf | ||
|
3b7ad1688b | ||
|
e907b99314 | ||
|
973bcb0483 | ||
|
87fb9a76ce | ||
|
0187e0c47d | ||
|
8732d8ece8 | ||
|
2e7c130f62 | ||
|
a90f434df5 | ||
|
3b005ad47c | ||
|
735bc2f178 | ||
|
e3cfa6363d | ||
|
331b1cb9a0 | ||
|
55dbb0ece0 | ||
|
af4071e119 | ||
|
9947e643d0 | ||
|
d3be4f2852 | ||
|
e320f343f8 | ||
|
f6cc7d9c3c | ||
|
b756f76b0e | ||
|
034948065d | ||
|
0c2df7e589 | ||
|
2ae6a71ca3 | ||
|
206fd0f78e | ||
|
b84225ac70 | ||
|
5ebcea53d6 | ||
|
a491e01144 | ||
|
1236efc008 | ||
|
e63bbdeb87 | ||
|
084ccb62a6 | ||
|
015469885d | ||
|
061f223269 | ||
|
88ee35d5f9 | ||
|
6c5b33ec71 | ||
|
31b8dd1bfc | ||
|
35113487f1 | ||
|
9ce8e10115 | ||
|
d07d059eda | ||
|
d836b0f815 | ||
|
1b1733ce7c | ||
|
5fd64a969b | ||
|
9a762e584c | ||
|
7fc0fd9fb6 | ||
|
da4b70fcae | ||
|
a0db69ee05 | ||
|
2c62504b79 | ||
|
67303106dc | ||
|
600d574042 | ||
|
07d4f21807 | ||
|
4da12067b9 | ||
|
24ab24879c | ||
|
dc51741b83 | ||
|
dd979dbf6d | ||
|
0cfea5613a | ||
|
98dd3ecab7 | ||
|
fe05e0bac3 | ||
|
d3f9b72c84 | ||
|
05b35c0fdc | ||
|
36b61650b3 | ||
|
c37b6f0eeb | ||
|
28114c3b5a | ||
|
2617df4ec7 | ||
|
0d28c48eb9 | ||
|
c6a6a54cce | ||
|
e5aa03da64 | ||
|
47c0195b07 | ||
|
f13d43dbf5 | ||
|
f9e99a27d3 | ||
|
854b8fad22 | ||
|
91c7105d43 | ||
|
c1e3533287 | ||
|
bb7c308081 | ||
|
fcbaf2f4e3 | ||
|
109c5df973 | ||
|
b0fab3ea4a | ||
|
490fed6228 | ||
|
9c81692d48 | ||
|
c505ba6f3e | ||
|
ee71f57453 | ||
|
f133aebfaf | ||
|
88556d31e2 | ||
|
c0d75c6476 | ||
|
5b6cf447e5 | ||
|
3890f8224d | ||
|
b9f5c93830 | ||
|
c40b3dea6c | ||
|
dbc798596b | ||
|
fac90c446c | ||
|
c5859b65a3 | ||
|
14bb697924 | ||
|
dbd815c1e0 | ||
|
9592a9a821 | ||
|
dd9f020c9b | ||
|
56f21f4bab | ||
|
91bc1b468b | ||
|
97268d2253 | ||
|
14b3c50b69 | ||
|
333bf9de05 | ||
|
16a38c687e | ||
|
24aa5cd1bf | ||
|
f699da90ba | ||
|
d1e33a3dff | ||
|
f50ac932d6 | ||
|
cab32d7593 | ||
|
2073aa9abc | ||
|
0386025395 | ||
|
0772403ea9 | ||
|
8acfc9a2f9 | ||
|
de087abc8d | ||
|
98b2875512 | ||
|
e9e73aa0a3 | ||
|
d280311734 | ||
|
789762617f | ||
|
6f38d1bee5 | ||
|
73d75bc405 | ||
|
91dcfd5ee8 | ||
|
5fe0e9f2e7 | ||
|
51fb6e6a23 | ||
|
9392d5c84f | ||
|
e49d136b99 | ||
|
d50174b89e | ||
|
1d9a77027e | ||
|
b4cd8897b2 | ||
|
df341717f7 | ||
|
68974313e1 | ||
|
39a06e1d3b | ||
|
bfe57b84d6 | ||
|
dae975b08c | ||
|
27d44e3021 | ||
|
df00d93b9c | ||
|
15bbbb3762 | ||
|
c9ee526d8b | ||
|
b110d95de1 | ||
|
76eab5d3ec | ||
|
4a2715e61f | ||
|
7fbcc3999f | ||
|
e873b8948f | ||
|
c8108a1db2 | ||
|
195c3af84e | ||
|
39724292e3 | ||
|
24b5aa0e82 | ||
|
3af2ef8439 | ||
|
e2d027e252 | ||
|
bddcebfbb1 | ||
|
a05b14e4d9 | ||
|
9a36e73f4e | ||
|
a66ccaa1da | ||
|
f05a563802 | ||
|
06396b8874 | ||
|
e5e68de2d7 | ||
|
dcc0908617 | ||
|
45d68285f1 | ||
|
e20f3a0f97 | ||
|
c5029e61e3 | ||
|
e90ed01105 | ||
|
d8099d53fe | ||
|
0a976a3fb8 | ||
|
4636d5fbc2 | ||
|
3506ec1caa | ||
|
1f0e819756 | ||
|
799ff2a5c3 | ||
|
ec5f768f9b | ||
|
66ab010055 | ||
|
6fb157488c | ||
|
814518dd80 | ||
|
554b18a466 | ||
|
855b6b1dc5 | ||
|
c2ae9f62a4 | ||
|
4159a8fe6e | ||
|
d8b44283a2 | ||
|
2c1daf9c9a | ||
|
c7962216e9 | ||
|
ffdaf88fd0 | ||
|
f84f879950 | ||
|
eb6027fba7 | ||
|
9a1f0ac8e2 | ||
|
51b6f8bc71 | ||
|
4f73b81b9c | ||
|
195d11f9d0 | ||
|
b325ad1735 | ||
|
74483631d0 | ||
|
89b24a21a0 | ||
|
f0f13aa1dd | ||
|
06f61949f9 | ||
|
0e72b67865 | ||
|
b987eebf21 | ||
|
c808d12b74 | ||
|
b466431ede | ||
|
bf69ca6e53 | ||
|
6ffa907f0e | ||
|
e54501522d | ||
|
f2baeddc30 | ||
|
fd349b618a | ||
|
6ca2a02766 | ||
|
d9a282bd92 | ||
|
dc151f7290 | ||
|
cce2127f72 | ||
|
0f8e6b395e | ||
|
b28cc6d7d3 | ||
|
3bf12a98a7 | ||
|
f27084ced4 | ||
|
cdcf624e9e | ||
|
ad4c2b95e4 | ||
|
8e7c395f59 | ||
|
02d50a513a | ||
|
d61759f6dd | ||
|
5790ed7ba9 | ||
|
067adbfb62 | ||
|
7fadba59e7 | ||
|
bcde0731db | ||
|
052afb67a4 | ||
|
6e15d7bb0f | ||
|
5bb68974ec | ||
|
0a3ba4d27d | ||
|
482a226dc5 | ||
|
9e69458ba8 | ||
|
71e386d5fa | ||
|
60b501b137 | ||
|
36f8e9f1d5 | ||
|
78707bd3ca | ||
|
56137d0605 | ||
|
681a582630 | ||
|
846a447c4d | ||
|
f76be4f016 | ||
|
ed19067096 | ||
|
eb9f7c2c9d | ||
|
52693f7d0a | ||
|
5e015872ef | ||
|
08c291bd3f | ||
|
48c5d69c9d | ||
|
0f9c262bb0 | ||
|
dff0fc65bf | ||
|
161f96c07d | ||
|
67ad21b368 | ||
|
d5e633c38f | ||
|
617ef5b6ce | ||
|
8bd4e38d02 | ||
|
f364b5c5ab | ||
|
6486fced34 | ||
|
bc9f2a51a2 | ||
|
9c03b54d75 | ||
|
eae08ea1e4 | ||
|
6f276223c6 | ||
|
21effcaa8b | ||
|
114b31a813 | ||
|
1a1b7a2bc4 | ||
|
c9b213839a | ||
|
4043fa76cc | ||
|
9c8e3bc4c9 | ||
|
18b1f01641 | ||
|
9085c674e4 | ||
|
b5d19d3fb1 | ||
|
cc0477153b | ||
|
76008b41c5 | ||
|
8193fdc304 | ||
|
9d06c81078 | ||
|
cdf85e5eee | ||
|
d774dbc432 | ||
|
0369f5ebc4 | ||
|
1e6b11b27e | ||
|
7a8231435b | ||
|
b1aa7725df | ||
|
bfe0ba3e9a | ||
|
2d39329ee7 | ||
|
761b0063a0 | ||
|
0f27ce3424 | ||
|
2b0c0a6ff7 | ||
|
5bd96f6fe9 | ||
|
37ac6749ba | ||
|
bf955bd87f | ||
|
6bd921d0bc | ||
|
534decea95 | ||
|
267830d463 | ||
|
e82d0c21ec | ||
|
ece6417699 | ||
|
74d5449719 | ||
|
4af7ff9cc3 | ||
|
46dedfcb67 | ||
|
a9fa1a0df6 | ||
|
a8572b4944 | ||
|
91c0d47ad4 | ||
|
fd2611794a | ||
|
1fe1c5321b | ||
|
f063a5db0f | ||
|
3883315447 | ||
|
7679e07957 | ||
|
c39ba37ad8 | ||
|
f1c3840c3b | ||
|
e5c5b36a73 | ||
|
c51f7a8375 | ||
|
e53e2ac31b | ||
|
b72857cd8b | ||
|
cc223b9eab | ||
|
f2c49e8b37 | ||
|
9b6476a6b7 | ||
|
d8898cf9a3 | ||
|
34df5af295 | ||
|
3de88d5345 | ||
|
9ab6ab1bf9 | ||
|
b6de0bdd43 | ||
|
a2b62fd808 | ||
|
fc166dea26 | ||
|
f9c4d0925e | ||
|
1df9370bc2 | ||
|
7d840c7a18 | ||
|
ff12aafc0f | ||
|
c08b4aa6a1 | ||
|
52a6e6357b | ||
|
74c0fd419b | ||
|
6f540e3e58 | ||
|
dead04dce8 | ||
|
886a03fdcd | ||
|
81007c453c | ||
|
6529e06057 | ||
|
55336f96d7 | ||
|
938aabde3d | ||
|
c7f196b579 | ||
|
b28a88dbb2 | ||
|
e6558b7135 | ||
|
2c8fb9aa31 | ||
|
f48c6b6285 | ||
|
4f42f60bde | ||
|
3942647910 | ||
|
e0fbc78925 | ||
|
f3e43d7d94 | ||
|
f36547241c | ||
|
7ad29950a8 | ||
|
cbf91ad45c | ||
|
a039b66533 | ||
|
3a18c249f5 | ||
|
7c0775aa1b | ||
|
6514c34ed8 | ||
|
ba92754669 | ||
|
30afd39129 | ||
|
41699406cf | ||
|
9aa49e59d0 | ||
|
29d5034260 | ||
|
00d1622b3f | ||
|
a1acf19ff3 | ||
|
86328af6b7 | ||
|
36c27bdbf8 | ||
|
c839965c05 | ||
|
e1a9f3435f | ||
|
9f74feb347 | ||
|
f99232095b | ||
|
5044fe4fe4 | ||
|
8e49169e6b | ||
|
c71781d9ab | ||
|
8a2a4052f3 | ||
|
dad557164e | ||
|
e2fb49a8f8 | ||
|
f3241ff86a | ||
|
b9e7973a0f | ||
|
004b1f5288 | ||
|
857bd24c6d | ||
|
904968cf4a | ||
|
83747934ad | ||
|
7f90f5ecd4 | ||
|
12f02b9814 | ||
|
8931388309 | ||
|
25160d7344 | ||
|
ab6bf6edc7 | ||
|
56a4a374cd | ||
|
caa5b4e342 | ||
|
b6172c3965 | ||
|
02ddfa07a7 | ||
|
5022878680 | ||
|
2bfacbb8ba | ||
|
b18d2b0274 | ||
|
f20b496dca | ||
|
cca17f70b8 | ||
|
b8e69718a1 | ||
|
50ed7d2af2 | ||
|
698de932ed | ||
|
a3d8858bb1 | ||
|
83f3ba21b8 | ||
|
2aa729b212 | ||
|
1de70e4474 | ||
|
f2393de59b | ||
|
94ea7cc451 | ||
|
f8dbf57582 | ||
|
c59cd36da6 | ||
|
15e92958d6 | ||
|
96c648c4b4 | ||
|
f56a7d0cb2 | ||
|
01e617bb83 | ||
|
59fd5c69c0 | ||
|
28a9a8c380 | ||
|
6c2796b433 | ||
|
82ad5f7897 | ||
|
bf8ac3b9e6 | ||
|
edcdc9b1b9 | ||
|
4227aaa68a | ||
|
b750ce8be6 | ||
|
03a6a088c5 | ||
|
1e787a7646 | ||
|
766ac3f1fe | ||
|
a9038f2afc | ||
|
9828fa335e | ||
|
0c04d490bb | ||
|
bffffffc95 | ||
|
e9589ff786 | ||
|
c3bd3437f5 | ||
|
01789e6750 | ||
|
c3f7ba1b91 | ||
|
90d72a3683 | ||
|
f9bcf936ed | ||
|
acff177c54 | ||
|
658214a2e2 | ||
|
55f6f02c9b | ||
|
c5ba52910a | ||
|
994ccd6694 | ||
|
4921a83813 | ||
|
a97ba41b86 | ||
|
67e2623d2c | ||
|
4111095da3 | ||
|
6c21ddcedb | ||
|
d86349658f | ||
|
151ce6e3c7 | ||
|
6bdee26c30 | ||
|
5e4b1eed30 | ||
|
ab5cd95ccc | ||
|
a3dc398da5 | ||
|
b70f5d1a1e | ||
|
26363931ed | ||
|
e2438330f5 | ||
|
c5fcdd0657 | ||
|
345f3c07a5 | ||
|
f3477ff28c | ||
|
7ac4fa50b5 | ||
|
2f0a914838 | ||
|
5fc7d9a603 | ||
|
ced68e4e02 | ||
|
80071beaac | ||
|
de1029d5ef | ||
|
ffeb3194a8 | ||
|
95e9f33f6a | ||
|
c599a20b34 | ||
|
ca59528a32 | ||
|
6f4fd06d38 | ||
|
4715c2d006 | ||
|
fcfa43b6f1 | ||
|
56b4c55654 | ||
|
830790eeac | ||
|
39de9c7879 | ||
|
7b6cc14b71 | ||
|
ec749a4033 | ||
|
fe32214613 | ||
|
f6fcb775b7 | ||
|
d209108a95 | ||
|
efc64cf17f | ||
|
2f41ed50c1 | ||
|
fcc8cdd36a | ||
|
248632ce76 | ||
|
25681754bd | ||
|
179c487da9 | ||
|
350989bbec | ||
|
f5293e6c38 | ||
|
70c3515c94 | ||
|
4c7fd5a4e8 | ||
|
9d24341d94 | ||
|
512502ca08 | ||
|
6ce662c7a4 | ||
|
701ea5c46b | ||
|
2e5ff53d72 | ||
|
1229c61ba4 | ||
|
ee54438e92 | ||
|
65af78c85d | ||
|
b4747c3f85 | ||
|
1df074b73e | ||
|
254d30b8df | ||
|
ac5588c7c4 | ||
|
ddb70a89ad | ||
|
f4b2a9625d | ||
|
c2a1317c38 | ||
|
49f1a6933c | ||
|
9b387b8ec3 | ||
|
a45a29432e | ||
|
819d069edc | ||
|
b0a57a5091 | ||
|
d8678d562d | ||
|
34a9035164 | ||
|
0941e0a929 | ||
|
1ee78062d7 | ||
|
09f5609618 | ||
|
098322c564 | ||
|
365e24c1cd | ||
|
b82fdd59e7 | ||
|
6190ac7791 | ||
|
ed3aeb7997 | ||
|
33f92b6bcf | ||
|
9131a72a47 | ||
|
e5617dfe61 | ||
|
e67d67419f | ||
|
17c34716f9 | ||
|
e12f7c3026 | ||
|
af395eccda | ||
|
c403dcdabf | ||
|
c500cc095f | ||
|
6ecda647ad | ||
|
3e7ee1f090 | ||
|
0c120cb7a3 | ||
|
cab6829df9 | ||
|
0efe6df416 | ||
|
a4b6112a31 | ||
|
47debf0134 | ||
|
16ddd1edfc | ||
|
0f1fd0e90d | ||
|
ef76d83d2a | ||
|
df9f6004f2 | ||
|
9a87f99dcd | ||
|
30011db6d7 | ||
|
b6ac132c78 | ||
|
abf87a643d | ||
|
3824ea9079 | ||
|
5e22ce05c5 | ||
|
8fcc7aefa7 | ||
|
0b6ea1d046 | ||
|
22d3981a74 | ||
|
81b4f4928d | ||
|
dd77a38535 | ||
|
d319b53e23 | ||
|
b9627e14d0 | ||
|
56a96d36a1 | ||
|
e60630fa73 | ||
|
5ef6613024 | ||
|
af7e02de27 | ||
|
51d5b9d35d | ||
|
092ca6bcf5 | ||
|
2625cbbfed | ||
|
cedd1d5596 | ||
|
fb9e14a229 | ||
|
4e1bd7b5f0 | ||
|
5dfed8cd00 | ||
|
a2672a0d78 | ||
|
ee5ac6b800 | ||
|
a481d2ab46 | ||
|
c8bb21d12d | ||
|
e817cd7d43 | ||
|
bd6085fffd | ||
|
7efe9a9385 | ||
|
50da40a727 | ||
|
48390a1875 | ||
|
a3d27cd128 | ||
|
589c814ee6 | ||
|
4b60a3cbab | ||
|
1aaf633df8 | ||
|
82771ec64a | ||
|
ada8a402da | ||
|
17956efe35 | ||
|
8378c9f85e | ||
|
324b1079e7 | ||
|
c6da829713 | ||
|
844b0687a6 | ||
|
2ed2dd2fb7 | ||
|
d2f7dd3d5a | ||
|
9f08916cf1 | ||
|
a0e3676e3a | ||
|
2276793629 | ||
|
cfe57f52f4 |
@@ -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
13
.gitignore
vendored
@@ -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/
|
||||
|
@@ -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
8
CODEOWNERS
Normal 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
|
@@ -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.
|
||||
|
11
README.md
11
README.md
@@ -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) | [](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts |
|
||||
| [`@0xproject/react-docs`](/packages/react-docs) | [](https://www.npmjs.com/package/@0xproject/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON |
|
||||
| [`@0xproject/react-shared`](/packages/react-shared) | [](https://www.npmjs.com/package/@0xproject/react-shared) | 0x shared react components |
|
||||
| [`@0xproject/sra-spec`](/packages/sra-spec) | [](https://www.npmjs.com/package/@0xproject/sra-spec) | OpenAPI specification for the standard relayer API |
|
||||
| [`@0xproject/sra-report`](/packages/sra-report) | [](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance |
|
||||
| [`@0xproject/sol-cov`](/packages/sol-cov) | [](https://www.npmjs.com/package/@0xproject/sol-cov) | Solidity test coverage tool |
|
||||
| [`@0xproject/subproviders`](/packages/subproviders) | [](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
|
||||
|
||||
|
11
lerna.json
11
lerna.json
@@ -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",
|
||||
|
32
package.json
32
package.json
@@ -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"
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"contract_name": "ZRX",
|
||||
"networks": {
|
||||
"1": {
|
||||
"address": "0xe41d2489571d322189246dafa5ebde1f4699f498"
|
||||
},
|
||||
"3": {
|
||||
"address": "0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d"
|
||||
},
|
||||
"4": {
|
||||
"address": "0x00f58d6d585f84b2d7267940cede30ce2fe6eae8"
|
||||
},
|
||||
"42": {
|
||||
"address": "0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570"
|
||||
},
|
||||
"50": {
|
||||
"address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401"
|
||||
}
|
||||
}
|
||||
}
|
@@ -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';
|
||||
|
@@ -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);
|
@@ -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);
|
@@ -1,5 +0,0 @@
|
||||
export const zeroExConfigSchema = {
|
||||
id: '/ZeroExConfig',
|
||||
oneOf: [{ $ref: '/ZeroExPrivateNetworkConfig' }, { $ref: '/ZeroExPublicNetworkConfig' }],
|
||||
type: 'object',
|
||||
};
|
@@ -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',
|
||||
],
|
||||
};
|
@@ -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'],
|
||||
};
|
@@ -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
|
@@ -1,4 +0,0 @@
|
||||
export const constants = {
|
||||
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
|
||||
TESTRPC_NETWORK_ID: 50,
|
||||
};
|
@@ -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,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
@@ -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);
|
||||
});
|
||||
});
|
@@ -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);
|
||||
});
|
@@ -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,
|
||||
};
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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 };
|
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
"outDir": "lib",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["./src/**/*", "./test/**/*"]
|
||||
"include": ["./src/**/*"]
|
||||
}
|
||||
|
7
packages/0x.js/typedoc-tsconfig.json
Normal file
7
packages/0x.js/typedoc-tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../typedoc-tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": ["./src/**/*", "./test/**/*"]
|
||||
}
|
@@ -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,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@@ -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
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('../lib/index.js')
|
||||
require('../lib/src/index.js');
|
||||
|
0
packages/abi-gen/coverage/.gitkeep
Normal file
0
packages/abi-gen/coverage/.gitkeep
Normal 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"
|
||||
|
@@ -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)}`);
|
||||
}
|
||||
|
@@ -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);
|
@@ -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;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
86
packages/abi-gen/test/utils_test.ts
Normal file
86
packages/abi-gen/test/utils_test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
"outDir": "lib",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": ["./src/**/*", "./test/**/*"]
|
||||
}
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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": {
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
@@ -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', () => {
|
||||
|
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
"outDir": "lib",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": ["./src/**/*", "./test/**/*"]
|
||||
}
|
||||
|
@@ -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": [
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
@@ -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)) {
|
||||
|
@@ -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);
|
114
packages/base-contract/test/base_contract_test.ts
Normal file
114
packages/base-contract/test/base_contract_test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
"outDir": "lib",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": ["src/**/*", "test/**/*"]
|
||||
}
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
@@ -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,
|
||||
|
@@ -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';
|
||||
|
@@ -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);
|
@@ -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);
|
29
packages/connect/src/orders_channel_factory.ts
Normal file
29
packages/connect/src/orders_channel_factory.ts
Normal 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);
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
@@ -0,0 +1,8 @@
|
||||
export const assetPairsRequestOptsSchema = {
|
||||
id: '/AssetPairsRequestOpts',
|
||||
type: 'object',
|
||||
properties: {
|
||||
assetDataA: { $ref: '/hexSchema' },
|
||||
assetDataB: { $ref: '/hexSchema' },
|
||||
},
|
||||
};
|
@@ -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',
|
||||
],
|
||||
};
|
24
packages/connect/src/schemas/order_config_request_schema.ts
Normal file
24
packages/connect/src/schemas/order_config_request_schema.ts
Normal 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',
|
||||
],
|
||||
};
|
@@ -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'],
|
||||
};
|
||||
|
@@ -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' },
|
||||
},
|
||||
};
|
||||
|
7
packages/connect/src/schemas/request_opts_schema.ts
Normal file
7
packages/connect/src/schemas/request_opts_schema.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const requestOptsSchema = {
|
||||
id: '/RequestOpts',
|
||||
type: 'object',
|
||||
properties: {
|
||||
networkId: { type: 'number' },
|
||||
},
|
||||
};
|
@@ -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,
|
||||
};
|
||||
|
@@ -1,8 +0,0 @@
|
||||
export const tokenPairsRequestOptsSchema = {
|
||||
id: '/TokenPairsRequestOpts',
|
||||
type: 'object',
|
||||
properties: {
|
||||
tokenA: { $ref: '/Address' },
|
||||
tokenB: { $ref: '/Address' },
|
||||
},
|
||||
};
|
@@ -1,10 +0,0 @@
|
||||
export const webSocketOrderbookChannelConfigSchema = {
|
||||
id: '/WebSocketOrderbookChannelConfig',
|
||||
type: 'object',
|
||||
properties: {
|
||||
heartbeatIntervalMs: {
|
||||
type: 'number',
|
||||
minimum: 10,
|
||||
},
|
||||
},
|
||||
};
|
@@ -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 {
|
||||
|
25
packages/connect/src/utils/assert.ts
Normal file
25
packages/connect/src/utils/assert.ts
Normal 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'));
|
||||
},
|
||||
};
|
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
37
packages/connect/src/utils/orders_channel_message_parser.ts
Normal file
37
packages/connect/src/utils/orders_channel_message_parser.ts
Normal 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,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
@@ -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']);
|
||||
},
|
||||
};
|
||||
|
@@ -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) };
|
||||
},
|
||||
};
|
||||
|
@@ -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`));
|
||||
}
|
||||
}
|
||||
}
|
101
packages/connect/src/ws_orders_channel.ts
Normal file
101
packages/connect/src/ws_orders_channel.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
21
packages/connect/test/fixtures/standard_relayer_api/asset_pairs.json
vendored
Normal file
21
packages/connect/test/fixtures/standard_relayer_api/asset_pairs.json
vendored
Normal 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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
25
packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts
vendored
Normal file
25
packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts
vendored
Normal 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',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
10
packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json
vendored
Normal file
10
packages/connect/test/fixtures/standard_relayer_api/fee_recipients.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"total": 3,
|
||||
"page": 1,
|
||||
"perPage": 10,
|
||||
"records": [
|
||||
"0x6ec92694ea172ebc430c30fa31de87620967a082",
|
||||
"0x9e56625509c2f60af937f23b7b532600390e8c8b",
|
||||
"0xa2b31dacf30a9c50ca473337c01d8a201ae33e32"
|
||||
]
|
||||
}
|
12
packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
vendored
Normal file
12
packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { FeeRecipientsResponse } from '../../../src/types';
|
||||
|
||||
export const feeRecipientsResponse: FeeRecipientsResponse = {
|
||||
total: 3,
|
||||
page: 1,
|
||||
perPage: 10,
|
||||
records: [
|
||||
'0x6ec92694ea172ebc430c30fa31de87620967a082',
|
||||
'0x9e56625509c2f60af937f23b7b532600390e8c8b',
|
||||
'0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
|
||||
],
|
||||
};
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"feeRecipient": "0x323b5d4c32345ced77393b3530b1eed0f346429d",
|
||||
"makerFee": "10000000000000000",
|
||||
"takerFee": "30000000000000000"
|
||||
}
|
@@ -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'),
|
||||
};
|
@@ -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": {}
|
||||
}
|
||||
|
@@ -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: {},
|
||||
};
|
||||
|
6
packages/connect/test/fixtures/standard_relayer_api/order_config.json
vendored
Normal file
6
packages/connect/test/fixtures/standard_relayer_api/order_config.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"senderAddress": "0xa2b31dacf30a9c50ca473337c01d8a201ae33e32",
|
||||
"feeRecipientAddress": "0xb046140686d052fff581f63f8136cce132e857da",
|
||||
"makerFee": "100000000000000",
|
||||
"takerFee": "200000000000000"
|
||||
}
|
10
packages/connect/test/fixtures/standard_relayer_api/order_config.ts
vendored
Normal file
10
packages/connect/test/fixtures/standard_relayer_api/order_config.ts
vendored
Normal 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'),
|
||||
};
|
@@ -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": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@@ -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: {},
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@@ -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": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
@@ -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: {},
|
||||
},
|
||||
},
|
||||
];
|
||||
],
|
||||
};
|
||||
|
@@ -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
Reference in New Issue
Block a user