Compare commits
798 Commits
@0x/contra
...
@0x/utils@
Author | SHA1 | Date | |
---|---|---|---|
|
2b8226a757 | ||
|
92d5adaac4 | ||
|
0c9daa693e | ||
|
89729e828c | ||
|
c2113caae1 | ||
|
e0adb6624d | ||
|
022855add0 | ||
|
4dd1c48dc8 | ||
|
cdc2393aa6 | ||
|
94f94bdda7 | ||
|
3264bd223d | ||
|
6292c0703c | ||
|
9a28079f2a | ||
|
c612649f02 | ||
|
eda44d1ffb | ||
|
4c2f77c014 | ||
|
6b8bbd3d5f | ||
|
e914e1b7fa | ||
|
3d2ce749a8 | ||
|
9892d8d6d2 | ||
|
218a7ab810 | ||
|
6779e52813 | ||
|
5d51b40541 | ||
|
b12b7069f7 | ||
|
10a5d38446 | ||
|
e39e7a934e | ||
|
b7127d8506 | ||
|
a12e07b1a8 | ||
|
8ff5c0a603 | ||
|
d7c61fea4c | ||
|
08dc5fafa0 | ||
|
78493a9d98 | ||
|
e274d8994a | ||
|
2dee887e6f | ||
|
f7eb20a235 | ||
|
f3cea0ebd0 | ||
|
05e00d278f | ||
|
107c7a71f9 | ||
|
56698fb09e | ||
|
55bb6f89d3 | ||
|
47d77cbddd | ||
|
2547e0e5b1 | ||
|
1a4699ecac | ||
|
c825643b67 | ||
|
a425d3a234 | ||
|
3041e7459e | ||
|
1fb9d54174 | ||
|
598607f5a3 | ||
|
5c5bb20415 | ||
|
6199a17791 | ||
|
7dd42ad6aa | ||
|
c7fd85633d | ||
|
b3df71bebf | ||
|
88d95ebdbc | ||
|
140cf4d378 | ||
|
451a19117f | ||
|
aa6ab33b93 | ||
|
8ec04271f3 | ||
|
f583de652f | ||
|
96cd9de8a6 | ||
|
9a17cb4c92 | ||
|
021cba9fad | ||
|
47f4321611 | ||
|
775a41a789 | ||
|
f6c61ed79f | ||
|
152e057e08 | ||
|
8b84ecc593 | ||
|
9c10babefd | ||
|
67193d9472 | ||
|
7d04dd9520 | ||
|
93bda7972c | ||
|
92c0e34ed2 | ||
|
c0a471b349 | ||
|
2543076d16 | ||
|
e32bb6fc0f | ||
|
7020166473 | ||
|
16ae47f2ad | ||
|
abf1141ad8 | ||
|
3790e0a741 | ||
|
9e1966b4fe | ||
|
38e06e57a3 | ||
|
7f2fc90677 | ||
|
1f0ab54fc5 | ||
|
7f8c11a74c | ||
|
7a4d64d90d | ||
|
7217bfa35e | ||
|
25077affc8 | ||
|
7a80583655 | ||
|
c21fe0cb50 | ||
|
3d08e79089 | ||
|
c43db2d096 | ||
|
220856d084 | ||
|
a01eafa4e7 | ||
|
f9c2d25352 | ||
|
d2f77d74e6 | ||
|
c3b928c1f5 | ||
|
9dfa9c194e | ||
|
1a3dc6cefc | ||
|
1a73daf82a | ||
|
6b20c9a542 | ||
|
76c996250d | ||
|
52e8de9966 | ||
|
81ab84b087 | ||
|
e34755a1ef | ||
|
6c11b2ad8a | ||
|
ede6ecc3aa | ||
|
9db69f33e4 | ||
|
17d5d4648b | ||
|
e203b5593a | ||
|
de9aa063c0 | ||
|
077d001b42 | ||
|
dfd46d68ac | ||
|
4dbe137999 | ||
|
1ac5cb404f | ||
|
43ffa2dd77 | ||
|
1efa7935b7 | ||
|
b0835b005a | ||
|
30946ac110 | ||
|
9427858755 | ||
|
53864d3817 | ||
|
ab283ddd9b | ||
|
7efcf9066c | ||
|
219e09d157 | ||
|
d816551dba | ||
|
04c5752b8a | ||
|
ed12d8b95f | ||
|
f48852742d | ||
|
b84d89367a | ||
|
d8dab6a070 | ||
|
ac2443690c | ||
|
5df0f13eb0 | ||
|
24d782fb19 | ||
|
01a5472318 | ||
|
4b7a2e9d49 | ||
|
62936e3502 | ||
|
d6b3e4fbaa | ||
|
a5f011f4a4 | ||
|
c6efaab01d | ||
|
0f7282d9a9 | ||
|
a3b414a986 | ||
|
8a6d0b67f1 | ||
|
f78ff91975 | ||
|
c8e416f3b1 | ||
|
d61f67d24a | ||
|
258ffdcc94 | ||
|
1f93f09864 | ||
|
7afddb9309 | ||
|
5eb4dbd5d9 | ||
|
fc39ddfb71 | ||
|
ba04a8bc0c | ||
|
02d4a28402 | ||
|
ea2bf07ea6 | ||
|
b5dc734dc4 | ||
|
7dd9b0ba66 | ||
|
69a5c8a317 | ||
|
b975ac7c31 | ||
|
dcede832c8 | ||
|
f40bbbc238 | ||
|
361f5ca5cc | ||
|
a710ebe5b3 | ||
|
2becef23ff | ||
|
f916d293fa | ||
|
f312a260cc | ||
|
fd9b51c7db | ||
|
1dac6b6157 | ||
|
c2ba6b3a0f | ||
|
576bd5585f | ||
|
ae61a87190 | ||
|
2e8f2ae769 | ||
|
b507a308e6 | ||
|
ad83b17fdf | ||
|
e452cfcd59 | ||
|
6474a4e08c | ||
|
e78288ddfd | ||
|
6e2d0ab13d | ||
|
bfbc78c95c | ||
|
368ae86530 | ||
|
d8ccc1694d | ||
|
b4e10b1e06 | ||
|
05f76958ac | ||
|
1183cf5e6b | ||
|
bf9eb1413b | ||
|
38d48a8f20 | ||
|
ca222a470d | ||
|
49ca8840ea | ||
|
faaeba78bb | ||
|
6c37d47f2f | ||
|
185e53149f | ||
|
4329a252ee | ||
|
8d38d69684 | ||
|
edb5e50253 | ||
|
81ab2e75ca | ||
|
e0d8398cf7 | ||
|
4fd46d1c95 | ||
|
c217764fe0 | ||
|
42124274c7 | ||
|
562342ac99 | ||
|
14b573ebfd | ||
|
e3834c2fc0 | ||
|
c2f3757de7 | ||
|
4b0010be63 | ||
|
078af36e0e | ||
|
b17d12fe23 | ||
|
294c0b449b | ||
|
bc3927e973 | ||
|
a2cfdd2975 | ||
|
53b4f48b2e | ||
|
635b80440a | ||
|
f2d95477e6 | ||
|
1005e4962a | ||
|
487bc1a08b | ||
|
0cf768185e | ||
|
b5558a8cff | ||
|
af2b8dfde5 | ||
|
2bde5f7034 | ||
|
c38f913a84 | ||
|
44b4f91208 | ||
|
9c4ad6ac32 | ||
|
b151c0b701 | ||
|
d4b6db773f | ||
|
7da71c0955 | ||
|
32adb35c2a | ||
|
2f197d128a | ||
|
5415bc4590 | ||
|
f6086b8054 | ||
|
c9d77d7fa0 | ||
|
ab8c457c51 | ||
|
5d91ad3656 | ||
|
78ffca06ea | ||
|
0d71ec93e7 | ||
|
d4c771dc7d | ||
|
68004466bb | ||
|
4dd2d1afaf | ||
|
4947676434 | ||
|
ea5e83da03 | ||
|
0705276ff9 | ||
|
0299abf1b5 | ||
|
132394ffbe | ||
|
40edcef340 | ||
|
bf22eba795 | ||
|
e990272db3 | ||
|
401a0eadb1 | ||
|
5852e0b476 | ||
|
401df5f45d | ||
|
7da40fd7bc | ||
|
89740dc24c | ||
|
4d7ba42f8f | ||
|
bbd9c4ef67 | ||
|
de036ae96a | ||
|
e5985d7c3f | ||
|
fb54c45d7d | ||
|
f1b704a91a | ||
|
b99eab6804 | ||
|
82acc26f97 | ||
|
569a165c87 | ||
|
704adcb03d | ||
|
197cdee604 | ||
|
3dc5de936e | ||
|
d88eb6a5c9 | ||
|
a168f34538 | ||
|
7b150bab73 | ||
|
b0e38f79ea | ||
|
a68ebc27ed | ||
|
25705bd314 | ||
|
85c9b7d9c5 | ||
|
629c2ecba2 | ||
|
be0662a41d | ||
|
1985fec892 | ||
|
2cbdd76aa3 | ||
|
73ae0541d8 | ||
|
22621b9f76 | ||
|
c9f214504a | ||
|
e8a2d1240f | ||
|
f2e0fe49f7 | ||
|
4ce7bf56e7 | ||
|
29be232ae9 | ||
|
794c0342ee | ||
|
d5a22829ac | ||
|
b58d4005d3 | ||
|
c16d9d85a2 | ||
|
92aeca1f30 | ||
|
b81ed67975 | ||
|
2bc6582e6b | ||
|
b27311da2e | ||
|
ab8a0da16a | ||
|
800e37ed03 | ||
|
950e84fe5c | ||
|
fdbc235fd6 | ||
|
ffdb5c06f6 | ||
|
14f0f89798 | ||
|
54b53184b7 | ||
|
75b1cdac66 | ||
|
d21f394531 | ||
|
86d90599ca | ||
|
ec24976789 | ||
|
00eaa8bd34 | ||
|
5c44163d68 | ||
|
f73bad5c13 | ||
|
a063fa6fe0 | ||
|
894ad8af21 | ||
|
c01793599f | ||
|
63db393b60 | ||
|
5846166c85 | ||
|
25e941128a | ||
|
22964ff913 | ||
|
62a58667ba | ||
|
c868015989 | ||
|
565e5e5770 | ||
|
198831d084 | ||
|
d3be097436 | ||
|
1259de5be4 | ||
|
df6be48638 | ||
|
4923fdbb73 | ||
|
66964a5a2f | ||
|
97e24d0e14 | ||
|
fe0b75ef26 | ||
|
4b76efbc28 | ||
|
11cff4d391 | ||
|
59211c1c1e | ||
|
c0ab2e8127 | ||
|
d39e90bfa1 | ||
|
16e55457c8 | ||
|
ea2a453811 | ||
|
7d2a768a0c | ||
|
78304c4369 | ||
|
85f243e2e0 | ||
|
785ca4f5d1 | ||
|
730e8ad151 | ||
|
b3e6e23508 | ||
|
f09d56cdb9 | ||
|
b51933c4d9 | ||
|
477791a600 | ||
|
f0d6476f92 | ||
|
fa4accd0c4 | ||
|
e64754f554 | ||
|
5badb1eb5d | ||
|
9c52fd1f2a | ||
|
27e01b9249 | ||
|
5bf0de5519 | ||
|
139a4acb1b | ||
|
9d8b2d9e0c | ||
|
d16a0f1b56 | ||
|
edb63c0f26 | ||
|
bd3a80bcde | ||
|
9f0da8ec39 | ||
|
42ed4e393f | ||
|
99ffe6bb2d | ||
|
70898be894 | ||
|
9f1859575d | ||
|
0167689374 | ||
|
053c5f0f88 | ||
|
fa6516d0be | ||
|
7fb0e1b39c | ||
|
8ba439c263 | ||
|
1a1f24146c | ||
|
086fa31d04 | ||
|
b5e02d1b74 | ||
|
e88aee6ad9 | ||
|
fb4ead84f5 | ||
|
298967e639 | ||
|
903a9947a3 | ||
|
72beb59d63 | ||
|
75dd1be40e | ||
|
6a7c2918bb | ||
|
9b9ee2415d | ||
|
f1f38fb8b0 | ||
|
1e44bcb7c9 | ||
|
11e689156e | ||
|
6c792e89f9 | ||
|
11026fe36a | ||
|
3133dde3a3 | ||
|
b666ca0271 | ||
|
de5c6c1ed0 | ||
|
34f4cf133b | ||
|
1ba54af4e2 | ||
|
42e0d608c8 | ||
|
2c35d63976 | ||
|
d1ca1e768f | ||
|
2255cc2ebc | ||
|
6512c12f40 | ||
|
fc8d428d1d | ||
|
e07613818d | ||
|
de59ae11bd | ||
|
026690c837 | ||
|
c223a72f5b | ||
|
c66cf83ef1 | ||
|
30cf9ac857 | ||
|
b99b9d5435 | ||
|
81b9ab2b6e | ||
|
78a60a9973 | ||
|
fca6f838d5 | ||
|
4a39eb7931 | ||
|
00ab5f0afb | ||
|
34dfd73aab | ||
|
9e0e12a468 | ||
|
1bdcb4f737 | ||
|
5e5ecdcf32 | ||
|
b316217394 | ||
|
d96e307e2c | ||
|
a7944bb3c5 | ||
|
2dc3885691 | ||
|
027ab98a3e | ||
|
1a5736a498 | ||
|
73f4c036c6 | ||
|
6cbadcf8e9 | ||
|
6a38f231b1 | ||
|
02d63daba5 | ||
|
99074b3c34 | ||
|
bb33609164 | ||
|
27832741e4 | ||
|
0cffdc9868 | ||
|
6055d44120 | ||
|
984305d483 | ||
|
7934624afc | ||
|
e7db5aa4f3 | ||
|
e922299a55 | ||
|
58cbc7a05f | ||
|
43648a2382 | ||
|
c1abaa3293 | ||
|
9f77879198 | ||
|
79279e5614 | ||
|
d100897b20 | ||
|
bfaaefaf0a | ||
|
520c6fa426 | ||
|
d95b520512 | ||
|
10f8637802 | ||
|
b327cc0f52 | ||
|
88acdaff90 | ||
|
d5039809de | ||
|
2746b73416 | ||
|
fdd1d20c5b | ||
|
e2b4670016 | ||
|
336adc6974 | ||
|
7c72ac52e1 | ||
|
d165bb2bb2 | ||
|
12dea02fab | ||
|
5181ee172b | ||
|
def0d9307e | ||
|
45e572388b | ||
|
4898de8d41 | ||
|
1aa2270d97 | ||
|
5abc9a8066 | ||
|
a8deb6cc74 | ||
|
87bcb46f43 | ||
|
3d904aac67 | ||
|
ace63fe83a | ||
|
33320fd758 | ||
|
be5b4b7702 | ||
|
5c55064c0f | ||
|
71ad8dcec0 | ||
|
09fd8bc521 | ||
|
ace0150fcb | ||
|
e627d3ce01 | ||
|
a65f981f55 | ||
|
dbebb3818d | ||
|
2027b74c5f | ||
|
5e921fdd08 | ||
|
6eda017719 | ||
|
9b9960c7b9 | ||
|
9df09e2464 | ||
|
5dacc58a4e | ||
|
fcb18e8d34 | ||
|
9af95a9461 | ||
|
bef662a6e1 | ||
|
04f24f32e2 | ||
|
65743882bb | ||
|
9e82b51eb5 | ||
|
a20c40ca90 | ||
|
745bdda1a3 | ||
|
3c7e538202 | ||
|
786419fee0 | ||
|
739651b917 | ||
|
e374469818 | ||
|
2ecd9672c2 | ||
|
68a4ad2e51 | ||
|
b2e2c27775 | ||
|
8e45d5e137 | ||
|
1ded7cd4f1 | ||
|
8bd2411a89 | ||
|
907fba7d0f | ||
|
bb5afc43b9 | ||
|
a243c9d685 | ||
|
829eeb2374 | ||
|
338de4ffa1 | ||
|
c7fbd6c64c | ||
|
95b7ae3146 | ||
|
ded48fd453 | ||
|
cbe2cf8a85 | ||
|
a12dc5c81b | ||
|
db062154d1 | ||
|
ac3a6426e8 | ||
|
f1f5b57254 | ||
|
3403e8af9b | ||
|
19286db952 | ||
|
40234e5b4a | ||
|
a9f046609c | ||
|
f2e2672e81 | ||
|
784f2674a9 | ||
|
93399165e7 | ||
|
7422485817 | ||
|
2ef19f31db | ||
|
8154209eab | ||
|
d56fb374a7 | ||
|
7bad1d2921 | ||
|
37dd494abd | ||
|
a9748e1b52 | ||
|
cc33101923 | ||
|
31fbbb52a8 | ||
|
d2c5665a30 | ||
|
06744ee7fb | ||
|
3e1db453ff | ||
|
ec76186c23 | ||
|
fcf975a65c | ||
|
e6d2c7db88 | ||
|
d012268953 | ||
|
70b797cb6d | ||
|
28d7cf38c8 | ||
|
6094fa7b6d | ||
|
8f3b7ee522 | ||
|
74f6fb7408 | ||
|
4ccb735282 | ||
|
b94631c84a | ||
|
2544e4fd65 | ||
|
7454a7a6f3 | ||
|
13e262b9cf | ||
|
b4db9d8b7d | ||
|
14ad5ced78 | ||
|
b2e592bb41 | ||
|
1a3281a959 | ||
|
6701c58a10 | ||
|
80fd0db2eb | ||
|
7ca8c5c16d | ||
|
3ed7cc5cab | ||
|
0987ae05a8 | ||
|
3154149d37 | ||
|
6f46109617 | ||
|
b0896408d2 | ||
|
243b478b99 | ||
|
fabbad2b2c | ||
|
1948ffe7bd | ||
|
67baee60f8 | ||
|
8f4c4715e2 | ||
|
3e7cbe6015 | ||
|
0053bde668 | ||
|
363dd31768 | ||
|
f841737adc | ||
|
9adaa7972e | ||
|
ec387f9bb7 | ||
|
aa657776fc | ||
|
f12632a1f2 | ||
|
4f8164dc43 | ||
|
88303d8855 | ||
|
4e8ddafa64 | ||
|
1ebe9d2bba | ||
|
fbae619725 | ||
|
8c5f4c3de7 | ||
|
154841157f | ||
|
6a20d06194 | ||
|
245e118016 | ||
|
fcc9d6749c | ||
|
9e091c5015 | ||
|
01247319c3 | ||
|
1d3d5f7e32 | ||
|
49f2cef5ac | ||
|
926d165321 | ||
|
86218445cd | ||
|
6e0f695699 | ||
|
7b9ff7776d | ||
|
e0f3f53d42 | ||
|
2e911ee709 | ||
|
43afed6654 | ||
|
0dda8328af | ||
|
48052fc3e4 | ||
|
5ac5fed513 | ||
|
60521e8167 | ||
|
510568d4f1 | ||
|
3e3ec3134d | ||
|
c22374893e | ||
|
013eaeeb07 | ||
|
b97b6867d8 | ||
|
87f31ec532 | ||
|
9b12695443 | ||
|
cbb40c1c2b | ||
|
b0e56fc27b | ||
|
d15532227d | ||
|
c3f98e95ad | ||
|
e92e99d6ea | ||
|
f6b67f6c98 | ||
|
108861b6ca | ||
|
80d93e8d75 | ||
|
1634cd53be | ||
|
577df3749d | ||
|
73c53b3da6 | ||
|
9af996a907 | ||
|
bd2e4a8076 | ||
|
ceaa6a592c | ||
|
b503fecccb | ||
|
4161055cc7 | ||
|
b0c9a3bbe1 | ||
|
436bdde461 | ||
|
01853064b0 | ||
|
c1ccb5af0f | ||
|
706f04ee27 | ||
|
549e35e972 | ||
|
1ed66966a8 | ||
|
326539f1f5 | ||
|
67322ba39f | ||
|
41fcc41bd1 | ||
|
7aacff62ca | ||
|
4566ddb037 | ||
|
957e6b1500 | ||
|
5945635d1d | ||
|
045fc0914b | ||
|
72442871aa | ||
|
bbd3c03969 | ||
|
a4405c3d39 | ||
|
0fe4f587d8 | ||
|
d3c714bd17 | ||
|
c399b7a7d5 | ||
|
b9234e94fb | ||
|
417bb87785 | ||
|
0233ae3134 | ||
|
eed0c5dd59 | ||
|
2b3b167095 | ||
|
5d91d19808 | ||
|
0f374ddee9 | ||
|
a65a9913cd | ||
|
1ead32c666 | ||
|
d1af9fc780 | ||
|
0f06737fb6 | ||
|
1676231532 | ||
|
b1caf697c8 | ||
|
51481065fe | ||
|
e367da710c | ||
|
f493d6524d | ||
|
e1b85da2a7 | ||
|
22c6548ed1 | ||
|
afb32c087d | ||
|
bbc1ed1c64 | ||
|
3a46f1a27a | ||
|
90cd364780 | ||
|
6795e6f078 | ||
|
cfb3404349 | ||
|
0212f3ee78 | ||
|
6b2995a4ee | ||
|
09e7ac54d4 | ||
|
f69009d4a8 | ||
|
206802ae33 | ||
|
91d4138fb8 | ||
|
cb455f951a | ||
|
5f25d20cd0 | ||
|
1f0e2cd910 | ||
|
1749d02701 | ||
|
55ace3179c | ||
|
7866d9ccb4 | ||
|
51f73d07fa | ||
|
63d84674ab | ||
|
14066997b2 | ||
|
28561e765a | ||
|
453fbbdc5d | ||
|
1e1e5ec10d | ||
|
2088b0e459 | ||
|
58400d9e01 | ||
|
ac9375f1d2 | ||
|
db061c9355 | ||
|
d5ce6c464b | ||
|
b06205bb7f | ||
|
f528a3e1de | ||
|
bddfdacfad | ||
|
d3cdd3f235 | ||
|
41ae45ea40 | ||
|
657e0895ea | ||
|
0ae2d8bab5 | ||
|
3e0bd1f02d | ||
|
b2592d1cc2 | ||
|
aa3524c3b2 | ||
|
35fcfb978d | ||
|
c68083cf03 | ||
|
39deb1a05f | ||
|
302d08e290 | ||
|
05489dd7f1 | ||
|
cfb5119efc | ||
|
5d53fa5635 | ||
|
38d2b70ba6 | ||
|
29d5db16c2 | ||
|
a8128c5772 | ||
|
55bd076602 | ||
|
53a08d00fd | ||
|
fccec66463 | ||
|
bc26e807cd | ||
|
46dc37fb20 | ||
|
ccbb8400ee | ||
|
5d3d8a5332 | ||
|
7a224fe08f | ||
|
e045f5f74b | ||
|
e5c07ff0c5 | ||
|
cdf0aa27e4 | ||
|
88998e6bb7 | ||
|
b885dfa606 | ||
|
407495c278 | ||
|
ea50a94355 | ||
|
cb3318972e | ||
|
c057ad7977 | ||
|
eb21718462 | ||
|
7836e10d8a | ||
|
946a31821d | ||
|
92a915f477 | ||
|
60b458dbfb | ||
|
8b13efc89a | ||
|
88b625fa15 | ||
|
2cf9c9b7df | ||
|
d179d6a1a2 | ||
|
08502c1eb6 | ||
|
384cd47416 | ||
|
3bdeb82097 | ||
|
f49ab3f919 | ||
|
42d5bdd3ab | ||
|
7228cbfe92 | ||
|
250c46d6a4 | ||
|
f394d7dba9 | ||
|
ca595cd8cf | ||
|
9ce71739f5 | ||
|
d69da38f7d | ||
|
50f69f734f | ||
|
fc9c6c5434 | ||
|
6e941be1e9 | ||
|
9f677150a4 | ||
|
11e273337f | ||
|
ec807120c3 | ||
|
a5654debeb | ||
|
0869c0d8b0 | ||
|
b456c3f953 | ||
|
8297d68166 | ||
|
18ce6797e0 | ||
|
c1009d440e | ||
|
89ee6fe6db | ||
|
38a12475bc | ||
|
9a800264a2 | ||
|
8ce390be3c | ||
|
cc93532f4f | ||
|
37cc40521c | ||
|
5ac7ff7084 | ||
|
e682b82ca8 | ||
|
7cd1fd0aaa | ||
|
8cd99c5a40 | ||
|
ad83312009 | ||
|
9e3b1fe333 | ||
|
c3f42995f9 | ||
|
3d3a02c892 | ||
|
06bec227ad | ||
|
5d7803323c | ||
|
4303f9a025 | ||
|
fe4c5434fa | ||
|
9325bb70c5 | ||
|
b164557165 | ||
|
424f984ea8 | ||
|
78c704e3d1 | ||
|
50f1a8fbd8 | ||
|
0f90b7b5da | ||
|
bec4384a5d | ||
|
f361efae5a | ||
|
76ca2116ab | ||
|
33d8646dc5 | ||
|
3cb5190bc6 | ||
|
5bba06bef8 | ||
|
dd3f672a35 | ||
|
25ef3b8445 | ||
|
7eb2d290d8 | ||
|
678762910b | ||
|
da28a542c7 | ||
|
92602d33ad | ||
|
03f04f4bb3 | ||
|
0d4dd5ff0d | ||
|
884864cc58 | ||
|
7c199d83be | ||
|
5b4c29c4bb | ||
|
f97ee80955 | ||
|
547322ae63 | ||
|
db74db622e | ||
|
57318c0041 | ||
|
4eb0767834 | ||
|
92bb7808ce | ||
|
abfe7d1613 | ||
|
6c72239365 | ||
|
8001daad8c | ||
|
73a38ab4f4 | ||
|
11e2fc5bc4 | ||
|
3e88f820b8 | ||
|
163750f8c2 | ||
|
4aabc5d791 | ||
|
c9a7b9dcc1 | ||
|
98075b5653 | ||
|
57ae5be916 | ||
|
8caf62997f | ||
|
f8656ad376 | ||
|
29c6c2a2ad | ||
|
f2db67ef02 | ||
|
72b8ef33d9 |
@@ -4,21 +4,26 @@ jobs:
|
||||
build:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
environment:
|
||||
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
||||
- run:
|
||||
# HACK(albrow): Without this, yarn commands will sometimes
|
||||
# fail with a "permission denied" error.
|
||||
name: Set npm path
|
||||
command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||
# HACK(feuGeneA): commented out this hack as we're changing
|
||||
# from a circleci-maintained container to a different
|
||||
# container, and this hack may not apply anymore, as
|
||||
# suggested by the non-existance of `/home/circleci/.bashrc`
|
||||
# when running the command below.
|
||||
# - run:
|
||||
# # HACK(albrow): Without this, yarn commands will sometimes
|
||||
# # fail with a "permission denied" error.
|
||||
# name: Set npm path
|
||||
# command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc
|
||||
- run:
|
||||
name: install-yarn
|
||||
command: npm install --global yarn@1.9.4
|
||||
command: npm install --global yarn@1.17.0
|
||||
- run:
|
||||
name: yarn
|
||||
command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install
|
||||
@@ -29,18 +34,14 @@ jobs:
|
||||
key: repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo
|
||||
- save_cache:
|
||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/python-contract-wrappers/generated
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/python-contract-wrappers/generated
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen/test-cli/output
|
||||
- store_artifacts:
|
||||
path: ~/repo/packages/abi-gen-wrappers/generated_docs
|
||||
build-website:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -48,8 +49,9 @@ jobs:
|
||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run: cd packages/website && yarn build:prod
|
||||
test-contracts-ganache:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -58,7 +60,7 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/contracts-multisig @0x/contracts-utils @0x/contracts-exchange-libs @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-extensions @0x/contracts-asset-proxy @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-coordinator @0x/contracts-dev-utils
|
||||
test-contracts-geth:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/devnet
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -71,7 +73,7 @@ jobs:
|
||||
test-publish:
|
||||
resource_class: medium+
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/verdaccio
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
@@ -81,7 +83,7 @@ jobs:
|
||||
- run: yarn test:publish:circleci
|
||||
test-doc-generation:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -90,7 +92,7 @@ jobs:
|
||||
- run: yarn test:generate_docs:circleci
|
||||
test-rest:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -107,7 +109,6 @@ jobs:
|
||||
- run: yarn wsrun test:circleci @0x/dev-utils
|
||||
- run: yarn wsrun test:circleci @0x/json-schemas
|
||||
- run: yarn wsrun test:circleci @0x/order-utils
|
||||
- run: yarn wsrun test:circleci @0x/order-watcher
|
||||
- run: yarn wsrun test:circleci @0x/sol-compiler
|
||||
- run: yarn wsrun test:circleci @0x/sol-tracing-utils
|
||||
- run: yarn wsrun test:circleci @0x/sol-doc
|
||||
@@ -151,10 +152,6 @@ jobs:
|
||||
key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/order-utils/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
- ~/repo/packages/order-watcher/coverage/lcov.info
|
||||
- save_cache:
|
||||
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
paths:
|
||||
@@ -178,22 +175,22 @@ jobs:
|
||||
test-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/ganache-cli:2.2.2
|
||||
- image: 0xorg/launch-kit-ci
|
||||
- image: 0xorg/launch-kit-backend:74bcc39
|
||||
environment:
|
||||
RPC_URL: http://localhost:8545
|
||||
NETWORK_ID: 50
|
||||
WHITELIST_ALL_TOKENS: True
|
||||
command: bash -c "until curl -sfd'{\"method\":\"net_listening\"}' http://localhost:8545 | grep true; do continue; done; forever ts/lib/index.js"
|
||||
command: |
|
||||
sh -c "until printf 'POST /\r\nContent-Length: 26\r\n\r\n{\"method\":\"net_listening\"}' | nc localhost 8545 | grep true; do continue; done; node_modules/.bin/forever ts/lib/index.js"
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
||||
keys:
|
||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages
|
||||
@@ -208,7 +205,7 @@ jobs:
|
||||
- run:
|
||||
command: |
|
||||
cd python-packages
|
||||
./parallel coverage run setup.py test
|
||||
./parallel_without_sra_client coverage run setup.py test
|
||||
./build_docs
|
||||
- save_cache:
|
||||
key: coverage-python-contract-addresses-{{ .Environment.CIRCLE_SHA1 }}
|
||||
@@ -235,9 +232,7 @@ jobs:
|
||||
paths:
|
||||
- ~/repo/python-packages/sra_client/.coverage
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
|
||||
path: ~/repo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/*/__init__.py
|
||||
- store_artifacts:
|
||||
path: ~/repo/python-packages/contract_addresses/build
|
||||
- store_artifacts:
|
||||
@@ -255,11 +250,9 @@ jobs:
|
||||
test-rest-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
@@ -283,15 +276,14 @@ jobs:
|
||||
static-tests-python:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/python
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- checkout
|
||||
- run: sudo chown -R circleci:circleci /usr/local/bin
|
||||
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7
|
||||
- restore_cache:
|
||||
key: installed-py-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
key: python-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
|
||||
keys:
|
||||
- repo-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- run:
|
||||
command: |
|
||||
python -m ensurepip
|
||||
@@ -302,7 +294,7 @@ jobs:
|
||||
static-tests:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
@@ -310,11 +302,12 @@ jobs:
|
||||
- run: yarn lerna run lint
|
||||
- run: yarn prettier:ci
|
||||
- run: yarn deps_versions:ci
|
||||
- run: yarn diff_md_docs:ci
|
||||
- run: cd packages/0x.js && yarn build:umd:prod
|
||||
- run: yarn bundlewatch
|
||||
submit-coverage:
|
||||
docker:
|
||||
- image: circleci/node:9-browsers
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -347,9 +340,6 @@ jobs:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-order-watcher-{{ .Environment.CIRCLE_SHA1 }}
|
||||
- restore_cache:
|
||||
keys:
|
||||
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
|
||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -4,4 +4,5 @@
|
||||
*.svg linguist-generated=true
|
||||
packages/contract-artifacts/artifacts/*json linguist-generated=true
|
||||
packages/abi-gen-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
packages/contract-wrappers/src/generated-wrappers/*.ts linguist-generated=true
|
||||
|
||||
|
1
.github/autolabeler.yml
vendored
1
.github/autolabeler.yml
vendored
@@ -21,7 +21,6 @@ contracts: ['contracts']
|
||||
@0x/utils: ['packages/utils']
|
||||
@0x/tslint-config: ['packages/tslint-config']
|
||||
@0x/asset-buyer: ['packages/asset-buyer']
|
||||
@0x/order-watcher: ['packages/order-watcher']
|
||||
@0x/order-utils: ['packages/order-utils']
|
||||
@0x/assert: ['packages/assert']
|
||||
@0x/base-contract: ['packages/base-contract']
|
||||
|
36
.gitignore
vendored
36
.gitignore
vendored
@@ -40,9 +40,12 @@ build/Release
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# NVM config
|
||||
.nvmrc
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
.npmrc
|
||||
@@ -98,7 +101,6 @@ packages/sol-tracing-utils/test/fixtures/artifacts/
|
||||
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
||||
|
||||
# generated contract wrappers
|
||||
packages/abi-gen-wrappers/src/generated-wrappers/
|
||||
packages/python-contract-wrappers/generated/
|
||||
contracts/coordinator/generated-wrappers/
|
||||
contracts/exchange/generated-wrappers/
|
||||
@@ -114,16 +116,28 @@ contracts/exchange-forwarder/generated-wrappers/
|
||||
contracts/dev-utils/generated-wrappers/
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/exchange/__init__.py
|
||||
|
||||
# cli test output
|
||||
packages/abi-gen/test-cli/output
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/asset_proxy_owner/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/coordinator_registry/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc20_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dummy_erc721_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/dutch_auction/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc20_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/erc721_token/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/eth_balance_checker/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/forwarder/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_asset_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_validator/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/i_wallet/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/multi_asset_proxy/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/order_validator/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/weth9/__init__.py
|
||||
python-packages/contract_wrappers/src/zero_ex/contract_wrappers/zrx_token/__init__.py
|
||||
|
||||
# solc-bin in sol-compiler
|
||||
packages/sol-compiler/solc_bin/
|
||||
|
||||
# Monorepo scripts
|
||||
packages/*/scripts/
|
||||
|
||||
# python stuff
|
||||
.eggs
|
||||
.mypy_cache
|
||||
@@ -136,3 +150,9 @@ python-packages/*/.coverage
|
||||
|
||||
# python keeps package-local copies of json schemas
|
||||
python-packages/json_schemas/src/zero_ex/json_schemas/schemas
|
||||
|
||||
# Doc README copy
|
||||
packages/*/docs/README.md
|
||||
|
||||
# Tool MDX files authoritatively live on S3
|
||||
packages/website/mdx/tools/*
|
||||
|
@@ -38,3 +38,5 @@ packages/sol-coverage/test/fixtures/artifacts
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/AbiGenDummy.json
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/LibDummy.json
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/TestLibDummy.json
|
||||
packages/*/docs
|
||||
packages/website/mdx/tools
|
||||
|
@@ -55,7 +55,7 @@ If an entry without a `timestamp` already exists, this means other changes have
|
||||
|
||||
### Development Tooling
|
||||
|
||||
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in Typescript and it offers amazing support for the language.
|
||||
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in TypeScript and it offers amazing support for the language.
|
||||
|
||||
#### Linter
|
||||
|
||||
@@ -89,7 +89,7 @@ A few of our coding conventions are not yet enforced by the linter/auto-formatte
|
||||
1. Do not import from a project's `index.ts` (e.g import { Token } from '../src';). Always import from the source file itself.
|
||||
1. Generic error variables should be named `err` instead of `e` or `error`.
|
||||
1. If you _must_ cast a variable to any - try to type it back as fast as possible. (e.g., `const cw = ((zeroEx as any)._contractWrappers as ContractWrappers);`). This ensures subsequent code is type-safe.
|
||||
1. Our enum conventions coincide with the recommended Typescript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
|
||||
1. Our enum conventions coincide with the recommended TypeScript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'`
|
||||
1. All public, exported methods/functions/classes must have associated Javadoc-style comments.
|
||||
|
||||
### Fix `submit-coverage` CI failure
|
||||
|
23
README.md
23
README.md
@@ -6,21 +6,16 @@
|
||||
|
||||
This repository is a monorepo including the 0x protocol smart contracts and numerous developer tools. Each public sub-package is independently published to NPM.
|
||||
|
||||
If you're developing on 0x now or are interested in using 0x infrastructure in the future, please join our [developer mailing list][dev-mailing-list-url] for updates.
|
||||
|
||||
[website-url]: https://0xproject.com
|
||||
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
|
||||
[dev-mailing-list-url]: http://eepurl.com/dx4cPf
|
||||
[website-url]: https://0x.org
|
||||
|
||||
[](https://circleci.com/gh/0xProject/0x-monorepo)
|
||||
[](https://coveralls.io/github/0xProject/0x-monorepo?branch=development)
|
||||
[](https://chat.0xproject.com)
|
||||
[](https://gitter.im/0xProject/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://discordapp.com/invite/d3FTX3M)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
|
||||
## Packages
|
||||
|
||||
Visit our [developer portal](https://0xproject.com/docs/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
|
||||
Visit our [developer portal](https://0x.org/docs/tools/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
|
||||
|
||||
### Python Packages
|
||||
|
||||
@@ -28,6 +23,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
|
||||
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| [`0x-contract-addresses`](/python-packages/contract_addresses) | [](https://pypi.org/project/0x-contract-addresses/) | A tiny utility library for getting known deployed contract addresses for a particular network |
|
||||
| [`0x-contract-artifacts`](/python-packages/contract_artifacts) | [](https://pypi.org/project/0x-contract-artifacts/) | 0x smart contract compilation artifacts |
|
||||
| [`0x-contract-wrappers`](/python-packages/contract_wrappers) | [](https://pypi.org/project/0x-contract-wrappers/) | 0x smart contract wrappers |
|
||||
| [`0x-json-schemas`](/python-packages/json_schemas) | [](https://pypi.org/project/0x-json-schemas/) | 0x-related JSON schemas |
|
||||
| [`0x-order-utils`](/python-packages/order_utils) | [](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`0x-sra-client`](/python-packages/sra_client) | [](https://pypi.org/project/0x-sra-client/) | A Python client for interacting with servers conforming to the Standard Relayer API specification |
|
||||
@@ -47,12 +43,12 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
| [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [](https://www.npmjs.com/package/@0x/contracts-exchange-libs) | Protocol specific libraries used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract |
|
||||
| [`@0x/contracts-extensions`](/contracts/extensions) | [](https://www.npmjs.com/package/@0x/contracts-extensions) | Contracts that interact with and extend the functionality of the core protocol |
|
||||
| [`@0x/contracts-multisig`](/contracts/multisig) | [](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol |
|
||||
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts |
|
||||
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [](https://www.npmjs.com/package/@0x/contracts-test-utils) | TypeScript/Javascript shared utilities used for testing contracts |
|
||||
| [`@0x/contracts-utils`](/contracts/utils) | [](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts |
|
||||
| [`@0x/contracts-coordinator`](/contracts/coordinator) | [](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator |
|
||||
| [`@0x/contracts-dev-utils`](/contracts/dev-utils) | [](https://www.npmjs.com/package/@0x/contracts-dev-utils) | A contract contains utility functions for developers (such as validating many orders using a single eth_call) |
|
||||
|
||||
### Typescript/Javascript Packages
|
||||
### TypeScript/Javascript Packages
|
||||
|
||||
#### 0x-specific packages
|
||||
|
||||
@@ -62,8 +58,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
|
||||
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
|
||||
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
|
||||
| [`@0x/order-watcher`](/packages/order-watcher) | [](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas | |
|
||||
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
|
||||
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
||||
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
|
||||
@@ -109,7 +104,7 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
|
||||
## Usage
|
||||
|
||||
Node version >= 6.12 is required.
|
||||
Node version 6.x or 8.x is required.
|
||||
|
||||
Most of the packages require additional typings for external dependencies.
|
||||
You can include those by prepending the `@0x/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
|
||||
@@ -138,6 +133,8 @@ Then install dependencies
|
||||
yarn install
|
||||
```
|
||||
|
||||
You will also need to have Python 3 installed, in order to build and run the tests of `abi-gen`'s command-line interface, which is integrated with the yarn build, yarn test, and yarn lint commands described below. More specifically, your local pip should resolve to the Python 3 version of pip, not a Python 2.x version.
|
||||
|
||||
### Build
|
||||
|
||||
To build all packages:
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "2.2.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.2.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.2.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.7 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.6 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.5 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.4 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## AssetProxy
|
||||
|
||||
This package contains the implementations of all of the [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts available within the 0x protocol. These contracts are responsible for decoding the `assetData` sent to them and performing the actual transfer of assets. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains the implementations of all of the [`AssetProxy`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxy) contracts available within the 0x protocol. These contracts are responsible for decoding the `assetData` sent to them and performing the actual transfer of assets. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-asset-proxy --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "2.2.4",
|
||||
"version": "2.2.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,17 +69,17 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-erc1155": "^1.1.11",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/contracts-erc721": "^2.1.11",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-erc1155": "^1.1.14",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-erc721": "^2.1.14",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "2.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.9",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.12 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.11 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.10 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.9 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## Coordinator
|
||||
|
||||
This package contains a contract that allows users to call arbitrary functions on the Exchange contract with permission from one or more Coordinators. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains a contract that allows users to call arbitrary functions on the Exchange contract with permission from one or more Coordinators. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-coordinator --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "2.0.9",
|
||||
"version": "2.0.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,18 +69,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^2.2.4",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/contracts-exchange": "^2.1.10",
|
||||
"@0x/contracts-exchange-libs": "^3.0.4",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-asset-proxy": "^2.2.7",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-exchange": "^2.1.13",
|
||||
"@0x/contracts-exchange-libs": "^3.0.7",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "0.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "0.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "0.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1564607468,
|
||||
"version": "0.0.6",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.9 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.8 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.7 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.6 - _July 31, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## Dev-Utils
|
||||
|
||||
This package implements various utilities for developers. For example, the `DevUtils` contract can query batches of balances or allowances given some `assetData`, can validate batches of orders, and can decode 0x-specific calldata. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package implements various utilities for developers. For example, the `DevUtils` contract can query batches of balances or allowances given some `assetData`, can validate batches of orders, and can decode 0x-specific calldata. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-dev-utils --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-dev-utils",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.9",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,12 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contract-wrappers": "^10.1.0",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -70,20 +69,20 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^2.2.4",
|
||||
"@0x/contracts-erc1155": "^1.1.11",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/contracts-erc721": "^2.1.11",
|
||||
"@0x/contracts-exchange": "^2.1.10",
|
||||
"@0x/contracts-exchange-libs": "^3.0.4",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-asset-proxy": "^2.2.7",
|
||||
"@0x/contracts-erc1155": "^1.1.14",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-erc721": "^2.1.14",
|
||||
"@0x/contracts-exchange": "^2.1.13",
|
||||
"@0x/contracts-exchange-libs": "^3.0.7",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethereumjs-util": "^5.1.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "1.1.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "1.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "1.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.11",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.14 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.13 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.12 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.11 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## ERC1155 Tokens
|
||||
|
||||
This package contains implementations of various [ERC1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md) tokens. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains implementations of various [ERC1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md) tokens. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-erc1155 --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "1.1.11",
|
||||
"version": "1.1.14",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,10 +47,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -68,14 +68,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "2.2.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.2.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.2.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.10",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.2.13 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.12 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.11 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.10 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## ERC20 Tokens
|
||||
|
||||
This package contains implementations of various [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) tokens, including WETH (Wrapped Ether) and ZRX. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains implementations of various [ERC20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) tokens, including WETH (Wrapped Ether) and ZRX. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-erc20 --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "2.2.10",
|
||||
"version": "2.2.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,13 +69,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "2.1.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.11",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.14 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.13 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.12 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.11 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## ERC721 Tokens
|
||||
|
||||
This package contains implementations of various [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) tokens. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains implementations of various [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) tokens. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-erc721 --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "2.1.11",
|
||||
"version": "2.1.14",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,13 +69,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "3.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.8",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.11 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.10 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.9 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.8 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## Exchange Forwarder
|
||||
|
||||
This package contains the implementation of the [`Forwarder`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md) contract. This contract is intended to improve the UX of interacting with the 0x [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract by abstracting user approvals, converting ETH to WETH, and paying fees. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains the implementation of the [`Forwarder`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md) contract. This contract is intended to improve the UX of interacting with the 0x [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract by abstracting user approvals, converting ETH to WETH, and paying fees. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-exchange-forwarder --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "3.0.8",
|
||||
"version": "3.0.11",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||
@@ -46,12 +46,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contract-wrappers": "^10.1.0",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,19 +68,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^2.2.4",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/contracts-erc721": "^2.1.11",
|
||||
"@0x/contracts-exchange": "^2.1.10",
|
||||
"@0x/contracts-exchange-libs": "^3.0.4",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-asset-proxy": "^2.2.7",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-erc721": "^2.1.14",
|
||||
"@0x/contracts-exchange": "^2.1.13",
|
||||
"@0x/contracts-exchange-libs": "^3.0.7",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "3.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.7 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.6 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.5 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.4 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## Exchange Libraries
|
||||
|
||||
This package contains the implementations of various libraries and utilities used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract. These libraries may be useful when creating external contracts that interact with the `Exchange` contract. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains the implementations of various libraries and utilities used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract. These libraries may be useful when creating external contracts that interact with the `Exchange` contract. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "3.0.4",
|
||||
"version": "3.0.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,14 +69,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "2.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "2.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "2.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.10",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.13 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.12 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.11 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.10 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## Exchange
|
||||
|
||||
This package contains the implementation of the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange). This contract is responsible for settling trades and is typically the entry point for all transactions that interact with the 0x protocol. Lightweight examples of how external contracts can interct with the `Exchange` contract can be found in the [examples](./contracts/examples) directory. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains the implementation of the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange). This contract is responsible for settling trades and is typically the entry point for all transactions that interact with the 0x protocol. Lightweight examples of how external contracts can interct with the `Exchange` contract can be found in the [examples](./contracts/examples) directory. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-exchange --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -39,7 +39,7 @@ contract Validator is
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of signature.
|
||||
/// @return Returns a known magic value if the signature is valid.
|
||||
// solhint-disable no-unused-vars
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
@@ -48,9 +48,11 @@ contract Validator is
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
return (signerAddress == VALID_SIGNER);
|
||||
require(signerAddress == VALID_SIGNER, "INVALID_SIGNER");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
// solhint-enable no-unused-vars
|
||||
}
|
||||
|
@@ -41,14 +41,14 @@ contract Wallet is
|
||||
/// The signer must match the owner of this wallet.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param eip712Signature Proof of signing.
|
||||
/// @return Validity of signature.
|
||||
/// @return Returns a known magic value if the signature is valid.
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
bytes calldata eip712Signature
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
require(
|
||||
eip712Signature.length == 65,
|
||||
@@ -59,7 +59,8 @@ contract Wallet is
|
||||
bytes32 r = eip712Signature.readBytes32(1);
|
||||
bytes32 s = eip712Signature.readBytes32(33);
|
||||
address recoveredAddress = ecrecover(hash, v, r, s);
|
||||
isValid = WALLET_OWNER == recoveredAddress;
|
||||
return isValid;
|
||||
require(WALLET_OWNER == recoveredAddress, "INVALID_SIGNATURE");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
}
|
||||
|
@@ -73,10 +73,12 @@ contract Whitelist is
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid)
|
||||
returns (bytes4)
|
||||
{
|
||||
// solhint-disable-next-line avoid-tx-origin
|
||||
return signerAddress == tx.origin;
|
||||
require(signerAddress == tx.origin, "INVALID_SIGNER");
|
||||
bytes4 magicValue = bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"));
|
||||
return magicValue;
|
||||
}
|
||||
// solhint-enable no-unused-vars
|
||||
|
||||
|
@@ -224,7 +224,8 @@ contract MixinSignatureValidator is
|
||||
revert("SIGNATURE_UNSUPPORTED");
|
||||
}
|
||||
|
||||
/// @dev Verifies signature using logic defined by Wallet contract.
|
||||
/// @dev Verifies signature using logic defined by Wallet contract. Wallet contract
|
||||
/// must return `bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))`
|
||||
/// @param hash Any 32 byte hash.
|
||||
/// @param walletAddress Address that should have signed the given hash
|
||||
/// and defines its own signature verification method.
|
||||
@@ -244,7 +245,19 @@ contract MixinSignatureValidator is
|
||||
hash,
|
||||
signature
|
||||
);
|
||||
// bytes4 0xb0671381
|
||||
bytes32 magicValue = bytes32(bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)")));
|
||||
assembly {
|
||||
// extcodesize added as an extra safety measure
|
||||
if iszero(extcodesize(walletAddress)) {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
let cdStart := add(callData, 32)
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
@@ -255,6 +268,15 @@ contract MixinSignatureValidator is
|
||||
32 // output size is 32 bytes
|
||||
)
|
||||
|
||||
if iszero(eq(returndatasize(), 32)) {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000c57414c4c45545f4552524f5200000000000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
switch success
|
||||
case 0 {
|
||||
// Revert with `Error("WALLET_ERROR")`
|
||||
@@ -266,13 +288,17 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
case 1 {
|
||||
// Signature is valid if call did not revert and returned true
|
||||
isValid := mload(cdStart)
|
||||
isValid := eq(
|
||||
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
|
||||
/// @dev Verifies signature using logic defined by Validator contract.
|
||||
/// Validator must return `bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))`
|
||||
/// @param validatorAddress Address of validator contract.
|
||||
/// @param hash Any 32 byte hash.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
@@ -294,7 +320,19 @@ contract MixinSignatureValidator is
|
||||
signerAddress,
|
||||
signature
|
||||
);
|
||||
// bytes4 0x42b38674
|
||||
bytes32 magicValue = bytes32(bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)")));
|
||||
assembly {
|
||||
// extcodesize added as an extra safety measure
|
||||
if iszero(extcodesize(validatorAddress)) {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
let cdStart := add(callData, 32)
|
||||
let success := staticcall(
|
||||
gas, // forward all gas
|
||||
@@ -305,6 +343,15 @@ contract MixinSignatureValidator is
|
||||
32 // output size is 32 bytes
|
||||
)
|
||||
|
||||
if iszero(eq(returndatasize(), 32)) {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
|
||||
mstore(64, 0x0000000f56414c494441544f525f4552524f5200000000000000000000000000)
|
||||
mstore(96, 0)
|
||||
revert(0, 100)
|
||||
}
|
||||
|
||||
switch success
|
||||
case 0 {
|
||||
// Revert with `Error("VALIDATOR_ERROR")`
|
||||
@@ -316,7 +363,10 @@ contract MixinSignatureValidator is
|
||||
}
|
||||
case 1 {
|
||||
// Signature is valid if call did not revert and returned true
|
||||
isValid := mload(cdStart)
|
||||
isValid := eq(
|
||||
and(mload(cdStart), 0xffffffff00000000000000000000000000000000000000000000000000000000),
|
||||
and(magicValue, 0xffffffff00000000000000000000000000000000000000000000000000000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
|
@@ -25,7 +25,8 @@ contract IValidator {
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signerAddress Address that should have signed the given hash.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of order signature.
|
||||
/// @return Magic bytes4 value if the signature is valid.
|
||||
/// Magic value is bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
address signerAddress,
|
||||
@@ -33,5 +34,5 @@ contract IValidator {
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid);
|
||||
returns (bytes4);
|
||||
}
|
||||
|
@@ -24,12 +24,13 @@ contract IWallet {
|
||||
/// @dev Verifies that a signature is valid.
|
||||
/// @param hash Message hash that is signed.
|
||||
/// @param signature Proof of signing.
|
||||
/// @return Validity of order signature.
|
||||
/// @return Magic bytes4 value if the signature is valid.
|
||||
/// Magic value is bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))
|
||||
function isValidSignature(
|
||||
bytes32 hash,
|
||||
bytes calldata signature
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (bool isValid);
|
||||
returns (bytes4);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "2.1.10",
|
||||
"version": "2.1.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,19 +69,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^2.2.4",
|
||||
"@0x/contracts-erc1155": "^1.1.11",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/contracts-erc721": "^2.1.11",
|
||||
"@0x/contracts-exchange-libs": "^3.0.4",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-asset-proxy": "^2.2.7",
|
||||
"@0x/contracts-erc1155": "^1.1.14",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-erc721": "^2.1.14",
|
||||
"@0x/contracts-exchange-libs": "^3.0.7",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -100,6 +100,12 @@ describe('MixinSignatureValidator', () => {
|
||||
),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await signatureValidator.setSignatureValidatorApproval.sendTransactionAsync(testValidator.address, true, {
|
||||
from: notSignerAddress,
|
||||
}),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
const defaultOrderParams = {
|
||||
...constants.STATIC_ORDER_PARAMS,
|
||||
@@ -307,7 +313,7 @@ describe('MixinSignatureValidator', () => {
|
||||
expect(isValidSignature).to.be.true();
|
||||
});
|
||||
|
||||
it('should return false when SignatureType=Wallet and signature is invalid', async () => {
|
||||
it('should revert when SignatureType=Wallet and signature is invalid', async () => {
|
||||
// Create EIP712 signature using a private key that does not belong to the wallet owner.
|
||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
const orderHashBuffer = ethUtil.toBuffer(orderHashHex);
|
||||
@@ -322,12 +328,10 @@ describe('MixinSignatureValidator', () => {
|
||||
]);
|
||||
const signatureHex = ethUtil.bufferToHex(signature);
|
||||
// Validate signature
|
||||
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
|
||||
orderHashHex,
|
||||
testWallet.address,
|
||||
signatureHex,
|
||||
return expectContractCallFailedAsync(
|
||||
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, testWallet.address, signatureHex),
|
||||
RevertReason.WalletError,
|
||||
);
|
||||
expect(isValidSignature).to.be.false();
|
||||
});
|
||||
|
||||
it('should revert when `isValidSignature` attempts to update state and SignatureType=Wallet', async () => {
|
||||
@@ -365,6 +369,15 @@ describe('MixinSignatureValidator', () => {
|
||||
signatureHex,
|
||||
);
|
||||
expect(isValidSignature).to.be.true();
|
||||
|
||||
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
orderHashHex,
|
||||
signatureHex,
|
||||
signerAddress,
|
||||
signatureValidator.address,
|
||||
);
|
||||
expect(isValidSignatureTs).to.be.true();
|
||||
});
|
||||
|
||||
it('should return false when SignatureType=Validator, signature is invalid and validator is approved', async () => {
|
||||
@@ -375,12 +388,19 @@ describe('MixinSignatureValidator', () => {
|
||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||
// This will return false because we signed the message with `signerAddress`, but
|
||||
// are validating against `notSignerAddress`
|
||||
const isValidSignature = await signatureValidator.publicIsValidSignature.callAsync(
|
||||
orderHashHex,
|
||||
notSignerAddress,
|
||||
signatureHex,
|
||||
await expectContractCallFailedAsync(
|
||||
signatureValidator.publicIsValidSignature.callAsync(orderHashHex, notSignerAddress, signatureHex),
|
||||
RevertReason.ValidatorError,
|
||||
);
|
||||
expect(isValidSignature).to.be.false();
|
||||
|
||||
const isValidSignatureTs = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
orderHashHex,
|
||||
signatureHex,
|
||||
notSignerAddress,
|
||||
signatureValidator.address,
|
||||
);
|
||||
expect(isValidSignatureTs).to.be.false();
|
||||
});
|
||||
|
||||
it('should revert when `isValidSignature` attempts to update state and SignatureType=Validator', async () => {
|
||||
@@ -416,6 +436,16 @@ describe('MixinSignatureValidator', () => {
|
||||
signatureHex,
|
||||
);
|
||||
expect(isValidSignature).to.be.false();
|
||||
|
||||
expect(
|
||||
signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
orderHashHex,
|
||||
signatureHex,
|
||||
signerAddress,
|
||||
signatureValidator.address,
|
||||
),
|
||||
).to.be.rejected();
|
||||
});
|
||||
|
||||
it('should return true when SignatureType=Presigned and signer has presigned hash', async () => {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "4.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "4.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "4.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.4",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.7 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.6 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.5 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.4 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## Extensions
|
||||
|
||||
This package implements various extensions to the 0x protocol. Extension contracts can add various rules around how orders are settled while still getting the interoperability and security benefits of using the underlying 0x protocol contracts. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package implements various extensions to the 0x protocol. Extension contracts can add various rules around how orders are settled while still getting the interoperability and security benefits of using the underlying 0x protocol contracts. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -12,7 +12,7 @@ npm install @0x/contracts-extensions --save
|
||||
|
||||
## Bug bounty
|
||||
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0xproject.com/wiki#Bug-Bounty).
|
||||
A bug bounty for the 2.0.0 contracts is ongoing! Instructions can be found [here](https://0x.org/docs/guides/bug-bounty-program).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "4.0.4",
|
||||
"version": "4.0.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,12 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contract-wrappers": "^10.1.0",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -70,19 +69,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^2.2.4",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/contracts-erc721": "^2.1.11",
|
||||
"@0x/contracts-exchange": "^2.1.10",
|
||||
"@0x/contracts-exchange-libs": "^3.0.4",
|
||||
"@0x/contracts-utils": "^3.2.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-asset-proxy": "^2.2.7",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-erc721": "^2.1.14",
|
||||
"@0x/contracts-exchange": "^2.1.13",
|
||||
"@0x/contracts-exchange-libs": "^3.0.7",
|
||||
"@0x/contracts-utils": "^3.2.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { DutchAuctionWrapper } from '@0x/contract-wrappers';
|
||||
import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
|
||||
import { DummyERC20TokenContract } from '@0x/contracts-erc20';
|
||||
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||
@@ -151,7 +150,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
feeRecipientAddress,
|
||||
// taker address or sender address should be set to the ducth auction contract
|
||||
takerAddress: dutchAuctionContract.address,
|
||||
makerAssetData: DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
makerAssetData: assetDataUtils.encodeDutchAuctionAssetData(
|
||||
assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress),
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -193,7 +192,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
describe('matchOrders', () => {
|
||||
it('should be worth the begin price at the begining of the auction', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp + 2);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -207,7 +206,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
it('should be be worth the end price at the end of the auction', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
||||
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -273,7 +272,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
it('should revert when auction expires', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds * 2);
|
||||
auctionEndTimeSeconds = new BigNumber(currentBlockTimestamp - tenMinutesInSeconds);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -307,7 +306,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
});
|
||||
it('begin time is less than end time', async () => {
|
||||
auctionBeginTimeSeconds = new BigNumber(auctionEndTimeSeconds).plus(tenMinutesInSeconds);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
defaultERC20MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
@@ -335,7 +334,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
it('should match orders when ERC721', async () => {
|
||||
const makerAssetId = erc721MakerAssetIds[0];
|
||||
const erc721MakerAssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, makerAssetId);
|
||||
const makerAssetData = DutchAuctionWrapper.encodeDutchAuctionAssetData(
|
||||
const makerAssetData = assetDataUtils.encodeDutchAuctionAssetData(
|
||||
erc721MakerAssetData,
|
||||
auctionBeginTimeSeconds,
|
||||
auctionBeginAmount,
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "3.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.1.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.1.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.10",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.13 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.12 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.11 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.10 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## MultiSignature Contracts
|
||||
|
||||
This package contains various types of multisignature wallet contracts, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that is responsible for upgrading the 0x protocol smart contracts. Addresses of the deployed contracts can be found in the 0x [wiki](https://0xproject.com/wiki#Deployed-Addresses) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
This package contains various types of multisignature wallet contracts, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that is responsible for upgrading the 0x protocol smart contracts. Addresses of the deployed contracts can be found in this 0x [guide](https://0x.org/docs/guides/0x-cheat-sheet) or the [DEPLOYS](./DEPLOYS.json) file within this package.
|
||||
|
||||
## Installation
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "3.1.10",
|
||||
"version": "3.1.13",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../packages/abi-gen-templates/contract.handlebars --partials '../../packages/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -69,15 +69,15 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^2.2.4",
|
||||
"@0x/contracts-erc20": "^2.2.10",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contracts-asset-proxy": "^2.2.7",
|
||||
"@0x/contracts-erc20": "^2.2.13",
|
||||
"@0x/contracts-utils": "2.0.1",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "3.1.15",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.1.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.1.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1564604963,
|
||||
"version": "3.1.12",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.15 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.14 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.13 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.12 - _July 31, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "3.1.12",
|
||||
"version": "3.1.15",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,18 +42,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/sol-coverage": "^3.0.8",
|
||||
"@0x/sol-profiler": "^3.1.10",
|
||||
"@0x/sol-trace": "^2.0.16",
|
||||
"@0x/subproviders": "^5.0.0",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/sol-coverage": "^3.0.11",
|
||||
"@0x/sol-profiler": "^3.1.13",
|
||||
"@0x/sol-trace": "^2.0.19",
|
||||
"@0x/subproviders": "^5.0.3",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -63,7 +63,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethers": "~4.0.4",
|
||||
"js-combinatorics": "^0.5.3",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "3.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1566446343,
|
||||
"version": "3.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "3.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.2.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.2.3 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.2 - _August 22, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.1 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.0 - _July 31, 2019_
|
||||
|
||||
* Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies. (#1995)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "3.2.0",
|
||||
"version": "3.2.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"compile": "sol-compiler",
|
||||
"watch": "sol-compiler -w",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
@@ -47,11 +47,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/contracts-gen": "^1.0.12",
|
||||
"@0x/contracts-test-utils": "^3.1.12",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/sol-compiler": "^3.1.11",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/contracts-gen": "^1.0.14",
|
||||
"@0x/contracts-test-utils": "^3.1.15",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/sol-compiler": "^3.1.14",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -70,14 +70,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
21
package.json
21
package.json
@@ -25,9 +25,9 @@
|
||||
"install:all": "yarn install",
|
||||
"wsrun": "wsrun",
|
||||
"lerna": "lerna",
|
||||
"build": "lerna link && wsrun build $PKG --fast-exit -r --stages --exclude @0x/pipeline --exclude-missing",
|
||||
"build:no_website": "lerna link && wsrun build $PKG --fast-exit -r --stages --exclude @0x/website --exclude @0x/pipeline --exclude-missing",
|
||||
"build:ci:no_website": "lerna link && wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website --exclude @0x/pipeline --exclude-missing",
|
||||
"build": "lerna link && wsrun build $PKG --fast-exit -r --stages --exclude-missing",
|
||||
"build:no_website": "lerna link && wsrun build $PKG --fast-exit -r --stages --exclude @0x/website --exclude-missing",
|
||||
"build:ci:no_website": "lerna link && wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website --exclude-missing",
|
||||
"build:contracts": "lerna link && wsrun build -p ${npm_package_config_contractsPackages} -c --fast-exit -r --stages --exclude-missing",
|
||||
"build:monorepo_scripts": "PKG=@0x/monorepo-scripts yarn build",
|
||||
"build:ts": "tsc -b",
|
||||
@@ -42,17 +42,19 @@
|
||||
"rebuild:no_website": "run-s clean build:no_website",
|
||||
"test": "wsrun test $PKG --fast-exit --serial --exclude-missing",
|
||||
"test:contracts": "wsrun test -p ${npm_package_config_contractsPackages} -c --fast-exit --serial --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;",
|
||||
"generate_doc": "node ./packages/monorepo-scripts/lib/doc_generate.js",
|
||||
"upload_md_docs": "wsrun s3:sync_md_docs --exclude-missing",
|
||||
"diff_md_docs:ci": "wsrun diff_docs --exclude-missing",
|
||||
"test:generate_docs:circleci": "for i in ${npm_package_config_packagesWithDocPages}; do yarn generate_doc --package $i || break -1; done;",
|
||||
"bundlewatch": "bundlewatch",
|
||||
"lint": "wsrun lint $PKG --fast-exit --parallel --exclude-missing"
|
||||
},
|
||||
"config": {
|
||||
"contractsPackages": "@0x/contracts-asset-proxy @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-exchange-libs @0x/contracts-extensions @0x/contracts-multisig @0x/contracts-test-utils @0x/contracts-utils @0x/contracts-coordinator @0x/contracts-dev-utils",
|
||||
"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-coverage sol-profiler sol-trace ethereum-types asset-buyer migrations",
|
||||
"packagesWithDocPages": "contract-wrappers 0x.js connect json-schemas subproviders web3-wrapper order-utils sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-buyer asset-swapper migrations",
|
||||
"ignoreDependencyVersions": "@types/styled-components @types/node",
|
||||
"ignoreDependencyVersionsForPackage": "website instant dev-tools-pages"
|
||||
"ignoreDependencyVersionsForPackage": "website instant dev-tools-pages contract-wrappers"
|
||||
},
|
||||
"bundlewatch": {
|
||||
"files": [
|
||||
@@ -73,11 +75,8 @@
|
||||
"repoBranchBase": "development"
|
||||
}
|
||||
},
|
||||
"resolutions": {
|
||||
"graceful-fs": "4.1.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x-lerna-fork/lerna": "3.16.9",
|
||||
"@0x-lerna-fork/lerna": "3.16.10",
|
||||
"@0xproject/npm-cli-login": "^0.0.11",
|
||||
"async-child-process": "^1.1.1",
|
||||
"bundlewatch": "^0.2.1",
|
||||
|
@@ -1,4 +1,39 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "7.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "7.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add optional `exchangeAddress` parameter to `signatureUtils.isValidSignatureAsync` to fix `Validator` type signatures.",
|
||||
"pr": 2017
|
||||
},
|
||||
{
|
||||
"note": "Removed @0x/order-watcher"
|
||||
},
|
||||
{
|
||||
"note": "Update to latest @0x/contract-wrappers v11",
|
||||
"pr": 2068
|
||||
}
|
||||
],
|
||||
"timestamp": 1566446343
|
||||
},
|
||||
{
|
||||
"timestamp": 1565296576,
|
||||
"version": "6.0.15",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1564604963,
|
||||
"version": "6.0.14",
|
||||
|
@@ -5,6 +5,20 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v7.0.1 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v7.0.0 - _August 22, 2019_
|
||||
|
||||
* Add optional `exchangeAddress` parameter to `signatureUtils.isValidSignatureAsync` to fix `Validator` type signatures. (#2017)
|
||||
* Removed @0x/order-watcher
|
||||
* Update to latest @0x/contract-wrappers v11 (#2068)
|
||||
|
||||
## v6.0.15 - _August 8, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.0.14 - _July 31, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,8 +1,8 @@
|
||||
## 0x.js
|
||||
|
||||
A TypeScript/Javascript library for interacting with the 0x protocol. It is a high level package which combines a number of underlying packages such as order-utils and order-watcher.
|
||||
A TypeScript/Javascript library for interacting with the 0x protocol. It is a high level package which combines a number of underlying packages such as order-utils and asset-data-utils.
|
||||
|
||||
### Read the [Documentation](https://0xproject.com/docs/0x.js).
|
||||
### Read the [Documentation](https://0x.org/docs/tools/0x.js).
|
||||
|
||||
## Installation
|
||||
|
||||
|
29397
packages/0x.js/docs/reference.mdx
Normal file
29397
packages/0x.js/docs/reference.mdx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "6.0.14",
|
||||
"version": "7.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -27,7 +27,10 @@
|
||||
"clean": "shx rm -rf _bundles lib test_temp src/generated_contract_wrappers generated_docs",
|
||||
"build:umd:prod": "NODE_ENV=production node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production",
|
||||
"build:commonjs": "tsc -b",
|
||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
|
||||
"diff_docs": "git diff --exit-code ./docs",
|
||||
"s3:sync_md_docs": "aws s3 sync ./docs s3://docs-markdown/${npm_package_name}/v${npm_package_version} --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
|
||||
"docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json",
|
||||
"docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
|
||||
},
|
||||
"config": {
|
||||
"postpublish": {
|
||||
@@ -43,10 +46,10 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen-wrappers": "^5.1.0",
|
||||
"@0x/contract-addresses": "^3.0.2",
|
||||
"@0x/dev-utils": "^2.2.6",
|
||||
"@0x/migrations": "^4.1.11",
|
||||
"@0x/contract-addresses": "^3.1.0",
|
||||
"@0x/dev-utils": "^2.3.2",
|
||||
"@0x/migrations": "^4.3.1",
|
||||
"@0x/ts-doc-gen": "^0.0.21",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -67,25 +70,25 @@
|
||||
"sinon": "^4.0.0",
|
||||
"source-map-support": "^0.5.0",
|
||||
"tslint": "5.11.0",
|
||||
"typedoc": "0.13.0",
|
||||
"typedoc": "^0.15.0",
|
||||
"typescript": "3.0.1",
|
||||
"uglifyjs-webpack-plugin": "^2.0.1",
|
||||
"webpack": "^4.20.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.1.2",
|
||||
"@0x/asset-swapper": "^1.0.0",
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contract-wrappers": "^10.1.0",
|
||||
"@0x/order-utils": "^8.2.4",
|
||||
"@0x/order-watcher": "^4.0.16",
|
||||
"@0x/subproviders": "^5.0.0",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/typescript-typings": "^4.2.4",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"@0x/abi-gen-wrappers": "^5.3.1",
|
||||
"@0x/assert": "^2.1.5",
|
||||
"@0x/asset-swapper": "^1.0.3",
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contract-wrappers": "^12.0.0",
|
||||
"@0x/order-utils": "^8.3.1",
|
||||
"@0x/subproviders": "^5.0.3",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/typescript-typings": "^4.2.5",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"web3-provider-engine": "14.0.6"
|
||||
|
@@ -13,59 +13,87 @@ export {
|
||||
CoordinatorWrapper,
|
||||
CoordinatorServerCancellationResponse,
|
||||
CoordinatorServerError,
|
||||
DutchAuctionWrapper,
|
||||
ERC20TokenWrapper,
|
||||
ERC721TokenWrapper,
|
||||
EtherTokenWrapper,
|
||||
ExchangeWrapper,
|
||||
ERC20ProxyWrapper,
|
||||
ERC721ProxyWrapper,
|
||||
ForwarderWrapper,
|
||||
OrderValidatorWrapper,
|
||||
IndexedFilterValues,
|
||||
BlockRange,
|
||||
ContractWrappersConfig,
|
||||
MethodOpts,
|
||||
OrderTransactionOpts,
|
||||
TransactionOpts,
|
||||
OrderStatus,
|
||||
OrderInfo,
|
||||
EventCallback,
|
||||
DecodedLogEvent,
|
||||
TransactionEncoder,
|
||||
BalanceAndAllowance,
|
||||
OrderAndTraderInfo,
|
||||
TraderInfo,
|
||||
ValidateOrderFillableOpts,
|
||||
OrderStatus,
|
||||
} from '@0x/contract-wrappers';
|
||||
|
||||
export {
|
||||
WETH9Events,
|
||||
WETH9WithdrawalEventArgs,
|
||||
WETH9ApprovalEventArgs,
|
||||
WETH9EventArgs,
|
||||
WETH9DepositEventArgs,
|
||||
WETH9TransferEventArgs,
|
||||
ERC20TokenTransferEventArgs,
|
||||
ERC20TokenApprovalEventArgs,
|
||||
ERC20TokenEvents,
|
||||
ERC20TokenEventArgs,
|
||||
ERC721TokenApprovalEventArgs,
|
||||
ERC721TokenApprovalForAllEventArgs,
|
||||
ERC721TokenTransferEventArgs,
|
||||
ERC721TokenEvents,
|
||||
ERC721TokenEventArgs,
|
||||
ExchangeCancelUpToEventArgs,
|
||||
ExchangeAssetProxyRegisteredEventArgs,
|
||||
ExchangeEventArgs,
|
||||
ExchangeEvents,
|
||||
ExchangeSignatureValidatorApprovalEventArgs,
|
||||
ExchangeFillEventArgs,
|
||||
ExchangeCancelEventArgs,
|
||||
ExchangeEventArgs,
|
||||
ExchangeEvents,
|
||||
ExchangeCancelUpToEventArgs,
|
||||
ExchangeAssetProxyRegisteredEventArgs,
|
||||
ExchangeContract,
|
||||
DevUtilsContract,
|
||||
ForwarderContract,
|
||||
DutchAuctionContract,
|
||||
CoordinatorContract,
|
||||
CoordinatorRegistryEventArgs,
|
||||
CoordinatorRegistryEvents,
|
||||
CoordinatorRegistryCoordinatorEndpointSetEventArgs,
|
||||
CoordinatorRegistryContract,
|
||||
IValidatorContract,
|
||||
IWalletContract,
|
||||
WETH9EventArgs,
|
||||
WETH9Events,
|
||||
WETH9ApprovalEventArgs,
|
||||
WETH9TransferEventArgs,
|
||||
WETH9DepositEventArgs,
|
||||
WETH9WithdrawalEventArgs,
|
||||
WETH9Contract,
|
||||
ERC20TokenEventArgs,
|
||||
ERC20TokenEvents,
|
||||
ERC20TokenTransferEventArgs,
|
||||
ERC20TokenApprovalEventArgs,
|
||||
ERC20TokenContract,
|
||||
ERC721TokenEventArgs,
|
||||
ERC721TokenEvents,
|
||||
ERC721TokenTransferEventArgs,
|
||||
ERC721TokenApprovalEventArgs,
|
||||
ERC721TokenApprovalForAllEventArgs,
|
||||
ERC721TokenContract,
|
||||
ERC1155ProxyEventArgs,
|
||||
ERC1155ProxyEvents,
|
||||
ERC1155ProxyAuthorizedAddressAddedEventArgs,
|
||||
ERC1155ProxyAuthorizedAddressRemovedEventArgs,
|
||||
ERC1155ProxyContract,
|
||||
ZRXTokenEventArgs,
|
||||
ZRXTokenEvents,
|
||||
ZRXTokenTransferEventArgs,
|
||||
ZRXTokenApprovalEventArgs,
|
||||
ZRXTokenContract,
|
||||
DummyERC20TokenEventArgs,
|
||||
DummyERC20TokenEvents,
|
||||
DummyERC20TokenTransferEventArgs,
|
||||
DummyERC20TokenApprovalEventArgs,
|
||||
DummyERC20TokenContract,
|
||||
DummyERC721TokenEventArgs,
|
||||
DummyERC721TokenEvents,
|
||||
DummyERC721TokenTransferEventArgs,
|
||||
DummyERC721TokenApprovalEventArgs,
|
||||
DummyERC721TokenApprovalForAllEventArgs,
|
||||
DummyERC721TokenContract,
|
||||
ERC20ProxyEventArgs,
|
||||
ERC20ProxyEvents,
|
||||
ERC20ProxyContract,
|
||||
ERC20ProxyAuthorizedAddressAddedEventArgs,
|
||||
ERC20ProxyAuthorizedAddressRemovedEventArgs,
|
||||
ERC721ProxyEventArgs,
|
||||
ERC721ProxyEvents,
|
||||
ERC721ProxyAuthorizedAddressAddedEventArgs,
|
||||
ERC721ProxyAuthorizedAddressRemovedEventArgs,
|
||||
ERC721ProxyContract,
|
||||
OrderValidatorContract,
|
||||
} from '@0x/abi-gen-wrappers';
|
||||
|
||||
export { OrderWatcher, OnOrderStateChangeCallback, OrderWatcherConfig } from '@0x/order-watcher';
|
||||
|
||||
export import Web3ProviderEngine = require('web3-provider-engine');
|
||||
|
||||
export {
|
||||
@@ -76,19 +104,13 @@ export {
|
||||
MetamaskSubprovider,
|
||||
} from '@0x/subproviders';
|
||||
|
||||
export { AbiDecoder, DecodedCalldata } from '@0x/utils';
|
||||
|
||||
export { BigNumber } from '@0x/utils';
|
||||
export { AbiDecoder, DecodedCalldata, BigNumber } from '@0x/utils';
|
||||
|
||||
export {
|
||||
ExchangeContractErrs,
|
||||
Order,
|
||||
SignedOrder,
|
||||
DutchAuctionData,
|
||||
ECSignature,
|
||||
OrderStateValid,
|
||||
OrderStateInvalid,
|
||||
OrderState,
|
||||
AssetProxyId,
|
||||
AssetData,
|
||||
SingleAssetData,
|
||||
@@ -99,18 +121,18 @@ export {
|
||||
MultiAssetDataWithRecursiveDecoding,
|
||||
StaticCallAssetData,
|
||||
SignatureType,
|
||||
ObjectMap,
|
||||
OrderRelevantState,
|
||||
Stats,
|
||||
DutchAuctionDetails,
|
||||
ZeroExTransaction,
|
||||
SignedZeroExTransaction,
|
||||
ValidatorSignature,
|
||||
SimpleContractArtifact,
|
||||
SimpleStandardContractOutput,
|
||||
SimpleEvmOutput,
|
||||
SimpleEvmBytecodeOutput,
|
||||
} from '@0x/types';
|
||||
|
||||
export {
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
ContractAbi,
|
||||
BlockParam,
|
||||
LogWithDecodedArgs,
|
||||
ContractEventArg,
|
||||
SupportedProvider,
|
||||
@@ -143,4 +165,22 @@ export {
|
||||
Web3JsV1Provider,
|
||||
Web3JsV2Provider,
|
||||
Web3JsV3Provider,
|
||||
TxData,
|
||||
ContractArtifact,
|
||||
CallData,
|
||||
BlockParam,
|
||||
CompilerOpts,
|
||||
StandardContractOutput,
|
||||
ContractNetworks,
|
||||
TxDataPayable,
|
||||
BlockParamLiteral,
|
||||
CompilerSettings,
|
||||
ContractNetworkData,
|
||||
DevdocOutput,
|
||||
EvmOutput,
|
||||
CompilerSettingsMetadata,
|
||||
OptimizerSettings,
|
||||
OutputField,
|
||||
ParamDescription,
|
||||
EvmBytecodeOutput,
|
||||
} from 'ethereum-types';
|
||||
|
@@ -1,130 +0,0 @@
|
||||
[
|
||||
{
|
||||
"version": "2.4.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated interface to `deployFrom0xArtifactAsync` to include log decode dependencies.",
|
||||
"pr": 1995
|
||||
},
|
||||
{
|
||||
"note": "Updated interface to `deployAsync` to include log decode dependencies.",
|
||||
"pr": 1995
|
||||
}
|
||||
],
|
||||
"timestamp": 1564604963
|
||||
},
|
||||
{
|
||||
"version": "2.3.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Python: fix broken event handling",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python: custom validator class support",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python: linter fixes",
|
||||
"pr": 1919
|
||||
},
|
||||
{
|
||||
"note": "Python: normalize bytes parameters in wrapper methods",
|
||||
"pr": 1919
|
||||
}
|
||||
],
|
||||
"timestamp": 1563957393
|
||||
},
|
||||
{
|
||||
"timestamp": 1563006338,
|
||||
"version": "2.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "add parameter assertions to methods",
|
||||
"pr": 1823
|
||||
},
|
||||
{
|
||||
"note": "Move `getABITransactionData` to `callAsync` template",
|
||||
"pr": 1863
|
||||
},
|
||||
{
|
||||
"note": "Initial support for Python",
|
||||
"pr": 1878
|
||||
}
|
||||
],
|
||||
"timestamp": 1562967251
|
||||
},
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "add `awaitTransactionSuccessAsync()` to `tx.handlebars`",
|
||||
"pr": 1797
|
||||
}
|
||||
],
|
||||
"timestamp": 1557507213
|
||||
},
|
||||
{
|
||||
"version": "2.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
],
|
||||
"timestamp": 1554997931
|
||||
},
|
||||
{
|
||||
"timestamp": 1551130135,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Upgrade the bignumber.js to v8.0.2",
|
||||
"pr": 1517
|
||||
}
|
||||
],
|
||||
"timestamp": 1549373905
|
||||
},
|
||||
{
|
||||
"timestamp": 1547561734,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "1.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Initial publish",
|
||||
"pr": 1305
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@@ -1,56 +0,0 @@
|
||||
<!--
|
||||
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
|
||||
Edit the package's CHANGELOG.json file only.
|
||||
-->
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.4.0 - _July 31, 2019_
|
||||
|
||||
* Updated interface to `deployFrom0xArtifactAsync` to include log decode dependencies. (#1995)
|
||||
* Updated interface to `deployAsync` to include log decode dependencies. (#1995)
|
||||
|
||||
## v2.3.0 - _July 24, 2019_
|
||||
|
||||
* Python: fix broken event handling (#1919)
|
||||
* Python: custom validator class support (#1919)
|
||||
* Python: linter fixes (#1919)
|
||||
* Python: normalize bytes parameters in wrapper methods (#1919)
|
||||
|
||||
## v2.2.1 - _July 13, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.0 - _July 12, 2019_
|
||||
|
||||
* add parameter assertions to methods (#1823)
|
||||
* Move `getABITransactionData` to `callAsync` template (#1863)
|
||||
* Initial support for Python (#1878)
|
||||
|
||||
## v2.1.0 - _May 10, 2019_
|
||||
|
||||
* add `awaitTransactionSuccessAsync()` to `tx.handlebars` (#1797)
|
||||
|
||||
## v2.0.2 - _April 11, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.1 - _February 25, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
||||
## v1.0.2 - _January 15, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.0 - _Invalid date_
|
||||
|
||||
* Initial publish (#1305)
|
@@ -1,54 +0,0 @@
|
||||
|
||||
def {{this.languageSpecificName}}(
|
||||
self,
|
||||
{{> typed_params inputs=inputs}}
|
||||
tx_params: Optional[TxParams] = None,
|
||||
{{^this.constant}}
|
||||
view_only: bool = False,
|
||||
{{/this.constant}}
|
||||
) -> {{> return_type outputs=outputs~}}:
|
||||
"""Execute underlying, same-named contract method.
|
||||
{{sanitizeDevdocDetails this.name this.devdoc.details 8}}{{~#if this.devdoc.params~}}{{#each this.devdoc.params}}
|
||||
{{makeParameterDocstringRole @key this 8}}{{/each}}{{/if}}
|
||||
:param tx_params: transaction parameters
|
||||
{{#if this.constant~}}
|
||||
{{#if this.devdoc.return}}
|
||||
{{makeReturnDocstringRole this.devdoc.return 8}}{{/if}}
|
||||
{{else}}
|
||||
:param view_only: whether to use transact() or call()
|
||||
|
||||
:returns: if param `view_only`:code: is `True`:code:, then returns the
|
||||
value returned from the underlying function; else returns the
|
||||
transaction hash.
|
||||
{{/if}}
|
||||
"""
|
||||
{{#each this.inputs}}
|
||||
self.validator.assert_valid(
|
||||
method_name='{{../name}}',
|
||||
parameter_name='{{name}}',
|
||||
argument_value={{toPythonIdentifier name}},
|
||||
)
|
||||
{{#if (equal type 'address')}}
|
||||
{{toPythonIdentifier this.name}} = self._validate_and_checksum_address({{toPythonIdentifier this.name}})
|
||||
{{else if (equal type 'uint256')}}
|
||||
# safeguard against fractional inputs
|
||||
{{toPythonIdentifier this.name}} = int({{toPythonIdentifier this.name}})
|
||||
{{else if (equal type 'bytes')}}
|
||||
{{toPythonIdentifier this.name}} = bytes.fromhex({{toPythonIdentifier this.name}}.decode("utf-8"))
|
||||
{{else if (equal type 'bytes[]')}}
|
||||
{{toPythonIdentifier this.name}} = [
|
||||
bytes.fromhex({{toPythonIdentifier this.name}}_element.decode("utf-8"))
|
||||
for {{toPythonIdentifier this.name}}_element in {{toPythonIdentifier this.name}}
|
||||
]
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
func = self._get_contract_instance(
|
||||
self.contract_address
|
||||
).functions.{{this.name}}(
|
||||
{{> params}}
|
||||
)
|
||||
return self._invoke_function_call(
|
||||
func=func,
|
||||
tx_params=tx_params,
|
||||
view_only={{#if this.constant}}True{{else}}view_only{{/if}}
|
||||
)
|
@@ -1,3 +0,0 @@
|
||||
{{#each inputs}}
|
||||
{{toPythonIdentifier name}}{{#if @last}}{{else}},{{/if}}
|
||||
{{/each}}
|
@@ -1,17 +0,0 @@
|
||||
These templates are used with [abi-gen](https://github.com/0xProject/0x-monorepo/tree/development/packages/abi-gen).
|
||||
|
||||
To successfully compile the generated TypeScript contract wrappers, you must:
|
||||
|
||||
- Install the packages on which the main contract template directly depends: `yarn add @0x/base-contract @0x/sol-compiler @0x/utils @0x/web3-wrapper ethereum-types ethers lodash`
|
||||
- Install the packages on which the main contract template *in*directly depends: `yarn add @types/lodash`
|
||||
- Ensure that your TypeScript configuration includes the following:
|
||||
|
||||
```
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2015"],
|
||||
"typeRoots": [
|
||||
"node_modules/@0x/typescript-typings/types",
|
||||
"node_modules/@types"
|
||||
]
|
||||
}
|
||||
```
|
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-templates",
|
||||
"version": "2.4.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
"description": "Handlebars templates used by abi-gen to generate contract-wrappers",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/0xProject/0x-monorepo/issues"
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-templates/README.md",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
@@ -1,4 +1,33 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1567521715,
|
||||
"version": "5.3.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "5.3.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Added DevUtils",
|
||||
"pr": 2060
|
||||
}
|
||||
],
|
||||
"timestamp": 1566446343
|
||||
},
|
||||
{
|
||||
"version": "5.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Updated to include `getABIDecodedTransactionData` and `getABIDecodedReturnData`",
|
||||
"pr": 2018
|
||||
}
|
||||
],
|
||||
"timestamp": 1565296576
|
||||
},
|
||||
{
|
||||
"version": "5.1.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.3.1 - _September 3, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.3.0 - _August 22, 2019_
|
||||
|
||||
* Added DevUtils (#2060)
|
||||
|
||||
## v5.2.0 - _August 8, 2019_
|
||||
|
||||
* Updated to include `getABIDecodedTransactionData` and `getABIDecodedReturnData` (#2018)
|
||||
|
||||
## v5.1.0 - _July 31, 2019_
|
||||
|
||||
* Add subscribe/unsubscribe methods for events (#1970)
|
||||
|
@@ -71,3 +71,9 @@ yarn lint
|
||||
```bash
|
||||
yarn test
|
||||
```
|
||||
|
||||
### Documentation
|
||||
|
||||
Documentation for this package is generated by TypeDoc, using the Solidity source code for 0x contracts. Each contract corresponds to one global-level module, which contains relevant enums and interfaces for its events and structs. Most significantly, each module exports a class, `<ContractName>Contract`, e.g. `ExchangeContract`, which implements helper methods for all the functions defined in the corresponding contract.
|
||||
|
||||
A convention to note is that these contract-specific helper methods are defined as _object literals_, which are separated from methods in the generated documentation. Each contract method has a number of sub-methods, e.g. `sendTransactionAsync`, or `estimateGasAsync`, which are documented separately. This is an example of an expected method call signature: `exchangeContractInstance.fillOrder.sendTransactionAsync(...arguments)`.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "5.1.0",
|
||||
"version": "5.3.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -18,10 +18,10 @@
|
||||
"prettier": "prettier --write src/**/* --config ../../.prettierrc",
|
||||
"prettier_contract_wrappers": "prettier --write src/generated-wrappers/* --config ../../.prettierrc",
|
||||
"clean": "shx rm -rf lib src/generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output src/generated-wrappers --backend ethers"
|
||||
},
|
||||
"config": {
|
||||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IAssetProxy|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken|Coordinator|CoordinatorRegistry|EthBalanceChecker).json"
|
||||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DevUtils|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IAssetProxy|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken|Coordinator|CoordinatorRegistry|EthBalanceChecker|ERC1155Proxy|StaticCallProxy).json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -33,23 +33,22 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^3.1.2",
|
||||
"@0x/abi-gen-templates": "^2.4.0",
|
||||
"@0x/assert": "^2.1.2",
|
||||
"@0x/json-schemas": "^3.1.12",
|
||||
"@0x/abi-gen": "^4.2.0",
|
||||
"@0x/assert": "^2.1.5",
|
||||
"@0x/json-schemas": "^4.0.1",
|
||||
"@0x/tslint-config": "^3.0.1",
|
||||
"@0x/types": "^2.4.1",
|
||||
"@0x/utils": "^4.4.2",
|
||||
"@0x/web3-wrapper": "^6.0.9",
|
||||
"ethereum-types": "^2.1.4",
|
||||
"@0x/types": "^2.4.2",
|
||||
"@0x/utils": "^4.5.1",
|
||||
"@0x/web3-wrapper": "^6.0.12",
|
||||
"ethereum-types": "^2.1.5",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.3.0",
|
||||
"@0x/contract-addresses": "^3.0.2",
|
||||
"@0x/contract-artifacts": "^2.0.3"
|
||||
"@0x/base-contract": "^5.3.3",
|
||||
"@0x/contract-addresses": "^3.1.0",
|
||||
"@0x/contract-artifacts": "^2.2.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,7 +28,17 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class CoordinatorContract extends BaseContract {
|
||||
/**
|
||||
* Recovers the address of a signer given a hash and signature.
|
||||
*/
|
||||
public getSignerAddress = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param hash Any 32 byte hash.
|
||||
* @param signature Proof that the hash has been signed by signer.
|
||||
*/
|
||||
async callAsync(
|
||||
hash: string,
|
||||
signature: string,
|
||||
@@ -66,6 +77,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param hash Any 32 byte hash.
|
||||
* @param signature Proof that the hash has been signed by signer.
|
||||
*/
|
||||
getABIEncodedTransactionData(hash: string, signature: string): string {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
@@ -76,8 +94,32 @@ export class CoordinatorContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getSignerAddress(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getSignerAddress(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Calculates the EIP712 hash of a 0x transaction using the domain separator of the Exchange contract.
|
||||
*/
|
||||
public getTransactionHash = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @returns EIP712 hash of the transaction with the domain separator of this contract.
|
||||
*/
|
||||
async callAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -115,6 +157,12 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
*/
|
||||
getABIEncodedTransactionData(transaction: { salt: BigNumber; signerAddress: string; data: string }): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
@@ -123,8 +171,33 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getTransactionHash((uint256,address,bytes))');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getTransactionHash((uint256,address,bytes))');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Calculated the EIP712 hash of the Coordinator approval mesasage using the domain separator of this contract.
|
||||
*/
|
||||
public getCoordinatorApprovalHash = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param approval Coordinator approval message containing the transaction
|
||||
* hash, transaction signature, and expiration of the approval.
|
||||
* @returns EIP712 hash of the Coordinator approval message with the domain separator of this contract.
|
||||
*/
|
||||
async callAsync(
|
||||
approval: {
|
||||
txOrigin: string;
|
||||
@@ -168,6 +241,13 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param approval Coordinator approval message containing the transaction
|
||||
* hash, transaction signature, and expiration of the approval.
|
||||
*/
|
||||
getABIEncodedTransactionData(approval: {
|
||||
txOrigin: string;
|
||||
transactionHash: string;
|
||||
@@ -181,8 +261,40 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Executes a 0x transaction that has been signed by the feeRecipients that correspond to each order in the transaction's Exchange calldata.
|
||||
*/
|
||||
public executeTransaction = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -229,6 +341,22 @@ export class CoordinatorContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -264,6 +392,20 @@ export class CoordinatorContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -302,6 +444,20 @@ export class CoordinatorContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
*/
|
||||
async callAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -356,6 +512,20 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
*/
|
||||
getABIEncodedTransactionData(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -380,8 +550,57 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).executeTransaction.callAsync(
|
||||
transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
txData,
|
||||
);
|
||||
const txHash = await (this as any).executeTransaction.sendTransactionAsync(
|
||||
transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public EIP712_EXCHANGE_DOMAIN_HASH = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -413,13 +632,50 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('EIP712_EXCHANGE_DOMAIN_HASH()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_EXCHANGE_DOMAIN_HASH()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_EXCHANGE_DOMAIN_HASH()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Validates that the 0x transaction has been approved by all of the feeRecipients
|
||||
* that correspond to each order in the transaction's Exchange calldata.
|
||||
*/
|
||||
public assertValidCoordinatorApprovals = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
*/
|
||||
async callAsync(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -474,6 +730,20 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param transaction 0x transaction containing salt, signerAddress, and data.
|
||||
* @param txOrigin Required signer of Ethereum transaction calling this
|
||||
* function.
|
||||
* @param transactionSignature Proof that the transaction has been signed by
|
||||
* the signer.
|
||||
* @param approvalExpirationTimeSeconds Array of expiration times in seconds
|
||||
* for which each corresponding approval signature expires.
|
||||
* @param approvalSignatures Array of signatures that correspond to the
|
||||
* feeRecipients of each order in the transaction's Exchange calldata.
|
||||
*/
|
||||
getABIEncodedTransactionData(
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
@@ -498,8 +768,36 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Decodes the orders from Exchange calldata representing any fill method.
|
||||
*/
|
||||
public decodeOrdersFromFillData = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param data Exchange calldata representing a fill method.
|
||||
* @returns The orders from the Exchange calldata.
|
||||
*/
|
||||
async callAsync(
|
||||
data: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -566,14 +864,99 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param data Exchange calldata representing a fill method.
|
||||
*/
|
||||
getABIEncodedTransactionData(data: string): string {
|
||||
assert.isString('data', data);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('decodeOrdersFromFillData(bytes)', [data]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(
|
||||
callData: string,
|
||||
): Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}> {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('decodeOrdersFromFillData(bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<
|
||||
Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>
|
||||
>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(
|
||||
returnData: string,
|
||||
): Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}> {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('decodeOrdersFromFillData(bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<
|
||||
Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>
|
||||
>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public EIP712_COORDINATOR_DOMAIN_HASH = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -605,11 +988,30 @@ export class CoordinatorContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('EIP712_COORDINATOR_DOMAIN_HASH()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_COORDINATOR_DOMAIN_HASH()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_COORDINATOR_DOMAIN_HASH()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -630,9 +1032,11 @@ export class CoordinatorContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return CoordinatorContract.deployAsync(
|
||||
bytecode,
|
||||
abi,
|
||||
|
@@ -3,7 +3,6 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
BaseContract,
|
||||
BlockRange,
|
||||
EventCallback,
|
||||
IndexedFilterValues,
|
||||
SubscriptionManager,
|
||||
@@ -13,6 +12,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -46,7 +46,17 @@ export interface CoordinatorRegistryCoordinatorEndpointSetEventArgs extends Deco
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class CoordinatorRegistryContract extends BaseContract {
|
||||
/**
|
||||
* Called by a Coordinator operator to set the endpoint of their Coordinator.
|
||||
*/
|
||||
public setCoordinatorEndpoint = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param coordinatorEndpoint endpoint of the Coordinator.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
@@ -67,6 +77,14 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param coordinatorEndpoint endpoint of the Coordinator.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
coordinatorEndpoint: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -88,6 +106,12 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param coordinatorEndpoint endpoint of the Coordinator.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
@@ -107,6 +131,12 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param coordinatorEndpoint endpoint of the Coordinator.
|
||||
*/
|
||||
async callAsync(
|
||||
coordinatorEndpoint: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -143,6 +173,12 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param coordinatorEndpoint endpoint of the Coordinator.
|
||||
*/
|
||||
getABIEncodedTransactionData(coordinatorEndpoint: string): string {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
@@ -151,8 +187,39 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
coordinatorEndpoint: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).setCoordinatorEndpoint.callAsync(coordinatorEndpoint, txData);
|
||||
const txHash = await (this as any).setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets the endpoint for a Coordinator.
|
||||
*/
|
||||
public getCoordinatorEndpoint = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param coordinatorOperator operator of the Coordinator endpoint.
|
||||
*/
|
||||
async callAsync(
|
||||
coordinatorOperator: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -191,6 +258,12 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param coordinatorOperator operator of the Coordinator endpoint.
|
||||
*/
|
||||
getABIEncodedTransactionData(coordinatorOperator: string): string {
|
||||
assert.isString('coordinatorOperator', coordinatorOperator);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
@@ -199,6 +272,20 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
private readonly _subscriptionManager: SubscriptionManager<CoordinatorRegistryEventArgs, CoordinatorRegistryEvents>;
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -219,9 +306,11 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return CoordinatorRegistryContract.deployAsync(
|
||||
bytecode,
|
||||
abi,
|
||||
|
3144
packages/abi-gen-wrappers/src/generated-wrappers/dev_utils.ts
generated
Normal file
3144
packages/abi-gen-wrappers/src/generated-wrappers/dev_utils.ts
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
BaseContract,
|
||||
BlockRange,
|
||||
EventCallback,
|
||||
IndexedFilterValues,
|
||||
SubscriptionManager,
|
||||
@@ -13,6 +12,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -55,6 +55,11 @@ export interface DummyERC20TokenApprovalEventArgs extends DecodedLogArgs {
|
||||
// tslint:disable-next-line:class-name
|
||||
export class DummyERC20TokenContract extends BaseContract {
|
||||
public name = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -86,13 +91,43 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('name()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* `msg.sender` approves `_spender` to spend `_value` tokens
|
||||
*/
|
||||
public approve = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -121,6 +156,15 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -144,6 +188,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -171,6 +222,14 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @returns Always true if the call has enough gas to complete execution
|
||||
*/
|
||||
async callAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -212,6 +271,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
*/
|
||||
getABIEncodedTransactionData(_spender: string, _value: BigNumber): string {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -222,8 +288,40 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).approve.callAsync(_spender, _value, txData);
|
||||
const txHash = await (this as any).approve.sendTransactionAsync(_spender, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Query total supply of token
|
||||
*/
|
||||
public totalSupply = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Total supply of token
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -255,13 +353,44 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. See https://github.com/ethereum/EIPs/issues/717
|
||||
*/
|
||||
public transferFrom = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _from Address to transfer from.
|
||||
* @param _to Address to transfer to.
|
||||
* @param _value Amount to transfer.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -293,6 +422,16 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _from Address to transfer from.
|
||||
* @param _to Address to transfer to.
|
||||
* @param _value Amount to transfer.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -323,6 +462,14 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _from Address to transfer from.
|
||||
* @param _to Address to transfer to.
|
||||
* @param _value Amount to transfer.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -353,6 +500,15 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _from Address to transfer from.
|
||||
* @param _to Address to transfer to.
|
||||
* @param _value Amount to transfer.
|
||||
* @returns Success of transfer.
|
||||
*/
|
||||
async callAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -397,6 +553,14 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _from Address to transfer from.
|
||||
* @param _to Address to transfer to.
|
||||
* @param _value Amount to transfer.
|
||||
*/
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _value: BigNumber): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
@@ -409,8 +573,37 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).transferFrom.callAsync(_from, _to, _value, txData);
|
||||
const txHash = await (this as any).transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public decimals = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -442,13 +635,42 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('decimals()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Query the balance of owner
|
||||
*/
|
||||
public balanceOf = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _owner The address from which the balance will be retrieved
|
||||
* @returns Balance of owner
|
||||
*/
|
||||
async callAsync(
|
||||
_owner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -485,14 +707,39 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _owner The address from which the balance will be retrieved
|
||||
*/
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -524,13 +771,37 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public symbol = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -562,13 +833,42 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('symbol()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Mints new tokens for sender
|
||||
*/
|
||||
public mint = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _value Amount of tokens to mint
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(_value: BigNumber, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
@@ -589,6 +889,14 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _value Amount of tokens to mint
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -610,6 +918,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _value Amount of tokens to mint
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(_value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
@@ -629,6 +943,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _value Amount of tokens to mint
|
||||
*/
|
||||
async callAsync(_value: BigNumber, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isBigNumber('_value', _value);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -661,14 +981,53 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _value Amount of tokens to mint
|
||||
*/
|
||||
getABIEncodedTransactionData(_value: BigNumber): string {
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('mint(uint256)', [_value]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).mint.callAsync(_value, txData);
|
||||
const txHash = await (this as any).mint.sendTransactionAsync(_value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* send `value` token to `to` from `msg.sender`
|
||||
*/
|
||||
public transfer = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -694,6 +1053,15 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -717,6 +1085,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(_to: string, _value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -737,6 +1112,14 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @returns True if transfer was successful
|
||||
*/
|
||||
async callAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -775,6 +1158,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
*/
|
||||
getABIEncodedTransactionData(_to: string, _value: BigNumber): string {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -785,8 +1175,39 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).transfer.callAsync(_to, _value, txData);
|
||||
const txHash = await (this as any).transfer.sendTransactionAsync(_to, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public allowance = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _owner The address of the account owning tokens
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @returns Amount of remaining tokens allowed to spent
|
||||
*/
|
||||
async callAsync(
|
||||
_owner: string,
|
||||
_spender: string,
|
||||
@@ -828,6 +1249,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _owner The address of the account owning tokens
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
*/
|
||||
getABIEncodedTransactionData(_owner: string, _spender: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
@@ -838,8 +1266,33 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Sets the balance of target address
|
||||
*/
|
||||
public setBalance = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _target Address or which balance will be updated
|
||||
* @param _value New balance of target address
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
@@ -868,6 +1321,15 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _target Address or which balance will be updated
|
||||
* @param _value New balance of target address
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
@@ -891,6 +1353,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _target Address or which balance will be updated
|
||||
* @param _value New balance of target address
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
@@ -918,6 +1387,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _target Address or which balance will be updated
|
||||
* @param _value New balance of target address
|
||||
*/
|
||||
async callAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
@@ -959,6 +1435,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _target Address or which balance will be updated
|
||||
* @param _value New balance of target address
|
||||
*/
|
||||
getABIEncodedTransactionData(_target: string, _value: BigNumber): string {
|
||||
assert.isString('_target', _target);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -969,8 +1452,37 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_target: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).setBalance.callAsync(_target, _value, txData);
|
||||
const txHash = await (this as any).setBalance.sendTransactionAsync(_target, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
@@ -991,6 +1503,13 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -1012,6 +1531,11 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
@@ -1031,6 +1555,11 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -1063,6 +1592,11 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
@@ -1071,8 +1605,32 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).transferOwnership.callAsync(newOwner, txData);
|
||||
const txHash = await (this as any).transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public MAX_MINT_AMOUNT = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -1104,11 +1662,30 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('MAX_MINT_AMOUNT()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as DummyERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
private readonly _subscriptionManager: SubscriptionManager<DummyERC20TokenEventArgs, DummyERC20TokenEvents>;
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -1133,9 +1710,11 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return DummyERC20TokenContract.deployAsync(
|
||||
bytecode,
|
||||
abi,
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,7 +28,17 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class DutchAuctionContract extends BaseContract {
|
||||
/**
|
||||
* Calculates the Auction Details for the given order
|
||||
*/
|
||||
public getAuctionDetails = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param order The sell order
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
order: {
|
||||
makerAddress: string;
|
||||
@@ -66,6 +77,14 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param order The sell order
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {
|
||||
makerAddress: string;
|
||||
@@ -99,6 +118,12 @@ export class DutchAuctionContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param order The sell order
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
order: {
|
||||
makerAddress: string;
|
||||
@@ -136,6 +161,13 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param order The sell order
|
||||
* @returns AuctionDetails
|
||||
*/
|
||||
async callAsync(
|
||||
order: {
|
||||
makerAddress: string;
|
||||
@@ -203,6 +235,12 @@ export class DutchAuctionContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param order The sell order
|
||||
*/
|
||||
getABIEncodedTransactionData(order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
@@ -224,8 +262,108 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(
|
||||
callData: string,
|
||||
): {
|
||||
beginTimeSeconds: BigNumber;
|
||||
endTimeSeconds: BigNumber;
|
||||
beginAmount: BigNumber;
|
||||
endAmount: BigNumber;
|
||||
currentAmount: BigNumber;
|
||||
currentTimeSeconds: BigNumber;
|
||||
} {
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<{
|
||||
beginTimeSeconds: BigNumber;
|
||||
endTimeSeconds: BigNumber;
|
||||
beginAmount: BigNumber;
|
||||
endAmount: BigNumber;
|
||||
currentAmount: BigNumber;
|
||||
currentTimeSeconds: BigNumber;
|
||||
}>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(
|
||||
returnData: string,
|
||||
): {
|
||||
beginTimeSeconds: BigNumber;
|
||||
endTimeSeconds: BigNumber;
|
||||
beginAmount: BigNumber;
|
||||
endAmount: BigNumber;
|
||||
currentAmount: BigNumber;
|
||||
currentTimeSeconds: BigNumber;
|
||||
} {
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<{
|
||||
beginTimeSeconds: BigNumber;
|
||||
endTimeSeconds: BigNumber;
|
||||
beginAmount: BigNumber;
|
||||
endAmount: BigNumber;
|
||||
currentAmount: BigNumber;
|
||||
currentTimeSeconds: BigNumber;
|
||||
}>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).getAuctionDetails.callAsync(order, txData);
|
||||
const txHash = await (this as any).getAuctionDetails.sendTransactionAsync(order, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Matches the buy and sell orders at an amount given the following: the current block time, the auction
|
||||
* start time and the auction begin amount. The sell order is a an order at the lowest amount
|
||||
* at the end of the auction. Excess from the match is transferred to the seller.
|
||||
* Over time the price moves from beginAmount to endAmount given the current block.timestamp.
|
||||
* sellOrder.expiryTimeSeconds is the end time of the auction.
|
||||
* sellOrder.takerAssetAmount is the end amount of the auction (lowest possible amount).
|
||||
* sellOrder.makerAssetData is the ABI encoded Asset Proxy data with the following data appended
|
||||
* buyOrder.makerAssetData is the buyers bid on the auction, must meet the amount for the current block timestamp
|
||||
* (uint256 beginTimeSeconds, uint256 beginAmount).
|
||||
* This function reverts in the following scenarios:
|
||||
* * Auction has not started (auctionDetails.currentTimeSeconds < auctionDetails.beginTimeSeconds)
|
||||
* * Auction has expired (auctionDetails.endTimeSeconds < auctionDetails.currentTimeSeconds)
|
||||
* * Amount is invalid: Buy order amount is too low (buyOrder.makerAssetAmount < auctionDetails.currentAmount)
|
||||
* * Amount is invalid: Invalid begin amount (auctionDetails.beginAmount > auctionDetails.endAmount)
|
||||
* * Any failure in the 0x Match Orders
|
||||
*/
|
||||
public matchOrders = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param buyOrder The Buyer's order. This order is for the current expected
|
||||
* price of the auction.
|
||||
* @param sellOrder The Seller's order. This order is for the lowest amount (at
|
||||
* the end of the auction).
|
||||
* @param buySignature Proof that order was created by the buyer.
|
||||
* @param sellSignature Proof that order was created by the seller.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
@@ -282,6 +420,19 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param buyOrder The Buyer's order. This order is for the current expected
|
||||
* price of the auction.
|
||||
* @param sellOrder The Seller's order. This order is for the lowest amount (at
|
||||
* the end of the auction).
|
||||
* @param buySignature Proof that order was created by the buyer.
|
||||
* @param sellSignature Proof that order was created by the seller.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
@@ -339,6 +490,17 @@ export class DutchAuctionContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param buyOrder The Buyer's order. This order is for the current expected
|
||||
* price of the auction.
|
||||
* @param sellOrder The Seller's order. This order is for the lowest amount (at
|
||||
* the end of the auction).
|
||||
* @param buySignature Proof that order was created by the buyer.
|
||||
* @param sellSignature Proof that order was created by the seller.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
@@ -394,6 +556,18 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param buyOrder The Buyer's order. This order is for the current expected
|
||||
* price of the auction.
|
||||
* @param sellOrder The Seller's order. This order is for the lowest amount (at
|
||||
* the end of the auction).
|
||||
* @param buySignature Proof that order was created by the buyer.
|
||||
* @param sellSignature Proof that order was created by the seller.
|
||||
* @returns matchedFillResults amounts filled and fees paid by maker and taker of matched orders.
|
||||
*/
|
||||
async callAsync(
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
@@ -493,6 +667,17 @@ export class DutchAuctionContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param buyOrder The Buyer's order. This order is for the current expected
|
||||
* price of the auction.
|
||||
* @param sellOrder The Seller's order. This order is for the lowest amount (at
|
||||
* the end of the auction).
|
||||
* @param buySignature Proof that order was created by the buyer.
|
||||
* @param sellSignature Proof that order was created by the seller.
|
||||
*/
|
||||
getABIEncodedTransactionData(
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
@@ -534,6 +719,127 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(
|
||||
callData: string,
|
||||
): {
|
||||
left: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
right: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
leftMakerAssetSpreadAmount: BigNumber;
|
||||
} {
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<{
|
||||
left: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
right: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
leftMakerAssetSpreadAmount: BigNumber;
|
||||
}>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(
|
||||
returnData: string,
|
||||
): {
|
||||
left: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
right: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
leftMakerAssetSpreadAmount: BigNumber;
|
||||
} {
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<{
|
||||
left: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
right: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
leftMakerAssetSpreadAmount: BigNumber;
|
||||
}>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
sellOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).matchOrders.callAsync(buyOrder, sellOrder, buySignature, sellSignature, txData);
|
||||
const txHash = await (this as any).matchOrders.sendTransactionAsync(
|
||||
buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -554,9 +860,11 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return DutchAuctionContract.deployAsync(
|
||||
bytecode,
|
||||
abi,
|
||||
|
1669
packages/abi-gen-wrappers/src/generated-wrappers/erc1155_proxy.ts
generated
Normal file
1669
packages/abi-gen-wrappers/src/generated-wrappers/erc1155_proxy.ts
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
BaseContract,
|
||||
BlockRange,
|
||||
EventCallback,
|
||||
IndexedFilterValues,
|
||||
SubscriptionManager,
|
||||
@@ -13,6 +12,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -54,7 +54,17 @@ export interface ERC20ProxyAuthorizedAddressRemovedEventArgs extends DecodedLogA
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ERC20ProxyContract extends BaseContract {
|
||||
/**
|
||||
* Authorizes an address.
|
||||
*/
|
||||
public addAuthorizedAddress = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -75,6 +85,14 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -96,6 +114,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -115,6 +139,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to authorize.
|
||||
*/
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -147,6 +177,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to authorize.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -155,8 +191,32 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).addAuthorizedAddress.callAsync(target, txData);
|
||||
const txHash = await (this as any).addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public authorities = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(
|
||||
index_0: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -193,14 +253,43 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(index_0: BigNumber): string {
|
||||
assert.isBigNumber('index_0', index_0);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorities(uint256)', [index_0]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Removes authorizion of an address.
|
||||
*/
|
||||
public removeAuthorizedAddress = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -221,6 +310,14 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -242,6 +339,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -261,6 +364,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to remove authorization from.
|
||||
*/
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -293,6 +402,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to remove authorization from.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -301,8 +416,32 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).removeAuthorizedAddress.callAsync(target, txData);
|
||||
const txHash = await (this as any).removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -334,13 +473,43 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Removes authorizion of an address.
|
||||
*/
|
||||
public removeAuthorizedAddressAtIndex = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -369,6 +538,15 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -396,6 +574,13 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -423,6 +608,13 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
*/
|
||||
async callAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -464,6 +656,13 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string, index: BigNumber): string {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
@@ -474,8 +673,44 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).removeAuthorizedAddressAtIndex.callAsync(target, index, txData);
|
||||
const txHash = await (this as any).removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target,
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets the proxy id associated with the proxy address.
|
||||
*/
|
||||
public getProxyId = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Proxy id.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -507,13 +742,37 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public authorized = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(
|
||||
index_0: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -550,6 +809,11 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -558,8 +822,31 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets all authorized addresses.
|
||||
*/
|
||||
public getAuthorizedAddresses = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Array of authorized addresses.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -591,13 +878,38 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string[] {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string[]>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string[] {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string[]>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -618,6 +930,13 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -639,6 +958,11 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -658,6 +982,11 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -690,6 +1019,11 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
@@ -698,6 +1032,25 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).transferOwnership.callAsync(newOwner, txData);
|
||||
const txHash = await (this as any).transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
private readonly _subscriptionManager: SubscriptionManager<ERC20ProxyEventArgs, ERC20ProxyEvents>;
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -718,9 +1071,11 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return ERC20ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
|
@@ -3,7 +3,6 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
BaseContract,
|
||||
BlockRange,
|
||||
EventCallback,
|
||||
IndexedFilterValues,
|
||||
SubscriptionManager,
|
||||
@@ -13,6 +12,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -54,7 +54,18 @@ export interface ERC20TokenApprovalEventArgs extends DecodedLogArgs {
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ERC20TokenContract extends BaseContract {
|
||||
/**
|
||||
* `msg.sender` approves `_spender` to spend `_value` tokens
|
||||
*/
|
||||
public approve = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -83,6 +94,15 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -106,6 +126,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -133,6 +160,14 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
* @returns Always true if the call has enough gas to complete execution
|
||||
*/
|
||||
async callAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
@@ -174,6 +209,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @param _value The amount of wei to be approved for transfer
|
||||
*/
|
||||
getABIEncodedTransactionData(_spender: string, _value: BigNumber): string {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -184,8 +226,40 @@ export class ERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).approve.callAsync(_spender, _value, txData);
|
||||
const txHash = await (this as any).approve.sendTransactionAsync(_spender, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Query total supply of token
|
||||
*/
|
||||
public totalSupply = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Total supply of token
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -217,13 +291,44 @@ export class ERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* send `value` token to `to` from `from` on the condition it is approved by `from`
|
||||
*/
|
||||
public transferFrom = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -255,6 +360,16 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -285,6 +400,14 @@ export class ERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -315,6 +438,15 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @returns True if transfer was successful
|
||||
*/
|
||||
async callAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -359,6 +491,14 @@ export class ERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
*/
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _value: BigNumber): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
@@ -371,8 +511,42 @@ export class ERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).transferFrom.callAsync(_from, _to, _value, txData);
|
||||
const txHash = await (this as any).transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Query the balance of owner
|
||||
*/
|
||||
public balanceOf = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _owner The address from which the balance will be retrieved
|
||||
* @returns Balance of owner
|
||||
*/
|
||||
async callAsync(
|
||||
_owner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -409,14 +583,45 @@ export class ERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _owner The address from which the balance will be retrieved
|
||||
*/
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* send `value` token to `to` from `msg.sender`
|
||||
*/
|
||||
public transfer = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -442,6 +647,15 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -465,6 +679,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(_to: string, _value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -485,6 +706,14 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @returns True if transfer was successful
|
||||
*/
|
||||
async callAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
@@ -523,6 +752,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
*/
|
||||
getABIEncodedTransactionData(_to: string, _value: BigNumber): string {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@@ -533,8 +769,39 @@ export class ERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).transfer.callAsync(_to, _value, txData);
|
||||
const txHash = await (this as any).transfer.sendTransactionAsync(_to, _value, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public allowance = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _owner The address of the account owning tokens
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
* @returns Amount of remaining tokens allowed to spent
|
||||
*/
|
||||
async callAsync(
|
||||
_owner: string,
|
||||
_spender: string,
|
||||
@@ -576,6 +843,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _owner The address of the account owning tokens
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
*/
|
||||
getABIEncodedTransactionData(_owner: string, _spender: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
@@ -586,6 +860,20 @@ export class ERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
private readonly _subscriptionManager: SubscriptionManager<ERC20TokenEventArgs, ERC20TokenEvents>;
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -606,9 +894,11 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
|
@@ -3,7 +3,6 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
BaseContract,
|
||||
BlockRange,
|
||||
EventCallback,
|
||||
IndexedFilterValues,
|
||||
SubscriptionManager,
|
||||
@@ -13,6 +12,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -54,7 +54,17 @@ export interface ERC721ProxyAuthorizedAddressRemovedEventArgs extends DecodedLog
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ERC721ProxyContract extends BaseContract {
|
||||
/**
|
||||
* Authorizes an address.
|
||||
*/
|
||||
public addAuthorizedAddress = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -75,6 +85,14 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -96,6 +114,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -115,6 +139,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to authorize.
|
||||
*/
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -147,6 +177,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to authorize.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -155,8 +191,32 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).addAuthorizedAddress.callAsync(target, txData);
|
||||
const txHash = await (this as any).addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public authorities = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(
|
||||
index_0: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -193,14 +253,43 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(index_0: BigNumber): string {
|
||||
assert.isBigNumber('index_0', index_0);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorities(uint256)', [index_0]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Removes authorizion of an address.
|
||||
*/
|
||||
public removeAuthorizedAddress = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -221,6 +310,14 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -242,6 +339,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -261,6 +364,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to remove authorization from.
|
||||
*/
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -293,6 +402,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to remove authorization from.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -301,8 +416,32 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).removeAuthorizedAddress.callAsync(target, txData);
|
||||
const txHash = await (this as any).removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -334,13 +473,43 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Removes authorizion of an address.
|
||||
*/
|
||||
public removeAuthorizedAddressAtIndex = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -369,6 +538,15 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -396,6 +574,13 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -423,6 +608,13 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
*/
|
||||
async callAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -464,6 +656,13 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string, index: BigNumber): string {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
@@ -474,8 +673,44 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).removeAuthorizedAddressAtIndex.callAsync(target, index, txData);
|
||||
const txHash = await (this as any).removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target,
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets the proxy id associated with the proxy address.
|
||||
*/
|
||||
public getProxyId = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Proxy id.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -507,13 +742,37 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public authorized = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(
|
||||
index_0: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -550,6 +809,11 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -558,8 +822,31 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets all authorized addresses.
|
||||
*/
|
||||
public getAuthorizedAddresses = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Array of authorized addresses.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -591,13 +878,38 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string[] {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string[]>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string[] {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string[]>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -618,6 +930,13 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -639,6 +958,11 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -658,6 +982,11 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -690,6 +1019,11 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
@@ -698,6 +1032,25 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).transferOwnership.callAsync(newOwner, txData);
|
||||
const txHash = await (this as any).transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
private readonly _subscriptionManager: SubscriptionManager<ERC721ProxyEventArgs, ERC721ProxyEvents>;
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -718,9 +1071,11 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return ERC721ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
|
@@ -3,7 +3,6 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
BaseContract,
|
||||
BlockRange,
|
||||
EventCallback,
|
||||
IndexedFilterValues,
|
||||
SubscriptionManager,
|
||||
@@ -13,6 +12,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -64,7 +64,17 @@ export interface ERC721TokenApprovalForAllEventArgs extends DecodedLogArgs {
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ERC721TokenContract extends BaseContract {
|
||||
/**
|
||||
* Throws if `_tokenId` is not a valid NFT.
|
||||
*/
|
||||
public getApproved = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _tokenId The NFT to find the approved address for
|
||||
* @returns The approved address for this NFT, or the zero address if there is none
|
||||
*/
|
||||
async callAsync(
|
||||
_tokenId: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -101,14 +111,47 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _tokenId The NFT to find the approved address for
|
||||
*/
|
||||
getABIEncodedTransactionData(_tokenId: BigNumber): string {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getApproved(uint256)', [_tokenId]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* The zero address indicates there is no approved address.
|
||||
* Throws unless `msg.sender` is the current NFT owner, or an authorized
|
||||
* operator of the current owner.
|
||||
*/
|
||||
public approve = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _approved The new approved NFT controller
|
||||
* @param _tokenId The NFT to approve
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -137,6 +180,15 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _approved The new approved NFT controller
|
||||
* @param _tokenId The NFT to approve
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -160,6 +212,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _approved The new approved NFT controller
|
||||
* @param _tokenId The NFT to approve
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -187,6 +246,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _approved The new approved NFT controller
|
||||
* @param _tokenId The NFT to approve
|
||||
*/
|
||||
async callAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
@@ -228,6 +294,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _approved The new approved NFT controller
|
||||
* @param _tokenId The NFT to approve
|
||||
*/
|
||||
getABIEncodedTransactionData(_approved: string, _tokenId: BigNumber): string {
|
||||
assert.isString('_approved', _approved);
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
@@ -238,8 +311,46 @@ export class ERC721TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_approved: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).approve.callAsync(_approved, _tokenId, txData);
|
||||
const txHash = await (this as any).approve.sendTransactionAsync(_approved, _tokenId, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Throws unless `msg.sender` is the current owner, an authorized
|
||||
* operator, or the approved address for this NFT. Throws if `_from` is
|
||||
* not the current owner. Throws if `_to` is the zero address. Throws if
|
||||
* `_tokenId` is not a valid NFT.
|
||||
*/
|
||||
public transferFrom = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -271,6 +382,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -301,6 +422,14 @@ export class ERC721TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -331,6 +460,14 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
*/
|
||||
async callAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -375,6 +512,14 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
*/
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _tokenId: BigNumber): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
@@ -387,8 +532,45 @@ export class ERC721TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).transferFrom.callAsync(_from, _to, _tokenId, txData);
|
||||
const txHash = await (this as any).transferFrom.sendTransactionAsync(_from, _to, _tokenId, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* This works identically to the other function with an extra data parameter,
|
||||
* except this function just sets data to "".
|
||||
*/
|
||||
public safeTransferFrom1 = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -420,6 +602,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -450,6 +642,14 @@ export class ERC721TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -480,6 +680,14 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
*/
|
||||
async callAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -524,6 +732,14 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
*/
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _tokenId: BigNumber): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
@@ -536,8 +752,43 @@ export class ERC721TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).safeTransferFrom1.callAsync(_from, _to, _tokenId, txData);
|
||||
const txHash = await (this as any).safeTransferFrom1.sendTransactionAsync(_from, _to, _tokenId, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* NFTs assigned to zero address are considered invalid, and queries
|
||||
* about them do throw.
|
||||
*/
|
||||
public ownerOf = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _tokenId The identifier for an NFT
|
||||
* @returns The address of the owner of the NFT
|
||||
*/
|
||||
async callAsync(
|
||||
_tokenId: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -574,14 +825,45 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _tokenId The identifier for an NFT
|
||||
*/
|
||||
getABIEncodedTransactionData(_tokenId: BigNumber): string {
|
||||
assert.isBigNumber('_tokenId', _tokenId);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('ownerOf(uint256)', [_tokenId]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* NFTs assigned to the zero address are considered invalid, and this
|
||||
* function throws for queries about the zero address.
|
||||
*/
|
||||
public balanceOf = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _owner An address for whom to query the balance
|
||||
* @returns The number of NFTs owned by `_owner`, possibly zero
|
||||
*/
|
||||
async callAsync(
|
||||
_owner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -618,14 +900,46 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _owner An address for whom to query the balance
|
||||
*/
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Emits the ApprovalForAll event. The contract MUST allow
|
||||
* multiple operators per owner.
|
||||
*/
|
||||
public setApprovalForAll = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _operator Address to add to the set of authorized operators
|
||||
* @param _approved True if the operator is approved, false to revoke approval
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
@@ -654,6 +968,15 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _operator Address to add to the set of authorized operators
|
||||
* @param _approved True if the operator is approved, false to revoke approval
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
@@ -681,6 +1004,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _operator Address to add to the set of authorized operators
|
||||
* @param _approved True if the operator is approved, false to revoke approval
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
@@ -708,6 +1038,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _operator Address to add to the set of authorized operators
|
||||
* @param _approved True if the operator is approved, false to revoke approval
|
||||
*/
|
||||
async callAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
@@ -749,6 +1086,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _operator Address to add to the set of authorized operators
|
||||
* @param _approved True if the operator is approved, false to revoke approval
|
||||
*/
|
||||
getABIEncodedTransactionData(_operator: string, _approved: boolean): string {
|
||||
assert.isString('_operator', _operator);
|
||||
assert.isBoolean('_approved', _approved);
|
||||
@@ -759,8 +1103,50 @@ export class ERC721TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_operator: string,
|
||||
_approved: boolean,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).setApprovalForAll.callAsync(_operator, _approved, txData);
|
||||
const txHash = await (this as any).setApprovalForAll.sendTransactionAsync(_operator, _approved, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Throws unless `msg.sender` is the current owner, an authorized
|
||||
* operator, or the approved address for this NFT. Throws if `_from` is
|
||||
* not the current owner. Throws if `_to` is the zero address. Throws if
|
||||
* `_tokenId` is not a valid NFT. When transfer is complete, this function
|
||||
* checks if `_to` is a smart contract (code size > 0). If so, it calls
|
||||
* `onERC721Received` on `_to` and throws if the return value is not
|
||||
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`.
|
||||
*/
|
||||
public safeTransferFrom2 = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param _data Additional data with no specified format, sent in call to `_to`
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -801,6 +1187,17 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param _data Additional data with no specified format, sent in call to `_to`
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -834,6 +1231,15 @@ export class ERC721TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param _data Additional data with no specified format, sent in call to `_to`
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -867,6 +1273,15 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param _data Additional data with no specified format, sent in call to `_to`
|
||||
*/
|
||||
async callAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
@@ -914,6 +1329,15 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _from The current owner of the NFT
|
||||
* @param _to The new owner
|
||||
* @param _tokenId The NFT to transfer
|
||||
* @param _data Additional data with no specified format, sent in call to `_to`
|
||||
*/
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _tokenId: BigNumber, _data: string): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
@@ -926,8 +1350,47 @@ export class ERC721TokenContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_tokenId: BigNumber,
|
||||
_data: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).safeTransferFrom2.callAsync(_from, _to, _tokenId, _data, txData);
|
||||
const txHash = await (this as any).safeTransferFrom2.sendTransactionAsync(
|
||||
_from,
|
||||
_to,
|
||||
_tokenId,
|
||||
_data,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public isApprovedForAll = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param _owner The address that owns the NFTs
|
||||
* @param _operator The address that acts on behalf of the owner
|
||||
* @returns True if `_operator` is an approved operator for `_owner`, false otherwise
|
||||
*/
|
||||
async callAsync(
|
||||
_owner: string,
|
||||
_operator: string,
|
||||
@@ -969,6 +1432,13 @@ export class ERC721TokenContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param _owner The address that owns the NFTs
|
||||
* @param _operator The address that acts on behalf of the owner
|
||||
*/
|
||||
getABIEncodedTransactionData(_owner: string, _operator: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_operator', _operator);
|
||||
@@ -979,6 +1449,20 @@ export class ERC721TokenContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): boolean {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<boolean>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): boolean {
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
private readonly _subscriptionManager: SubscriptionManager<ERC721TokenEventArgs, ERC721TokenEvents>;
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
@@ -999,9 +1483,11 @@ export class ERC721TokenContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return ERC721TokenContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
|
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,7 +28,17 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class EthBalanceCheckerContract extends BaseContract {
|
||||
/**
|
||||
* Batch fetches ETH balances
|
||||
*/
|
||||
public getEthBalances = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param addresses Array of addresses.
|
||||
* @returns Array of ETH balances.
|
||||
*/
|
||||
async callAsync(
|
||||
addresses: string[],
|
||||
callData: Partial<CallData> = {},
|
||||
@@ -64,12 +75,32 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param addresses Array of addresses.
|
||||
*/
|
||||
getABIEncodedTransactionData(addresses: string[]): string {
|
||||
assert.isArray('addresses', addresses);
|
||||
const self = (this as any) as EthBalanceCheckerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getEthBalances(address[])', [addresses]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): BigNumber[] {
|
||||
const self = (this as any) as EthBalanceCheckerContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getEthBalances(address[])');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<BigNumber[]>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): BigNumber[] {
|
||||
const self = (this as any) as EthBalanceCheckerContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getEthBalances(address[])');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber[]>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -89,9 +120,11 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return EthBalanceCheckerContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
|
2345
packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts
generated
2345
packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts
generated
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,7 +28,28 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ForwarderContract extends BaseContract {
|
||||
/**
|
||||
* Attempt to purchase makerAssetFillAmount of makerAsset by selling ETH provided with transaction.
|
||||
* Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.
|
||||
* Any ETH not spent will be refunded to sender.
|
||||
*/
|
||||
public marketBuyOrdersWithEth = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -109,6 +131,23 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -177,6 +216,21 @@ export class ForwarderContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -248,6 +302,22 @@ export class ForwarderContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @returns Amounts filled and fees paid by maker and taker for both sets of orders.
|
||||
*/
|
||||
async callAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -365,6 +435,21 @@ export class ForwarderContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param makerAssetFillAmount Desired amount of makerAsset to purchase.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
*/
|
||||
getABIEncodedTransactionData(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -422,8 +507,157 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(
|
||||
callData: string,
|
||||
): [
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
] {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<
|
||||
[
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
]
|
||||
>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(
|
||||
returnData: string,
|
||||
): [
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
] {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<
|
||||
[
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
]
|
||||
>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>,
|
||||
makerAssetFillAmount: BigNumber,
|
||||
signatures: string[],
|
||||
feeOrders: Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>,
|
||||
feeSignatures: string[],
|
||||
feePercentage: BigNumber,
|
||||
feeRecipient: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).marketBuyOrdersWithEth.callAsync(
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
txData,
|
||||
);
|
||||
const txHash = await (this as any).marketBuyOrdersWithEth.sendTransactionAsync(
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Withdraws assets from this contract. The contract requires a ZRX balance in order to
|
||||
* function optimally, and this function allows the ZRX to be withdrawn by owner. It may also be
|
||||
* used to withdraw assets that were accidentally sent to this contract.
|
||||
*/
|
||||
public withdrawAsset = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param amount Amount of ERC20 token to withdraw.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
@@ -449,6 +683,15 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param amount Amount of ERC20 token to withdraw.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
@@ -472,6 +715,13 @@ export class ForwarderContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param amount Amount of ERC20 token to withdraw.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
@@ -496,6 +746,13 @@ export class ForwarderContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param amount Amount of ERC20 token to withdraw.
|
||||
*/
|
||||
async callAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
@@ -534,6 +791,13 @@ export class ForwarderContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param amount Amount of ERC20 token to withdraw.
|
||||
*/
|
||||
getABIEncodedTransactionData(assetData: string, amount: BigNumber): string {
|
||||
assert.isString('assetData', assetData);
|
||||
assert.isBigNumber('amount', amount);
|
||||
@@ -544,8 +808,36 @@ export class ForwarderContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('withdrawAsset(bytes,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('withdrawAsset(bytes,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
assetData: string,
|
||||
amount: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).withdrawAsset.callAsync(assetData, amount, txData);
|
||||
const txHash = await (this as any).withdrawAsset.sendTransactionAsync(assetData, amount, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -577,13 +869,53 @@ export class ForwarderContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.
|
||||
* Any ZRX required to pay fees for primary orders will automatically be purchased by this contract.
|
||||
* 5% of ETH value is reserved for paying fees to order feeRecipients (in ZRX) and forwarding contract feeRecipient (in ETH).
|
||||
* Any ETH not spent will be refunded to sender.
|
||||
*/
|
||||
public marketSellOrdersWithEth = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -654,6 +986,22 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -719,6 +1067,20 @@ export class ForwarderContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -780,6 +1142,21 @@ export class ForwarderContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @returns Amounts filled and fees paid by maker and taker for both sets of orders.
|
||||
*/
|
||||
async callAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -887,6 +1264,20 @@ export class ForwarderContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feeOrders Array of order specifications containing ZRX as makerAsset
|
||||
* and WETH as takerAsset. Used to purchase ZRX for primary order fees.
|
||||
* @param feeSignatures Proofs that feeOrders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
*/
|
||||
getABIEncodedTransactionData(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
@@ -934,8 +1325,147 @@ export class ForwarderContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(
|
||||
callData: string,
|
||||
): [
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
] {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<
|
||||
[
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
]
|
||||
>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(
|
||||
returnData: string,
|
||||
): [
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
] {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<
|
||||
[
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
},
|
||||
{
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
}
|
||||
]
|
||||
>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
orders: Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>,
|
||||
signatures: string[],
|
||||
feeOrders: Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>,
|
||||
feeSignatures: string[],
|
||||
feePercentage: BigNumber,
|
||||
feeRecipient: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).marketSellOrdersWithEth.callAsync(
|
||||
orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
txData,
|
||||
);
|
||||
const txHash = await (this as any).marketSellOrdersWithEth.sendTransactionAsync(
|
||||
orders,
|
||||
signatures,
|
||||
feeOrders,
|
||||
feeSignatures,
|
||||
feePercentage,
|
||||
feeRecipient,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
@@ -956,6 +1486,13 @@ export class ForwarderContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -977,6 +1514,11 @@ export class ForwarderContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
@@ -996,6 +1538,11 @@ export class ForwarderContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -1028,6 +1575,11 @@ export class ForwarderContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
@@ -1036,6 +1588,25 @@ export class ForwarderContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).transferOwnership.callAsync(newOwner, txData);
|
||||
const txHash = await (this as any).transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -1058,9 +1629,11 @@ export class ForwarderContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return ForwarderContract.deployAsync(
|
||||
bytecode,
|
||||
abi,
|
||||
|
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,7 +28,17 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class IAssetProxyContract extends BaseContract {
|
||||
/**
|
||||
* Authorizes an address.
|
||||
*/
|
||||
public addAuthorizedAddress = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -48,6 +59,14 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -69,6 +88,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to authorize.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -88,6 +113,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to authorize.
|
||||
*/
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -120,6 +151,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to authorize.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -128,8 +165,37 @@ export class IAssetProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).addAuthorizedAddress.callAsync(target, txData);
|
||||
const txHash = await (this as any).addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Removes authorizion of an address.
|
||||
*/
|
||||
public removeAuthorizedAddress = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -150,6 +216,14 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -171,6 +245,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -190,6 +270,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to remove authorization from.
|
||||
*/
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -222,6 +308,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to remove authorization from.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -230,8 +322,38 @@ export class IAssetProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).removeAuthorizedAddress.callAsync(target, txData);
|
||||
const txHash = await (this as any).removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Removes authorizion of an address.
|
||||
*/
|
||||
public removeAuthorizedAddressAtIndex = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -260,6 +382,15 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -287,6 +418,13 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -314,6 +452,13 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
*/
|
||||
async callAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
@@ -355,6 +500,13 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param target Address to remove authorization from.
|
||||
* @param index Index of target in authorities array.
|
||||
*/
|
||||
getABIEncodedTransactionData(target: string, index: BigNumber): string {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
@@ -365,8 +517,48 @@ export class IAssetProxyContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).removeAuthorizedAddressAtIndex.callAsync(target, index, txData);
|
||||
const txHash = await (this as any).removeAuthorizedAddressAtIndex.sendTransactionAsync(
|
||||
target,
|
||||
index,
|
||||
txData,
|
||||
);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Transfers assets. Either succeeds or throws.
|
||||
*/
|
||||
public transferFrom = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param from Address to transfer asset from.
|
||||
* @param to Address to transfer asset to.
|
||||
* @param amount Amount of asset to transfer.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
@@ -401,6 +593,17 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param from Address to transfer asset from.
|
||||
* @param to Address to transfer asset to.
|
||||
* @param amount Amount of asset to transfer.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
@@ -434,6 +637,15 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param from Address to transfer asset from.
|
||||
* @param to Address to transfer asset to.
|
||||
* @param amount Amount of asset to transfer.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
@@ -467,6 +679,15 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param from Address to transfer asset from.
|
||||
* @param to Address to transfer asset to.
|
||||
* @param amount Amount of asset to transfer.
|
||||
*/
|
||||
async callAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
@@ -514,6 +735,15 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param assetData Byte array encoded for the respective asset proxy.
|
||||
* @param from Address to transfer asset from.
|
||||
* @param to Address to transfer asset to.
|
||||
* @param amount Amount of asset to transfer.
|
||||
*/
|
||||
getABIEncodedTransactionData(assetData: string, from: string, to: string, amount: BigNumber): string {
|
||||
assert.isString('assetData', assetData);
|
||||
assert.isString('from', from);
|
||||
@@ -526,8 +756,42 @@ export class IAssetProxyContract extends BaseContract {
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(
|
||||
assetData: string,
|
||||
from: string,
|
||||
to: string,
|
||||
amount: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
await (this as any).transferFrom.callAsync(assetData, from, to, amount, txData);
|
||||
const txHash = await (this as any).transferFrom.sendTransactionAsync(assetData, from, to, amount, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets the proxy id associated with the proxy address.
|
||||
*/
|
||||
public getProxyId = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Proxy id.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -559,13 +823,41 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Gets all authorized addresses.
|
||||
*/
|
||||
public getAuthorizedAddresses = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @returns Array of authorized addresses.
|
||||
*/
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@@ -597,13 +889,38 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string[] {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string[]>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string[] {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string[]>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
/**
|
||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
||||
* Ethereum operation and will cost gas.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -624,6 +941,13 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
/**
|
||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
||||
* If the transaction was mined, but reverted, an error is thrown.
|
||||
* @param txData Additional data for transaction
|
||||
* @param pollingIntervalMs Interval at which to poll for success
|
||||
* @returns A promise that resolves when the transaction is successful
|
||||
*/
|
||||
awaitTransactionSuccessAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData>,
|
||||
@@ -645,6 +969,11 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
||||
* @param txData Additional data for transaction
|
||||
* @returns The hash of the transaction
|
||||
*/
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -664,6 +993,11 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
*/
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -696,6 +1030,11 @@ export class IAssetProxyContract extends BaseContract {
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
*/
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
@@ -704,6 +1043,25 @@ export class IAssetProxyContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<void>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): void {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
async validateAndSendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
await (this as any).transferOwnership.callAsync(newOwner, txData);
|
||||
const txHash = await (this as any).transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return txHash;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -723,9 +1081,11 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return IAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
|
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,14 +28,26 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class IValidatorContract extends BaseContract {
|
||||
/**
|
||||
* Verifies that a signature is valid.
|
||||
*/
|
||||
public isValidSignature = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param hash Message hash that is signed.
|
||||
* @param signerAddress Address that should have signed the given hash.
|
||||
* @param signature Proof of signing.
|
||||
* @returns Magic bytes4 value if the signature is valid. Magic value is bytes4(keccak256("isValidValidatorSignature(address,bytes32,address,bytes)"))
|
||||
*/
|
||||
async callAsync(
|
||||
hash: string,
|
||||
signerAddress: string,
|
||||
signature: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean> {
|
||||
): Promise<string> {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signerAddress', signerAddress);
|
||||
assert.isString('signature', signature);
|
||||
@@ -68,10 +81,18 @@ export class IValidatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param hash Message hash that is signed.
|
||||
* @param signerAddress Address that should have signed the given hash.
|
||||
* @param signature Proof of signing.
|
||||
*/
|
||||
getABIEncodedTransactionData(hash: string, signerAddress: string, signature: string): string {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signerAddress', signerAddress);
|
||||
@@ -84,6 +105,20 @@ export class IValidatorContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as IValidatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as IValidatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -103,9 +138,11 @@ export class IValidatorContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
@@ -171,8 +208,8 @@ export class IValidatorContract extends BaseContract {
|
||||
name: 'isValidSignature',
|
||||
outputs: [
|
||||
{
|
||||
name: 'isValid',
|
||||
type: 'bool',
|
||||
name: '',
|
||||
type: 'bytes4',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
|
@@ -6,6 +6,7 @@ import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
BlockRange,
|
||||
CallData,
|
||||
ContractAbi,
|
||||
ContractArtifact,
|
||||
@@ -27,13 +28,24 @@ import * as ethers from 'ethers';
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class IWalletContract extends BaseContract {
|
||||
/**
|
||||
* Verifies that a signature is valid.
|
||||
*/
|
||||
public isValidSignature = {
|
||||
/**
|
||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
||||
* since they don't modify state.
|
||||
* @param hash Message hash that is signed.
|
||||
* @param signature Proof of signing.
|
||||
* @returns Magic bytes4 value if the signature is valid. Magic value is bytes4(keccak256("isValidWalletSignature(bytes32,address,bytes)"))
|
||||
*/
|
||||
async callAsync(
|
||||
hash: string,
|
||||
signature: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean> {
|
||||
): Promise<string> {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@@ -62,10 +74,17 @@ export class IWalletContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
||||
* to create a 0x transaction (see protocol spec for more details).
|
||||
* @param hash Message hash that is signed.
|
||||
* @param signature Proof of signing.
|
||||
*/
|
||||
getABIEncodedTransactionData(hash: string, signature: string): string {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
@@ -76,6 +95,20 @@ export class IWalletContract extends BaseContract {
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
getABIDecodedTransactionData(callData: string): string {
|
||||
const self = (this as any) as IWalletContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedCallData = abiEncoder.strictDecode<string>(callData);
|
||||
return abiDecodedCallData;
|
||||
},
|
||||
getABIDecodedReturnData(returnData: string): string {
|
||||
const self = (this as any) as IWalletContract;
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData);
|
||||
return abiDecodedReturnData;
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
@@ -95,9 +128,11 @@ export class IWalletContract extends BaseContract {
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
||||
for (const key of Object.keys(logDecodeDependencies)) {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return IWalletContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
@@ -159,8 +194,8 @@ export class IWalletContract extends BaseContract {
|
||||
name: 'isValidSignature',
|
||||
outputs: [
|
||||
{
|
||||
name: 'isValid',
|
||||
type: 'bool',
|
||||
name: '',
|
||||
type: 'bytes4',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user