Compare commits
3743
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ebed3095f | ||
|
|
5b2ef4ab31 | ||
|
|
629e6b6cff | ||
|
|
2f7b1bcb4b | ||
|
|
ca39237d97 | ||
|
|
947a74d07e | ||
|
|
ed903a2f99 | ||
|
|
a2ae601e2e | ||
|
|
9a9ea8e338 | ||
|
|
4f1c4f179f | ||
|
|
2fc59ea595 | ||
|
|
8037ccf3c0 | ||
|
|
79d7ebad58 | ||
|
|
cd5e89bedc | ||
|
|
c4f5db9bb1 | ||
|
|
e89d345e85 | ||
|
|
f9de125bfd | ||
|
|
5001fbc474 | ||
|
|
cc75c7d630 | ||
|
|
93dee2d28c | ||
|
|
65d535ef2d | ||
|
|
b782cf277d | ||
|
|
0ebf4a7dbd | ||
|
|
316dd6da66 | ||
|
|
1104a07808 | ||
|
|
b68454a392 | ||
|
|
8adee4168c | ||
|
|
99cf71878e | ||
|
|
a0bc67c316 | ||
|
|
ebbe3d78de | ||
|
|
97d9753621 | ||
|
|
11ee1f585e | ||
|
|
4a29bcc10d | ||
|
|
c14ce4f5f5 | ||
|
|
baa71182ee | ||
|
|
3ebcbfea24 | ||
|
|
8e34abfadc | ||
|
|
ea4d9eba29 | ||
|
|
5ee9a9858a | ||
|
|
ed2c96e039 | ||
|
|
4cb5d8b3bd | ||
|
|
73c5ffb99b | ||
|
|
2f8f1451c6 | ||
|
|
d2bdea6f0c | ||
|
|
0d157bb98e | ||
|
|
275af0cf0c | ||
|
|
59306ebb87 | ||
|
|
38c1d5c0fc | ||
|
|
8ce9b412f1 | ||
|
|
e9289a6b95 | ||
|
|
c37469f75b | ||
|
|
877432808b | ||
|
|
060770a409 | ||
|
|
272c3cf04b | ||
|
|
ada83e4c2c | ||
|
|
2547cab9fb | ||
|
|
e172dbf4f4 | ||
|
|
d03c4f00d2 | ||
|
|
2bd15150e3 | ||
|
|
2023fdd03a | ||
|
|
7b91d9d22c | ||
|
|
83141a61b3 | ||
|
|
52706719e6 | ||
|
|
e1c7ae5394 | ||
|
|
136c0a4deb | ||
|
|
14f386cf86 | ||
|
|
7c13b51b7f | ||
|
|
c7e457e357 | ||
|
|
92c5a7e7e9 | ||
|
|
0a9b1c9d48 | ||
|
|
c47033adc5 | ||
|
|
35c54b0186 | ||
|
|
0fe01e6371 | ||
|
|
6f40d41db9 | ||
|
|
85a218936f | ||
|
|
df79a409eb | ||
|
|
b07f3b8566 | ||
|
|
97ff78d359 | ||
|
|
21d59c2395 | ||
|
|
21c95922e0 | ||
|
|
97ceb9f785 | ||
|
|
5a390a3c03 | ||
|
|
ea78609f7c | ||
|
|
7e7849fd24 | ||
|
|
c3715d7126 | ||
|
|
71946bc5d5 | ||
|
|
15ede2f4f4 | ||
|
|
14ccd705c4 | ||
|
|
0fefcabb17 | ||
|
|
516535b8e4 | ||
|
|
b6a92cda57 | ||
|
|
68be25a50f | ||
|
|
4e7d6f5203 | ||
|
|
20f90952a3 | ||
|
|
0fc0ec71dc | ||
|
|
e6b4445fef | ||
|
|
dfc045f2cf | ||
|
|
fcc5a8b39f | ||
|
|
884ff3cbbb | ||
|
|
c007d3f7ae | ||
|
|
a8fde78b50 | ||
|
|
51ad32b29a | ||
|
|
f04d9c5c5f | ||
|
|
c42ee1e41e | ||
|
|
1a48645f68 | ||
|
|
06edcd1e91 | ||
|
|
bad1f28883 | ||
|
|
36e78ad75c | ||
|
|
1706874099 | ||
|
|
c0c03753a8 | ||
|
|
53948cddb5 | ||
|
|
41d42e07a0 | ||
|
|
ae6030e9a3 | ||
|
|
c03dba4e02 | ||
|
|
2a81376c19 | ||
|
|
ac182bfe3d | ||
|
|
d07b836ffa | ||
|
|
7467ce8ee9 | ||
|
|
889a796798 | ||
|
|
daeb3920ac | ||
|
|
35df064af9 | ||
|
|
f3ede68928 | ||
|
|
58d88ac334 | ||
|
|
9f6663b1df | ||
|
|
614c093a54 | ||
|
|
1658b3ed82 | ||
|
|
0561d75b9b | ||
|
|
0887739d86 | ||
|
|
62f43dcf16 | ||
|
|
b1684361ff | ||
|
|
15727ff6d1 | ||
|
|
7baee2c619 | ||
|
|
e79d26d0c1 | ||
|
|
8031da44be | ||
|
|
fb08ae6349 | ||
|
|
cc2c16ba09 | ||
|
|
2c98c8538d | ||
|
|
664af207a1 | ||
|
|
bc7a931bd0 | ||
|
|
bb2055dcf4 | ||
|
|
ebcd818219 | ||
|
|
26cc412855 | ||
|
|
e969cb0047 | ||
|
|
91075420d7 | ||
|
|
3fe8a46a3b | ||
|
|
774eb62910 | ||
|
|
b92545269c | ||
|
|
10c98dcfe8 | ||
|
|
2ff3559baf | ||
|
|
42877ad754 | ||
|
|
8ac96096ac | ||
|
|
f10f7166cf | ||
|
|
04daf0ff69 | ||
|
|
3442442017 | ||
|
|
32dd328112 | ||
|
|
61ec81e092 | ||
|
|
55f49ff6ca | ||
|
|
fa4ff8efa7 | ||
|
|
9f1b16e89b | ||
|
|
32b3763f9b | ||
|
|
0ca0d721c2 | ||
|
|
9da15a66bf | ||
|
|
a1ee5a2478 | ||
|
|
0d4dfbd20d | ||
|
|
23ca4b5c1e | ||
|
|
777f5e8309 | ||
|
|
cee247e02e | ||
|
|
5c08e5b0e9 | ||
|
|
b81f39edc3 | ||
|
|
1669e7950e | ||
|
|
13abba6213 | ||
|
|
e8694bdf98 | ||
|
|
e4ae20e1be | ||
|
|
c1729dbdac | ||
|
|
a17a0ed878 | ||
|
|
928e611b85 | ||
|
|
b97db15d8f | ||
|
|
7632d6dc3f | ||
|
|
9bdea96052 | ||
|
|
2a49b03d70 | ||
|
|
ae479e3853 | ||
|
|
9cac93eb63 | ||
|
|
c3a8040402 | ||
|
|
c54a50b834 | ||
|
|
05fd1554c5 | ||
|
|
9826831dfc | ||
|
|
345482b55e | ||
|
|
6d01f36594 | ||
|
|
ad66b76795 | ||
|
|
d8ac177e84 | ||
|
|
4b39bc5ce2 | ||
|
|
07212fa93d | ||
|
|
4b81270699 | ||
|
|
f56005ba70 | ||
|
|
cd77780f28 | ||
|
|
a7529a6dbc | ||
|
|
91debac36f | ||
|
|
ed98835903 | ||
|
|
523c95ee21 | ||
|
|
4e4d6b8fc4 | ||
|
|
438cff2028 | ||
|
|
85d8991bc2 | ||
|
|
f640cdcc12 | ||
|
|
1b4a0d0ab1 | ||
|
|
5cfac99354 | ||
|
|
6870bbb18f | ||
|
|
21112e05e9 | ||
|
|
f3cff4a4de | ||
|
|
f0fd1f4ee7 | ||
|
|
70c72ad7dc | ||
|
|
a47de0fd1e | ||
|
|
75700877a6 | ||
|
|
434db6a138 | ||
|
|
15d06e05df | ||
|
|
f619641f26 | ||
|
|
d2f4eb9cb6 | ||
|
|
ef8e78d9bc | ||
|
|
b2c6a23f55 | ||
|
|
e0a8ae40de | ||
|
|
dde97cadc8 | ||
|
|
63ae6492eb | ||
|
|
9162840a25 | ||
|
|
6d40654523 | ||
|
|
970407eab9 | ||
|
|
0535413490 | ||
|
|
e62f2c97d6 | ||
|
|
8ee75a9e6d | ||
|
|
a0950d418c | ||
|
|
8d8caca23c | ||
|
|
a5b2d4d32e | ||
|
|
8f363f2e95 | ||
|
|
ddb19c73c6 | ||
|
|
8fc3a26b78 | ||
|
|
b20c664f81 | ||
|
|
5e80ab63b0 | ||
|
|
e3d4aa7006 | ||
|
|
1913cafacc | ||
|
|
f8e7dc75ad | ||
|
|
4c346aabd9 | ||
|
|
173b4d78f3 | ||
|
|
a8d06a46e1 | ||
|
|
efcdb11fc1 | ||
|
|
9d113e9376 | ||
|
|
1593871b51 | ||
|
|
c4ba03dd47 | ||
|
|
826f4d3fd8 | ||
|
|
883e566cd2 | ||
|
|
0ccd5114f0 | ||
|
|
777f6607ea | ||
|
|
00c20fc389 | ||
|
|
47e87b269e | ||
|
|
6aae1d54bc | ||
|
|
42fe051bad | ||
|
|
6a92615bb1 | ||
|
|
b15abee11b | ||
|
|
664db48914 | ||
|
|
7fa0ac699d | ||
|
|
501449f98a | ||
|
|
82e0999a9f | ||
|
|
998e3765d2 | ||
|
|
fc5f1b11e8 | ||
|
|
8abcf97f1e | ||
|
|
5d1ba51a71 | ||
|
|
4ced38eee1 | ||
|
|
d93c433fdf | ||
|
|
e9af465e1c | ||
|
|
bec0bb880a | ||
|
|
e4ca90db04 | ||
|
|
833db3c168 | ||
|
|
bff781f1db | ||
|
|
39573ec1ce | ||
|
|
9a645294ee | ||
|
|
97d397c2b1 | ||
|
|
5ea6b82d8d | ||
|
|
9ddee3a3f8 | ||
|
|
e66a88def3 | ||
|
|
cc965c66fb | ||
|
|
5560354ffd | ||
|
|
f27ab683d6 | ||
|
|
9ef2138f0c | ||
|
|
a887d5b997 | ||
|
|
134c3c8119 | ||
|
|
300a5b4f64 | ||
|
|
61fdd5307b | ||
|
|
c2ac8cc7d4 | ||
|
|
cc95a1f36e | ||
|
|
945d566e43 | ||
|
|
186746041b | ||
|
|
936b6f4f34 | ||
|
|
d6e65c36c3 | ||
|
|
559053b169 | ||
|
|
25796587fb | ||
|
|
3da75053aa | ||
|
|
2f11880055 | ||
|
|
f4ac7fad14 | ||
|
|
5835257d1e | ||
|
|
11597254ea | ||
|
|
bf17265ac0 | ||
|
|
f2bb032e17 | ||
|
|
59435e4bc3 | ||
|
|
b7c1510a5d | ||
|
|
5ba393a09b | ||
|
|
408911bddd | ||
|
|
87d4e6f516 | ||
|
|
42a2b935cb | ||
|
|
1db4bda0bc | ||
|
|
00c05e673e | ||
|
|
f55d9d8a7a | ||
|
|
fe264a58ce | ||
|
|
4aa51ec00d | ||
|
|
ac25f962de | ||
|
|
f95a7e1450 | ||
|
|
dc0ad2647f | ||
|
|
524df27792 | ||
|
|
957e62c5f9 | ||
|
|
e9c2e773f4 | ||
|
|
15fd95bb19 | ||
|
|
9ff3b57f4e | ||
|
|
8790d7ea37 | ||
|
|
c7881176c1 | ||
|
|
516365b2af | ||
|
|
b5d7b2d2f8 | ||
|
|
a8e4b71efa | ||
|
|
5e5207f508 | ||
|
|
8597332738 | ||
|
|
927f3016c9 | ||
|
|
1edb6c878e | ||
|
|
ac29807afd | ||
|
|
6c2a8abf93 | ||
|
|
f827356158 | ||
|
|
3b569e509a | ||
|
|
7cdb4ffaf3 | ||
|
|
f7496db953 | ||
|
|
fc5b97caf8 | ||
|
|
b8873cd4f3 | ||
|
|
505722047c | ||
|
|
06a336742c | ||
|
|
041d2f0b38 | ||
|
|
be09981ef5 | ||
|
|
7c851c26d7 | ||
|
|
b89d904d72 | ||
|
|
0b464f3628 | ||
|
|
33035603ad | ||
|
|
7924ac4162 | ||
|
|
4b963a8dc3 | ||
|
|
f5704eea8a | ||
|
|
5bf5aa5600 | ||
|
|
523490d7e5 | ||
|
|
ae1ed6e3ff | ||
|
|
4425d456d6 | ||
|
|
eac46b3393 | ||
|
|
c35e556cf9 | ||
|
|
83e5f8f3bc | ||
|
|
7459dfd074 | ||
|
|
a492ebf4e1 | ||
|
|
8db9598060 | ||
|
|
ced2bba300 | ||
|
|
d7a5953f7f | ||
|
|
8b7c3b2bc8 | ||
|
|
67d2f4b443 | ||
|
|
57c4f80eb0 | ||
|
|
9badedfbdb | ||
|
|
eb68e0181a | ||
|
|
a2480f2d21 | ||
|
|
328a82914f | ||
|
|
9a4d6ccf38 | ||
|
|
d6c739b1c5 | ||
|
|
0ee6fd05ba | ||
|
|
edb2f91006 | ||
|
|
99cb765424 | ||
|
|
1088eeaf43 | ||
|
|
ad97c8a9f1 | ||
|
|
1bf1960cde | ||
|
|
c8fbd3bcdc | ||
|
|
727be74343 | ||
|
|
2a373a243f | ||
|
|
594262930d | ||
|
|
ea52a6e0a6 | ||
|
|
64bb598d0e | ||
|
|
2ceedd593c | ||
|
|
ce336a3f8d | ||
|
|
2bd4127135 | ||
|
|
325163e5fa | ||
|
|
cf2d083905 | ||
|
|
edc3f86ad8 | ||
|
|
eea1faef81 | ||
|
|
dcaffe7aee | ||
|
|
ed273f5750 | ||
|
|
b298a69c5f | ||
|
|
d4c9d647d8 | ||
|
|
18a0a47136 | ||
|
|
65f9165b58 | ||
|
|
525822b3d3 | ||
|
|
15891ff890 | ||
|
|
488261dbd4 | ||
|
|
c2fcf04369 | ||
|
|
8a70df1ffa | ||
|
|
a4239311bb | ||
|
|
850bcf8d7f | ||
|
|
60b46413c7 | ||
|
|
c8fab584f0 | ||
|
|
64a35b2798 | ||
|
|
dda0883461 | ||
|
|
82e36eee7a | ||
|
|
87514fed5f | ||
|
|
f25d7d754d | ||
|
|
392322a432 | ||
|
|
79a03df2fb | ||
|
|
3612143d68 | ||
|
|
9d04974902 | ||
|
|
0443fd2ea2 | ||
|
|
5c3bfb1182 | ||
|
|
99ce5971dc | ||
|
|
82fc956181 | ||
|
|
440321ee21 | ||
|
|
0df88066cc | ||
|
|
0e73d7c7f4 | ||
|
|
b1f0658cc5 | ||
|
|
587f97e3b5 | ||
|
|
5ae366665b | ||
|
|
2ad273a8bb | ||
|
|
fa7f16360e | ||
|
|
e38b6bc952 | ||
|
|
e3f8d25328 | ||
|
|
f9ac2761d2 | ||
|
|
553669f460 | ||
|
|
63eb662290 | ||
|
|
533cae9c2e | ||
|
|
3d23408823 | ||
|
|
e1836ec8b4 | ||
|
|
d4f5200d3c | ||
|
|
0ee33ae86f | ||
|
|
6d22b0d6b7 | ||
|
|
be9e77f685 | ||
|
|
78693c3be9 | ||
|
|
a64163a332 | ||
|
|
fff993929f | ||
|
|
20a63bb614 | ||
|
|
71d0d1b9a5 | ||
|
|
2571590dfb | ||
|
|
5d84c6af81 | ||
|
|
f0dc0e1046 | ||
|
|
5370d814fb | ||
|
|
218282a2a0 | ||
|
|
b04916fdbf | ||
|
|
ec01ed4345 | ||
|
|
8d2295d74f | ||
|
|
eda995e011 | ||
|
|
010b5e2597 | ||
|
|
12c27519b7 | ||
|
|
ac0b03fd5f | ||
|
|
3e4814add9 | ||
|
|
1090e64fa3 | ||
|
|
7dfe5c2397 | ||
|
|
b5dcf93c1f | ||
|
|
e5a11328ee | ||
|
|
751cd0acfb | ||
|
|
a520501258 | ||
|
|
d750a4be81 | ||
|
|
7c1bd26491 | ||
|
|
7931dab53e | ||
|
|
94e5e301c4 | ||
|
|
dc6e1bdb1c | ||
|
|
ee29bbcb11 | ||
|
|
d22287dd0e | ||
|
|
3821164970 | ||
|
|
29e89ef824 | ||
|
|
41f7aa7a20 | ||
|
|
06385eb3bf | ||
|
|
caa339d786 | ||
|
|
a29ca106b1 | ||
|
|
dd3b682af3 | ||
|
|
44bfdd4a8f | ||
|
|
79f0438079 | ||
|
|
e043fd613d | ||
|
|
cf40373829 | ||
|
|
183e848937 | ||
|
|
6675fb7d47 | ||
|
|
b6c2554f86 | ||
|
|
42b2166824 | ||
|
|
976b15d484 | ||
|
|
1f19b961db | ||
|
|
bf6bb3559d | ||
|
|
6fc2f223ad | ||
|
|
29e9ba2b1c | ||
|
|
e5f83eeccb | ||
|
|
b49237b25f | ||
|
|
8757d26487 | ||
|
|
760c8d9196 | ||
|
|
e914250f5d | ||
|
|
2949307bb3 | ||
|
|
a995068978 | ||
|
|
71de99b11b | ||
|
|
a0dc92a115 | ||
|
|
447830f4a2 | ||
|
|
5d2f74c8de | ||
|
|
d2f815d256 | ||
|
|
b1f5d42a25 | ||
|
|
b40417943a | ||
|
|
a88c860989 | ||
|
|
4d6352e089 | ||
|
|
9379d2b8c2 | ||
|
|
4b1ed89dde | ||
|
|
5e60605b58 | ||
|
|
f68ddda386 | ||
|
|
45a57d9f27 | ||
|
|
05101d8d8e | ||
|
|
c1ea907ba7 | ||
|
|
734dcfd45b | ||
|
|
862e9995cc | ||
|
|
44033decc6 | ||
|
|
40566f6059 | ||
|
|
2e977822b1 | ||
|
|
e351fe271f | ||
|
|
e6893d1db5 | ||
|
|
ee8403e39b | ||
|
|
888c1ae3e6 | ||
|
|
2584d6aeb0 | ||
|
|
959e75b256 | ||
|
|
f990734a87 | ||
|
|
2ec676defb | ||
|
|
d2811cc422 | ||
|
|
61dbbf4e53 | ||
|
|
fea83fbf87 | ||
|
|
5218b27402 | ||
|
|
2eb6f2c9c2 | ||
|
|
90e7e4c32e | ||
|
|
9eebd3e9dd | ||
|
|
a7f31eb918 | ||
|
|
84af4d9ebf | ||
|
|
8e5745bf0e | ||
|
|
dbd32e208f | ||
|
|
73e426ddad | ||
|
|
0b1eeafb36 | ||
|
|
4e73c75b8b | ||
|
|
e9418127ee | ||
|
|
6d9dddcb84 | ||
|
|
38bf0759c2 | ||
|
|
884de45ae7 | ||
|
|
bd9dd06f89 | ||
|
|
a12b89dab3 | ||
|
|
f7f5a5859c | ||
|
|
29601079c8 | ||
|
|
9d24120b9b | ||
|
|
bf854b4419 | ||
|
|
341334939f | ||
|
|
e30addb819 | ||
|
|
ecb9f0013f | ||
|
|
3530f125d3 | ||
|
|
d641a7e3b4 | ||
|
|
7388ebc629 | ||
|
|
82e54dc8f5 | ||
|
|
354a8b1126 | ||
|
|
2683476fe4 | ||
|
|
fcdc0c75b3 | ||
|
|
a7287c5261 | ||
|
|
a752730d9d | ||
|
|
a93925e520 | ||
|
|
ec582c45bc | ||
|
|
e59eb365bb | ||
|
|
2662571357 | ||
|
|
3e98e21b43 | ||
|
|
a4671b2ceb | ||
|
|
6b392e8a54 | ||
|
|
edf824b77d | ||
|
|
c7e5e48282 | ||
|
|
87765207c0 | ||
|
|
e32f5244f0 | ||
|
|
243fa7a870 | ||
|
|
05cd46bb01 | ||
|
|
0a8fcc2a03 | ||
|
|
782cdb6046 | ||
|
|
a687e50d5b | ||
|
|
12730be0d4 | ||
|
|
ed7a19eed3 | ||
|
|
3b4d9853aa | ||
|
|
ef07234b26 | ||
|
|
dbb03c4aee | ||
|
|
f9a9d02308 | ||
|
|
7e0a6c7197 | ||
|
|
55ff37c296 | ||
|
|
f77aa3d1c5 | ||
|
|
2b92426d9c | ||
|
|
2a6515b2af | ||
|
|
0609479caf | ||
|
|
9b1a54999a | ||
|
|
fe64297e55 | ||
|
|
ea7e27ad6f | ||
|
|
3d0db423ed | ||
|
|
5276fb8728 | ||
|
|
7280704a33 | ||
|
|
fd1fec92ac | ||
|
|
ee92708d40 | ||
|
|
335e32613a | ||
|
|
2018cbdc6f | ||
|
|
7852c26286 | ||
|
|
15712a67e1 | ||
|
|
be44746f79 | ||
|
|
cbfbb6e5f6 | ||
|
|
938852779b | ||
|
|
7db4fbf424 | ||
|
|
e06416ba82 | ||
|
|
aae8229048 | ||
|
|
b04812762d | ||
|
|
f3a146d25f | ||
|
|
986172f616 | ||
|
|
e4f11d5341 | ||
|
|
db348b3f51 | ||
|
|
2f4aa33cfe | ||
|
|
e7a44b7760 | ||
|
|
091a8a3c6d | ||
|
|
8d79c9255d | ||
|
|
061e513601 | ||
|
|
9b9dc4d645 | ||
|
|
c5a83c2889 | ||
|
|
726c012b2f | ||
|
|
6f67aa8382 | ||
|
|
274d8e24fa | ||
|
|
481b8fb2d8 | ||
|
|
f58dcd7e33 | ||
|
|
cdd5cebfc5 | ||
|
|
6968489d8b | ||
|
|
4125d54016 | ||
|
|
663a847351 | ||
|
|
9c1baaf306 | ||
|
|
7b3aa8da85 | ||
|
|
c18e1a776d | ||
|
|
652610bb5d | ||
|
|
73134a4f45 | ||
|
|
1758d8704c | ||
|
|
d76c79b9ab | ||
|
|
303c8a9920 | ||
|
|
bdf54265ce | ||
|
|
c24381f820 | ||
|
|
176a2a8d08 | ||
|
|
47acdceaad | ||
|
|
a9cf324199 | ||
|
|
f3a7460985 | ||
|
|
44332a13de | ||
|
|
c01c9bbca6 | ||
|
|
b81ac5fcf7 | ||
|
|
6af7fe09eb | ||
|
|
020e01237a | ||
|
|
e9ea832281 | ||
|
|
6f8d223142 | ||
|
|
591053ef40 | ||
|
|
7f0bb521d4 | ||
|
|
cff738248b | ||
|
|
4e92ff1740 | ||
|
|
65549d136c | ||
|
|
511adfd6d8 | ||
|
|
03a6e458cb | ||
|
|
bac140cf92 | ||
|
|
4623ef28a3 | ||
|
|
979b95dab9 | ||
|
|
373f0307d8 | ||
|
|
8e17897597 | ||
|
|
f5d6154be4 | ||
|
|
4e0ac054ec | ||
|
|
c1951921c0 | ||
|
|
501b447ca1 | ||
|
|
0d7db51cf8 | ||
|
|
ecc7b7d7b6 | ||
|
|
debd68e950 | ||
|
|
748ffca1e4 | ||
|
|
18c8f862ce | ||
|
|
474a9238ec | ||
|
|
6a0a654c3d | ||
|
|
4eb9697ea8 | ||
|
|
b9b3e85cdf | ||
|
|
76d289c921 | ||
|
|
0ff2809f0d | ||
|
|
be65a32245 | ||
|
|
d12d7c61c0 | ||
|
|
05b48e7500 | ||
|
|
547949b91d | ||
|
|
9760f192c2 | ||
|
|
e2bc0b7991 | ||
|
|
1638cf7567 | ||
|
|
e0f6d8e74a | ||
|
|
88537c6d18 | ||
|
|
ff7929f792 | ||
|
|
c9826af31e | ||
|
|
f75c17cca4 | ||
|
|
565ac3f325 | ||
|
|
c99d7aee2f | ||
|
|
0efb0cd566 | ||
|
|
dd90247ccc | ||
|
|
8279b3b516 | ||
|
|
c267276104 | ||
|
|
a6c948cbc8 | ||
|
|
ca12a1510e | ||
|
|
05488f499b | ||
|
|
0bf6ce548e | ||
|
|
7ed863e636 | ||
|
|
52fedb04b9 | ||
|
|
6bbfdf6b59 | ||
|
|
e19df9f327 | ||
|
|
7949ca88e9 | ||
|
|
3ae43bfb3d | ||
|
|
f53a0c5158 | ||
|
|
e8cd74ae4e | ||
|
|
c149341110 | ||
|
|
fea8c85646 | ||
|
|
98d067e392 | ||
|
|
e29001d6de | ||
|
|
35ebb597bb | ||
|
|
e3f5161156 | ||
|
|
db723fdf14 | ||
|
|
75dadff4bc | ||
|
|
3ebe1b7d11 | ||
|
|
45bbc39947 | ||
|
|
61117fb4b6 | ||
|
|
5c0b9606ea | ||
|
|
9312348299 | ||
|
|
fe0bbe93c9 | ||
|
|
2aee64489c | ||
|
|
af21d524cc | ||
|
|
4e4944c63b | ||
|
|
fb2301fd26 | ||
|
|
5b1fd7b7d2 | ||
|
|
0af57681ee | ||
|
|
017dec2ded | ||
|
|
27f4d411fc | ||
|
|
c8205c9e0b | ||
|
|
24e0845cd2 | ||
|
|
881682ea96 | ||
|
|
2d6eb2a8b8 | ||
|
|
2a88a3778a | ||
|
|
b942c855ac | ||
|
|
781f6b8fa1 | ||
|
|
17656a12c0 | ||
|
|
d6f4981278 | ||
|
|
cf0e6ebd4f | ||
|
|
562de222ec | ||
|
|
d968b07f39 | ||
|
|
d50591fd95 | ||
|
|
73053884d4 | ||
|
|
a649b5e767 | ||
|
|
ab1b96d9d1 | ||
|
|
bce399dc6e | ||
|
|
877ac25e4d | ||
|
|
74f1c7d27b | ||
|
|
0489e2e047 | ||
|
|
c343900615 | ||
|
|
60657c79fd | ||
|
|
03e4ce1f10 | ||
|
|
d69e630303 | ||
|
|
c99cbbc7a0 | ||
|
|
9247044dc0 | ||
|
|
9488ffed5d | ||
|
|
966e9f7c6a | ||
|
|
d29335489f | ||
|
|
585bb001ba | ||
|
|
9236a277f2 | ||
|
|
07c4303d93 | ||
|
|
ede40ef335 | ||
|
|
bff589c75d | ||
|
|
ff75aa5126 | ||
|
|
d474537614 | ||
|
|
88246d2b35 | ||
|
|
6dca7ae0dd | ||
|
|
5262e191e5 | ||
|
|
6812c4b257 | ||
|
|
5d9edebc2d | ||
|
|
40c7307086 | ||
|
|
d091a28c79 | ||
|
|
6532fec733 | ||
|
|
b7535dd779 | ||
|
|
3e079b21a7 | ||
|
|
91d4d395ea | ||
|
|
b4d2a17f12 | ||
|
|
bb019a7ca2 | ||
|
|
9373fd6f71 | ||
|
|
412f099ee9 | ||
|
|
eab738ddfa | ||
|
|
ba9f3bc4a4 | ||
|
|
afd73fc82e | ||
|
|
67ec986422 | ||
|
|
2645df775e | ||
|
|
2c181aaeed | ||
|
|
0fc22b5f56 | ||
|
|
243f2ec1d8 | ||
|
|
f519ad7e9f | ||
|
|
d583eb825e | ||
|
|
fafd2666c6 | ||
|
|
c143e518dd | ||
|
|
a07ca6b1f7 | ||
|
|
433addd020 | ||
|
|
18bc792f52 | ||
|
|
a0a7e52edc | ||
|
|
3f4c243da5 | ||
|
|
622bdebb80 | ||
|
|
71535da022 | ||
|
|
4fd57ad93c | ||
|
|
f241310835 | ||
|
|
6ad439a3db | ||
|
|
386ce248ae | ||
|
|
d2dd1d9f22 | ||
|
|
36e00115ed | ||
|
|
c815d07c19 | ||
|
|
22bf9fa486 | ||
|
|
0806627b02 | ||
|
|
2b44c0e0d1 | ||
|
|
aa26c4458c | ||
|
|
4de654f4dd | ||
|
|
fa862c915d | ||
|
|
e8c0893623 | ||
|
|
b4b29947bf | ||
|
|
bf12e9c84c | ||
|
|
66e3e205ef | ||
|
|
a610c99b2f | ||
|
|
055a0c60e9 | ||
|
|
996f6442fd | ||
|
|
ddb1af522f | ||
|
|
63b753e59b | ||
|
|
b55439d3a9 | ||
|
|
47c1744dbf | ||
|
|
b08828a092 | ||
|
|
e9ec8688db | ||
|
|
e4f2d51c47 | ||
|
|
3e6c66e73c | ||
|
|
1f1ca73592 | ||
|
|
2e32610862 | ||
|
|
7c6361a69b | ||
|
|
483ccbc39a | ||
|
|
51e738cb9f | ||
|
|
b4ae67503f | ||
|
|
064e98c0b1 | ||
|
|
0ef9969e55 | ||
|
|
1cb72cfbc2 | ||
|
|
cca4066e4e | ||
|
|
ba57ac8b07 | ||
|
|
e9ed6e6c10 | ||
|
|
b9e170a0bc | ||
|
|
2225ae8be0 | ||
|
|
173ba7a512 | ||
|
|
a4ac062fc0 | ||
|
|
9c66ebd8c2 | ||
|
|
3f679e8e90 | ||
|
|
b18b1f2342 | ||
|
|
b47b9b3dcf | ||
|
|
cf3c1358e1 | ||
|
|
b262400441 | ||
|
|
743885aff5 | ||
|
|
895c57aa0d | ||
|
|
a50a8b7c79 | ||
|
|
b264900b87 | ||
|
|
d3062bdc14 | ||
|
|
6858abf5e2 | ||
|
|
efd7c1ce3a | ||
|
|
f297991e20 | ||
|
|
06d0f3bf53 | ||
|
|
bec02cb3bc | ||
|
|
0374939ad6 | ||
|
|
0f3a6a9786 | ||
|
|
f208abe369 | ||
|
|
6fe27dd72b | ||
|
|
9fb12699f0 | ||
|
|
02396798b8 | ||
|
|
0bed570595 | ||
|
|
a52e9aa0a9 | ||
|
|
1d676e4931 | ||
|
|
62726d8faa | ||
|
|
15aab85030 | ||
|
|
b6d04746d6 | ||
|
|
bb9ebcfafc | ||
|
|
73728a4356 | ||
|
|
ecd0dcc761 | ||
|
|
85cc9c2c3d | ||
|
|
5d57fe0c76 | ||
|
|
fc716b9d95 | ||
|
|
5550977b52 | ||
|
|
fd2eb5eabe | ||
|
|
9a5851714c | ||
|
|
71514d580e | ||
|
|
6504f47b6f | ||
|
|
30759dc934 | ||
|
|
9c9de3ff97 | ||
|
|
8c5542226b | ||
|
|
bb4c62dd38 | ||
|
|
26e502d896 | ||
|
|
b94edd16f2 | ||
|
|
c1f41e50dd | ||
|
|
c696436769 | ||
|
|
06b5b9956c | ||
|
|
390115d789 | ||
|
|
79adad9893 | ||
|
|
541370c6a8 | ||
|
|
50e6643062 | ||
|
|
2812dc2ab1 | ||
|
|
4c9701965a | ||
|
|
dec4541210 | ||
|
|
bfc9a0ecf4 | ||
|
|
825b17d24c | ||
|
|
c7011e4183 | ||
|
|
3ac5e16c44 | ||
|
|
71d06794c0 | ||
|
|
d42f473a91 | ||
|
|
44219d2939 | ||
|
|
9bb7d70eb6 | ||
|
|
6b483d72be | ||
|
|
648f699b56 | ||
|
|
4aa11efddf | ||
|
|
2554f5592b | ||
|
|
af332691d5 | ||
|
|
b0fdd80c74 | ||
|
|
1cd04a056b | ||
|
|
60839e5138 | ||
|
|
4c5583813f | ||
|
|
e2b40dc4d6 | ||
|
|
b7fdc7feb7 | ||
|
|
a8e8f0fa9d | ||
|
|
ebe4e27890 | ||
|
|
ba6a385d55 | ||
|
|
74ade01069 | ||
|
|
4a202b909a | ||
|
|
414e25b6d5 | ||
|
|
ce7ce89150 | ||
|
|
b177bd6a67 | ||
|
|
d866b898cd | ||
|
|
6b70d02029 | ||
|
|
a50b1ef7a5 | ||
|
|
2c83973b92 | ||
|
|
31a8a5c473 | ||
|
|
72bf5129a8 | ||
|
|
94c74d0bb7 | ||
|
|
485817a623 | ||
|
|
649bc4e0a9 | ||
|
|
7763520845 | ||
|
|
a6bc5b34e8 | ||
|
|
5e138be57b | ||
|
|
cfd8aba0ea | ||
|
|
084dc6404a | ||
|
|
7c0a0b44d5 | ||
|
|
4b4a483b49 | ||
|
|
26063d4a86 | ||
|
|
d4a3e56611 | ||
|
|
f5682932c3 | ||
|
|
053bc54c01 | ||
|
|
a1e790c7bb | ||
|
|
db3c9a89d0 | ||
|
|
b7eeb0e549 | ||
|
|
0be94e7e00 | ||
|
|
a5c80fc152 | ||
|
|
ec7d8ea194 | ||
|
|
f078e82623 | ||
|
|
d9b618b42d | ||
|
|
f82968a623 | ||
|
|
297bcd5e7a | ||
|
|
a5d46133d2 | ||
|
|
b88bedb77a | ||
|
|
db9ec0194b | ||
|
|
4b719279ed | ||
|
|
78ea072b9f | ||
|
|
577bf9ec83 | ||
|
|
f36f1d2e29 | ||
|
|
7277c932fe | ||
|
|
8608836fe6 | ||
|
|
cae033fb2f | ||
|
|
b644d21826 | ||
|
|
7b53e5d48b | ||
|
|
07fe9557df | ||
|
|
f321a9663a | ||
|
|
ab98050ad1 | ||
|
|
e38d0c76d9 | ||
|
|
b0ff4e57ad | ||
|
|
f997021c0d | ||
|
|
72cf70617d | ||
|
|
fd3bddf540 | ||
|
|
5e763a4ce3 | ||
|
|
94a48d9008 | ||
|
|
96535a2dd4 | ||
|
|
777b57703a | ||
|
|
104499ab57 | ||
|
|
658bfd2b0d | ||
|
|
830a92c486 | ||
|
|
3e5b205de2 | ||
|
|
5099ac6827 | ||
|
|
a5fd41820b | ||
|
|
d1f58a7bfc | ||
|
|
1ced991ce4 | ||
|
|
68020e7832 | ||
|
|
61bfe8d130 | ||
|
|
ff6c981863 | ||
|
|
4b0eb2b003 | ||
|
|
4380c800a3 | ||
|
|
2aa4eebc90 | ||
|
|
685c2b30d6 | ||
|
|
3f2933699b | ||
|
|
d5c5eaef1e | ||
|
|
9ed09ccc14 | ||
|
|
e0be1236c1 | ||
|
|
dba49aa67d | ||
|
|
6c8f75d3e7 | ||
|
|
0eead7634c | ||
|
|
1c9ad8d48d | ||
|
|
d655becef5 | ||
|
|
d90e45c547 | ||
|
|
450a98e910 | ||
|
|
99eead9640 | ||
|
|
9a4aadc14d | ||
|
|
15489610c7 | ||
|
|
c158a6756a | ||
|
|
5da911fe0f | ||
|
|
3f2871acea | ||
|
|
b48a0e074c | ||
|
|
de2c1435fe | ||
|
|
cee91ca686 | ||
|
|
bc86fb1c42 | ||
|
|
0b86055c1b | ||
|
|
ded48eb876 | ||
|
|
bb13b0921c | ||
|
|
206b4ca0e1 | ||
|
|
d86de9d83b | ||
|
|
125360841d | ||
|
|
28a0e51cb5 | ||
|
|
1b5c479765 | ||
|
|
d37ab6ced4 | ||
|
|
5e2afac13c | ||
|
|
979670a7aa | ||
|
|
5f3023208e | ||
|
|
bc91882282 | ||
|
|
13dc420032 | ||
|
|
1aad11a320 | ||
|
|
3b76166015 | ||
|
|
ff95db85bb | ||
|
|
bd15139d1a | ||
|
|
d6a27330ac | ||
|
|
3bc9179f08 | ||
|
|
4c6d9774df | ||
|
|
c89fb16d10 | ||
|
|
1a9b7ca592 | ||
|
|
f6f333923f | ||
|
|
10d12d6083 | ||
|
|
ba0d0e42bd | ||
|
|
0954bbc876 | ||
|
|
a18618dcf4 | ||
|
|
e68729e8c0 | ||
|
|
d017dde4fa | ||
|
|
8060dc7499 | ||
|
|
6407f87d6c | ||
|
|
383b9f1368 | ||
|
|
d96d91049d | ||
|
|
3305bc5f10 | ||
|
|
0ac1ebe7cd | ||
|
|
eed2016c6f | ||
|
|
b248527726 | ||
|
|
17b493d0aa | ||
|
|
b2bac7e88a | ||
|
|
3d50b62475 | ||
|
|
81d2e6ae72 | ||
|
|
36b7584476 | ||
|
|
1b0af59b81 | ||
|
|
ea761bd83d | ||
|
|
d05cd589e8 | ||
|
|
e3883024fe | ||
|
|
34bf6aa604 | ||
|
|
98dfa77c0a | ||
|
|
f381eafe9d | ||
|
|
2f0c8ec695 | ||
|
|
07c048e126 | ||
|
|
30beda6da1 | ||
|
|
a691435125 | ||
|
|
08af36d308 | ||
|
|
cc47c888c7 | ||
|
|
259dfec08f | ||
|
|
9e365463b5 | ||
|
|
af8c869a22 | ||
|
|
f6cbbd00e9 | ||
|
|
05dd5b4f6f | ||
|
|
a928857db6 | ||
|
|
cfe425d67f | ||
|
|
2e64c18e50 | ||
|
|
1a662290e5 | ||
|
|
1c318e7685 | ||
|
|
5ab6c51f1e | ||
|
|
54cb7115e5 | ||
|
|
6cf0f8f224 | ||
|
|
7526043856 | ||
|
|
328d52a146 | ||
|
|
154519cf1b | ||
|
|
839e8f7243 | ||
|
|
a5287682d0 | ||
|
|
37ab531cf2 | ||
|
|
88c2f0f5f5 | ||
|
|
a9b0bd577e | ||
|
|
88029fa467 | ||
|
|
686360ce39 | ||
|
|
3903b2d5ce | ||
|
|
f85fbaecbc | ||
|
|
75deb00d1e | ||
|
|
50419aea1f | ||
|
|
addfe79b5f | ||
|
|
5e5f37cd11 | ||
|
|
f2d130e2c4 | ||
|
|
2ae97b6d0e | ||
|
|
a7f3f75ca8 | ||
|
|
ea0e9eab23 | ||
|
|
23792bdc13 | ||
|
|
2d01f1a7cb | ||
|
|
c7d3cd7c3b | ||
|
|
836846c0f9 | ||
|
|
eeb47fac23 | ||
|
|
69610d08b8 | ||
|
|
e8840ebb00 | ||
|
|
a682ddabda | ||
|
|
9fe7a411d5 | ||
|
|
ab69ca30e4 | ||
|
|
7c86eaf665 | ||
|
|
aee5e65dff | ||
|
|
583f367d9d | ||
|
|
57059ba2f1 | ||
|
|
548f2c233b | ||
|
|
1024de7d05 | ||
|
|
65e5046af8 | ||
|
|
30a552da36 | ||
|
|
78f8d97563 | ||
|
|
1c0a147fa4 | ||
|
|
473be41ab8 | ||
|
|
e5291af6ea | ||
|
|
bf75433755 | ||
|
|
a98d16652b | ||
|
|
93ad473a7d | ||
|
|
f4b794c8db | ||
|
|
a5380e59da | ||
|
|
8834d1e55d | ||
|
|
6a4b14dfc6 | ||
|
|
f697e02849 | ||
|
|
25c4ca5117 | ||
|
|
518e780104 | ||
|
|
5d0cd1ecdc | ||
|
|
1a0d90f0a6 | ||
|
|
e227f3afe1 | ||
|
|
3016b05731 | ||
|
|
3ddda6203e | ||
|
|
d82c50fb79 | ||
|
|
951632f453 | ||
|
|
53d830e3ee | ||
|
|
1b840f97e2 | ||
|
|
0c83eb95db | ||
|
|
9199a70e4b | ||
|
|
76ad9802b0 | ||
|
|
85465159e5 | ||
|
|
7848e7c0b8 | ||
|
|
3a99c29028 | ||
|
|
173442f714 | ||
|
|
42a0757862 | ||
|
|
fbbf18e9f4 | ||
|
|
228c102ffc | ||
|
|
b1bb4b4bcf | ||
|
|
7ee7235d1e | ||
|
|
38e464edaf | ||
|
|
e9fff1231d | ||
|
|
e70d1ae765 | ||
|
|
d971925dd5 | ||
|
|
0853baa2dd | ||
|
|
dab1361cf5 | ||
|
|
62c06a221a | ||
|
|
b08d969d25 | ||
|
|
bb0a325a71 | ||
|
|
1cd90530e8 | ||
|
|
b7205320e3 | ||
|
|
7571f8daec | ||
|
|
8cd31c844d | ||
|
|
a42a4c025c | ||
|
|
0d2d91ef09 | ||
|
|
06c81cf52b | ||
|
|
8f9fe4fdb8 | ||
|
|
5dd96a55d4 | ||
|
|
d36b7956b1 | ||
|
|
5daa0b0bea | ||
|
|
1483043e66 | ||
|
|
95a7f9e9b3 | ||
|
|
2d249162b9 | ||
|
|
f488cb0adc | ||
|
|
1c4c7b6d1c | ||
|
|
649dd52d77 | ||
|
|
005236d886 | ||
|
|
3da957018c | ||
|
|
d7d8b1e4c5 | ||
|
|
a39a86b73d | ||
|
|
5872e4bac0 | ||
|
|
9c8b4a650a | ||
|
|
fa85806ba5 | ||
|
|
f06298e3c3 | ||
|
|
528fc1dcbb | ||
|
|
a254044d3d | ||
|
|
6b4ebaf9b5 | ||
|
|
68fb354ee9 | ||
|
|
eca3763f4f | ||
|
|
34fc53c8d1 | ||
|
|
97790e3b2c | ||
|
|
ea595d9d42 | ||
|
|
1e3fc8baf4 | ||
|
|
3ec7ce333f | ||
|
|
2e6a7a99ac | ||
|
|
a695d25e69 | ||
|
|
e890c02313 | ||
|
|
348367968c | ||
|
|
fc1c1164c7 | ||
|
|
11c1437ce6 | ||
|
|
9b11bed4cf | ||
|
|
e94b8e210d | ||
|
|
b87236df92 | ||
|
|
bf32e4c6c9 | ||
|
|
f78c3017eb | ||
|
|
ac889bfa5b | ||
|
|
cee76fa119 | ||
|
|
5fc346e99b | ||
|
|
d3144edf04 | ||
|
|
48edcef0a9 | ||
|
|
aa6c162200 | ||
|
|
7343983db5 | ||
|
|
1225ca023c | ||
|
|
3d5ae7c4e0 | ||
|
|
3d14b0b766 | ||
|
|
c3c368f513 | ||
|
|
a02287cd39 | ||
|
|
73cc66c7ee | ||
|
|
9253095281 | ||
|
|
e81d4993bf | ||
|
|
98973eb80e | ||
|
|
a89e5957be | ||
|
|
9fae9ab40f | ||
|
|
90afe4f08d | ||
|
|
6a4ed210d2 | ||
|
|
f3e39682b8 | ||
|
|
95dc638191 | ||
|
|
6a5bd747af | ||
|
|
e8d0f25947 | ||
|
|
01544d03ef | ||
|
|
0bd721710d | ||
|
|
d7d2cc62af | ||
|
|
d594a79e25 | ||
|
|
2855fb6bc5 | ||
|
|
c2372e66af | ||
|
|
3f42fc5d65 | ||
|
|
0fc35f0dc2 | ||
|
|
0acdd6e04c | ||
|
|
ae4308f0fa | ||
|
|
513738a22d | ||
|
|
ac03592101 | ||
|
|
37d70849ec | ||
|
|
6d67490942 | ||
|
|
b69cca3647 | ||
|
|
0799f3c444 | ||
|
|
418efe032c | ||
|
|
b61da487a5 | ||
|
|
e9f0a95930 | ||
|
|
f0fa91914e | ||
|
|
11330b7a47 | ||
|
|
ba66b987e2 | ||
|
|
e64b09213b | ||
|
|
4faeb8c5b9 | ||
|
|
3313dc74f5 | ||
|
|
1c8d63f3fd | ||
|
|
6bab2dd21c | ||
|
|
5cf159586c | ||
|
|
6774e7b359 | ||
|
|
256a412b7c | ||
|
|
36e0d763f5 | ||
|
|
998d630b4b | ||
|
|
81b20ea2ee | ||
|
|
3f13b84a79 | ||
|
|
7673ce76b2 | ||
|
|
ef859348fb | ||
|
|
1ce7a69bbc | ||
|
|
23fa8cd932 | ||
|
|
ddf24dcc87 | ||
|
|
0f71e715e9 | ||
|
|
4f56770b56 | ||
|
|
43a396e471 | ||
|
|
c990670bbb | ||
|
|
4dc02731df | ||
|
|
c40f425797 | ||
|
|
6e6cf09f6e | ||
|
|
e7cd1702cc | ||
|
|
c7488b9155 | ||
|
|
8f2caba4a5 | ||
|
|
dbb723daac | ||
|
|
5cb1e63e69 | ||
|
|
7f23ed50f6 | ||
|
|
2ab9e02d3c | ||
|
|
e515d88a0b | ||
|
|
12b08f546a | ||
|
|
5c13d0bc55 | ||
|
|
e97d484e38 | ||
|
|
a6014ebc79 | ||
|
|
f9f480e814 | ||
|
|
1caa07032e | ||
|
|
877c4c6039 | ||
|
|
974112e619 | ||
|
|
1a26c64e61 | ||
|
|
d9e6df8251 | ||
|
|
2256722096 | ||
|
|
1a01996ff4 | ||
|
|
dd27034dc3 | ||
|
|
d9026e7505 | ||
|
|
621a72c333 | ||
|
|
b433d9e68e | ||
|
|
42df2960ad | ||
|
|
257bd207ee | ||
|
|
e011f1a4ad | ||
|
|
77abe49c7a | ||
|
|
887277f3d1 | ||
|
|
ff11ca0582 | ||
|
|
92722e2691 | ||
|
|
ee1041d969 | ||
|
|
972cb4291d | ||
|
|
6a41e52024 | ||
|
|
41c0061aa0 | ||
|
|
53b960b546 | ||
|
|
925df2e54e | ||
|
|
ac70d0e571 | ||
|
|
2a839f6b07 | ||
|
|
35952d05ff | ||
|
|
09c5f96d53 | ||
|
|
a5a9d933bf | ||
|
|
9870d01354 | ||
|
|
3276c8b8b9 | ||
|
|
3acb254e4f | ||
|
|
98bdd28afd | ||
|
|
546e055449 | ||
|
|
65482f00db | ||
|
|
03a293959e | ||
|
|
73db02b60d | ||
|
|
cb24964f97 | ||
|
|
6c0a4d3d36 | ||
|
|
ed75389ff4 | ||
|
|
62cbf56fcb | ||
|
|
9e4e622b89 | ||
|
|
a779dc4dbd | ||
|
|
857379b440 | ||
|
|
2f0dd2795a | ||
|
|
0b3e27ed04 | ||
|
|
0049d2bab2 | ||
|
|
763bf9be57 | ||
|
|
ff44777c6d | ||
|
|
fb3bb98d54 | ||
|
|
70a93a4d34 | ||
|
|
6c5d290835 | ||
|
|
a1565e26e9 | ||
|
|
e1981aef7c | ||
|
|
a58ac9775b | ||
|
|
a2912919a1 | ||
|
|
5776b7cd69 | ||
|
|
9007f98ced | ||
|
|
0668dc2d9e | ||
|
|
99dc44d896 | ||
|
|
718cc983e5 | ||
|
|
2bb78c50fb | ||
|
|
7bafbdfd59 | ||
|
|
412d579048 | ||
|
|
ff178e3b05 | ||
|
|
aff2fb9b70 | ||
|
|
5b456b6580 | ||
|
|
f7c7570d13 | ||
|
|
c22e765464 | ||
|
|
cbc9f7a034 | ||
|
|
837451ab79 | ||
|
|
730a9adccd | ||
|
|
96db250251 | ||
|
|
9e917c139e | ||
|
|
b623c88b9b | ||
|
|
2d7ed1d085 | ||
|
|
59e65e6cfd | ||
|
|
25e072b3b1 | ||
|
|
8450425827 | ||
|
|
cbda84ce9a | ||
|
|
a12baf0062 | ||
|
|
8e2d7232a1 | ||
|
|
873c7c41f1 | ||
|
|
7abd313d9a | ||
|
|
1c2c095fa9 | ||
|
|
1777628740 | ||
|
|
2f4e1e7e80 | ||
|
|
1bfe81db25 | ||
|
|
cf4f22d267 | ||
|
|
8b8f7be6e0 | ||
|
|
d6715d1a27 | ||
|
|
70cfd84837 | ||
|
|
2006a5dcbc | ||
|
|
9f7da1e5a1 | ||
|
|
bada0bdfd4 | ||
|
|
b70b5f2a9f | ||
|
|
d5948b5595 | ||
|
|
1de90e9912 | ||
|
|
9b8fc29991 | ||
|
|
0f1818b852 | ||
|
|
df523c7f3f | ||
|
|
45ba451cf2 | ||
|
|
7c9beb6cee | ||
|
|
989a9c5098 | ||
|
|
ec03837d61 | ||
|
|
fc7ea18156 | ||
|
|
173c394784 | ||
|
|
648f7f8445 | ||
|
|
14d5fbf8f4 | ||
|
|
27eb64ffac | ||
|
|
aa1f120ad2 | ||
|
|
e48cdcaba0 | ||
|
|
0e6ed30cec | ||
|
|
158cc0a55a | ||
|
|
20e72d5a81 | ||
|
|
1699ebd77f | ||
|
|
1c89aac2ff | ||
|
|
f105ba21ad | ||
|
|
82c5299d48 | ||
|
|
bbd48b7f10 | ||
|
|
d5786cc957 | ||
|
|
5071799241 | ||
|
|
013d74146c | ||
|
|
ce3dbc58b3 | ||
|
|
44fe0c6f90 | ||
|
|
266c49886e | ||
|
|
03ce51e39b | ||
|
|
4630370436 | ||
|
|
09ec038700 | ||
|
|
9e5358f864 | ||
|
|
936ce6263f | ||
|
|
4702ff93d5 | ||
|
|
cd6a74b2ee | ||
|
|
394bc5f716 | ||
|
|
e590aba2ba | ||
|
|
9b65fc77a6 | ||
|
|
6bd0738f4b | ||
|
|
302690795b | ||
|
|
576c963b24 | ||
|
|
ab65be7acb | ||
|
|
4e7d67c911 | ||
|
|
9c1d79ec7d | ||
|
|
3659e4fc69 | ||
|
|
b8e031856c | ||
|
|
34670b98a6 | ||
|
|
1c00fd4351 | ||
|
|
030c21d372 | ||
|
|
dae1164d3c | ||
|
|
6c9c4511ac | ||
|
|
07b7570def | ||
|
|
a54de8bc93 | ||
|
|
4724265316 | ||
|
|
2b69df26d0 | ||
|
|
7b24239720 | ||
|
|
80423c9e4c | ||
|
|
89aa3585ff | ||
|
|
23d77b2d05 | ||
|
|
a4ae7189b9 | ||
|
|
5c6ecdf5b4 | ||
|
|
141ddc7c4a | ||
|
|
e3594187c3 | ||
|
|
882df1293f | ||
|
|
524c530415 | ||
|
|
1b4a54de24 | ||
|
|
de692ebf95 | ||
|
|
4978522b21 | ||
|
|
7fdc0d7356 | ||
|
|
987a3cacbb | ||
|
|
3f231fbb04 | ||
|
|
506f4caedc | ||
|
|
313641a2e0 | ||
|
|
555fa9a28c | ||
|
|
59f6871a66 | ||
|
|
432554f99c | ||
|
|
ff3d03047a | ||
|
|
aa7912b714 | ||
|
|
33743283bc | ||
|
|
1ec02ea8c6 | ||
|
|
63c4d9132f | ||
|
|
fdeda61d60 | ||
|
|
6643e7f696 | ||
|
|
d24fb0bb58 | ||
|
|
52e618b0a1 | ||
|
|
27c0eb3741 | ||
|
|
acff0c9756 | ||
|
|
3118275cda | ||
|
|
d9ec0c8c49 | ||
|
|
af53c71b8f | ||
|
|
3088b5e5c9 | ||
|
|
cb5412fec1 | ||
|
|
924a4cf19e | ||
|
|
e705f5f4c5 | ||
|
|
a1e449191e | ||
|
|
4c56fdde6a | ||
|
|
5bed2f5a8e | ||
|
|
116dcae01b | ||
|
|
5de2d189ad | ||
|
|
9a6168f871 | ||
|
|
7b6f239cdd | ||
|
|
de65acf412 | ||
|
|
c6a2544e60 | ||
|
|
6efa918487 | ||
|
|
51eeb9637f | ||
|
|
05c1025899 | ||
|
|
476a1798f6 | ||
|
|
d407645d8d | ||
|
|
2a860da0e2 | ||
|
|
78b43f95c7 | ||
|
|
1c1bb330b4 | ||
|
|
bff11c2035 | ||
|
|
c7799e704a | ||
|
|
16bf1ad3b0 | ||
|
|
4953a21538 | ||
|
|
4b61c6e74b | ||
|
|
bb2de43dec | ||
|
|
3d70bffb37 | ||
|
|
00ed8594fc | ||
|
|
710df75fcf | ||
|
|
7348cad232 | ||
|
|
b929c3ec29 | ||
|
|
6fbc0710da | ||
|
|
7eb2545d4e | ||
|
|
81538898b2 | ||
|
|
0f93ec2b24 | ||
|
|
c44f140927 | ||
|
|
e87b38aa53 | ||
|
|
4401aaf2d3 | ||
|
|
367cb980be | ||
|
|
6dc99f5574 | ||
|
|
adfe8d3886 | ||
|
|
0ac81e6a10 | ||
|
|
a47c1a31ad | ||
|
|
c754382b89 | ||
|
|
936ce51b66 | ||
|
|
072cca8e6b | ||
|
|
4aba44d87f | ||
|
|
7254e97d91 | ||
|
|
2037cfac74 | ||
|
|
223522b1c7 | ||
|
|
1c49078b86 | ||
|
|
57d22430fc | ||
|
|
b7b72cf870 | ||
|
|
19b1c0f991 | ||
|
|
273300a61d | ||
|
|
33e36c0355 | ||
|
|
52864745e4 | ||
|
|
b4426e6d24 | ||
|
|
78d8a6a64a | ||
|
|
140256d348 | ||
|
|
f8868ee5c6 | ||
|
|
7cd402bc62 | ||
|
|
6e72bf0ae9 | ||
|
|
1c73ad580c | ||
|
|
04c0eb8f27 | ||
|
|
726895214f | ||
|
|
b378a449b5 | ||
|
|
ff5a649cd6 | ||
|
|
9270a2f0f3 | ||
|
|
f30697f09b | ||
|
|
ca964b0eb8 | ||
|
|
853fabadb3 | ||
|
|
112ea23194 | ||
|
|
d0716e25f2 | ||
|
|
fb5244c0e6 | ||
|
|
0dc53e3787 | ||
|
|
10885c866c | ||
|
|
6ce6e59974 | ||
|
|
c687fb8237 | ||
|
|
c5d45cb3f0 | ||
|
|
b9aca75c6f | ||
|
|
83afd6c429 | ||
|
|
389847bf2f | ||
|
|
e35de07e9e | ||
|
|
5e034e0b01 | ||
|
|
a480b1595e | ||
|
|
210f72effd | ||
|
|
0358d48454 | ||
|
|
77184086ab | ||
|
|
35f4d49289 | ||
|
|
e7e1156369 | ||
|
|
dcd9d627e2 | ||
|
|
b759e8a898 | ||
|
|
627f14460d | ||
|
|
abc2fd0c21 | ||
|
|
292818610e | ||
|
|
f3c92a7f74 | ||
|
|
88d70f7056 | ||
|
|
503ff60735 | ||
|
|
df3037ce8f | ||
|
|
50faac2f4f | ||
|
|
63dd04cc32 | ||
|
|
a6b1db6c79 | ||
|
|
def18ed292 | ||
|
|
29e5d2df79 | ||
|
|
cc997900c8 | ||
|
|
9e4a179899 | ||
|
|
9f6b62a342 | ||
|
|
4ded152850 | ||
|
|
884fb2faa9 | ||
|
|
19746d03d1 | ||
|
|
27c33865a6 | ||
|
|
5008ee4fc7 | ||
|
|
49fbc67d29 | ||
|
|
b5830d65f6 | ||
|
|
75e03b3793 | ||
|
|
672cb74c9a | ||
|
|
f121d2641f | ||
|
|
fd90a3c137 | ||
|
|
7f89d5b068 | ||
|
|
10664a3f38 | ||
|
|
ac68e37472 | ||
|
|
1499b23cb9 | ||
|
|
7e0450dd05 | ||
|
|
db59d134be | ||
|
|
6bbe5c1eb2 | ||
|
|
1c015b6cde | ||
|
|
f3eb155241 | ||
|
|
b1f08386ad | ||
|
|
0d9a5f54c2 | ||
|
|
0a3faa8b12 | ||
|
|
3f2715b53c | ||
|
|
9125e3e7f2 | ||
|
|
4df95a63f2 | ||
|
|
7ec952d432 | ||
|
|
6922b1b34c | ||
|
|
b48de42683 | ||
|
|
38e740bf43 | ||
|
|
0f53c8eba6 | ||
|
|
fd35c77b63 | ||
|
|
d5674ec982 | ||
|
|
577a80f8bc | ||
|
|
7a69073a8c | ||
|
|
9b91624038 | ||
|
|
d3375305d3 | ||
|
|
c720e20612 | ||
|
|
57d38e3d84 | ||
|
|
44ab535148 | ||
|
|
ed74a0e3d2 | ||
|
|
4eef8b4b0d | ||
|
|
e1d1065156 | ||
|
|
fd293220f5 | ||
|
|
045ed9f2f1 | ||
|
|
c78cb554cd | ||
|
|
d554d2eac6 | ||
|
|
e720cb1f3b | ||
|
|
29ad71cd78 | ||
|
|
42e4524c44 | ||
|
|
18cd4bbc25 | ||
|
|
ab54c8ed65 | ||
|
|
313a6681b9 | ||
|
|
f24f260200 | ||
|
|
fdabe46603 | ||
|
|
30aea18914 | ||
|
|
827dcbaee6 | ||
|
|
e7c22b1311 | ||
|
|
396d42c44d | ||
|
|
64d5e97771 | ||
|
|
9b2e490b30 | ||
|
|
aea9e8f707 | ||
|
|
a64dd3ccd8 | ||
|
|
c442661fbd | ||
|
|
268d5eba7c | ||
|
|
beccb0f6db | ||
|
|
7ba196cbb9 | ||
|
|
df9c77bd06 | ||
|
|
bc7843b337 | ||
|
|
c33c53348b | ||
|
|
2caf827d2e | ||
|
|
80ab62225c | ||
|
|
c70b4a6237 | ||
|
|
708a94c99d | ||
|
|
198c3ea5c8 | ||
|
|
b7beb137e0 | ||
|
|
b78b334426 | ||
|
|
e8875e171f | ||
|
|
4cdc1fd841 | ||
|
|
b4e165fbb5 | ||
|
|
534b59d702 | ||
|
|
2d91c1c57d | ||
|
|
78b5f12272 | ||
|
|
c1dade3c3f | ||
|
|
42f32bdac1 | ||
|
|
25a03359e9 | ||
|
|
1bcc755706 | ||
|
|
33cd8dc262 | ||
|
|
c0b73e702b | ||
|
|
81d3f66232 | ||
|
|
3549a6eaf7 | ||
|
|
eea8d4e9d1 | ||
|
|
0c2a91c9f7 | ||
|
|
e8388502ed | ||
|
|
8a018d0063 | ||
|
|
cf6fc83127 | ||
|
|
0ad6f69b9c | ||
|
|
4f1dd4be36 | ||
|
|
e611453c21 | ||
|
|
47b9755b4b | ||
|
|
01550df79d | ||
|
|
37c3a9e180 | ||
|
|
cd791d84b0 | ||
|
|
fb68ab2f87 | ||
|
|
22ef87ad80 | ||
|
|
1a38d502a2 | ||
|
|
ae024b2ea7 | ||
|
|
e80d1e731c | ||
|
|
3a1f99ff86 | ||
|
|
79b8b17328 | ||
|
|
a92fd87906 | ||
|
|
ca3f38f31d | ||
|
|
79696f8b47 | ||
|
|
e394e30789 | ||
|
|
4e9cc28dc4 | ||
|
|
87cca72287 | ||
|
|
80e4d73317 | ||
|
|
95e7452d66 | ||
|
|
af49f70dd4 | ||
|
|
cb22ea7541 | ||
|
|
466b08abc7 | ||
|
|
9eb2d25c3f | ||
|
|
d067bed510 | ||
|
|
1246035bbd | ||
|
|
d90f909c00 | ||
|
|
758f13fc2b | ||
|
|
84792f1bbd | ||
|
|
dd4d887489 | ||
|
|
b6e7a0be4f | ||
|
|
38db378f0d | ||
|
|
4c14f6f93d | ||
|
|
257bdac9c7 | ||
|
|
e361365078 | ||
|
|
19a765feb9 | ||
|
|
4566fae6e1 | ||
|
|
686e6c0300 | ||
|
|
3750629750 | ||
|
|
963c9d8a0e | ||
|
|
576e7cb3ad | ||
|
|
dfd85d0175 | ||
|
|
a151a381f0 | ||
|
|
36cdfc3112 | ||
|
|
ec4c4239f4 | ||
|
|
f17987410e | ||
|
|
685b223728 | ||
|
|
aab066aa64 | ||
|
|
82e4b97e03 | ||
|
|
a66e007d50 | ||
|
|
9f362e89d6 | ||
|
|
d56b825bdd | ||
|
|
e41243cd2f | ||
|
|
4a5867d944 | ||
|
|
b84729158f | ||
|
|
3932bcf6a4 | ||
|
|
fba63d84ea | ||
|
|
adadddb611 | ||
|
|
3324c90747 | ||
|
|
6786f1f754 | ||
|
|
e781805381 | ||
|
|
f4f94f4f85 | ||
|
|
a32416c64e | ||
|
|
7d32b716c4 | ||
|
|
90f068290b | ||
|
|
8b053f8b97 | ||
|
|
27024f0be0 | ||
|
|
4798cdef28 | ||
|
|
6d08bd413e | ||
|
|
1edcc74fd4 | ||
|
|
2295b6ad58 | ||
|
|
b8103f0e7c | ||
|
|
272cfdb30a | ||
|
|
73be668fc1 | ||
|
|
1ef840cd02 | ||
|
|
df2a2c41c4 | ||
|
|
788839cc56 | ||
|
|
8c79115af9 | ||
|
|
0d904c242a | ||
|
|
ba7e061a23 | ||
|
|
5114cd1f47 | ||
|
|
a4442eef5e | ||
|
|
c7c1214e43 | ||
|
|
0e60a2f323 | ||
|
|
33a58c88f6 | ||
|
|
28876851e7 | ||
|
|
b23e49a11b | ||
|
|
b891b13fc1 | ||
|
|
973ec3ddef | ||
|
|
5d95b6fad1 | ||
|
|
ebdfcc3e56 | ||
|
|
45bbc0b368 | ||
|
|
28a89d012e | ||
|
|
0570558293 | ||
|
|
d64cf914e2 | ||
|
|
5b59d0ebe0 | ||
|
|
d31407e063 | ||
|
|
25e42e316d | ||
|
|
9d8ab73c29 | ||
|
|
2eb8e76000 | ||
|
|
796d066a6c | ||
|
|
d2635919f6 | ||
|
|
80184b6d2e | ||
|
|
0de05a8532 | ||
|
|
3157df712b | ||
|
|
b0c1451fad | ||
|
|
d2615078db | ||
|
|
9db04e37ba | ||
|
|
e9f862658f | ||
|
|
993ddb8790 | ||
|
|
2e16d90cf5 | ||
|
|
d56ec6855f | ||
|
|
26c58ea965 | ||
|
|
7003e1d8dd | ||
|
|
d977e3a5a8 | ||
|
|
5f6aa78bd6 | ||
|
|
ea9d458356 | ||
|
|
4badc46160 | ||
|
|
5d109c271d | ||
|
|
bf53bac167 | ||
|
|
62c9921beb | ||
|
|
06fb9f9266 | ||
|
|
5765014072 | ||
|
|
6037109eee | ||
|
|
5070e3454b | ||
|
|
7fc57c4ada | ||
|
|
6fd070aa3e | ||
|
|
216bfad7d3 | ||
|
|
2aac12ab24 | ||
|
|
2ab52b7d8c | ||
|
|
8eb1c54e69 | ||
|
|
1013a47a37 | ||
|
|
32b123123a | ||
|
|
6e178fe3ec | ||
|
|
fbf3bce170 | ||
|
|
2a2698d4ba | ||
|
|
4638b624b0 | ||
|
|
c0cd4e18dc | ||
|
|
d345ee19a3 | ||
|
|
90ffa7b2d1 | ||
|
|
daf330944a | ||
|
|
869f43c9af | ||
|
|
a5d1ed4dec | ||
|
|
4e30c1ed9b | ||
|
|
1b3b3b61e0 | ||
|
|
6f4bc49014 | ||
|
|
d7ea3162e2 | ||
|
|
ebf1589eab | ||
|
|
66a5a3ec3d | ||
|
|
daa3eb8bad | ||
|
|
e50f56ea44 | ||
|
|
8dc645345b | ||
|
|
fc136169c4 | ||
|
|
2c3ece8c39 | ||
|
|
13345ed9e4 | ||
|
|
0752f06abf | ||
|
|
859f88dc01 | ||
|
|
a156fcff67 | ||
|
|
6c7db911cf | ||
|
|
0633aead5c | ||
|
|
c1afec7546 | ||
|
|
2ac532b604 | ||
|
|
4948e22858 | ||
|
|
8272d1dc13 | ||
|
|
99f69a24c7 | ||
|
|
8b2754ab0a | ||
|
|
e5511a1b03 | ||
|
|
2444587978 | ||
|
|
e5d3e2872c | ||
|
|
726834e7c7 | ||
|
|
c6128ffc96 | ||
|
|
24a89fcd96 | ||
|
|
be940800a5 | ||
|
|
d5e0db2a2a | ||
|
|
c7bbfcb49a | ||
|
|
f5fc9a9a50 | ||
|
|
4f8c4f4f3f | ||
|
|
2dd7f03c93 | ||
|
|
75c2936c6c | ||
|
|
c301b4ce0d | ||
|
|
ced478fdca | ||
|
|
cfe0f5dd68 | ||
|
|
4f9bca11f4 | ||
|
|
2f824e1be2 | ||
|
|
900d5eb327 | ||
|
|
a29df33b95 | ||
|
|
0471bcb75f | ||
|
|
dadaa040b4 | ||
|
|
3aa88f01da | ||
|
|
f7f3287379 | ||
|
|
2f29279c97 | ||
|
|
0c31599d19 | ||
|
|
5d87186127 | ||
|
|
54efa67c9c | ||
|
|
c315f1feef | ||
|
|
7bf9b0d245 | ||
|
|
e606fd5101 | ||
|
|
8b3c8910e1 | ||
|
|
c793cd2c2f | ||
|
|
dae98d3fd4 | ||
|
|
b6ca4ae39d | ||
|
|
8b9a34d5b6 | ||
|
|
d6037100de | ||
|
|
17fc4188d7 | ||
|
|
7683c15f8d | ||
|
|
ce0125a302 | ||
|
|
ba1adec98f | ||
|
|
a4e00bab11 | ||
|
|
fa4633a1ef | ||
|
|
017914cb18 | ||
|
|
da4fa7bae9 | ||
|
|
178b33545f | ||
|
|
f726fb7294 | ||
|
|
66e1af371c | ||
|
|
b7bca38126 | ||
|
|
83dd0e6174 | ||
|
|
6a6cdd1a32 | ||
|
|
24d6947d36 | ||
|
|
943ce362e5 | ||
|
|
c068cb2d72 | ||
|
|
7be103ef65 | ||
|
|
0a91fa3e01 | ||
|
|
e69e3c6756 | ||
|
|
9695d7b84e | ||
|
|
5cfcd397a4 | ||
|
|
34cedb77f3 | ||
|
|
95d81ac9f8 | ||
|
|
bf74302662 | ||
|
|
26da36faa8 | ||
|
|
d760d301cb | ||
|
|
6af5ea6c8c | ||
|
|
a645b491be | ||
|
|
5fe7dbdaf1 | ||
|
|
e9c2ca4ff5 | ||
|
|
f703a9093b | ||
|
|
8eb3d835f5 | ||
|
|
bb8082739a | ||
|
|
7b4f5766fb | ||
|
|
52a40b00f2 | ||
|
|
85823c45ff | ||
|
|
d6b573914e | ||
|
|
9ff6457124 | ||
|
|
d5a521c2fd | ||
|
|
61a4311bb4 | ||
|
|
1d5099eed0 | ||
|
|
ef3655f318 | ||
|
|
1e27fd1de0 | ||
|
|
d3a8560dec | ||
|
|
faee98e2ab | ||
|
|
c321034d69 | ||
|
|
aea3e978b0 | ||
|
|
b3849826e3 | ||
|
|
8fd1030556 | ||
|
|
1164595d85 | ||
|
|
6357611caa | ||
|
|
6eb8745897 | ||
|
|
4f1a68363a | ||
|
|
c22f1338ce | ||
|
|
1e0f3c5c9d | ||
|
|
7d55dbd3a1 | ||
|
|
3bd1eee1bb | ||
|
|
2c98c7855f | ||
|
|
f8d46316c4 | ||
|
|
8b05b3ae8d | ||
|
|
7c55c818e3 | ||
|
|
733b050ad8 | ||
|
|
1de839406d | ||
|
|
39a383b246 | ||
|
|
991ebf2d5f | ||
|
|
1090ecb6d6 | ||
|
|
fcea0470ad | ||
|
|
0136734f73 | ||
|
|
e372a32857 | ||
|
|
0fb705b775 | ||
|
|
10debca24f | ||
|
|
46d401ea1a | ||
|
|
835d8368a9 | ||
|
|
b0fb856843 | ||
|
|
22dc7a774c | ||
|
|
26540757dc | ||
|
|
2495bbd97f | ||
|
|
0caf35299a | ||
|
|
2793ecf07d | ||
|
|
4b688776d2 | ||
|
|
226205413a | ||
|
|
62f4f9c75f | ||
|
|
ddb15dbdc1 | ||
|
|
a28b75a50b | ||
|
|
805f6d48f3 | ||
|
|
1852c939b5 | ||
|
|
63d147131f | ||
|
|
5bac00777e | ||
|
|
ac38f35c68 | ||
|
|
b8409025f3 | ||
|
|
32e8447daa | ||
|
|
94f40cd337 | ||
|
|
1bc5ba612c | ||
|
|
74f35535e8 | ||
|
|
92632251a7 | ||
|
|
6b4a7479e4 | ||
|
|
02e23d2ab5 | ||
|
|
d33c8390e7 | ||
|
|
a4f5ab0e5b | ||
|
|
2a2ef3781d | ||
|
|
e959765710 | ||
|
|
12faa5b099 | ||
|
|
323484f4d5 | ||
|
|
dad8168f02 | ||
|
|
2f29c80bd1 | ||
|
|
f0acdf1303 | ||
|
|
37ea7f735e | ||
|
|
95d85d43c1 | ||
|
|
187fcbdd45 | ||
|
|
c8dd0cacff | ||
|
|
280c6b26d7 | ||
|
|
f0cfec5386 | ||
|
|
f3a375fd40 | ||
|
|
85bc313b89 | ||
|
|
b4f645e126 | ||
|
|
8ca0c05a1f | ||
|
|
ddfbb0a5fe | ||
|
|
3e5ae891e2 | ||
|
|
2743f4b3a4 | ||
|
|
94fa880ff4 | ||
|
|
9fb55f539f | ||
|
|
120badb432 | ||
|
|
9e9bc84333 | ||
|
|
a75e3e89a1 | ||
|
|
8ead73d8f5 | ||
|
|
314359935b | ||
|
|
b5c85c7e5e | ||
|
|
a4c7680f4b | ||
|
|
71905eabe2 | ||
|
|
f47a79778a | ||
|
|
297768b947 | ||
|
|
88290c4ecc | ||
|
|
16cace9533 | ||
|
|
158476c84c | ||
|
|
7f08741f40 | ||
|
|
ff90501e82 | ||
|
|
66b9843466 | ||
|
|
046d628a42 | ||
|
|
d525e8a10f | ||
|
|
04edc7011e | ||
|
|
4da3e39e4a | ||
|
|
c675ed3a92 | ||
|
|
5982f65852 | ||
|
|
99df705ba2 | ||
|
|
66f6ce4d2a | ||
|
|
be7ef9fbd9 | ||
|
|
786df087d4 | ||
|
|
d80dca45c5 | ||
|
|
5e392b9330 | ||
|
|
22036f00e8 | ||
|
|
70bcb9580f | ||
|
|
ad21aa8eb1 | ||
|
|
d1ffdb6704 | ||
|
|
3b653289f5 | ||
|
|
ce6c9e9f57 | ||
|
|
89fd47fc7b | ||
|
|
25d29311dd | ||
|
|
9850c4a0c6 | ||
|
|
cc6fefc49e | ||
|
|
c940c88f9b | ||
|
|
56dcdbeacd | ||
|
|
6f4be89322 | ||
|
|
e87704fe52 | ||
|
|
bde8c178f4 | ||
|
|
8366600a5d | ||
|
|
fefe33ad75 | ||
|
|
8f91a04145 | ||
|
|
1bf9e599ee | ||
|
|
914920d2dd | ||
|
|
cbdb422398 | ||
|
|
6121a6d7f9 | ||
|
|
57e5992875 | ||
|
|
9985a98942 | ||
|
|
f26b4c2dad | ||
|
|
82f0751702 | ||
|
|
5afcc26061 | ||
|
|
a5d6f1b71e | ||
|
|
4365c94a00 | ||
|
|
87edcc043d | ||
|
|
c9c0aeaca7 | ||
|
|
b3840ad8db | ||
|
|
e7d49e00d8 | ||
|
|
f24f089794 | ||
|
|
71540e4b68 | ||
|
|
b503fb38f0 | ||
|
|
e75c45293d | ||
|
|
433a779d95 | ||
|
|
6ee7c5beb2 | ||
|
|
862e3e3e86 | ||
|
|
b30a6133b3 | ||
|
|
2ccf2b9b20 | ||
|
|
3261971bf7 | ||
|
|
99ebe22860 | ||
|
|
bdbfcc817c | ||
|
|
a82db0a1b2 | ||
|
|
a6a6a9902d | ||
|
|
cc2ef4243b | ||
|
|
bed333a2e8 | ||
|
|
099e41b9c8 | ||
|
|
6ccd5bd2f1 | ||
|
|
63d2669a09 | ||
|
|
8d1dbd1b06 | ||
|
|
2f7853f552 | ||
|
|
55938d0d24 | ||
|
|
18574aaa3e | ||
|
|
977517f8ab | ||
|
|
5ca8680d98 | ||
|
|
3abeccf920 | ||
|
|
a1c246e8bf | ||
|
|
2834cb729c | ||
|
|
4185c233b3 | ||
|
|
aee40b84ea | ||
|
|
cbfe9e1209 | ||
|
|
df4ec3183b | ||
|
|
bd7f067d1c | ||
|
|
fce478ed64 | ||
|
|
8145c17dda | ||
|
|
16d36a670e | ||
|
|
69c59eddc3 | ||
|
|
605b0060ef | ||
|
|
ac9926488a | ||
|
|
997832281a | ||
|
|
61d3acacac | ||
|
|
b503ffe392 | ||
|
|
23ba403fd8 | ||
|
|
79d58631cb | ||
|
|
f52d5d8d5a | ||
|
|
1227055ffc | ||
|
|
ece93f2135 | ||
|
|
5787e13f0c | ||
|
|
66e827727f | ||
|
|
0eae061db8 | ||
|
|
c7ddbaa0d1 | ||
|
|
79020fea65 | ||
|
|
f712e1ee70 | ||
|
|
0514361d30 | ||
|
|
b60906915c | ||
|
|
42819693c0 | ||
|
|
81b1c5a738 | ||
|
|
552b6b6e1d | ||
|
|
fa06764299 | ||
|
|
53f361570e | ||
|
|
69cf9adceb | ||
|
|
db550bef7a | ||
|
|
537c9b8563 | ||
|
|
c17cb6e0ba | ||
|
|
4bb99377ed | ||
|
|
5995f20582 | ||
|
|
91766a4fe2 | ||
|
|
8f0c678f09 | ||
|
|
2e32d102de | ||
|
|
b710b0925f | ||
|
|
c07b8c5740 | ||
|
|
304be02a24 | ||
|
|
2aa2f6ed2b | ||
|
|
c7a229fe8a | ||
|
|
d304bf3673 | ||
|
|
9b76822a1c | ||
|
|
c9757544cb | ||
|
|
6c073a672a | ||
|
|
94d185a423 | ||
|
|
34cc867eff | ||
|
|
f324612e53 | ||
|
|
a0d1ce3fc8 | ||
|
|
6e4f3c4875 | ||
|
|
8e6f322760 | ||
|
|
5b52de8153 | ||
|
|
db855b27ad | ||
|
|
cabe806c1e | ||
|
|
8e703c2f0a | ||
|
|
928a548a38 | ||
|
|
21fb258903 | ||
|
|
3cf13a37d0 | ||
|
|
cfa0a51fca | ||
|
|
15edbc807d | ||
|
|
cdb945b99b | ||
|
|
f18d9953ec | ||
|
|
1d2dc5a646 | ||
|
|
4750803fae | ||
|
|
68697c7280 | ||
|
|
b3d37de39f | ||
|
|
ebe64b7f8e | ||
|
|
1629752c80 | ||
|
|
b9647c1a35 | ||
|
|
d0d25c42a3 | ||
|
|
9c6a2a06a8 | ||
|
|
a2c2e9e49c | ||
|
|
25c007fb3f | ||
|
|
d3ff0c5c49 | ||
|
|
b80b04a905 | ||
|
|
412133e558 | ||
|
|
4186fac706 | ||
|
|
4994f03ff4 | ||
|
|
6c14a20679 | ||
|
|
8f50c4295b | ||
|
|
60fdf78534 | ||
|
|
135c795ed7 | ||
|
|
58552862f2 | ||
|
|
41dce98191 | ||
|
|
537da88983 | ||
|
|
dc9fa31163 | ||
|
|
bc121adef5 | ||
|
|
8dd57b239e | ||
|
|
98cca71c5a | ||
|
|
42741386f3 | ||
|
|
3aebd10bf9 | ||
|
|
76120c1028 | ||
|
|
ee955824fb | ||
|
|
c35727f919 | ||
|
|
13119ad755 | ||
|
|
39e567c057 | ||
|
|
dd8176d34e | ||
|
|
612b9f30ee | ||
|
|
a031a59b19 | ||
|
|
316562ef7b | ||
|
|
de4e257a7e | ||
|
|
d2c49e91be | ||
|
|
0eefff8eef | ||
|
|
270dcf7cb3 | ||
|
|
63c2b8dcf9 | ||
|
|
c88d398d5f | ||
|
|
105cb7c020 | ||
|
|
ca7db1e5e6 | ||
|
|
76b6fa4eb3 | ||
|
|
36b5856bbc | ||
|
|
67bb9a21ca | ||
|
|
9160dbe203 | ||
|
|
6b29a47117 | ||
|
|
4ac8f90eee | ||
|
|
5666455316 | ||
|
|
9971d6aa16 | ||
|
|
894eada595 | ||
|
|
b0000d1439 | ||
|
|
7fda589615 | ||
|
|
fab078f38f | ||
|
|
3b36eda278 | ||
|
|
a2c8d31bfc | ||
|
|
8ae34f3d4e | ||
|
|
e4f3e9b807 | ||
|
|
f2dad9389e | ||
|
|
c860d14e1e | ||
|
|
6c4975d051 | ||
|
|
08a82d52cd | ||
|
|
018718e340 | ||
|
|
34695c333b | ||
|
|
d55e7c952b | ||
|
|
8e1b3f9571 | ||
|
|
17bba97219 | ||
|
|
1790cbf752 | ||
|
|
7723636f4b | ||
|
|
2d7f2f7a79 | ||
|
|
804fa72d5f | ||
|
|
f97b6286ec | ||
|
|
9afcbb56b4 | ||
|
|
51f3119ad3 | ||
|
|
d936333bff | ||
|
|
dc7d19efd9 | ||
|
|
ebd825104c | ||
|
|
1e7a8869ed | ||
|
|
bac0e8be04 | ||
|
|
550af617b5 | ||
|
|
dc4b30ec12 | ||
|
|
7bea84d7d2 | ||
|
|
e26e5664fc | ||
|
|
d252bb108c | ||
|
|
c8443b0c68 | ||
|
|
91e112c756 | ||
|
|
a02f03b334 | ||
|
|
cf7c1652f8 | ||
|
|
598ebcefcc | ||
|
|
37e073868f | ||
|
|
40abe3a192 | ||
|
|
7e5cb6bfdf | ||
|
|
d69e1ed670 | ||
|
|
fe615e979f | ||
|
|
d26ce4bde1 | ||
|
|
e2dc178ec1 | ||
|
|
8127696f89 | ||
|
|
5875921221 | ||
|
|
449c49b552 | ||
|
|
b8211fa91b | ||
|
|
366336097e | ||
|
|
9620a6be4c | ||
|
|
597227353b | ||
|
|
991f05c335 | ||
|
|
8dcb1667c6 | ||
|
|
d8711f68b8 | ||
|
|
b4d8f0bba6 | ||
|
|
b70b244ed0 | ||
|
|
b95fbf127d | ||
|
|
e11fe7ccd3 | ||
|
|
d08fd76f5e | ||
|
|
792fef2371 | ||
|
|
b85218705d | ||
|
|
fd130bffe2 | ||
|
|
2396381390 | ||
|
|
a182a2c3df | ||
|
|
d72ee8ab8c | ||
|
|
1ba978d9f7 | ||
|
|
2303e58844 | ||
|
|
1b9c70e14b | ||
|
|
2694a6a401 | ||
|
|
0484b55077 | ||
|
|
e68d3e4dfc | ||
|
|
94a6f7b8a8 | ||
|
|
2e28514a00 | ||
|
|
f468b146d9 | ||
|
|
9532c6cdb7 | ||
|
|
f5202e36d4 | ||
|
|
9f10e4b83b | ||
|
|
d978df049e | ||
|
|
bea3bf2de4 | ||
|
|
bfc8e6931f | ||
|
|
13a2a26f73 | ||
|
|
129001a041 | ||
|
|
2638ad0c4d | ||
|
|
8f761c5477 | ||
|
|
b3f197482f | ||
|
|
1f91a84654 | ||
|
|
50546e05f2 | ||
|
|
79c79c54ef | ||
|
|
0e0c17b0f8 | ||
|
|
1538ab7f47 | ||
|
|
fd599c254e | ||
|
|
f97a35b005 | ||
|
|
fa64a8d37b | ||
|
|
6b2d6847c7 | ||
|
|
2f47213ab8 | ||
|
|
f814a03e0a | ||
|
|
fbf6bd9339 | ||
|
|
c7534a3a8e | ||
|
|
f00cbc0409 | ||
|
|
8f82dc8403 | ||
|
|
ae0018348f | ||
|
|
5fc83ea7eb | ||
|
|
0edf17e5f1 | ||
|
|
4a885047a5 | ||
|
|
92295f3f3c | ||
|
|
d69cefecb5 | ||
|
|
12ea0c809b | ||
|
|
33bffbbd5e | ||
|
|
55cb35be44 | ||
|
|
6130e9e1e5 | ||
|
|
82e4a1f141 | ||
|
|
011c5fc5e0 | ||
|
|
e897a554c6 | ||
|
|
89b52f3edc | ||
|
|
19455657ab | ||
|
|
0658d2d284 | ||
|
|
4b21756d1d | ||
|
|
167a9bedd1 | ||
|
|
8993f50169 | ||
|
|
1ee6040f0f | ||
|
|
5d5c04bc41 | ||
|
|
b89de0b437 | ||
|
|
ec7654a9b7 | ||
|
|
ae379e3086 | ||
|
|
91d990759b | ||
|
|
06d7679684 | ||
|
|
88826a90c7 | ||
|
|
bb9f5e391d | ||
|
|
4876963d85 | ||
|
|
6f1cdf099d | ||
|
|
838e01e358 | ||
|
|
312d0740c6 | ||
|
|
17f0a3631f | ||
|
|
3e45c646d8 | ||
|
|
fd54e62137 | ||
|
|
2a16d70393 | ||
|
|
d633fb1ef3 | ||
|
|
7d4804940d | ||
|
|
3a603a067d | ||
|
|
dfff4b387d | ||
|
|
d24604ec24 | ||
|
|
126ea143a3 | ||
|
|
b7f36f8d4c | ||
|
|
ad8c47abc3 | ||
|
|
304e1cf5ad | ||
|
|
128c4c14fb | ||
|
|
0906b748ee | ||
|
|
87116a5983 | ||
|
|
b904277d8d | ||
|
|
c00ef37516 | ||
|
|
ac8556d18e | ||
|
|
156786f8a7 | ||
|
|
2be56c941e | ||
|
|
136f72c906 | ||
|
|
bcc103c73e | ||
|
|
74bdae6681 | ||
|
|
37d510003f | ||
|
|
11d48f3c0e | ||
|
|
2a35196c64 | ||
|
|
f52aaa40fd | ||
|
|
1c72dfaea1 | ||
|
|
178caee4b8 | ||
|
|
6f58f3cc3f | ||
|
|
a9c1d15823 | ||
|
|
1a582183d0 | ||
|
|
08e2e0f96f | ||
|
|
58b2e7d69e | ||
|
|
513c0fef75 | ||
|
|
a48f7f6f05 | ||
|
|
de873393f6 | ||
|
|
9233783ded | ||
|
|
c77999c8e4 | ||
|
|
1b47e77a83 | ||
|
|
530c87bfb6 | ||
|
|
2907b9bf39 | ||
|
|
c44b42b7a0 | ||
|
|
48a289085e | ||
|
|
f24276a3da | ||
|
|
622e8f83de | ||
|
|
bb4954de9b | ||
|
|
82751bd9ba | ||
|
|
c9b0685db0 | ||
|
|
3f3b08e578 | ||
|
|
f3685ffc4a | ||
|
|
02986a1879 | ||
|
|
2d9da9380c | ||
|
|
c863353fce | ||
|
|
01c4853fba | ||
|
|
6788f1653d | ||
|
|
72c3e3d6ec | ||
|
|
909412eeb9 | ||
|
|
a08860d9fc | ||
|
|
42276e9c65 | ||
|
|
6cdcbcede7 | ||
|
|
f1da5ab2f0 | ||
|
|
bcf55dfded | ||
|
|
18ad1ad641 | ||
|
|
58be63eca6 | ||
|
|
c83fab32a9 | ||
|
|
c4269bbd3a | ||
|
|
bc9d981422 | ||
|
|
ad1ad9bb27 | ||
|
|
702fe61068 | ||
|
|
270bf7b96e | ||
|
|
a92ae52de0 | ||
|
|
f19065dc2a | ||
|
|
ed3920b245 | ||
|
|
6088d1d50a | ||
|
|
1c44426ff2 | ||
|
|
076800ed2d | ||
|
|
0f0b8c0339 | ||
|
|
9ea4666211 | ||
|
|
2fca1d5e74 | ||
|
|
831437c1aa | ||
|
|
9133f2cc73 | ||
|
|
044e2b63e9 | ||
|
|
c4e16038a4 | ||
|
|
1aaa39e284 | ||
|
|
f4c8f1abce | ||
|
|
683d6d2948 | ||
|
|
69bf426a08 | ||
|
|
7d1fe263aa | ||
|
|
74ad625e53 | ||
|
|
59534f0846 | ||
|
|
244c43a20e | ||
|
|
6c046725e5 | ||
|
|
938b5fbfb4 | ||
|
|
12d53f218e | ||
|
|
45a00fb17f | ||
|
|
8c7ff0c1d9 | ||
|
|
3d3ab2548d | ||
|
|
a58bf292a9 | ||
|
|
e1791c2630 | ||
|
|
cab277cf2c | ||
|
|
f1cc1caf20 | ||
|
|
8ca90466e4 | ||
|
|
0cc1d6b378 | ||
|
|
5e068f0012 | ||
|
|
ea7179d12b | ||
|
|
97572ed0a4 | ||
|
|
1c4282b743 | ||
|
|
0f8dce49c1 | ||
|
|
173f752dc1 | ||
|
|
dd2ad0397b | ||
|
|
cc50d576f1 | ||
|
|
347c15189b | ||
|
|
0f0ede81b2 | ||
|
|
04dad67c01 | ||
|
|
543aac058c | ||
|
|
38bd1badb9 | ||
|
|
99376d2072 | ||
|
|
4ed52e3df7 | ||
|
|
9824567998 | ||
|
|
207311b14c | ||
|
|
a04b2be446 | ||
|
|
5f147eca7f | ||
|
|
350e45825a | ||
|
|
b544a2e69c | ||
|
|
9b1714b2e7 | ||
|
|
258347bc94 | ||
|
|
15e2e1ac67 | ||
|
|
81ac113e8f | ||
|
|
d475ac95e3 | ||
|
|
df1fb3f0ef | ||
|
|
e2ff7ecac6 | ||
|
|
990f1c1c3c | ||
|
|
a3ff7c3116 | ||
|
|
b1bd4a350a | ||
|
|
987eb76023 | ||
|
|
32eee83073 | ||
|
|
8319db6588 | ||
|
|
eef8f6e03c | ||
|
|
8d64c231c0 | ||
|
|
8e87370cfb | ||
|
|
46cfe71c32 | ||
|
|
aa30e40791 | ||
|
|
f9e276f1f6 | ||
|
|
3764fcb274 | ||
|
|
f2877386c8 | ||
|
|
a0e37220ad | ||
|
|
e6061da09a | ||
|
|
1d5138753a | ||
|
|
3042cede1d | ||
|
|
387a8204fa | ||
|
|
c710014392 | ||
|
|
38550c54a5 | ||
|
|
ce9acc2900 | ||
|
|
6f1c506d9b | ||
|
|
5edc510c2c | ||
|
|
2ef6136989 | ||
|
|
f5a46b5a06 | ||
|
|
6c117f3eab | ||
|
|
ed76069cc3 | ||
|
|
e3a2e60209 | ||
|
|
4fa59deaab | ||
|
|
e4066686ea | ||
|
|
97f816c113 | ||
|
|
b888018b22 | ||
|
|
32c1ac5e56 | ||
|
|
3676d4ac8c | ||
|
|
ca5573459e | ||
|
|
60fd72479d | ||
|
|
328963e196 | ||
|
|
fc3037358d | ||
|
|
4227252627 | ||
|
|
b6be55f2d0 | ||
|
|
bda5920088 | ||
|
|
74e4533d8e | ||
|
|
88afcd237e | ||
|
|
0b9fdaf513 | ||
|
|
4ab1b9d86c | ||
|
|
e569c72573 | ||
|
|
198fc130b2 | ||
|
|
bf053c688e | ||
|
|
4db9e0e3ce | ||
|
|
1a3ec7d03b | ||
|
|
44111f6dea | ||
|
|
ac5774dfb2 | ||
|
|
f7423e26b2 | ||
|
|
94fe3511d0 | ||
|
|
ab3fe8ab6c | ||
|
|
9eb6732638 | ||
|
|
2a6632f159 | ||
|
|
26a5567f1c | ||
|
|
b3710db27d | ||
|
|
16f869f22c | ||
|
|
518c993e39 | ||
|
|
77c00b8a3c | ||
|
|
9d0e5aa3da | ||
|
|
afc81903c5 | ||
|
|
a337f6f4c0 | ||
|
|
4b32d7c30a | ||
|
|
a3afb73cf2 | ||
|
|
ec2db1e887 | ||
|
|
98f79f5162 | ||
|
|
232b2ef63c | ||
|
|
5bd2f0c554 | ||
|
|
a5928dc51d | ||
|
|
e7e39bb5bd | ||
|
|
098843221f | ||
|
|
aefa41cd83 | ||
|
|
efe3f90eaa | ||
|
|
b8ec01b52d | ||
|
|
7d615ac2f6 | ||
|
|
30644ff9e4 | ||
|
|
35164873c2 | ||
|
|
3fe4517286 | ||
|
|
783ea687ba | ||
|
|
1b421bfec7 | ||
|
|
2bccf3518c | ||
|
|
d18f8cefd7 | ||
|
|
2b076c7c41 | ||
|
|
6030725029 | ||
|
|
b787498759 | ||
|
|
29702850b5 | ||
|
|
3322ae7272 | ||
|
|
adcd2f8169 | ||
|
|
20e13e348a | ||
|
|
8483f6b9a9 | ||
|
|
a517b99294 | ||
|
|
4376ffc3e8 | ||
|
|
e873f5379f | ||
|
|
0de5eba7a5 | ||
|
|
523cd53a9f | ||
|
|
0ff245bdd5 | ||
|
|
d072fae4bf | ||
|
|
2c125dbe38 | ||
|
|
f1d9a05b1f | ||
|
|
68d6bd9c0f | ||
|
|
8c795d79c2 | ||
|
|
4a2ffa4ed3 | ||
|
|
60143ba4d0 | ||
|
|
c2077aedb3 | ||
|
|
0ee65aa180 | ||
|
|
abd4b605b5 | ||
|
|
c487fe9939 | ||
|
|
680d066fa4 | ||
|
|
c19b7d0190 | ||
|
|
b25bf3fc9b | ||
|
|
0a9374b831 | ||
|
|
40be21e6a8 | ||
|
|
0fd8b2a645 | ||
|
|
ed1b3896c5 | ||
|
|
61ca4b60ce | ||
|
|
8d5fdf3ed4 | ||
|
|
1f505a2c14 | ||
|
|
96b52132f2 | ||
|
|
9cc2bbdee2 | ||
|
|
0b566f59c4 | ||
|
|
27d0d41b42 | ||
|
|
fb0566afe3 | ||
|
|
6c369a3192 | ||
|
|
34eaa8d06a | ||
|
|
5e1ba8cb9e | ||
|
|
27c213b6fd | ||
|
|
a6ecba31a1 | ||
|
|
72dee4e8a3 | ||
|
|
257fcc3da9 | ||
|
|
b1970da932 | ||
|
|
a891d6e209 | ||
|
|
3c12df4245 | ||
|
|
35b852ff2a | ||
|
|
3e8ca6a5ae | ||
|
|
141f84d78e | ||
|
|
58aafeb73a | ||
|
|
33dc3c994d | ||
|
|
b688f5ef0a | ||
|
|
45755c18d2 | ||
|
|
ffb12ae9f2 | ||
|
|
9afb4d3433 | ||
|
|
6348891a93 | ||
|
|
796f622d34 | ||
|
|
abdced0801 | ||
|
|
6c4ccc1e1a | ||
|
|
2096323d88 | ||
|
|
cf36649f03 | ||
|
|
7a818d5a89 | ||
|
|
b52ed20caf | ||
|
|
8e2b791bc2 | ||
|
|
01bb8e7843 | ||
|
|
4d5e5f04dc | ||
|
|
6d2cdf4cbd | ||
|
|
3a32953c66 | ||
|
|
32a898d7c7 | ||
|
|
6647bef3f5 | ||
|
|
5004324744 | ||
|
|
4d7f9cf419 | ||
|
|
4bcee11574 | ||
|
|
d4c52f95ec | ||
|
|
7190ff7806 | ||
|
|
cd72460f46 | ||
|
|
87e6f34428 | ||
|
|
9de6d99d58 | ||
|
|
2cd52259ea | ||
|
|
9c7373197b | ||
|
|
cc75447b55 | ||
|
|
2fc5d2f810 | ||
|
|
85a6f6edb4 | ||
|
|
d2dbddce49 | ||
|
|
9d5d2d2671 | ||
|
|
3b2e2c0e3b | ||
|
|
f819213e29 | ||
|
|
3574ee7d59 | ||
|
|
631a702499 | ||
|
|
594c553206 | ||
|
|
8b4576c6f4 | ||
|
|
31233588db | ||
|
|
d552b229f8 | ||
|
|
ebcb783207 | ||
|
|
b2cfed488e | ||
|
|
f4607447b1 | ||
|
|
5303f0672c | ||
|
|
c1da48bff8 | ||
|
|
70b26543fc | ||
|
|
a4cf1cbe3c | ||
|
|
f6adc7aa9f | ||
|
|
45a768c9c5 | ||
|
|
52368451b9 | ||
|
|
62f46efba8 | ||
|
|
1fcb7095dd | ||
|
|
8dc4f28be8 | ||
|
|
ba54382272 | ||
|
|
ff6ecbd0ac | ||
|
|
c68fbe2c97 | ||
|
|
c5b1006fde | ||
|
|
0e8580d376 | ||
|
|
a647dd6d59 | ||
|
|
4ab3295917 | ||
|
|
82b75aa4e5 | ||
|
|
0ba846534b | ||
|
|
81f8feb69a | ||
|
|
070a74dc89 | ||
|
|
477e29dcf8 | ||
|
|
30da48d5de | ||
|
|
f1daaaa752 | ||
|
|
f63dd40d18 | ||
|
|
c0a74025ff | ||
|
|
a05970ae49 | ||
|
|
3cc58b3c7d | ||
|
|
f393eed63b | ||
|
|
8846932335 | ||
|
|
e94b29402b | ||
|
|
07eacf19af | ||
|
|
ec65381c01 | ||
|
|
4497d10a46 | ||
|
|
68638187d1 | ||
|
|
1e062d73ec | ||
|
|
be218752b5 | ||
|
|
6f82264d06 | ||
|
|
875f86a8eb | ||
|
|
5475d3b1d6 | ||
|
|
0829ce734e | ||
|
|
70a346ccc9 | ||
|
|
a54c815533 | ||
|
|
22a765649c | ||
|
|
5b0d289106 | ||
|
|
e199a24416 | ||
|
|
68ef1b0891 | ||
|
|
4f8b6da5e0 | ||
|
|
173f715794 | ||
|
|
81707deb28 | ||
|
|
3e52d518e4 | ||
|
|
fd7d5d1010 | ||
|
|
ca5fee2420 | ||
|
|
4de1893713 | ||
|
|
16c1443f49 | ||
|
|
6e47c4e81f | ||
|
|
f4d71fb7e9 | ||
|
|
6b10ea126d | ||
|
|
0f05db394d | ||
|
|
3ba605d2fb | ||
|
|
cf5eb1f332 | ||
|
|
cf5d7415c7 | ||
|
|
f00b1b0cb1 | ||
|
|
bb82a4f179 | ||
|
|
861fa68b66 | ||
|
|
26bc949218 | ||
|
|
12866efd4f | ||
|
|
7d3fb6de2c | ||
|
|
7fed529503 | ||
|
|
02f86cf454 | ||
|
|
364dea3357 | ||
|
|
74c7ca2513 | ||
|
|
56b8a24bfc | ||
|
|
542226bbca | ||
|
|
2975b0838d | ||
|
|
0f3abbddb2 | ||
|
|
133fb4aecc | ||
|
|
2ed90b1491 | ||
|
|
d6692d45b3 | ||
|
|
17624865c9 | ||
|
|
81c20d148e | ||
|
|
4ec579c781 | ||
|
|
a1dca88328 | ||
|
|
4ef6ede664 | ||
|
|
1578d44b26 | ||
|
|
16801dfbb9 | ||
|
|
226c9c2c24 | ||
|
|
09fa1cca5d | ||
|
|
53317c3c27 | ||
|
|
a753985890 | ||
|
|
7ff18ccdda | ||
|
|
04bb90ca9f | ||
|
|
1b953c165d | ||
|
|
9dfe17154f | ||
|
|
7b614b957c | ||
|
|
ab393285ca | ||
|
|
15f25cfa75 | ||
|
|
3ed18a2b1c | ||
|
|
49fc0d39b2 | ||
|
|
84951c1eea | ||
|
|
db4f31fa67 | ||
|
|
4e02030b76 | ||
|
|
5bc7b86f99 | ||
|
|
84e9948299 | ||
|
|
36d6001d50 | ||
|
|
afca80cbf1 | ||
|
|
63d0147f69 | ||
|
|
7c62e64da9 | ||
|
|
300ae26781 | ||
|
|
1d8bd433fd | ||
|
|
2e45e74ebb | ||
|
|
f101a7eb6c | ||
|
|
f117296ba9 | ||
|
|
99ae95cf5b | ||
|
|
2e735d2395 | ||
|
|
1ddf921a59 | ||
|
|
102dd5aa14 | ||
|
|
216e2f38e1 | ||
|
|
0792bed42c | ||
|
|
5dca2edf44 | ||
|
|
9d2c818372 | ||
|
|
a59418a386 | ||
|
|
3e70cda005 | ||
|
|
2049216ab7 | ||
|
|
1313529204 | ||
|
|
b459ef91a2 | ||
|
|
c28542bdcc | ||
|
|
3e1829cb3e | ||
|
|
866932658f | ||
|
|
618c1b323e | ||
|
|
362a561bf6 | ||
|
|
c828d92d42 | ||
|
|
19afab17c4 | ||
|
|
704ffb48e9 | ||
|
|
be094ba536 | ||
|
|
5166d936e5 | ||
|
|
0d944dd532 | ||
|
|
d052098b66 | ||
|
|
0b9af11663 | ||
|
|
f0ad6c51eb | ||
|
|
51f8d1be23 | ||
|
|
3831809f6c | ||
|
|
f59dbeec3b | ||
|
|
05cb622da1 | ||
|
|
1a7fe13fb6 | ||
|
|
396feb5c6b | ||
|
|
2fc11db5b2 | ||
|
|
cab94f8cd1 | ||
|
|
eff024dbbf | ||
|
|
a380bd8b05 | ||
|
|
0e94b41d97 | ||
|
|
576c930476 | ||
|
|
0184cc64d5 | ||
|
|
bcc2513ff1 | ||
|
|
295b082521 | ||
|
|
0ada5377c9 | ||
|
|
7d26bd3309 | ||
|
|
9419d0b849 | ||
|
|
290715c2a9 | ||
|
|
17d21c501d | ||
|
|
d90aeda34e | ||
|
|
d9f4fef9ae | ||
|
|
ac29a6f863 | ||
|
|
dbfac533c7 | ||
|
|
d5f37611e9 | ||
|
|
ece6b383e5 | ||
|
|
fc4aa929e5 | ||
|
|
204cf9e3b6 | ||
|
|
2e309856ad | ||
|
|
ea1ff46c20 | ||
|
|
ba4eca543a | ||
|
|
25c3e2d9a7 | ||
|
|
ffa1b25510 | ||
|
|
ebd1148e1f | ||
|
|
5e0d39cb98 | ||
|
|
6b3acaa720 | ||
|
|
afa1b8e1af | ||
|
|
109ea8ff02 | ||
|
|
5d1804853d | ||
|
|
cbfdf6c321 | ||
|
|
bb4ebf1864 | ||
|
|
e8afe2be01 | ||
|
|
0b5dc2200b | ||
|
|
e59377e1f0 | ||
|
|
005dbbbbf7 | ||
|
|
593258668b | ||
|
|
62bf2d0e5f | ||
|
|
6e2742a930 | ||
|
|
dde871e57e | ||
|
|
91b9969f68 | ||
|
|
89bd9393a7 | ||
|
|
ee7cb0c835 | ||
|
|
7c75576731 | ||
|
|
88a8b9d702 | ||
|
|
fca33e54ee | ||
|
|
88aa4f8838 | ||
|
|
178e93fbb2 | ||
|
|
922fbeecef | ||
|
|
021b9b0fde | ||
|
|
1bab9e5dbc | ||
|
|
1c7c3184e1 | ||
|
|
8a01d25b53 | ||
|
|
17b7479c3e | ||
|
|
c5e0753bc3 | ||
|
|
890455bc7a | ||
|
|
34e080360c | ||
|
|
623418ee14 | ||
|
|
92f3a86f65 | ||
|
|
188339c860 | ||
|
|
3d778eaf63 | ||
|
|
1057c87a2d | ||
|
|
d4d26671b7 | ||
|
|
70de50d9d0 | ||
|
|
5a7a0ea99d | ||
|
|
7348983569 | ||
|
|
182dad6662 | ||
|
|
cbba6e5a2e | ||
|
|
7bf7f7be83 | ||
|
|
eaa71e5b23 | ||
|
|
610c1db268 | ||
|
|
a2c4c93dff | ||
|
|
18c50f1276 | ||
|
|
3b3b889f52 | ||
|
|
7572e76e2c | ||
|
|
a370158e09 | ||
|
|
1c351b80b9 | ||
|
|
7dfd20020a | ||
|
|
047f2be264 | ||
|
|
c77a9f4041 | ||
|
|
487c797450 | ||
|
|
eda9cfa0ac | ||
|
|
6efb50f04e | ||
|
|
5c5ec99158 | ||
|
|
494d4fcbbb | ||
|
|
b5c937bda5 | ||
|
|
0f50f3e378 | ||
|
|
bfe45b1feb | ||
|
|
6232276012 | ||
|
|
c5ebfe1f6c | ||
|
|
7e67c1a200 | ||
|
|
101ceb41d0 | ||
|
|
c1df92ad42 | ||
|
|
68686165c3 | ||
|
|
942f518ba5 | ||
|
|
ef49e7d12a | ||
|
|
73444d97b5 | ||
|
|
84cc5f30a0 | ||
|
|
6c6b204072 | ||
|
|
1201700332 | ||
|
|
fd8619f2c3 | ||
|
|
916562f632 | ||
|
|
58a5fc59dc | ||
|
|
48d084e2b3 | ||
|
|
36200eae5d | ||
|
|
9e8b758c39 | ||
|
|
67afd2c6a3 | ||
|
|
9a8d14f34e | ||
|
|
194ee13778 | ||
|
|
9769761b4d | ||
|
|
92c3d189a1 | ||
|
|
e9c00276b7 | ||
|
|
89f07ef649 | ||
|
|
114d834d36 | ||
|
|
cea708239e | ||
|
|
e01ff6b78f | ||
|
|
e07253124c | ||
|
|
124fd3040d | ||
|
|
17afa41ccb | ||
|
|
8cd9f15cb8 | ||
|
|
3075ecfc24 | ||
|
|
c5fd0cb584 | ||
|
|
a3c1edaa75 | ||
|
|
367a47fe71 | ||
|
|
c93f58dd01 | ||
|
|
bfc83b2e32 | ||
|
|
6c75258291 | ||
|
|
562ff5efe0 | ||
|
|
a82959de1a | ||
|
|
2c01d2177a | ||
|
|
b7ac28b5c7 | ||
|
|
45254f3f10 | ||
|
|
f7c2358d66 | ||
|
|
c9e26f5396 | ||
|
|
d3f514e66a | ||
|
|
a38c4078ac | ||
|
|
139c8bb9fd | ||
|
|
1144e5ee4a | ||
|
|
75cb6d54c3 | ||
|
|
daf5eb465e | ||
|
|
d35648ef08 | ||
|
|
503587206f | ||
|
|
802b422b40 | ||
|
|
418c6bb83e | ||
|
|
e9f4f1c2a7 | ||
|
|
1aa8c87ee6 | ||
|
|
cffcb79662 | ||
|
|
442cd88bd2 | ||
|
|
4f82fa8125 | ||
|
|
5b0e548204 | ||
|
|
9894ac5e33 | ||
|
|
0c85f0df73 | ||
|
|
844d1313c9 | ||
|
|
8e2172afd3 | ||
|
|
2bc7f91641 | ||
|
|
c565222963 | ||
|
|
0aab8e4828 | ||
|
|
922f6dd9ce | ||
|
|
d22141bd6c | ||
|
|
de3e983504 | ||
|
|
84f2aeb627 | ||
|
|
9f4a25aee2 | ||
|
|
ac8985bf10 | ||
|
|
b9226c82d0 | ||
|
|
95ad39f020 | ||
|
|
25d06fe2c9 | ||
|
|
52b9d29c58 | ||
|
|
8adc4e82a2 | ||
|
|
ecfd40bf70 | ||
|
|
951de0a56c | ||
|
|
4567e8de23 | ||
|
|
8ad6838caf | ||
|
|
911529b0cc | ||
|
|
3242b73023 | ||
|
|
a58535dae5 | ||
|
|
41b443d444 | ||
|
|
3655b2cdf1 | ||
|
|
50e7d5c710 | ||
|
|
97216709e3 | ||
|
|
f82ac03d2e | ||
|
|
eaf2a47dc5 | ||
|
|
71ace4ef21 | ||
|
|
571ceb61d4 | ||
|
|
50c255fb26 | ||
|
|
fd8b9aebe5 | ||
|
|
4c4ff2ad5d | ||
|
|
c2c2a4c666 | ||
|
|
fb6d69a4eb | ||
|
|
ac141949b3 | ||
|
|
d5584d498e | ||
|
|
119ab2acb0 | ||
|
|
86ba1f867e | ||
|
|
0bc76f88e9 | ||
|
|
d95f0d4888 | ||
|
|
dfecdbd5e8 | ||
|
|
4a14976d81 | ||
|
|
da6ec283fe | ||
|
|
7668c130f5 | ||
|
|
514168ac9f | ||
|
|
c07369e5ed | ||
|
|
b916eb708b | ||
|
|
d5d1661d41 | ||
|
|
e4647a1df9 | ||
|
|
27f34c95e9 | ||
|
|
439c632c6a | ||
|
|
fd9e2f1f88 | ||
|
|
335cdcf585 | ||
|
|
a8e3c399bb | ||
|
|
2478de7a16 | ||
|
|
348e39f01c | ||
|
|
3586d9ad06 | ||
|
|
b7271a13e0 | ||
|
|
c401755bf0 | ||
|
|
9406f5bbea | ||
|
|
6b14e92ab6 | ||
|
|
2d9ccfdb90 | ||
|
|
7db1699f6f | ||
|
|
9980cf637e | ||
|
|
43312c05e6 | ||
|
|
847b3585f8 | ||
|
|
85a6d24ec2 | ||
|
|
7a5c88acf7 | ||
|
|
0c2db497a5 | ||
|
|
0871f3e571 | ||
|
|
02efde6dec | ||
|
|
46898a348c | ||
|
|
afe6efc232 | ||
|
|
3a9575bbb8 | ||
|
|
0f912f97b1 | ||
|
|
fe376474ac | ||
|
|
8363e825a3 | ||
|
|
955cbb128b | ||
|
|
f6d5b1e794 | ||
|
|
c31d3cfe48 | ||
|
|
aee0d889c5 | ||
|
|
ae38c94bd7 | ||
|
|
5aa8bce1cc | ||
|
|
fab48b0d7f | ||
|
|
8f2ca7bed2 | ||
|
|
48efab796d | ||
|
|
3e872328af | ||
|
|
edd02d984e | ||
|
|
816bf451a1 | ||
|
|
ddac685469 | ||
|
|
dddbb186fe | ||
|
|
c9831e6449 | ||
|
|
95de7fa3d8 | ||
|
|
e9fdc0e50b | ||
|
|
2cbc1b3bfe | ||
|
|
72d3ee37c3 | ||
|
|
759f21bbb1 | ||
|
|
eb969767cd | ||
|
|
6ed480374b | ||
|
|
b632e3ab8d | ||
|
|
5d603e24a4 | ||
|
|
cd95e9d112 | ||
|
|
8e09b1c163 | ||
|
|
31af3a2383 | ||
|
|
2e1d3c944a | ||
|
|
f6c3b01841 | ||
|
|
ab42d3261f | ||
|
|
9fbf585dc5 | ||
|
|
3cba131c30 | ||
|
|
58d7acb51d | ||
|
|
69d478fa5b | ||
|
|
12151f20e4 | ||
|
|
38af8ffb85 | ||
|
|
93193de4c3 | ||
|
|
8729ae25d0 | ||
|
|
1c88103950 | ||
|
|
a3ec64554e | ||
|
|
3fcfcec066 | ||
|
|
35a7188740 | ||
|
|
2eb493291e | ||
|
|
51a74ae782 | ||
|
|
1461de3493 | ||
|
|
26067ab0e2 | ||
|
|
bb0c3f5d51 | ||
|
|
a5fee10d6c | ||
|
|
ec206fbf88 | ||
|
|
1ccb99cc23 | ||
|
|
5f7431b2a5 | ||
|
|
257f18757c | ||
|
|
8bb6a69b27 | ||
|
|
f65b1d5316 | ||
|
|
f58d1f44f7 | ||
|
|
b38630bf85 | ||
|
|
ee7c870d3c | ||
|
|
aa7d5e8701 | ||
|
|
f115bff859 | ||
|
|
7357974c8f | ||
|
|
d4c2704331 | ||
|
|
feb19f7fd5 | ||
|
|
4867fd70ef | ||
|
|
2724e41fb0 | ||
|
|
f2b8d23a2c | ||
|
|
3e260bf85f | ||
|
|
1be9018f8f | ||
|
|
394bee3a66 | ||
|
|
0790df29ce | ||
|
|
25528d2d0e | ||
|
|
5761f656da | ||
|
|
a54af6671b | ||
|
|
7dad199f74 | ||
|
|
57eb4b200c | ||
|
|
4d3f95acf0 | ||
|
|
90f8e0a2b7 | ||
|
|
147202f6d9 | ||
|
|
d6b919dbc3 | ||
|
|
cd17059000 | ||
|
|
140c52d7d2 | ||
|
|
215885621a | ||
|
|
e582f0fa09 | ||
|
|
6c25401bd8 | ||
|
|
68c7b5999d | ||
|
|
96529afe92 | ||
|
|
e721e92268 | ||
|
|
18ef3bdaf2 | ||
|
|
fa83d4b579 | ||
|
|
7f27969f2b | ||
|
|
ac704d002f | ||
|
|
ead48b08b1 | ||
|
|
71f32e750d | ||
|
|
38e83f02e0 | ||
|
|
61d0b09b1a | ||
|
|
9e15617836 | ||
|
|
f9cbabc706 | ||
|
|
d1c0835060 | ||
|
|
8048ddd076 | ||
|
|
e03ec36e3e | ||
|
|
e131bd8293 | ||
|
|
335daa8830 | ||
|
|
9d72956865 | ||
|
|
c6f51b5453 | ||
|
|
e6304242ab | ||
|
|
0d1a713183 | ||
|
|
96c326cc85 | ||
|
|
8257225381 | ||
|
|
3d3f602242 | ||
|
|
b08277d5da | ||
|
|
c50088db2e | ||
|
|
c4af8dae12 | ||
|
|
1593edc828 | ||
|
|
d168ea1538 | ||
|
|
faeeb398f0 | ||
|
|
6901d0f3c7 | ||
|
|
7c7f88f878 | ||
|
|
d7a0dd6984 | ||
|
|
44c40c960f | ||
|
|
6406975c6b | ||
|
|
85ca464d1a | ||
|
|
d02503fc44 | ||
|
|
8fc5009140 | ||
|
|
7fe425bc3b | ||
|
|
0728668844 | ||
|
|
38aa11aba6 | ||
|
|
535a9bf5e0 | ||
|
|
59b5b24026 | ||
|
|
5425f9d8e8 | ||
|
|
801df1bcab | ||
|
|
28f0b0bdd0 | ||
|
|
396f523117 | ||
|
|
674d0e3888 | ||
|
|
27fb043f88 | ||
|
|
ebcc363202 | ||
|
|
e8f245cf5c | ||
|
|
4a597252c0 | ||
|
|
fedf02d35b | ||
|
|
9af1255a4c | ||
|
|
dd3ce6b852 | ||
|
|
4f397ff76f | ||
|
|
4eeec4cd7c | ||
|
|
f3906aee04 | ||
|
|
af0f252242 | ||
|
|
19150c9eb3 | ||
|
|
273163deb8 | ||
|
|
4ff20878b2 | ||
|
|
2eeb551323 | ||
|
|
a81f81de9d | ||
|
|
1a68e96906 | ||
|
|
a6f367f8b7 | ||
|
|
32fb108ae3 | ||
|
|
d03266a151 | ||
|
|
ab96894b35 | ||
|
|
aebd1b4f8f | ||
|
|
bfda7c18e6 | ||
|
|
9ecc5e9ebc | ||
|
|
23aae0ee52 | ||
|
|
6ca92929b0 | ||
|
|
72f135d983 | ||
|
|
b04831b978 | ||
|
|
25ef9e6813 | ||
|
|
5dc20acfd9 | ||
|
|
cd9dfa91c4 | ||
|
|
de73c98dd0 | ||
|
|
fd89a55379 | ||
|
|
4c686dcb0f | ||
|
|
9ae2e7e53d | ||
|
|
a5ebb29ba3 | ||
|
|
9db90a25b7 | ||
|
|
0b12741bf9 | ||
|
|
47a0601e78 | ||
|
|
36517c7940 | ||
|
|
c731272afa | ||
|
|
66d4644ae1 | ||
|
|
5d802f8bf1 | ||
|
|
3c773d5f1e | ||
|
|
ce029e3720 | ||
|
|
51fe47c594 | ||
|
|
2935e1efae | ||
|
|
8b7cdbf13d | ||
|
|
07d8e8dce8 | ||
|
|
32f0602043 | ||
|
|
92c8c112fd | ||
|
|
1d64272f80 | ||
|
|
93903d836d | ||
|
|
42b94fae44 | ||
|
|
a7cd5732ec | ||
|
|
e8cd831a6c | ||
|
|
bf8a6ba8f1 | ||
|
|
52840e70e6 | ||
|
|
6f4c2a2c84 | ||
|
|
29b3600124 | ||
|
|
192e5fabf3 | ||
|
|
dfc5b658c4 | ||
|
|
ec0be4eea0 | ||
|
|
ad6bbf4291 | ||
|
|
221e3b7313 | ||
|
|
acdb16c8fc | ||
|
|
90815703a8 | ||
|
|
173357baf3 | ||
|
|
f3a0f03e6f | ||
|
|
651aef5d12 | ||
|
|
3ef582c935 | ||
|
|
4059fae940 | ||
|
|
b5819e7a14 | ||
|
|
f8879d90bb | ||
|
|
a7cfb24713 | ||
|
|
f88ed660f9 | ||
|
|
83dc55a398 | ||
|
|
f7d93ed994 | ||
|
|
3fbf95be13 | ||
|
|
935a37138f | ||
|
|
e33c7343cf | ||
|
|
3b31a7933e | ||
|
|
63196b5262 | ||
|
|
da82f7a60b | ||
|
|
d25ec06aca | ||
|
|
f79088d7aa | ||
|
|
6497dfe881 | ||
|
|
1c76f03bf5 | ||
|
|
ea8b1daf39 | ||
|
|
bf55671492 | ||
|
|
8b24c35739 | ||
|
|
733cd4a67a | ||
|
|
25272cf615 | ||
|
|
b4862427ec | ||
|
|
af572261a9 | ||
|
|
37234dbf1d | ||
|
|
0f004a4d12 | ||
|
|
1b74ebe914 | ||
|
|
bbbdb43cdd | ||
|
|
c39260e194 | ||
|
|
225d02eb63 | ||
|
|
4c2ac7ffec | ||
|
|
de632bd38d | ||
|
|
1c5670b6c1 | ||
|
|
05b3d08fc4 | ||
|
|
ab42b60a4c | ||
|
|
9c994944ae | ||
|
|
ec1afcb7d9 | ||
|
|
64085bff34 | ||
|
|
303ad77a3c | ||
|
|
9d105b3c32 | ||
|
|
9f42ffef74 | ||
|
|
4e13517da6 | ||
|
|
aa1be3a78a | ||
|
|
e665574593 | ||
|
|
ac43839d5d | ||
|
|
5273acd2cd | ||
|
|
653b222acd | ||
|
|
e265d871c3 | ||
|
|
535473b304 | ||
|
|
eba0f5880d | ||
|
|
426fa476dc | ||
|
|
f0f9014700 | ||
|
|
1710d4ba89 | ||
|
|
37e20e5910 | ||
|
|
27d2c35e78 | ||
|
|
b058b0eff2 | ||
|
|
0805284d5a | ||
|
|
2c8a8d08d4 | ||
|
|
8750180c3d | ||
|
|
3396f46433 | ||
|
|
6dcbe3ff9c | ||
|
|
f44bb4e52f | ||
|
|
df6b142292 | ||
|
|
aa0f66a53a | ||
|
|
e5d8e87777 | ||
|
|
cd7eb7b5eb | ||
|
|
3d619a1637 | ||
|
|
28afdac2f7 | ||
|
|
2c5ef4d8cc | ||
|
|
3ace88042f | ||
|
|
9758b4cb4f | ||
|
|
f01dc02c09 | ||
|
|
1aeb49f6a4 | ||
|
|
c32a70343e | ||
|
|
227cdcd6df | ||
|
|
561de6ed1f | ||
|
|
b224ed2f82 | ||
|
|
f9fc0dad95 | ||
|
|
e185fe8a9b | ||
|
|
c18b7fc3c6 | ||
|
|
ac951074bb | ||
|
|
2828e5872c | ||
|
|
7e6ae5db61 | ||
|
|
f22a679046 | ||
|
|
77c52824fb | ||
|
|
76c827023b | ||
|
|
901b31e05f | ||
|
|
41b3b7f64a | ||
|
|
1ab4856a6c | ||
|
|
dd7b200b6e | ||
|
|
1383401850 | ||
|
|
bdc4610345 | ||
|
|
8965f0589c | ||
|
|
243fd308d2 | ||
|
|
6997bf418d | ||
|
|
79bca213f8 | ||
|
|
637f4ac38c | ||
|
|
446b663913 | ||
|
|
4de7eb6a54 | ||
|
|
6f1457758e | ||
|
|
82d2e76f7c | ||
|
|
5c8e19bcda | ||
|
|
7a525861e0 | ||
|
|
5b44671a05 | ||
|
|
8b1b59650d | ||
|
|
7a82bbd082 | ||
|
|
de0e709634 | ||
|
|
e82ea3cf6d | ||
|
|
8ecd917e83 | ||
|
|
37b1e66ad6 | ||
|
|
87c4665a2f | ||
|
|
733d761967 | ||
|
|
184b1f817a | ||
|
|
7d4dc6fa87 | ||
|
|
ea01d0255f | ||
|
|
c30873e6a1 | ||
|
|
2de9b52c11 | ||
|
|
b2adf284a4 | ||
|
|
17191f7aa6 | ||
|
|
b966b99619 | ||
|
|
d8ef45eb91 | ||
|
|
5115df023c | ||
|
|
f8a816017a | ||
|
|
fb12c2d710 | ||
|
|
dba3da5a64 | ||
|
|
c64acf3bb4 | ||
|
|
36aabe4914 | ||
|
|
7c314137d0 | ||
|
|
6c3416983a | ||
|
|
9f111b8359 | ||
|
|
07f35f1525 | ||
|
|
4d47610eed | ||
|
|
96f57d8555 | ||
|
|
4babbf12e8 | ||
|
|
80b79164cc | ||
|
|
91d7af66e3 | ||
|
|
0d5776dad5 | ||
|
|
f947de9538 | ||
|
|
458b3e2324 | ||
|
|
890053021b | ||
|
|
123cbcea89 | ||
|
|
5966d92669 | ||
|
|
52b7e12879 | ||
|
|
1a5ddd81a4 | ||
|
|
9ae10c343d | ||
|
|
32801004b9 | ||
|
|
280d20ba61 | ||
|
|
1fb06ac435 | ||
|
|
23e2e69e5b | ||
|
|
c7e1a960f9 | ||
|
|
02fee7ba8e | ||
|
|
fdacf0f091 | ||
|
|
3c7c067e5e | ||
|
|
86bc47fc33 | ||
|
|
2b3cf77c41 | ||
|
|
039d545fd4 | ||
|
|
e1e0c690dd | ||
|
|
23bf365a7b | ||
|
|
56d24742a1 | ||
|
|
a3b5249563 | ||
|
|
3dc6c229a0 | ||
|
|
dce53590e5 | ||
|
|
0b15c42837 | ||
|
|
d87a61a5f2 | ||
|
|
d072938546 | ||
|
|
d3ca6760da | ||
|
|
4862a9dc6c | ||
|
|
3f49ac5f13 | ||
|
|
efb9be7d8b | ||
|
|
edd64705fe | ||
|
|
ee7436c880 | ||
|
|
897b91414f | ||
|
|
26159d1848 | ||
|
|
d43e4167de | ||
|
|
10d9beb86a | ||
|
|
363b587f07 | ||
|
|
e3ac8d0b8f | ||
|
|
d8a8d33815 | ||
|
|
42c2beae66 | ||
|
|
9c24c5dc8b | ||
|
|
d6bcc5b727 | ||
|
|
d9948a622c | ||
|
|
f3f81f3a06 | ||
|
|
75d0e5ec2b | ||
|
|
41b2a246c5 | ||
|
|
3cc580a29c | ||
|
|
aceae06205 | ||
|
|
951067043a | ||
|
|
39151ca0a7 | ||
|
|
4a5ce31889 | ||
|
|
331d275bd9 | ||
|
|
7353db6f92 | ||
|
|
c2ef3f8ca9 | ||
|
|
79f43bc017 | ||
|
|
cf5da45f97 | ||
|
|
801934e104 | ||
|
|
5816bb3cef | ||
|
|
2e0483ae0d | ||
|
|
f0fe94ab92 | ||
|
|
e1d45b4752 | ||
|
|
2ad85783dd | ||
|
|
6efc4a87c2 | ||
|
|
530dfd9deb | ||
|
|
7f83dcfd02 | ||
|
|
a964758a36 | ||
|
|
d92cba5d5f | ||
|
|
284988235f | ||
|
|
9fe4f89b54 | ||
|
|
868be459ee | ||
|
|
7ad3d7eac7 | ||
|
|
56884d0658 | ||
|
|
6968a1547f | ||
|
|
6feb21102a | ||
|
|
4a43f5064e | ||
|
|
6d5c510832 | ||
|
|
2c19351019 | ||
|
|
34bf5be290 | ||
|
|
d440451382 | ||
|
|
b5882a15f2 | ||
|
|
8ae0743138 | ||
|
|
934df54066 | ||
|
|
98072dc05e | ||
|
|
44b308ece5 | ||
|
|
192e51fa4b | ||
|
|
c2c3f7d67f | ||
|
|
f703377989 | ||
|
|
b4180723aa | ||
|
|
d5ce013d23 | ||
|
|
7d5071ba50 | ||
|
|
463ac96bcb | ||
|
|
83c53eeff1 | ||
|
|
9a0f8db94c | ||
|
|
6ec48a9273 | ||
|
|
48361c8e89 | ||
|
|
8036386160 | ||
|
|
5c467d3fb4 | ||
|
|
f29ebcb567 | ||
|
|
3f48e3b5b0 | ||
|
|
7d5a997272 | ||
|
|
7682f58e84 | ||
|
|
9cd43d5ee5 | ||
|
|
b8d6e7e7bc | ||
|
|
278669b0a9 | ||
|
|
a0f20c87c8 | ||
|
|
ec62859cf6 | ||
|
|
c5b8193c32 | ||
|
|
f5ed463284 | ||
|
|
bbcd00d09c | ||
|
|
96e5b4ac09 | ||
|
|
b2be80fe02 | ||
|
|
f063f420bd | ||
|
|
3114aeb310 | ||
|
|
28e0913e73 | ||
|
|
ffb104432a | ||
|
|
233e31c946 | ||
|
|
0ba3abe7b9 | ||
|
|
367c21a9dc | ||
|
|
fface4e14b | ||
|
|
3faae2385b | ||
|
|
fc94d06469 | ||
|
|
62e8fe8d98 | ||
|
|
6b47fc8502 | ||
|
|
e99ebfcef1 | ||
|
|
7d4b256817 | ||
|
|
8854c92d0e | ||
|
|
3b4cf43f86 | ||
|
|
ce79f87032 | ||
|
|
f003720b2f | ||
|
|
8d2f6e11d0 | ||
|
|
5dee017e21 | ||
|
|
d2ef380d34 | ||
|
|
6bf5689585 | ||
|
|
920bc22b13 | ||
|
|
38a7ba0346 | ||
|
|
43816b1e91 | ||
|
|
fd58d75dd2 | ||
|
|
173a0fda5d | ||
|
|
6180f79c56 | ||
|
|
10e693a59f | ||
|
|
a6b199390c | ||
|
|
faf6952a66 | ||
|
|
e34d9f3fe7 | ||
|
|
4b2ee3d9a4 | ||
|
|
03940207d7 | ||
|
|
32e9025783 | ||
|
|
5e446f48ac | ||
|
|
fd0b6f0e5c | ||
|
|
d977aaf66f | ||
|
|
8781496ff5 | ||
|
|
0491ce6ad8 | ||
|
|
691f0a5001 | ||
|
|
715cb1a69a | ||
|
|
427e05382a | ||
|
|
91044c9be0 | ||
|
|
d9e1dba9e0 | ||
|
|
e630ff35cb | ||
|
|
a4050f6c8d | ||
|
|
a98aec38e0 | ||
|
|
a9fd8b033b | ||
|
|
4acf35130c | ||
|
|
643b18e3c5 | ||
|
|
93f6e58845 | ||
|
|
5ecd9763ef | ||
|
|
b6a22500b6 | ||
|
|
04f6072fda | ||
|
|
d0fb099c33 | ||
|
|
6f817933f2 | ||
|
|
405c63d6d4 | ||
|
|
b2c3afd908 | ||
|
|
6aa2ebd8fe | ||
|
|
7db1c6886a | ||
|
|
76a6134185 | ||
|
|
e58bc4d916 | ||
|
|
88e07e40de | ||
|
|
7bbd42ea46 | ||
|
|
0da74ad323 | ||
|
|
ff9aed7253 | ||
|
|
4f2bfdebad | ||
|
|
e6fe6a25dc | ||
|
|
1e2696012c | ||
|
|
d63e078339 | ||
|
|
d7f7e20c96 | ||
|
|
a056cfe3fd | ||
|
|
bc4fd1b45e | ||
|
|
e12bf14b57 | ||
|
|
ff908749d3 | ||
|
|
798c04ae0c | ||
|
|
a6b29e221c | ||
|
|
ffcb64815f | ||
|
|
dc121a2941 | ||
|
|
17c9c076c0 | ||
|
|
09e4d26ceb | ||
|
|
436447e871 | ||
|
|
7beb7b4b4a | ||
|
|
35ff70cd04 | ||
|
|
ad61c92758 | ||
|
|
350f673fcd | ||
|
|
6b818b5e7b | ||
|
|
1679b2854e | ||
|
|
0fdc01c8b7 | ||
|
|
2074a68040 | ||
|
|
22f0df4dcc | ||
|
|
83086d811c | ||
|
|
a276a88dbe | ||
|
|
5827a311c1 | ||
|
|
987f0f8f94 | ||
|
|
fa7c1d84d3 | ||
|
|
ba8f88d057 | ||
|
|
b54eea813a | ||
|
|
fc0b884a03 | ||
|
|
f1d254a38f | ||
|
|
b8c7069da2 | ||
|
|
fa700ffb46 | ||
|
|
cb55e883af | ||
|
|
3ce1cbf568 | ||
|
|
bf352a70f7 | ||
|
|
1fbc981d97 | ||
|
|
f51190bcc5 | ||
|
|
cdad9bfd42 | ||
|
|
ca512712d2 | ||
|
|
acd6d2fd77 | ||
|
|
efcf92c964 | ||
|
|
90da52abe7 | ||
|
|
18f0bd2b44 | ||
|
|
ffc6ee8c9d | ||
|
|
42b8225b5e | ||
|
|
16a1426414 | ||
|
|
af81aff87e | ||
|
|
e45f5c072a | ||
|
|
dc1024d1e6 | ||
|
|
f364321917 | ||
|
|
7d4f7d2254 | ||
|
|
5d634d70b0 | ||
|
|
2d0c95b170 | ||
|
|
d21292600e | ||
|
|
d1a703d72b | ||
|
|
d70422593d | ||
|
|
5ceb1a8265 | ||
|
|
f8035d7df4 | ||
|
|
9196257ba1 | ||
|
|
38e3798003 | ||
|
|
8e7cace491 | ||
|
|
4969926b11 | ||
|
|
f64044c5b8 | ||
|
|
9e436bcbd6 | ||
|
|
9dd30174d0 | ||
|
|
654ca36ef7 | ||
|
|
8e40828ffd | ||
|
|
1578df6ce3 | ||
|
|
6194ec92dd | ||
|
|
f14ff40fbf | ||
|
|
65c72adf81 | ||
|
|
a829aa94c2 | ||
|
|
2ae755ac28 | ||
|
|
1a083ecc53 | ||
|
|
2d2eb1859e | ||
|
|
7849a17789 | ||
|
|
03aaa89462 | ||
|
|
1bedd0955a | ||
|
|
e2b94d520a | ||
|
|
b76ed95b64 | ||
|
|
6048eb8aaa | ||
|
|
a1d5a34bba | ||
|
|
2ae512f3e8 | ||
|
|
ebd59d5831 | ||
|
|
c75fc91211 | ||
|
|
92f6f4f303 | ||
|
|
b9ff1ecd47 | ||
|
|
575546ceea | ||
|
|
a20e7df6fa | ||
|
|
012abfa784 | ||
|
|
500726ed1d | ||
|
|
4d38e06633 | ||
|
|
6f96be5934 | ||
|
|
6cd1d9d47f | ||
|
|
e8a3cdceea | ||
|
|
01a8e85271 | ||
|
|
50fde03087 | ||
|
|
fb775c5bfd | ||
|
|
3cba3daad8 | ||
|
|
e7c16ae6e8 | ||
|
|
0d4a46dd44 | ||
|
|
731b28a6fa | ||
|
|
ce6ca0b1ac | ||
|
|
1acd66d6cd | ||
|
|
d13667e414 | ||
|
|
7a6b10fc32 | ||
|
|
5428718042 | ||
|
|
2b7ad6e3e3 | ||
|
|
7ab832313d | ||
|
|
93d1e1d3c8 | ||
|
|
acbd7b113f | ||
|
|
5cdc8a1e46 | ||
|
|
ee72bfb807 | ||
|
|
ce488f074f | ||
|
|
6a861682ce | ||
|
|
aa5bf3b6c6 | ||
|
|
043fba0aa9 | ||
|
|
5c5ef68677 | ||
|
|
10698a49a7 | ||
|
|
12702289b0 | ||
|
|
578c31226a | ||
|
|
0444f1fb12 | ||
|
|
7c5090a032 | ||
|
|
76e97e38e1 | ||
|
|
124e71d40c | ||
|
|
6521befc27 | ||
|
|
bc9ece59d3 | ||
|
|
089281344e | ||
|
|
4a8cb84f8c | ||
|
|
e88df65f68 | ||
|
|
c236b3887b | ||
|
|
ad7b2bbb87 | ||
|
|
44947c76bc | ||
|
|
86f67df3be | ||
|
|
74b2ef40f8 | ||
|
|
bc0ccd019c | ||
|
|
3f78190575 | ||
|
|
d763639cb6 | ||
|
|
57ecc91039 | ||
|
|
85211ab486 | ||
|
|
2789487ae2 | ||
|
|
d524e237a4 | ||
|
|
5fbb451d33 | ||
|
|
463f8e0cda | ||
|
|
604b1fbb0d | ||
|
|
0341fe8ecc | ||
|
|
2eb96dc048 | ||
|
|
b18fc0335a | ||
|
|
74e80cb43c | ||
|
|
f630ecf212 | ||
|
|
ea092fa6e5 | ||
|
|
4432244041 | ||
|
|
c3db652d3d | ||
|
|
56ca80ab92 | ||
|
|
f42a46dc48 | ||
|
|
ab9cc4afdf | ||
|
|
b526ee8d2f | ||
|
|
240d549fc7 | ||
|
|
bc5fa505d8 | ||
|
|
d5f936a4b9 | ||
|
|
c736bdee86 | ||
|
|
6a8e58f461 | ||
|
|
465cecb729 | ||
|
|
a5634aa38e | ||
|
|
7b13217786 | ||
|
|
8de041b0ae |
No files matched your search
@@ -0,0 +1,18 @@
|
||||
Data-Storage
|
||||
Log-Files
|
||||
My-Workspaces
|
||||
debug.log
|
||||
|
||||
*.db
|
||||
|
||||
README.md
|
||||
LICENSE
|
||||
CONTRIBUTING.md
|
||||
CODE_OF_CONDUCT.md
|
||||
.git*
|
||||
.docker*
|
||||
**/.vscode
|
||||
**/Dockerfile*
|
||||
**/docker-compose.yml
|
||||
**/node_modules
|
||||
**/.env*
|
||||
@@ -0,0 +1,11 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm" # See documentation for possible values
|
||||
directory: "/Client" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
@@ -0,0 +1,54 @@
|
||||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, develop]
|
||||
release:
|
||||
types: [published, created, edited]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: repository
|
||||
uses: ASzc/change-string-case-action@v1
|
||||
with:
|
||||
string: "${{ github.repository }}"
|
||||
- uses: actions/checkout@v2
|
||||
- name: Preparation
|
||||
id: prep
|
||||
run: |
|
||||
REGISTRY="ghcr.io"
|
||||
IMAGE="${REGISTRY}/${{ steps.repository.outputs.lowercase }}"
|
||||
TAGS="${IMAGE}:${{ github.sha }},${IMAGE}:latest"
|
||||
REF=${GITHUB_REF,,}
|
||||
PREFIX="$(dirname $REF)"
|
||||
SUFFIX="$(basename $REF)"
|
||||
if [[ $PREFIX = "refs/heads" ]]; then
|
||||
TAGS="${TAGS},${IMAGE}:${SUFFIX}"
|
||||
elif [[ $PREFIX = "refs/tags" ]]; then
|
||||
RELEASE=${SUFFIX#"superalgos-"}
|
||||
TAGS="${TAGS},${IMAGE}:${RELEASE}"
|
||||
fi
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
- name: Login in to registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Push to registry
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
file: ./Docker/Dockerfile
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
+14
-1
@@ -1,6 +1,19 @@
|
||||
Data-Storage
|
||||
Log-Files
|
||||
My-Workspaces
|
||||
My-Social-Trading-Data
|
||||
My-Network-Nodes-Data
|
||||
My-Secrets
|
||||
debug.log
|
||||
|
||||
.DS_Store
|
||||
*.db
|
||||
Projects/Foundations/Icons/Thumbs.db
|
||||
*.bat
|
||||
!launch-windows.bat
|
||||
!create-shortcut-windows.bat
|
||||
!uninstall-shortcut-windows.bat
|
||||
*.exe
|
||||
node_modules
|
||||
launch.json
|
||||
package-lock.json
|
||||
.idea
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos\\Platform"
|
||||
},
|
||||
{
|
||||
"path": "C:\\Superalgos\\Projects"
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos\\TaskServer"
|
||||
},
|
||||
{
|
||||
"path": "C:\\Superalgos\\Projects"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+5
-2
@@ -4,13 +4,16 @@
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true
|
||||
"**/Deprecated-Code": true,
|
||||
"**/My-Social-Trading-Data": true,
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/Deprecated-Code": true
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true,
|
||||
"**/My-Social-Trading-Data": true
|
||||
},
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
@@ -1,206 +0,0 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Superalgos</title>
|
||||
<meta name="description" content="Free and Open Source Crypto Trading Tools">
|
||||
<link rel="stylesheet" href="main.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="credits.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="tutorial.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="docs.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="context-menu.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="font-awasome.css" type="text/css" />
|
||||
<link rel="stylesheet" href="prism.css" type="text/css" />
|
||||
<link rel="shortcut icon" type="image/png/ico" href="Images/favicon.ico" />
|
||||
<script type="text/javascript" src="WebServer/require.js"></script>
|
||||
<script type="text/javascript" src="AppPreLoader.js"></script>
|
||||
<script src="externalScripts/CCapture.all.min.js"></script>
|
||||
<script src="externalScripts/prism.js"></script>
|
||||
|
||||
<!-- Documentation Style Sheets -->
|
||||
<!-- -->
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadCanvas() {
|
||||
// Prevent click-jacking
|
||||
try {
|
||||
if (window == window.top || window.chrome && chrome.app && chrome.app.window) {
|
||||
document.documentElement.style.display = 'block'
|
||||
} else {
|
||||
top.location = self.location
|
||||
}
|
||||
} catch (e) { console.error('CJ protection', e) }
|
||||
|
||||
try {
|
||||
loadSuperalgos();
|
||||
} catch (err) {
|
||||
console.log("[ERROR] UI can not be started. Please check that WebServer is running.", err);
|
||||
}
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
try {
|
||||
if (canvas === undefined) { return }
|
||||
if (canvas.eventHandler === undefined) { return }
|
||||
if (DISABLE_BROWSER_RESIZE_EVENT === true) { return }
|
||||
canvas.eventHandler.raiseEvent('Browser Resized')
|
||||
} catch (err) {
|
||||
console.log('Error Resizing. ' + err.stack)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="body" onload="loadCanvas()"
|
||||
style="overflow:hidden; background: url(Images/superalgos-platform.jpg); background-size: cover;"
|
||||
onresize="onResize()">
|
||||
<div id="contributors" class="credits">
|
||||
<p id="credits-page-status-paragraph" class="credits-yellow">The UI is loading...</p>
|
||||
<p>Superalgos is <span class="credits-red">forever free</span> and <span class="credits-red">open-source</span>, and it's
|
||||
<span class="credits-red">relentlessly improving</span> thanks to the involvement of contributors:</p>
|
||||
<p>Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis,
|
||||
Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman,
|
||||
Viktoria B., Guillermo V., Daniel J.,
|
||||
Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V.,
|
||||
Diego M., CarnivalBen,
|
||||
Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan
|
||||
T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.</p>
|
||||
<p>Thanks for giving a <span class="credits-red">star</span> to the Superalgos <span class="credits-red">repo at GitHub.com</span>... It helps other devs find the project!</p>
|
||||
</div>
|
||||
<div id="masterApp"></div>
|
||||
<div id="canvasApp"></div>
|
||||
<div id="docs-space-div" class="docs-page" style="position:fixed; top:100000px; left:100000px"><div id="docs-content-div"></div></div>
|
||||
<div id="chatApp" style="position:fixed; top:100000px; left:100000px">
|
||||
<iframe id="chatIFrame" style="border:none; " height="2000" width="900"></iframe>
|
||||
</div>
|
||||
<div id="textAreaDiv"></div>
|
||||
<div id="inputDiv" style="font-family:saira condensed;"> </div>
|
||||
|
||||
<!-- Tutorial Template Divs -->
|
||||
<div id="tutorialDiv" class="tutorial-step" style="position:fixed; top:100000px; left:100000px;"></div>
|
||||
<div id="tutorialFormDiv" class="tutorial-form" style="position:fixed; top:100000px; left:100000px;">
|
||||
<form>
|
||||
<table class="tutorial-buttonsTable">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-stop-button"
|
||||
onclick="UI.projects.superalgos.spaces.tutorialSpace.stop()"
|
||||
value=""> Stop </label>
|
||||
</td>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-skip-button"
|
||||
onclick="UI.projects.superalgos.spaces.tutorialSpace.skip()"
|
||||
value=""> Skip </label>
|
||||
</td>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-previous-button"
|
||||
onclick="UI.projects.superalgos.spaces.tutorialSpace.previous()" value="">Previous</label>
|
||||
</td>
|
||||
<td align="center">
|
||||
<label class="tutorial-font-small tutorial-next-button"
|
||||
onclick="UI.projects.superalgos.spaces.tutorialSpace.next()"
|
||||
value=""> Next </label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="menu" class="docs-menu-table">
|
||||
<div class="menu-row">
|
||||
<div class="menu-item" onClick="window.contextMenu.editParagraph()">
|
||||
<img src="Icons/Superalgos/docs-action-edit-paragraph.png" class="menu-img" title="Edit">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toTitle()">
|
||||
<img src="Icons/Superalgos/docs-title-style.png" class="menu-img" title="Title">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toSubtitle()">
|
||||
<img src="Icons/Superalgos/docs-subtitle-style.png" class="menu-img" title="Subtitle">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toNote()">
|
||||
<img src="Icons/Superalgos/docs-note-style.png" class="menu-img" title="Note">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toJavascript()">
|
||||
<img src="Icons/Superalgos/docs-js-code-style.png" class="menu-img" title="Javascript">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toYouTubeVideo()">
|
||||
<img src="Icons/Superalgos/docs-youtube-video-style.png" class="menu-img" title="Youtube">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toBlock()">
|
||||
<img src="Icons/Superalgos/docs-block-style.png" class="menu-img" title="Block">
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-row">
|
||||
<div class="menu-item" onClick="window.contextMenu.copyLink()">
|
||||
<img src="Icons/Superalgos/docs-action-copy-to-clipboard.png" class="menu-img" title="Copy">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toText()">
|
||||
<img src="Icons/Superalgos/docs-text-style.png" class="menu-img" title="Text">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toList()">
|
||||
<img src="Icons/Superalgos/docs-list-style.png" class="menu-img" title="List">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toSuccess()">
|
||||
<img src="Icons/Superalgos/docs-success-style.png" class="menu-img" title="Success">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toJson()">
|
||||
<img src="Icons/Superalgos/docs-json-code-style.png" class="menu-img" title="Json">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toGif()">
|
||||
<img src="Icons/Superalgos/docs-gif-style.png" class="menu-img" title="Gif">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toInclude()">
|
||||
<img src="Icons/Superalgos/docs-include-style.png" class="menu-img" title="Include">
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-row">
|
||||
<div class="menu-item" onClick="window.contextMenu.toPlaceholder()">
|
||||
<img src="Icons/Superalgos/docs-placeholder-style.png" class="menu-img" title="Placeholder">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toSummary()">
|
||||
<img src="Icons/Superalgos/docs-summary-style.png" class="menu-img" title="Summary">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toCallout()">
|
||||
<img src="Icons/Superalgos/docs-callout-style.png" class="menu-img" title="Callout">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toImportant()">
|
||||
<img src="Icons/Superalgos/docs-important-style.png" class="menu-img" title="Important">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toTable()">
|
||||
<img src="Icons/Superalgos/docs-table-style.png" class="menu-img" title="Table">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toPng()">
|
||||
<img src="Icons/Superalgos/docs-png-style.png" class="menu-img" title="Png">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toSection()">
|
||||
<img src="Icons/Superalgos/docs-section-style.png" class="menu-img" title="Section">
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-row">
|
||||
<div class="menu-item" onClick="window.contextMenu.deleteParagraph()">
|
||||
<img src="Icons/Superalgos/docs-action-delete-paragraph.png" class="menu-img" title="Delete">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toWebPageLink()">
|
||||
<img src="Icons/Superalgos/docs-web-page-link-style.png" class="menu-img" title="Link">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toAnchor()">
|
||||
<img src="Icons/Superalgos/docs-anchor-style.png" class="menu-img" title="Anchor">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toWarning()">
|
||||
<img src="Icons/Superalgos/docs-warning-style.png" class="menu-img" title="Warning">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toHierarchy()">
|
||||
<img src="Icons/Superalgos/docs-hierarchy-style.png" class="menu-img" title="Hierarchy">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toError()">
|
||||
<img src="Icons/Superalgos/docs-error-style.png" class="menu-img" title="Error">
|
||||
</div>
|
||||
<div class="menu-item" onClick="window.contextMenu.toChapter()">
|
||||
<img src="Icons/Superalgos/docs-chapter-style.png" class="menu-img" title="Chapter">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,54 +0,0 @@
|
||||
<h2 id="trading-engine">Trading Engine</h2>
|
||||
|
||||
<table class="definitionTable"><tr><td>
|
||||
|
||||
<img src="images/icons/nodes/png150/trading-engine.png" />
|
||||
|
||||
</td><td>
|
||||
|
||||
<strong>The trading engine hierarchy is the data structure used by the trading bot to keep runtime information highly accessible and exposed to others.</strong>
|
||||
|
||||
</td></tr></table>
|
||||
|
||||
<p>You will use this hierarchy for two main purposes:</p>
|
||||
|
||||
<p>The hierarchy exposes—literally—all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users. The hierarchy exposes—literally—all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users.</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>To let your trading systems:</strong> This allows strategies to keep track of and react to current and past events—including those involving the exchange, such as orders placed or filled—as the bot is running.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>To keep track of the actions:</strong> By analyzing runtime information, you may gain a detailed understanding of what happens, when, and why, throughout a trading session.</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>The hierarchy exposes—literally—all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users.</p>
|
||||
|
||||
<div class="bs-callout bs-callout-success">Este callout se usa para resaltar una idea particularmente importante. Algo se sobresale, como una conclusion, o algo por el estilo.</div>
|
||||
|
||||
<p>The hierarchy exposes all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users. The hierarchy exposes all the information processed by the trading bot, providing a comprehensive feedback loop to trading systems and analysis capabilities to users.</p>
|
||||
|
||||
<div class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Esto es una nota, algo noteworthy.</div>
|
||||
|
||||
<div class="alert alert-success" role="alert"><i class="fa fa-check-square-o"></i> <b>Tip:</b> Esto es un tip.</div>
|
||||
|
||||
<div class="alert alert-warning" role="alert"><i class="fa fa-warning"></i> <b>Important:</b> Esto es algo importante.</div>
|
||||
|
||||
<div class="alert alert-danger" role="alert"><i class="fa fa-exclamation-circle"></i> <b>Warning:</b> Esto es una aviso de alerta.</div>
|
||||
|
||||
<h4 id="adding-a-trading-engine-node">Adding a Trading Engine Node</h4>
|
||||
|
||||
<p>Calculo que con este segundo nivel de titulo alcanza.</p>
|
||||
|
||||
<h4 id="este-es-otro-formato-tipico-de-la-doc--trading-engine">Este es otro formato tipico de la doc: Trading Engine</h4>
|
||||
|
||||
<table class="definitionTable"><tr><td>
|
||||
|
||||
<img src="images/icons/nodes/png50/trading-engine.png" />
|
||||
|
||||
</td><td>
|
||||
|
||||
The trading engine hierarchy is the data structure used by the trading bot to keep runtime information highly accessible and exposed to others.
|
||||
|
||||
</td></tr></table>
|
||||
@@ -1,146 +0,0 @@
|
||||
|
||||
/* Load Environment Variables */
|
||||
let ENVIRONMENT = require('../Environment.js');
|
||||
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
|
||||
global.env = ENVIRONMENT_MODULE
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
if (err.message && err.message.indexOf("EADDRINUSE") > 0) {
|
||||
console.log("A Superalgos Client cannot be started. Reason: the port " + port + " is already in use by another application.")
|
||||
return
|
||||
}
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err.message = ' + err.message)
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err = ' + err)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
console.log('[ERROR] Client -> client-> unhandledRejection -> reason = ' + JSON.stringify(reason))
|
||||
console.log('[ERROR] Client -> client-> unhandledRejection -> p = ' + JSON.stringify(p))
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
/* Callbacks default responses. */
|
||||
|
||||
global.DEFAULT_OK_RESPONSE = {
|
||||
result: "Ok",
|
||||
message: "Operation Succeeded"
|
||||
};
|
||||
|
||||
global.DEFAULT_FAIL_RESPONSE = {
|
||||
result: "Fail",
|
||||
message: "Operation Failed"
|
||||
};
|
||||
|
||||
global.DEFAULT_RETRY_RESPONSE = {
|
||||
result: 'Retry',
|
||||
message: 'Retry Later'
|
||||
}
|
||||
|
||||
global.CUSTOM_OK_RESPONSE = {
|
||||
result: 'Ok, but check Message',
|
||||
message: 'Custom Message'
|
||||
}
|
||||
|
||||
global.CUSTOM_FAIL_RESPONSE = {
|
||||
result: 'Fail Because',
|
||||
message: 'Custom Message'
|
||||
}
|
||||
|
||||
/* Servers */
|
||||
let WEB_SERVER = require('./webServer.js')
|
||||
let DATA_FILE_SERVER = require('./dataFileServer.js')
|
||||
let PROJECT_FILE_SERVER = require('./projectFileServer.js')
|
||||
let UI_FILE_SERVER = require('./uiFileServer.js')
|
||||
let PLUGIN_SERVER = require('./pluginServer.js')
|
||||
let EVENT_SERVER = require('./eventServer.js')
|
||||
let TASK_MANAGER_SERVER = require('./taskManagerServer.js')
|
||||
let CCXT_SERVER = require('./ccxtServer.js')
|
||||
let WEB3_SERVER = require('./web3Server.js')
|
||||
|
||||
/* Network Interfaces */
|
||||
let WEB_SOCKETS_INTERFACE = require('./webSocketsServer.js')
|
||||
let HTTP_INTERFACE = require('./httpInterface.js')
|
||||
|
||||
try {
|
||||
console.log('CLIENT SERVERS:')
|
||||
console.log('')
|
||||
|
||||
WEB_SERVER = WEB_SERVER.newWebServer()
|
||||
WEB_SERVER.initialize()
|
||||
WEB_SERVER.run()
|
||||
console.log('Web Server ......................... Started')
|
||||
|
||||
UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer()
|
||||
UI_FILE_SERVER.initialize()
|
||||
UI_FILE_SERVER.run()
|
||||
console.log('UI File Server ..................... Started')
|
||||
|
||||
PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer()
|
||||
PROJECT_FILE_SERVER.initialize()
|
||||
PROJECT_FILE_SERVER.run()
|
||||
console.log('Project File Server ................ Started')
|
||||
|
||||
PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer()
|
||||
PLUGIN_SERVER.initialize()
|
||||
PLUGIN_SERVER.run()
|
||||
console.log('Plugin Server ...................... Started')
|
||||
|
||||
DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer()
|
||||
DATA_FILE_SERVER.initialize()
|
||||
DATA_FILE_SERVER.run()
|
||||
console.log('Data File Server ................... Started')
|
||||
|
||||
EVENT_SERVER = EVENT_SERVER.newEventServer()
|
||||
EVENT_SERVER.initialize()
|
||||
EVENT_SERVER.run()
|
||||
console.log('Events Server ...................... Started')
|
||||
|
||||
TASK_MANAGER_SERVER = TASK_MANAGER_SERVER.newTaskManagerServer(WEB_SOCKETS_INTERFACE, EVENT_SERVER)
|
||||
TASK_MANAGER_SERVER.initialize()
|
||||
TASK_MANAGER_SERVER.run()
|
||||
console.log('Task Manager Server ................ Started')
|
||||
|
||||
CCXT_SERVER = CCXT_SERVER.newCCXTServer()
|
||||
CCXT_SERVER.initialize()
|
||||
CCXT_SERVER.run()
|
||||
console.log('CCXT Server ........................ Started')
|
||||
|
||||
WEB3_SERVER = WEB3_SERVER.newWeb3Server()
|
||||
WEB3_SERVER.initialize()
|
||||
WEB3_SERVER.run()
|
||||
console.log('WEB3 Server ........................ Started')
|
||||
|
||||
console.log('')
|
||||
console.log('CLIENT INTERFACES:')
|
||||
console.log('')
|
||||
|
||||
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface(EVENT_SERVER)
|
||||
WEB_SOCKETS_INTERFACE.initialize()
|
||||
WEB_SOCKETS_INTERFACE.run()
|
||||
console.log('Web Sockets Interface .............. Listening at port ' + global.env.WEB_SOCKETS_INTERFACE_PORT)
|
||||
|
||||
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface(WEB_SERVER, DATA_FILE_SERVER, PROJECT_FILE_SERVER, UI_FILE_SERVER, PLUGIN_SERVER, CCXT_SERVER, WEB3_SERVER)
|
||||
HTTP_INTERFACE.initialize()
|
||||
HTTP_INTERFACE.run()
|
||||
console.log('Http Interface ..................... Listening at port ' + global.env.HTTP_INTERFACE_PORT)
|
||||
|
||||
console.log('')
|
||||
console.log("You are running Superalgos Beta 8")
|
||||
console.log('')
|
||||
console.log("What's new? The following was implemented here:")
|
||||
console.log('')
|
||||
console.log('Task Server Upgraded ............... This allow us to integrate crypto projects into the Task Server, opening the door to new types of bots defined at other projects.')
|
||||
console.log('In-App Documentation Improved ...... This allow users to improve the docs / tutorials, correcting, expanding and translating pages.')
|
||||
console.log('')
|
||||
console.log("What's next? At the development pipeline we have:")
|
||||
console.log('')
|
||||
console.log('Ethereum Integration ............... This will allow mining data from an Ethereum network node, create indicators with it, an use it on strategies.')
|
||||
console.log('Machine Learning Infrastructure .... This will enable a new kind of Bot that can learn from data mined. Later that knowledge can be used at trading strategies.')
|
||||
console.log('')
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] Client -> Error = ' + err.stack)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
-1
@@ -1 +0,0 @@
|
||||
export const version = "abi/5.0.0-beta.153";
|
||||
-91
@@ -1,91 +0,0 @@
|
||||
"use strict";
|
||||
// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI
|
||||
import { arrayify } from "@ethersproject/bytes";
|
||||
import { defineReadOnly } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
import { Reader, Writer } from "./coders/abstract-coder";
|
||||
import { AddressCoder } from "./coders/address";
|
||||
import { ArrayCoder } from "./coders/array";
|
||||
import { BooleanCoder } from "./coders/boolean";
|
||||
import { BytesCoder } from "./coders/bytes";
|
||||
import { FixedBytesCoder } from "./coders/fixed-bytes";
|
||||
import { NullCoder } from "./coders/null";
|
||||
import { NumberCoder } from "./coders/number";
|
||||
import { StringCoder } from "./coders/string";
|
||||
import { TupleCoder } from "./coders/tuple";
|
||||
import { ParamType } from "./fragments";
|
||||
const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
|
||||
const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
|
||||
export class AbiCoder {
|
||||
constructor(coerceFunc) {
|
||||
logger.checkNew(new.target, AbiCoder);
|
||||
defineReadOnly(this, "coerceFunc", coerceFunc || null);
|
||||
}
|
||||
_getCoder(param) {
|
||||
switch (param.baseType) {
|
||||
case "address":
|
||||
return new AddressCoder(param.name);
|
||||
case "bool":
|
||||
return new BooleanCoder(param.name);
|
||||
case "string":
|
||||
return new StringCoder(param.name);
|
||||
case "bytes":
|
||||
return new BytesCoder(param.name);
|
||||
case "array":
|
||||
return new ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);
|
||||
case "tuple":
|
||||
return new TupleCoder((param.components || []).map((component) => {
|
||||
return this._getCoder(component);
|
||||
}), param.name);
|
||||
case "":
|
||||
return new NullCoder(param.name);
|
||||
}
|
||||
// u?int[0-9]*
|
||||
let match = param.type.match(paramTypeNumber);
|
||||
if (match) {
|
||||
let size = parseInt(match[2] || "256");
|
||||
if (size === 0 || size > 256 || (size % 8) !== 0) {
|
||||
logger.throwArgumentError("invalid " + match[1] + " bit length", "param", param);
|
||||
}
|
||||
return new NumberCoder(size / 8, (match[1] === "int"), param.name);
|
||||
}
|
||||
// bytes[0-9]+
|
||||
match = param.type.match(paramTypeBytes);
|
||||
if (match) {
|
||||
let size = parseInt(match[1]);
|
||||
if (size === 0 || size > 32) {
|
||||
logger.throwArgumentError("invalid bytes length", "param", param);
|
||||
}
|
||||
return new FixedBytesCoder(size, param.name);
|
||||
}
|
||||
return logger.throwArgumentError("invalid type", "type", param.type);
|
||||
}
|
||||
_getWordSize() { return 32; }
|
||||
_getReader(data) {
|
||||
return new Reader(data, this._getWordSize(), this.coerceFunc);
|
||||
}
|
||||
_getWriter() {
|
||||
return new Writer(this._getWordSize());
|
||||
}
|
||||
encode(types, values) {
|
||||
if (types.length !== values.length) {
|
||||
logger.throwError("types/values length mismatch", Logger.errors.INVALID_ARGUMENT, {
|
||||
count: { types: types.length, values: values.length },
|
||||
value: { types: types, values: values }
|
||||
});
|
||||
}
|
||||
const coders = types.map((type) => this._getCoder(ParamType.from(type)));
|
||||
const coder = (new TupleCoder(coders, "_"));
|
||||
const writer = this._getWriter();
|
||||
coder.encode(writer, values);
|
||||
return writer.data;
|
||||
}
|
||||
decode(types, data) {
|
||||
const coders = types.map((type) => this._getCoder(ParamType.from(type)));
|
||||
const coder = new TupleCoder(coders, "_");
|
||||
return coder.decode(this._getReader(arrayify(data)));
|
||||
}
|
||||
}
|
||||
export const defaultAbiCoder = new AbiCoder();
|
||||
-131
@@ -1,131 +0,0 @@
|
||||
"use strict";
|
||||
import { arrayify, concat, hexlify } from "@ethersproject/bytes";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
import { defineReadOnly } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "../_version";
|
||||
const logger = new Logger(version);
|
||||
export function checkResultErrors(result) {
|
||||
// Find the first error (if any)
|
||||
const errors = [];
|
||||
const checkErrors = function (path, object) {
|
||||
if (!Array.isArray(object)) {
|
||||
return;
|
||||
}
|
||||
for (let key in object) {
|
||||
const childPath = path.slice();
|
||||
childPath.push(key);
|
||||
try {
|
||||
checkErrors(childPath, object[key]);
|
||||
}
|
||||
catch (error) {
|
||||
errors.push({ path: childPath, error: error });
|
||||
}
|
||||
}
|
||||
};
|
||||
checkErrors([], result);
|
||||
return errors;
|
||||
}
|
||||
export class Coder {
|
||||
constructor(name, type, localName, dynamic) {
|
||||
// @TODO: defineReadOnly these
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.localName = localName;
|
||||
this.dynamic = dynamic;
|
||||
}
|
||||
_throwError(message, value) {
|
||||
logger.throwArgumentError(message, this.localName, value);
|
||||
}
|
||||
}
|
||||
export class Writer {
|
||||
constructor(wordSize) {
|
||||
defineReadOnly(this, "wordSize", wordSize || 32);
|
||||
this._data = arrayify([]);
|
||||
this._padding = new Uint8Array(wordSize);
|
||||
}
|
||||
get data() { return hexlify(this._data); }
|
||||
get length() { return this._data.length; }
|
||||
_writeData(data) {
|
||||
this._data = concat([this._data, data]);
|
||||
return data.length;
|
||||
}
|
||||
// Arrayish items; padded on the right to wordSize
|
||||
writeBytes(value) {
|
||||
let bytes = arrayify(value);
|
||||
if (bytes.length % this.wordSize) {
|
||||
bytes = concat([bytes, this._padding.slice(bytes.length % this.wordSize)]);
|
||||
}
|
||||
return this._writeData(bytes);
|
||||
}
|
||||
_getValue(value) {
|
||||
let bytes = arrayify(BigNumber.from(value));
|
||||
if (bytes.length > this.wordSize) {
|
||||
logger.throwError("value out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
|
||||
length: this.wordSize,
|
||||
offset: bytes.length
|
||||
});
|
||||
}
|
||||
if (bytes.length % this.wordSize) {
|
||||
bytes = concat([this._padding.slice(bytes.length % this.wordSize), bytes]);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
// BigNumberish items; padded on the left to wordSize
|
||||
writeValue(value) {
|
||||
return this._writeData(this._getValue(value));
|
||||
}
|
||||
writeUpdatableValue() {
|
||||
let offset = this.length;
|
||||
this.writeValue(0);
|
||||
return (value) => {
|
||||
this._data.set(this._getValue(value), offset);
|
||||
};
|
||||
}
|
||||
}
|
||||
export class Reader {
|
||||
constructor(data, wordSize, coerceFunc) {
|
||||
defineReadOnly(this, "_data", arrayify(data));
|
||||
defineReadOnly(this, "wordSize", wordSize || 32);
|
||||
defineReadOnly(this, "_coerceFunc", coerceFunc);
|
||||
this._offset = 0;
|
||||
}
|
||||
get data() { return hexlify(this._data); }
|
||||
get consumed() { return this._offset; }
|
||||
// The default Coerce function
|
||||
static coerce(name, value) {
|
||||
let match = name.match("^u?int([0-9]+)$");
|
||||
if (match && parseInt(match[1]) <= 48) {
|
||||
value = value.toNumber();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
coerce(name, value) {
|
||||
if (this._coerceFunc) {
|
||||
return this._coerceFunc(name, value);
|
||||
}
|
||||
return Reader.coerce(name, value);
|
||||
}
|
||||
_peekBytes(offset, length) {
|
||||
let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;
|
||||
if (this._offset + alignedLength > this._data.length) {
|
||||
logger.throwError("data out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
|
||||
length: this._data.length,
|
||||
offset: this._offset + alignedLength
|
||||
});
|
||||
}
|
||||
return this._data.slice(this._offset, this._offset + alignedLength);
|
||||
}
|
||||
subReader(offset) {
|
||||
return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc);
|
||||
}
|
||||
readBytes(length) {
|
||||
let bytes = this._peekBytes(0, length);
|
||||
this._offset += bytes.length;
|
||||
// @TODO: Make sure the length..end bytes are all 0?
|
||||
return bytes.slice(0, length);
|
||||
}
|
||||
readValue() {
|
||||
return BigNumber.from(this.readBytes(this.wordSize));
|
||||
}
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
import { getAddress } from "@ethersproject/address";
|
||||
import { hexZeroPad } from "@ethersproject/bytes";
|
||||
import { Coder } from "./abstract-coder";
|
||||
export class AddressCoder extends Coder {
|
||||
constructor(localName) {
|
||||
super("address", "address", localName, false);
|
||||
}
|
||||
encode(writer, value) {
|
||||
try {
|
||||
getAddress(value);
|
||||
}
|
||||
catch (error) {
|
||||
this._throwError(error.message, value);
|
||||
}
|
||||
return writer.writeValue(value);
|
||||
}
|
||||
decode(reader) {
|
||||
return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));
|
||||
}
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
import { Coder } from "./abstract-coder";
|
||||
// Clones the functionality of an existing Coder, but without a localName
|
||||
export class AnonymousCoder extends Coder {
|
||||
constructor(coder) {
|
||||
super(coder.name, coder.type, undefined, coder.dynamic);
|
||||
this.coder = coder;
|
||||
}
|
||||
encode(writer, value) {
|
||||
return this.coder.encode(writer, value);
|
||||
}
|
||||
decode(reader) {
|
||||
return this.coder.decode(reader);
|
||||
}
|
||||
}
|
||||
-165
@@ -1,165 +0,0 @@
|
||||
"use strict";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "../_version";
|
||||
const logger = new Logger(version);
|
||||
import { Coder, Writer } from "./abstract-coder";
|
||||
import { AnonymousCoder } from "./anonymous";
|
||||
export function pack(writer, coders, values) {
|
||||
if (Array.isArray(values)) {
|
||||
// do nothing
|
||||
}
|
||||
else if (values && typeof (values) === "object") {
|
||||
let arrayValues = [];
|
||||
coders.forEach(function (coder) {
|
||||
arrayValues.push(values[coder.localName]);
|
||||
});
|
||||
values = arrayValues;
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("invalid tuple value", "tuple", values);
|
||||
}
|
||||
if (coders.length !== values.length) {
|
||||
logger.throwArgumentError("types/value length mismatch", "tuple", values);
|
||||
}
|
||||
let staticWriter = new Writer(writer.wordSize);
|
||||
let dynamicWriter = new Writer(writer.wordSize);
|
||||
let updateFuncs = [];
|
||||
coders.forEach((coder, index) => {
|
||||
let value = values[index];
|
||||
if (coder.dynamic) {
|
||||
// Get current dynamic offset (for the future pointer)
|
||||
let dynamicOffset = dynamicWriter.length;
|
||||
// Encode the dynamic value into the dynamicWriter
|
||||
coder.encode(dynamicWriter, value);
|
||||
// Prepare to populate the correct offset once we are done
|
||||
let updateFunc = staticWriter.writeUpdatableValue();
|
||||
updateFuncs.push((baseOffset) => {
|
||||
updateFunc(baseOffset + dynamicOffset);
|
||||
});
|
||||
}
|
||||
else {
|
||||
coder.encode(staticWriter, value);
|
||||
}
|
||||
});
|
||||
// Backfill all the dynamic offsets, now that we know the static length
|
||||
updateFuncs.forEach((func) => { func(staticWriter.length); });
|
||||
let length = writer.writeBytes(staticWriter.data);
|
||||
length += writer.writeBytes(dynamicWriter.data);
|
||||
return length;
|
||||
}
|
||||
export function unpack(reader, coders) {
|
||||
let values = [];
|
||||
// A reader anchored to this base
|
||||
let baseReader = reader.subReader(0);
|
||||
// The amount of dynamic data read; to consume later to synchronize
|
||||
let dynamicLength = 0;
|
||||
coders.forEach((coder) => {
|
||||
let value = null;
|
||||
if (coder.dynamic) {
|
||||
let offset = reader.readValue();
|
||||
let offsetReader = baseReader.subReader(offset.toNumber());
|
||||
try {
|
||||
value = coder.decode(offsetReader);
|
||||
}
|
||||
catch (error) {
|
||||
// Cannot recover from this
|
||||
if (error.code === Logger.errors.BUFFER_OVERRUN) {
|
||||
throw error;
|
||||
}
|
||||
value = error;
|
||||
value.baseType = coder.name;
|
||||
value.name = coder.localName;
|
||||
value.type = coder.type;
|
||||
}
|
||||
dynamicLength += offsetReader.consumed;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
value = coder.decode(reader);
|
||||
}
|
||||
catch (error) {
|
||||
// Cannot recover from this
|
||||
if (error.code === Logger.errors.BUFFER_OVERRUN) {
|
||||
throw error;
|
||||
}
|
||||
value = error;
|
||||
value.baseType = coder.name;
|
||||
value.name = coder.localName;
|
||||
value.type = coder.type;
|
||||
}
|
||||
}
|
||||
if (value != undefined) {
|
||||
values.push(value);
|
||||
}
|
||||
});
|
||||
// @TODO: get rid of this an see if it still works?
|
||||
// Consume the dynamic components in the main reader
|
||||
reader.readBytes(dynamicLength);
|
||||
// Add any named parameters (i.e. tuples)
|
||||
coders.forEach((coder, index) => {
|
||||
let name = coder.localName;
|
||||
if (!name) {
|
||||
return;
|
||||
}
|
||||
if (name === "length") {
|
||||
name = "_length";
|
||||
}
|
||||
if (values[name] != null) {
|
||||
return;
|
||||
}
|
||||
const value = values[index];
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(values, name, {
|
||||
get: () => { throw value; }
|
||||
});
|
||||
}
|
||||
else {
|
||||
values[name] = value;
|
||||
}
|
||||
});
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
const value = values[i];
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(values, i, {
|
||||
get: () => { throw value; }
|
||||
});
|
||||
}
|
||||
}
|
||||
return Object.freeze(values);
|
||||
}
|
||||
export class ArrayCoder extends Coder {
|
||||
constructor(coder, length, localName) {
|
||||
const type = (coder.type + "[" + (length >= 0 ? length : "") + "]");
|
||||
const dynamic = (length === -1 || coder.dynamic);
|
||||
super("array", type, localName, dynamic);
|
||||
this.coder = coder;
|
||||
this.length = length;
|
||||
}
|
||||
encode(writer, value) {
|
||||
if (!Array.isArray(value)) {
|
||||
this._throwError("expected array value", value);
|
||||
}
|
||||
let count = this.length;
|
||||
if (count === -1) {
|
||||
count = value.length;
|
||||
writer.writeValue(value.length);
|
||||
}
|
||||
logger.checkArgumentCount(count, value.length, "coder array" + (this.localName ? (" " + this.localName) : ""));
|
||||
let coders = [];
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
coders.push(this.coder);
|
||||
}
|
||||
return pack(writer, coders, value);
|
||||
}
|
||||
decode(reader) {
|
||||
let count = this.length;
|
||||
if (count === -1) {
|
||||
count = reader.readValue().toNumber();
|
||||
}
|
||||
let coders = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
coders.push(new AnonymousCoder(this.coder));
|
||||
}
|
||||
return reader.coerce(this.name, unpack(reader, coders));
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
import { Coder } from "./abstract-coder";
|
||||
export class BooleanCoder extends Coder {
|
||||
constructor(localName) {
|
||||
super("bool", "bool", localName, false);
|
||||
}
|
||||
encode(writer, value) {
|
||||
return writer.writeValue(value ? 1 : 0);
|
||||
}
|
||||
decode(reader) {
|
||||
return reader.coerce(this.type, !reader.readValue().isZero());
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
"use strict";
|
||||
import { arrayify, hexlify } from "@ethersproject/bytes";
|
||||
import { Coder } from "./abstract-coder";
|
||||
export class DynamicBytesCoder extends Coder {
|
||||
constructor(type, localName) {
|
||||
super(type, type, localName, true);
|
||||
}
|
||||
encode(writer, value) {
|
||||
value = arrayify(value);
|
||||
let length = writer.writeValue(value.length);
|
||||
length += writer.writeBytes(value);
|
||||
return length;
|
||||
}
|
||||
decode(reader) {
|
||||
return reader.readBytes(reader.readValue().toNumber());
|
||||
}
|
||||
}
|
||||
export class BytesCoder extends DynamicBytesCoder {
|
||||
constructor(localName) {
|
||||
super("bytes", localName);
|
||||
}
|
||||
decode(reader) {
|
||||
return reader.coerce(this.name, hexlify(super.decode(reader)));
|
||||
}
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
import { arrayify, hexlify } from "@ethersproject/bytes";
|
||||
import { Coder } from "./abstract-coder";
|
||||
// @TODO: Merge this with bytes
|
||||
export class FixedBytesCoder extends Coder {
|
||||
constructor(size, localName) {
|
||||
let name = "bytes" + String(size);
|
||||
super(name, name, localName, false);
|
||||
this.size = size;
|
||||
}
|
||||
encode(writer, value) {
|
||||
let data = arrayify(value);
|
||||
if (data.length !== this.size) {
|
||||
this._throwError("incorrect data length", value);
|
||||
}
|
||||
return writer.writeBytes(data);
|
||||
}
|
||||
decode(reader) {
|
||||
return reader.coerce(this.name, hexlify(reader.readBytes(this.size)));
|
||||
}
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
import { Coder } from "./abstract-coder";
|
||||
export class NullCoder extends Coder {
|
||||
constructor(localName) {
|
||||
super("null", "", localName, false);
|
||||
}
|
||||
encode(writer, value) {
|
||||
if (value != null) {
|
||||
this._throwError("not null", value);
|
||||
}
|
||||
return writer.writeBytes([]);
|
||||
}
|
||||
decode(reader) {
|
||||
reader.readBytes(0);
|
||||
return reader.coerce(this.name, null);
|
||||
}
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
"use strict";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
import { MaxUint256, NegativeOne, One, Zero } from "@ethersproject/constants";
|
||||
import { Coder } from "./abstract-coder";
|
||||
export class NumberCoder extends Coder {
|
||||
constructor(size, signed, localName) {
|
||||
const name = ((signed ? "int" : "uint") + (size * 8));
|
||||
super(name, name, localName, false);
|
||||
this.size = size;
|
||||
this.signed = signed;
|
||||
}
|
||||
encode(writer, value) {
|
||||
let v = BigNumber.from(value);
|
||||
// Check bounds are safe for encoding
|
||||
let maxUintValue = MaxUint256.mask(writer.wordSize * 8);
|
||||
if (this.signed) {
|
||||
let bounds = maxUintValue.mask(this.size * 8 - 1);
|
||||
if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne))) {
|
||||
this._throwError("value out-of-bounds", value);
|
||||
}
|
||||
}
|
||||
else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {
|
||||
this._throwError("value out-of-bounds", value);
|
||||
}
|
||||
v = v.toTwos(this.size * 8).mask(this.size * 8);
|
||||
if (this.signed) {
|
||||
v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
|
||||
}
|
||||
return writer.writeValue(v);
|
||||
}
|
||||
decode(reader) {
|
||||
let value = reader.readValue().mask(this.size * 8);
|
||||
if (this.signed) {
|
||||
value = value.fromTwos(this.size * 8);
|
||||
}
|
||||
return reader.coerce(this.name, value);
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
import { toUtf8Bytes, toUtf8String } from "@ethersproject/strings";
|
||||
import { DynamicBytesCoder } from "./bytes";
|
||||
export class StringCoder extends DynamicBytesCoder {
|
||||
constructor(localName) {
|
||||
super("string", localName);
|
||||
}
|
||||
encode(writer, value) {
|
||||
return super.encode(writer, toUtf8Bytes(value));
|
||||
}
|
||||
decode(reader) {
|
||||
return toUtf8String(super.decode(reader));
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
import { Coder } from "./abstract-coder";
|
||||
import { pack, unpack } from "./array";
|
||||
export class TupleCoder extends Coder {
|
||||
constructor(coders, localName) {
|
||||
let dynamic = false;
|
||||
const types = [];
|
||||
coders.forEach((coder) => {
|
||||
if (coder.dynamic) {
|
||||
dynamic = true;
|
||||
}
|
||||
types.push(coder.type);
|
||||
});
|
||||
const type = ("tuple(" + types.join(",") + ")");
|
||||
super("tuple", type, localName, dynamic);
|
||||
this.coders = coders;
|
||||
}
|
||||
encode(writer, value) {
|
||||
return pack(writer, this.coders, value);
|
||||
}
|
||||
decode(reader) {
|
||||
return reader.coerce(this.name, unpack(reader, this.coders));
|
||||
}
|
||||
}
|
||||
-780
@@ -1,780 +0,0 @@
|
||||
"use strict";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
import { defineReadOnly } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
;
|
||||
const _constructorGuard = {};
|
||||
let ModifiersBytes = { calldata: true, memory: true, storage: true };
|
||||
let ModifiersNest = { calldata: true, memory: true };
|
||||
function checkModifier(type, name) {
|
||||
if (type === "bytes" || type === "string") {
|
||||
if (ModifiersBytes[name]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (type === "address") {
|
||||
if (name === "payable") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (type.indexOf("[") >= 0 || type === "tuple") {
|
||||
if (ModifiersNest[name]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ModifiersBytes[name] || name === "payable") {
|
||||
logger.throwArgumentError("invalid modifier", "name", name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// @TODO: Make sure that children of an indexed tuple are marked with a null indexed
|
||||
function parseParamType(param, allowIndexed) {
|
||||
let originalParam = param;
|
||||
function throwError(i) {
|
||||
logger.throwArgumentError(`unexpected character at position ${i}`, "param", param);
|
||||
}
|
||||
param = param.replace(/\s/g, " ");
|
||||
function newNode(parent) {
|
||||
let node = { type: "", name: "", parent: parent, state: { allowType: true } };
|
||||
if (allowIndexed) {
|
||||
node.indexed = false;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
let parent = { type: "", name: "", state: { allowType: true } };
|
||||
let node = parent;
|
||||
for (let i = 0; i < param.length; i++) {
|
||||
let c = param[i];
|
||||
switch (c) {
|
||||
case "(":
|
||||
if (node.state.allowType && node.type === "") {
|
||||
node.type = "tuple";
|
||||
}
|
||||
else if (!node.state.allowParams) {
|
||||
throwError(i);
|
||||
}
|
||||
node.state.allowType = false;
|
||||
node.type = verifyType(node.type);
|
||||
node.components = [newNode(node)];
|
||||
node = node.components[0];
|
||||
break;
|
||||
case ")":
|
||||
delete node.state;
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(i);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
node.type = verifyType(node.type);
|
||||
let child = node;
|
||||
node = node.parent;
|
||||
if (!node) {
|
||||
throwError(i);
|
||||
}
|
||||
delete child.parent;
|
||||
node.state.allowParams = false;
|
||||
node.state.allowName = true;
|
||||
node.state.allowArray = true;
|
||||
break;
|
||||
case ",":
|
||||
delete node.state;
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(i);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
node.type = verifyType(node.type);
|
||||
let sibling = newNode(node.parent);
|
||||
//{ type: "", name: "", parent: node.parent, state: { allowType: true } };
|
||||
node.parent.components.push(sibling);
|
||||
delete node.parent;
|
||||
node = sibling;
|
||||
break;
|
||||
// Hit a space...
|
||||
case " ":
|
||||
// If reading type, the type is done and may read a param or name
|
||||
if (node.state.allowType) {
|
||||
if (node.type !== "") {
|
||||
node.type = verifyType(node.type);
|
||||
delete node.state.allowType;
|
||||
node.state.allowName = true;
|
||||
node.state.allowParams = true;
|
||||
}
|
||||
}
|
||||
// If reading name, the name is done
|
||||
if (node.state.allowName) {
|
||||
if (node.name !== "") {
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(i);
|
||||
}
|
||||
if (node.indexed) {
|
||||
throwError(i);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
else if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
else {
|
||||
node.state.allowName = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "[":
|
||||
if (!node.state.allowArray) {
|
||||
throwError(i);
|
||||
}
|
||||
node.type += c;
|
||||
node.state.allowArray = false;
|
||||
node.state.allowName = false;
|
||||
node.state.readArray = true;
|
||||
break;
|
||||
case "]":
|
||||
if (!node.state.readArray) {
|
||||
throwError(i);
|
||||
}
|
||||
node.type += c;
|
||||
node.state.readArray = false;
|
||||
node.state.allowArray = true;
|
||||
node.state.allowName = true;
|
||||
break;
|
||||
default:
|
||||
if (node.state.allowType) {
|
||||
node.type += c;
|
||||
node.state.allowParams = true;
|
||||
node.state.allowArray = true;
|
||||
}
|
||||
else if (node.state.allowName) {
|
||||
node.name += c;
|
||||
delete node.state.allowArray;
|
||||
}
|
||||
else if (node.state.readArray) {
|
||||
node.type += c;
|
||||
}
|
||||
else {
|
||||
throwError(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (node.parent) {
|
||||
logger.throwArgumentError("unexpected eof", "param", param);
|
||||
}
|
||||
delete parent.state;
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(originalParam.length - 7);
|
||||
}
|
||||
if (node.indexed) {
|
||||
throwError(originalParam.length - 7);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
else if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
parent.type = verifyType(parent.type);
|
||||
return parent;
|
||||
}
|
||||
function populate(object, params) {
|
||||
for (let key in params) {
|
||||
defineReadOnly(object, key, params[key]);
|
||||
}
|
||||
}
|
||||
export const FormatTypes = Object.freeze({
|
||||
// Bare formatting, as is needed for computing a sighash of an event or function
|
||||
sighash: "sighash",
|
||||
// Human-Readable with Minimal spacing and without names (compact human-readable)
|
||||
minimal: "minimal",
|
||||
// Human-Readble with nice spacing, including all names
|
||||
full: "full",
|
||||
// JSON-format a la Solidity
|
||||
json: "json"
|
||||
});
|
||||
const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
|
||||
export class ParamType {
|
||||
constructor(constructorGuard, params) {
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("use fromString", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new ParamType()"
|
||||
});
|
||||
}
|
||||
populate(this, params);
|
||||
let match = this.type.match(paramTypeArray);
|
||||
if (match) {
|
||||
populate(this, {
|
||||
arrayLength: parseInt(match[2] || "-1"),
|
||||
arrayChildren: ParamType.fromObject({
|
||||
type: match[1],
|
||||
components: this.components
|
||||
}),
|
||||
baseType: "array"
|
||||
});
|
||||
}
|
||||
else {
|
||||
populate(this, {
|
||||
arrayLength: null,
|
||||
arrayChildren: null,
|
||||
baseType: ((this.components != null) ? "tuple" : this.type)
|
||||
});
|
||||
}
|
||||
this._isParamType = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
// Format the parameter fragment
|
||||
// - sighash: "(uint256,address)"
|
||||
// - minimal: "tuple(uint256,address) indexed"
|
||||
// - full: "tuple(uint256 foo, addres bar) indexed baz"
|
||||
format(format) {
|
||||
if (!format) {
|
||||
format = FormatTypes.sighash;
|
||||
}
|
||||
if (!FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === FormatTypes.json) {
|
||||
let result = {
|
||||
type: ((this.baseType === "tuple") ? "tuple" : this.type),
|
||||
name: (this.name || undefined)
|
||||
};
|
||||
if (typeof (this.indexed) === "boolean") {
|
||||
result.indexed = this.indexed;
|
||||
}
|
||||
if (this.components) {
|
||||
result.components = this.components.map((comp) => JSON.parse(comp.format(format)));
|
||||
}
|
||||
return JSON.stringify(result);
|
||||
}
|
||||
let result = "";
|
||||
// Array
|
||||
if (this.baseType === "array") {
|
||||
result += this.arrayChildren.format(format);
|
||||
result += "[" + (this.arrayLength < 0 ? "" : String(this.arrayLength)) + "]";
|
||||
}
|
||||
else {
|
||||
if (this.baseType === "tuple") {
|
||||
if (format !== FormatTypes.sighash) {
|
||||
result += this.type;
|
||||
}
|
||||
result += "(" + this.components.map((comp) => comp.format(format)).join((format === FormatTypes.full) ? ", " : ",") + ")";
|
||||
}
|
||||
else {
|
||||
result += this.type;
|
||||
}
|
||||
}
|
||||
if (format !== FormatTypes.sighash) {
|
||||
if (this.indexed === true) {
|
||||
result += " indexed";
|
||||
}
|
||||
if (format === FormatTypes.full && this.name) {
|
||||
result += " " + this.name;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
static from(value, allowIndexed) {
|
||||
if (typeof (value) === "string") {
|
||||
return ParamType.fromString(value, allowIndexed);
|
||||
}
|
||||
return ParamType.fromObject(value);
|
||||
}
|
||||
static fromObject(value) {
|
||||
if (ParamType.isParamType(value)) {
|
||||
return value;
|
||||
}
|
||||
return new ParamType(_constructorGuard, {
|
||||
name: (value.name || null),
|
||||
type: verifyType(value.type),
|
||||
indexed: ((value.indexed == null) ? null : !!value.indexed),
|
||||
components: (value.components ? value.components.map(ParamType.fromObject) : null)
|
||||
});
|
||||
}
|
||||
static fromString(value, allowIndexed) {
|
||||
function ParamTypify(node) {
|
||||
return ParamType.fromObject({
|
||||
name: node.name,
|
||||
type: node.type,
|
||||
indexed: node.indexed,
|
||||
components: node.components
|
||||
});
|
||||
}
|
||||
return ParamTypify(parseParamType(value, !!allowIndexed));
|
||||
}
|
||||
static isParamType(value) {
|
||||
return !!(value != null && value._isParamType);
|
||||
}
|
||||
}
|
||||
;
|
||||
function parseParams(value, allowIndex) {
|
||||
return splitNesting(value).map((param) => ParamType.fromString(param, allowIndex));
|
||||
}
|
||||
export class Fragment {
|
||||
constructor(constructorGuard, params) {
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("use a static from method", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new Fragment()"
|
||||
});
|
||||
}
|
||||
populate(this, params);
|
||||
this._isFragment = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
static from(value) {
|
||||
if (Fragment.isFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
return Fragment.fromString(value);
|
||||
}
|
||||
return Fragment.fromObject(value);
|
||||
}
|
||||
static fromObject(value) {
|
||||
if (Fragment.isFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
switch (value.type) {
|
||||
case "function":
|
||||
return FunctionFragment.fromObject(value);
|
||||
case "event":
|
||||
return EventFragment.fromObject(value);
|
||||
case "constructor":
|
||||
return ConstructorFragment.fromObject(value);
|
||||
case "fallback":
|
||||
case "receive":
|
||||
// @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?
|
||||
return null;
|
||||
}
|
||||
return logger.throwArgumentError("invalid fragment object", "value", value);
|
||||
}
|
||||
static fromString(value) {
|
||||
// Make sure the "returns" is surrounded by a space and all whitespace is exactly one space
|
||||
value = value.replace(/\s/g, " ");
|
||||
value = value.replace(/\(/g, " (").replace(/\)/g, ") ").replace(/\s+/g, " ");
|
||||
value = value.trim();
|
||||
if (value.split(" ")[0] === "event") {
|
||||
return EventFragment.fromString(value.substring(5).trim());
|
||||
}
|
||||
else if (value.split(" ")[0] === "function") {
|
||||
return FunctionFragment.fromString(value.substring(8).trim());
|
||||
}
|
||||
else if (value.split("(")[0].trim() === "constructor") {
|
||||
return ConstructorFragment.fromString(value.trim());
|
||||
}
|
||||
return logger.throwArgumentError("unsupported fragment", "value", value);
|
||||
}
|
||||
static isFragment(value) {
|
||||
return !!(value && value._isFragment);
|
||||
}
|
||||
}
|
||||
export class EventFragment extends Fragment {
|
||||
format(format) {
|
||||
if (!format) {
|
||||
format = FormatTypes.sighash;
|
||||
}
|
||||
if (!FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === FormatTypes.json) {
|
||||
return JSON.stringify({
|
||||
type: "event",
|
||||
anonymous: this.anonymous,
|
||||
name: this.name,
|
||||
inputs: this.inputs.map((input) => JSON.parse(input.format(format)))
|
||||
});
|
||||
}
|
||||
let result = "";
|
||||
if (format !== FormatTypes.sighash) {
|
||||
result += "event ";
|
||||
}
|
||||
result += this.name + "(" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? ", " : ",") + ") ";
|
||||
if (format !== FormatTypes.sighash) {
|
||||
if (this.anonymous) {
|
||||
result += "anonymous ";
|
||||
}
|
||||
}
|
||||
return result.trim();
|
||||
}
|
||||
static from(value) {
|
||||
if (typeof (value) === "string") {
|
||||
return EventFragment.fromString(value);
|
||||
}
|
||||
return EventFragment.fromObject(value);
|
||||
}
|
||||
static fromObject(value) {
|
||||
if (EventFragment.isEventFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (value.type !== "event") {
|
||||
logger.throwArgumentError("invalid event object", "value", value);
|
||||
}
|
||||
const params = {
|
||||
name: verifyIdentifier(value.name),
|
||||
anonymous: value.anonymous,
|
||||
inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),
|
||||
type: "event"
|
||||
};
|
||||
return new EventFragment(_constructorGuard, params);
|
||||
}
|
||||
static fromString(value) {
|
||||
let match = value.match(regexParen);
|
||||
if (!match) {
|
||||
logger.throwArgumentError("invalid event string", "value", value);
|
||||
}
|
||||
let anonymous = false;
|
||||
match[3].split(" ").forEach((modifier) => {
|
||||
switch (modifier.trim()) {
|
||||
case "anonymous":
|
||||
anonymous = true;
|
||||
break;
|
||||
case "":
|
||||
break;
|
||||
default:
|
||||
logger.warn("unknown modifier: " + modifier);
|
||||
}
|
||||
});
|
||||
return EventFragment.fromObject({
|
||||
name: match[1].trim(),
|
||||
anonymous: anonymous,
|
||||
inputs: parseParams(match[2], true),
|
||||
type: "event"
|
||||
});
|
||||
}
|
||||
static isEventFragment(value) {
|
||||
return (value && value._isFragment && value.type === "event");
|
||||
}
|
||||
}
|
||||
function parseGas(value, params) {
|
||||
params.gas = null;
|
||||
let comps = value.split("@");
|
||||
if (comps.length !== 1) {
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
||||
}
|
||||
if (!comps[1].match(/^[0-9]+$/)) {
|
||||
logger.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
||||
}
|
||||
params.gas = BigNumber.from(comps[1]);
|
||||
return comps[0];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function parseModifiers(value, params) {
|
||||
params.constant = false;
|
||||
params.payable = false;
|
||||
params.stateMutability = "nonpayable";
|
||||
value.split(" ").forEach((modifier) => {
|
||||
switch (modifier.trim()) {
|
||||
case "constant":
|
||||
params.constant = true;
|
||||
break;
|
||||
case "payable":
|
||||
params.payable = true;
|
||||
params.stateMutability = "payable";
|
||||
break;
|
||||
case "pure":
|
||||
params.constant = true;
|
||||
params.stateMutability = "pure";
|
||||
break;
|
||||
case "view":
|
||||
params.constant = true;
|
||||
params.stateMutability = "view";
|
||||
break;
|
||||
case "external":
|
||||
case "public":
|
||||
case "":
|
||||
break;
|
||||
default:
|
||||
console.log("unknown modifier: " + modifier);
|
||||
}
|
||||
});
|
||||
}
|
||||
function verifyState(value) {
|
||||
let result = {
|
||||
constant: false,
|
||||
payable: true,
|
||||
stateMutability: "payable"
|
||||
};
|
||||
if (value.stateMutability != null) {
|
||||
result.stateMutability = value.stateMutability;
|
||||
// Set (and check things are consistent) the constant property
|
||||
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
|
||||
if (value.constant != null) {
|
||||
if ((!!value.constant) !== result.constant) {
|
||||
logger.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
|
||||
}
|
||||
}
|
||||
// Set (and check things are consistent) the payable property
|
||||
result.payable = (result.stateMutability === "payable");
|
||||
if (value.payable != null) {
|
||||
if ((!!value.payable) !== result.payable) {
|
||||
logger.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (value.payable != null) {
|
||||
result.payable = !!value.payable;
|
||||
// If payable we can assume non-constant; otherwise we can't assume
|
||||
if (value.constant == null && !result.payable && value.type !== "constructor") {
|
||||
logger.throwArgumentError("unable to determine stateMutability", "value", value);
|
||||
}
|
||||
result.constant = !!value.constant;
|
||||
if (result.constant) {
|
||||
result.stateMutability = "view";
|
||||
}
|
||||
else {
|
||||
result.stateMutability = (result.payable ? "payable" : "nonpayable");
|
||||
}
|
||||
if (result.payable && result.constant) {
|
||||
logger.throwArgumentError("cannot have constant payable function", "value", value);
|
||||
}
|
||||
}
|
||||
else if (value.constant != null) {
|
||||
result.constant = !!value.constant;
|
||||
result.payable = !result.constant;
|
||||
result.stateMutability = (result.constant ? "view" : "payable");
|
||||
}
|
||||
else if (value.type !== "constructor") {
|
||||
logger.throwArgumentError("unable to determine stateMutability", "value", value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export class ConstructorFragment extends Fragment {
|
||||
format(format) {
|
||||
if (!format) {
|
||||
format = FormatTypes.sighash;
|
||||
}
|
||||
if (!FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === FormatTypes.json) {
|
||||
return JSON.stringify({
|
||||
type: "constructor",
|
||||
stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined),
|
||||
payble: this.payable,
|
||||
gas: (this.gas ? this.gas.toNumber() : undefined),
|
||||
inputs: this.inputs.map((input) => JSON.parse(input.format(format)))
|
||||
});
|
||||
}
|
||||
if (format === FormatTypes.sighash) {
|
||||
logger.throwError("cannot format a constructor for sighash", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "format(sighash)"
|
||||
});
|
||||
}
|
||||
let result = "constructor(" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? ", " : ",") + ") ";
|
||||
if (this.stateMutability && this.stateMutability !== "nonpayable") {
|
||||
result += this.stateMutability + " ";
|
||||
}
|
||||
return result.trim();
|
||||
}
|
||||
static from(value) {
|
||||
if (typeof (value) === "string") {
|
||||
return ConstructorFragment.fromString(value);
|
||||
}
|
||||
return ConstructorFragment.fromObject(value);
|
||||
}
|
||||
static fromObject(value) {
|
||||
if (ConstructorFragment.isConstructorFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (value.type !== "constructor") {
|
||||
logger.throwArgumentError("invalid constructor object", "value", value);
|
||||
}
|
||||
let state = verifyState(value);
|
||||
if (state.constant) {
|
||||
logger.throwArgumentError("constructor cannot be constant", "value", value);
|
||||
}
|
||||
const params = {
|
||||
name: null,
|
||||
type: value.type,
|
||||
inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),
|
||||
payable: state.payable,
|
||||
stateMutability: state.stateMutability,
|
||||
gas: (value.gas ? BigNumber.from(value.gas) : null)
|
||||
};
|
||||
return new ConstructorFragment(_constructorGuard, params);
|
||||
}
|
||||
static fromString(value) {
|
||||
let params = { type: "constructor" };
|
||||
value = parseGas(value, params);
|
||||
let parens = value.match(regexParen);
|
||||
if (!parens || parens[1].trim() !== "constructor") {
|
||||
logger.throwArgumentError("invalid constructor string", "value", value);
|
||||
}
|
||||
params.inputs = parseParams(parens[2].trim(), false);
|
||||
parseModifiers(parens[3].trim(), params);
|
||||
return ConstructorFragment.fromObject(params);
|
||||
}
|
||||
static isConstructorFragment(value) {
|
||||
return (value && value._isFragment && value.type === "constructor");
|
||||
}
|
||||
}
|
||||
export class FunctionFragment extends ConstructorFragment {
|
||||
format(format) {
|
||||
if (!format) {
|
||||
format = FormatTypes.sighash;
|
||||
}
|
||||
if (!FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === FormatTypes.json) {
|
||||
return JSON.stringify({
|
||||
type: "function",
|
||||
name: this.name,
|
||||
constant: this.constant,
|
||||
stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined),
|
||||
payble: this.payable,
|
||||
gas: (this.gas ? this.gas.toNumber() : undefined),
|
||||
inputs: this.inputs.map((input) => JSON.parse(input.format(format))),
|
||||
ouputs: this.outputs.map((output) => JSON.parse(output.format(format))),
|
||||
});
|
||||
}
|
||||
let result = "";
|
||||
if (format !== FormatTypes.sighash) {
|
||||
result += "function ";
|
||||
}
|
||||
result += this.name + "(" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? ", " : ",") + ") ";
|
||||
if (format !== FormatTypes.sighash) {
|
||||
if (this.stateMutability) {
|
||||
if (this.stateMutability !== "nonpayable") {
|
||||
result += (this.stateMutability + " ");
|
||||
}
|
||||
}
|
||||
else if (this.constant) {
|
||||
result += "view ";
|
||||
}
|
||||
if (this.outputs && this.outputs.length) {
|
||||
result += "returns (" + this.outputs.map((output) => output.format(format)).join(", ") + ") ";
|
||||
}
|
||||
if (this.gas != null) {
|
||||
result += "@" + this.gas.toString() + " ";
|
||||
}
|
||||
}
|
||||
return result.trim();
|
||||
}
|
||||
static from(value) {
|
||||
if (typeof (value) === "string") {
|
||||
return FunctionFragment.fromString(value);
|
||||
}
|
||||
return FunctionFragment.fromObject(value);
|
||||
}
|
||||
static fromObject(value) {
|
||||
if (FunctionFragment.isFunctionFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (value.type !== "function") {
|
||||
logger.throwArgumentError("invalid function object", "value", value);
|
||||
}
|
||||
let state = verifyState(value);
|
||||
const params = {
|
||||
type: value.type,
|
||||
name: verifyIdentifier(value.name),
|
||||
constant: state.constant,
|
||||
inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),
|
||||
outputs: (value.outputs ? value.outputs.map(ParamType.fromObject) : []),
|
||||
payable: state.payable,
|
||||
stateMutability: state.stateMutability,
|
||||
gas: (value.gas ? BigNumber.from(value.gas) : null)
|
||||
};
|
||||
return new FunctionFragment(_constructorGuard, params);
|
||||
}
|
||||
static fromString(value) {
|
||||
let params = { type: "function" };
|
||||
value = parseGas(value, params);
|
||||
let comps = value.split(" returns ");
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("invalid function string", "value", value);
|
||||
}
|
||||
let parens = comps[0].match(regexParen);
|
||||
if (!parens) {
|
||||
logger.throwArgumentError("invalid function signature", "value", value);
|
||||
}
|
||||
params.name = parens[1].trim();
|
||||
if (params.name) {
|
||||
verifyIdentifier(params.name);
|
||||
}
|
||||
params.inputs = parseParams(parens[2], false);
|
||||
parseModifiers(parens[3].trim(), params);
|
||||
// We have outputs
|
||||
if (comps.length > 1) {
|
||||
let returns = comps[1].match(regexParen);
|
||||
if (returns[1].trim() != "" || returns[3].trim() != "") {
|
||||
logger.throwArgumentError("unexpected tokens", "value", value);
|
||||
}
|
||||
params.outputs = parseParams(returns[2], false);
|
||||
}
|
||||
else {
|
||||
params.outputs = [];
|
||||
}
|
||||
return FunctionFragment.fromObject(params);
|
||||
}
|
||||
static isFunctionFragment(value) {
|
||||
return (value && value._isFragment && value.type === "function");
|
||||
}
|
||||
}
|
||||
//export class ErrorFragment extends Fragment {
|
||||
//}
|
||||
//export class StructFragment extends Fragment {
|
||||
//}
|
||||
function verifyType(type) {
|
||||
// These need to be transformed to their full description
|
||||
if (type.match(/^uint($|[^1-9])/)) {
|
||||
type = "uint256" + type.substring(4);
|
||||
}
|
||||
else if (type.match(/^int($|[^1-9])/)) {
|
||||
type = "int256" + type.substring(3);
|
||||
}
|
||||
// @TODO: more verification
|
||||
return type;
|
||||
}
|
||||
const regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
|
||||
function verifyIdentifier(value) {
|
||||
if (!value || !value.match(regexIdentifier)) {
|
||||
logger.throwArgumentError(`invalid identifier "${value}"`, "value", value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
const regexParen = new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");
|
||||
function splitNesting(value) {
|
||||
value = value.trim();
|
||||
let result = [];
|
||||
let accum = "";
|
||||
let depth = 0;
|
||||
for (let offset = 0; offset < value.length; offset++) {
|
||||
let c = value[offset];
|
||||
if (c === "," && depth === 0) {
|
||||
result.push(accum);
|
||||
accum = "";
|
||||
}
|
||||
else {
|
||||
accum += c;
|
||||
if (c === "(") {
|
||||
depth++;
|
||||
}
|
||||
else if (c === ")") {
|
||||
depth--;
|
||||
if (depth === -1) {
|
||||
logger.throwArgumentError("unbalanced parenthesis", "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (accum) {
|
||||
result.push(accum);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
"use strict";
|
||||
import { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from "./fragments";
|
||||
import { AbiCoder, defaultAbiCoder } from "./abi-coder";
|
||||
import { checkResultErrors, Indexed, Interface, LogDescription, TransactionDescription } from "./interface";
|
||||
export { ConstructorFragment, EventFragment, Fragment, FunctionFragment, ParamType, FormatTypes, AbiCoder, defaultAbiCoder, Interface, Indexed, checkResultErrors, LogDescription, TransactionDescription };
|
||||
-492
@@ -1,492 +0,0 @@
|
||||
"use strict";
|
||||
import { getAddress } from "@ethersproject/address";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
import { arrayify, concat, hexDataSlice, hexlify, hexZeroPad, isHexString } from "@ethersproject/bytes";
|
||||
import { id } from "@ethersproject/hash";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { defineReadOnly, Description, getStatic } from "@ethersproject/properties";
|
||||
import { defaultAbiCoder } from "./abi-coder";
|
||||
import { checkResultErrors } from "./coders/abstract-coder";
|
||||
import { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from "./fragments";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
export { checkResultErrors };
|
||||
export class LogDescription extends Description {
|
||||
}
|
||||
export class TransactionDescription extends Description {
|
||||
}
|
||||
export class Indexed extends Description {
|
||||
static isIndexed(value) {
|
||||
return !!(value && value._isIndexed);
|
||||
}
|
||||
}
|
||||
function wrapAccessError(property, error) {
|
||||
const wrap = new Error(`deferred error during ABI decoding triggered accessing ${property}`);
|
||||
wrap.error = error;
|
||||
return wrap;
|
||||
}
|
||||
function checkNames(fragment, type, params) {
|
||||
params.reduce((accum, param) => {
|
||||
if (param.name) {
|
||||
if (accum[param.name]) {
|
||||
logger.throwArgumentError(`duplicate ${type} parameter ${JSON.stringify(param.name)} in ${fragment.format("full")}`, "fragment", fragment);
|
||||
}
|
||||
accum[param.name] = true;
|
||||
}
|
||||
return accum;
|
||||
}, {});
|
||||
}
|
||||
export class Interface {
|
||||
constructor(fragments) {
|
||||
logger.checkNew(new.target, Interface);
|
||||
let abi = [];
|
||||
if (typeof (fragments) === "string") {
|
||||
abi = JSON.parse(fragments);
|
||||
}
|
||||
else {
|
||||
abi = fragments;
|
||||
}
|
||||
defineReadOnly(this, "fragments", abi.map((fragment) => {
|
||||
return Fragment.from(fragment);
|
||||
}).filter((fragment) => (fragment != null)));
|
||||
defineReadOnly(this, "_abiCoder", getStatic((new.target), "getAbiCoder")());
|
||||
defineReadOnly(this, "functions", {});
|
||||
defineReadOnly(this, "errors", {});
|
||||
defineReadOnly(this, "events", {});
|
||||
defineReadOnly(this, "structs", {});
|
||||
// Add all fragments by their signature
|
||||
this.fragments.forEach((fragment) => {
|
||||
let bucket = null;
|
||||
switch (fragment.type) {
|
||||
case "constructor":
|
||||
if (this.deploy) {
|
||||
logger.warn("duplicate definition - constructor");
|
||||
return;
|
||||
}
|
||||
checkNames(fragment, "input", fragment.inputs);
|
||||
defineReadOnly(this, "deploy", fragment);
|
||||
return;
|
||||
case "function":
|
||||
checkNames(fragment, "input", fragment.inputs);
|
||||
checkNames(fragment, "output", fragment.outputs);
|
||||
bucket = this.functions;
|
||||
break;
|
||||
case "event":
|
||||
checkNames(fragment, "input", fragment.inputs);
|
||||
bucket = this.events;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
let signature = fragment.format();
|
||||
if (bucket[signature]) {
|
||||
logger.warn("duplicate definition - " + signature);
|
||||
return;
|
||||
}
|
||||
bucket[signature] = fragment;
|
||||
});
|
||||
// If we do not have a constructor add a default
|
||||
if (!this.deploy) {
|
||||
defineReadOnly(this, "deploy", ConstructorFragment.from({
|
||||
payable: false,
|
||||
type: "constructor"
|
||||
}));
|
||||
}
|
||||
defineReadOnly(this, "_isInterface", true);
|
||||
}
|
||||
format(format) {
|
||||
if (!format) {
|
||||
format = FormatTypes.full;
|
||||
}
|
||||
if (format === FormatTypes.sighash) {
|
||||
logger.throwArgumentError("interface does not support formatting sighash", "format", format);
|
||||
}
|
||||
const abi = this.fragments.map((fragment) => fragment.format(format));
|
||||
// We need to re-bundle the JSON fragments a bit
|
||||
if (format === FormatTypes.json) {
|
||||
return JSON.stringify(abi.map((j) => JSON.parse(j)));
|
||||
}
|
||||
return abi;
|
||||
}
|
||||
// Sub-classes can override these to handle other blockchains
|
||||
static getAbiCoder() {
|
||||
return defaultAbiCoder;
|
||||
}
|
||||
static getAddress(address) {
|
||||
return getAddress(address);
|
||||
}
|
||||
static getSighash(functionFragment) {
|
||||
return hexDataSlice(id(functionFragment.format()), 0, 4);
|
||||
}
|
||||
static getEventTopic(eventFragment) {
|
||||
return id(eventFragment.format());
|
||||
}
|
||||
// Find a function definition by any means necessary (unless it is ambiguous)
|
||||
getFunction(nameOrSignatureOrSighash) {
|
||||
if (isHexString(nameOrSignatureOrSighash)) {
|
||||
for (const name in this.functions) {
|
||||
if (nameOrSignatureOrSighash === this.getSighash(name)) {
|
||||
return this.functions[name];
|
||||
}
|
||||
}
|
||||
logger.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
|
||||
}
|
||||
// It is a bare name, look up the function (will return null if ambiguous)
|
||||
if (nameOrSignatureOrSighash.indexOf("(") === -1) {
|
||||
const name = nameOrSignatureOrSighash.trim();
|
||||
const matching = Object.keys(this.functions).filter((f) => (f.split("(" /* fix:) */)[0] === name));
|
||||
if (matching.length === 0) {
|
||||
logger.throwArgumentError("no matching function", "name", name);
|
||||
}
|
||||
else if (matching.length > 1) {
|
||||
logger.throwArgumentError("multiple matching functions", "name", name);
|
||||
}
|
||||
return this.functions[matching[0]];
|
||||
}
|
||||
// Normlize the signature and lookup the function
|
||||
const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
|
||||
if (!result) {
|
||||
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Find an event definition by any means necessary (unless it is ambiguous)
|
||||
getEvent(nameOrSignatureOrTopic) {
|
||||
if (isHexString(nameOrSignatureOrTopic)) {
|
||||
const topichash = nameOrSignatureOrTopic.toLowerCase();
|
||||
for (const name in this.events) {
|
||||
if (topichash === this.getEventTopic(name)) {
|
||||
return this.events[name];
|
||||
}
|
||||
}
|
||||
logger.throwArgumentError("no matching event", "topichash", topichash);
|
||||
}
|
||||
// It is a bare name, look up the function (will return null if ambiguous)
|
||||
if (nameOrSignatureOrTopic.indexOf("(") === -1) {
|
||||
const name = nameOrSignatureOrTopic.trim();
|
||||
const matching = Object.keys(this.events).filter((f) => (f.split("(" /* fix:) */)[0] === name));
|
||||
if (matching.length === 0) {
|
||||
logger.throwArgumentError("no matching event", "name", name);
|
||||
}
|
||||
else if (matching.length > 1) {
|
||||
logger.throwArgumentError("multiple matching events", "name", name);
|
||||
}
|
||||
return this.events[matching[0]];
|
||||
}
|
||||
// Normlize the signature and lookup the function
|
||||
const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
|
||||
if (!result) {
|
||||
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Get the sighash (the bytes4 selector) used by Solidity to identify a function
|
||||
getSighash(functionFragment) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
return getStatic(this.constructor, "getSighash")(functionFragment);
|
||||
}
|
||||
// Get the topic (the bytes32 hash) used by Solidity to identify an event
|
||||
getEventTopic(eventFragment) {
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
return getStatic(this.constructor, "getEventTopic")(eventFragment);
|
||||
}
|
||||
_decodeParams(params, data) {
|
||||
return this._abiCoder.decode(params, data);
|
||||
}
|
||||
_encodeParams(params, values) {
|
||||
return this._abiCoder.encode(params, values);
|
||||
}
|
||||
encodeDeploy(values) {
|
||||
return this._encodeParams(this.deploy.inputs, values || []);
|
||||
}
|
||||
// Decode the data for a function call (e.g. tx.data)
|
||||
decodeFunctionData(functionFragment, data) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
const bytes = arrayify(data);
|
||||
if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
|
||||
logger.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, "data", hexlify(bytes));
|
||||
}
|
||||
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
|
||||
}
|
||||
// Encode the data for a function call (e.g. tx.data)
|
||||
encodeFunctionData(functionFragment, values) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
return hexlify(concat([
|
||||
this.getSighash(functionFragment),
|
||||
this._encodeParams(functionFragment.inputs, values || [])
|
||||
]));
|
||||
}
|
||||
// Decode the result from a function call (e.g. from eth_call)
|
||||
decodeFunctionResult(functionFragment, data) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
let bytes = arrayify(data);
|
||||
let reason = null;
|
||||
let errorSignature = null;
|
||||
switch (bytes.length % this._abiCoder._getWordSize()) {
|
||||
case 0:
|
||||
try {
|
||||
return this._abiCoder.decode(functionFragment.outputs, bytes);
|
||||
}
|
||||
catch (error) { }
|
||||
break;
|
||||
case 4:
|
||||
if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
|
||||
errorSignature = "Error(string)";
|
||||
reason = this._abiCoder.decode(["string"], bytes.slice(4))[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
return logger.throwError("call revert exception", Logger.errors.CALL_EXCEPTION, {
|
||||
method: functionFragment.format(),
|
||||
errorSignature: errorSignature,
|
||||
errorArgs: [reason],
|
||||
reason: reason
|
||||
});
|
||||
}
|
||||
// Encode the result for a function call (e.g. for eth_call)
|
||||
encodeFunctionResult(functionFragment, values) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
|
||||
}
|
||||
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
|
||||
encodeFilterTopics(eventFragment, values) {
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
if (values.length > eventFragment.inputs.length) {
|
||||
logger.throwError("too many arguments for " + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {
|
||||
argument: "values",
|
||||
value: values
|
||||
});
|
||||
}
|
||||
let topics = [];
|
||||
if (!eventFragment.anonymous) {
|
||||
topics.push(this.getEventTopic(eventFragment));
|
||||
}
|
||||
const encodeTopic = (param, value) => {
|
||||
if (param.type === "string") {
|
||||
return id(value);
|
||||
}
|
||||
else if (param.type === "bytes") {
|
||||
return keccak256(hexlify(value));
|
||||
}
|
||||
// Check addresses are valid
|
||||
if (param.type === "address") {
|
||||
this._abiCoder.encode(["address"], [value]);
|
||||
}
|
||||
return hexZeroPad(hexlify(value), 32);
|
||||
};
|
||||
values.forEach((value, index) => {
|
||||
let param = eventFragment.inputs[index];
|
||||
if (!param.indexed) {
|
||||
if (value != null) {
|
||||
logger.throwArgumentError("cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (value == null) {
|
||||
topics.push(null);
|
||||
}
|
||||
else if (param.baseType === "array" || param.baseType === "tuple") {
|
||||
logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
|
||||
}
|
||||
else if (Array.isArray(value)) {
|
||||
topics.push(value.map((value) => encodeTopic(param, value)));
|
||||
}
|
||||
else {
|
||||
topics.push(encodeTopic(param, value));
|
||||
}
|
||||
});
|
||||
// Trim off trailing nulls
|
||||
while (topics.length && topics[topics.length - 1] === null) {
|
||||
topics.pop();
|
||||
}
|
||||
return topics;
|
||||
}
|
||||
encodeEventLog(eventFragment, values) {
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
const topics = [];
|
||||
const dataTypes = [];
|
||||
const dataValues = [];
|
||||
if (!eventFragment.anonymous) {
|
||||
topics.push(this.getEventTopic(eventFragment));
|
||||
}
|
||||
if (values.length !== eventFragment.inputs.length) {
|
||||
logger.throwArgumentError("event arguments/values mismatch", "values", values);
|
||||
}
|
||||
eventFragment.inputs.forEach((param, index) => {
|
||||
const value = values[index];
|
||||
if (param.indexed) {
|
||||
if (param.type === "string") {
|
||||
topics.push(id(value));
|
||||
}
|
||||
else if (param.type === "bytes") {
|
||||
topics.push(keccak256(value));
|
||||
}
|
||||
else if (param.baseType === "tuple" || param.baseType === "array") {
|
||||
// @TOOD
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
else {
|
||||
topics.push(this._abiCoder.encode([param.type], [value]));
|
||||
}
|
||||
}
|
||||
else {
|
||||
dataTypes.push(param);
|
||||
dataValues.push(value);
|
||||
}
|
||||
});
|
||||
return {
|
||||
data: this._abiCoder.encode(dataTypes, dataValues),
|
||||
topics: topics
|
||||
};
|
||||
}
|
||||
// Decode a filter for the event and the search criteria
|
||||
decodeEventLog(eventFragment, data, topics) {
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
if (topics != null && !eventFragment.anonymous) {
|
||||
let topicHash = this.getEventTopic(eventFragment);
|
||||
if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
|
||||
logger.throwError("fragment/topic mismatch", Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
|
||||
}
|
||||
topics = topics.slice(1);
|
||||
}
|
||||
let indexed = [];
|
||||
let nonIndexed = [];
|
||||
let dynamic = [];
|
||||
eventFragment.inputs.forEach((param, index) => {
|
||||
if (param.indexed) {
|
||||
if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") {
|
||||
indexed.push(ParamType.fromObject({ type: "bytes32", name: param.name }));
|
||||
dynamic.push(true);
|
||||
}
|
||||
else {
|
||||
indexed.push(param);
|
||||
dynamic.push(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nonIndexed.push(param);
|
||||
dynamic.push(false);
|
||||
}
|
||||
});
|
||||
let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)) : null;
|
||||
let resultNonIndexed = this._abiCoder.decode(nonIndexed, data);
|
||||
let result = [];
|
||||
let nonIndexedIndex = 0, indexedIndex = 0;
|
||||
eventFragment.inputs.forEach((param, index) => {
|
||||
if (param.indexed) {
|
||||
if (resultIndexed == null) {
|
||||
result[index] = new Indexed({ _isIndexed: true, hash: null });
|
||||
}
|
||||
else if (dynamic[index]) {
|
||||
result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });
|
||||
}
|
||||
else {
|
||||
try {
|
||||
result[index] = resultIndexed[indexedIndex++];
|
||||
}
|
||||
catch (error) {
|
||||
result[index] = error;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
result[index] = resultNonIndexed[nonIndexedIndex++];
|
||||
}
|
||||
catch (error) {
|
||||
result[index] = error;
|
||||
}
|
||||
}
|
||||
// Add the keyword argument if named and safe
|
||||
if (param.name && result[param.name] == null) {
|
||||
const value = result[index];
|
||||
// Make error named values throw on access
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(result, param.name, {
|
||||
get: () => { throw wrapAccessError(`property ${JSON.stringify(param.name)}`, value); }
|
||||
});
|
||||
}
|
||||
else {
|
||||
result[param.name] = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
// Make all error indexed values throw on access
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
const value = result[i];
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(result, i, {
|
||||
get: () => { throw wrapAccessError(`index ${i}`, value); }
|
||||
});
|
||||
}
|
||||
}
|
||||
return Object.freeze(result);
|
||||
}
|
||||
// Given a transaction, find the matching function fragment (if any) and
|
||||
// determine all its properties and call parameters
|
||||
parseTransaction(tx) {
|
||||
let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
|
||||
if (!fragment) {
|
||||
return null;
|
||||
}
|
||||
return new TransactionDescription({
|
||||
args: this._abiCoder.decode(fragment.inputs, "0x" + tx.data.substring(10)),
|
||||
functionFragment: fragment,
|
||||
name: fragment.name,
|
||||
signature: fragment.format(),
|
||||
sighash: this.getSighash(fragment),
|
||||
value: BigNumber.from(tx.value || "0"),
|
||||
});
|
||||
}
|
||||
// Given an event log, find the matching event fragment (if any) and
|
||||
// determine all its properties and values
|
||||
parseLog(log) {
|
||||
let fragment = this.getEvent(log.topics[0]);
|
||||
if (!fragment || fragment.anonymous) {
|
||||
return null;
|
||||
}
|
||||
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
|
||||
// Probably not, because just because it is the only event in the ABI does
|
||||
// not mean we have the full ABI; maybe jsut a fragment?
|
||||
return new LogDescription({
|
||||
eventFragment: fragment,
|
||||
name: fragment.name,
|
||||
signature: fragment.format(),
|
||||
topic: this.getEventTopic(fragment),
|
||||
args: this.decodeEventLog(fragment, log.data, log.topics)
|
||||
});
|
||||
}
|
||||
/*
|
||||
static from(value: Array<Fragment | string | JsonAbi> | string | Interface) {
|
||||
if (Interface.isInterface(value)) {
|
||||
return value;
|
||||
}
|
||||
if (typeof(value) === "string") {
|
||||
return new Interface(JSON.parse(value));
|
||||
}
|
||||
return new Interface(value);
|
||||
}
|
||||
*/
|
||||
static isInterface(value) {
|
||||
return !!(value && value._isInterface);
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "abi/5.0.0-beta.153";
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var abstract_coder_1 = require("./coders/abstract-coder");
|
||||
var address_1 = require("./coders/address");
|
||||
var array_1 = require("./coders/array");
|
||||
var boolean_1 = require("./coders/boolean");
|
||||
var bytes_2 = require("./coders/bytes");
|
||||
var fixed_bytes_1 = require("./coders/fixed-bytes");
|
||||
var null_1 = require("./coders/null");
|
||||
var number_1 = require("./coders/number");
|
||||
var string_1 = require("./coders/string");
|
||||
var tuple_1 = require("./coders/tuple");
|
||||
var fragments_1 = require("./fragments");
|
||||
var paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
|
||||
var paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
|
||||
var AbiCoder = /** @class */ (function () {
|
||||
function AbiCoder(coerceFunc) {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, AbiCoder);
|
||||
properties_1.defineReadOnly(this, "coerceFunc", coerceFunc || null);
|
||||
}
|
||||
AbiCoder.prototype._getCoder = function (param) {
|
||||
var _this = this;
|
||||
switch (param.baseType) {
|
||||
case "address":
|
||||
return new address_1.AddressCoder(param.name);
|
||||
case "bool":
|
||||
return new boolean_1.BooleanCoder(param.name);
|
||||
case "string":
|
||||
return new string_1.StringCoder(param.name);
|
||||
case "bytes":
|
||||
return new bytes_2.BytesCoder(param.name);
|
||||
case "array":
|
||||
return new array_1.ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);
|
||||
case "tuple":
|
||||
return new tuple_1.TupleCoder((param.components || []).map(function (component) {
|
||||
return _this._getCoder(component);
|
||||
}), param.name);
|
||||
case "":
|
||||
return new null_1.NullCoder(param.name);
|
||||
}
|
||||
// u?int[0-9]*
|
||||
var match = param.type.match(paramTypeNumber);
|
||||
if (match) {
|
||||
var size = parseInt(match[2] || "256");
|
||||
if (size === 0 || size > 256 || (size % 8) !== 0) {
|
||||
logger.throwArgumentError("invalid " + match[1] + " bit length", "param", param);
|
||||
}
|
||||
return new number_1.NumberCoder(size / 8, (match[1] === "int"), param.name);
|
||||
}
|
||||
// bytes[0-9]+
|
||||
match = param.type.match(paramTypeBytes);
|
||||
if (match) {
|
||||
var size = parseInt(match[1]);
|
||||
if (size === 0 || size > 32) {
|
||||
logger.throwArgumentError("invalid bytes length", "param", param);
|
||||
}
|
||||
return new fixed_bytes_1.FixedBytesCoder(size, param.name);
|
||||
}
|
||||
return logger.throwArgumentError("invalid type", "type", param.type);
|
||||
};
|
||||
AbiCoder.prototype._getWordSize = function () { return 32; };
|
||||
AbiCoder.prototype._getReader = function (data) {
|
||||
return new abstract_coder_1.Reader(data, this._getWordSize(), this.coerceFunc);
|
||||
};
|
||||
AbiCoder.prototype._getWriter = function () {
|
||||
return new abstract_coder_1.Writer(this._getWordSize());
|
||||
};
|
||||
AbiCoder.prototype.encode = function (types, values) {
|
||||
var _this = this;
|
||||
if (types.length !== values.length) {
|
||||
logger.throwError("types/values length mismatch", logger_1.Logger.errors.INVALID_ARGUMENT, {
|
||||
count: { types: types.length, values: values.length },
|
||||
value: { types: types, values: values }
|
||||
});
|
||||
}
|
||||
var coders = types.map(function (type) { return _this._getCoder(fragments_1.ParamType.from(type)); });
|
||||
var coder = (new tuple_1.TupleCoder(coders, "_"));
|
||||
var writer = this._getWriter();
|
||||
coder.encode(writer, values);
|
||||
return writer.data;
|
||||
};
|
||||
AbiCoder.prototype.decode = function (types, data) {
|
||||
var _this = this;
|
||||
var coders = types.map(function (type) { return _this._getCoder(fragments_1.ParamType.from(type)); });
|
||||
var coder = new tuple_1.TupleCoder(coders, "_");
|
||||
return coder.decode(this._getReader(bytes_1.arrayify(data)));
|
||||
};
|
||||
return AbiCoder;
|
||||
}());
|
||||
exports.AbiCoder = AbiCoder;
|
||||
exports.defaultAbiCoder = new AbiCoder();
|
||||
-156
@@ -1,156 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("../_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
function checkResultErrors(result) {
|
||||
// Find the first error (if any)
|
||||
var errors = [];
|
||||
var checkErrors = function (path, object) {
|
||||
if (!Array.isArray(object)) {
|
||||
return;
|
||||
}
|
||||
for (var key in object) {
|
||||
var childPath = path.slice();
|
||||
childPath.push(key);
|
||||
try {
|
||||
checkErrors(childPath, object[key]);
|
||||
}
|
||||
catch (error) {
|
||||
errors.push({ path: childPath, error: error });
|
||||
}
|
||||
}
|
||||
};
|
||||
checkErrors([], result);
|
||||
return errors;
|
||||
}
|
||||
exports.checkResultErrors = checkResultErrors;
|
||||
var Coder = /** @class */ (function () {
|
||||
function Coder(name, type, localName, dynamic) {
|
||||
// @TODO: defineReadOnly these
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.localName = localName;
|
||||
this.dynamic = dynamic;
|
||||
}
|
||||
Coder.prototype._throwError = function (message, value) {
|
||||
logger.throwArgumentError(message, this.localName, value);
|
||||
};
|
||||
return Coder;
|
||||
}());
|
||||
exports.Coder = Coder;
|
||||
var Writer = /** @class */ (function () {
|
||||
function Writer(wordSize) {
|
||||
properties_1.defineReadOnly(this, "wordSize", wordSize || 32);
|
||||
this._data = bytes_1.arrayify([]);
|
||||
this._padding = new Uint8Array(wordSize);
|
||||
}
|
||||
Object.defineProperty(Writer.prototype, "data", {
|
||||
get: function () { return bytes_1.hexlify(this._data); },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Writer.prototype, "length", {
|
||||
get: function () { return this._data.length; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Writer.prototype._writeData = function (data) {
|
||||
this._data = bytes_1.concat([this._data, data]);
|
||||
return data.length;
|
||||
};
|
||||
// Arrayish items; padded on the right to wordSize
|
||||
Writer.prototype.writeBytes = function (value) {
|
||||
var bytes = bytes_1.arrayify(value);
|
||||
if (bytes.length % this.wordSize) {
|
||||
bytes = bytes_1.concat([bytes, this._padding.slice(bytes.length % this.wordSize)]);
|
||||
}
|
||||
return this._writeData(bytes);
|
||||
};
|
||||
Writer.prototype._getValue = function (value) {
|
||||
var bytes = bytes_1.arrayify(bignumber_1.BigNumber.from(value));
|
||||
if (bytes.length > this.wordSize) {
|
||||
logger.throwError("value out-of-bounds", logger_1.Logger.errors.BUFFER_OVERRUN, {
|
||||
length: this.wordSize,
|
||||
offset: bytes.length
|
||||
});
|
||||
}
|
||||
if (bytes.length % this.wordSize) {
|
||||
bytes = bytes_1.concat([this._padding.slice(bytes.length % this.wordSize), bytes]);
|
||||
}
|
||||
return bytes;
|
||||
};
|
||||
// BigNumberish items; padded on the left to wordSize
|
||||
Writer.prototype.writeValue = function (value) {
|
||||
return this._writeData(this._getValue(value));
|
||||
};
|
||||
Writer.prototype.writeUpdatableValue = function () {
|
||||
var _this = this;
|
||||
var offset = this.length;
|
||||
this.writeValue(0);
|
||||
return function (value) {
|
||||
_this._data.set(_this._getValue(value), offset);
|
||||
};
|
||||
};
|
||||
return Writer;
|
||||
}());
|
||||
exports.Writer = Writer;
|
||||
var Reader = /** @class */ (function () {
|
||||
function Reader(data, wordSize, coerceFunc) {
|
||||
properties_1.defineReadOnly(this, "_data", bytes_1.arrayify(data));
|
||||
properties_1.defineReadOnly(this, "wordSize", wordSize || 32);
|
||||
properties_1.defineReadOnly(this, "_coerceFunc", coerceFunc);
|
||||
this._offset = 0;
|
||||
}
|
||||
Object.defineProperty(Reader.prototype, "data", {
|
||||
get: function () { return bytes_1.hexlify(this._data); },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Reader.prototype, "consumed", {
|
||||
get: function () { return this._offset; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
// The default Coerce function
|
||||
Reader.coerce = function (name, value) {
|
||||
var match = name.match("^u?int([0-9]+)$");
|
||||
if (match && parseInt(match[1]) <= 48) {
|
||||
value = value.toNumber();
|
||||
}
|
||||
return value;
|
||||
};
|
||||
Reader.prototype.coerce = function (name, value) {
|
||||
if (this._coerceFunc) {
|
||||
return this._coerceFunc(name, value);
|
||||
}
|
||||
return Reader.coerce(name, value);
|
||||
};
|
||||
Reader.prototype._peekBytes = function (offset, length) {
|
||||
var alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;
|
||||
if (this._offset + alignedLength > this._data.length) {
|
||||
logger.throwError("data out-of-bounds", logger_1.Logger.errors.BUFFER_OVERRUN, {
|
||||
length: this._data.length,
|
||||
offset: this._offset + alignedLength
|
||||
});
|
||||
}
|
||||
return this._data.slice(this._offset, this._offset + alignedLength);
|
||||
};
|
||||
Reader.prototype.subReader = function (offset) {
|
||||
return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc);
|
||||
};
|
||||
Reader.prototype.readBytes = function (length) {
|
||||
var bytes = this._peekBytes(0, length);
|
||||
this._offset += bytes.length;
|
||||
// @TODO: Make sure the length..end bytes are all 0?
|
||||
return bytes.slice(0, length);
|
||||
};
|
||||
Reader.prototype.readValue = function () {
|
||||
return bignumber_1.BigNumber.from(this.readBytes(this.wordSize));
|
||||
};
|
||||
return Reader;
|
||||
}());
|
||||
exports.Reader = Reader;
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var address_1 = require("@ethersproject/address");
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var AddressCoder = /** @class */ (function (_super) {
|
||||
__extends(AddressCoder, _super);
|
||||
function AddressCoder(localName) {
|
||||
return _super.call(this, "address", "address", localName, false) || this;
|
||||
}
|
||||
AddressCoder.prototype.encode = function (writer, value) {
|
||||
try {
|
||||
address_1.getAddress(value);
|
||||
}
|
||||
catch (error) {
|
||||
this._throwError(error.message, value);
|
||||
}
|
||||
return writer.writeValue(value);
|
||||
};
|
||||
AddressCoder.prototype.decode = function (reader) {
|
||||
return address_1.getAddress(bytes_1.hexZeroPad(reader.readValue().toHexString(), 20));
|
||||
};
|
||||
return AddressCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.AddressCoder = AddressCoder;
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
// Clones the functionality of an existing Coder, but without a localName
|
||||
var AnonymousCoder = /** @class */ (function (_super) {
|
||||
__extends(AnonymousCoder, _super);
|
||||
function AnonymousCoder(coder) {
|
||||
var _this = _super.call(this, coder.name, coder.type, undefined, coder.dynamic) || this;
|
||||
_this.coder = coder;
|
||||
return _this;
|
||||
}
|
||||
AnonymousCoder.prototype.encode = function (writer, value) {
|
||||
return this.coder.encode(writer, value);
|
||||
};
|
||||
AnonymousCoder.prototype.decode = function (reader) {
|
||||
return this.coder.decode(reader);
|
||||
};
|
||||
return AnonymousCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.AnonymousCoder = AnonymousCoder;
|
||||
-189
@@ -1,189 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("../_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var anonymous_1 = require("./anonymous");
|
||||
function pack(writer, coders, values) {
|
||||
if (Array.isArray(values)) {
|
||||
// do nothing
|
||||
}
|
||||
else if (values && typeof (values) === "object") {
|
||||
var arrayValues_1 = [];
|
||||
coders.forEach(function (coder) {
|
||||
arrayValues_1.push(values[coder.localName]);
|
||||
});
|
||||
values = arrayValues_1;
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("invalid tuple value", "tuple", values);
|
||||
}
|
||||
if (coders.length !== values.length) {
|
||||
logger.throwArgumentError("types/value length mismatch", "tuple", values);
|
||||
}
|
||||
var staticWriter = new abstract_coder_1.Writer(writer.wordSize);
|
||||
var dynamicWriter = new abstract_coder_1.Writer(writer.wordSize);
|
||||
var updateFuncs = [];
|
||||
coders.forEach(function (coder, index) {
|
||||
var value = values[index];
|
||||
if (coder.dynamic) {
|
||||
// Get current dynamic offset (for the future pointer)
|
||||
var dynamicOffset_1 = dynamicWriter.length;
|
||||
// Encode the dynamic value into the dynamicWriter
|
||||
coder.encode(dynamicWriter, value);
|
||||
// Prepare to populate the correct offset once we are done
|
||||
var updateFunc_1 = staticWriter.writeUpdatableValue();
|
||||
updateFuncs.push(function (baseOffset) {
|
||||
updateFunc_1(baseOffset + dynamicOffset_1);
|
||||
});
|
||||
}
|
||||
else {
|
||||
coder.encode(staticWriter, value);
|
||||
}
|
||||
});
|
||||
// Backfill all the dynamic offsets, now that we know the static length
|
||||
updateFuncs.forEach(function (func) { func(staticWriter.length); });
|
||||
var length = writer.writeBytes(staticWriter.data);
|
||||
length += writer.writeBytes(dynamicWriter.data);
|
||||
return length;
|
||||
}
|
||||
exports.pack = pack;
|
||||
function unpack(reader, coders) {
|
||||
var values = [];
|
||||
// A reader anchored to this base
|
||||
var baseReader = reader.subReader(0);
|
||||
// The amount of dynamic data read; to consume later to synchronize
|
||||
var dynamicLength = 0;
|
||||
coders.forEach(function (coder) {
|
||||
var value = null;
|
||||
if (coder.dynamic) {
|
||||
var offset = reader.readValue();
|
||||
var offsetReader = baseReader.subReader(offset.toNumber());
|
||||
try {
|
||||
value = coder.decode(offsetReader);
|
||||
}
|
||||
catch (error) {
|
||||
// Cannot recover from this
|
||||
if (error.code === logger_1.Logger.errors.BUFFER_OVERRUN) {
|
||||
throw error;
|
||||
}
|
||||
value = error;
|
||||
value.baseType = coder.name;
|
||||
value.name = coder.localName;
|
||||
value.type = coder.type;
|
||||
}
|
||||
dynamicLength += offsetReader.consumed;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
value = coder.decode(reader);
|
||||
}
|
||||
catch (error) {
|
||||
// Cannot recover from this
|
||||
if (error.code === logger_1.Logger.errors.BUFFER_OVERRUN) {
|
||||
throw error;
|
||||
}
|
||||
value = error;
|
||||
value.baseType = coder.name;
|
||||
value.name = coder.localName;
|
||||
value.type = coder.type;
|
||||
}
|
||||
}
|
||||
if (value != undefined) {
|
||||
values.push(value);
|
||||
}
|
||||
});
|
||||
// @TODO: get rid of this an see if it still works?
|
||||
// Consume the dynamic components in the main reader
|
||||
reader.readBytes(dynamicLength);
|
||||
// Add any named parameters (i.e. tuples)
|
||||
coders.forEach(function (coder, index) {
|
||||
var name = coder.localName;
|
||||
if (!name) {
|
||||
return;
|
||||
}
|
||||
if (name === "length") {
|
||||
name = "_length";
|
||||
}
|
||||
if (values[name] != null) {
|
||||
return;
|
||||
}
|
||||
var value = values[index];
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(values, name, {
|
||||
get: function () { throw value; }
|
||||
});
|
||||
}
|
||||
else {
|
||||
values[name] = value;
|
||||
}
|
||||
});
|
||||
var _loop_1 = function (i) {
|
||||
var value = values[i];
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(values, i, {
|
||||
get: function () { throw value; }
|
||||
});
|
||||
}
|
||||
};
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
_loop_1(i);
|
||||
}
|
||||
return Object.freeze(values);
|
||||
}
|
||||
exports.unpack = unpack;
|
||||
var ArrayCoder = /** @class */ (function (_super) {
|
||||
__extends(ArrayCoder, _super);
|
||||
function ArrayCoder(coder, length, localName) {
|
||||
var _this = this;
|
||||
var type = (coder.type + "[" + (length >= 0 ? length : "") + "]");
|
||||
var dynamic = (length === -1 || coder.dynamic);
|
||||
_this = _super.call(this, "array", type, localName, dynamic) || this;
|
||||
_this.coder = coder;
|
||||
_this.length = length;
|
||||
return _this;
|
||||
}
|
||||
ArrayCoder.prototype.encode = function (writer, value) {
|
||||
if (!Array.isArray(value)) {
|
||||
this._throwError("expected array value", value);
|
||||
}
|
||||
var count = this.length;
|
||||
if (count === -1) {
|
||||
count = value.length;
|
||||
writer.writeValue(value.length);
|
||||
}
|
||||
logger.checkArgumentCount(count, value.length, "coder array" + (this.localName ? (" " + this.localName) : ""));
|
||||
var coders = [];
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
coders.push(this.coder);
|
||||
}
|
||||
return pack(writer, coders, value);
|
||||
};
|
||||
ArrayCoder.prototype.decode = function (reader) {
|
||||
var count = this.length;
|
||||
if (count === -1) {
|
||||
count = reader.readValue().toNumber();
|
||||
}
|
||||
var coders = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
coders.push(new anonymous_1.AnonymousCoder(this.coder));
|
||||
}
|
||||
return reader.coerce(this.name, unpack(reader, coders));
|
||||
};
|
||||
return ArrayCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.ArrayCoder = ArrayCoder;
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var BooleanCoder = /** @class */ (function (_super) {
|
||||
__extends(BooleanCoder, _super);
|
||||
function BooleanCoder(localName) {
|
||||
return _super.call(this, "bool", "bool", localName, false) || this;
|
||||
}
|
||||
BooleanCoder.prototype.encode = function (writer, value) {
|
||||
return writer.writeValue(value ? 1 : 0);
|
||||
};
|
||||
BooleanCoder.prototype.decode = function (reader) {
|
||||
return reader.coerce(this.type, !reader.readValue().isZero());
|
||||
};
|
||||
return BooleanCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.BooleanCoder = BooleanCoder;
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var DynamicBytesCoder = /** @class */ (function (_super) {
|
||||
__extends(DynamicBytesCoder, _super);
|
||||
function DynamicBytesCoder(type, localName) {
|
||||
return _super.call(this, type, type, localName, true) || this;
|
||||
}
|
||||
DynamicBytesCoder.prototype.encode = function (writer, value) {
|
||||
value = bytes_1.arrayify(value);
|
||||
var length = writer.writeValue(value.length);
|
||||
length += writer.writeBytes(value);
|
||||
return length;
|
||||
};
|
||||
DynamicBytesCoder.prototype.decode = function (reader) {
|
||||
return reader.readBytes(reader.readValue().toNumber());
|
||||
};
|
||||
return DynamicBytesCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.DynamicBytesCoder = DynamicBytesCoder;
|
||||
var BytesCoder = /** @class */ (function (_super) {
|
||||
__extends(BytesCoder, _super);
|
||||
function BytesCoder(localName) {
|
||||
return _super.call(this, "bytes", localName) || this;
|
||||
}
|
||||
BytesCoder.prototype.decode = function (reader) {
|
||||
return reader.coerce(this.name, bytes_1.hexlify(_super.prototype.decode.call(this, reader)));
|
||||
};
|
||||
return BytesCoder;
|
||||
}(DynamicBytesCoder));
|
||||
exports.BytesCoder = BytesCoder;
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
// @TODO: Merge this with bytes
|
||||
var FixedBytesCoder = /** @class */ (function (_super) {
|
||||
__extends(FixedBytesCoder, _super);
|
||||
function FixedBytesCoder(size, localName) {
|
||||
var _this = this;
|
||||
var name = "bytes" + String(size);
|
||||
_this = _super.call(this, name, name, localName, false) || this;
|
||||
_this.size = size;
|
||||
return _this;
|
||||
}
|
||||
FixedBytesCoder.prototype.encode = function (writer, value) {
|
||||
var data = bytes_1.arrayify(value);
|
||||
if (data.length !== this.size) {
|
||||
this._throwError("incorrect data length", value);
|
||||
}
|
||||
return writer.writeBytes(data);
|
||||
};
|
||||
FixedBytesCoder.prototype.decode = function (reader) {
|
||||
return reader.coerce(this.name, bytes_1.hexlify(reader.readBytes(this.size)));
|
||||
};
|
||||
return FixedBytesCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.FixedBytesCoder = FixedBytesCoder;
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var NullCoder = /** @class */ (function (_super) {
|
||||
__extends(NullCoder, _super);
|
||||
function NullCoder(localName) {
|
||||
return _super.call(this, "null", "", localName, false) || this;
|
||||
}
|
||||
NullCoder.prototype.encode = function (writer, value) {
|
||||
if (value != null) {
|
||||
this._throwError("not null", value);
|
||||
}
|
||||
return writer.writeBytes([]);
|
||||
};
|
||||
NullCoder.prototype.decode = function (reader) {
|
||||
reader.readBytes(0);
|
||||
return reader.coerce(this.name, null);
|
||||
};
|
||||
return NullCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.NullCoder = NullCoder;
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var constants_1 = require("@ethersproject/constants");
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var NumberCoder = /** @class */ (function (_super) {
|
||||
__extends(NumberCoder, _super);
|
||||
function NumberCoder(size, signed, localName) {
|
||||
var _this = this;
|
||||
var name = ((signed ? "int" : "uint") + (size * 8));
|
||||
_this = _super.call(this, name, name, localName, false) || this;
|
||||
_this.size = size;
|
||||
_this.signed = signed;
|
||||
return _this;
|
||||
}
|
||||
NumberCoder.prototype.encode = function (writer, value) {
|
||||
var v = bignumber_1.BigNumber.from(value);
|
||||
// Check bounds are safe for encoding
|
||||
var maxUintValue = constants_1.MaxUint256.mask(writer.wordSize * 8);
|
||||
if (this.signed) {
|
||||
var bounds = maxUintValue.mask(this.size * 8 - 1);
|
||||
if (v.gt(bounds) || v.lt(bounds.add(constants_1.One).mul(constants_1.NegativeOne))) {
|
||||
this._throwError("value out-of-bounds", value);
|
||||
}
|
||||
}
|
||||
else if (v.lt(constants_1.Zero) || v.gt(maxUintValue.mask(this.size * 8))) {
|
||||
this._throwError("value out-of-bounds", value);
|
||||
}
|
||||
v = v.toTwos(this.size * 8).mask(this.size * 8);
|
||||
if (this.signed) {
|
||||
v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
|
||||
}
|
||||
return writer.writeValue(v);
|
||||
};
|
||||
NumberCoder.prototype.decode = function (reader) {
|
||||
var value = reader.readValue().mask(this.size * 8);
|
||||
if (this.signed) {
|
||||
value = value.fromTwos(this.size * 8);
|
||||
}
|
||||
return reader.coerce(this.name, value);
|
||||
};
|
||||
return NumberCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.NumberCoder = NumberCoder;
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var strings_1 = require("@ethersproject/strings");
|
||||
var bytes_1 = require("./bytes");
|
||||
var StringCoder = /** @class */ (function (_super) {
|
||||
__extends(StringCoder, _super);
|
||||
function StringCoder(localName) {
|
||||
return _super.call(this, "string", localName) || this;
|
||||
}
|
||||
StringCoder.prototype.encode = function (writer, value) {
|
||||
return _super.prototype.encode.call(this, writer, strings_1.toUtf8Bytes(value));
|
||||
};
|
||||
StringCoder.prototype.decode = function (reader) {
|
||||
return strings_1.toUtf8String(_super.prototype.decode.call(this, reader));
|
||||
};
|
||||
return StringCoder;
|
||||
}(bytes_1.DynamicBytesCoder));
|
||||
exports.StringCoder = StringCoder;
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var abstract_coder_1 = require("./abstract-coder");
|
||||
var array_1 = require("./array");
|
||||
var TupleCoder = /** @class */ (function (_super) {
|
||||
__extends(TupleCoder, _super);
|
||||
function TupleCoder(coders, localName) {
|
||||
var _this = this;
|
||||
var dynamic = false;
|
||||
var types = [];
|
||||
coders.forEach(function (coder) {
|
||||
if (coder.dynamic) {
|
||||
dynamic = true;
|
||||
}
|
||||
types.push(coder.type);
|
||||
});
|
||||
var type = ("tuple(" + types.join(",") + ")");
|
||||
_this = _super.call(this, "tuple", type, localName, dynamic) || this;
|
||||
_this.coders = coders;
|
||||
return _this;
|
||||
}
|
||||
TupleCoder.prototype.encode = function (writer, value) {
|
||||
return array_1.pack(writer, this.coders, value);
|
||||
};
|
||||
TupleCoder.prototype.decode = function (reader) {
|
||||
return reader.coerce(this.name, array_1.unpack(reader, this.coders));
|
||||
};
|
||||
return TupleCoder;
|
||||
}(abstract_coder_1.Coder));
|
||||
exports.TupleCoder = TupleCoder;
|
||||
-816
@@ -1,816 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
;
|
||||
var _constructorGuard = {};
|
||||
var ModifiersBytes = { calldata: true, memory: true, storage: true };
|
||||
var ModifiersNest = { calldata: true, memory: true };
|
||||
function checkModifier(type, name) {
|
||||
if (type === "bytes" || type === "string") {
|
||||
if (ModifiersBytes[name]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (type === "address") {
|
||||
if (name === "payable") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (type.indexOf("[") >= 0 || type === "tuple") {
|
||||
if (ModifiersNest[name]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ModifiersBytes[name] || name === "payable") {
|
||||
logger.throwArgumentError("invalid modifier", "name", name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// @TODO: Make sure that children of an indexed tuple are marked with a null indexed
|
||||
function parseParamType(param, allowIndexed) {
|
||||
var originalParam = param;
|
||||
function throwError(i) {
|
||||
logger.throwArgumentError("unexpected character at position " + i, "param", param);
|
||||
}
|
||||
param = param.replace(/\s/g, " ");
|
||||
function newNode(parent) {
|
||||
var node = { type: "", name: "", parent: parent, state: { allowType: true } };
|
||||
if (allowIndexed) {
|
||||
node.indexed = false;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
var parent = { type: "", name: "", state: { allowType: true } };
|
||||
var node = parent;
|
||||
for (var i = 0; i < param.length; i++) {
|
||||
var c = param[i];
|
||||
switch (c) {
|
||||
case "(":
|
||||
if (node.state.allowType && node.type === "") {
|
||||
node.type = "tuple";
|
||||
}
|
||||
else if (!node.state.allowParams) {
|
||||
throwError(i);
|
||||
}
|
||||
node.state.allowType = false;
|
||||
node.type = verifyType(node.type);
|
||||
node.components = [newNode(node)];
|
||||
node = node.components[0];
|
||||
break;
|
||||
case ")":
|
||||
delete node.state;
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(i);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
node.type = verifyType(node.type);
|
||||
var child = node;
|
||||
node = node.parent;
|
||||
if (!node) {
|
||||
throwError(i);
|
||||
}
|
||||
delete child.parent;
|
||||
node.state.allowParams = false;
|
||||
node.state.allowName = true;
|
||||
node.state.allowArray = true;
|
||||
break;
|
||||
case ",":
|
||||
delete node.state;
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(i);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
node.type = verifyType(node.type);
|
||||
var sibling = newNode(node.parent);
|
||||
//{ type: "", name: "", parent: node.parent, state: { allowType: true } };
|
||||
node.parent.components.push(sibling);
|
||||
delete node.parent;
|
||||
node = sibling;
|
||||
break;
|
||||
// Hit a space...
|
||||
case " ":
|
||||
// If reading type, the type is done and may read a param or name
|
||||
if (node.state.allowType) {
|
||||
if (node.type !== "") {
|
||||
node.type = verifyType(node.type);
|
||||
delete node.state.allowType;
|
||||
node.state.allowName = true;
|
||||
node.state.allowParams = true;
|
||||
}
|
||||
}
|
||||
// If reading name, the name is done
|
||||
if (node.state.allowName) {
|
||||
if (node.name !== "") {
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(i);
|
||||
}
|
||||
if (node.indexed) {
|
||||
throwError(i);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
else if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
else {
|
||||
node.state.allowName = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "[":
|
||||
if (!node.state.allowArray) {
|
||||
throwError(i);
|
||||
}
|
||||
node.type += c;
|
||||
node.state.allowArray = false;
|
||||
node.state.allowName = false;
|
||||
node.state.readArray = true;
|
||||
break;
|
||||
case "]":
|
||||
if (!node.state.readArray) {
|
||||
throwError(i);
|
||||
}
|
||||
node.type += c;
|
||||
node.state.readArray = false;
|
||||
node.state.allowArray = true;
|
||||
node.state.allowName = true;
|
||||
break;
|
||||
default:
|
||||
if (node.state.allowType) {
|
||||
node.type += c;
|
||||
node.state.allowParams = true;
|
||||
node.state.allowArray = true;
|
||||
}
|
||||
else if (node.state.allowName) {
|
||||
node.name += c;
|
||||
delete node.state.allowArray;
|
||||
}
|
||||
else if (node.state.readArray) {
|
||||
node.type += c;
|
||||
}
|
||||
else {
|
||||
throwError(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (node.parent) {
|
||||
logger.throwArgumentError("unexpected eof", "param", param);
|
||||
}
|
||||
delete parent.state;
|
||||
if (node.name === "indexed") {
|
||||
if (!allowIndexed) {
|
||||
throwError(originalParam.length - 7);
|
||||
}
|
||||
if (node.indexed) {
|
||||
throwError(originalParam.length - 7);
|
||||
}
|
||||
node.indexed = true;
|
||||
node.name = "";
|
||||
}
|
||||
else if (checkModifier(node.type, node.name)) {
|
||||
node.name = "";
|
||||
}
|
||||
parent.type = verifyType(parent.type);
|
||||
return parent;
|
||||
}
|
||||
function populate(object, params) {
|
||||
for (var key in params) {
|
||||
properties_1.defineReadOnly(object, key, params[key]);
|
||||
}
|
||||
}
|
||||
exports.FormatTypes = Object.freeze({
|
||||
// Bare formatting, as is needed for computing a sighash of an event or function
|
||||
sighash: "sighash",
|
||||
// Human-Readable with Minimal spacing and without names (compact human-readable)
|
||||
minimal: "minimal",
|
||||
// Human-Readble with nice spacing, including all names
|
||||
full: "full",
|
||||
// JSON-format a la Solidity
|
||||
json: "json"
|
||||
});
|
||||
var paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
|
||||
var ParamType = /** @class */ (function () {
|
||||
function ParamType(constructorGuard, params) {
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("use fromString", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new ParamType()"
|
||||
});
|
||||
}
|
||||
populate(this, params);
|
||||
var match = this.type.match(paramTypeArray);
|
||||
if (match) {
|
||||
populate(this, {
|
||||
arrayLength: parseInt(match[2] || "-1"),
|
||||
arrayChildren: ParamType.fromObject({
|
||||
type: match[1],
|
||||
components: this.components
|
||||
}),
|
||||
baseType: "array"
|
||||
});
|
||||
}
|
||||
else {
|
||||
populate(this, {
|
||||
arrayLength: null,
|
||||
arrayChildren: null,
|
||||
baseType: ((this.components != null) ? "tuple" : this.type)
|
||||
});
|
||||
}
|
||||
this._isParamType = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
// Format the parameter fragment
|
||||
// - sighash: "(uint256,address)"
|
||||
// - minimal: "tuple(uint256,address) indexed"
|
||||
// - full: "tuple(uint256 foo, addres bar) indexed baz"
|
||||
ParamType.prototype.format = function (format) {
|
||||
if (!format) {
|
||||
format = exports.FormatTypes.sighash;
|
||||
}
|
||||
if (!exports.FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === exports.FormatTypes.json) {
|
||||
var result_1 = {
|
||||
type: ((this.baseType === "tuple") ? "tuple" : this.type),
|
||||
name: (this.name || undefined)
|
||||
};
|
||||
if (typeof (this.indexed) === "boolean") {
|
||||
result_1.indexed = this.indexed;
|
||||
}
|
||||
if (this.components) {
|
||||
result_1.components = this.components.map(function (comp) { return JSON.parse(comp.format(format)); });
|
||||
}
|
||||
return JSON.stringify(result_1);
|
||||
}
|
||||
var result = "";
|
||||
// Array
|
||||
if (this.baseType === "array") {
|
||||
result += this.arrayChildren.format(format);
|
||||
result += "[" + (this.arrayLength < 0 ? "" : String(this.arrayLength)) + "]";
|
||||
}
|
||||
else {
|
||||
if (this.baseType === "tuple") {
|
||||
if (format !== exports.FormatTypes.sighash) {
|
||||
result += this.type;
|
||||
}
|
||||
result += "(" + this.components.map(function (comp) { return comp.format(format); }).join((format === exports.FormatTypes.full) ? ", " : ",") + ")";
|
||||
}
|
||||
else {
|
||||
result += this.type;
|
||||
}
|
||||
}
|
||||
if (format !== exports.FormatTypes.sighash) {
|
||||
if (this.indexed === true) {
|
||||
result += " indexed";
|
||||
}
|
||||
if (format === exports.FormatTypes.full && this.name) {
|
||||
result += " " + this.name;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
ParamType.from = function (value, allowIndexed) {
|
||||
if (typeof (value) === "string") {
|
||||
return ParamType.fromString(value, allowIndexed);
|
||||
}
|
||||
return ParamType.fromObject(value);
|
||||
};
|
||||
ParamType.fromObject = function (value) {
|
||||
if (ParamType.isParamType(value)) {
|
||||
return value;
|
||||
}
|
||||
return new ParamType(_constructorGuard, {
|
||||
name: (value.name || null),
|
||||
type: verifyType(value.type),
|
||||
indexed: ((value.indexed == null) ? null : !!value.indexed),
|
||||
components: (value.components ? value.components.map(ParamType.fromObject) : null)
|
||||
});
|
||||
};
|
||||
ParamType.fromString = function (value, allowIndexed) {
|
||||
function ParamTypify(node) {
|
||||
return ParamType.fromObject({
|
||||
name: node.name,
|
||||
type: node.type,
|
||||
indexed: node.indexed,
|
||||
components: node.components
|
||||
});
|
||||
}
|
||||
return ParamTypify(parseParamType(value, !!allowIndexed));
|
||||
};
|
||||
ParamType.isParamType = function (value) {
|
||||
return !!(value != null && value._isParamType);
|
||||
};
|
||||
return ParamType;
|
||||
}());
|
||||
exports.ParamType = ParamType;
|
||||
;
|
||||
function parseParams(value, allowIndex) {
|
||||
return splitNesting(value).map(function (param) { return ParamType.fromString(param, allowIndex); });
|
||||
}
|
||||
var Fragment = /** @class */ (function () {
|
||||
function Fragment(constructorGuard, params) {
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("use a static from method", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new Fragment()"
|
||||
});
|
||||
}
|
||||
populate(this, params);
|
||||
this._isFragment = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
Fragment.from = function (value) {
|
||||
if (Fragment.isFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
return Fragment.fromString(value);
|
||||
}
|
||||
return Fragment.fromObject(value);
|
||||
};
|
||||
Fragment.fromObject = function (value) {
|
||||
if (Fragment.isFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
switch (value.type) {
|
||||
case "function":
|
||||
return FunctionFragment.fromObject(value);
|
||||
case "event":
|
||||
return EventFragment.fromObject(value);
|
||||
case "constructor":
|
||||
return ConstructorFragment.fromObject(value);
|
||||
case "fallback":
|
||||
case "receive":
|
||||
// @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?
|
||||
return null;
|
||||
}
|
||||
return logger.throwArgumentError("invalid fragment object", "value", value);
|
||||
};
|
||||
Fragment.fromString = function (value) {
|
||||
// Make sure the "returns" is surrounded by a space and all whitespace is exactly one space
|
||||
value = value.replace(/\s/g, " ");
|
||||
value = value.replace(/\(/g, " (").replace(/\)/g, ") ").replace(/\s+/g, " ");
|
||||
value = value.trim();
|
||||
if (value.split(" ")[0] === "event") {
|
||||
return EventFragment.fromString(value.substring(5).trim());
|
||||
}
|
||||
else if (value.split(" ")[0] === "function") {
|
||||
return FunctionFragment.fromString(value.substring(8).trim());
|
||||
}
|
||||
else if (value.split("(")[0].trim() === "constructor") {
|
||||
return ConstructorFragment.fromString(value.trim());
|
||||
}
|
||||
return logger.throwArgumentError("unsupported fragment", "value", value);
|
||||
};
|
||||
Fragment.isFragment = function (value) {
|
||||
return !!(value && value._isFragment);
|
||||
};
|
||||
return Fragment;
|
||||
}());
|
||||
exports.Fragment = Fragment;
|
||||
var EventFragment = /** @class */ (function (_super) {
|
||||
__extends(EventFragment, _super);
|
||||
function EventFragment() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
EventFragment.prototype.format = function (format) {
|
||||
if (!format) {
|
||||
format = exports.FormatTypes.sighash;
|
||||
}
|
||||
if (!exports.FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === exports.FormatTypes.json) {
|
||||
return JSON.stringify({
|
||||
type: "event",
|
||||
anonymous: this.anonymous,
|
||||
name: this.name,
|
||||
inputs: this.inputs.map(function (input) { return JSON.parse(input.format(format)); })
|
||||
});
|
||||
}
|
||||
var result = "";
|
||||
if (format !== exports.FormatTypes.sighash) {
|
||||
result += "event ";
|
||||
}
|
||||
result += this.name + "(" + this.inputs.map(function (input) { return input.format(format); }).join((format === exports.FormatTypes.full) ? ", " : ",") + ") ";
|
||||
if (format !== exports.FormatTypes.sighash) {
|
||||
if (this.anonymous) {
|
||||
result += "anonymous ";
|
||||
}
|
||||
}
|
||||
return result.trim();
|
||||
};
|
||||
EventFragment.from = function (value) {
|
||||
if (typeof (value) === "string") {
|
||||
return EventFragment.fromString(value);
|
||||
}
|
||||
return EventFragment.fromObject(value);
|
||||
};
|
||||
EventFragment.fromObject = function (value) {
|
||||
if (EventFragment.isEventFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (value.type !== "event") {
|
||||
logger.throwArgumentError("invalid event object", "value", value);
|
||||
}
|
||||
var params = {
|
||||
name: verifyIdentifier(value.name),
|
||||
anonymous: value.anonymous,
|
||||
inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),
|
||||
type: "event"
|
||||
};
|
||||
return new EventFragment(_constructorGuard, params);
|
||||
};
|
||||
EventFragment.fromString = function (value) {
|
||||
var match = value.match(regexParen);
|
||||
if (!match) {
|
||||
logger.throwArgumentError("invalid event string", "value", value);
|
||||
}
|
||||
var anonymous = false;
|
||||
match[3].split(" ").forEach(function (modifier) {
|
||||
switch (modifier.trim()) {
|
||||
case "anonymous":
|
||||
anonymous = true;
|
||||
break;
|
||||
case "":
|
||||
break;
|
||||
default:
|
||||
logger.warn("unknown modifier: " + modifier);
|
||||
}
|
||||
});
|
||||
return EventFragment.fromObject({
|
||||
name: match[1].trim(),
|
||||
anonymous: anonymous,
|
||||
inputs: parseParams(match[2], true),
|
||||
type: "event"
|
||||
});
|
||||
};
|
||||
EventFragment.isEventFragment = function (value) {
|
||||
return (value && value._isFragment && value.type === "event");
|
||||
};
|
||||
return EventFragment;
|
||||
}(Fragment));
|
||||
exports.EventFragment = EventFragment;
|
||||
function parseGas(value, params) {
|
||||
params.gas = null;
|
||||
var comps = value.split("@");
|
||||
if (comps.length !== 1) {
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
||||
}
|
||||
if (!comps[1].match(/^[0-9]+$/)) {
|
||||
logger.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
||||
}
|
||||
params.gas = bignumber_1.BigNumber.from(comps[1]);
|
||||
return comps[0];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function parseModifiers(value, params) {
|
||||
params.constant = false;
|
||||
params.payable = false;
|
||||
params.stateMutability = "nonpayable";
|
||||
value.split(" ").forEach(function (modifier) {
|
||||
switch (modifier.trim()) {
|
||||
case "constant":
|
||||
params.constant = true;
|
||||
break;
|
||||
case "payable":
|
||||
params.payable = true;
|
||||
params.stateMutability = "payable";
|
||||
break;
|
||||
case "pure":
|
||||
params.constant = true;
|
||||
params.stateMutability = "pure";
|
||||
break;
|
||||
case "view":
|
||||
params.constant = true;
|
||||
params.stateMutability = "view";
|
||||
break;
|
||||
case "external":
|
||||
case "public":
|
||||
case "":
|
||||
break;
|
||||
default:
|
||||
console.log("unknown modifier: " + modifier);
|
||||
}
|
||||
});
|
||||
}
|
||||
function verifyState(value) {
|
||||
var result = {
|
||||
constant: false,
|
||||
payable: true,
|
||||
stateMutability: "payable"
|
||||
};
|
||||
if (value.stateMutability != null) {
|
||||
result.stateMutability = value.stateMutability;
|
||||
// Set (and check things are consistent) the constant property
|
||||
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
|
||||
if (value.constant != null) {
|
||||
if ((!!value.constant) !== result.constant) {
|
||||
logger.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
|
||||
}
|
||||
}
|
||||
// Set (and check things are consistent) the payable property
|
||||
result.payable = (result.stateMutability === "payable");
|
||||
if (value.payable != null) {
|
||||
if ((!!value.payable) !== result.payable) {
|
||||
logger.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (value.payable != null) {
|
||||
result.payable = !!value.payable;
|
||||
// If payable we can assume non-constant; otherwise we can't assume
|
||||
if (value.constant == null && !result.payable && value.type !== "constructor") {
|
||||
logger.throwArgumentError("unable to determine stateMutability", "value", value);
|
||||
}
|
||||
result.constant = !!value.constant;
|
||||
if (result.constant) {
|
||||
result.stateMutability = "view";
|
||||
}
|
||||
else {
|
||||
result.stateMutability = (result.payable ? "payable" : "nonpayable");
|
||||
}
|
||||
if (result.payable && result.constant) {
|
||||
logger.throwArgumentError("cannot have constant payable function", "value", value);
|
||||
}
|
||||
}
|
||||
else if (value.constant != null) {
|
||||
result.constant = !!value.constant;
|
||||
result.payable = !result.constant;
|
||||
result.stateMutability = (result.constant ? "view" : "payable");
|
||||
}
|
||||
else if (value.type !== "constructor") {
|
||||
logger.throwArgumentError("unable to determine stateMutability", "value", value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var ConstructorFragment = /** @class */ (function (_super) {
|
||||
__extends(ConstructorFragment, _super);
|
||||
function ConstructorFragment() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
ConstructorFragment.prototype.format = function (format) {
|
||||
if (!format) {
|
||||
format = exports.FormatTypes.sighash;
|
||||
}
|
||||
if (!exports.FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === exports.FormatTypes.json) {
|
||||
return JSON.stringify({
|
||||
type: "constructor",
|
||||
stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined),
|
||||
payble: this.payable,
|
||||
gas: (this.gas ? this.gas.toNumber() : undefined),
|
||||
inputs: this.inputs.map(function (input) { return JSON.parse(input.format(format)); })
|
||||
});
|
||||
}
|
||||
if (format === exports.FormatTypes.sighash) {
|
||||
logger.throwError("cannot format a constructor for sighash", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "format(sighash)"
|
||||
});
|
||||
}
|
||||
var result = "constructor(" + this.inputs.map(function (input) { return input.format(format); }).join((format === exports.FormatTypes.full) ? ", " : ",") + ") ";
|
||||
if (this.stateMutability && this.stateMutability !== "nonpayable") {
|
||||
result += this.stateMutability + " ";
|
||||
}
|
||||
return result.trim();
|
||||
};
|
||||
ConstructorFragment.from = function (value) {
|
||||
if (typeof (value) === "string") {
|
||||
return ConstructorFragment.fromString(value);
|
||||
}
|
||||
return ConstructorFragment.fromObject(value);
|
||||
};
|
||||
ConstructorFragment.fromObject = function (value) {
|
||||
if (ConstructorFragment.isConstructorFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (value.type !== "constructor") {
|
||||
logger.throwArgumentError("invalid constructor object", "value", value);
|
||||
}
|
||||
var state = verifyState(value);
|
||||
if (state.constant) {
|
||||
logger.throwArgumentError("constructor cannot be constant", "value", value);
|
||||
}
|
||||
var params = {
|
||||
name: null,
|
||||
type: value.type,
|
||||
inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),
|
||||
payable: state.payable,
|
||||
stateMutability: state.stateMutability,
|
||||
gas: (value.gas ? bignumber_1.BigNumber.from(value.gas) : null)
|
||||
};
|
||||
return new ConstructorFragment(_constructorGuard, params);
|
||||
};
|
||||
ConstructorFragment.fromString = function (value) {
|
||||
var params = { type: "constructor" };
|
||||
value = parseGas(value, params);
|
||||
var parens = value.match(regexParen);
|
||||
if (!parens || parens[1].trim() !== "constructor") {
|
||||
logger.throwArgumentError("invalid constructor string", "value", value);
|
||||
}
|
||||
params.inputs = parseParams(parens[2].trim(), false);
|
||||
parseModifiers(parens[3].trim(), params);
|
||||
return ConstructorFragment.fromObject(params);
|
||||
};
|
||||
ConstructorFragment.isConstructorFragment = function (value) {
|
||||
return (value && value._isFragment && value.type === "constructor");
|
||||
};
|
||||
return ConstructorFragment;
|
||||
}(Fragment));
|
||||
exports.ConstructorFragment = ConstructorFragment;
|
||||
var FunctionFragment = /** @class */ (function (_super) {
|
||||
__extends(FunctionFragment, _super);
|
||||
function FunctionFragment() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
FunctionFragment.prototype.format = function (format) {
|
||||
if (!format) {
|
||||
format = exports.FormatTypes.sighash;
|
||||
}
|
||||
if (!exports.FormatTypes[format]) {
|
||||
logger.throwArgumentError("invalid format type", "format", format);
|
||||
}
|
||||
if (format === exports.FormatTypes.json) {
|
||||
return JSON.stringify({
|
||||
type: "function",
|
||||
name: this.name,
|
||||
constant: this.constant,
|
||||
stateMutability: ((this.stateMutability !== "nonpayable") ? this.stateMutability : undefined),
|
||||
payble: this.payable,
|
||||
gas: (this.gas ? this.gas.toNumber() : undefined),
|
||||
inputs: this.inputs.map(function (input) { return JSON.parse(input.format(format)); }),
|
||||
ouputs: this.outputs.map(function (output) { return JSON.parse(output.format(format)); }),
|
||||
});
|
||||
}
|
||||
var result = "";
|
||||
if (format !== exports.FormatTypes.sighash) {
|
||||
result += "function ";
|
||||
}
|
||||
result += this.name + "(" + this.inputs.map(function (input) { return input.format(format); }).join((format === exports.FormatTypes.full) ? ", " : ",") + ") ";
|
||||
if (format !== exports.FormatTypes.sighash) {
|
||||
if (this.stateMutability) {
|
||||
if (this.stateMutability !== "nonpayable") {
|
||||
result += (this.stateMutability + " ");
|
||||
}
|
||||
}
|
||||
else if (this.constant) {
|
||||
result += "view ";
|
||||
}
|
||||
if (this.outputs && this.outputs.length) {
|
||||
result += "returns (" + this.outputs.map(function (output) { return output.format(format); }).join(", ") + ") ";
|
||||
}
|
||||
if (this.gas != null) {
|
||||
result += "@" + this.gas.toString() + " ";
|
||||
}
|
||||
}
|
||||
return result.trim();
|
||||
};
|
||||
FunctionFragment.from = function (value) {
|
||||
if (typeof (value) === "string") {
|
||||
return FunctionFragment.fromString(value);
|
||||
}
|
||||
return FunctionFragment.fromObject(value);
|
||||
};
|
||||
FunctionFragment.fromObject = function (value) {
|
||||
if (FunctionFragment.isFunctionFragment(value)) {
|
||||
return value;
|
||||
}
|
||||
if (value.type !== "function") {
|
||||
logger.throwArgumentError("invalid function object", "value", value);
|
||||
}
|
||||
var state = verifyState(value);
|
||||
var params = {
|
||||
type: value.type,
|
||||
name: verifyIdentifier(value.name),
|
||||
constant: state.constant,
|
||||
inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),
|
||||
outputs: (value.outputs ? value.outputs.map(ParamType.fromObject) : []),
|
||||
payable: state.payable,
|
||||
stateMutability: state.stateMutability,
|
||||
gas: (value.gas ? bignumber_1.BigNumber.from(value.gas) : null)
|
||||
};
|
||||
return new FunctionFragment(_constructorGuard, params);
|
||||
};
|
||||
FunctionFragment.fromString = function (value) {
|
||||
var params = { type: "function" };
|
||||
value = parseGas(value, params);
|
||||
var comps = value.split(" returns ");
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("invalid function string", "value", value);
|
||||
}
|
||||
var parens = comps[0].match(regexParen);
|
||||
if (!parens) {
|
||||
logger.throwArgumentError("invalid function signature", "value", value);
|
||||
}
|
||||
params.name = parens[1].trim();
|
||||
if (params.name) {
|
||||
verifyIdentifier(params.name);
|
||||
}
|
||||
params.inputs = parseParams(parens[2], false);
|
||||
parseModifiers(parens[3].trim(), params);
|
||||
// We have outputs
|
||||
if (comps.length > 1) {
|
||||
var returns = comps[1].match(regexParen);
|
||||
if (returns[1].trim() != "" || returns[3].trim() != "") {
|
||||
logger.throwArgumentError("unexpected tokens", "value", value);
|
||||
}
|
||||
params.outputs = parseParams(returns[2], false);
|
||||
}
|
||||
else {
|
||||
params.outputs = [];
|
||||
}
|
||||
return FunctionFragment.fromObject(params);
|
||||
};
|
||||
FunctionFragment.isFunctionFragment = function (value) {
|
||||
return (value && value._isFragment && value.type === "function");
|
||||
};
|
||||
return FunctionFragment;
|
||||
}(ConstructorFragment));
|
||||
exports.FunctionFragment = FunctionFragment;
|
||||
//export class ErrorFragment extends Fragment {
|
||||
//}
|
||||
//export class StructFragment extends Fragment {
|
||||
//}
|
||||
function verifyType(type) {
|
||||
// These need to be transformed to their full description
|
||||
if (type.match(/^uint($|[^1-9])/)) {
|
||||
type = "uint256" + type.substring(4);
|
||||
}
|
||||
else if (type.match(/^int($|[^1-9])/)) {
|
||||
type = "int256" + type.substring(3);
|
||||
}
|
||||
// @TODO: more verification
|
||||
return type;
|
||||
}
|
||||
var regexIdentifier = new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");
|
||||
function verifyIdentifier(value) {
|
||||
if (!value || !value.match(regexIdentifier)) {
|
||||
logger.throwArgumentError("invalid identifier \"" + value + "\"", "value", value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var regexParen = new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");
|
||||
function splitNesting(value) {
|
||||
value = value.trim();
|
||||
var result = [];
|
||||
var accum = "";
|
||||
var depth = 0;
|
||||
for (var offset = 0; offset < value.length; offset++) {
|
||||
var c = value[offset];
|
||||
if (c === "," && depth === 0) {
|
||||
result.push(accum);
|
||||
accum = "";
|
||||
}
|
||||
else {
|
||||
accum += c;
|
||||
if (c === "(") {
|
||||
depth++;
|
||||
}
|
||||
else if (c === ")") {
|
||||
depth--;
|
||||
if (depth === -1) {
|
||||
logger.throwArgumentError("unbalanced parenthesis", "value", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (accum) {
|
||||
result.push(accum);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fragments_1 = require("./fragments");
|
||||
exports.ConstructorFragment = fragments_1.ConstructorFragment;
|
||||
exports.EventFragment = fragments_1.EventFragment;
|
||||
exports.FormatTypes = fragments_1.FormatTypes;
|
||||
exports.Fragment = fragments_1.Fragment;
|
||||
exports.FunctionFragment = fragments_1.FunctionFragment;
|
||||
exports.ParamType = fragments_1.ParamType;
|
||||
var abi_coder_1 = require("./abi-coder");
|
||||
exports.AbiCoder = abi_coder_1.AbiCoder;
|
||||
exports.defaultAbiCoder = abi_coder_1.defaultAbiCoder;
|
||||
var interface_1 = require("./interface");
|
||||
exports.checkResultErrors = interface_1.checkResultErrors;
|
||||
exports.Indexed = interface_1.Indexed;
|
||||
exports.Interface = interface_1.Interface;
|
||||
exports.LogDescription = interface_1.LogDescription;
|
||||
exports.TransactionDescription = interface_1.TransactionDescription;
|
||||
-533
@@ -1,533 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var address_1 = require("@ethersproject/address");
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var hash_1 = require("@ethersproject/hash");
|
||||
var keccak256_1 = require("@ethersproject/keccak256");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var abi_coder_1 = require("./abi-coder");
|
||||
var abstract_coder_1 = require("./coders/abstract-coder");
|
||||
exports.checkResultErrors = abstract_coder_1.checkResultErrors;
|
||||
var fragments_1 = require("./fragments");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var LogDescription = /** @class */ (function (_super) {
|
||||
__extends(LogDescription, _super);
|
||||
function LogDescription() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return LogDescription;
|
||||
}(properties_1.Description));
|
||||
exports.LogDescription = LogDescription;
|
||||
var TransactionDescription = /** @class */ (function (_super) {
|
||||
__extends(TransactionDescription, _super);
|
||||
function TransactionDescription() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return TransactionDescription;
|
||||
}(properties_1.Description));
|
||||
exports.TransactionDescription = TransactionDescription;
|
||||
var Indexed = /** @class */ (function (_super) {
|
||||
__extends(Indexed, _super);
|
||||
function Indexed() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Indexed.isIndexed = function (value) {
|
||||
return !!(value && value._isIndexed);
|
||||
};
|
||||
return Indexed;
|
||||
}(properties_1.Description));
|
||||
exports.Indexed = Indexed;
|
||||
function wrapAccessError(property, error) {
|
||||
var wrap = new Error("deferred error during ABI decoding triggered accessing " + property);
|
||||
wrap.error = error;
|
||||
return wrap;
|
||||
}
|
||||
function checkNames(fragment, type, params) {
|
||||
params.reduce(function (accum, param) {
|
||||
if (param.name) {
|
||||
if (accum[param.name]) {
|
||||
logger.throwArgumentError("duplicate " + type + " parameter " + JSON.stringify(param.name) + " in " + fragment.format("full"), "fragment", fragment);
|
||||
}
|
||||
accum[param.name] = true;
|
||||
}
|
||||
return accum;
|
||||
}, {});
|
||||
}
|
||||
var Interface = /** @class */ (function () {
|
||||
function Interface(fragments) {
|
||||
var _newTarget = this.constructor;
|
||||
var _this = this;
|
||||
logger.checkNew(_newTarget, Interface);
|
||||
var abi = [];
|
||||
if (typeof (fragments) === "string") {
|
||||
abi = JSON.parse(fragments);
|
||||
}
|
||||
else {
|
||||
abi = fragments;
|
||||
}
|
||||
properties_1.defineReadOnly(this, "fragments", abi.map(function (fragment) {
|
||||
return fragments_1.Fragment.from(fragment);
|
||||
}).filter(function (fragment) { return (fragment != null); }));
|
||||
properties_1.defineReadOnly(this, "_abiCoder", properties_1.getStatic((_newTarget), "getAbiCoder")());
|
||||
properties_1.defineReadOnly(this, "functions", {});
|
||||
properties_1.defineReadOnly(this, "errors", {});
|
||||
properties_1.defineReadOnly(this, "events", {});
|
||||
properties_1.defineReadOnly(this, "structs", {});
|
||||
// Add all fragments by their signature
|
||||
this.fragments.forEach(function (fragment) {
|
||||
var bucket = null;
|
||||
switch (fragment.type) {
|
||||
case "constructor":
|
||||
if (_this.deploy) {
|
||||
logger.warn("duplicate definition - constructor");
|
||||
return;
|
||||
}
|
||||
checkNames(fragment, "input", fragment.inputs);
|
||||
properties_1.defineReadOnly(_this, "deploy", fragment);
|
||||
return;
|
||||
case "function":
|
||||
checkNames(fragment, "input", fragment.inputs);
|
||||
checkNames(fragment, "output", fragment.outputs);
|
||||
bucket = _this.functions;
|
||||
break;
|
||||
case "event":
|
||||
checkNames(fragment, "input", fragment.inputs);
|
||||
bucket = _this.events;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
var signature = fragment.format();
|
||||
if (bucket[signature]) {
|
||||
logger.warn("duplicate definition - " + signature);
|
||||
return;
|
||||
}
|
||||
bucket[signature] = fragment;
|
||||
});
|
||||
// If we do not have a constructor add a default
|
||||
if (!this.deploy) {
|
||||
properties_1.defineReadOnly(this, "deploy", fragments_1.ConstructorFragment.from({
|
||||
payable: false,
|
||||
type: "constructor"
|
||||
}));
|
||||
}
|
||||
properties_1.defineReadOnly(this, "_isInterface", true);
|
||||
}
|
||||
Interface.prototype.format = function (format) {
|
||||
if (!format) {
|
||||
format = fragments_1.FormatTypes.full;
|
||||
}
|
||||
if (format === fragments_1.FormatTypes.sighash) {
|
||||
logger.throwArgumentError("interface does not support formatting sighash", "format", format);
|
||||
}
|
||||
var abi = this.fragments.map(function (fragment) { return fragment.format(format); });
|
||||
// We need to re-bundle the JSON fragments a bit
|
||||
if (format === fragments_1.FormatTypes.json) {
|
||||
return JSON.stringify(abi.map(function (j) { return JSON.parse(j); }));
|
||||
}
|
||||
return abi;
|
||||
};
|
||||
// Sub-classes can override these to handle other blockchains
|
||||
Interface.getAbiCoder = function () {
|
||||
return abi_coder_1.defaultAbiCoder;
|
||||
};
|
||||
Interface.getAddress = function (address) {
|
||||
return address_1.getAddress(address);
|
||||
};
|
||||
Interface.getSighash = function (functionFragment) {
|
||||
return bytes_1.hexDataSlice(hash_1.id(functionFragment.format()), 0, 4);
|
||||
};
|
||||
Interface.getEventTopic = function (eventFragment) {
|
||||
return hash_1.id(eventFragment.format());
|
||||
};
|
||||
// Find a function definition by any means necessary (unless it is ambiguous)
|
||||
Interface.prototype.getFunction = function (nameOrSignatureOrSighash) {
|
||||
if (bytes_1.isHexString(nameOrSignatureOrSighash)) {
|
||||
for (var name_1 in this.functions) {
|
||||
if (nameOrSignatureOrSighash === this.getSighash(name_1)) {
|
||||
return this.functions[name_1];
|
||||
}
|
||||
}
|
||||
logger.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
|
||||
}
|
||||
// It is a bare name, look up the function (will return null if ambiguous)
|
||||
if (nameOrSignatureOrSighash.indexOf("(") === -1) {
|
||||
var name_2 = nameOrSignatureOrSighash.trim();
|
||||
var matching = Object.keys(this.functions).filter(function (f) { return (f.split("(" /* fix:) */)[0] === name_2); });
|
||||
if (matching.length === 0) {
|
||||
logger.throwArgumentError("no matching function", "name", name_2);
|
||||
}
|
||||
else if (matching.length > 1) {
|
||||
logger.throwArgumentError("multiple matching functions", "name", name_2);
|
||||
}
|
||||
return this.functions[matching[0]];
|
||||
}
|
||||
// Normlize the signature and lookup the function
|
||||
var result = this.functions[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
|
||||
if (!result) {
|
||||
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
// Find an event definition by any means necessary (unless it is ambiguous)
|
||||
Interface.prototype.getEvent = function (nameOrSignatureOrTopic) {
|
||||
if (bytes_1.isHexString(nameOrSignatureOrTopic)) {
|
||||
var topichash = nameOrSignatureOrTopic.toLowerCase();
|
||||
for (var name_3 in this.events) {
|
||||
if (topichash === this.getEventTopic(name_3)) {
|
||||
return this.events[name_3];
|
||||
}
|
||||
}
|
||||
logger.throwArgumentError("no matching event", "topichash", topichash);
|
||||
}
|
||||
// It is a bare name, look up the function (will return null if ambiguous)
|
||||
if (nameOrSignatureOrTopic.indexOf("(") === -1) {
|
||||
var name_4 = nameOrSignatureOrTopic.trim();
|
||||
var matching = Object.keys(this.events).filter(function (f) { return (f.split("(" /* fix:) */)[0] === name_4); });
|
||||
if (matching.length === 0) {
|
||||
logger.throwArgumentError("no matching event", "name", name_4);
|
||||
}
|
||||
else if (matching.length > 1) {
|
||||
logger.throwArgumentError("multiple matching events", "name", name_4);
|
||||
}
|
||||
return this.events[matching[0]];
|
||||
}
|
||||
// Normlize the signature and lookup the function
|
||||
var result = this.events[fragments_1.EventFragment.fromString(nameOrSignatureOrTopic).format()];
|
||||
if (!result) {
|
||||
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
// Get the sighash (the bytes4 selector) used by Solidity to identify a function
|
||||
Interface.prototype.getSighash = function (functionFragment) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
return properties_1.getStatic(this.constructor, "getSighash")(functionFragment);
|
||||
};
|
||||
// Get the topic (the bytes32 hash) used by Solidity to identify an event
|
||||
Interface.prototype.getEventTopic = function (eventFragment) {
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
return properties_1.getStatic(this.constructor, "getEventTopic")(eventFragment);
|
||||
};
|
||||
Interface.prototype._decodeParams = function (params, data) {
|
||||
return this._abiCoder.decode(params, data);
|
||||
};
|
||||
Interface.prototype._encodeParams = function (params, values) {
|
||||
return this._abiCoder.encode(params, values);
|
||||
};
|
||||
Interface.prototype.encodeDeploy = function (values) {
|
||||
return this._encodeParams(this.deploy.inputs, values || []);
|
||||
};
|
||||
// Decode the data for a function call (e.g. tx.data)
|
||||
Interface.prototype.decodeFunctionData = function (functionFragment, data) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
var bytes = bytes_1.arrayify(data);
|
||||
if (bytes_1.hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
|
||||
logger.throwArgumentError("data signature does not match function " + functionFragment.name + ".", "data", bytes_1.hexlify(bytes));
|
||||
}
|
||||
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
|
||||
};
|
||||
// Encode the data for a function call (e.g. tx.data)
|
||||
Interface.prototype.encodeFunctionData = function (functionFragment, values) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
return bytes_1.hexlify(bytes_1.concat([
|
||||
this.getSighash(functionFragment),
|
||||
this._encodeParams(functionFragment.inputs, values || [])
|
||||
]));
|
||||
};
|
||||
// Decode the result from a function call (e.g. from eth_call)
|
||||
Interface.prototype.decodeFunctionResult = function (functionFragment, data) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
var bytes = bytes_1.arrayify(data);
|
||||
var reason = null;
|
||||
var errorSignature = null;
|
||||
switch (bytes.length % this._abiCoder._getWordSize()) {
|
||||
case 0:
|
||||
try {
|
||||
return this._abiCoder.decode(functionFragment.outputs, bytes);
|
||||
}
|
||||
catch (error) { }
|
||||
break;
|
||||
case 4:
|
||||
if (bytes_1.hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
|
||||
errorSignature = "Error(string)";
|
||||
reason = this._abiCoder.decode(["string"], bytes.slice(4))[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
return logger.throwError("call revert exception", logger_1.Logger.errors.CALL_EXCEPTION, {
|
||||
method: functionFragment.format(),
|
||||
errorSignature: errorSignature,
|
||||
errorArgs: [reason],
|
||||
reason: reason
|
||||
});
|
||||
};
|
||||
// Encode the result for a function call (e.g. for eth_call)
|
||||
Interface.prototype.encodeFunctionResult = function (functionFragment, values) {
|
||||
if (typeof (functionFragment) === "string") {
|
||||
functionFragment = this.getFunction(functionFragment);
|
||||
}
|
||||
return bytes_1.hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
|
||||
};
|
||||
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
|
||||
Interface.prototype.encodeFilterTopics = function (eventFragment, values) {
|
||||
var _this = this;
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
if (values.length > eventFragment.inputs.length) {
|
||||
logger.throwError("too many arguments for " + eventFragment.format(), logger_1.Logger.errors.UNEXPECTED_ARGUMENT, {
|
||||
argument: "values",
|
||||
value: values
|
||||
});
|
||||
}
|
||||
var topics = [];
|
||||
if (!eventFragment.anonymous) {
|
||||
topics.push(this.getEventTopic(eventFragment));
|
||||
}
|
||||
var encodeTopic = function (param, value) {
|
||||
if (param.type === "string") {
|
||||
return hash_1.id(value);
|
||||
}
|
||||
else if (param.type === "bytes") {
|
||||
return keccak256_1.keccak256(bytes_1.hexlify(value));
|
||||
}
|
||||
// Check addresses are valid
|
||||
if (param.type === "address") {
|
||||
_this._abiCoder.encode(["address"], [value]);
|
||||
}
|
||||
return bytes_1.hexZeroPad(bytes_1.hexlify(value), 32);
|
||||
};
|
||||
values.forEach(function (value, index) {
|
||||
var param = eventFragment.inputs[index];
|
||||
if (!param.indexed) {
|
||||
if (value != null) {
|
||||
logger.throwArgumentError("cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (value == null) {
|
||||
topics.push(null);
|
||||
}
|
||||
else if (param.baseType === "array" || param.baseType === "tuple") {
|
||||
logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
|
||||
}
|
||||
else if (Array.isArray(value)) {
|
||||
topics.push(value.map(function (value) { return encodeTopic(param, value); }));
|
||||
}
|
||||
else {
|
||||
topics.push(encodeTopic(param, value));
|
||||
}
|
||||
});
|
||||
// Trim off trailing nulls
|
||||
while (topics.length && topics[topics.length - 1] === null) {
|
||||
topics.pop();
|
||||
}
|
||||
return topics;
|
||||
};
|
||||
Interface.prototype.encodeEventLog = function (eventFragment, values) {
|
||||
var _this = this;
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
var topics = [];
|
||||
var dataTypes = [];
|
||||
var dataValues = [];
|
||||
if (!eventFragment.anonymous) {
|
||||
topics.push(this.getEventTopic(eventFragment));
|
||||
}
|
||||
if (values.length !== eventFragment.inputs.length) {
|
||||
logger.throwArgumentError("event arguments/values mismatch", "values", values);
|
||||
}
|
||||
eventFragment.inputs.forEach(function (param, index) {
|
||||
var value = values[index];
|
||||
if (param.indexed) {
|
||||
if (param.type === "string") {
|
||||
topics.push(hash_1.id(value));
|
||||
}
|
||||
else if (param.type === "bytes") {
|
||||
topics.push(keccak256_1.keccak256(value));
|
||||
}
|
||||
else if (param.baseType === "tuple" || param.baseType === "array") {
|
||||
// @TOOD
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
else {
|
||||
topics.push(_this._abiCoder.encode([param.type], [value]));
|
||||
}
|
||||
}
|
||||
else {
|
||||
dataTypes.push(param);
|
||||
dataValues.push(value);
|
||||
}
|
||||
});
|
||||
return {
|
||||
data: this._abiCoder.encode(dataTypes, dataValues),
|
||||
topics: topics
|
||||
};
|
||||
};
|
||||
// Decode a filter for the event and the search criteria
|
||||
Interface.prototype.decodeEventLog = function (eventFragment, data, topics) {
|
||||
if (typeof (eventFragment) === "string") {
|
||||
eventFragment = this.getEvent(eventFragment);
|
||||
}
|
||||
if (topics != null && !eventFragment.anonymous) {
|
||||
var topicHash = this.getEventTopic(eventFragment);
|
||||
if (!bytes_1.isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
|
||||
logger.throwError("fragment/topic mismatch", logger_1.Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
|
||||
}
|
||||
topics = topics.slice(1);
|
||||
}
|
||||
var indexed = [];
|
||||
var nonIndexed = [];
|
||||
var dynamic = [];
|
||||
eventFragment.inputs.forEach(function (param, index) {
|
||||
if (param.indexed) {
|
||||
if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") {
|
||||
indexed.push(fragments_1.ParamType.fromObject({ type: "bytes32", name: param.name }));
|
||||
dynamic.push(true);
|
||||
}
|
||||
else {
|
||||
indexed.push(param);
|
||||
dynamic.push(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nonIndexed.push(param);
|
||||
dynamic.push(false);
|
||||
}
|
||||
});
|
||||
var resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, bytes_1.concat(topics)) : null;
|
||||
var resultNonIndexed = this._abiCoder.decode(nonIndexed, data);
|
||||
var result = [];
|
||||
var nonIndexedIndex = 0, indexedIndex = 0;
|
||||
eventFragment.inputs.forEach(function (param, index) {
|
||||
if (param.indexed) {
|
||||
if (resultIndexed == null) {
|
||||
result[index] = new Indexed({ _isIndexed: true, hash: null });
|
||||
}
|
||||
else if (dynamic[index]) {
|
||||
result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });
|
||||
}
|
||||
else {
|
||||
try {
|
||||
result[index] = resultIndexed[indexedIndex++];
|
||||
}
|
||||
catch (error) {
|
||||
result[index] = error;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
result[index] = resultNonIndexed[nonIndexedIndex++];
|
||||
}
|
||||
catch (error) {
|
||||
result[index] = error;
|
||||
}
|
||||
}
|
||||
// Add the keyword argument if named and safe
|
||||
if (param.name && result[param.name] == null) {
|
||||
var value_1 = result[index];
|
||||
// Make error named values throw on access
|
||||
if (value_1 instanceof Error) {
|
||||
Object.defineProperty(result, param.name, {
|
||||
get: function () { throw wrapAccessError("property " + JSON.stringify(param.name), value_1); }
|
||||
});
|
||||
}
|
||||
else {
|
||||
result[param.name] = value_1;
|
||||
}
|
||||
}
|
||||
});
|
||||
var _loop_1 = function (i) {
|
||||
var value = result[i];
|
||||
if (value instanceof Error) {
|
||||
Object.defineProperty(result, i, {
|
||||
get: function () { throw wrapAccessError("index " + i, value); }
|
||||
});
|
||||
}
|
||||
};
|
||||
// Make all error indexed values throw on access
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
_loop_1(i);
|
||||
}
|
||||
return Object.freeze(result);
|
||||
};
|
||||
// Given a transaction, find the matching function fragment (if any) and
|
||||
// determine all its properties and call parameters
|
||||
Interface.prototype.parseTransaction = function (tx) {
|
||||
var fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
|
||||
if (!fragment) {
|
||||
return null;
|
||||
}
|
||||
return new TransactionDescription({
|
||||
args: this._abiCoder.decode(fragment.inputs, "0x" + tx.data.substring(10)),
|
||||
functionFragment: fragment,
|
||||
name: fragment.name,
|
||||
signature: fragment.format(),
|
||||
sighash: this.getSighash(fragment),
|
||||
value: bignumber_1.BigNumber.from(tx.value || "0"),
|
||||
});
|
||||
};
|
||||
// Given an event log, find the matching event fragment (if any) and
|
||||
// determine all its properties and values
|
||||
Interface.prototype.parseLog = function (log) {
|
||||
var fragment = this.getEvent(log.topics[0]);
|
||||
if (!fragment || fragment.anonymous) {
|
||||
return null;
|
||||
}
|
||||
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
|
||||
// Probably not, because just because it is the only event in the ABI does
|
||||
// not mean we have the full ABI; maybe jsut a fragment?
|
||||
return new LogDescription({
|
||||
eventFragment: fragment,
|
||||
name: fragment.name,
|
||||
signature: fragment.format(),
|
||||
topic: this.getEventTopic(fragment),
|
||||
args: this.decodeEventLog(fragment, log.data, log.topics)
|
||||
});
|
||||
};
|
||||
/*
|
||||
static from(value: Array<Fragment | string | JsonAbi> | string | Interface) {
|
||||
if (Interface.isInterface(value)) {
|
||||
return value;
|
||||
}
|
||||
if (typeof(value) === "string") {
|
||||
return new Interface(JSON.parse(value));
|
||||
}
|
||||
return new Interface(value);
|
||||
}
|
||||
*/
|
||||
Interface.isInterface = function (value) {
|
||||
return !!(value && value._isInterface);
|
||||
};
|
||||
return Interface;
|
||||
}());
|
||||
exports.Interface = Interface;
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"dependencies": {
|
||||
"@ethersproject/address": ">=5.0.0-beta.128",
|
||||
"@ethersproject/bignumber": ">=5.0.0-beta.130",
|
||||
"@ethersproject/bytes": ">=5.0.0-beta.129",
|
||||
"@ethersproject/constants": ">=5.0.0-beta.128",
|
||||
"@ethersproject/hash": ">=5.0.0-beta.128",
|
||||
"@ethersproject/keccak256": ">=5.0.0-beta.127",
|
||||
"@ethersproject/logger": ">=5.0.0-beta.129",
|
||||
"@ethersproject/properties": ">=5.0.0-beta.131",
|
||||
"@ethersproject/strings": ">=5.0.0-beta.130"
|
||||
},
|
||||
"description": "Utilities and Classes for parsing, formatting and managing Ethereum ABIs.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/abi",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x7f866470aabd8bbe47af1ff527fedbd86445cbfcd3bbf340d34c96b38b8e8606",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.153"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz"
|
||||
,"_integrity": "sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg=="
|
||||
,"_from": "@ethersproject/abi@5.0.0-beta.153"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "abstract-provider/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
import { isHexString } from "@ethersproject/bytes";
|
||||
import { Description, defineReadOnly } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
;
|
||||
;
|
||||
//export type CallTransactionable = {
|
||||
// call(transaction: TransactionRequest): Promise<TransactionResponse>;
|
||||
//};
|
||||
export class ForkEvent extends Description {
|
||||
static isForkEvent(value) {
|
||||
return !!(value && value._isForkEvent);
|
||||
}
|
||||
}
|
||||
export class BlockForkEvent extends ForkEvent {
|
||||
constructor(blockHash, expiry) {
|
||||
if (!isHexString(blockHash, 32)) {
|
||||
logger.throwArgumentError("invalid blockHash", "blockHash", blockHash);
|
||||
}
|
||||
super({
|
||||
_isForkEvent: true,
|
||||
_isBlockForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
blockHash: blockHash
|
||||
});
|
||||
}
|
||||
}
|
||||
export class TransactionForkEvent extends ForkEvent {
|
||||
constructor(hash, expiry) {
|
||||
if (!isHexString(hash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "hash", hash);
|
||||
}
|
||||
super({
|
||||
_isForkEvent: true,
|
||||
_isTransactionForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
hash: hash
|
||||
});
|
||||
}
|
||||
}
|
||||
export class TransactionOrderForkEvent extends ForkEvent {
|
||||
constructor(beforeHash, afterHash, expiry) {
|
||||
if (!isHexString(beforeHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
||||
}
|
||||
if (!isHexString(afterHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
||||
}
|
||||
super({
|
||||
_isForkEvent: true,
|
||||
_isTransactionOrderForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
beforeHash: beforeHash,
|
||||
afterHash: afterHash
|
||||
});
|
||||
}
|
||||
}
|
||||
///////////////////////////////
|
||||
// Exported Abstracts
|
||||
export class Provider {
|
||||
constructor() {
|
||||
logger.checkAbstract(new.target, Provider);
|
||||
defineReadOnly(this, "_isProvider", true);
|
||||
}
|
||||
// Alias for "on"
|
||||
addListener(eventName, listener) {
|
||||
return this.on(eventName, listener);
|
||||
}
|
||||
// Alias for "off"
|
||||
removeListener(eventName, listener) {
|
||||
return this.off(eventName, listener);
|
||||
}
|
||||
static isProvider(value) {
|
||||
return !!(value && value._isProvider);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "abstract-provider/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
;
|
||||
;
|
||||
//export type CallTransactionable = {
|
||||
// call(transaction: TransactionRequest): Promise<TransactionResponse>;
|
||||
//};
|
||||
var ForkEvent = /** @class */ (function (_super) {
|
||||
__extends(ForkEvent, _super);
|
||||
function ForkEvent() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
ForkEvent.isForkEvent = function (value) {
|
||||
return !!(value && value._isForkEvent);
|
||||
};
|
||||
return ForkEvent;
|
||||
}(properties_1.Description));
|
||||
exports.ForkEvent = ForkEvent;
|
||||
var BlockForkEvent = /** @class */ (function (_super) {
|
||||
__extends(BlockForkEvent, _super);
|
||||
function BlockForkEvent(blockHash, expiry) {
|
||||
var _this = this;
|
||||
if (!bytes_1.isHexString(blockHash, 32)) {
|
||||
logger.throwArgumentError("invalid blockHash", "blockHash", blockHash);
|
||||
}
|
||||
_this = _super.call(this, {
|
||||
_isForkEvent: true,
|
||||
_isBlockForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
blockHash: blockHash
|
||||
}) || this;
|
||||
return _this;
|
||||
}
|
||||
return BlockForkEvent;
|
||||
}(ForkEvent));
|
||||
exports.BlockForkEvent = BlockForkEvent;
|
||||
var TransactionForkEvent = /** @class */ (function (_super) {
|
||||
__extends(TransactionForkEvent, _super);
|
||||
function TransactionForkEvent(hash, expiry) {
|
||||
var _this = this;
|
||||
if (!bytes_1.isHexString(hash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "hash", hash);
|
||||
}
|
||||
_this = _super.call(this, {
|
||||
_isForkEvent: true,
|
||||
_isTransactionForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
hash: hash
|
||||
}) || this;
|
||||
return _this;
|
||||
}
|
||||
return TransactionForkEvent;
|
||||
}(ForkEvent));
|
||||
exports.TransactionForkEvent = TransactionForkEvent;
|
||||
var TransactionOrderForkEvent = /** @class */ (function (_super) {
|
||||
__extends(TransactionOrderForkEvent, _super);
|
||||
function TransactionOrderForkEvent(beforeHash, afterHash, expiry) {
|
||||
var _this = this;
|
||||
if (!bytes_1.isHexString(beforeHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
||||
}
|
||||
if (!bytes_1.isHexString(afterHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
||||
}
|
||||
_this = _super.call(this, {
|
||||
_isForkEvent: true,
|
||||
_isTransactionOrderForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
beforeHash: beforeHash,
|
||||
afterHash: afterHash
|
||||
}) || this;
|
||||
return _this;
|
||||
}
|
||||
return TransactionOrderForkEvent;
|
||||
}(ForkEvent));
|
||||
exports.TransactionOrderForkEvent = TransactionOrderForkEvent;
|
||||
///////////////////////////////
|
||||
// Exported Abstracts
|
||||
var Provider = /** @class */ (function () {
|
||||
function Provider() {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkAbstract(_newTarget, Provider);
|
||||
properties_1.defineReadOnly(this, "_isProvider", true);
|
||||
}
|
||||
// Alias for "on"
|
||||
Provider.prototype.addListener = function (eventName, listener) {
|
||||
return this.on(eventName, listener);
|
||||
};
|
||||
// Alias for "off"
|
||||
Provider.prototype.removeListener = function (eventName, listener) {
|
||||
return this.off(eventName, listener);
|
||||
};
|
||||
Provider.isProvider = function (value) {
|
||||
return !!(value && value._isProvider);
|
||||
};
|
||||
return Provider;
|
||||
}());
|
||||
exports.Provider = Provider;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.0.7",
|
||||
"@ethersproject/bytes": "^5.0.4",
|
||||
"@ethersproject/logger": "^5.0.5",
|
||||
"@ethersproject/networks": "^5.0.3",
|
||||
"@ethersproject/properties": "^5.0.3",
|
||||
"@ethersproject/transactions": "^5.0.5",
|
||||
"@ethersproject/web": "^5.0.6"
|
||||
},
|
||||
"description": "An Abstract Class for describing an Ethereum Provider for ethers.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/abstract-provider",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x87fdc7d7ee69d8c228c0e6946be702acd027a832b5a3deaa5b60e3c9f7110e58",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.5"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.5.tgz"
|
||||
,"_integrity": "sha512-i/CjElAkzV7vQBAeoz+IpjGfcFYEP9eD7j3fzZ0fzTq03DO7PPnR+xkEZ1IoDXGwDS+55aLM1xvLDwB/Lx6IOQ=="
|
||||
,"_from": "@ethersproject/abstract-provider@^5.0.4"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "abstract-signer/5.0.7";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-208
@@ -1,208 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { defineReadOnly, resolveProperties, shallowCopy } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
const allowedTransactionKeys = [
|
||||
"chainId", "data", "from", "gasLimit", "gasPrice", "nonce", "to", "value"
|
||||
];
|
||||
const forwardErrors = [
|
||||
Logger.errors.INSUFFICIENT_FUNDS,
|
||||
Logger.errors.NONCE_EXPIRED,
|
||||
Logger.errors.REPLACEMENT_UNDERPRICED,
|
||||
];
|
||||
;
|
||||
;
|
||||
export class Signer {
|
||||
///////////////////
|
||||
// Sub-classes MUST call super
|
||||
constructor() {
|
||||
logger.checkAbstract(new.target, Signer);
|
||||
defineReadOnly(this, "_isSigner", true);
|
||||
}
|
||||
///////////////////
|
||||
// Sub-classes MAY override these
|
||||
getBalance(blockTag) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("getBalance");
|
||||
return yield this.provider.getBalance(this.getAddress(), blockTag);
|
||||
});
|
||||
}
|
||||
getTransactionCount(blockTag) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("getTransactionCount");
|
||||
return yield this.provider.getTransactionCount(this.getAddress(), blockTag);
|
||||
});
|
||||
}
|
||||
// Populates "from" if unspecified, and estimates the gas for the transation
|
||||
estimateGas(transaction) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("estimateGas");
|
||||
const tx = yield resolveProperties(this.checkTransaction(transaction));
|
||||
return yield this.provider.estimateGas(tx);
|
||||
});
|
||||
}
|
||||
// Populates "from" if unspecified, and calls with the transation
|
||||
call(transaction, blockTag) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("call");
|
||||
const tx = yield resolveProperties(this.checkTransaction(transaction));
|
||||
return yield this.provider.call(tx, blockTag);
|
||||
});
|
||||
}
|
||||
// Populates all fields in a transaction, signs it and sends it to the network
|
||||
sendTransaction(transaction) {
|
||||
this._checkProvider("sendTransaction");
|
||||
return this.populateTransaction(transaction).then((tx) => {
|
||||
return this.signTransaction(tx).then((signedTx) => {
|
||||
return this.provider.sendTransaction(signedTx);
|
||||
});
|
||||
});
|
||||
}
|
||||
getChainId() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("getChainId");
|
||||
const network = yield this.provider.getNetwork();
|
||||
return network.chainId;
|
||||
});
|
||||
}
|
||||
getGasPrice() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("getGasPrice");
|
||||
return yield this.provider.getGasPrice();
|
||||
});
|
||||
}
|
||||
resolveName(name) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._checkProvider("resolveName");
|
||||
return yield this.provider.resolveName(name);
|
||||
});
|
||||
}
|
||||
// Checks a transaction does not contain invalid keys and if
|
||||
// no "from" is provided, populates it.
|
||||
// - does NOT require a provider
|
||||
// - adds "from" is not present
|
||||
// - returns a COPY (safe to mutate the result)
|
||||
// By default called from: (overriding these prevents it)
|
||||
// - call
|
||||
// - estimateGas
|
||||
// - populateTransaction (and therefor sendTransaction)
|
||||
checkTransaction(transaction) {
|
||||
for (const key in transaction) {
|
||||
if (allowedTransactionKeys.indexOf(key) === -1) {
|
||||
logger.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
|
||||
}
|
||||
}
|
||||
const tx = shallowCopy(transaction);
|
||||
if (tx.from == null) {
|
||||
tx.from = this.getAddress();
|
||||
}
|
||||
else {
|
||||
// Make sure any provided address matches this signer
|
||||
tx.from = Promise.all([
|
||||
Promise.resolve(tx.from),
|
||||
this.getAddress()
|
||||
]).then((result) => {
|
||||
if (result[0] !== result[1]) {
|
||||
logger.throwArgumentError("from address mismatch", "transaction", transaction);
|
||||
}
|
||||
return result[0];
|
||||
});
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
// Populates ALL keys for a transaction and checks that "from" matches
|
||||
// this Signer. Should be used by sendTransaction but NOT by signTransaction.
|
||||
// By default called from: (overriding these prevents it)
|
||||
// - sendTransaction
|
||||
populateTransaction(transaction) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const tx = yield resolveProperties(this.checkTransaction(transaction));
|
||||
if (tx.to != null) {
|
||||
tx.to = Promise.resolve(tx.to).then((to) => this.resolveName(to));
|
||||
}
|
||||
if (tx.gasPrice == null) {
|
||||
tx.gasPrice = this.getGasPrice();
|
||||
}
|
||||
if (tx.nonce == null) {
|
||||
tx.nonce = this.getTransactionCount("pending");
|
||||
}
|
||||
if (tx.gasLimit == null) {
|
||||
tx.gasLimit = this.estimateGas(tx).catch((error) => {
|
||||
if (forwardErrors.indexOf(error.code) >= 0) {
|
||||
throw error;
|
||||
}
|
||||
return logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
||||
error: error,
|
||||
tx: tx
|
||||
});
|
||||
});
|
||||
}
|
||||
if (tx.chainId == null) {
|
||||
tx.chainId = this.getChainId();
|
||||
}
|
||||
else {
|
||||
tx.chainId = Promise.all([
|
||||
Promise.resolve(tx.chainId),
|
||||
this.getChainId()
|
||||
]).then((results) => {
|
||||
if (results[1] !== 0 && results[0] !== results[1]) {
|
||||
logger.throwArgumentError("chainId address mismatch", "transaction", transaction);
|
||||
}
|
||||
return results[0];
|
||||
});
|
||||
}
|
||||
return yield resolveProperties(tx);
|
||||
});
|
||||
}
|
||||
///////////////////
|
||||
// Sub-classes SHOULD leave these alone
|
||||
_checkProvider(operation) {
|
||||
if (!this.provider) {
|
||||
logger.throwError("missing provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: (operation || "_checkProvider")
|
||||
});
|
||||
}
|
||||
}
|
||||
static isSigner(value) {
|
||||
return !!(value && value._isSigner);
|
||||
}
|
||||
}
|
||||
export class VoidSigner extends Signer {
|
||||
constructor(address, provider) {
|
||||
logger.checkNew(new.target, VoidSigner);
|
||||
super();
|
||||
defineReadOnly(this, "address", address);
|
||||
defineReadOnly(this, "provider", provider || null);
|
||||
}
|
||||
getAddress() {
|
||||
return Promise.resolve(this.address);
|
||||
}
|
||||
_fail(message, operation) {
|
||||
return Promise.resolve().then(() => {
|
||||
logger.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });
|
||||
});
|
||||
}
|
||||
signMessage(message) {
|
||||
return this._fail("VoidSigner cannot sign messages", "signMessage");
|
||||
}
|
||||
signTransaction(transaction) {
|
||||
return this._fail("VoidSigner cannot sign transactions", "signTransaction");
|
||||
}
|
||||
_signTypedData(domain, types, value) {
|
||||
return this._fail("VoidSigner cannot sign typed data", "signTypedData");
|
||||
}
|
||||
connect(provider) {
|
||||
return new VoidSigner(this.address, provider);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "abstract-signer/5.0.7";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-318
@@ -1,318 +0,0 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var allowedTransactionKeys = [
|
||||
"chainId", "data", "from", "gasLimit", "gasPrice", "nonce", "to", "value"
|
||||
];
|
||||
var forwardErrors = [
|
||||
logger_1.Logger.errors.INSUFFICIENT_FUNDS,
|
||||
logger_1.Logger.errors.NONCE_EXPIRED,
|
||||
logger_1.Logger.errors.REPLACEMENT_UNDERPRICED,
|
||||
];
|
||||
;
|
||||
;
|
||||
var Signer = /** @class */ (function () {
|
||||
///////////////////
|
||||
// Sub-classes MUST call super
|
||||
function Signer() {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkAbstract(_newTarget, Signer);
|
||||
properties_1.defineReadOnly(this, "_isSigner", true);
|
||||
}
|
||||
///////////////////
|
||||
// Sub-classes MAY override these
|
||||
Signer.prototype.getBalance = function (blockTag) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("getBalance");
|
||||
return [4 /*yield*/, this.provider.getBalance(this.getAddress(), blockTag)];
|
||||
case 1: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
Signer.prototype.getTransactionCount = function (blockTag) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("getTransactionCount");
|
||||
return [4 /*yield*/, this.provider.getTransactionCount(this.getAddress(), blockTag)];
|
||||
case 1: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// Populates "from" if unspecified, and estimates the gas for the transation
|
||||
Signer.prototype.estimateGas = function (transaction) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var tx;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("estimateGas");
|
||||
return [4 /*yield*/, properties_1.resolveProperties(this.checkTransaction(transaction))];
|
||||
case 1:
|
||||
tx = _a.sent();
|
||||
return [4 /*yield*/, this.provider.estimateGas(tx)];
|
||||
case 2: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// Populates "from" if unspecified, and calls with the transation
|
||||
Signer.prototype.call = function (transaction, blockTag) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var tx;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("call");
|
||||
return [4 /*yield*/, properties_1.resolveProperties(this.checkTransaction(transaction))];
|
||||
case 1:
|
||||
tx = _a.sent();
|
||||
return [4 /*yield*/, this.provider.call(tx, blockTag)];
|
||||
case 2: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// Populates all fields in a transaction, signs it and sends it to the network
|
||||
Signer.prototype.sendTransaction = function (transaction) {
|
||||
var _this = this;
|
||||
this._checkProvider("sendTransaction");
|
||||
return this.populateTransaction(transaction).then(function (tx) {
|
||||
return _this.signTransaction(tx).then(function (signedTx) {
|
||||
return _this.provider.sendTransaction(signedTx);
|
||||
});
|
||||
});
|
||||
};
|
||||
Signer.prototype.getChainId = function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var network;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("getChainId");
|
||||
return [4 /*yield*/, this.provider.getNetwork()];
|
||||
case 1:
|
||||
network = _a.sent();
|
||||
return [2 /*return*/, network.chainId];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
Signer.prototype.getGasPrice = function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("getGasPrice");
|
||||
return [4 /*yield*/, this.provider.getGasPrice()];
|
||||
case 1: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
Signer.prototype.resolveName = function (name) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
this._checkProvider("resolveName");
|
||||
return [4 /*yield*/, this.provider.resolveName(name)];
|
||||
case 1: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// Checks a transaction does not contain invalid keys and if
|
||||
// no "from" is provided, populates it.
|
||||
// - does NOT require a provider
|
||||
// - adds "from" is not present
|
||||
// - returns a COPY (safe to mutate the result)
|
||||
// By default called from: (overriding these prevents it)
|
||||
// - call
|
||||
// - estimateGas
|
||||
// - populateTransaction (and therefor sendTransaction)
|
||||
Signer.prototype.checkTransaction = function (transaction) {
|
||||
for (var key in transaction) {
|
||||
if (allowedTransactionKeys.indexOf(key) === -1) {
|
||||
logger.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
|
||||
}
|
||||
}
|
||||
var tx = properties_1.shallowCopy(transaction);
|
||||
if (tx.from == null) {
|
||||
tx.from = this.getAddress();
|
||||
}
|
||||
else {
|
||||
// Make sure any provided address matches this signer
|
||||
tx.from = Promise.all([
|
||||
Promise.resolve(tx.from),
|
||||
this.getAddress()
|
||||
]).then(function (result) {
|
||||
if (result[0] !== result[1]) {
|
||||
logger.throwArgumentError("from address mismatch", "transaction", transaction);
|
||||
}
|
||||
return result[0];
|
||||
});
|
||||
}
|
||||
return tx;
|
||||
};
|
||||
// Populates ALL keys for a transaction and checks that "from" matches
|
||||
// this Signer. Should be used by sendTransaction but NOT by signTransaction.
|
||||
// By default called from: (overriding these prevents it)
|
||||
// - sendTransaction
|
||||
Signer.prototype.populateTransaction = function (transaction) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var tx;
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, properties_1.resolveProperties(this.checkTransaction(transaction))];
|
||||
case 1:
|
||||
tx = _a.sent();
|
||||
if (tx.to != null) {
|
||||
tx.to = Promise.resolve(tx.to).then(function (to) { return _this.resolveName(to); });
|
||||
}
|
||||
if (tx.gasPrice == null) {
|
||||
tx.gasPrice = this.getGasPrice();
|
||||
}
|
||||
if (tx.nonce == null) {
|
||||
tx.nonce = this.getTransactionCount("pending");
|
||||
}
|
||||
if (tx.gasLimit == null) {
|
||||
tx.gasLimit = this.estimateGas(tx).catch(function (error) {
|
||||
if (forwardErrors.indexOf(error.code) >= 0) {
|
||||
throw error;
|
||||
}
|
||||
return logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
||||
error: error,
|
||||
tx: tx
|
||||
});
|
||||
});
|
||||
}
|
||||
if (tx.chainId == null) {
|
||||
tx.chainId = this.getChainId();
|
||||
}
|
||||
else {
|
||||
tx.chainId = Promise.all([
|
||||
Promise.resolve(tx.chainId),
|
||||
this.getChainId()
|
||||
]).then(function (results) {
|
||||
if (results[1] !== 0 && results[0] !== results[1]) {
|
||||
logger.throwArgumentError("chainId address mismatch", "transaction", transaction);
|
||||
}
|
||||
return results[0];
|
||||
});
|
||||
}
|
||||
return [4 /*yield*/, properties_1.resolveProperties(tx)];
|
||||
case 2: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
///////////////////
|
||||
// Sub-classes SHOULD leave these alone
|
||||
Signer.prototype._checkProvider = function (operation) {
|
||||
if (!this.provider) {
|
||||
logger.throwError("missing provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: (operation || "_checkProvider")
|
||||
});
|
||||
}
|
||||
};
|
||||
Signer.isSigner = function (value) {
|
||||
return !!(value && value._isSigner);
|
||||
};
|
||||
return Signer;
|
||||
}());
|
||||
exports.Signer = Signer;
|
||||
var VoidSigner = /** @class */ (function (_super) {
|
||||
__extends(VoidSigner, _super);
|
||||
function VoidSigner(address, provider) {
|
||||
var _newTarget = this.constructor;
|
||||
var _this = this;
|
||||
logger.checkNew(_newTarget, VoidSigner);
|
||||
_this = _super.call(this) || this;
|
||||
properties_1.defineReadOnly(_this, "address", address);
|
||||
properties_1.defineReadOnly(_this, "provider", provider || null);
|
||||
return _this;
|
||||
}
|
||||
VoidSigner.prototype.getAddress = function () {
|
||||
return Promise.resolve(this.address);
|
||||
};
|
||||
VoidSigner.prototype._fail = function (message, operation) {
|
||||
return Promise.resolve().then(function () {
|
||||
logger.throwError(message, logger_1.Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });
|
||||
});
|
||||
};
|
||||
VoidSigner.prototype.signMessage = function (message) {
|
||||
return this._fail("VoidSigner cannot sign messages", "signMessage");
|
||||
};
|
||||
VoidSigner.prototype.signTransaction = function (transaction) {
|
||||
return this._fail("VoidSigner cannot sign transactions", "signTransaction");
|
||||
};
|
||||
VoidSigner.prototype._signTypedData = function (domain, types, value) {
|
||||
return this._fail("VoidSigner cannot sign typed data", "signTypedData");
|
||||
};
|
||||
VoidSigner.prototype.connect = function (provider) {
|
||||
return new VoidSigner(this.address, provider);
|
||||
};
|
||||
return VoidSigner;
|
||||
}(Signer));
|
||||
exports.VoidSigner = VoidSigner;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"dependencies": {
|
||||
"@ethersproject/abstract-provider": "^5.0.4",
|
||||
"@ethersproject/bignumber": "^5.0.7",
|
||||
"@ethersproject/bytes": "^5.0.4",
|
||||
"@ethersproject/logger": "^5.0.5",
|
||||
"@ethersproject/properties": "^5.0.3"
|
||||
},
|
||||
"description": "An Abstract Class for desribing an Ethereum Signer for ethers.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "86146650d83865d83b10867e9592923eada5d7cc",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/abstract-signer",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x722fb4b5e18bb70cda3c2fbd250d96bacdbe7d358c4c426a73d262fc1f751845",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.7"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.0.7.tgz"
|
||||
,"_integrity": "sha512-8W8gy/QutEL60EoMEpvxZ8MFAEWs/JvH5nmZ6xeLXoZvmBCasGmxqHdYjo2cxg0nevkPkq9SeenSsBBZSCx+SQ=="
|
||||
,"_from": "@ethersproject/abstract-signer@^5.0.6"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "address/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-136
@@ -1,136 +0,0 @@
|
||||
"use strict";
|
||||
// We use this for base 36 maths
|
||||
import { BN } from "bn.js";
|
||||
import { arrayify, concat, hexDataLength, hexDataSlice, isHexString, stripZeros } from "@ethersproject/bytes";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { encode } from "@ethersproject/rlp";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
function getChecksumAddress(address) {
|
||||
if (!isHexString(address, 20)) {
|
||||
logger.throwArgumentError("invalid address", "address", address);
|
||||
}
|
||||
address = address.toLowerCase();
|
||||
const chars = address.substring(2).split("");
|
||||
const expanded = new Uint8Array(40);
|
||||
for (let i = 0; i < 40; i++) {
|
||||
expanded[i] = chars[i].charCodeAt(0);
|
||||
}
|
||||
const hashed = arrayify(keccak256(expanded));
|
||||
for (let i = 0; i < 40; i += 2) {
|
||||
if ((hashed[i >> 1] >> 4) >= 8) {
|
||||
chars[i] = chars[i].toUpperCase();
|
||||
}
|
||||
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
||||
chars[i + 1] = chars[i + 1].toUpperCase();
|
||||
}
|
||||
}
|
||||
return "0x" + chars.join("");
|
||||
}
|
||||
// Shims for environments that are missing some required constants and functions
|
||||
const MAX_SAFE_INTEGER = 0x1fffffffffffff;
|
||||
function log10(x) {
|
||||
if (Math.log10) {
|
||||
return Math.log10(x);
|
||||
}
|
||||
return Math.log(x) / Math.LN10;
|
||||
}
|
||||
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
||||
// Create lookup table
|
||||
const ibanLookup = {};
|
||||
for (let i = 0; i < 10; i++) {
|
||||
ibanLookup[String(i)] = String(i);
|
||||
}
|
||||
for (let i = 0; i < 26; i++) {
|
||||
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
||||
}
|
||||
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
||||
const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
||||
function ibanChecksum(address) {
|
||||
address = address.toUpperCase();
|
||||
address = address.substring(4) + address.substring(0, 2) + "00";
|
||||
let expanded = address.split("").map((c) => { return ibanLookup[c]; }).join("");
|
||||
// Javascript can handle integers safely up to 15 (decimal) digits
|
||||
while (expanded.length >= safeDigits) {
|
||||
let block = expanded.substring(0, safeDigits);
|
||||
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
||||
}
|
||||
let checksum = String(98 - (parseInt(expanded, 10) % 97));
|
||||
while (checksum.length < 2) {
|
||||
checksum = "0" + checksum;
|
||||
}
|
||||
return checksum;
|
||||
}
|
||||
;
|
||||
export function getAddress(address) {
|
||||
let result = null;
|
||||
if (typeof (address) !== "string") {
|
||||
logger.throwArgumentError("invalid address", "address", address);
|
||||
}
|
||||
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
||||
// Missing the 0x prefix
|
||||
if (address.substring(0, 2) !== "0x") {
|
||||
address = "0x" + address;
|
||||
}
|
||||
result = getChecksumAddress(address);
|
||||
// It is a checksummed address with a bad checksum
|
||||
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
||||
logger.throwArgumentError("bad address checksum", "address", address);
|
||||
}
|
||||
// Maybe ICAP? (we only support direct mode)
|
||||
}
|
||||
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
||||
// It is an ICAP address with a bad checksum
|
||||
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
||||
logger.throwArgumentError("bad icap checksum", "address", address);
|
||||
}
|
||||
result = (new BN(address.substring(4), 36)).toString(16);
|
||||
while (result.length < 40) {
|
||||
result = "0" + result;
|
||||
}
|
||||
result = getChecksumAddress("0x" + result);
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("invalid address", "address", address);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function isAddress(address) {
|
||||
try {
|
||||
getAddress(address);
|
||||
return true;
|
||||
}
|
||||
catch (error) { }
|
||||
return false;
|
||||
}
|
||||
export function getIcapAddress(address) {
|
||||
let base36 = (new BN(getAddress(address).substring(2), 16)).toString(36).toUpperCase();
|
||||
while (base36.length < 30) {
|
||||
base36 = "0" + base36;
|
||||
}
|
||||
return "XE" + ibanChecksum("XE00" + base36) + base36;
|
||||
}
|
||||
// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed
|
||||
export function getContractAddress(transaction) {
|
||||
let from = null;
|
||||
try {
|
||||
from = getAddress(transaction.from);
|
||||
}
|
||||
catch (error) {
|
||||
logger.throwArgumentError("missing from address", "transaction", transaction);
|
||||
}
|
||||
const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
||||
return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12));
|
||||
}
|
||||
export function getCreate2Address(from, salt, initCodeHash) {
|
||||
if (hexDataLength(salt) !== 32) {
|
||||
logger.throwArgumentError("salt must be 32 bytes", "salt", salt);
|
||||
}
|
||||
if (hexDataLength(initCodeHash) !== 32) {
|
||||
logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
||||
}
|
||||
return getAddress(hexDataSlice(keccak256(concat(["0xff", getAddress(from), salt, initCodeHash])), 12));
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "address/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-142
@@ -1,142 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// We use this for base 36 maths
|
||||
var bn_js_1 = require("bn.js");
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var keccak256_1 = require("@ethersproject/keccak256");
|
||||
var rlp_1 = require("@ethersproject/rlp");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
function getChecksumAddress(address) {
|
||||
if (!bytes_1.isHexString(address, 20)) {
|
||||
logger.throwArgumentError("invalid address", "address", address);
|
||||
}
|
||||
address = address.toLowerCase();
|
||||
var chars = address.substring(2).split("");
|
||||
var expanded = new Uint8Array(40);
|
||||
for (var i = 0; i < 40; i++) {
|
||||
expanded[i] = chars[i].charCodeAt(0);
|
||||
}
|
||||
var hashed = bytes_1.arrayify(keccak256_1.keccak256(expanded));
|
||||
for (var i = 0; i < 40; i += 2) {
|
||||
if ((hashed[i >> 1] >> 4) >= 8) {
|
||||
chars[i] = chars[i].toUpperCase();
|
||||
}
|
||||
if ((hashed[i >> 1] & 0x0f) >= 8) {
|
||||
chars[i + 1] = chars[i + 1].toUpperCase();
|
||||
}
|
||||
}
|
||||
return "0x" + chars.join("");
|
||||
}
|
||||
// Shims for environments that are missing some required constants and functions
|
||||
var MAX_SAFE_INTEGER = 0x1fffffffffffff;
|
||||
function log10(x) {
|
||||
if (Math.log10) {
|
||||
return Math.log10(x);
|
||||
}
|
||||
return Math.log(x) / Math.LN10;
|
||||
}
|
||||
// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
||||
// Create lookup table
|
||||
var ibanLookup = {};
|
||||
for (var i = 0; i < 10; i++) {
|
||||
ibanLookup[String(i)] = String(i);
|
||||
}
|
||||
for (var i = 0; i < 26; i++) {
|
||||
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
||||
}
|
||||
// How many decimal digits can we process? (for 64-bit float, this is 15)
|
||||
var safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
|
||||
function ibanChecksum(address) {
|
||||
address = address.toUpperCase();
|
||||
address = address.substring(4) + address.substring(0, 2) + "00";
|
||||
var expanded = address.split("").map(function (c) { return ibanLookup[c]; }).join("");
|
||||
// Javascript can handle integers safely up to 15 (decimal) digits
|
||||
while (expanded.length >= safeDigits) {
|
||||
var block = expanded.substring(0, safeDigits);
|
||||
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
||||
}
|
||||
var checksum = String(98 - (parseInt(expanded, 10) % 97));
|
||||
while (checksum.length < 2) {
|
||||
checksum = "0" + checksum;
|
||||
}
|
||||
return checksum;
|
||||
}
|
||||
;
|
||||
function getAddress(address) {
|
||||
var result = null;
|
||||
if (typeof (address) !== "string") {
|
||||
logger.throwArgumentError("invalid address", "address", address);
|
||||
}
|
||||
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
||||
// Missing the 0x prefix
|
||||
if (address.substring(0, 2) !== "0x") {
|
||||
address = "0x" + address;
|
||||
}
|
||||
result = getChecksumAddress(address);
|
||||
// It is a checksummed address with a bad checksum
|
||||
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
||||
logger.throwArgumentError("bad address checksum", "address", address);
|
||||
}
|
||||
// Maybe ICAP? (we only support direct mode)
|
||||
}
|
||||
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
||||
// It is an ICAP address with a bad checksum
|
||||
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
||||
logger.throwArgumentError("bad icap checksum", "address", address);
|
||||
}
|
||||
result = (new bn_js_1.BN(address.substring(4), 36)).toString(16);
|
||||
while (result.length < 40) {
|
||||
result = "0" + result;
|
||||
}
|
||||
result = getChecksumAddress("0x" + result);
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("invalid address", "address", address);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.getAddress = getAddress;
|
||||
function isAddress(address) {
|
||||
try {
|
||||
getAddress(address);
|
||||
return true;
|
||||
}
|
||||
catch (error) { }
|
||||
return false;
|
||||
}
|
||||
exports.isAddress = isAddress;
|
||||
function getIcapAddress(address) {
|
||||
var base36 = (new bn_js_1.BN(getAddress(address).substring(2), 16)).toString(36).toUpperCase();
|
||||
while (base36.length < 30) {
|
||||
base36 = "0" + base36;
|
||||
}
|
||||
return "XE" + ibanChecksum("XE00" + base36) + base36;
|
||||
}
|
||||
exports.getIcapAddress = getIcapAddress;
|
||||
// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed
|
||||
function getContractAddress(transaction) {
|
||||
var from = null;
|
||||
try {
|
||||
from = getAddress(transaction.from);
|
||||
}
|
||||
catch (error) {
|
||||
logger.throwArgumentError("missing from address", "transaction", transaction);
|
||||
}
|
||||
var nonce = bytes_1.stripZeros(bytes_1.arrayify(bignumber_1.BigNumber.from(transaction.nonce).toHexString()));
|
||||
return getAddress(bytes_1.hexDataSlice(keccak256_1.keccak256(rlp_1.encode([from, nonce])), 12));
|
||||
}
|
||||
exports.getContractAddress = getContractAddress;
|
||||
function getCreate2Address(from, salt, initCodeHash) {
|
||||
if (bytes_1.hexDataLength(salt) !== 32) {
|
||||
logger.throwArgumentError("salt must be 32 bytes", "salt", salt);
|
||||
}
|
||||
if (bytes_1.hexDataLength(initCodeHash) !== 32) {
|
||||
logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
||||
}
|
||||
return getAddress(bytes_1.hexDataSlice(keccak256_1.keccak256(bytes_1.concat(["0xff", getAddress(from), salt, initCodeHash])), 12));
|
||||
}
|
||||
exports.getCreate2Address = getCreate2Address;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"_from": "@ethersproject/address@^5.0.4",
|
||||
"_id": "@ethersproject/address@5.0.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-DpkQ6rwk9jTefrRsJzEm6nhRiJd9pvhn1xN0rw5N/jswXG5r7BLk/GVA0mMAVWAsYfvi2xSc5L41FMox43RYEA==",
|
||||
"_location": "/@ethersproject/address",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@ethersproject/address@^5.0.4",
|
||||
"name": "@ethersproject/address",
|
||||
"escapedName": "@ethersproject%2faddress",
|
||||
"scope": "@ethersproject",
|
||||
"rawSpec": "^5.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@ethersproject/abi",
|
||||
"/@ethersproject/hash",
|
||||
"/@ethersproject/transactions"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.5.tgz",
|
||||
"_shasum": "2caa65f6b7125015395b1b54c985ee0b27059cc7",
|
||||
"_spec": "@ethersproject/address@^5.0.4",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\@ethersproject\\transactions",
|
||||
"author": {
|
||||
"name": "Richard Moore",
|
||||
"email": "me@ricmoo.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ethers-io/ethers.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.0.7",
|
||||
"@ethersproject/bytes": "^5.0.4",
|
||||
"@ethersproject/keccak256": "^5.0.3",
|
||||
"@ethersproject/logger": "^5.0.5",
|
||||
"@ethersproject/rlp": "^5.0.3",
|
||||
"bn.js": "^4.4.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Utilities for handling Ethereum Addresses for ethers.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"homepage": "https://github.com/ethers-io/ethers.js#readme",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/address",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0xd6263c8653bc6784fed703b8a30075630c544e3861f43ed5b49ab56ffb5d4808",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.5"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "base64/5.0.4";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
import { arrayify } from "@ethersproject/bytes";
|
||||
export function decode(textData) {
|
||||
textData = atob(textData);
|
||||
const data = [];
|
||||
for (let i = 0; i < textData.length; i++) {
|
||||
data.push(textData.charCodeAt(i));
|
||||
}
|
||||
return arrayify(data);
|
||||
}
|
||||
export function encode(data) {
|
||||
data = arrayify(data);
|
||||
let textData = "";
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
textData += String.fromCharCode(data[i]);
|
||||
}
|
||||
return btoa(textData);
|
||||
}
|
||||
//# sourceMappingURL=browser.js.map
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
import { arrayify } from "@ethersproject/bytes";
|
||||
export function decode(textData) {
|
||||
return arrayify(new Uint8Array(Buffer.from(textData, "base64")));
|
||||
}
|
||||
;
|
||||
export function encode(data) {
|
||||
return Buffer.from(arrayify(data)).toString("base64");
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "base64/5.0.4";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
function decode(textData) {
|
||||
textData = atob(textData);
|
||||
var data = [];
|
||||
for (var i = 0; i < textData.length; i++) {
|
||||
data.push(textData.charCodeAt(i));
|
||||
}
|
||||
return bytes_1.arrayify(data);
|
||||
}
|
||||
exports.decode = decode;
|
||||
function encode(data) {
|
||||
data = bytes_1.arrayify(data);
|
||||
var textData = "";
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
textData += String.fromCharCode(data[i]);
|
||||
}
|
||||
return btoa(textData);
|
||||
}
|
||||
exports.encode = encode;
|
||||
//# sourceMappingURL=browser.js.map
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
function decode(textData) {
|
||||
return bytes_1.arrayify(new Uint8Array(Buffer.from(textData, "base64")));
|
||||
}
|
||||
exports.decode = decode;
|
||||
;
|
||||
function encode(data) {
|
||||
return Buffer.from(bytes_1.arrayify(data)).toString("base64");
|
||||
}
|
||||
exports.encode = encode;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"_from": "@ethersproject/base64@^5.0.3",
|
||||
"_id": "@ethersproject/base64@5.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-4KRykQ7BQMeOXfvio1YITwHjxwBzh92UoXIdzxDE1p53CK28bbHPdsPNYo0wl0El7lJAMpT2SOdL0hhbWRnyIA==",
|
||||
"_location": "/@ethersproject/base64",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@ethersproject/base64@^5.0.3",
|
||||
"name": "@ethersproject/base64",
|
||||
"escapedName": "@ethersproject%2fbase64",
|
||||
"scope": "@ethersproject",
|
||||
"rawSpec": "^5.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@ethersproject/web"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.0.4.tgz",
|
||||
"_shasum": "b0d8fdbf3dda977cf546dcd35725a7b1d5256caa",
|
||||
"_spec": "@ethersproject/base64@^5.0.3",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\@ethersproject\\web",
|
||||
"author": {
|
||||
"name": "Richard Moore",
|
||||
"email": "me@ricmoo.com"
|
||||
},
|
||||
"browser": "./lib/browser.js",
|
||||
"browser.esm": "./lib.esm/browser.js",
|
||||
"browser.umd": "./lib/browser.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ethers-io/ethers.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@ethersproject/bytes": "^5.0.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Base64 coder.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"homepage": "https://github.com/ethers-io/ethers.js#readme",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/base64",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0xf9edd66aa5131bf0bca2ea188265e0e333d781e4b0ef5e92090a7cef8556cb30",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.4"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "bignumber/5.0.8";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-275
@@ -1,275 +0,0 @@
|
||||
"use strict";
|
||||
/**
|
||||
* BigNumber
|
||||
*
|
||||
* A wrapper around the BN.js object. We use the BN.js library
|
||||
* because it is used by elliptic, so it is required regardles.
|
||||
*
|
||||
*/
|
||||
import { BN } from "bn.js";
|
||||
import { hexlify, isBytes, isHexString } from "@ethersproject/bytes";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
const _constructorGuard = {};
|
||||
const MAX_SAFE = 0x1fffffffffffff;
|
||||
export function isBigNumberish(value) {
|
||||
return (value != null) && (BigNumber.isBigNumber(value) ||
|
||||
(typeof (value) === "number" && (value % 1) === 0) ||
|
||||
(typeof (value) === "string" && !!value.match(/^-?[0-9]+$/)) ||
|
||||
isHexString(value) ||
|
||||
(typeof (value) === "bigint") ||
|
||||
isBytes(value));
|
||||
}
|
||||
export class BigNumber {
|
||||
constructor(constructorGuard, hex) {
|
||||
logger.checkNew(new.target, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
this._hex = hex;
|
||||
this._isBigNumber = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
fromTwos(value) {
|
||||
return toBigNumber(toBN(this).fromTwos(value));
|
||||
}
|
||||
toTwos(value) {
|
||||
return toBigNumber(toBN(this).toTwos(value));
|
||||
}
|
||||
abs() {
|
||||
if (this._hex[0] === "-") {
|
||||
return BigNumber.from(this._hex.substring(1));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
add(other) {
|
||||
return toBigNumber(toBN(this).add(toBN(other)));
|
||||
}
|
||||
sub(other) {
|
||||
return toBigNumber(toBN(this).sub(toBN(other)));
|
||||
}
|
||||
div(other) {
|
||||
const o = BigNumber.from(other);
|
||||
if (o.isZero()) {
|
||||
throwFault("division by zero", "div");
|
||||
}
|
||||
return toBigNumber(toBN(this).div(toBN(other)));
|
||||
}
|
||||
mul(other) {
|
||||
return toBigNumber(toBN(this).mul(toBN(other)));
|
||||
}
|
||||
mod(other) {
|
||||
const value = toBN(other);
|
||||
if (value.isNeg()) {
|
||||
throwFault("cannot modulo negative values", "mod");
|
||||
}
|
||||
return toBigNumber(toBN(this).umod(value));
|
||||
}
|
||||
pow(other) {
|
||||
const value = toBN(other);
|
||||
if (value.isNeg()) {
|
||||
throwFault("cannot raise to negative values", "pow");
|
||||
}
|
||||
return toBigNumber(toBN(this).pow(value));
|
||||
}
|
||||
and(other) {
|
||||
const value = toBN(other);
|
||||
if (this.isNegative() || value.isNeg()) {
|
||||
throwFault("cannot 'and' negative values", "and");
|
||||
}
|
||||
return toBigNumber(toBN(this).and(value));
|
||||
}
|
||||
or(other) {
|
||||
const value = toBN(other);
|
||||
if (this.isNegative() || value.isNeg()) {
|
||||
throwFault("cannot 'or' negative values", "or");
|
||||
}
|
||||
return toBigNumber(toBN(this).or(value));
|
||||
}
|
||||
xor(other) {
|
||||
const value = toBN(other);
|
||||
if (this.isNegative() || value.isNeg()) {
|
||||
throwFault("cannot 'xor' negative values", "xor");
|
||||
}
|
||||
return toBigNumber(toBN(this).xor(value));
|
||||
}
|
||||
mask(value) {
|
||||
if (this.isNegative() || value < 0) {
|
||||
throwFault("cannot mask negative values", "mask");
|
||||
}
|
||||
return toBigNumber(toBN(this).maskn(value));
|
||||
}
|
||||
shl(value) {
|
||||
if (this.isNegative() || value < 0) {
|
||||
throwFault("cannot shift negative values", "shl");
|
||||
}
|
||||
return toBigNumber(toBN(this).shln(value));
|
||||
}
|
||||
shr(value) {
|
||||
if (this.isNegative() || value < 0) {
|
||||
throwFault("cannot shift negative values", "shr");
|
||||
}
|
||||
return toBigNumber(toBN(this).shrn(value));
|
||||
}
|
||||
eq(other) {
|
||||
return toBN(this).eq(toBN(other));
|
||||
}
|
||||
lt(other) {
|
||||
return toBN(this).lt(toBN(other));
|
||||
}
|
||||
lte(other) {
|
||||
return toBN(this).lte(toBN(other));
|
||||
}
|
||||
gt(other) {
|
||||
return toBN(this).gt(toBN(other));
|
||||
}
|
||||
gte(other) {
|
||||
return toBN(this).gte(toBN(other));
|
||||
}
|
||||
isNegative() {
|
||||
return (this._hex[0] === "-");
|
||||
}
|
||||
isZero() {
|
||||
return toBN(this).isZero();
|
||||
}
|
||||
toNumber() {
|
||||
try {
|
||||
return toBN(this).toNumber();
|
||||
}
|
||||
catch (error) {
|
||||
throwFault("overflow", "toNumber", this.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
toString() {
|
||||
// Lots of people expect this, which we do not support, so check
|
||||
if (arguments.length !== 0) {
|
||||
logger.throwError("bigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {});
|
||||
}
|
||||
return toBN(this).toString(10);
|
||||
}
|
||||
toHexString() {
|
||||
return this._hex;
|
||||
}
|
||||
toJSON(key) {
|
||||
return { type: "BigNumber", hex: this.toHexString() };
|
||||
}
|
||||
static from(value) {
|
||||
if (value instanceof BigNumber) {
|
||||
return value;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
if (value.match(/^-?0x[0-9a-f]+$/i)) {
|
||||
return new BigNumber(_constructorGuard, toHex(value));
|
||||
}
|
||||
if (value.match(/^-?[0-9]+$/)) {
|
||||
return new BigNumber(_constructorGuard, toHex(new BN(value)));
|
||||
}
|
||||
return logger.throwArgumentError("invalid BigNumber string", "value", value);
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
if (value % 1) {
|
||||
throwFault("underflow", "BigNumber.from", value);
|
||||
}
|
||||
if (value >= MAX_SAFE || value <= -MAX_SAFE) {
|
||||
throwFault("overflow", "BigNumber.from", value);
|
||||
}
|
||||
return BigNumber.from(String(value));
|
||||
}
|
||||
const anyValue = value;
|
||||
if (typeof (anyValue) === "bigint") {
|
||||
return BigNumber.from(anyValue.toString());
|
||||
}
|
||||
if (isBytes(anyValue)) {
|
||||
return BigNumber.from(hexlify(anyValue));
|
||||
}
|
||||
if (anyValue) {
|
||||
// Hexable interface (takes piority)
|
||||
if (anyValue.toHexString) {
|
||||
const hex = anyValue.toHexString();
|
||||
if (typeof (hex) === "string") {
|
||||
return BigNumber.from(hex);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// For now, handle legacy JSON-ified values (goes away in v6)
|
||||
let hex = anyValue._hex;
|
||||
// New-form JSON
|
||||
if (hex == null && anyValue.type === "BigNumber") {
|
||||
hex = anyValue.hex;
|
||||
}
|
||||
if (typeof (hex) === "string") {
|
||||
if (isHexString(hex) || (hex[0] === "-" && isHexString(hex.substring(1)))) {
|
||||
return BigNumber.from(hex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return logger.throwArgumentError("invalid BigNumber value", "value", value);
|
||||
}
|
||||
static isBigNumber(value) {
|
||||
return !!(value && value._isBigNumber);
|
||||
}
|
||||
}
|
||||
// Normalize the hex string
|
||||
function toHex(value) {
|
||||
// For BN, call on the hex string
|
||||
if (typeof (value) !== "string") {
|
||||
return toHex(value.toString(16));
|
||||
}
|
||||
// If negative, prepend the negative sign to the normalized positive value
|
||||
if (value[0] === "-") {
|
||||
// Strip off the negative sign
|
||||
value = value.substring(1);
|
||||
// Cannot have mulitple negative signs (e.g. "--0x04")
|
||||
if (value[0] === "-") {
|
||||
logger.throwArgumentError("invalid hex", "value", value);
|
||||
}
|
||||
// Call toHex on the positive component
|
||||
value = toHex(value);
|
||||
// Do not allow "-0x00"
|
||||
if (value === "0x00") {
|
||||
return value;
|
||||
}
|
||||
// Negate the value
|
||||
return "-" + value;
|
||||
}
|
||||
// Add a "0x" prefix if missing
|
||||
if (value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
// Normalize zero
|
||||
if (value === "0x") {
|
||||
return "0x00";
|
||||
}
|
||||
// Make the string even length
|
||||
if (value.length % 2) {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
// Trim to smallest even-length string
|
||||
while (value.length > 4 && value.substring(0, 4) === "0x00") {
|
||||
value = "0x" + value.substring(4);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function toBigNumber(value) {
|
||||
return BigNumber.from(toHex(value));
|
||||
}
|
||||
function toBN(value) {
|
||||
const hex = BigNumber.from(value).toHexString();
|
||||
if (hex[0] === "-") {
|
||||
return (new BN("-" + hex.substring(3), 16));
|
||||
}
|
||||
return new BN(hex.substring(2), 16);
|
||||
}
|
||||
function throwFault(fault, operation, value) {
|
||||
const params = { fault: fault, operation: operation };
|
||||
if (value != null) {
|
||||
params.value = value;
|
||||
}
|
||||
return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
|
||||
}
|
||||
//# sourceMappingURL=bignumber.js.map
|
||||
-339
@@ -1,339 +0,0 @@
|
||||
"use strict";
|
||||
import { arrayify, hexZeroPad, isBytes } from "@ethersproject/bytes";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
import { BigNumber, isBigNumberish } from "./bignumber";
|
||||
const _constructorGuard = {};
|
||||
const Zero = BigNumber.from(0);
|
||||
const NegativeOne = BigNumber.from(-1);
|
||||
function throwFault(message, fault, operation, value) {
|
||||
const params = { fault: fault, operation: operation };
|
||||
if (value !== undefined) {
|
||||
params.value = value;
|
||||
}
|
||||
return logger.throwError(message, Logger.errors.NUMERIC_FAULT, params);
|
||||
}
|
||||
// Constant to pull zeros from for multipliers
|
||||
let zeros = "0";
|
||||
while (zeros.length < 256) {
|
||||
zeros += zeros;
|
||||
}
|
||||
// Returns a string "1" followed by decimal "0"s
|
||||
function getMultiplier(decimals) {
|
||||
if (typeof (decimals) !== "number") {
|
||||
try {
|
||||
decimals = BigNumber.from(decimals).toNumber();
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
||||
return ("1" + zeros.substring(0, decimals));
|
||||
}
|
||||
return logger.throwArgumentError("invalid decimal size", "decimals", decimals);
|
||||
}
|
||||
export function formatFixed(value, decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
const multiplier = getMultiplier(decimals);
|
||||
// Make sure wei is a big number (convert as necessary)
|
||||
value = BigNumber.from(value);
|
||||
const negative = value.lt(Zero);
|
||||
if (negative) {
|
||||
value = value.mul(NegativeOne);
|
||||
}
|
||||
let fraction = value.mod(multiplier).toString();
|
||||
while (fraction.length < multiplier.length - 1) {
|
||||
fraction = "0" + fraction;
|
||||
}
|
||||
// Strip training 0
|
||||
fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];
|
||||
const whole = value.div(multiplier).toString();
|
||||
value = whole + "." + fraction;
|
||||
if (negative) {
|
||||
value = "-" + value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function parseFixed(value, decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
const multiplier = getMultiplier(decimals);
|
||||
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
||||
logger.throwArgumentError("invalid decimal value", "value", value);
|
||||
}
|
||||
if (multiplier.length - 1 === 0) {
|
||||
return BigNumber.from(value);
|
||||
}
|
||||
// Is it negative?
|
||||
const negative = (value.substring(0, 1) === "-");
|
||||
if (negative) {
|
||||
value = value.substring(1);
|
||||
}
|
||||
if (value === ".") {
|
||||
logger.throwArgumentError("missing value", "value", value);
|
||||
}
|
||||
// Split it into a whole and fractional part
|
||||
const comps = value.split(".");
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("too many decimal points", "value", value);
|
||||
}
|
||||
let whole = comps[0], fraction = comps[1];
|
||||
if (!whole) {
|
||||
whole = "0";
|
||||
}
|
||||
if (!fraction) {
|
||||
fraction = "0";
|
||||
}
|
||||
// Prevent underflow
|
||||
if (fraction.length > multiplier.length - 1) {
|
||||
throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
|
||||
}
|
||||
// Fully pad the string with zeros to get to wei
|
||||
while (fraction.length < multiplier.length - 1) {
|
||||
fraction += "0";
|
||||
}
|
||||
const wholeValue = BigNumber.from(whole);
|
||||
const fractionValue = BigNumber.from(fraction);
|
||||
let wei = (wholeValue.mul(multiplier)).add(fractionValue);
|
||||
if (negative) {
|
||||
wei = wei.mul(NegativeOne);
|
||||
}
|
||||
return wei;
|
||||
}
|
||||
export class FixedFormat {
|
||||
constructor(constructorGuard, signed, width, decimals) {
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new FixedFormat"
|
||||
});
|
||||
}
|
||||
this.signed = signed;
|
||||
this.width = width;
|
||||
this.decimals = decimals;
|
||||
this.name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals);
|
||||
this._multiplier = getMultiplier(decimals);
|
||||
Object.freeze(this);
|
||||
}
|
||||
static from(value) {
|
||||
if (value instanceof FixedFormat) {
|
||||
return value;
|
||||
}
|
||||
let signed = true;
|
||||
let width = 128;
|
||||
let decimals = 18;
|
||||
if (typeof (value) === "string") {
|
||||
if (value === "fixed") {
|
||||
// defaults...
|
||||
}
|
||||
else if (value === "ufixed") {
|
||||
signed = false;
|
||||
}
|
||||
else if (value != null) {
|
||||
const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
||||
if (!match) {
|
||||
logger.throwArgumentError("invalid fixed format", "format", value);
|
||||
}
|
||||
signed = (match[1] !== "u");
|
||||
width = parseInt(match[2]);
|
||||
decimals = parseInt(match[3]);
|
||||
}
|
||||
}
|
||||
else if (value) {
|
||||
const check = (key, type, defaultValue) => {
|
||||
if (value[key] == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (typeof (value[key]) !== type) {
|
||||
logger.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
||||
}
|
||||
return value[key];
|
||||
};
|
||||
signed = check("signed", "boolean", signed);
|
||||
width = check("width", "number", width);
|
||||
decimals = check("decimals", "number", decimals);
|
||||
}
|
||||
if (width % 8) {
|
||||
logger.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
||||
}
|
||||
if (decimals > 80) {
|
||||
logger.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
||||
}
|
||||
return new FixedFormat(_constructorGuard, signed, width, decimals);
|
||||
}
|
||||
}
|
||||
export class FixedNumber {
|
||||
constructor(constructorGuard, hex, value, format) {
|
||||
logger.checkNew(new.target, FixedNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new FixedFormat"
|
||||
});
|
||||
}
|
||||
this.format = format;
|
||||
this._hex = hex;
|
||||
this._value = value;
|
||||
this._isFixedNumber = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
_checkFormat(other) {
|
||||
if (this.format.name !== other.format.name) {
|
||||
logger.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
||||
}
|
||||
}
|
||||
addUnsafe(other) {
|
||||
this._checkFormat(other);
|
||||
const a = parseFixed(this._value, this.format.decimals);
|
||||
const b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);
|
||||
}
|
||||
subUnsafe(other) {
|
||||
this._checkFormat(other);
|
||||
const a = parseFixed(this._value, this.format.decimals);
|
||||
const b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);
|
||||
}
|
||||
mulUnsafe(other) {
|
||||
this._checkFormat(other);
|
||||
const a = parseFixed(this._value, this.format.decimals);
|
||||
const b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);
|
||||
}
|
||||
divUnsafe(other) {
|
||||
this._checkFormat(other);
|
||||
const a = parseFixed(this._value, this.format.decimals);
|
||||
const b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);
|
||||
}
|
||||
floor() {
|
||||
let comps = this.toString().split(".");
|
||||
let result = FixedNumber.from(comps[0], this.format);
|
||||
const hasFraction = !comps[1].match(/^(0*)$/);
|
||||
if (this.isNegative() && hasFraction) {
|
||||
result = result.subUnsafe(ONE);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ceiling() {
|
||||
let comps = this.toString().split(".");
|
||||
let result = FixedNumber.from(comps[0], this.format);
|
||||
const hasFraction = !comps[1].match(/^(0*)$/);
|
||||
if (!this.isNegative() && hasFraction) {
|
||||
result = result.addUnsafe(ONE);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// @TODO: Support other rounding algorithms
|
||||
round(decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
let comps = this.toString().split(".");
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger.throwArgumentError("invalid decimal count", "decimals", decimals);
|
||||
}
|
||||
if (comps[1].length <= decimals) {
|
||||
return this;
|
||||
}
|
||||
const factor = FixedNumber.from("1" + zeros.substring(0, decimals));
|
||||
return this.mulUnsafe(factor).addUnsafe(BUMP).floor().divUnsafe(factor);
|
||||
}
|
||||
isZero() {
|
||||
return (this._value === "0.0");
|
||||
}
|
||||
isNegative() {
|
||||
return (this._value[0] === "-");
|
||||
}
|
||||
toString() { return this._value; }
|
||||
toHexString(width) {
|
||||
if (width == null) {
|
||||
return this._hex;
|
||||
}
|
||||
if (width % 8) {
|
||||
logger.throwArgumentError("invalid byte width", "width", width);
|
||||
}
|
||||
const hex = BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
||||
return hexZeroPad(hex, width / 8);
|
||||
}
|
||||
toUnsafeFloat() { return parseFloat(this.toString()); }
|
||||
toFormat(format) {
|
||||
return FixedNumber.fromString(this._value, format);
|
||||
}
|
||||
static fromValue(value, decimals, format) {
|
||||
// If decimals looks more like a format, and there is no format, shift the parameters
|
||||
if (format == null && decimals != null && !isBigNumberish(decimals)) {
|
||||
format = decimals;
|
||||
decimals = null;
|
||||
}
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));
|
||||
}
|
||||
static fromString(value, format) {
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
const fixedFormat = FixedFormat.from(format);
|
||||
const numeric = parseFixed(value, fixedFormat.decimals);
|
||||
if (!fixedFormat.signed && numeric.lt(Zero)) {
|
||||
throwFault("unsigned value cannot be negative", "overflow", "value", value);
|
||||
}
|
||||
let hex = null;
|
||||
if (fixedFormat.signed) {
|
||||
hex = numeric.toTwos(fixedFormat.width).toHexString();
|
||||
}
|
||||
else {
|
||||
hex = numeric.toHexString();
|
||||
hex = hexZeroPad(hex, fixedFormat.width / 8);
|
||||
}
|
||||
const decimal = formatFixed(numeric, fixedFormat.decimals);
|
||||
return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
|
||||
}
|
||||
static fromBytes(value, format) {
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
const fixedFormat = FixedFormat.from(format);
|
||||
if (arrayify(value).length > fixedFormat.width / 8) {
|
||||
throw new Error("overflow");
|
||||
}
|
||||
let numeric = BigNumber.from(value);
|
||||
if (fixedFormat.signed) {
|
||||
numeric = numeric.fromTwos(fixedFormat.width);
|
||||
}
|
||||
const hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();
|
||||
const decimal = formatFixed(numeric, fixedFormat.decimals);
|
||||
return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
|
||||
}
|
||||
static from(value, format) {
|
||||
if (typeof (value) === "string") {
|
||||
return FixedNumber.fromString(value, format);
|
||||
}
|
||||
if (isBytes(value)) {
|
||||
return FixedNumber.fromBytes(value, format);
|
||||
}
|
||||
try {
|
||||
return FixedNumber.fromValue(value, 0, format);
|
||||
}
|
||||
catch (error) {
|
||||
// Allow NUMERIC_FAULT to bubble up
|
||||
if (error.code !== Logger.errors.INVALID_ARGUMENT) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return logger.throwArgumentError("invalid FixedNumber value", "value", value);
|
||||
}
|
||||
static isFixedNumber(value) {
|
||||
return !!(value && value._isFixedNumber);
|
||||
}
|
||||
}
|
||||
const ONE = FixedNumber.from(1);
|
||||
const BUMP = FixedNumber.from("0.5");
|
||||
//# sourceMappingURL=fixednumber.js.map
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
export { BigNumber } from "./bignumber";
|
||||
export { formatFixed, FixedFormat, FixedNumber, parseFixed } from "./fixednumber";
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "bignumber/5.0.8";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-280
@@ -1,280 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
* BigNumber
|
||||
*
|
||||
* A wrapper around the BN.js object. We use the BN.js library
|
||||
* because it is used by elliptic, so it is required regardles.
|
||||
*
|
||||
*/
|
||||
var bn_js_1 = require("bn.js");
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var _constructorGuard = {};
|
||||
var MAX_SAFE = 0x1fffffffffffff;
|
||||
function isBigNumberish(value) {
|
||||
return (value != null) && (BigNumber.isBigNumber(value) ||
|
||||
(typeof (value) === "number" && (value % 1) === 0) ||
|
||||
(typeof (value) === "string" && !!value.match(/^-?[0-9]+$/)) ||
|
||||
bytes_1.isHexString(value) ||
|
||||
(typeof (value) === "bigint") ||
|
||||
bytes_1.isBytes(value));
|
||||
}
|
||||
exports.isBigNumberish = isBigNumberish;
|
||||
var BigNumber = /** @class */ (function () {
|
||||
function BigNumber(constructorGuard, hex) {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, BigNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot call constructor directly; use BigNumber.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new (BigNumber)"
|
||||
});
|
||||
}
|
||||
this._hex = hex;
|
||||
this._isBigNumber = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
BigNumber.prototype.fromTwos = function (value) {
|
||||
return toBigNumber(toBN(this).fromTwos(value));
|
||||
};
|
||||
BigNumber.prototype.toTwos = function (value) {
|
||||
return toBigNumber(toBN(this).toTwos(value));
|
||||
};
|
||||
BigNumber.prototype.abs = function () {
|
||||
if (this._hex[0] === "-") {
|
||||
return BigNumber.from(this._hex.substring(1));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
BigNumber.prototype.add = function (other) {
|
||||
return toBigNumber(toBN(this).add(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.sub = function (other) {
|
||||
return toBigNumber(toBN(this).sub(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.div = function (other) {
|
||||
var o = BigNumber.from(other);
|
||||
if (o.isZero()) {
|
||||
throwFault("division by zero", "div");
|
||||
}
|
||||
return toBigNumber(toBN(this).div(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.mul = function (other) {
|
||||
return toBigNumber(toBN(this).mul(toBN(other)));
|
||||
};
|
||||
BigNumber.prototype.mod = function (other) {
|
||||
var value = toBN(other);
|
||||
if (value.isNeg()) {
|
||||
throwFault("cannot modulo negative values", "mod");
|
||||
}
|
||||
return toBigNumber(toBN(this).umod(value));
|
||||
};
|
||||
BigNumber.prototype.pow = function (other) {
|
||||
var value = toBN(other);
|
||||
if (value.isNeg()) {
|
||||
throwFault("cannot raise to negative values", "pow");
|
||||
}
|
||||
return toBigNumber(toBN(this).pow(value));
|
||||
};
|
||||
BigNumber.prototype.and = function (other) {
|
||||
var value = toBN(other);
|
||||
if (this.isNegative() || value.isNeg()) {
|
||||
throwFault("cannot 'and' negative values", "and");
|
||||
}
|
||||
return toBigNumber(toBN(this).and(value));
|
||||
};
|
||||
BigNumber.prototype.or = function (other) {
|
||||
var value = toBN(other);
|
||||
if (this.isNegative() || value.isNeg()) {
|
||||
throwFault("cannot 'or' negative values", "or");
|
||||
}
|
||||
return toBigNumber(toBN(this).or(value));
|
||||
};
|
||||
BigNumber.prototype.xor = function (other) {
|
||||
var value = toBN(other);
|
||||
if (this.isNegative() || value.isNeg()) {
|
||||
throwFault("cannot 'xor' negative values", "xor");
|
||||
}
|
||||
return toBigNumber(toBN(this).xor(value));
|
||||
};
|
||||
BigNumber.prototype.mask = function (value) {
|
||||
if (this.isNegative() || value < 0) {
|
||||
throwFault("cannot mask negative values", "mask");
|
||||
}
|
||||
return toBigNumber(toBN(this).maskn(value));
|
||||
};
|
||||
BigNumber.prototype.shl = function (value) {
|
||||
if (this.isNegative() || value < 0) {
|
||||
throwFault("cannot shift negative values", "shl");
|
||||
}
|
||||
return toBigNumber(toBN(this).shln(value));
|
||||
};
|
||||
BigNumber.prototype.shr = function (value) {
|
||||
if (this.isNegative() || value < 0) {
|
||||
throwFault("cannot shift negative values", "shr");
|
||||
}
|
||||
return toBigNumber(toBN(this).shrn(value));
|
||||
};
|
||||
BigNumber.prototype.eq = function (other) {
|
||||
return toBN(this).eq(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.lt = function (other) {
|
||||
return toBN(this).lt(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.lte = function (other) {
|
||||
return toBN(this).lte(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.gt = function (other) {
|
||||
return toBN(this).gt(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.gte = function (other) {
|
||||
return toBN(this).gte(toBN(other));
|
||||
};
|
||||
BigNumber.prototype.isNegative = function () {
|
||||
return (this._hex[0] === "-");
|
||||
};
|
||||
BigNumber.prototype.isZero = function () {
|
||||
return toBN(this).isZero();
|
||||
};
|
||||
BigNumber.prototype.toNumber = function () {
|
||||
try {
|
||||
return toBN(this).toNumber();
|
||||
}
|
||||
catch (error) {
|
||||
throwFault("overflow", "toNumber", this.toString());
|
||||
}
|
||||
return null;
|
||||
};
|
||||
BigNumber.prototype.toString = function () {
|
||||
// Lots of people expect this, which we do not support, so check
|
||||
if (arguments.length !== 0) {
|
||||
logger.throwError("bigNumber.toString does not accept parameters", logger_1.Logger.errors.UNEXPECTED_ARGUMENT, {});
|
||||
}
|
||||
return toBN(this).toString(10);
|
||||
};
|
||||
BigNumber.prototype.toHexString = function () {
|
||||
return this._hex;
|
||||
};
|
||||
BigNumber.prototype.toJSON = function (key) {
|
||||
return { type: "BigNumber", hex: this.toHexString() };
|
||||
};
|
||||
BigNumber.from = function (value) {
|
||||
if (value instanceof BigNumber) {
|
||||
return value;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
if (value.match(/^-?0x[0-9a-f]+$/i)) {
|
||||
return new BigNumber(_constructorGuard, toHex(value));
|
||||
}
|
||||
if (value.match(/^-?[0-9]+$/)) {
|
||||
return new BigNumber(_constructorGuard, toHex(new bn_js_1.BN(value)));
|
||||
}
|
||||
return logger.throwArgumentError("invalid BigNumber string", "value", value);
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
if (value % 1) {
|
||||
throwFault("underflow", "BigNumber.from", value);
|
||||
}
|
||||
if (value >= MAX_SAFE || value <= -MAX_SAFE) {
|
||||
throwFault("overflow", "BigNumber.from", value);
|
||||
}
|
||||
return BigNumber.from(String(value));
|
||||
}
|
||||
var anyValue = value;
|
||||
if (typeof (anyValue) === "bigint") {
|
||||
return BigNumber.from(anyValue.toString());
|
||||
}
|
||||
if (bytes_1.isBytes(anyValue)) {
|
||||
return BigNumber.from(bytes_1.hexlify(anyValue));
|
||||
}
|
||||
if (anyValue) {
|
||||
// Hexable interface (takes piority)
|
||||
if (anyValue.toHexString) {
|
||||
var hex = anyValue.toHexString();
|
||||
if (typeof (hex) === "string") {
|
||||
return BigNumber.from(hex);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// For now, handle legacy JSON-ified values (goes away in v6)
|
||||
var hex = anyValue._hex;
|
||||
// New-form JSON
|
||||
if (hex == null && anyValue.type === "BigNumber") {
|
||||
hex = anyValue.hex;
|
||||
}
|
||||
if (typeof (hex) === "string") {
|
||||
if (bytes_1.isHexString(hex) || (hex[0] === "-" && bytes_1.isHexString(hex.substring(1)))) {
|
||||
return BigNumber.from(hex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return logger.throwArgumentError("invalid BigNumber value", "value", value);
|
||||
};
|
||||
BigNumber.isBigNumber = function (value) {
|
||||
return !!(value && value._isBigNumber);
|
||||
};
|
||||
return BigNumber;
|
||||
}());
|
||||
exports.BigNumber = BigNumber;
|
||||
// Normalize the hex string
|
||||
function toHex(value) {
|
||||
// For BN, call on the hex string
|
||||
if (typeof (value) !== "string") {
|
||||
return toHex(value.toString(16));
|
||||
}
|
||||
// If negative, prepend the negative sign to the normalized positive value
|
||||
if (value[0] === "-") {
|
||||
// Strip off the negative sign
|
||||
value = value.substring(1);
|
||||
// Cannot have mulitple negative signs (e.g. "--0x04")
|
||||
if (value[0] === "-") {
|
||||
logger.throwArgumentError("invalid hex", "value", value);
|
||||
}
|
||||
// Call toHex on the positive component
|
||||
value = toHex(value);
|
||||
// Do not allow "-0x00"
|
||||
if (value === "0x00") {
|
||||
return value;
|
||||
}
|
||||
// Negate the value
|
||||
return "-" + value;
|
||||
}
|
||||
// Add a "0x" prefix if missing
|
||||
if (value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
// Normalize zero
|
||||
if (value === "0x") {
|
||||
return "0x00";
|
||||
}
|
||||
// Make the string even length
|
||||
if (value.length % 2) {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
// Trim to smallest even-length string
|
||||
while (value.length > 4 && value.substring(0, 4) === "0x00") {
|
||||
value = "0x" + value.substring(4);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function toBigNumber(value) {
|
||||
return BigNumber.from(toHex(value));
|
||||
}
|
||||
function toBN(value) {
|
||||
var hex = BigNumber.from(value).toHexString();
|
||||
if (hex[0] === "-") {
|
||||
return (new bn_js_1.BN("-" + hex.substring(3), 16));
|
||||
}
|
||||
return new bn_js_1.BN(hex.substring(2), 16);
|
||||
}
|
||||
function throwFault(fault, operation, value) {
|
||||
var params = { fault: fault, operation: operation };
|
||||
if (value != null) {
|
||||
params.value = value;
|
||||
}
|
||||
return logger.throwError(fault, logger_1.Logger.errors.NUMERIC_FAULT, params);
|
||||
}
|
||||
//# sourceMappingURL=bignumber.js.map
|
||||
-347
@@ -1,347 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var bignumber_1 = require("./bignumber");
|
||||
var _constructorGuard = {};
|
||||
var Zero = bignumber_1.BigNumber.from(0);
|
||||
var NegativeOne = bignumber_1.BigNumber.from(-1);
|
||||
function throwFault(message, fault, operation, value) {
|
||||
var params = { fault: fault, operation: operation };
|
||||
if (value !== undefined) {
|
||||
params.value = value;
|
||||
}
|
||||
return logger.throwError(message, logger_1.Logger.errors.NUMERIC_FAULT, params);
|
||||
}
|
||||
// Constant to pull zeros from for multipliers
|
||||
var zeros = "0";
|
||||
while (zeros.length < 256) {
|
||||
zeros += zeros;
|
||||
}
|
||||
// Returns a string "1" followed by decimal "0"s
|
||||
function getMultiplier(decimals) {
|
||||
if (typeof (decimals) !== "number") {
|
||||
try {
|
||||
decimals = bignumber_1.BigNumber.from(decimals).toNumber();
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
||||
return ("1" + zeros.substring(0, decimals));
|
||||
}
|
||||
return logger.throwArgumentError("invalid decimal size", "decimals", decimals);
|
||||
}
|
||||
function formatFixed(value, decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
var multiplier = getMultiplier(decimals);
|
||||
// Make sure wei is a big number (convert as necessary)
|
||||
value = bignumber_1.BigNumber.from(value);
|
||||
var negative = value.lt(Zero);
|
||||
if (negative) {
|
||||
value = value.mul(NegativeOne);
|
||||
}
|
||||
var fraction = value.mod(multiplier).toString();
|
||||
while (fraction.length < multiplier.length - 1) {
|
||||
fraction = "0" + fraction;
|
||||
}
|
||||
// Strip training 0
|
||||
fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];
|
||||
var whole = value.div(multiplier).toString();
|
||||
value = whole + "." + fraction;
|
||||
if (negative) {
|
||||
value = "-" + value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.formatFixed = formatFixed;
|
||||
function parseFixed(value, decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
var multiplier = getMultiplier(decimals);
|
||||
if (typeof (value) !== "string" || !value.match(/^-?[0-9.,]+$/)) {
|
||||
logger.throwArgumentError("invalid decimal value", "value", value);
|
||||
}
|
||||
if (multiplier.length - 1 === 0) {
|
||||
return bignumber_1.BigNumber.from(value);
|
||||
}
|
||||
// Is it negative?
|
||||
var negative = (value.substring(0, 1) === "-");
|
||||
if (negative) {
|
||||
value = value.substring(1);
|
||||
}
|
||||
if (value === ".") {
|
||||
logger.throwArgumentError("missing value", "value", value);
|
||||
}
|
||||
// Split it into a whole and fractional part
|
||||
var comps = value.split(".");
|
||||
if (comps.length > 2) {
|
||||
logger.throwArgumentError("too many decimal points", "value", value);
|
||||
}
|
||||
var whole = comps[0], fraction = comps[1];
|
||||
if (!whole) {
|
||||
whole = "0";
|
||||
}
|
||||
if (!fraction) {
|
||||
fraction = "0";
|
||||
}
|
||||
// Prevent underflow
|
||||
if (fraction.length > multiplier.length - 1) {
|
||||
throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
|
||||
}
|
||||
// Fully pad the string with zeros to get to wei
|
||||
while (fraction.length < multiplier.length - 1) {
|
||||
fraction += "0";
|
||||
}
|
||||
var wholeValue = bignumber_1.BigNumber.from(whole);
|
||||
var fractionValue = bignumber_1.BigNumber.from(fraction);
|
||||
var wei = (wholeValue.mul(multiplier)).add(fractionValue);
|
||||
if (negative) {
|
||||
wei = wei.mul(NegativeOne);
|
||||
}
|
||||
return wei;
|
||||
}
|
||||
exports.parseFixed = parseFixed;
|
||||
var FixedFormat = /** @class */ (function () {
|
||||
function FixedFormat(constructorGuard, signed, width, decimals) {
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot use FixedFormat constructor; use FixedFormat.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new FixedFormat"
|
||||
});
|
||||
}
|
||||
this.signed = signed;
|
||||
this.width = width;
|
||||
this.decimals = decimals;
|
||||
this.name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals);
|
||||
this._multiplier = getMultiplier(decimals);
|
||||
Object.freeze(this);
|
||||
}
|
||||
FixedFormat.from = function (value) {
|
||||
if (value instanceof FixedFormat) {
|
||||
return value;
|
||||
}
|
||||
var signed = true;
|
||||
var width = 128;
|
||||
var decimals = 18;
|
||||
if (typeof (value) === "string") {
|
||||
if (value === "fixed") {
|
||||
// defaults...
|
||||
}
|
||||
else if (value === "ufixed") {
|
||||
signed = false;
|
||||
}
|
||||
else if (value != null) {
|
||||
var match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
||||
if (!match) {
|
||||
logger.throwArgumentError("invalid fixed format", "format", value);
|
||||
}
|
||||
signed = (match[1] !== "u");
|
||||
width = parseInt(match[2]);
|
||||
decimals = parseInt(match[3]);
|
||||
}
|
||||
}
|
||||
else if (value) {
|
||||
var check = function (key, type, defaultValue) {
|
||||
if (value[key] == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (typeof (value[key]) !== type) {
|
||||
logger.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
||||
}
|
||||
return value[key];
|
||||
};
|
||||
signed = check("signed", "boolean", signed);
|
||||
width = check("width", "number", width);
|
||||
decimals = check("decimals", "number", decimals);
|
||||
}
|
||||
if (width % 8) {
|
||||
logger.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
||||
}
|
||||
if (decimals > 80) {
|
||||
logger.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
||||
}
|
||||
return new FixedFormat(_constructorGuard, signed, width, decimals);
|
||||
};
|
||||
return FixedFormat;
|
||||
}());
|
||||
exports.FixedFormat = FixedFormat;
|
||||
var FixedNumber = /** @class */ (function () {
|
||||
function FixedNumber(constructorGuard, hex, value, format) {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkNew(_newTarget, FixedNumber);
|
||||
if (constructorGuard !== _constructorGuard) {
|
||||
logger.throwError("cannot use FixedNumber constructor; use FixedNumber.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
operation: "new FixedFormat"
|
||||
});
|
||||
}
|
||||
this.format = format;
|
||||
this._hex = hex;
|
||||
this._value = value;
|
||||
this._isFixedNumber = true;
|
||||
Object.freeze(this);
|
||||
}
|
||||
FixedNumber.prototype._checkFormat = function (other) {
|
||||
if (this.format.name !== other.format.name) {
|
||||
logger.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
||||
}
|
||||
};
|
||||
FixedNumber.prototype.addUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.subUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.mulUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.divUnsafe = function (other) {
|
||||
this._checkFormat(other);
|
||||
var a = parseFixed(this._value, this.format.decimals);
|
||||
var b = parseFixed(other._value, other.format.decimals);
|
||||
return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);
|
||||
};
|
||||
FixedNumber.prototype.floor = function () {
|
||||
var comps = this.toString().split(".");
|
||||
var result = FixedNumber.from(comps[0], this.format);
|
||||
var hasFraction = !comps[1].match(/^(0*)$/);
|
||||
if (this.isNegative() && hasFraction) {
|
||||
result = result.subUnsafe(ONE);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
FixedNumber.prototype.ceiling = function () {
|
||||
var comps = this.toString().split(".");
|
||||
var result = FixedNumber.from(comps[0], this.format);
|
||||
var hasFraction = !comps[1].match(/^(0*)$/);
|
||||
if (!this.isNegative() && hasFraction) {
|
||||
result = result.addUnsafe(ONE);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
// @TODO: Support other rounding algorithms
|
||||
FixedNumber.prototype.round = function (decimals) {
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
// If we are already in range, we're done
|
||||
var comps = this.toString().split(".");
|
||||
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
||||
logger.throwArgumentError("invalid decimal count", "decimals", decimals);
|
||||
}
|
||||
if (comps[1].length <= decimals) {
|
||||
return this;
|
||||
}
|
||||
var factor = FixedNumber.from("1" + zeros.substring(0, decimals));
|
||||
return this.mulUnsafe(factor).addUnsafe(BUMP).floor().divUnsafe(factor);
|
||||
};
|
||||
FixedNumber.prototype.isZero = function () {
|
||||
return (this._value === "0.0");
|
||||
};
|
||||
FixedNumber.prototype.isNegative = function () {
|
||||
return (this._value[0] === "-");
|
||||
};
|
||||
FixedNumber.prototype.toString = function () { return this._value; };
|
||||
FixedNumber.prototype.toHexString = function (width) {
|
||||
if (width == null) {
|
||||
return this._hex;
|
||||
}
|
||||
if (width % 8) {
|
||||
logger.throwArgumentError("invalid byte width", "width", width);
|
||||
}
|
||||
var hex = bignumber_1.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
||||
return bytes_1.hexZeroPad(hex, width / 8);
|
||||
};
|
||||
FixedNumber.prototype.toUnsafeFloat = function () { return parseFloat(this.toString()); };
|
||||
FixedNumber.prototype.toFormat = function (format) {
|
||||
return FixedNumber.fromString(this._value, format);
|
||||
};
|
||||
FixedNumber.fromValue = function (value, decimals, format) {
|
||||
// If decimals looks more like a format, and there is no format, shift the parameters
|
||||
if (format == null && decimals != null && !bignumber_1.isBigNumberish(decimals)) {
|
||||
format = decimals;
|
||||
decimals = null;
|
||||
}
|
||||
if (decimals == null) {
|
||||
decimals = 0;
|
||||
}
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));
|
||||
};
|
||||
FixedNumber.fromString = function (value, format) {
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
var fixedFormat = FixedFormat.from(format);
|
||||
var numeric = parseFixed(value, fixedFormat.decimals);
|
||||
if (!fixedFormat.signed && numeric.lt(Zero)) {
|
||||
throwFault("unsigned value cannot be negative", "overflow", "value", value);
|
||||
}
|
||||
var hex = null;
|
||||
if (fixedFormat.signed) {
|
||||
hex = numeric.toTwos(fixedFormat.width).toHexString();
|
||||
}
|
||||
else {
|
||||
hex = numeric.toHexString();
|
||||
hex = bytes_1.hexZeroPad(hex, fixedFormat.width / 8);
|
||||
}
|
||||
var decimal = formatFixed(numeric, fixedFormat.decimals);
|
||||
return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
|
||||
};
|
||||
FixedNumber.fromBytes = function (value, format) {
|
||||
if (format == null) {
|
||||
format = "fixed";
|
||||
}
|
||||
var fixedFormat = FixedFormat.from(format);
|
||||
if (bytes_1.arrayify(value).length > fixedFormat.width / 8) {
|
||||
throw new Error("overflow");
|
||||
}
|
||||
var numeric = bignumber_1.BigNumber.from(value);
|
||||
if (fixedFormat.signed) {
|
||||
numeric = numeric.fromTwos(fixedFormat.width);
|
||||
}
|
||||
var hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();
|
||||
var decimal = formatFixed(numeric, fixedFormat.decimals);
|
||||
return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
|
||||
};
|
||||
FixedNumber.from = function (value, format) {
|
||||
if (typeof (value) === "string") {
|
||||
return FixedNumber.fromString(value, format);
|
||||
}
|
||||
if (bytes_1.isBytes(value)) {
|
||||
return FixedNumber.fromBytes(value, format);
|
||||
}
|
||||
try {
|
||||
return FixedNumber.fromValue(value, 0, format);
|
||||
}
|
||||
catch (error) {
|
||||
// Allow NUMERIC_FAULT to bubble up
|
||||
if (error.code !== logger_1.Logger.errors.INVALID_ARGUMENT) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return logger.throwArgumentError("invalid FixedNumber value", "value", value);
|
||||
};
|
||||
FixedNumber.isFixedNumber = function (value) {
|
||||
return !!(value && value._isFixedNumber);
|
||||
};
|
||||
return FixedNumber;
|
||||
}());
|
||||
exports.FixedNumber = FixedNumber;
|
||||
var ONE = FixedNumber.from(1);
|
||||
var BUMP = FixedNumber.from("0.5");
|
||||
//# sourceMappingURL=fixednumber.js.map
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bignumber_1 = require("./bignumber");
|
||||
exports.BigNumber = bignumber_1.BigNumber;
|
||||
var fixednumber_1 = require("./fixednumber");
|
||||
exports.formatFixed = fixednumber_1.formatFixed;
|
||||
exports.FixedFormat = fixednumber_1.FixedFormat;
|
||||
exports.FixedNumber = fixednumber_1.FixedNumber;
|
||||
exports.parseFixed = fixednumber_1.parseFixed;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
{
|
||||
"_from": "@ethersproject/bignumber@^5.0.7",
|
||||
"_id": "@ethersproject/bignumber@5.0.8",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-KXFVAFKS1jdTXYN8BE5Oj+ZfPMh28iRdFeNGBVT6cUFdtiPVqeXqc0ggvBqA3A1VoFFGgM7oAeaagA393aORHA==",
|
||||
"_location": "/@ethersproject/bignumber",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@ethersproject/bignumber@^5.0.7",
|
||||
"name": "@ethersproject/bignumber",
|
||||
"escapedName": "@ethersproject%2fbignumber",
|
||||
"scope": "@ethersproject",
|
||||
"rawSpec": "^5.0.7",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.7"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@ethersproject/abi",
|
||||
"/@ethersproject/abstract-provider",
|
||||
"/@ethersproject/abstract-signer",
|
||||
"/@ethersproject/address",
|
||||
"/@ethersproject/constants",
|
||||
"/@ethersproject/hash",
|
||||
"/@ethersproject/transactions"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.8.tgz",
|
||||
"_shasum": "cee33bd8eb0266176def0d371b45274b1d2c4ec0",
|
||||
"_spec": "@ethersproject/bignumber@^5.0.7",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\@ethersproject\\transactions",
|
||||
"author": {
|
||||
"name": "Richard Moore",
|
||||
"email": "me@ricmoo.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ethers-io/ethers.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@ethersproject/bytes": "^5.0.4",
|
||||
"@ethersproject/logger": "^5.0.5",
|
||||
"bn.js": "^4.4.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "BigNumber library used in ethers.js.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"homepage": "https://github.com/ethers-io/ethers.js#readme",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"bignumber",
|
||||
"bn"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/bignumber",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x13de0d9c0138d0d056ed658b8f8744fab45fcdf4b52dcd9456bfd7285a4288ce",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.8"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "bytes/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-380
@@ -1,380 +0,0 @@
|
||||
"use strict";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
///////////////////////////////
|
||||
function isHexable(value) {
|
||||
return !!(value.toHexString);
|
||||
}
|
||||
function addSlice(array) {
|
||||
if (array.slice) {
|
||||
return array;
|
||||
}
|
||||
array.slice = function () {
|
||||
const args = Array.prototype.slice.call(arguments);
|
||||
return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));
|
||||
};
|
||||
return array;
|
||||
}
|
||||
export function isBytesLike(value) {
|
||||
return ((isHexString(value) && !(value.length % 2)) || isBytes(value));
|
||||
}
|
||||
export function isBytes(value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (value.constructor === Uint8Array) {
|
||||
return true;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
return false;
|
||||
}
|
||||
if (value.length == null) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
const v = value[i];
|
||||
if (v < 0 || v >= 256 || (v % 1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
export function arrayify(value, options) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
logger.checkSafeUint53(value, "invalid arrayify value");
|
||||
const result = [];
|
||||
while (value) {
|
||||
result.unshift(value & 0xff);
|
||||
value = parseInt(String(value / 256));
|
||||
}
|
||||
if (result.length === 0) {
|
||||
result.push(0);
|
||||
}
|
||||
return addSlice(new Uint8Array(result));
|
||||
}
|
||||
if (options.allowMissingPrefix && typeof (value) === "string" && value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
if (isHexable(value)) {
|
||||
value = value.toHexString();
|
||||
}
|
||||
if (isHexString(value)) {
|
||||
let hex = value.substring(2);
|
||||
if (hex.length % 2) {
|
||||
if (options.hexPad === "left") {
|
||||
hex = "0x0" + hex.substring(2);
|
||||
}
|
||||
else if (options.hexPad === "right") {
|
||||
hex += "0";
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("hex data is odd-length", "value", value);
|
||||
}
|
||||
}
|
||||
const result = [];
|
||||
for (let i = 0; i < hex.length; i += 2) {
|
||||
result.push(parseInt(hex.substring(i, i + 2), 16));
|
||||
}
|
||||
return addSlice(new Uint8Array(result));
|
||||
}
|
||||
if (isBytes(value)) {
|
||||
return addSlice(new Uint8Array(value));
|
||||
}
|
||||
return logger.throwArgumentError("invalid arrayify value", "value", value);
|
||||
}
|
||||
export function concat(items) {
|
||||
const objects = items.map(item => arrayify(item));
|
||||
const length = objects.reduce((accum, item) => (accum + item.length), 0);
|
||||
const result = new Uint8Array(length);
|
||||
objects.reduce((offset, object) => {
|
||||
result.set(object, offset);
|
||||
return offset + object.length;
|
||||
}, 0);
|
||||
return addSlice(result);
|
||||
}
|
||||
export function stripZeros(value) {
|
||||
let result = arrayify(value);
|
||||
if (result.length === 0) {
|
||||
return result;
|
||||
}
|
||||
// Find the first non-zero entry
|
||||
let start = 0;
|
||||
while (start < result.length && result[start] === 0) {
|
||||
start++;
|
||||
}
|
||||
// If we started with zeros, strip them
|
||||
if (start) {
|
||||
result = result.slice(start);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function zeroPad(value, length) {
|
||||
value = arrayify(value);
|
||||
if (value.length > length) {
|
||||
logger.throwArgumentError("value out of range", "value", arguments[0]);
|
||||
}
|
||||
const result = new Uint8Array(length);
|
||||
result.set(value, length - value.length);
|
||||
return addSlice(result);
|
||||
}
|
||||
export function isHexString(value, length) {
|
||||
if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
||||
return false;
|
||||
}
|
||||
if (length && value.length !== 2 + 2 * length) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const HexCharacters = "0123456789abcdef";
|
||||
export function hexlify(value, options) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
logger.checkSafeUint53(value, "invalid hexlify value");
|
||||
let hex = "";
|
||||
while (value) {
|
||||
hex = HexCharacters[value & 0x0f] + hex;
|
||||
value = Math.floor(value / 16);
|
||||
}
|
||||
if (hex.length) {
|
||||
if (hex.length % 2) {
|
||||
hex = "0" + hex;
|
||||
}
|
||||
return "0x" + hex;
|
||||
}
|
||||
return "0x00";
|
||||
}
|
||||
if (options.allowMissingPrefix && typeof (value) === "string" && value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
if (isHexable(value)) {
|
||||
return value.toHexString();
|
||||
}
|
||||
if (isHexString(value)) {
|
||||
if (value.length % 2) {
|
||||
if (options.hexPad === "left") {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
else if (options.hexPad === "right") {
|
||||
value += "0";
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("hex data is odd-length", "value", value);
|
||||
}
|
||||
}
|
||||
return value.toLowerCase();
|
||||
}
|
||||
if (isBytes(value)) {
|
||||
let result = "0x";
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
let v = value[i];
|
||||
result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return logger.throwArgumentError("invalid hexlify value", "value", value);
|
||||
}
|
||||
/*
|
||||
function unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {
|
||||
if (typeof(value) === "string" && value.length % 2 && value.substring(0, 2) === "0x") {
|
||||
return "0x0" + value.substring(2);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
*/
|
||||
export function hexDataLength(data) {
|
||||
if (typeof (data) !== "string") {
|
||||
data = hexlify(data);
|
||||
}
|
||||
else if (!isHexString(data) || (data.length % 2)) {
|
||||
return null;
|
||||
}
|
||||
return (data.length - 2) / 2;
|
||||
}
|
||||
export function hexDataSlice(data, offset, endOffset) {
|
||||
if (typeof (data) !== "string") {
|
||||
data = hexlify(data);
|
||||
}
|
||||
else if (!isHexString(data) || (data.length % 2)) {
|
||||
logger.throwArgumentError("invalid hexData", "value", data);
|
||||
}
|
||||
offset = 2 + 2 * offset;
|
||||
if (endOffset != null) {
|
||||
return "0x" + data.substring(offset, 2 + 2 * endOffset);
|
||||
}
|
||||
return "0x" + data.substring(offset);
|
||||
}
|
||||
export function hexConcat(items) {
|
||||
let result = "0x";
|
||||
items.forEach((item) => {
|
||||
result += hexlify(item).substring(2);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
export function hexValue(value) {
|
||||
const trimmed = hexStripZeros(hexlify(value, { hexPad: "left" }));
|
||||
if (trimmed === "0x") {
|
||||
return "0x0";
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
export function hexStripZeros(value) {
|
||||
if (typeof (value) !== "string") {
|
||||
value = hexlify(value);
|
||||
}
|
||||
if (!isHexString(value)) {
|
||||
logger.throwArgumentError("invalid hex string", "value", value);
|
||||
}
|
||||
value = value.substring(2);
|
||||
let offset = 0;
|
||||
while (offset < value.length && value[offset] === "0") {
|
||||
offset++;
|
||||
}
|
||||
return "0x" + value.substring(offset);
|
||||
}
|
||||
export function hexZeroPad(value, length) {
|
||||
if (typeof (value) !== "string") {
|
||||
value = hexlify(value);
|
||||
}
|
||||
else if (!isHexString(value)) {
|
||||
logger.throwArgumentError("invalid hex string", "value", value);
|
||||
}
|
||||
if (value.length > 2 * length + 2) {
|
||||
logger.throwArgumentError("value out of range", "value", arguments[1]);
|
||||
}
|
||||
while (value.length < 2 * length + 2) {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function splitSignature(signature) {
|
||||
const result = {
|
||||
r: "0x",
|
||||
s: "0x",
|
||||
_vs: "0x",
|
||||
recoveryParam: 0,
|
||||
v: 0
|
||||
};
|
||||
if (isBytesLike(signature)) {
|
||||
const bytes = arrayify(signature);
|
||||
if (bytes.length !== 65) {
|
||||
logger.throwArgumentError("invalid signature string; must be 65 bytes", "signature", signature);
|
||||
}
|
||||
// Get the r, s and v
|
||||
result.r = hexlify(bytes.slice(0, 32));
|
||||
result.s = hexlify(bytes.slice(32, 64));
|
||||
result.v = bytes[64];
|
||||
// Allow a recid to be used as the v
|
||||
if (result.v < 27) {
|
||||
if (result.v === 0 || result.v === 1) {
|
||||
result.v += 27;
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("signature invalid v byte", "signature", signature);
|
||||
}
|
||||
}
|
||||
// Compute recoveryParam from v
|
||||
result.recoveryParam = 1 - (result.v % 2);
|
||||
// Compute _vs from recoveryParam and s
|
||||
if (result.recoveryParam) {
|
||||
bytes[32] |= 0x80;
|
||||
}
|
||||
result._vs = hexlify(bytes.slice(32, 64));
|
||||
}
|
||||
else {
|
||||
result.r = signature.r;
|
||||
result.s = signature.s;
|
||||
result.v = signature.v;
|
||||
result.recoveryParam = signature.recoveryParam;
|
||||
result._vs = signature._vs;
|
||||
// If the _vs is available, use it to populate missing s, v and recoveryParam
|
||||
// and verify non-missing s, v and recoveryParam
|
||||
if (result._vs != null) {
|
||||
const vs = zeroPad(arrayify(result._vs), 32);
|
||||
result._vs = hexlify(vs);
|
||||
// Set or check the recid
|
||||
const recoveryParam = ((vs[0] >= 128) ? 1 : 0);
|
||||
if (result.recoveryParam == null) {
|
||||
result.recoveryParam = recoveryParam;
|
||||
}
|
||||
else if (result.recoveryParam !== recoveryParam) {
|
||||
logger.throwArgumentError("signature recoveryParam mismatch _vs", "signature", signature);
|
||||
}
|
||||
// Set or check the s
|
||||
vs[0] &= 0x7f;
|
||||
const s = hexlify(vs);
|
||||
if (result.s == null) {
|
||||
result.s = s;
|
||||
}
|
||||
else if (result.s !== s) {
|
||||
logger.throwArgumentError("signature v mismatch _vs", "signature", signature);
|
||||
}
|
||||
}
|
||||
// Use recid and v to populate each other
|
||||
if (result.recoveryParam == null) {
|
||||
if (result.v == null) {
|
||||
logger.throwArgumentError("signature missing v and recoveryParam", "signature", signature);
|
||||
}
|
||||
else {
|
||||
result.recoveryParam = 1 - (result.v % 2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (result.v == null) {
|
||||
result.v = 27 + result.recoveryParam;
|
||||
}
|
||||
else if (result.recoveryParam !== (1 - (result.v % 2))) {
|
||||
logger.throwArgumentError("signature recoveryParam mismatch v", "signature", signature);
|
||||
}
|
||||
}
|
||||
if (result.r == null || !isHexString(result.r)) {
|
||||
logger.throwArgumentError("signature missing or invalid r", "signature", signature);
|
||||
}
|
||||
else {
|
||||
result.r = hexZeroPad(result.r, 32);
|
||||
}
|
||||
if (result.s == null || !isHexString(result.s)) {
|
||||
logger.throwArgumentError("signature missing or invalid s", "signature", signature);
|
||||
}
|
||||
else {
|
||||
result.s = hexZeroPad(result.s, 32);
|
||||
}
|
||||
const vs = arrayify(result.s);
|
||||
if (vs[0] >= 128) {
|
||||
logger.throwArgumentError("signature s out of range", "signature", signature);
|
||||
}
|
||||
if (result.recoveryParam) {
|
||||
vs[0] |= 0x80;
|
||||
}
|
||||
const _vs = hexlify(vs);
|
||||
if (result._vs) {
|
||||
if (!isHexString(result._vs)) {
|
||||
logger.throwArgumentError("signature invalid _vs", "signature", signature);
|
||||
}
|
||||
result._vs = hexZeroPad(result._vs, 32);
|
||||
}
|
||||
// Set or check the _vs
|
||||
if (result._vs == null) {
|
||||
result._vs = _vs;
|
||||
}
|
||||
else if (result._vs !== _vs) {
|
||||
logger.throwArgumentError("signature _vs mismatch v and s", "signature", signature);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function joinSignature(signature) {
|
||||
signature = splitSignature(signature);
|
||||
return hexlify(concat([
|
||||
signature.r,
|
||||
signature.s,
|
||||
(signature.recoveryParam ? "0x1c" : "0x1b")
|
||||
]));
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "bytes/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-397
@@ -1,397 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
///////////////////////////////
|
||||
function isHexable(value) {
|
||||
return !!(value.toHexString);
|
||||
}
|
||||
function addSlice(array) {
|
||||
if (array.slice) {
|
||||
return array;
|
||||
}
|
||||
array.slice = function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));
|
||||
};
|
||||
return array;
|
||||
}
|
||||
function isBytesLike(value) {
|
||||
return ((isHexString(value) && !(value.length % 2)) || isBytes(value));
|
||||
}
|
||||
exports.isBytesLike = isBytesLike;
|
||||
function isBytes(value) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (value.constructor === Uint8Array) {
|
||||
return true;
|
||||
}
|
||||
if (typeof (value) === "string") {
|
||||
return false;
|
||||
}
|
||||
if (value.length == null) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
var v = value[i];
|
||||
if (v < 0 || v >= 256 || (v % 1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.isBytes = isBytes;
|
||||
function arrayify(value, options) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
logger.checkSafeUint53(value, "invalid arrayify value");
|
||||
var result = [];
|
||||
while (value) {
|
||||
result.unshift(value & 0xff);
|
||||
value = parseInt(String(value / 256));
|
||||
}
|
||||
if (result.length === 0) {
|
||||
result.push(0);
|
||||
}
|
||||
return addSlice(new Uint8Array(result));
|
||||
}
|
||||
if (options.allowMissingPrefix && typeof (value) === "string" && value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
if (isHexable(value)) {
|
||||
value = value.toHexString();
|
||||
}
|
||||
if (isHexString(value)) {
|
||||
var hex = value.substring(2);
|
||||
if (hex.length % 2) {
|
||||
if (options.hexPad === "left") {
|
||||
hex = "0x0" + hex.substring(2);
|
||||
}
|
||||
else if (options.hexPad === "right") {
|
||||
hex += "0";
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("hex data is odd-length", "value", value);
|
||||
}
|
||||
}
|
||||
var result = [];
|
||||
for (var i = 0; i < hex.length; i += 2) {
|
||||
result.push(parseInt(hex.substring(i, i + 2), 16));
|
||||
}
|
||||
return addSlice(new Uint8Array(result));
|
||||
}
|
||||
if (isBytes(value)) {
|
||||
return addSlice(new Uint8Array(value));
|
||||
}
|
||||
return logger.throwArgumentError("invalid arrayify value", "value", value);
|
||||
}
|
||||
exports.arrayify = arrayify;
|
||||
function concat(items) {
|
||||
var objects = items.map(function (item) { return arrayify(item); });
|
||||
var length = objects.reduce(function (accum, item) { return (accum + item.length); }, 0);
|
||||
var result = new Uint8Array(length);
|
||||
objects.reduce(function (offset, object) {
|
||||
result.set(object, offset);
|
||||
return offset + object.length;
|
||||
}, 0);
|
||||
return addSlice(result);
|
||||
}
|
||||
exports.concat = concat;
|
||||
function stripZeros(value) {
|
||||
var result = arrayify(value);
|
||||
if (result.length === 0) {
|
||||
return result;
|
||||
}
|
||||
// Find the first non-zero entry
|
||||
var start = 0;
|
||||
while (start < result.length && result[start] === 0) {
|
||||
start++;
|
||||
}
|
||||
// If we started with zeros, strip them
|
||||
if (start) {
|
||||
result = result.slice(start);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.stripZeros = stripZeros;
|
||||
function zeroPad(value, length) {
|
||||
value = arrayify(value);
|
||||
if (value.length > length) {
|
||||
logger.throwArgumentError("value out of range", "value", arguments[0]);
|
||||
}
|
||||
var result = new Uint8Array(length);
|
||||
result.set(value, length - value.length);
|
||||
return addSlice(result);
|
||||
}
|
||||
exports.zeroPad = zeroPad;
|
||||
function isHexString(value, length) {
|
||||
if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
||||
return false;
|
||||
}
|
||||
if (length && value.length !== 2 + 2 * length) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.isHexString = isHexString;
|
||||
var HexCharacters = "0123456789abcdef";
|
||||
function hexlify(value, options) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
if (typeof (value) === "number") {
|
||||
logger.checkSafeUint53(value, "invalid hexlify value");
|
||||
var hex = "";
|
||||
while (value) {
|
||||
hex = HexCharacters[value & 0x0f] + hex;
|
||||
value = Math.floor(value / 16);
|
||||
}
|
||||
if (hex.length) {
|
||||
if (hex.length % 2) {
|
||||
hex = "0" + hex;
|
||||
}
|
||||
return "0x" + hex;
|
||||
}
|
||||
return "0x00";
|
||||
}
|
||||
if (options.allowMissingPrefix && typeof (value) === "string" && value.substring(0, 2) !== "0x") {
|
||||
value = "0x" + value;
|
||||
}
|
||||
if (isHexable(value)) {
|
||||
return value.toHexString();
|
||||
}
|
||||
if (isHexString(value)) {
|
||||
if (value.length % 2) {
|
||||
if (options.hexPad === "left") {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
else if (options.hexPad === "right") {
|
||||
value += "0";
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("hex data is odd-length", "value", value);
|
||||
}
|
||||
}
|
||||
return value.toLowerCase();
|
||||
}
|
||||
if (isBytes(value)) {
|
||||
var result = "0x";
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
var v = value[i];
|
||||
result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return logger.throwArgumentError("invalid hexlify value", "value", value);
|
||||
}
|
||||
exports.hexlify = hexlify;
|
||||
/*
|
||||
function unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {
|
||||
if (typeof(value) === "string" && value.length % 2 && value.substring(0, 2) === "0x") {
|
||||
return "0x0" + value.substring(2);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
*/
|
||||
function hexDataLength(data) {
|
||||
if (typeof (data) !== "string") {
|
||||
data = hexlify(data);
|
||||
}
|
||||
else if (!isHexString(data) || (data.length % 2)) {
|
||||
return null;
|
||||
}
|
||||
return (data.length - 2) / 2;
|
||||
}
|
||||
exports.hexDataLength = hexDataLength;
|
||||
function hexDataSlice(data, offset, endOffset) {
|
||||
if (typeof (data) !== "string") {
|
||||
data = hexlify(data);
|
||||
}
|
||||
else if (!isHexString(data) || (data.length % 2)) {
|
||||
logger.throwArgumentError("invalid hexData", "value", data);
|
||||
}
|
||||
offset = 2 + 2 * offset;
|
||||
if (endOffset != null) {
|
||||
return "0x" + data.substring(offset, 2 + 2 * endOffset);
|
||||
}
|
||||
return "0x" + data.substring(offset);
|
||||
}
|
||||
exports.hexDataSlice = hexDataSlice;
|
||||
function hexConcat(items) {
|
||||
var result = "0x";
|
||||
items.forEach(function (item) {
|
||||
result += hexlify(item).substring(2);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
exports.hexConcat = hexConcat;
|
||||
function hexValue(value) {
|
||||
var trimmed = hexStripZeros(hexlify(value, { hexPad: "left" }));
|
||||
if (trimmed === "0x") {
|
||||
return "0x0";
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
exports.hexValue = hexValue;
|
||||
function hexStripZeros(value) {
|
||||
if (typeof (value) !== "string") {
|
||||
value = hexlify(value);
|
||||
}
|
||||
if (!isHexString(value)) {
|
||||
logger.throwArgumentError("invalid hex string", "value", value);
|
||||
}
|
||||
value = value.substring(2);
|
||||
var offset = 0;
|
||||
while (offset < value.length && value[offset] === "0") {
|
||||
offset++;
|
||||
}
|
||||
return "0x" + value.substring(offset);
|
||||
}
|
||||
exports.hexStripZeros = hexStripZeros;
|
||||
function hexZeroPad(value, length) {
|
||||
if (typeof (value) !== "string") {
|
||||
value = hexlify(value);
|
||||
}
|
||||
else if (!isHexString(value)) {
|
||||
logger.throwArgumentError("invalid hex string", "value", value);
|
||||
}
|
||||
if (value.length > 2 * length + 2) {
|
||||
logger.throwArgumentError("value out of range", "value", arguments[1]);
|
||||
}
|
||||
while (value.length < 2 * length + 2) {
|
||||
value = "0x0" + value.substring(2);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.hexZeroPad = hexZeroPad;
|
||||
function splitSignature(signature) {
|
||||
var result = {
|
||||
r: "0x",
|
||||
s: "0x",
|
||||
_vs: "0x",
|
||||
recoveryParam: 0,
|
||||
v: 0
|
||||
};
|
||||
if (isBytesLike(signature)) {
|
||||
var bytes = arrayify(signature);
|
||||
if (bytes.length !== 65) {
|
||||
logger.throwArgumentError("invalid signature string; must be 65 bytes", "signature", signature);
|
||||
}
|
||||
// Get the r, s and v
|
||||
result.r = hexlify(bytes.slice(0, 32));
|
||||
result.s = hexlify(bytes.slice(32, 64));
|
||||
result.v = bytes[64];
|
||||
// Allow a recid to be used as the v
|
||||
if (result.v < 27) {
|
||||
if (result.v === 0 || result.v === 1) {
|
||||
result.v += 27;
|
||||
}
|
||||
else {
|
||||
logger.throwArgumentError("signature invalid v byte", "signature", signature);
|
||||
}
|
||||
}
|
||||
// Compute recoveryParam from v
|
||||
result.recoveryParam = 1 - (result.v % 2);
|
||||
// Compute _vs from recoveryParam and s
|
||||
if (result.recoveryParam) {
|
||||
bytes[32] |= 0x80;
|
||||
}
|
||||
result._vs = hexlify(bytes.slice(32, 64));
|
||||
}
|
||||
else {
|
||||
result.r = signature.r;
|
||||
result.s = signature.s;
|
||||
result.v = signature.v;
|
||||
result.recoveryParam = signature.recoveryParam;
|
||||
result._vs = signature._vs;
|
||||
// If the _vs is available, use it to populate missing s, v and recoveryParam
|
||||
// and verify non-missing s, v and recoveryParam
|
||||
if (result._vs != null) {
|
||||
var vs_1 = zeroPad(arrayify(result._vs), 32);
|
||||
result._vs = hexlify(vs_1);
|
||||
// Set or check the recid
|
||||
var recoveryParam = ((vs_1[0] >= 128) ? 1 : 0);
|
||||
if (result.recoveryParam == null) {
|
||||
result.recoveryParam = recoveryParam;
|
||||
}
|
||||
else if (result.recoveryParam !== recoveryParam) {
|
||||
logger.throwArgumentError("signature recoveryParam mismatch _vs", "signature", signature);
|
||||
}
|
||||
// Set or check the s
|
||||
vs_1[0] &= 0x7f;
|
||||
var s = hexlify(vs_1);
|
||||
if (result.s == null) {
|
||||
result.s = s;
|
||||
}
|
||||
else if (result.s !== s) {
|
||||
logger.throwArgumentError("signature v mismatch _vs", "signature", signature);
|
||||
}
|
||||
}
|
||||
// Use recid and v to populate each other
|
||||
if (result.recoveryParam == null) {
|
||||
if (result.v == null) {
|
||||
logger.throwArgumentError("signature missing v and recoveryParam", "signature", signature);
|
||||
}
|
||||
else {
|
||||
result.recoveryParam = 1 - (result.v % 2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (result.v == null) {
|
||||
result.v = 27 + result.recoveryParam;
|
||||
}
|
||||
else if (result.recoveryParam !== (1 - (result.v % 2))) {
|
||||
logger.throwArgumentError("signature recoveryParam mismatch v", "signature", signature);
|
||||
}
|
||||
}
|
||||
if (result.r == null || !isHexString(result.r)) {
|
||||
logger.throwArgumentError("signature missing or invalid r", "signature", signature);
|
||||
}
|
||||
else {
|
||||
result.r = hexZeroPad(result.r, 32);
|
||||
}
|
||||
if (result.s == null || !isHexString(result.s)) {
|
||||
logger.throwArgumentError("signature missing or invalid s", "signature", signature);
|
||||
}
|
||||
else {
|
||||
result.s = hexZeroPad(result.s, 32);
|
||||
}
|
||||
var vs = arrayify(result.s);
|
||||
if (vs[0] >= 128) {
|
||||
logger.throwArgumentError("signature s out of range", "signature", signature);
|
||||
}
|
||||
if (result.recoveryParam) {
|
||||
vs[0] |= 0x80;
|
||||
}
|
||||
var _vs = hexlify(vs);
|
||||
if (result._vs) {
|
||||
if (!isHexString(result._vs)) {
|
||||
logger.throwArgumentError("signature invalid _vs", "signature", signature);
|
||||
}
|
||||
result._vs = hexZeroPad(result._vs, 32);
|
||||
}
|
||||
// Set or check the _vs
|
||||
if (result._vs == null) {
|
||||
result._vs = _vs;
|
||||
}
|
||||
else if (result._vs !== _vs) {
|
||||
logger.throwArgumentError("signature _vs mismatch v and s", "signature", signature);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.splitSignature = splitSignature;
|
||||
function joinSignature(signature) {
|
||||
signature = splitSignature(signature);
|
||||
return hexlify(concat([
|
||||
signature.r,
|
||||
signature.s,
|
||||
(signature.recoveryParam ? "0x1c" : "0x1b")
|
||||
]));
|
||||
}
|
||||
exports.joinSignature = joinSignature;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
{
|
||||
"_from": "@ethersproject/bytes@^5.0.4",
|
||||
"_id": "@ethersproject/bytes@5.0.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-IEj9HpZB+ACS6cZ+QQMTqmu/cnUK2fYNE6ms/PVxjoBjoxc6HCraLpam1KuRvreMy0i523PLmjN8OYeikRdcUQ==",
|
||||
"_location": "/@ethersproject/bytes",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@ethersproject/bytes@^5.0.4",
|
||||
"name": "@ethersproject/bytes",
|
||||
"escapedName": "@ethersproject%2fbytes",
|
||||
"scope": "@ethersproject",
|
||||
"rawSpec": "^5.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@ethersproject/abi",
|
||||
"/@ethersproject/abstract-provider",
|
||||
"/@ethersproject/abstract-signer",
|
||||
"/@ethersproject/address",
|
||||
"/@ethersproject/base64",
|
||||
"/@ethersproject/bignumber",
|
||||
"/@ethersproject/hash",
|
||||
"/@ethersproject/keccak256",
|
||||
"/@ethersproject/rlp",
|
||||
"/@ethersproject/signing-key",
|
||||
"/@ethersproject/strings",
|
||||
"/@ethersproject/transactions",
|
||||
"/@ethersproject/web"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.5.tgz",
|
||||
"_shasum": "688b70000e550de0c97a151a21f15b87d7f97d7c",
|
||||
"_spec": "@ethersproject/bytes@^5.0.4",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\@ethersproject\\transactions",
|
||||
"author": {
|
||||
"name": "Richard Moore",
|
||||
"email": "me@ricmoo.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ethers-io/ethers.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@ethersproject/logger": "^5.0.5"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Bytes utility functions for ethers.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"homepage": "https://github.com/ethers-io/ethers.js#readme",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/bytes",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-build": "npm run build -- -w",
|
||||
"build": "tsc -p ./tsconfig.json",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x132538d3d8927299393c28ac01243ebc0e7ea34f5af1feadf23b364745f7c130",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.5"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "constants/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
const AddressZero = "0x0000000000000000000000000000000000000000";
|
||||
const HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
||||
// NFKC (composed) // (decomposed)
|
||||
const EtherSymbol = "\u039e"; // "\uD835\uDF63";
|
||||
const NegativeOne = BigNumber.from(-1);
|
||||
const Zero = BigNumber.from(0);
|
||||
const One = BigNumber.from(1);
|
||||
const Two = BigNumber.from(2);
|
||||
const WeiPerEther = BigNumber.from("1000000000000000000");
|
||||
const MaxUint256 = BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
export { AddressZero, HashZero, EtherSymbol, NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256 };
|
||||
//# sourceMappingURL=index.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "constants/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var AddressZero = "0x0000000000000000000000000000000000000000";
|
||||
exports.AddressZero = AddressZero;
|
||||
var HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
||||
exports.HashZero = HashZero;
|
||||
// NFKC (composed) // (decomposed)
|
||||
var EtherSymbol = "\u039e"; // "\uD835\uDF63";
|
||||
exports.EtherSymbol = EtherSymbol;
|
||||
var NegativeOne = bignumber_1.BigNumber.from(-1);
|
||||
exports.NegativeOne = NegativeOne;
|
||||
var Zero = bignumber_1.BigNumber.from(0);
|
||||
exports.Zero = Zero;
|
||||
var One = bignumber_1.BigNumber.from(1);
|
||||
exports.One = One;
|
||||
var Two = bignumber_1.BigNumber.from(2);
|
||||
exports.Two = Two;
|
||||
var WeiPerEther = bignumber_1.BigNumber.from("1000000000000000000");
|
||||
exports.WeiPerEther = WeiPerEther;
|
||||
var MaxUint256 = bignumber_1.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
exports.MaxUint256 = MaxUint256;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
{
|
||||
"_from": "@ethersproject/constants@^5.0.4",
|
||||
"_id": "@ethersproject/constants@5.0.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-foaQVmxp2+ik9FrLUCtVrLZCj4M3Ibgkqvh+Xw/vFRSerkjVSYePApaVE5essxhoSlF1U9oXfWY09QI2AXtgKA==",
|
||||
"_location": "/@ethersproject/constants",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@ethersproject/constants@^5.0.4",
|
||||
"name": "@ethersproject/constants",
|
||||
"escapedName": "@ethersproject%2fconstants",
|
||||
"scope": "@ethersproject",
|
||||
"rawSpec": "^5.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@ethersproject/abi",
|
||||
"/@ethersproject/strings",
|
||||
"/@ethersproject/transactions"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.5.tgz",
|
||||
"_shasum": "0ed19b002e8404bdf6d135234dc86a7d9bcf9b71",
|
||||
"_spec": "@ethersproject/constants@^5.0.4",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\@ethersproject\\transactions",
|
||||
"author": {
|
||||
"name": "Richard Moore",
|
||||
"email": "me@ricmoo.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ethers-io/ethers.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.0.7"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Common Ethereum constants used for ethers.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"homepage": "https://github.com/ethers-io/ethers.js#readme",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/constants",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x638edaa4b45c46158073ede9fda2c54d6c60a2f11485e693021c484076970130",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.5"
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export const version = "hash/5.0.6";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { toUtf8Bytes } from "@ethersproject/strings";
|
||||
export function id(text) {
|
||||
return keccak256(toUtf8Bytes(text));
|
||||
}
|
||||
//# sourceMappingURL=id.js.map
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
import { id } from "./id";
|
||||
import { isValidName, namehash } from "./namehash";
|
||||
import { hashMessage, messagePrefix } from "./message";
|
||||
import { TypedDataEncoder as _TypedDataEncoder } from "./typed-data";
|
||||
export { id, namehash, isValidName, messagePrefix, hashMessage, _TypedDataEncoder, };
|
||||
//# sourceMappingURL=index.js.map
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
import { concat } from "@ethersproject/bytes";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { toUtf8Bytes } from "@ethersproject/strings";
|
||||
export const messagePrefix = "\x19Ethereum Signed Message:\n";
|
||||
export function hashMessage(message) {
|
||||
if (typeof (message) === "string") {
|
||||
message = toUtf8Bytes(message);
|
||||
}
|
||||
return keccak256(concat([
|
||||
toUtf8Bytes(messagePrefix),
|
||||
toUtf8Bytes(String(message.length)),
|
||||
message
|
||||
]));
|
||||
}
|
||||
//# sourceMappingURL=message.js.map
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
import { concat, hexlify } from "@ethersproject/bytes";
|
||||
import { nameprep, toUtf8Bytes } from "@ethersproject/strings";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
const Zeros = new Uint8Array(32);
|
||||
Zeros.fill(0);
|
||||
const Partition = new RegExp("^((.*)\\.)?([^.]+)$");
|
||||
export function isValidName(name) {
|
||||
try {
|
||||
const comps = name.split(".");
|
||||
for (let i = 0; i < comps.length; i++) {
|
||||
if (nameprep(comps[i]).length === 0) {
|
||||
throw new Error("empty");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (error) { }
|
||||
return false;
|
||||
}
|
||||
export function namehash(name) {
|
||||
/* istanbul ignore if */
|
||||
if (typeof (name) !== "string") {
|
||||
logger.throwArgumentError("invalid address - " + String(name), "name", name);
|
||||
}
|
||||
let result = Zeros;
|
||||
while (name.length) {
|
||||
const partition = name.match(Partition);
|
||||
const label = toUtf8Bytes(nameprep(partition[3]));
|
||||
result = keccak256(concat([result, keccak256(label)]));
|
||||
name = partition[2] || "";
|
||||
}
|
||||
return hexlify(result);
|
||||
}
|
||||
//# sourceMappingURL=namehash.js.map
|
||||
-444
@@ -1,444 +0,0 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { getAddress } from "@ethersproject/address";
|
||||
import { BigNumber } from "@ethersproject/bignumber";
|
||||
import { arrayify, hexConcat, hexlify, hexValue, hexZeroPad, isHexString } from "@ethersproject/bytes";
|
||||
import { keccak256 } from "@ethersproject/keccak256";
|
||||
import { deepCopy, defineReadOnly, shallowCopy } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
import { id } from "./id";
|
||||
const padding = new Uint8Array(32);
|
||||
padding.fill(0);
|
||||
const NegativeOne = BigNumber.from(-1);
|
||||
const Zero = BigNumber.from(0);
|
||||
const One = BigNumber.from(1);
|
||||
const MaxUint256 = BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
function hexPadRight(value) {
|
||||
const bytes = arrayify(value);
|
||||
const padOffset = bytes.length % 32;
|
||||
if (padOffset) {
|
||||
return hexConcat([bytes, padding.slice(padOffset)]);
|
||||
}
|
||||
return hexlify(bytes);
|
||||
}
|
||||
const hexTrue = hexZeroPad(One.toHexString(), 32);
|
||||
const hexFalse = hexZeroPad(Zero.toHexString(), 32);
|
||||
const domainFieldTypes = {
|
||||
name: "string",
|
||||
version: "string",
|
||||
chainId: "uint256",
|
||||
verifyingContract: "address",
|
||||
salt: "bytes32"
|
||||
};
|
||||
const domainFieldNames = [
|
||||
"name", "version", "chainId", "verifyingContract", "salt"
|
||||
];
|
||||
function checkString(key) {
|
||||
return function (value) {
|
||||
if (typeof (value) !== "string") {
|
||||
logger.throwArgumentError(`invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
const domainChecks = {
|
||||
name: checkString("name"),
|
||||
version: checkString("version"),
|
||||
chainId: function (value) {
|
||||
try {
|
||||
return BigNumber.from(value).toString();
|
||||
}
|
||||
catch (error) { }
|
||||
return logger.throwArgumentError(`invalid domain value for "chainId"`, "domain.chainId", value);
|
||||
},
|
||||
verifyingContract: function (value) {
|
||||
try {
|
||||
return getAddress(value).toLowerCase();
|
||||
}
|
||||
catch (error) { }
|
||||
return logger.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
||||
},
|
||||
salt: function (value) {
|
||||
try {
|
||||
const bytes = arrayify(value);
|
||||
if (bytes.length !== 32) {
|
||||
throw new Error("bad length");
|
||||
}
|
||||
return hexlify(bytes);
|
||||
}
|
||||
catch (error) { }
|
||||
return logger.throwArgumentError(`invalid domain value "salt"`, "domain.salt", value);
|
||||
}
|
||||
};
|
||||
function getBaseEncoder(type) {
|
||||
// intXX and uintXX
|
||||
{
|
||||
const match = type.match(/^(u?)int(\d*)$/);
|
||||
if (match) {
|
||||
const signed = (match[1] === "");
|
||||
const width = parseInt(match[2] || "256");
|
||||
if (width % 8 !== 0 || width > 256 || (match[2] && match[2] !== String(width))) {
|
||||
logger.throwArgumentError("invalid numeric width", "type", type);
|
||||
}
|
||||
const boundsUpper = MaxUint256.mask(signed ? (width - 1) : width);
|
||||
const boundsLower = signed ? boundsUpper.add(One).mul(NegativeOne) : Zero;
|
||||
return function (value) {
|
||||
const v = BigNumber.from(value);
|
||||
if (v.lt(boundsLower) || v.gt(boundsUpper)) {
|
||||
logger.throwArgumentError(`value out-of-bounds for ${type}`, "value", value);
|
||||
}
|
||||
return hexZeroPad(v.toTwos(256).toHexString(), 32);
|
||||
};
|
||||
}
|
||||
}
|
||||
// bytesXX
|
||||
{
|
||||
const match = type.match(/^bytes(\d+)$/);
|
||||
if (match) {
|
||||
const width = parseInt(match[1]);
|
||||
if (width === 0 || width > 32 || match[1] !== String(width)) {
|
||||
logger.throwArgumentError("invalid bytes width", "type", type);
|
||||
}
|
||||
return function (value) {
|
||||
const bytes = arrayify(value);
|
||||
if (bytes.length !== width) {
|
||||
logger.throwArgumentError(`invalid length for ${type}`, "value", value);
|
||||
}
|
||||
return hexPadRight(value);
|
||||
};
|
||||
}
|
||||
}
|
||||
switch (type) {
|
||||
case "address": return function (value) {
|
||||
return hexZeroPad(getAddress(value), 32);
|
||||
};
|
||||
case "bool": return function (value) {
|
||||
return ((!value) ? hexFalse : hexTrue);
|
||||
};
|
||||
case "bytes": return function (value) {
|
||||
return keccak256(value);
|
||||
};
|
||||
case "string": return function (value) {
|
||||
return id(value);
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function encodeType(name, fields) {
|
||||
return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`;
|
||||
}
|
||||
export class TypedDataEncoder {
|
||||
constructor(types) {
|
||||
defineReadOnly(this, "types", Object.freeze(deepCopy(types)));
|
||||
defineReadOnly(this, "_encoderCache", {});
|
||||
defineReadOnly(this, "_types", {});
|
||||
// Link struct types to their direct child structs
|
||||
const links = {};
|
||||
// Link structs to structs which contain them as a child
|
||||
const parents = {};
|
||||
// Link all subtypes within a given struct
|
||||
const subtypes = {};
|
||||
Object.keys(types).forEach((type) => {
|
||||
links[type] = {};
|
||||
parents[type] = [];
|
||||
subtypes[type] = {};
|
||||
});
|
||||
for (const name in types) {
|
||||
const uniqueNames = {};
|
||||
types[name].forEach((field) => {
|
||||
// Check each field has a unique name
|
||||
if (uniqueNames[field.name]) {
|
||||
logger.throwArgumentError(`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
|
||||
}
|
||||
uniqueNames[field.name] = true;
|
||||
// Get the base type (drop any array specifiers)
|
||||
const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1];
|
||||
if (baseType === name) {
|
||||
logger.throwArgumentError(`circular type reference to ${JSON.stringify(baseType)}`, "types", types);
|
||||
}
|
||||
// Is this a base encoding type?
|
||||
const encoder = getBaseEncoder(baseType);
|
||||
if (encoder) {
|
||||
return;
|
||||
}
|
||||
if (!parents[baseType]) {
|
||||
logger.throwArgumentError(`unknown type ${JSON.stringify(baseType)}`, "types", types);
|
||||
}
|
||||
// Add linkage
|
||||
parents[baseType].push(name);
|
||||
links[name][baseType] = true;
|
||||
});
|
||||
}
|
||||
// Deduce the primary type
|
||||
const primaryTypes = Object.keys(parents).filter((n) => (parents[n].length === 0));
|
||||
if (primaryTypes.length === 0) {
|
||||
logger.throwArgumentError("missing primary type", "types", types);
|
||||
}
|
||||
else if (primaryTypes.length > 1) {
|
||||
logger.throwArgumentError(`ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types);
|
||||
}
|
||||
defineReadOnly(this, "primaryType", primaryTypes[0]);
|
||||
// Check for circular type references
|
||||
function checkCircular(type, found) {
|
||||
if (found[type]) {
|
||||
logger.throwArgumentError(`circular type reference to ${JSON.stringify(type)}`, "types", types);
|
||||
}
|
||||
found[type] = true;
|
||||
Object.keys(links[type]).forEach((child) => {
|
||||
if (!parents[child]) {
|
||||
return;
|
||||
}
|
||||
// Recursively check children
|
||||
checkCircular(child, found);
|
||||
// Mark all ancestors as having this decendant
|
||||
Object.keys(found).forEach((subtype) => {
|
||||
subtypes[subtype][child] = true;
|
||||
});
|
||||
});
|
||||
delete found[type];
|
||||
}
|
||||
checkCircular(this.primaryType, {});
|
||||
// Compute each fully describe type
|
||||
for (const name in subtypes) {
|
||||
const st = Object.keys(subtypes[name]);
|
||||
st.sort();
|
||||
this._types[name] = encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join("");
|
||||
}
|
||||
}
|
||||
getEncoder(type) {
|
||||
let encoder = this._encoderCache[type];
|
||||
if (!encoder) {
|
||||
encoder = this._encoderCache[type] = this._getEncoder(type);
|
||||
}
|
||||
return encoder;
|
||||
}
|
||||
_getEncoder(type) {
|
||||
// Basic encoder type (address, bool, uint256, etc)
|
||||
{
|
||||
const encoder = getBaseEncoder(type);
|
||||
if (encoder) {
|
||||
return encoder;
|
||||
}
|
||||
}
|
||||
// Array
|
||||
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
||||
if (match) {
|
||||
const subtype = match[1];
|
||||
const subEncoder = this.getEncoder(subtype);
|
||||
const length = parseInt(match[3]);
|
||||
return (value) => {
|
||||
if (length >= 0 && value.length !== length) {
|
||||
logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", value);
|
||||
}
|
||||
let result = value.map(subEncoder);
|
||||
if (this._types[subtype]) {
|
||||
result = result.map(keccak256);
|
||||
}
|
||||
return keccak256(hexConcat(result));
|
||||
};
|
||||
}
|
||||
// Struct
|
||||
const fields = this.types[type];
|
||||
if (fields) {
|
||||
const encodedType = id(this._types[type]);
|
||||
return (value) => {
|
||||
const values = fields.map(({ name, type }) => {
|
||||
const result = this.getEncoder(type)(value[name]);
|
||||
if (this._types[type]) {
|
||||
return keccak256(result);
|
||||
}
|
||||
return result;
|
||||
});
|
||||
values.unshift(encodedType);
|
||||
return hexConcat(values);
|
||||
};
|
||||
}
|
||||
return logger.throwArgumentError(`unknown type: ${type}`, "type", type);
|
||||
}
|
||||
encodeType(name) {
|
||||
const result = this._types[name];
|
||||
if (!result) {
|
||||
logger.throwArgumentError(`unknown type: ${JSON.stringify(name)}`, "name", name);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
encodeData(type, value) {
|
||||
return this.getEncoder(type)(value);
|
||||
}
|
||||
hashStruct(name, value) {
|
||||
return keccak256(this.encodeData(name, value));
|
||||
}
|
||||
encode(value) {
|
||||
return this.encodeData(this.primaryType, value);
|
||||
}
|
||||
hash(value) {
|
||||
return this.hashStruct(this.primaryType, value);
|
||||
}
|
||||
_visit(type, value, callback) {
|
||||
// Basic encoder type (address, bool, uint256, etc)
|
||||
{
|
||||
const encoder = getBaseEncoder(type);
|
||||
if (encoder) {
|
||||
return callback(type, value);
|
||||
}
|
||||
}
|
||||
// Array
|
||||
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
||||
if (match) {
|
||||
const subtype = match[1];
|
||||
const length = parseInt(match[3]);
|
||||
if (length >= 0 && value.length !== length) {
|
||||
logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", value);
|
||||
}
|
||||
return value.map((v) => this._visit(subtype, v, callback));
|
||||
}
|
||||
// Struct
|
||||
const fields = this.types[type];
|
||||
if (fields) {
|
||||
return fields.reduce((accum, { name, type }) => {
|
||||
accum[name] = this._visit(type, value[name], callback);
|
||||
return accum;
|
||||
}, {});
|
||||
}
|
||||
return logger.throwArgumentError(`unknown type: ${type}`, "type", type);
|
||||
}
|
||||
visit(value, callback) {
|
||||
return this._visit(this.primaryType, value, callback);
|
||||
}
|
||||
static from(types) {
|
||||
return new TypedDataEncoder(types);
|
||||
}
|
||||
static getPrimaryType(types) {
|
||||
return TypedDataEncoder.from(types).primaryType;
|
||||
}
|
||||
static hashStruct(name, types, value) {
|
||||
return TypedDataEncoder.from(types).hashStruct(name, value);
|
||||
}
|
||||
static hashDomain(domain) {
|
||||
const domainFields = [];
|
||||
for (const name in domain) {
|
||||
const type = domainFieldTypes[name];
|
||||
if (!type) {
|
||||
logger.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
|
||||
}
|
||||
domainFields.push({ name, type });
|
||||
}
|
||||
domainFields.sort((a, b) => {
|
||||
return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);
|
||||
});
|
||||
return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain);
|
||||
}
|
||||
static encode(domain, types, value) {
|
||||
return hexConcat([
|
||||
"0x1901",
|
||||
TypedDataEncoder.hashDomain(domain),
|
||||
TypedDataEncoder.from(types).hash(value)
|
||||
]);
|
||||
}
|
||||
static hash(domain, types, value) {
|
||||
return keccak256(TypedDataEncoder.encode(domain, types, value));
|
||||
}
|
||||
// Replaces all address types with ENS names with their looked up address
|
||||
static resolveNames(domain, types, value, resolveName) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Make a copy to isolate it from the object passed in
|
||||
domain = shallowCopy(domain);
|
||||
// Look up all ENS names
|
||||
const ensCache = {};
|
||||
// Do we need to look up the domain's verifyingContract?
|
||||
if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {
|
||||
ensCache[domain.verifyingContract] = "0x";
|
||||
}
|
||||
// We are going to use the encoder to visit all the base values
|
||||
const encoder = TypedDataEncoder.from(types);
|
||||
// Get a list of all the addresses
|
||||
encoder.visit(value, (type, value) => {
|
||||
if (type === "address" && !isHexString(value, 20)) {
|
||||
ensCache[value] = "0x";
|
||||
}
|
||||
return value;
|
||||
});
|
||||
// Lookup each name
|
||||
for (const name in ensCache) {
|
||||
ensCache[name] = yield resolveName(name);
|
||||
}
|
||||
// Replace the domain verifyingContract if needed
|
||||
if (domain.verifyingContract && ensCache[domain.verifyingContract]) {
|
||||
domain.verifyingContract = ensCache[domain.verifyingContract];
|
||||
}
|
||||
// Replace all ENS names with their address
|
||||
value = encoder.visit(value, (type, value) => {
|
||||
if (type === "address" && ensCache[value]) {
|
||||
return ensCache[value];
|
||||
}
|
||||
return value;
|
||||
});
|
||||
return { domain, value };
|
||||
});
|
||||
}
|
||||
static getPayload(domain, types, value) {
|
||||
// Validate the domain fields
|
||||
TypedDataEncoder.hashDomain(domain);
|
||||
// Derive the EIP712Domain Struct reference type
|
||||
const domainValues = {};
|
||||
const domainTypes = [];
|
||||
domainFieldNames.forEach((name) => {
|
||||
const value = domain[name];
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
domainValues[name] = domainChecks[name](value);
|
||||
domainTypes.push({ name, type: domainFieldTypes[name] });
|
||||
});
|
||||
const encoder = TypedDataEncoder.from(types);
|
||||
const typesWithDomain = shallowCopy(types);
|
||||
if (typesWithDomain.EIP712Domain) {
|
||||
typesWithDomain.EIP712Domain = domainTypes;
|
||||
}
|
||||
// Validate the data structures and types
|
||||
encoder.encode(value);
|
||||
return {
|
||||
types: typesWithDomain,
|
||||
domain: domainValues,
|
||||
primaryType: encoder.primaryType,
|
||||
message: encoder.visit(value, (type, value) => {
|
||||
// bytes
|
||||
if (type.match(/^bytes(\d*)/)) {
|
||||
return hexlify(arrayify(value));
|
||||
}
|
||||
// uint or int
|
||||
if (type.match(/^u?int/)) {
|
||||
let prefix = "";
|
||||
let v = BigNumber.from(value);
|
||||
if (v.isNegative()) {
|
||||
prefix = "-";
|
||||
v = v.mul(-1);
|
||||
}
|
||||
return prefix + hexValue(v.toHexString());
|
||||
}
|
||||
switch (type) {
|
||||
case "address":
|
||||
return value.toLowerCase();
|
||||
case "bool":
|
||||
return !!value;
|
||||
case "string":
|
||||
if (typeof (value) !== "string") {
|
||||
logger.throwArgumentError(`invalid string`, "value", value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return logger.throwArgumentError("unsupported type", "type", type);
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=typed-data.js.map
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "hash/5.0.6";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var keccak256_1 = require("@ethersproject/keccak256");
|
||||
var strings_1 = require("@ethersproject/strings");
|
||||
function id(text) {
|
||||
return keccak256_1.keccak256(strings_1.toUtf8Bytes(text));
|
||||
}
|
||||
exports.id = id;
|
||||
//# sourceMappingURL=id.js.map
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var id_1 = require("./id");
|
||||
exports.id = id_1.id;
|
||||
var namehash_1 = require("./namehash");
|
||||
exports.isValidName = namehash_1.isValidName;
|
||||
exports.namehash = namehash_1.namehash;
|
||||
var message_1 = require("./message");
|
||||
exports.hashMessage = message_1.hashMessage;
|
||||
exports.messagePrefix = message_1.messagePrefix;
|
||||
var typed_data_1 = require("./typed-data");
|
||||
exports._TypedDataEncoder = typed_data_1.TypedDataEncoder;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var keccak256_1 = require("@ethersproject/keccak256");
|
||||
var strings_1 = require("@ethersproject/strings");
|
||||
exports.messagePrefix = "\x19Ethereum Signed Message:\n";
|
||||
function hashMessage(message) {
|
||||
if (typeof (message) === "string") {
|
||||
message = strings_1.toUtf8Bytes(message);
|
||||
}
|
||||
return keccak256_1.keccak256(bytes_1.concat([
|
||||
strings_1.toUtf8Bytes(exports.messagePrefix),
|
||||
strings_1.toUtf8Bytes(String(message.length)),
|
||||
message
|
||||
]));
|
||||
}
|
||||
exports.hashMessage = hashMessage;
|
||||
//# sourceMappingURL=message.js.map
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var strings_1 = require("@ethersproject/strings");
|
||||
var keccak256_1 = require("@ethersproject/keccak256");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var Zeros = new Uint8Array(32);
|
||||
Zeros.fill(0);
|
||||
var Partition = new RegExp("^((.*)\\.)?([^.]+)$");
|
||||
function isValidName(name) {
|
||||
try {
|
||||
var comps = name.split(".");
|
||||
for (var i = 0; i < comps.length; i++) {
|
||||
if (strings_1.nameprep(comps[i]).length === 0) {
|
||||
throw new Error("empty");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (error) { }
|
||||
return false;
|
||||
}
|
||||
exports.isValidName = isValidName;
|
||||
function namehash(name) {
|
||||
/* istanbul ignore if */
|
||||
if (typeof (name) !== "string") {
|
||||
logger.throwArgumentError("invalid address - " + String(name), "name", name);
|
||||
}
|
||||
var result = Zeros;
|
||||
while (name.length) {
|
||||
var partition = name.match(Partition);
|
||||
var label = strings_1.toUtf8Bytes(strings_1.nameprep(partition[3]));
|
||||
result = keccak256_1.keccak256(bytes_1.concat([result, keccak256_1.keccak256(label)]));
|
||||
name = partition[2] || "";
|
||||
}
|
||||
return bytes_1.hexlify(result);
|
||||
}
|
||||
exports.namehash = namehash;
|
||||
//# sourceMappingURL=namehash.js.map
|
||||
-503
@@ -1,503 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var address_1 = require("@ethersproject/address");
|
||||
var bignumber_1 = require("@ethersproject/bignumber");
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var keccak256_1 = require("@ethersproject/keccak256");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
var id_1 = require("./id");
|
||||
var padding = new Uint8Array(32);
|
||||
padding.fill(0);
|
||||
var NegativeOne = bignumber_1.BigNumber.from(-1);
|
||||
var Zero = bignumber_1.BigNumber.from(0);
|
||||
var One = bignumber_1.BigNumber.from(1);
|
||||
var MaxUint256 = bignumber_1.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
function hexPadRight(value) {
|
||||
var bytes = bytes_1.arrayify(value);
|
||||
var padOffset = bytes.length % 32;
|
||||
if (padOffset) {
|
||||
return bytes_1.hexConcat([bytes, padding.slice(padOffset)]);
|
||||
}
|
||||
return bytes_1.hexlify(bytes);
|
||||
}
|
||||
var hexTrue = bytes_1.hexZeroPad(One.toHexString(), 32);
|
||||
var hexFalse = bytes_1.hexZeroPad(Zero.toHexString(), 32);
|
||||
var domainFieldTypes = {
|
||||
name: "string",
|
||||
version: "string",
|
||||
chainId: "uint256",
|
||||
verifyingContract: "address",
|
||||
salt: "bytes32"
|
||||
};
|
||||
var domainFieldNames = [
|
||||
"name", "version", "chainId", "verifyingContract", "salt"
|
||||
];
|
||||
function checkString(key) {
|
||||
return function (value) {
|
||||
if (typeof (value) !== "string") {
|
||||
logger.throwArgumentError("invalid domain value for " + JSON.stringify(key), "domain." + key, value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
var domainChecks = {
|
||||
name: checkString("name"),
|
||||
version: checkString("version"),
|
||||
chainId: function (value) {
|
||||
try {
|
||||
return bignumber_1.BigNumber.from(value).toString();
|
||||
}
|
||||
catch (error) { }
|
||||
return logger.throwArgumentError("invalid domain value for \"chainId\"", "domain.chainId", value);
|
||||
},
|
||||
verifyingContract: function (value) {
|
||||
try {
|
||||
return address_1.getAddress(value).toLowerCase();
|
||||
}
|
||||
catch (error) { }
|
||||
return logger.throwArgumentError("invalid domain value \"verifyingContract\"", "domain.verifyingContract", value);
|
||||
},
|
||||
salt: function (value) {
|
||||
try {
|
||||
var bytes = bytes_1.arrayify(value);
|
||||
if (bytes.length !== 32) {
|
||||
throw new Error("bad length");
|
||||
}
|
||||
return bytes_1.hexlify(bytes);
|
||||
}
|
||||
catch (error) { }
|
||||
return logger.throwArgumentError("invalid domain value \"salt\"", "domain.salt", value);
|
||||
}
|
||||
};
|
||||
function getBaseEncoder(type) {
|
||||
// intXX and uintXX
|
||||
{
|
||||
var match = type.match(/^(u?)int(\d*)$/);
|
||||
if (match) {
|
||||
var signed = (match[1] === "");
|
||||
var width = parseInt(match[2] || "256");
|
||||
if (width % 8 !== 0 || width > 256 || (match[2] && match[2] !== String(width))) {
|
||||
logger.throwArgumentError("invalid numeric width", "type", type);
|
||||
}
|
||||
var boundsUpper_1 = MaxUint256.mask(signed ? (width - 1) : width);
|
||||
var boundsLower_1 = signed ? boundsUpper_1.add(One).mul(NegativeOne) : Zero;
|
||||
return function (value) {
|
||||
var v = bignumber_1.BigNumber.from(value);
|
||||
if (v.lt(boundsLower_1) || v.gt(boundsUpper_1)) {
|
||||
logger.throwArgumentError("value out-of-bounds for " + type, "value", value);
|
||||
}
|
||||
return bytes_1.hexZeroPad(v.toTwos(256).toHexString(), 32);
|
||||
};
|
||||
}
|
||||
}
|
||||
// bytesXX
|
||||
{
|
||||
var match = type.match(/^bytes(\d+)$/);
|
||||
if (match) {
|
||||
var width_1 = parseInt(match[1]);
|
||||
if (width_1 === 0 || width_1 > 32 || match[1] !== String(width_1)) {
|
||||
logger.throwArgumentError("invalid bytes width", "type", type);
|
||||
}
|
||||
return function (value) {
|
||||
var bytes = bytes_1.arrayify(value);
|
||||
if (bytes.length !== width_1) {
|
||||
logger.throwArgumentError("invalid length for " + type, "value", value);
|
||||
}
|
||||
return hexPadRight(value);
|
||||
};
|
||||
}
|
||||
}
|
||||
switch (type) {
|
||||
case "address": return function (value) {
|
||||
return bytes_1.hexZeroPad(address_1.getAddress(value), 32);
|
||||
};
|
||||
case "bool": return function (value) {
|
||||
return ((!value) ? hexFalse : hexTrue);
|
||||
};
|
||||
case "bytes": return function (value) {
|
||||
return keccak256_1.keccak256(value);
|
||||
};
|
||||
case "string": return function (value) {
|
||||
return id_1.id(value);
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function encodeType(name, fields) {
|
||||
return name + "(" + fields.map(function (_a) {
|
||||
var name = _a.name, type = _a.type;
|
||||
return (type + " " + name);
|
||||
}).join(",") + ")";
|
||||
}
|
||||
var TypedDataEncoder = /** @class */ (function () {
|
||||
function TypedDataEncoder(types) {
|
||||
properties_1.defineReadOnly(this, "types", Object.freeze(properties_1.deepCopy(types)));
|
||||
properties_1.defineReadOnly(this, "_encoderCache", {});
|
||||
properties_1.defineReadOnly(this, "_types", {});
|
||||
// Link struct types to their direct child structs
|
||||
var links = {};
|
||||
// Link structs to structs which contain them as a child
|
||||
var parents = {};
|
||||
// Link all subtypes within a given struct
|
||||
var subtypes = {};
|
||||
Object.keys(types).forEach(function (type) {
|
||||
links[type] = {};
|
||||
parents[type] = [];
|
||||
subtypes[type] = {};
|
||||
});
|
||||
var _loop_1 = function (name_1) {
|
||||
var uniqueNames = {};
|
||||
types[name_1].forEach(function (field) {
|
||||
// Check each field has a unique name
|
||||
if (uniqueNames[field.name]) {
|
||||
logger.throwArgumentError("duplicate variable name " + JSON.stringify(field.name) + " in " + JSON.stringify(name_1), "types", types);
|
||||
}
|
||||
uniqueNames[field.name] = true;
|
||||
// Get the base type (drop any array specifiers)
|
||||
var baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1];
|
||||
if (baseType === name_1) {
|
||||
logger.throwArgumentError("circular type reference to " + JSON.stringify(baseType), "types", types);
|
||||
}
|
||||
// Is this a base encoding type?
|
||||
var encoder = getBaseEncoder(baseType);
|
||||
if (encoder) {
|
||||
return;
|
||||
}
|
||||
if (!parents[baseType]) {
|
||||
logger.throwArgumentError("unknown type " + JSON.stringify(baseType), "types", types);
|
||||
}
|
||||
// Add linkage
|
||||
parents[baseType].push(name_1);
|
||||
links[name_1][baseType] = true;
|
||||
});
|
||||
};
|
||||
for (var name_1 in types) {
|
||||
_loop_1(name_1);
|
||||
}
|
||||
// Deduce the primary type
|
||||
var primaryTypes = Object.keys(parents).filter(function (n) { return (parents[n].length === 0); });
|
||||
if (primaryTypes.length === 0) {
|
||||
logger.throwArgumentError("missing primary type", "types", types);
|
||||
}
|
||||
else if (primaryTypes.length > 1) {
|
||||
logger.throwArgumentError("ambiguous primary types or unused types: " + primaryTypes.map(function (t) { return (JSON.stringify(t)); }).join(", "), "types", types);
|
||||
}
|
||||
properties_1.defineReadOnly(this, "primaryType", primaryTypes[0]);
|
||||
// Check for circular type references
|
||||
function checkCircular(type, found) {
|
||||
if (found[type]) {
|
||||
logger.throwArgumentError("circular type reference to " + JSON.stringify(type), "types", types);
|
||||
}
|
||||
found[type] = true;
|
||||
Object.keys(links[type]).forEach(function (child) {
|
||||
if (!parents[child]) {
|
||||
return;
|
||||
}
|
||||
// Recursively check children
|
||||
checkCircular(child, found);
|
||||
// Mark all ancestors as having this decendant
|
||||
Object.keys(found).forEach(function (subtype) {
|
||||
subtypes[subtype][child] = true;
|
||||
});
|
||||
});
|
||||
delete found[type];
|
||||
}
|
||||
checkCircular(this.primaryType, {});
|
||||
// Compute each fully describe type
|
||||
for (var name_2 in subtypes) {
|
||||
var st = Object.keys(subtypes[name_2]);
|
||||
st.sort();
|
||||
this._types[name_2] = encodeType(name_2, types[name_2]) + st.map(function (t) { return encodeType(t, types[t]); }).join("");
|
||||
}
|
||||
}
|
||||
TypedDataEncoder.prototype.getEncoder = function (type) {
|
||||
var encoder = this._encoderCache[type];
|
||||
if (!encoder) {
|
||||
encoder = this._encoderCache[type] = this._getEncoder(type);
|
||||
}
|
||||
return encoder;
|
||||
};
|
||||
TypedDataEncoder.prototype._getEncoder = function (type) {
|
||||
var _this = this;
|
||||
// Basic encoder type (address, bool, uint256, etc)
|
||||
{
|
||||
var encoder = getBaseEncoder(type);
|
||||
if (encoder) {
|
||||
return encoder;
|
||||
}
|
||||
}
|
||||
// Array
|
||||
var match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
||||
if (match) {
|
||||
var subtype_1 = match[1];
|
||||
var subEncoder_1 = this.getEncoder(subtype_1);
|
||||
var length_1 = parseInt(match[3]);
|
||||
return function (value) {
|
||||
if (length_1 >= 0 && value.length !== length_1) {
|
||||
logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", value);
|
||||
}
|
||||
var result = value.map(subEncoder_1);
|
||||
if (_this._types[subtype_1]) {
|
||||
result = result.map(keccak256_1.keccak256);
|
||||
}
|
||||
return keccak256_1.keccak256(bytes_1.hexConcat(result));
|
||||
};
|
||||
}
|
||||
// Struct
|
||||
var fields = this.types[type];
|
||||
if (fields) {
|
||||
var encodedType_1 = id_1.id(this._types[type]);
|
||||
return function (value) {
|
||||
var values = fields.map(function (_a) {
|
||||
var name = _a.name, type = _a.type;
|
||||
var result = _this.getEncoder(type)(value[name]);
|
||||
if (_this._types[type]) {
|
||||
return keccak256_1.keccak256(result);
|
||||
}
|
||||
return result;
|
||||
});
|
||||
values.unshift(encodedType_1);
|
||||
return bytes_1.hexConcat(values);
|
||||
};
|
||||
}
|
||||
return logger.throwArgumentError("unknown type: " + type, "type", type);
|
||||
};
|
||||
TypedDataEncoder.prototype.encodeType = function (name) {
|
||||
var result = this._types[name];
|
||||
if (!result) {
|
||||
logger.throwArgumentError("unknown type: " + JSON.stringify(name), "name", name);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
TypedDataEncoder.prototype.encodeData = function (type, value) {
|
||||
return this.getEncoder(type)(value);
|
||||
};
|
||||
TypedDataEncoder.prototype.hashStruct = function (name, value) {
|
||||
return keccak256_1.keccak256(this.encodeData(name, value));
|
||||
};
|
||||
TypedDataEncoder.prototype.encode = function (value) {
|
||||
return this.encodeData(this.primaryType, value);
|
||||
};
|
||||
TypedDataEncoder.prototype.hash = function (value) {
|
||||
return this.hashStruct(this.primaryType, value);
|
||||
};
|
||||
TypedDataEncoder.prototype._visit = function (type, value, callback) {
|
||||
var _this = this;
|
||||
// Basic encoder type (address, bool, uint256, etc)
|
||||
{
|
||||
var encoder = getBaseEncoder(type);
|
||||
if (encoder) {
|
||||
return callback(type, value);
|
||||
}
|
||||
}
|
||||
// Array
|
||||
var match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
||||
if (match) {
|
||||
var subtype_2 = match[1];
|
||||
var length_2 = parseInt(match[3]);
|
||||
if (length_2 >= 0 && value.length !== length_2) {
|
||||
logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", value);
|
||||
}
|
||||
return value.map(function (v) { return _this._visit(subtype_2, v, callback); });
|
||||
}
|
||||
// Struct
|
||||
var fields = this.types[type];
|
||||
if (fields) {
|
||||
return fields.reduce(function (accum, _a) {
|
||||
var name = _a.name, type = _a.type;
|
||||
accum[name] = _this._visit(type, value[name], callback);
|
||||
return accum;
|
||||
}, {});
|
||||
}
|
||||
return logger.throwArgumentError("unknown type: " + type, "type", type);
|
||||
};
|
||||
TypedDataEncoder.prototype.visit = function (value, callback) {
|
||||
return this._visit(this.primaryType, value, callback);
|
||||
};
|
||||
TypedDataEncoder.from = function (types) {
|
||||
return new TypedDataEncoder(types);
|
||||
};
|
||||
TypedDataEncoder.getPrimaryType = function (types) {
|
||||
return TypedDataEncoder.from(types).primaryType;
|
||||
};
|
||||
TypedDataEncoder.hashStruct = function (name, types, value) {
|
||||
return TypedDataEncoder.from(types).hashStruct(name, value);
|
||||
};
|
||||
TypedDataEncoder.hashDomain = function (domain) {
|
||||
var domainFields = [];
|
||||
for (var name_3 in domain) {
|
||||
var type = domainFieldTypes[name_3];
|
||||
if (!type) {
|
||||
logger.throwArgumentError("invalid typed-data domain key: " + JSON.stringify(name_3), "domain", domain);
|
||||
}
|
||||
domainFields.push({ name: name_3, type: type });
|
||||
}
|
||||
domainFields.sort(function (a, b) {
|
||||
return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);
|
||||
});
|
||||
return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain);
|
||||
};
|
||||
TypedDataEncoder.encode = function (domain, types, value) {
|
||||
return bytes_1.hexConcat([
|
||||
"0x1901",
|
||||
TypedDataEncoder.hashDomain(domain),
|
||||
TypedDataEncoder.from(types).hash(value)
|
||||
]);
|
||||
};
|
||||
TypedDataEncoder.hash = function (domain, types, value) {
|
||||
return keccak256_1.keccak256(TypedDataEncoder.encode(domain, types, value));
|
||||
};
|
||||
// Replaces all address types with ENS names with their looked up address
|
||||
TypedDataEncoder.resolveNames = function (domain, types, value, resolveName) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var ensCache, encoder, _a, _b, _i, name_4, _c, _d;
|
||||
return __generator(this, function (_e) {
|
||||
switch (_e.label) {
|
||||
case 0:
|
||||
// Make a copy to isolate it from the object passed in
|
||||
domain = properties_1.shallowCopy(domain);
|
||||
ensCache = {};
|
||||
// Do we need to look up the domain's verifyingContract?
|
||||
if (domain.verifyingContract && !bytes_1.isHexString(domain.verifyingContract, 20)) {
|
||||
ensCache[domain.verifyingContract] = "0x";
|
||||
}
|
||||
encoder = TypedDataEncoder.from(types);
|
||||
// Get a list of all the addresses
|
||||
encoder.visit(value, function (type, value) {
|
||||
if (type === "address" && !bytes_1.isHexString(value, 20)) {
|
||||
ensCache[value] = "0x";
|
||||
}
|
||||
return value;
|
||||
});
|
||||
_a = [];
|
||||
for (_b in ensCache)
|
||||
_a.push(_b);
|
||||
_i = 0;
|
||||
_e.label = 1;
|
||||
case 1:
|
||||
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
||||
name_4 = _a[_i];
|
||||
_c = ensCache;
|
||||
_d = name_4;
|
||||
return [4 /*yield*/, resolveName(name_4)];
|
||||
case 2:
|
||||
_c[_d] = _e.sent();
|
||||
_e.label = 3;
|
||||
case 3:
|
||||
_i++;
|
||||
return [3 /*break*/, 1];
|
||||
case 4:
|
||||
// Replace the domain verifyingContract if needed
|
||||
if (domain.verifyingContract && ensCache[domain.verifyingContract]) {
|
||||
domain.verifyingContract = ensCache[domain.verifyingContract];
|
||||
}
|
||||
// Replace all ENS names with their address
|
||||
value = encoder.visit(value, function (type, value) {
|
||||
if (type === "address" && ensCache[value]) {
|
||||
return ensCache[value];
|
||||
}
|
||||
return value;
|
||||
});
|
||||
return [2 /*return*/, { domain: domain, value: value }];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
TypedDataEncoder.getPayload = function (domain, types, value) {
|
||||
// Validate the domain fields
|
||||
TypedDataEncoder.hashDomain(domain);
|
||||
// Derive the EIP712Domain Struct reference type
|
||||
var domainValues = {};
|
||||
var domainTypes = [];
|
||||
domainFieldNames.forEach(function (name) {
|
||||
var value = domain[name];
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
domainValues[name] = domainChecks[name](value);
|
||||
domainTypes.push({ name: name, type: domainFieldTypes[name] });
|
||||
});
|
||||
var encoder = TypedDataEncoder.from(types);
|
||||
var typesWithDomain = properties_1.shallowCopy(types);
|
||||
if (typesWithDomain.EIP712Domain) {
|
||||
typesWithDomain.EIP712Domain = domainTypes;
|
||||
}
|
||||
// Validate the data structures and types
|
||||
encoder.encode(value);
|
||||
return {
|
||||
types: typesWithDomain,
|
||||
domain: domainValues,
|
||||
primaryType: encoder.primaryType,
|
||||
message: encoder.visit(value, function (type, value) {
|
||||
// bytes
|
||||
if (type.match(/^bytes(\d*)/)) {
|
||||
return bytes_1.hexlify(bytes_1.arrayify(value));
|
||||
}
|
||||
// uint or int
|
||||
if (type.match(/^u?int/)) {
|
||||
var prefix = "";
|
||||
var v = bignumber_1.BigNumber.from(value);
|
||||
if (v.isNegative()) {
|
||||
prefix = "-";
|
||||
v = v.mul(-1);
|
||||
}
|
||||
return prefix + bytes_1.hexValue(v.toHexString());
|
||||
}
|
||||
switch (type) {
|
||||
case "address":
|
||||
return value.toLowerCase();
|
||||
case "bool":
|
||||
return !!value;
|
||||
case "string":
|
||||
if (typeof (value) !== "string") {
|
||||
logger.throwArgumentError("invalid string", "value", value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
return logger.throwArgumentError("unsupported type", "type", type);
|
||||
})
|
||||
};
|
||||
};
|
||||
return TypedDataEncoder;
|
||||
}());
|
||||
exports.TypedDataEncoder = TypedDataEncoder;
|
||||
//# sourceMappingURL=typed-data.js.map
|
||||
Loaded 100 of 9895 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user