mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-05 05:15:48 +00:00
Compare commits
661 Commits
0.12.0
...
0.13.0-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16bc7b986b | ||
|
|
115f95fa96 | ||
|
|
a6821bb8ab | ||
|
|
ed40eec711 | ||
|
|
43488c55f1 | ||
|
|
2f727b553c | ||
|
|
29c37aa6da | ||
|
|
64baef431d | ||
|
|
634fe5683a | ||
|
|
225ca3f852 | ||
|
|
ff2ac6c3cd | ||
|
|
607777f2a3 | ||
|
|
78eeb40322 | ||
|
|
772f79ae21 | ||
|
|
806a4e823f | ||
|
|
323e402e0c | ||
|
|
9ebb59580d | ||
|
|
bafab6eb18 | ||
|
|
35acbb62c3 | ||
|
|
4676ade4ee | ||
|
|
8edc3b1f36 | ||
|
|
8acfb1a537 | ||
|
|
ac78171099 | ||
|
|
d573c5746b | ||
|
|
51e8f9a87a | ||
|
|
bfe590d96d | ||
|
|
60e2d10775 | ||
|
|
2f432cef62 | ||
|
|
5217b66396 | ||
|
|
b8bb191d24 | ||
|
|
8070a52dc7 | ||
|
|
3205f3cf8c | ||
|
|
e0cdd610dd | ||
|
|
ed3b04ed6f | ||
|
|
62a2d2ae39 | ||
|
|
e2c853e40d | ||
|
|
b9b5a71869 | ||
|
|
87fdbc932f | ||
|
|
84838b2e9f | ||
|
|
c2ca37a790 | ||
|
|
c6805b9f0d | ||
|
|
b1dbdc03dd | ||
|
|
88a3f3d43b | ||
|
|
5f8dcd71a5 | ||
|
|
45db95da79 | ||
|
|
c79b12b27f | ||
|
|
135da6108d | ||
|
|
0d6dda579f | ||
|
|
e641a347db | ||
|
|
3e17d91edf | ||
|
|
715c648d52 | ||
|
|
d0ebed9822 | ||
|
|
a3775f18ba | ||
|
|
7b5d6e9fc5 | ||
|
|
368ac0b9e0 | ||
|
|
0448696bd8 | ||
|
|
deb75ed0d7 | ||
|
|
fcc9bacb4e | ||
|
|
9a5e8fd2ba | ||
|
|
1c023c4377 | ||
|
|
c213b98329 | ||
|
|
27d2e6e519 | ||
|
|
7ee368965c | ||
|
|
d8b5b825b3 | ||
|
|
de67570230 | ||
|
|
60c604fbe6 | ||
|
|
2f6d25ed01 | ||
|
|
b134081293 | ||
|
|
a0528d7f9c | ||
|
|
348335ddf0 | ||
|
|
01752e5486 | ||
|
|
3e758e1b86 | ||
|
|
fb0b30a9a7 | ||
|
|
0c9aea454e | ||
|
|
f282585c3f | ||
|
|
ae5ff31c96 | ||
|
|
20fa8bc953 | ||
|
|
778f59b4fd | ||
|
|
49623cb4dd | ||
|
|
90b53002aa | ||
|
|
93c12af305 | ||
|
|
60f2419b5c | ||
|
|
80494ad813 | ||
|
|
b43c4a7ad4 | ||
|
|
3c608de5bb | ||
|
|
fe5bc1d215 | ||
|
|
580bf9a755 | ||
|
|
c7df5df163 | ||
|
|
a08c52af55 | ||
|
|
e11db0f0f3 | ||
|
|
c6e0582729 | ||
|
|
6e98629f9b | ||
|
|
2243760442 | ||
|
|
91dd6877aa | ||
|
|
e73bcd8fc1 | ||
|
|
7e886b3260 | ||
|
|
5c9451d3ed | ||
|
|
c6c2dcc6c0 | ||
|
|
0bdd37090e | ||
|
|
c745faaaf0 | ||
|
|
9ad03ca873 | ||
|
|
138914384e | ||
|
|
77068667e4 | ||
|
|
c57cef4a21 | ||
|
|
50acc4c708 | ||
|
|
b5f8ba4817 | ||
|
|
a53249ccd7 | ||
|
|
0c62fa2112 | ||
|
|
806547dd15 | ||
|
|
fb1669b2b3 | ||
|
|
0cda15f2b5 | ||
|
|
b88e9370c6 | ||
|
|
e343f3beb8 | ||
|
|
a13bfae714 | ||
|
|
877c6bbb2a | ||
|
|
30d5134394 | ||
|
|
fae5c74487 | ||
|
|
255332ea2e | ||
|
|
15c0e6db19 | ||
|
|
2b600a1e4e | ||
|
|
297fb2483d | ||
|
|
5049822415 | ||
|
|
e3787e0f4f | ||
|
|
683199044b | ||
|
|
4f3c3e9f66 | ||
|
|
fc0240c06b | ||
|
|
6bfa284bac | ||
|
|
dfee9bc578 | ||
|
|
0838a0e865 | ||
|
|
5f61d80e2d | ||
|
|
c4fa4c237c | ||
|
|
44d00d5ef4 | ||
|
|
d4d3efcb65 | ||
|
|
f23e105240 | ||
|
|
5a396a7060 | ||
|
|
513632299f | ||
|
|
0d40558f1e | ||
|
|
1ccbaf6776 | ||
|
|
ba6c703163 | ||
|
|
3b9eb02bbb | ||
|
|
bca7382015 | ||
|
|
67672bd389 | ||
|
|
232017d9a2 | ||
|
|
23653f67f0 | ||
|
|
e3b688d1dd | ||
|
|
a94b21ca3c | ||
|
|
9c9be3e6e4 | ||
|
|
062561686e | ||
|
|
761682c206 | ||
|
|
39c48d631c | ||
|
|
a55d26a726 | ||
|
|
597ae157b3 | ||
|
|
c1c7458914 | ||
|
|
0e97f269ab | ||
|
|
bbe4cd63a1 | ||
|
|
2515d17a85 | ||
|
|
d8e95a3c3b | ||
|
|
98f6bed8c9 | ||
|
|
bd000c2662 | ||
|
|
a46141111a | ||
|
|
f57c89c6e9 | ||
|
|
6d4cac948d | ||
|
|
1f54b3a0cf | ||
|
|
2f8655dc23 | ||
|
|
d624923cd8 | ||
|
|
2180c076dd | ||
|
|
0dbdf0a21a | ||
|
|
5cb63a258c | ||
|
|
39ac6caaef | ||
|
|
de4ef8b2b4 | ||
|
|
99cba09a4a | ||
|
|
300967f0f3 | ||
|
|
52879febb9 | ||
|
|
f077a563c4 | ||
|
|
92fbc61f47 | ||
|
|
5ac1bcc414 | ||
|
|
5837aa23ea | ||
|
|
8c431b4ec3 | ||
|
|
25086a7944 | ||
|
|
b0889b4afe | ||
|
|
ed971bc41c | ||
|
|
728595dc96 | ||
|
|
7fc6adb776 | ||
|
|
002102ce62 | ||
|
|
bf9da80d46 | ||
|
|
dda9994869 | ||
|
|
4c76ad159e | ||
|
|
f76a8daca8 | ||
|
|
3263629ebe | ||
|
|
fcbe7d3c98 | ||
|
|
a6662ccdff | ||
|
|
854fe85151 | ||
|
|
2b2fdf1b11 | ||
|
|
cbe44d6a96 | ||
|
|
420346faea | ||
|
|
6220162852 | ||
|
|
37198bde66 | ||
|
|
281c056f6c | ||
|
|
49a513cd07 | ||
|
|
7a95aabbf4 | ||
|
|
83874ec096 | ||
|
|
9270d0a33d | ||
|
|
30295efdb4 | ||
|
|
f1342c1456 | ||
|
|
194b73c293 | ||
|
|
89e5f79bbb | ||
|
|
82d7ce7ac2 | ||
|
|
0cc4c704f8 | ||
|
|
dde762a1d6 | ||
|
|
1c86e246c7 | ||
|
|
2d173c8e69 | ||
|
|
600fd34d30 | ||
|
|
4cb9cf801c | ||
|
|
50fb8789b4 | ||
|
|
fb8dc44ec1 | ||
|
|
0781caa8bc | ||
|
|
2cdb23f0dd | ||
|
|
8e536c00b9 | ||
|
|
8ff154cc2d | ||
|
|
daaae6e01e | ||
|
|
a64a4e697a | ||
|
|
3f51d8cc12 | ||
|
|
9f9e76f8b9 | ||
|
|
5b51db158d | ||
|
|
a4d1509448 | ||
|
|
bbd51a03b6 | ||
|
|
b55b82b2fd | ||
|
|
fdb0f101bd | ||
|
|
0afca5633d | ||
|
|
7c0d9a7172 | ||
|
|
f6b7e27c67 | ||
|
|
b8624bc55f | ||
|
|
2eec30756d | ||
|
|
6b44ce8973 | ||
|
|
ed0b501716 | ||
|
|
0fd391af72 | ||
|
|
fe9c1ada88 | ||
|
|
4c1f4ef58c | ||
|
|
10afc770ff | ||
|
|
8543e60f86 | ||
|
|
116d7e0f29 | ||
|
|
68adaec55b | ||
|
|
03640efef5 | ||
|
|
c6f450842e | ||
|
|
e583eb4592 | ||
|
|
7fffbe0c64 | ||
|
|
63e3b71eb5 | ||
|
|
823ef738fe | ||
|
|
0977ef0ec2 | ||
|
|
cecf3f3d22 | ||
|
|
472fbce23a | ||
|
|
e44aea1767 | ||
|
|
d682d90d86 | ||
|
|
141aa17dfc | ||
|
|
0b09e53479 | ||
|
|
528d8bf25d | ||
|
|
03a2109e24 | ||
|
|
b38b9bced6 | ||
|
|
ea063d0c95 | ||
|
|
7f93929014 | ||
|
|
4cd10ecb87 | ||
|
|
6ef30debd2 | ||
|
|
4766bace4e | ||
|
|
261500a3a4 | ||
|
|
fae22b7023 | ||
|
|
4568b39997 | ||
|
|
4a218cacfa | ||
|
|
34a4dd3077 | ||
|
|
a383bd7e52 | ||
|
|
e76e693bdb | ||
|
|
2c52e4aa69 | ||
|
|
13dee36e93 | ||
|
|
6e180439d1 | ||
|
|
e8d0c1ae95 | ||
|
|
068bda0c95 | ||
|
|
ab694381d5 | ||
|
|
dc2a6c75cf | ||
|
|
98dbba8f27 | ||
|
|
9a1b80d77a | ||
|
|
a655be30d6 | ||
|
|
e5aabc3072 | ||
|
|
2cd32d58ad | ||
|
|
0c02b92717 | ||
|
|
c58a077a2f | ||
|
|
6e7dc9d7d3 | ||
|
|
572c945274 | ||
|
|
c605efab61 | ||
|
|
2695f4302a | ||
|
|
a17011243e | ||
|
|
9a533ab807 | ||
|
|
a037952493 | ||
|
|
dc96795a02 | ||
|
|
8d9746d7b1 | ||
|
|
00342c4239 | ||
|
|
e48df2c1fd | ||
|
|
6ade0f6554 | ||
|
|
a88157bb92 | ||
|
|
00f318284f | ||
|
|
2e12dc6d53 | ||
|
|
34435d4d05 | ||
|
|
a99452b773 | ||
|
|
a05cb39ab0 | ||
|
|
0c69f7f10e | ||
|
|
8d50034265 | ||
|
|
64f451e904 | ||
|
|
b1b47d7d91 | ||
|
|
a93c580c92 | ||
|
|
030e2786d1 | ||
|
|
56bbe1d437 | ||
|
|
1fff5ea6dc | ||
|
|
ad9956375f | ||
|
|
4787e5d29a | ||
|
|
194f76d57f | ||
|
|
d2ee5cb0bc | ||
|
|
040298db2c | ||
|
|
b4e6d4b98c | ||
|
|
a2b31e2677 | ||
|
|
e997c44a18 | ||
|
|
b27011fb38 | ||
|
|
b477eb238b | ||
|
|
02bc256225 | ||
|
|
9f7293127c | ||
|
|
61a0ea7eac | ||
|
|
51ef93e23b | ||
|
|
ab11220e27 | ||
|
|
b23d588747 | ||
|
|
a71dc28523 | ||
|
|
2de0e13ec5 | ||
|
|
d0c922ed13 | ||
|
|
8c82ebec79 | ||
|
|
ddd83d10fa | ||
|
|
031375e701 | ||
|
|
4bc285313c | ||
|
|
f42dd69b53 | ||
|
|
1dae06fdd8 | ||
|
|
ff29247b9e | ||
|
|
d9eca203ed | ||
|
|
4a85182a79 | ||
|
|
055d275f0a | ||
|
|
eb7bbe5715 | ||
|
|
8d5752883f | ||
|
|
2b5f356de8 | ||
|
|
c9610900fd | ||
|
|
79b1a65a7b | ||
|
|
df21b9453f | ||
|
|
22257bdd2b | ||
|
|
aa3767b180 | ||
|
|
c073c2b7de | ||
|
|
529a55efb0 | ||
|
|
c36567e062 | ||
|
|
f7873f3b41 | ||
|
|
6b54f1c1eb | ||
|
|
1fb1bc7404 | ||
|
|
aa646a3acf | ||
|
|
18ac8a9d03 | ||
|
|
7c357c5d52 | ||
|
|
816db9e0dc | ||
|
|
fa9e1de4df | ||
|
|
137d947606 | ||
|
|
77a05c1881 | ||
|
|
ab13e3fe18 | ||
|
|
fc4b085026 | ||
|
|
67e8f6ab65 | ||
|
|
792b30c8b5 | ||
|
|
3407aadfb8 | ||
|
|
29e59ebfd2 | ||
|
|
286a684963 | ||
|
|
3ef586d2d3 | ||
|
|
5889037a71 | ||
|
|
5e3f3969f5 | ||
|
|
eecf45918b | ||
|
|
6d91e6e6b2 | ||
|
|
7808f87060 | ||
|
|
6c48b22eea | ||
|
|
7344f1178b | ||
|
|
5a6a3ce6e0 | ||
|
|
f3a54bf02a | ||
|
|
766dc5d0ce | ||
|
|
f8f196903a | ||
|
|
337c41fe10 | ||
|
|
fb8eefd00d | ||
|
|
3082b959f6 | ||
|
|
487371737c | ||
|
|
14ccc9359d | ||
|
|
665b76271c | ||
|
|
11ca00bb45 | ||
|
|
046d397dfb | ||
|
|
58cc01b6d3 | ||
|
|
6a3eb7b9b9 | ||
|
|
935a463d3b | ||
|
|
f2f4173d7b | ||
|
|
941aaf6d8b | ||
|
|
1068b68568 | ||
|
|
e76b9a9051 | ||
|
|
410ac117f6 | ||
|
|
fa89c4dee8 | ||
|
|
a464ca2368 | ||
|
|
befd89c3d7 | ||
|
|
49640cf282 | ||
|
|
2ac4549712 | ||
|
|
6bffe06c3b | ||
|
|
13e9ad45f9 | ||
|
|
193fcc9014 | ||
|
|
30529b7a04 | ||
|
|
38b254e7f0 | ||
|
|
c4b98d2139 | ||
|
|
1309b58592 | ||
|
|
9b9d2dc32b | ||
|
|
73020fb8ae | ||
|
|
8221db833f | ||
|
|
09b10d3f2c | ||
|
|
c31798c7f8 | ||
|
|
064c5e9e50 | ||
|
|
077a53475d | ||
|
|
32ca23a00b | ||
|
|
1a7cdd7d04 | ||
|
|
85befa467b | ||
|
|
9b956e57ac | ||
|
|
93c0c49002 | ||
|
|
44954621e0 | ||
|
|
96e5d484da | ||
|
|
4efe0b920e | ||
|
|
d158cc7fc1 | ||
|
|
034cd4eaf6 | ||
|
|
d5f3d90486 | ||
|
|
99e076b7dd | ||
|
|
8f9aec83f2 | ||
|
|
87a8745a64 | ||
|
|
2ab51d7a8a | ||
|
|
3e0f43e44e | ||
|
|
6a763fab18 | ||
|
|
3fe6726789 | ||
|
|
5b4deabd90 | ||
|
|
84bc7dd4aa | ||
|
|
3960b4e11f | ||
|
|
141215fc38 | ||
|
|
2446e2f6da | ||
|
|
81a9bc0739 | ||
|
|
64e86f403e | ||
|
|
77f1351e5b | ||
|
|
47a87f3a92 | ||
|
|
d2df75dc25 | ||
|
|
d92fbfb7aa | ||
|
|
1b3be55711 | ||
|
|
8d98e443c5 | ||
|
|
46121edd62 | ||
|
|
1a32536ac8 | ||
|
|
85bf6891f9 | ||
|
|
1ccca1c4ec | ||
|
|
22cd70e53f | ||
|
|
d8aad1444e | ||
|
|
621dfd9ca5 | ||
|
|
2ad6a1a77e | ||
|
|
8f37438a08 | ||
|
|
ff6ac0333c | ||
|
|
1b936d2aa2 | ||
|
|
df0cff969c | ||
|
|
46e2598499 | ||
|
|
0b32378ab5 | ||
|
|
bf25eb350f | ||
|
|
97cea2ce4d | ||
|
|
82ed402b16 | ||
|
|
ca7b69a2a0 | ||
|
|
d9c61a9431 | ||
|
|
3b636ce2d1 | ||
|
|
2196352335 | ||
|
|
823d7048ba | ||
|
|
d066e1145d | ||
|
|
fb7021abcc | ||
|
|
9c14fb2379 | ||
|
|
a114bf42c4 | ||
|
|
87b6c09de3 | ||
|
|
f1c95112bd | ||
|
|
76d8c8b061 | ||
|
|
7cbcb9a220 | ||
|
|
4433ac57bd | ||
|
|
5379da4874 | ||
|
|
d488ce55b3 | ||
|
|
908e306f04 | ||
|
|
62b5953abe | ||
|
|
35ae968d9f | ||
|
|
22dc39b920 | ||
|
|
278331cc4a | ||
|
|
16e3541a10 | ||
|
|
7d7970d318 | ||
|
|
f4fa10b9c0 | ||
|
|
e68096bd27 | ||
|
|
50cda426eb | ||
|
|
1038421428 | ||
|
|
a5046ab086 | ||
|
|
ebbec1954e | ||
|
|
4021018931 | ||
|
|
5824c3cb7c | ||
|
|
45a1b9471e | ||
|
|
70bc819665 | ||
|
|
e05f3e9b9c | ||
|
|
e93f1ab6f4 | ||
|
|
0878a8ecf0 | ||
|
|
6ea07139dc | ||
|
|
55fca2d7d5 | ||
|
|
8596dcef21 | ||
|
|
bca84d5508 | ||
|
|
65f7485497 | ||
|
|
457b02c781 | ||
|
|
c8e0fa85f3 | ||
|
|
5e714f6143 | ||
|
|
4ecbf31898 | ||
|
|
ea24bf0415 | ||
|
|
171f8349cb | ||
|
|
398f8d001f | ||
|
|
e66978fb48 | ||
|
|
c57d528db7 | ||
|
|
0c47310063 | ||
|
|
cb4f6e37a8 | ||
|
|
ab943f36c3 | ||
|
|
de7fc78ef0 | ||
|
|
9a502580fd | ||
|
|
d56e70b995 | ||
|
|
e9aaf50d59 | ||
|
|
ac0a4f521a | ||
|
|
a3380c5cdd | ||
|
|
6a6d2a0787 | ||
|
|
64809d9ae2 | ||
|
|
d14b38bc91 | ||
|
|
440dfb5785 | ||
|
|
d4a4b5f4fb | ||
|
|
0c000a7fee | ||
|
|
c655c2a20e | ||
|
|
3ba5a18b91 | ||
|
|
bdb3415855 | ||
|
|
5ef5bdd9d9 | ||
|
|
c7bbce8371 | ||
|
|
5e2c26a4a2 | ||
|
|
631faa20ec | ||
|
|
2db17ba67c | ||
|
|
50eca42e35 | ||
|
|
f327487157 | ||
|
|
85b64b7ac3 | ||
|
|
cf17a9e8d6 | ||
|
|
71a1282b89 | ||
|
|
85e1f2f47d | ||
|
|
1f68eba146 | ||
|
|
d71873442f | ||
|
|
10ca2da2d6 | ||
|
|
c7ba822320 | ||
|
|
ef3ce46d00 | ||
|
|
c4595e03ce | ||
|
|
26a7eb456b | ||
|
|
142a85d6a7 | ||
|
|
ef51490a1a | ||
|
|
c40d643238 | ||
|
|
6f23c88567 | ||
|
|
56958a6242 | ||
|
|
74dac97b36 | ||
|
|
2f2e41c781 | ||
|
|
8c872f71c6 | ||
|
|
b40b496866 | ||
|
|
569fec296e | ||
|
|
56d8aa797a | ||
|
|
fe7e30b737 | ||
|
|
a114281c60 | ||
|
|
d09548d04d | ||
|
|
a02b8e3e5c | ||
|
|
2c3f9ca202 | ||
|
|
587782820d | ||
|
|
8fad048569 | ||
|
|
f7c35b118e | ||
|
|
65a669bbb2 | ||
|
|
9985acc539 | ||
|
|
f1f0a43f21 | ||
|
|
6b856c3cc5 | ||
|
|
d92888ed73 | ||
|
|
0357840654 | ||
|
|
53cae3a66d | ||
|
|
949a1ca4ae | ||
|
|
e667536a5b | ||
|
|
dde000a4bb | ||
|
|
aa1f5a8e7d | ||
|
|
bfbfcc2894 | ||
|
|
6abfa759aa | ||
|
|
7cbac2e757 | ||
|
|
1012381d3d | ||
|
|
6de96f62df | ||
|
|
e2ed2bdbf6 | ||
|
|
e248c54aa5 | ||
|
|
1c9635edad | ||
|
|
25cf6c52e4 | ||
|
|
7859ef6145 | ||
|
|
6efaa4ac7e | ||
|
|
19e17a8431 | ||
|
|
c865ae9734 | ||
|
|
6959f74073 | ||
|
|
9f4d21e976 | ||
|
|
719f39c01c | ||
|
|
25bb9c7320 | ||
|
|
a160e16abd | ||
|
|
ec31841aa5 | ||
|
|
3e249902c4 | ||
|
|
21bb766f06 | ||
|
|
a883151400 | ||
|
|
3c7fe82cbd | ||
|
|
899fc09704 | ||
|
|
daa45a44b9 | ||
|
|
52494628c3 | ||
|
|
dbf5d21b72 | ||
|
|
441bd4dfbf | ||
|
|
8452f05dda | ||
|
|
0d2325e646 | ||
|
|
90329d3d73 | ||
|
|
ca83a142f8 | ||
|
|
d3b2d3d5c5 | ||
|
|
255177487c | ||
|
|
ed0b75bcde | ||
|
|
06500a7909 | ||
|
|
6e16bf68ae | ||
|
|
ad22480117 | ||
|
|
2fcd09072f | ||
|
|
f0c785b196 | ||
|
|
84fe76bada | ||
|
|
b5ed8f59a7 | ||
|
|
52526f90d7 | ||
|
|
99e6e81e65 | ||
|
|
5af824f5cf | ||
|
|
2166bb2e88 | ||
|
|
ae884c0200 | ||
|
|
423ec7d08a | ||
|
|
914cd6ecb2 | ||
|
|
f221c82859 | ||
|
|
d57be723e6 | ||
|
|
777554809a | ||
|
|
f2b63fa4a8 | ||
|
|
4d06ce7454 | ||
|
|
8da6ec5fa3 | ||
|
|
2a5a8b498d | ||
|
|
a9b7d7d793 | ||
|
|
6578cf5dd7 | ||
|
|
2e21e8a43c | ||
|
|
176e1fd9d4 | ||
|
|
c3b274b18f | ||
|
|
8e134918fb | ||
|
|
2b531d2a1f | ||
|
|
87317dd54a | ||
|
|
618548c88d | ||
|
|
b62f42006c | ||
|
|
c275174f27 | ||
|
|
af4ed295e0 | ||
|
|
7614a03ea8 | ||
|
|
d9527726b6 | ||
|
|
05f4099709 | ||
|
|
a20a649013 | ||
|
|
0e3e64105c | ||
|
|
b2cdb1a6ae | ||
|
|
812432db96 | ||
|
|
5b2c4aef2d | ||
|
|
b7ccf424f4 | ||
|
|
77d5db168b | ||
|
|
e80cd1ff55 | ||
|
|
4ff25a21f6 | ||
|
|
f184a71360 | ||
|
|
fc38a9853d | ||
|
|
6023efed41 |
@@ -1,7 +1,14 @@
|
||||
[ignore]
|
||||
.*/src/api/.*
|
||||
.*/src/core/.*
|
||||
.*/dist/.*
|
||||
.*/test/fixtures/.*
|
||||
.*/node_modules/flow-bin/.*
|
||||
|
||||
[include]
|
||||
./node_modules/
|
||||
|
||||
[libs]
|
||||
|
||||
[options]
|
||||
module.system=node
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -17,7 +17,7 @@
|
||||
|
||||
# Ignore object files.
|
||||
*.o
|
||||
build/*.js
|
||||
build/
|
||||
tags
|
||||
bin/rippled
|
||||
Debug/*.*
|
||||
@@ -59,3 +59,5 @@ out/
|
||||
|
||||
# Ignore perf test cache
|
||||
scripts/cache
|
||||
|
||||
eslintrc
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
deploy
|
||||
lib-cov
|
||||
coverage.html
|
||||
src
|
||||
dist/bower
|
||||
|
||||
15
.travis.yml
15
.travis.yml
@@ -1,14 +1,9 @@
|
||||
sudo: false # use faster docker containers
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
script: MOCHA_REPORTER=tap npm test --coverage
|
||||
after_success:
|
||||
- npm run coveralls
|
||||
- "0.12"
|
||||
before_script:
|
||||
- sh -c "git log | head -12"
|
||||
script: bin/ci.sh
|
||||
notifications:
|
||||
email: false
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/d1ec4245f90231619d30
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
on_start: false # default: false
|
||||
|
||||
210
Gulpfile.js
210
Gulpfile.js
@@ -1,102 +1,54 @@
|
||||
/* eslint-disable no-var, no-param-reassign */
|
||||
/* these eslint rules are disabled because gulp does not support babel yet */
|
||||
'use strict';
|
||||
var _ = require('lodash');
|
||||
var gulp = require('gulp');
|
||||
var gutil = require('gulp-util');
|
||||
var watch = require('gulp-watch');
|
||||
var plumber = require('gulp-plumber');
|
||||
var filelog = require('gulp-filelog');
|
||||
var cleanDest = require('gulp-clean-dest');
|
||||
var concat = require('gulp-concat');
|
||||
var uglify = require('gulp-uglify');
|
||||
var rename = require('gulp-rename');
|
||||
var webpack = require('webpack');
|
||||
var map = require('map-stream');
|
||||
var bump = require('gulp-bump');
|
||||
var react = require('gulp-react');
|
||||
var flow = require('gulp-flowtype');
|
||||
var argv = require('yargs').argv;
|
||||
//var header = require('gulp-header');
|
||||
|
||||
var pkg = require('./package.json');
|
||||
|
||||
var banner = '/*! <%= pkg.name %> - v<%= pkg.version %> - '
|
||||
+ '<%= new Date().toISOString() %>\n'
|
||||
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>'
|
||||
+ '* Copyright (c) <%= new Date().getFullYear() %> <%= pkg.author.name %>;'
|
||||
+ ' Licensed <%= pkg.license %> */'
|
||||
|
||||
var sjclSrc = [
|
||||
'src/js/sjcl/core/sjcl.js',
|
||||
'src/js/sjcl/core/aes.js',
|
||||
'src/js/sjcl/core/bitArray.js',
|
||||
'src/js/sjcl/core/codecString.js',
|
||||
'src/js/sjcl/core/codecHex.js',
|
||||
'src/js/sjcl/core/codecBase64.js',
|
||||
'src/js/sjcl/core/codecBytes.js',
|
||||
'src/js/sjcl/core/sha256.js',
|
||||
'src/js/sjcl/core/sha512.js',
|
||||
'src/js/sjcl/core/sha1.js',
|
||||
'src/js/sjcl/core/ccm.js',
|
||||
// 'src/js/sjcl/core/cbc.js',
|
||||
// 'src/js/sjcl/core/ocb2.js',
|
||||
'src/js/sjcl/core/hmac.js',
|
||||
'src/js/sjcl/core/pbkdf2.js',
|
||||
'src/js/sjcl/core/random.js',
|
||||
'src/js/sjcl/core/convenience.js',
|
||||
'src/js/sjcl/core/bn.js',
|
||||
'src/js/sjcl/core/ecc.js',
|
||||
'src/js/sjcl/core/srp.js',
|
||||
'src/js/sjcl-custom/sjcl-ecc-pointextras.js',
|
||||
'src/js/sjcl-custom/sjcl-secp256k1.js',
|
||||
'src/js/sjcl-custom/sjcl-ripemd160.js',
|
||||
'src/js/sjcl-custom/sjcl-extramath.js',
|
||||
'src/js/sjcl-custom/sjcl-montgomery.js',
|
||||
'src/js/sjcl-custom/sjcl-validecc.js',
|
||||
'src/js/sjcl-custom/sjcl-ecdsa-canonical.js',
|
||||
'src/js/sjcl-custom/sjcl-ecdsa-der.js',
|
||||
'src/js/sjcl-custom/sjcl-ecdsa-recoverablepublickey.js',
|
||||
'src/js/sjcl-custom/sjcl-jacobi.js'
|
||||
];
|
||||
|
||||
function logPluginError(error) {
|
||||
gutil.log(error.toString());
|
||||
function webpackConfig(extension, overrides) {
|
||||
overrides = overrides || {};
|
||||
var defaults = {
|
||||
cache: true,
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
library: 'ripple',
|
||||
path: './build/',
|
||||
filename: ['ripple-', extension].join(pkg.version)
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader?optional=runtime'
|
||||
}, {
|
||||
test: /\.json/,
|
||||
loader: 'json-loader'
|
||||
}]
|
||||
}
|
||||
};
|
||||
return _.assign({}, defaults, overrides);
|
||||
}
|
||||
|
||||
gulp.task('concat-sjcl', function() {
|
||||
return gulp.src(sjclSrc)
|
||||
.pipe(concat('sjcl.js'))
|
||||
.pipe(gulp.dest('./build/'));
|
||||
gulp.task('build', function(callback) {
|
||||
webpack(webpackConfig('.js'), callback);
|
||||
});
|
||||
|
||||
gulp.task('build', [ 'concat-sjcl' ], function(callback) {
|
||||
webpack({
|
||||
cache: true,
|
||||
entry: './src/js/ripple/index.js',
|
||||
output: {
|
||||
library: 'ripple',
|
||||
path: './build/',
|
||||
filename: [ 'ripple-', '.js' ].join(pkg.version)
|
||||
},
|
||||
}, callback);
|
||||
});
|
||||
|
||||
gulp.task('build-min', [ 'build' ], function(callback) {
|
||||
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
|
||||
gulp.task('build-min', ['build'], function() {
|
||||
return gulp.src(['./build/ripple-', '.js'].join(pkg.version))
|
||||
.pipe(uglify())
|
||||
.pipe(rename([ 'ripple-', '-min.js' ].join(pkg.version)))
|
||||
.pipe(rename(['ripple-', '-min.js'].join(pkg.version)))
|
||||
.pipe(gulp.dest('./build/'));
|
||||
});
|
||||
|
||||
gulp.task('build-debug', [ 'concat-sjcl' ], function(callback) {
|
||||
webpack({
|
||||
cache: true,
|
||||
entry: './src/js/ripple/index.js',
|
||||
output: {
|
||||
library: 'ripple',
|
||||
path: './build/',
|
||||
filename: [ 'ripple-', '-debug.js' ].join(pkg.version)
|
||||
},
|
||||
debug: true,
|
||||
devtool: 'eval'
|
||||
}, callback);
|
||||
gulp.task('build-debug', function(callback) {
|
||||
var configOverrides = {debug: true, devtool: 'eval'};
|
||||
webpack(webpackConfig('-debug.js', configOverrides), callback);
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -105,97 +57,73 @@ gulp.task('build-debug', [ 'concat-sjcl' ], function(callback) {
|
||||
*/
|
||||
|
||||
function buildUseError(cons) {
|
||||
return 'var {<CONS>:function(){throw new Error("Class is unavailable in this build: <CONS>")}}'
|
||||
.replace(new RegExp('<CONS>', 'g'), cons);
|
||||
};
|
||||
return ('var {<CONS>:function(){throw new Error('
|
||||
+ '"Class is unavailable in this build: <CONS>")}}')
|
||||
.replace(new RegExp('<CONS>', 'g'), cons);
|
||||
}
|
||||
|
||||
gulp.task('build-core', [ 'concat-sjcl' ], function(callback) {
|
||||
webpack({
|
||||
entry: [
|
||||
'./src/js/ripple/remote.js'
|
||||
],
|
||||
externals: [
|
||||
{
|
||||
'./transaction': buildUseError('Transaction'),
|
||||
'./orderbook': buildUseError('OrderBook'),
|
||||
'./account': buildUseError('Account'),
|
||||
'./serializedobject': buildUseError('SerializedObject')
|
||||
}
|
||||
],
|
||||
output: {
|
||||
library: 'ripple',
|
||||
path: './build/',
|
||||
filename: [ 'ripple-', '-core.js' ].join(pkg.version)
|
||||
},
|
||||
gulp.task('build-core', function(callback) {
|
||||
var configOverrides = {
|
||||
cache: false,
|
||||
entry: './src/remote.js',
|
||||
externals: [{
|
||||
'./transaction': buildUseError('Transaction'),
|
||||
'./orderbook': buildUseError('OrderBook'),
|
||||
'./account': buildUseError('Account'),
|
||||
'./serializedobject': buildUseError('SerializedObject')
|
||||
}],
|
||||
plugins: [
|
||||
new webpack.optimize.UglifyJsPlugin()
|
||||
]
|
||||
}, callback);
|
||||
};
|
||||
webpack(webpackConfig('-core.js', configOverrides), callback);
|
||||
});
|
||||
|
||||
gulp.task('bower-build', [ 'build' ], function(callback) {
|
||||
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
|
||||
gulp.task('bower-build', ['build'], function() {
|
||||
return gulp.src(['./build/ripple-', '.js'].join(pkg.version))
|
||||
.pipe(rename('ripple.js'))
|
||||
.pipe(gulp.dest('./dist/'));
|
||||
.pipe(gulp.dest('./dist/bower'));
|
||||
});
|
||||
|
||||
gulp.task('bower-build-min', [ 'build-min' ], function(callback) {
|
||||
return gulp.src([ './build/ripple-', '-min.js' ].join(pkg.version))
|
||||
gulp.task('bower-build-min', ['build-min'], function() {
|
||||
return gulp.src(['./build/ripple-', '-min.js'].join(pkg.version))
|
||||
.pipe(rename('ripple-min.js'))
|
||||
.pipe(gulp.dest('./dist/'));
|
||||
.pipe(gulp.dest('./dist/bower'));
|
||||
});
|
||||
|
||||
gulp.task('bower-build-debug', [ 'build-debug' ], function(callback) {
|
||||
return gulp.src([ './build/ripple-', '-debug.js' ].join(pkg.version))
|
||||
gulp.task('bower-build-debug', ['build-debug'], function() {
|
||||
return gulp.src(['./build/ripple-', '-debug.js'].join(pkg.version))
|
||||
.pipe(rename('ripple-debug.js'))
|
||||
.pipe(gulp.dest('./dist/'));
|
||||
.pipe(gulp.dest('./dist/bower'));
|
||||
});
|
||||
|
||||
gulp.task('bower-version', function() {
|
||||
gulp.src('./dist/bower.json')
|
||||
.pipe(bump({ version: pkg.version }))
|
||||
.pipe(gulp.dest('./dist/'));
|
||||
gulp.src('./dist/bower/bower.json')
|
||||
.pipe(bump({version: pkg.version}))
|
||||
.pipe(gulp.dest('./dist/bower'));
|
||||
});
|
||||
|
||||
gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug', 'bower-version']);
|
||||
gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug',
|
||||
'bower-version']);
|
||||
|
||||
gulp.task('watch', function() {
|
||||
gulp.watch('src/js/ripple/*', [ 'build-debug' ]);
|
||||
});
|
||||
|
||||
// To use this, each javascript file must have /* @flow */ on the first line
|
||||
gulp.task('typecheck', function() {
|
||||
return gulp.src('src/js/ripple/*.js')
|
||||
.pipe(flow({ // note: do not set the 'all' option, it is broken
|
||||
weak: true, // remove this after all errors are addressed
|
||||
killFlow: true
|
||||
}));
|
||||
});
|
||||
|
||||
gulp.task('strip', function() {
|
||||
return gulp.src('src/js/ripple/*.js')
|
||||
.pipe(watch('src/js/ripple/*.js'))
|
||||
.pipe(cleanDest('out')) // delete outdated output file before stripping
|
||||
.pipe(plumber()) // prevent an error in one file from ending build
|
||||
.pipe(react({ stripTypes: true }).on('error', logPluginError))
|
||||
.pipe(filelog())
|
||||
.pipe(gulp.dest('out'));
|
||||
gulp.watch('src/*', ['build-debug']);
|
||||
});
|
||||
|
||||
gulp.task('version-bump', function() {
|
||||
if (!argv.type) {
|
||||
throw new Error("No type found, pass it in using the --type argument");
|
||||
throw new Error('No type found, pass it in using the --type argument');
|
||||
}
|
||||
|
||||
gulp.src('./package.json')
|
||||
.pipe(bump({ type: argv.type }))
|
||||
.pipe(bump({type: argv.type}))
|
||||
.pipe(gulp.dest('./'));
|
||||
});
|
||||
|
||||
gulp.task('version-beta', function() {
|
||||
gulp.src('./package.json')
|
||||
.pipe(bump({ version: pkg.version + '-beta' }))
|
||||
.pipe(bump({version: pkg.version + '-beta'}))
|
||||
.pipe(gulp.dest('./'));
|
||||
});
|
||||
|
||||
gulp.task('default', [ 'concat-sjcl', 'build', 'build-debug', 'build-min' ]);
|
||||
gulp.task('default', ['build', 'build-debug', 'build-min']);
|
||||
|
||||
136
HISTORY.md
136
HISTORY.md
@@ -1,3 +1,123 @@
|
||||
##0.13.0 (release candidate)
|
||||
|
||||
**Breaking Changes**
|
||||
+ [Removed timeout method of Request and added default timeout](https://github.com/ripple/ripple-lib/commit/634fe5683a9082e57682ff7d5c4fb9483b4af818)
|
||||
+ Add new RippleAPI interface
|
||||
- [RippleAPI README and samples](https://github.com/ripple/ripple-lib/tree/develop/docs/samples)
|
||||
- [Method documentation](https://rawgit.com/ripple/ripple-lib/develop/docs/api.html)
|
||||
|
||||
**Changes**
|
||||
+ [Add Remote.closeCurrentPathFind function, so current pathfind can be properly closed](https://github.com/ripple/ripple-lib/commit/e99010f363fc7cbe7fd547d3ca5b32ea083c44e6)
|
||||
+ [Implement Balance Sheet API](https://github.com/ripple/ripple-lib/pull/579)
|
||||
+ [Fix bugs in orderbook subscription](https://github.com/ripple/ripple-lib/commit/7404795dc64a85216148de7bc3ca7da7b33f4490)
|
||||
+ [Fix crash due to rippled slowDown error](https://github.com/ripple/ripple-lib/commit/84838b2e9f6969b593b8462a62a6b8f516ada937)
|
||||
+ [Fix: Emit error events and return error on pathfind](https://github.com/ripple/ripple-lib/commit/1ccbaf677631a1944eb05d90f7afc5f3690a03dd)
|
||||
+ [Deprecate core and remove snake case method copying](https://github.com/ripple/ripple-lib/commit/fb8dc44ec1d49bb05cd0cdbe6dd4ab211195868a)
|
||||
|
||||
+ [Fix RangeSet for validated_ledger as single ledger](https://github.com/ripple/ripple-lib/commit/9f9e76f8b933201651af59307135f67cfa7d60e8)
|
||||
+ [Fix bug where the paths would be set with an empty array](https://github.com/ripple/ripple-lib/commit/83874ec0962da311b76f2385623e51c68bc39035)
|
||||
+ [Fix reserve calculation](https://github.com/ripple/ripple-lib/commit/52879febb92d876f01f2e4d70871baa07af631fb)
|
||||
|
||||
##0.12.7 and 0.12.8
|
||||
|
||||
+ [Improve performance of orderbook](https://github.com/ripple/ripple-lib/commit/c745faaaf0956ca98448a754b4fe97fb50574fc7)
|
||||
|
||||
+ [Remove Firefox warning about prototype overwrite](https://github.com/ripple/ripple-lib/commit/0c62fa21123b220b066871e1c41a3b4fe6f51885)
|
||||
|
||||
+ [Fix compare bug in Amount class](https://github.com/ripple/ripple-lib/commit/806547dd154e1b0bf252e8a74ad3ac6aa8a97660)
|
||||
|
||||
##0.12.6
|
||||
|
||||
+ [Fix webpack require failure due to "./" notation](https://github.com/ripple/ripple-lib/commit/8d9746d7b10be203ee613df523c2522012ff1baf)
|
||||
|
||||
##0.12.15
|
||||
|
||||
+ [Add offer autobridging](https://github.com/ripple/ripple-lib/commit/c7bbce83719c1e8c6a4fae5ca850e7515db1a4a5)
|
||||
|
||||
+ [Prevent crash when listening for "model" events on the OrderBook class](https://github.com/ripple/ripple-lib/commit/5824c3cb7cb6bd834d6e037f69943aebf3d83351)
|
||||
|
||||
+ [Fix empty order edgecase](https://github.com/ripple/ripple-lib/commit/64809d9ae23dc24f47accd4b4788b48f49880d3e)
|
||||
|
||||
+ [Fix AutobridgeCalculator (RT-3445)](https://github.com/ripple/ripple-lib/commit/1fff5ea6dcbcee856536df26f3b9cf1aec3c3b55)
|
||||
|
||||
+ [Update sjcl and delete custom ripemd160, montgomery, and jacobi](https://github.com/ripple/ripple-lib/commit/50cda426eb83599c38c0b725e1524a01fc415da2)
|
||||
|
||||
+ [Fix transaction summary for transactions that fail with remoteError](https://github.com/ripple/ripple-lib/commit/5e714f6143464d7912f42537acaa553b88eaf6dc)
|
||||
|
||||
+ [Fix serializedobject append for excessively large bytes length](https://github.com/ripple/ripple-lib/commit/e93f1ab6f4aaad347450aee75a169af0faa2121c)
|
||||
|
||||
+ [Switch to sjcl npm module](https://github.com/ripple/ripple-lib/commit/9a502580fd89ec6a9aa55f4e5847f6a4a2cb5bba)
|
||||
|
||||
+ [Add babel transpiler](https://github.com/ripple/ripple-lib/commit/398f8d001f758bf575b959537a17e79e4042d17b)
|
||||
|
||||
+ [Remove unused float.js and wallet.js](https://github.com/ripple/ripple-lib/commit/d4a4b5f4fbbf09677a59ce81bace35c6426a2fda)
|
||||
|
||||
+ [Remove config singleton to reduce global state](https://github.com/ripple/ripple-lib/commit/c655c2a20ee5d150a4b5a1b6717b9fb81f636025)
|
||||
|
||||
##0.12.4
|
||||
|
||||
+ [Improve entropy security](https://github.com/ripple/ripple-lib/commit/c7ba822320880037796f57876d1abb4e525648ed)
|
||||
|
||||
+ [Remove unused crypt.js file](https://github.com/ripple/ripple-lib/commit/1f68eba1461bca03a4d22872450d15ae5a185334)
|
||||
|
||||
##0.12.3
|
||||
|
||||
+ [Add getLedgerSequence to Remote](https://github.com/ripple/ripple-lib/commit/d09548d04d3238fca653d482ec1d5faa7254559a)
|
||||
|
||||
+ [Improve randomness when generating ECDSA signatures](https://github.com/ripple/ripple-lib/commit/fe7e30b737ead6e71adfa466f5835ba546feab31)
|
||||
|
||||
+ [Improve SerializedObject.append performance](https://github.com/ripple/ripple-lib/commit/f7c35b118ebba549a64bcaa1a0629385ec6dbf6f)
|
||||
|
||||
+ [Add `Amount.scale`. Multiply an amount’s value by a scale factor](https://github.com/ripple/ripple-lib/commit/74dac97b368493056474468520f05671f458a69f)
|
||||
|
||||
|
||||
##0.12.2
|
||||
|
||||
+ [Check that stack trace is available, fixes logging in browser](https://github.com/ripple/ripple-lib/commit/53cae3a66d48e88e8a6bbb96d6489ce7b9e22975)
|
||||
|
||||
|
||||
##0.12.1
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
+ [Removed support for parsing native amounts in floating point format](https://github.com/ripple/ripple-lib/commit/e80cd1ff55deae9cd5b0ae85be957f86856b887e)
|
||||
|
||||
|
||||
**Changes**
|
||||
|
||||
+ [Fix taker pays funded calculation](https://github.com/ripple/ripple-lib/commit/5af824f5cf46c7b9caa58ee0a757bf854d26c8dc)
|
||||
|
||||
+ [Fix order funded amount calculation](https://github.com/ripple/ripple-lib/commit/b2cdb1a6aed968b1f306e8dadbd4b7ca37e5aa03)
|
||||
|
||||
+ [Fix handling of quality in order book](https://github.com/ripple/ripple-lib/commit/2a5a8b498da60df738ba18d5c265f34771e8a1af)
|
||||
|
||||
+ [Fix currency parsing of non-alphanumeric and no-currency currencies](https://github.com/ripple/ripple-lib/commit/2166bb2e88eae8d5f1aba77338f69e8a9edf6a6f)
|
||||
|
||||
+ [Add Amount.strict_mode for toggling range validation](https://github.com/ripple/ripple-lib/commit/b5ed8f59a7dab1a17491618b8d9193646c314fb4)
|
||||
|
||||
+ [Add filename and line number to log, use log.warn() for deprecations](https://github.com/ripple/ripple-lib/commit/90329d3d73f1a76675063655b407513e32dc048b)
|
||||
|
||||
+ [Add GlobalFreeze and NoFreeze flags](https://github.com/ripple/ripple-lib/commit/e2ed2bdbf6f01c7d4d690c2cf0b83fba94558dd7)
|
||||
|
||||
+ [Fix handling of falsy parameters in requestLedger](https://github.com/ripple/ripple-lib/commit/6023efed41b7812b3bab660a1c0dc9f0a21000b9)
|
||||
|
||||
+ [Fix Base:decode](https://github.com/ripple/ripple-lib/commit/719f39c01c6941d9a650aa94f95617793dd53ea0)
|
||||
|
||||
+ [Fix Amount: clone in ratio_human, product_human](https://github.com/ripple/ripple-lib/commit/19e17a8431550cf156b1ad669a19dedfe4e28e4a)
|
||||
|
||||
+ [Fix Amount.to_human for very small numbers](https://github.com/ripple/ripple-lib/commit/6abfa759aa09d68074ac558d96c4b126a7cd1719)
|
||||
|
||||
+ [Refactor base conversion](https://github.com/ripple/ripple-lib/commit/f2b63fa4a80663eb29472bc6bb1aea8159f1f205)
|
||||
|
||||
+ [Update binary transaction format](https://github.com/ripple/ripple-lib/commit/8e134918fb4c22983320a3102f955e4568bb1dfb)
|
||||
|
||||
+ [Add DefaultRipple account flag](https://github.com/ripple/ripple-lib/commit/3e249902c4cf25b4da5e75048c84ae391be83b10)
|
||||
|
||||
+ [Remove `Features` field requirement in `SetFee` transaction format](https://github.com/ripple/ripple-lib/commit/a20a649013646710c078d4ce1e210f87c7fe74fe)
|
||||
|
||||
+ [Remove `RegularKey` field requirement in `SetRegularKey` transaction format](https://github.com/ripple/ripple-lib/commit/c275174f27877ba8f389eb4efe969feb514d6e46)
|
||||
|
||||
|
||||
##0.12.0
|
||||
|
||||
**Breaking Changes**
|
||||
@@ -14,8 +134,8 @@
|
||||
- [Handle invalid input in parse_human - c8f18c8c](https://github.com/ripple/ripple-lib/commit/c8f18c8c8590b7b48e370e0325b6677b7720294f)
|
||||
- [Check for null in isNumber - b86790c8](https://github.com/ripple/ripple-lib/commit/b86790c8543c239a532fd7697d4652829019d385)
|
||||
- [Cleanup amount.js - d0fb291c](https://github.com/ripple/ripple-lib/commit/d0fb291c4e330193a244902156f1d74730da357d)
|
||||
|
||||
|
||||
|
||||
|
||||
**Changes**
|
||||
|
||||
+ [Add deprecation warnings to request constructors. The first argument to request constructor functions should be an object containing request properties](https://github.com/ripple/ripple-lib/commit/35d76b3520934285f80059c1badd6c522539104c)
|
||||
@@ -30,13 +150,13 @@
|
||||
|
||||
+ [Bumped dependencies](https://github.com/ripple/ripple-lib/commit/f9bc7cc746b44b24b61bbe260ae2e9d9617286da)
|
||||
|
||||
|
||||
|
||||
|
||||
##0.11.0
|
||||
|
||||
+ [Track the funded status of an order based on cumulative account orders](https://github.com/ripple/ripple-lib/commit/67d39737a4d5e0fcd9d9b47b9083ee00e5a9e652) and [67d3973](https://github.com/ripple/ripple-lib/commit/b6b99dde022e1e14c4797e454b1d7fca50e49482)
|
||||
|
||||
+ Remove blobvault client from ripple-lib, use the [`ripple-vault-client`](https://github.com/ripple/ripple-vault-client) instead [9b3d62b7](https://github.com/ripple/ripple-lib/commit/9b3d62b765c4c25beae6eb0fa57ef3a07f2581b1)
|
||||
+ Remove blobvault client from ripple-lib, use the [`ripple-vault-client`](https://github.com/ripple/ripple-vault-client) instead [9b3d62b7](https://github.com/ripple/ripple-lib/commit/9b3d62b765c4c25beae6eb0fa57ef3a07f2581b1)
|
||||
|
||||
+ [Add support for `ledger` option in requestBookOffers](https://github.com/ripple/ripple-lib/commit/34c0677c453c409ef0a5b351959abdc176d3bacb)
|
||||
|
||||
@@ -75,13 +195,13 @@ are locally determined to have expired: `tejMaxLedger`.
|
||||
+ [Improve memo support](https://github.com/ripple/ripple-lib/commit/1704ac4ae144c0ce54afad86f644c75a632080b1)
|
||||
- Add `MemoFormat` property for memo
|
||||
- Enforce `MemoFormat` and `MemoType` to be valid ASCII
|
||||
- Support `text` and `json` MemoFormat
|
||||
- Support `text` and `json` MemoFormat
|
||||
|
||||
+ [Update jscl library](https://github.com/ripple/ripple-lib/commit/3204998fcb6f31d6c90532a737a4adb8a1e420f6)
|
||||
- Improved entropy by taking advantage of platform crypto
|
||||
- Use jscl's k256 curve instead of altering the c256 curve with k256 configuration
|
||||
- **deprecated:** the c256 curve is linked to the k256 curve to provide backwards compatibility, this link will be removed in the future
|
||||
|
||||
|
||||
+ [Fix empty queue check on reconnect](https://github.com/ripple/ripple-lib/commit/3c21994adcf72d1fbd87d453ceb917f9ad6df4ec)
|
||||
|
||||
##0.9.4
|
||||
@@ -110,7 +230,7 @@ are locally determined to have expired: `tejMaxLedger`.
|
||||
|
||||
+ [**Breaking change**: Change accountRequest method signature](https://github.com/ripple/ripple-lib/commit/6f5d1104aa3eb440c518ec4f39e264fdce15fa15)
|
||||
|
||||
+ [Add paging behavior for account requests, `account_lines` and `account_offers`](https://github.com/ripple/ripple-lib/commit/722f4e175dbbf378e51b49142d0285f87acb22d7)
|
||||
+ [Add paging behavior for account requests, `account_lines` and `account_offers`](https://github.com/ripple/ripple-lib/commit/722f4e175dbbf378e51b49142d0285f87acb22d7)
|
||||
|
||||
+ [Add max_fee setter to transactions to set max fee the submitter is willing to pay] (https://github.com/ripple/ripple-lib/commit/24587fab9c8ad3840d7aa345a7037b48839e09d7)
|
||||
|
||||
@@ -126,7 +246,7 @@ var options = {
|
||||
ledger: < valid ledger_index or ledger_hash >
|
||||
}
|
||||
|
||||
// The `marker` comes back in an account request if there are more results than are returned
|
||||
// The `marker` comes back in an account request if there are more results than are returned
|
||||
// in the current response. The amount of results per response are determined by the `limit`.
|
||||
if (marker) {
|
||||
options.marker = < marker >;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A JavaScript API for interacting with Ripple in Node.js and the browser
|
||||
|
||||
[](https://travis-ci.org/ripple/ripple-lib) [](https://coveralls.io/r/ripple/ripple-lib?branch=develop)
|
||||
[](https://circleci.com/gh/ripple/ripple-lib/tree/develop) [](https://coveralls.io/r/ripple/ripple-lib?branch=develop)
|
||||
|
||||
[](https://www.npmjs.org/package/ripple-lib)
|
||||
|
||||
@@ -44,7 +44,7 @@ A JavaScript API for interacting with Ripple in Node.js and the browser
|
||||
$ bower install ripple
|
||||
```
|
||||
|
||||
See the [bower-ripple repo](https://github.com/ripple/bower-ripple) for additional bower instructions
|
||||
See the [bower-ripple repo](https://github.com/ripple/bower-ripple) for additional bower instructions.
|
||||
|
||||
|
||||
**Building ripple-lib for browser environments**
|
||||
|
||||
65
bin/ci.sh
Executable file
65
bin/ci.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
NODE_INDEX="$1"
|
||||
TOTAL_NODES="$2"
|
||||
|
||||
typecheck() {
|
||||
npm install -g flow-bin
|
||||
flow --version
|
||||
npm run typecheck
|
||||
}
|
||||
|
||||
lint() {
|
||||
echo "eslint $(node_modules/.bin/eslint --version)"
|
||||
npm list babel-eslint | grep babel-eslint
|
||||
REPO_URL="https://raw.githubusercontent.com/ripple/javascript-style-guide"
|
||||
curl "$REPO_URL/es6/eslintrc" > ./eslintrc
|
||||
echo "parser: babel-eslint" >> ./eslintrc
|
||||
node_modules/.bin/eslint -c ./eslintrc $(git --no-pager diff --name-only -M100% --diff-filter=AM --relative $(git merge-base FETCH_HEAD origin/HEAD) FETCH_HEAD | grep "\.js$")
|
||||
}
|
||||
|
||||
unittest() {
|
||||
# test "src"
|
||||
npm test --coverage
|
||||
npm run coveralls
|
||||
|
||||
# test compiled version in "dist/npm"
|
||||
babel -D --optional runtime --ignore "**/node_modules/**" -d test-compiled/ test/
|
||||
echo "--reporter spec --timeout 5000 --slow 500" > test-compiled/mocha.opts
|
||||
mkdir -p test-compiled/node_modules
|
||||
ln -nfs ../../dist/npm/core test-compiled/node_modules/ripple-lib
|
||||
ln -nfs ../../dist/npm test-compiled/node_modules/ripple-api
|
||||
mocha --opts test-compiled/mocha.opts test-compiled
|
||||
rm -rf test-compiled
|
||||
}
|
||||
|
||||
oneNode() {
|
||||
lint
|
||||
typecheck
|
||||
unittest
|
||||
}
|
||||
|
||||
twoNodes() {
|
||||
case "$NODE_INDEX" in
|
||||
0) lint && unittest;;
|
||||
1) typecheck;;
|
||||
*) echo "ERROR: invalid usage"; exit 2;;
|
||||
esac
|
||||
}
|
||||
|
||||
threeNodes() {
|
||||
case "$NODE_INDEX" in
|
||||
0) lint;;
|
||||
1) typecheck;;
|
||||
2) unittest;;
|
||||
*) echo "ERROR: invalid usage"; exit 2;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "$TOTAL_NODES" in
|
||||
"") oneNode;;
|
||||
1) oneNode;;
|
||||
2) twoNodes;;
|
||||
3) threeNodes;;
|
||||
*) echo "ERROR: invalid usage"; exit 2;;
|
||||
esac
|
||||
@@ -1,47 +1,52 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable no-var */
|
||||
'use strict';
|
||||
var SerializedObject = require('..').SerializedObject;
|
||||
|
||||
var SerializedObject = require('../src/js/ripple/serializedobject').SerializedObject;
|
||||
function main() {
|
||||
var argv = process.argv.slice(2);
|
||||
var blob = argv.shift();
|
||||
|
||||
var argv = process.argv.slice(2);
|
||||
|
||||
var blob;
|
||||
|
||||
blob = argv.shift();
|
||||
|
||||
if (blob === '-') {
|
||||
read_input(ready);
|
||||
} else {
|
||||
ready();
|
||||
if (blob === '-') {
|
||||
read_input(ready);
|
||||
} else {
|
||||
ready(blob);
|
||||
}
|
||||
}
|
||||
|
||||
function read_input(callback) {
|
||||
tx_json = '';
|
||||
process.stdin.on('data', function(data) { tx_json += data; });
|
||||
var tx_json = '';
|
||||
process.stdin.on('data', function(data) {
|
||||
tx_json += data;
|
||||
});
|
||||
process.stdin.on('end', callback);
|
||||
process.stdin.resume();
|
||||
}
|
||||
|
||||
function ready() {
|
||||
function ready(blob) {
|
||||
var valid_arguments = blob;
|
||||
|
||||
if (!valid_arguments) {
|
||||
console.error('Invalid arguments\n');
|
||||
print_usage();
|
||||
} else {
|
||||
decode();
|
||||
}
|
||||
decode(blob);
|
||||
}
|
||||
}
|
||||
|
||||
function print_usage() {
|
||||
/* eslint-disable max-len */
|
||||
console.log(
|
||||
'Usage: decode_binary.js <hex_blob>\n\n',
|
||||
'Example: decode_binary.js 120000240000000161D6871AFD498D00000000000000000000000000005553440000000000550FC62003E785DC231A1058A05E56E3F09CF4E668400000000000000A732102AE75B908F0A95F740A7BFA96057637E5C2170BC8DAD13B2F7B52AE75FAEBEFCF811450F97A072F1C4357F1AD84566A609479D927C9428314550FC62003E785DC231A1058A05E56E3F09CF4E6'
|
||||
);
|
||||
};
|
||||
/* eslint-enable max-len */
|
||||
}
|
||||
|
||||
function decode() {
|
||||
buffer = new SerializedObject(blob);
|
||||
function decode(blob) {
|
||||
var buffer = new SerializedObject(blob);
|
||||
console.log(buffer.to_json());
|
||||
};
|
||||
}
|
||||
|
||||
main();
|
||||
// vim:sw=2:sts=2:ts=8:et
|
||||
|
||||
123
bin/rsign.js
123
bin/rsign.js
@@ -1,62 +1,23 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var Transaction = require('../src/js/ripple/transaction').Transaction;
|
||||
|
||||
var argv = process.argv.slice(2);
|
||||
|
||||
var verbose;
|
||||
var secret;
|
||||
var tx_json;
|
||||
|
||||
if (~argv.indexOf('-v')){
|
||||
argv.splice(argv.indexOf('-v'), 1);
|
||||
verbose = true;
|
||||
}
|
||||
|
||||
secret = argv.shift();
|
||||
tx_json = argv.shift();
|
||||
|
||||
if (tx_json === '-') {
|
||||
read_input(ready);
|
||||
} else {
|
||||
ready();
|
||||
}
|
||||
/* eslint-disable no-var */
|
||||
'use strict';
|
||||
var Transaction = require('..').Transaction;
|
||||
|
||||
function read_input(callback) {
|
||||
tx_json = '';
|
||||
process.stdin.on('data', function(data) { tx_json += data; });
|
||||
process.stdin.on('end', callback);
|
||||
var stdin = '';
|
||||
process.stdin.on('data', function(data) {
|
||||
stdin += data;
|
||||
});
|
||||
process.stdin.on('end', function() {
|
||||
callback(stdin);
|
||||
});
|
||||
process.stdin.resume();
|
||||
}
|
||||
|
||||
function ready() {
|
||||
var valid_arguments = secret && tx_json;
|
||||
|
||||
if (!valid_arguments) {
|
||||
console.error('Invalid arguments\n');
|
||||
print_usage();
|
||||
} else {
|
||||
var valid_json = true;
|
||||
|
||||
try {
|
||||
tx_json = JSON.parse(tx_json);
|
||||
} catch(exception) {
|
||||
valid_json = false;
|
||||
}
|
||||
|
||||
if (!valid_json) {
|
||||
console.error('Invalid JSON\n');
|
||||
print_usage();
|
||||
} else {
|
||||
sign_transaction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function print_usage() {
|
||||
console.log(
|
||||
'Usage: rsign.js <secret> <json>\n\n',
|
||||
'Example: rsign.js ssq55ueDob4yV3kPVnNQLHB6icwpC','\''+
|
||||
'Example: rsign.js ssq55ueDob4yV3kPVnNQLHB6icwpC', '\'' +
|
||||
JSON.stringify({
|
||||
TransactionType: 'Payment',
|
||||
Account: 'r3P9vH81KBayazSTrQj6S25jW6kDb779Gi',
|
||||
@@ -64,14 +25,14 @@ function print_usage() {
|
||||
Amount: '200000000',
|
||||
Fee: '10',
|
||||
Sequence: 1
|
||||
})+'\''
|
||||
);
|
||||
};
|
||||
}) + '\''
|
||||
);
|
||||
}
|
||||
|
||||
function sign_transaction() {
|
||||
function sign_transaction(tx_json_object, secret, verbose) {
|
||||
var tx = new Transaction();
|
||||
|
||||
tx.tx_json = tx_json;
|
||||
tx.tx_json = tx_json_object;
|
||||
tx._secret = secret;
|
||||
tx.complete();
|
||||
|
||||
@@ -81,16 +42,56 @@ function sign_transaction() {
|
||||
|
||||
if (verbose) {
|
||||
var sim = { };
|
||||
|
||||
sim.tx_blob = tx.serialize().to_hex();
|
||||
sim.tx_json = tx.tx_json;
|
||||
sim.tx_blob = tx.serialize().to_hex();
|
||||
sim.tx_json = tx.tx_json;
|
||||
sim.tx_signing_hash = unsigned_hash;
|
||||
sim.tx_unsigned = unsigned_blob;
|
||||
|
||||
sim.tx_unsigned = unsigned_blob;
|
||||
console.log(JSON.stringify(sim, null, 2));
|
||||
} else {
|
||||
console.log(tx.serialize().to_hex());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function ready(tx_json, secret, verbose) {
|
||||
if (!(tx_json && secret)) {
|
||||
console.error('Invalid arguments\n');
|
||||
print_usage();
|
||||
return;
|
||||
}
|
||||
|
||||
var tx_json_object;
|
||||
try {
|
||||
tx_json_object = JSON.parse(tx_json);
|
||||
} catch(exception) {
|
||||
console.error('Invalid JSON\n');
|
||||
print_usage();
|
||||
return;
|
||||
}
|
||||
sign_transaction(tx_json_object, secret, verbose);
|
||||
}
|
||||
|
||||
function main() {
|
||||
var argv = process.argv.slice(2);
|
||||
var verbose;
|
||||
var secret;
|
||||
var tx_json;
|
||||
|
||||
if (~argv.indexOf('-v')) {
|
||||
argv.splice(argv.indexOf('-v'), 1);
|
||||
verbose = true;
|
||||
}
|
||||
|
||||
secret = argv.shift();
|
||||
tx_json = argv.shift();
|
||||
|
||||
if (tx_json === '-') {
|
||||
read_input(function(stdin) {
|
||||
ready(stdin, secret, verbose);
|
||||
});
|
||||
} else {
|
||||
ready(tx_json, secret, verbose);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
// vim:sw=2:sts=2:ts=8:et
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable no-var */
|
||||
'use strict';
|
||||
var UInt160 = require('..').UInt160;
|
||||
|
||||
var UInt160 = require('../').UInt160;
|
||||
var address = process.argv[2];
|
||||
function main() {
|
||||
var address = process.argv[2];
|
||||
|
||||
if (address === '-') {
|
||||
readInput(validateAddress);
|
||||
} else {
|
||||
validateAddress(address);
|
||||
if (address === '-') {
|
||||
readInput(validateAddress);
|
||||
} else {
|
||||
validateAddress(address);
|
||||
}
|
||||
}
|
||||
|
||||
function readInput(callback) {
|
||||
@@ -19,8 +23,10 @@ function readInput(callback) {
|
||||
process.stdin.on('end', function() {
|
||||
callback(result);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function validateAddress(address) {
|
||||
process.stdout.write((UInt160.is_valid(address.trim()) ? '0' : '1') + '\r\n');
|
||||
};
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
7
circle.yml
Normal file
7
circle.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
machine:
|
||||
node:
|
||||
version: 0.12.0
|
||||
test:
|
||||
override:
|
||||
- bin/ci.sh "$CIRCLE_NODE_INDEX" "$CIRCLE_NODE_TOTAL":
|
||||
parallel: true
|
||||
@@ -1,3 +0,0 @@
|
||||
start newcoin
|
||||
sleep 4
|
||||
start index.html
|
||||
@@ -18,7 +18,7 @@ This file provides step-by-step walkthroughs for some of the most common usages
|
||||
|
||||
##Connecting to the Ripple network
|
||||
|
||||
1. [Get ripple-lib](README.md#getting-ripple-lib)
|
||||
1. [Get ripple-lib](../README.md#installation)
|
||||
2. Load the ripple-lib module into a Node.js file or webpage:
|
||||
```js
|
||||
/* Loading ripple-lib with Node.js */
|
||||
@@ -37,7 +37,7 @@ This file provides step-by-step walkthroughs for some of the most common usages
|
||||
servers: [
|
||||
{ host: 's-west.ripple.com', port: 443, secure: true }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var remote = new Remote(options);
|
||||
|
||||
@@ -173,7 +173,7 @@ See the [wiki](https://ripple.com/wiki/JSON_Messages#subscribe) for details on s
|
||||
|
||||
##Submitting a payment to the network
|
||||
|
||||
Submitting a payment transaction to the Ripple network involves connecting to a `Remote`, creating a transaction, signing it with the user's secret, and submitting it to the `rippled` server. Note that the `Amount` module is used to convert human-readable amounts like '1XRP' or '10.50USD' to the type of Amount object used by the Ripple network.
|
||||
Submitting a payment transaction to the Ripple network involves connecting to a `Remote`, creating a transaction, signing it with the user's secret, and submitting it to the `rippled` server. Note that the `Amount` module is used to convert human-readable amounts like '1 XRP' or '10.50 USD' to the type of Amount object used by the Ripple network.
|
||||
|
||||
```js
|
||||
/* Loading ripple-lib Remote and Amount modules in Node.js */
|
||||
@@ -187,7 +187,7 @@ var Amount = require('ripple-lib').Amount;
|
||||
var MY_ADDRESS = 'rrrMyAddress';
|
||||
var MY_SECRET = 'secret';
|
||||
var RECIPIENT = 'rrrRecipient';
|
||||
var AMOUNT = Amount.from_human('1XRP');
|
||||
var AMOUNT = Amount.from_human('1 USD').set_issuer('rrrIssuer');
|
||||
|
||||
var remote = new Remote({ /* Remote options */ });
|
||||
|
||||
|
||||
358
docs/api.html
Normal file
358
docs/api.html
Normal file
@@ -0,0 +1,358 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.method {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.details {
|
||||
font-family: "Courier New", monospace;
|
||||
white-space: pre;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function toggle(element) {
|
||||
var results = element.parentElement.getElementsByClassName('details');
|
||||
if (results.length > 0) {
|
||||
var style = results[0].style;
|
||||
style.display = (style.display === 'block') ? 'none' : 'block';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2><a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/index.js">RippleAPI</a></h2>
|
||||
|
||||
<div class="method">
|
||||
connect()
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
disconnect()
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
isConnected()
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
getServerInfo()
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
getFee()
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
getLedgerVersion()
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-transaction.json">getTransaction</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/hash256.json">identifier</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/transaction-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
identifier: txhash
|
||||
options: {minLedgerVersion: int, maxLedgerVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-transactions.json">getTransactions</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/transactions-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
options: {
|
||||
start: txhash,
|
||||
limit: int,
|
||||
minLedgerVersion: int,
|
||||
maxLedgerVersion: int,
|
||||
earliestFirst: bool,
|
||||
excludeFailures: bool,
|
||||
initiated: bool,
|
||||
counterparty: address,
|
||||
types: [string],
|
||||
binary: bool
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-trustlines.json">getTrustlines</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/trustlines-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
options: {counterparty: address, currency: string, limit: int, ledgerVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-balances.json">getBalances</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/trustlines-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
options: {counterparty: address, currency: string, limit: int, ledgerVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-paths.json">getPaths</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/pathfind.json">pathfind</a>
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
pathfind: {
|
||||
source: {
|
||||
address: address,
|
||||
currencies: [{
|
||||
currency: string,
|
||||
counterparty: address
|
||||
}]
|
||||
},
|
||||
destination: adjustment
|
||||
}
|
||||
|
||||
adjustment = {address: address, amount: amount, tag?: int}
|
||||
amount = {currency: string, counterparty: address, value: floatstr}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-orders.json">getOrders</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/orders-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
options: {limit: int, ledverVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-orderbook.json">getOrderbook</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/orderbook.json">orderbook</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/orders-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
orderbook: {
|
||||
base: {
|
||||
currency,
|
||||
counterparty
|
||||
},
|
||||
counter: {
|
||||
currency,
|
||||
counterparty
|
||||
}
|
||||
}
|
||||
options: {limit: int, ledverVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-settings.json">getSettings</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/settings-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
options: {ledgerVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/get-account-info.json">getAccountInfo</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/settings-options.json">options</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
options: {ledgerVersion: int}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/tx.json">preparePayment</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/payment.json">payment</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/instructions.json">instructions</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
payment: {
|
||||
source: adjustment,
|
||||
destination: adjustment,
|
||||
paths?: string,
|
||||
slippage?: strfloat,
|
||||
memos?: [{
|
||||
type: string,
|
||||
format: string,
|
||||
data: string
|
||||
}],
|
||||
invoiceID?: hash256,
|
||||
allowPartialPayment?: bool,
|
||||
noDirectRipple?: bool,
|
||||
limitQuality?: bool
|
||||
}
|
||||
|
||||
adjustment = {address: address, amount: amount, tag?: int}
|
||||
amount = {currency: string, counterparty: address, value: floatstr}
|
||||
|
||||
instructions: {
|
||||
sequence: int,
|
||||
fee: floatstr,
|
||||
maxFee: floatstr,
|
||||
maxLedgerVersion: int,
|
||||
maxLedgerVersionOffset: int
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/tx.json">prepareTrustline</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/trustline.json">trustline</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/instructions.json">instructions</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
trustline: {
|
||||
currency: string,
|
||||
counterparty: address,
|
||||
limit: strfloat,
|
||||
qualityIn?: float,
|
||||
qualityOut?: float,
|
||||
allowRippling?: bool,
|
||||
authorized?: bool,
|
||||
frozen?: bool
|
||||
}
|
||||
|
||||
instructions: {
|
||||
sequence: int,
|
||||
fee: floatstr,
|
||||
maxFee: floatstr,
|
||||
maxLedgerVersion: int,
|
||||
maxLedgerVersionOffset: int
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/tx.json">prepareOrder</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/order.json">order</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/instructions.json">instructions</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
order: {
|
||||
direction: ("buy"|"sell"),
|
||||
quantity: amount,
|
||||
totalPrice: amount,
|
||||
immediateOrCancel?: bool,
|
||||
fillOrKill?: bool,
|
||||
passive?: bool
|
||||
}
|
||||
|
||||
amount = {currency: string, counterparty: address, value: floatstr}
|
||||
|
||||
instructions: {
|
||||
sequence: int,
|
||||
fee: floatstr,
|
||||
maxFee: floatstr,
|
||||
maxLedgerVersion: int,
|
||||
maxLedgerVersionOffset: int
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/tx.json">prepareOrderCancellation</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/sequence.json">sequence</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/instructions.json">instructions</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
sequence: int
|
||||
|
||||
instructions: {
|
||||
sequence: int,
|
||||
fee: floatstr,
|
||||
maxFee: floatstr,
|
||||
maxLedgerVersion: int,
|
||||
maxLedgerVersionOffset: int
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/tx.json">prepareSettings</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/address.json">account</a>,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/settings.json">settings</a>[,
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/instructions.json">instructions</a>]
|
||||
)
|
||||
<a href="#" onclick="javascript:toggle(this)">+</a>
|
||||
<div class="details">
|
||||
settings: {
|
||||
passwordSpent: bool,
|
||||
requireDestinationTag: bool,
|
||||
requireAuthorization: bool,
|
||||
disallowIncomingXRP: bool,
|
||||
disableMasterKey: bool,
|
||||
enableTransactionIDTracking: bool,
|
||||
noFreeze: bool,
|
||||
globalFreeze: bool,
|
||||
defaultRipple: bool,
|
||||
emailHash: hash128,
|
||||
walletLocator: hash256,
|
||||
walletSize: int,
|
||||
messageKey: string,
|
||||
domain: string,
|
||||
transferRate: float,
|
||||
signers: string,
|
||||
regularKey: address
|
||||
}
|
||||
|
||||
instructions: {
|
||||
sequence: int,
|
||||
fee: floatstr,
|
||||
maxFee: floatstr,
|
||||
maxLedgerVersion: int,
|
||||
maxLedgerVersionOffset: int
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/sign.json">sign</a>(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/tx.json">txJSON</a>,
|
||||
secret)
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
submit(
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/schemas/blob.json">txBlob</a>
|
||||
)
|
||||
</div>
|
||||
|
||||
<div class="method">
|
||||
generateWallet()
|
||||
</div>
|
||||
|
||||
<a href="https://github.com/ripple/ripple-lib/blob/develop/src/api/common/errors.js">errors</a>
|
||||
</body>
|
||||
</html>
|
||||
3
docs/samples/README
Normal file
3
docs/samples/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Usage:
|
||||
babel-node balances.js
|
||||
babel-node payment.js (requires setting address and secret in source file first)
|
||||
12
docs/samples/balances.js
Normal file
12
docs/samples/balances.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
const RippleAPI = require('../../src').RippleAPI; // require('ripple-lib')
|
||||
|
||||
const api = new RippleAPI({servers: ['wss://s1.ripple.com:443']});
|
||||
const address = 'r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV';
|
||||
|
||||
api.connect().then(() => {
|
||||
api.getBalances(address).then(balances => {
|
||||
console.log(JSON.stringify(balances, null, 2));
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
41
docs/samples/payment.js
Normal file
41
docs/samples/payment.js
Normal file
@@ -0,0 +1,41 @@
|
||||
'use strict';
|
||||
const RippleAPI = require('../../src').RippleAPI; // require('ripple-lib')
|
||||
|
||||
const address = 'INSERT ADDRESS HERE';
|
||||
const secret = 'INSERT SECRET HERE';
|
||||
|
||||
const api = new RippleAPI({servers: ['wss://s1.ripple.com:443']});
|
||||
const instructions = {maxLedgerVersionOffset: 5};
|
||||
|
||||
const payment = {
|
||||
source: {
|
||||
address: address,
|
||||
amount: {
|
||||
value: '0.01',
|
||||
currency: 'XRP'
|
||||
}
|
||||
},
|
||||
destination: {
|
||||
address: 'rKmBGxocj9Abgy25J51Mk1iqFzW9aVF9Tc',
|
||||
amount: {
|
||||
value: '0.01',
|
||||
currency: 'XRP'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
api.connect().then(() => {
|
||||
console.log('Connected...');
|
||||
api.preparePayment(address, payment, instructions).then(txJSON => {
|
||||
console.log('Payment transaction prepared...');
|
||||
const signedTransaction = api.sign(txJSON, secret).signedTransaction;
|
||||
console.log('Payment transaction signed...');
|
||||
api.submit(signedTransaction).then(response => {
|
||||
console.log(response);
|
||||
process.exit(0);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
72
eslint.json
72
eslint.json
@@ -1,72 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"no-use-before-define": 1,
|
||||
"no-undef": 1,
|
||||
"no-unused-expressions": 1,
|
||||
"no-unused-vars": 1,
|
||||
"no-extend-native": 1,
|
||||
"no-native-reassign": 1,
|
||||
"no-trailing-spaces": 1,
|
||||
"no-empty": 1,
|
||||
"no-inner-declarations": 1,
|
||||
"no-irregular-whitespace": 1,
|
||||
"no-negated-in-lhs": 1,
|
||||
"no-obj-calls": 1,
|
||||
"no-reserved-keys": 1,
|
||||
"no-sparse-arrays": 1,
|
||||
"no-unreachable": 1,
|
||||
"use-isnan": 1,
|
||||
"valid-jsdoc": 1,
|
||||
"valid-typeof": 1,
|
||||
"block-scoped-var": 1,
|
||||
"dot-notation": 1,
|
||||
"semi": 1,
|
||||
"curly": 1,
|
||||
"eqeqeq": 1,
|
||||
"no-else-return": 1,
|
||||
"new-cap": 1,
|
||||
"new-parens": 1,
|
||||
"no-comma-dangle": 1,
|
||||
"no-empty-label": 1,
|
||||
"no-eval": 1,
|
||||
"no-extra-bind": 1,
|
||||
"no-fallthrough": 1,
|
||||
"no-lone-blocks": 1,
|
||||
"no-loop-func": 1,
|
||||
"no-multi-spaces": 1,
|
||||
"no-return-assign": 1,
|
||||
"no-sequences": 1,
|
||||
"no-with": 1,
|
||||
"radix": 1,
|
||||
"yoda": [ 1, "never" ],
|
||||
"no-catch-shadow": 1,
|
||||
"no-shadow-restricted-names": 1,
|
||||
"no-delete-var": 1,
|
||||
"no-undefined": 1,
|
||||
"handle-callback-err": 1,
|
||||
"brace-style": [ 1, "1tbs", { "allowSingleLine": false } ],
|
||||
"comma-spacing": [ 1, { "before": false, "after": true } ],
|
||||
"comma-style": [ 1, "last" ],
|
||||
"consistent-this": [ 1, "self" ],
|
||||
"func-style": [ 1, "declaration" ],
|
||||
"key-spacing": [ 1, { "beforeColon": false, "afterColon": true } ],
|
||||
"max-nested-callbacks": [ 1, 2 ],
|
||||
"no-lonely-if": 1,
|
||||
"no-mixed-spaces-and-tabs": 1,
|
||||
"no-multiple-empty-lines": 1,
|
||||
"no-space-before-semi": 1,
|
||||
"no-spaced-func": 1,
|
||||
"space-after-keywords": [ 1, "always" ],
|
||||
"space-infix-ops": 1,
|
||||
"space-return-throw-case": 1,
|
||||
"spaced-line-comment": 1,
|
||||
"max-params": [ 1, 4 ],
|
||||
"max-depth": [1, 3 ],
|
||||
"max-len": [ 1, 80 ],
|
||||
"quotes": [ 1, "single" ]
|
||||
}
|
||||
}
|
||||
309
npm-shrinkwrap.json
generated
309
npm-shrinkwrap.json
generated
@@ -1,181 +1,222 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"version": "0.12.0",
|
||||
"version": "0.13.0-rc13",
|
||||
"npm-shrinkwrap-version": "5.4.0",
|
||||
"node-version": "v0.12.7",
|
||||
"dependencies": {
|
||||
"async": {
|
||||
"version": "0.9.0",
|
||||
"from": "async@>=0.9.0 <0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
|
||||
"version": "0.9.2",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz"
|
||||
},
|
||||
"babel-runtime": {
|
||||
"version": "5.8.25",
|
||||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.25.tgz",
|
||||
"dependencies": {
|
||||
"core-js": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-1.1.4.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bignumber.js": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.0.7.tgz"
|
||||
},
|
||||
"bn.js": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-3.1.2.tgz"
|
||||
},
|
||||
"es6-promisify": {
|
||||
"version": "2.0.0",
|
||||
"from": "bignumber.js@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.0.0.tgz"
|
||||
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-2.0.0.tgz",
|
||||
"dependencies": {
|
||||
"es6-promise": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-2.3.0.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "1.2.1",
|
||||
"from": "extend@>=1.2.1 <1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz"
|
||||
},
|
||||
"lodash": {
|
||||
"version": "3.1.0",
|
||||
"from": "lodash@>=3.1.0 <4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.1.0.tgz"
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "2.5.0",
|
||||
"from": "lru-cache@>=2.5.0 <2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
|
||||
},
|
||||
"ripple-wallet-generator": {
|
||||
"version": "1.0.1",
|
||||
"from": "ripple-wallet-generator@1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ripple-wallet-generator/-/ripple-wallet-generator-1.0.1.tgz"
|
||||
},
|
||||
"superagent": {
|
||||
"version": "0.18.2",
|
||||
"from": "superagent@>=0.18.0 <0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/superagent/-/superagent-0.18.2.tgz",
|
||||
"hash.js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",
|
||||
"dependencies": {
|
||||
"qs": {
|
||||
"version": "0.6.6",
|
||||
"from": "qs@0.6.6",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz"
|
||||
},
|
||||
"formidable": {
|
||||
"version": "1.0.14",
|
||||
"from": "formidable@1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz"
|
||||
},
|
||||
"mime": {
|
||||
"version": "1.2.11",
|
||||
"from": "mime@1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
|
||||
},
|
||||
"component-emitter": {
|
||||
"version": "1.1.2",
|
||||
"from": "component-emitter@1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz"
|
||||
},
|
||||
"methods": {
|
||||
"version": "1.0.1",
|
||||
"from": "methods@1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.0.1.tgz"
|
||||
},
|
||||
"cookiejar": {
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"from": "cookiejar@2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.1.tgz"
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"https-proxy-agent": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz",
|
||||
"dependencies": {
|
||||
"agent-base": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.0.1.tgz",
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "1.0.4",
|
||||
"from": "debug@>=1.0.1 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-1.0.4.tgz",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
|
||||
"dependencies": {
|
||||
"ms": {
|
||||
"version": "0.6.2",
|
||||
"from": "ms@0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"reduce-component": {
|
||||
"version": "1.0.1",
|
||||
"from": "reduce-component@1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/reduce-component/-/reduce-component-1.0.1.tgz"
|
||||
"extend": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"is-my-json-valid": {
|
||||
"version": "2.12.2",
|
||||
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.2.tgz",
|
||||
"dependencies": {
|
||||
"generate-function": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"
|
||||
},
|
||||
"form-data": {
|
||||
"version": "0.1.3",
|
||||
"from": "form-data@0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.3.tgz",
|
||||
"generate-object-property": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
|
||||
"dependencies": {
|
||||
"combined-stream": {
|
||||
"version": "0.0.7",
|
||||
"from": "combined-stream@>=0.0.4 <0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
|
||||
"dependencies": {
|
||||
"delayed-stream": {
|
||||
"version": "0.0.5",
|
||||
"from": "delayed-stream@0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
|
||||
}
|
||||
}
|
||||
"is-property": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "1.0.27-1",
|
||||
"from": "readable-stream@1.0.27-1",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz",
|
||||
"jsonpointer": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz"
|
||||
},
|
||||
"xtend": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.2.tgz"
|
||||
},
|
||||
"ripple-address-codec": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-2.0.1.tgz",
|
||||
"dependencies": {
|
||||
"x-address-codec": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/x-address-codec/-/x-address-codec-0.7.0.tgz",
|
||||
"dependencies": {
|
||||
"core-util-is": {
|
||||
"base-x": {
|
||||
"version": "1.0.1",
|
||||
"from": "core-util-is@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
|
||||
},
|
||||
"isarray": {
|
||||
"version": "0.0.1",
|
||||
"from": "isarray@0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"from": "string_decoder@>=0.10.0 <0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"from": "inherits@>=2.0.1 <2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ws": {
|
||||
"version": "0.7.1",
|
||||
"from": "ws@>=0.7.1 <0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-0.7.1.tgz",
|
||||
"ripple-keypairs": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/ripple-keypairs/-/ripple-keypairs-0.9.0.tgz",
|
||||
"dependencies": {
|
||||
"options": {
|
||||
"version": "0.0.6",
|
||||
"from": "options@>=0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz"
|
||||
"brorand": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz"
|
||||
},
|
||||
"ultron": {
|
||||
"version": "1.0.1",
|
||||
"from": "ultron@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.1.tgz"
|
||||
},
|
||||
"bufferutil": {
|
||||
"version": "1.0.1",
|
||||
"from": "bufferutil@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-1.0.1.tgz",
|
||||
"elliptic": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-5.1.0.tgz",
|
||||
"dependencies": {
|
||||
"bindings": {
|
||||
"version": "1.2.1",
|
||||
"from": "bindings@>=1.2.0 <1.3.0"
|
||||
},
|
||||
"nan": {
|
||||
"version": "1.6.1",
|
||||
"from": "nan@>=1.6.0 <1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-1.6.1.tgz"
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"version": "1.0.1",
|
||||
"from": "utf-8-validate@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-1.0.1.tgz",
|
||||
"ripple-address-codec": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-1.6.0.tgz",
|
||||
"dependencies": {
|
||||
"x-address-codec": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/x-address-codec/-/x-address-codec-0.6.0.tgz",
|
||||
"dependencies": {
|
||||
"base-x": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ripple-lib-transactionparser": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/ripple-lib-transactionparser/-/ripple-lib-transactionparser-0.5.1.tgz"
|
||||
},
|
||||
"ripple-lib-value": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ripple-lib-value/-/ripple-lib-value-0.1.0.tgz"
|
||||
},
|
||||
"sjcl-codec": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/sjcl-codec/-/sjcl-codec-0.1.0.tgz"
|
||||
},
|
||||
"ws": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-0.7.2.tgz",
|
||||
"dependencies": {
|
||||
"bufferutil": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-1.1.0.tgz",
|
||||
"dependencies": {
|
||||
"bindings": {
|
||||
"version": "1.2.1",
|
||||
"from": "bindings@>=1.2.0 <1.3.0"
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz"
|
||||
},
|
||||
"nan": {
|
||||
"version": "1.6.1",
|
||||
"from": "nan@>=1.6.0 <1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-1.6.1.tgz"
|
||||
"version": "1.8.4",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-1.8.4.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz"
|
||||
},
|
||||
"ultron": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz"
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-1.1.0.tgz",
|
||||
"dependencies": {
|
||||
"bindings": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz"
|
||||
},
|
||||
"nan": {
|
||||
"version": "1.8.4",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-1.8.4.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
64
package.json
64
package.json
@@ -1,58 +1,70 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"version": "0.12.0",
|
||||
"version": "0.13.0-rc13",
|
||||
"license": "ISC",
|
||||
"description": "A JavaScript API for interacting with Ripple in Node.js and the browser",
|
||||
"files": [
|
||||
"src/js/*",
|
||||
"dist/npm/*",
|
||||
"bin/*",
|
||||
"build/*",
|
||||
"test/*",
|
||||
"Makefile",
|
||||
"Gulpfile.js"
|
||||
],
|
||||
"main": "src/js/ripple",
|
||||
"main": "dist/npm/",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "~0.9.0",
|
||||
"bignumber.js": "^2.0.0",
|
||||
"babel-runtime": "^5.5.4",
|
||||
"bignumber.js": "^2.0.3",
|
||||
"bn.js": "^3.1.1",
|
||||
"es6-promisify": "^2.0.0",
|
||||
"extend": "~1.2.1",
|
||||
"hash.js": "^1.0.3",
|
||||
"https-proxy-agent": "^1.0.0",
|
||||
"is-my-json-valid": "^2.12.2",
|
||||
"lodash": "^3.1.0",
|
||||
"lru-cache": "~2.5.0",
|
||||
"ripple-wallet-generator": "1.0.1",
|
||||
"ws": "~0.7.1",
|
||||
"superagent": "^0.18.0"
|
||||
"ripple-address-codec": "^2.0.1",
|
||||
"ripple-keypairs": "^0.9.0",
|
||||
"ripple-lib-transactionparser": "^0.5.1",
|
||||
"ripple-lib-value": "0.1.0",
|
||||
"sjcl-codec": "0.1.0",
|
||||
"ws": "~0.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"assert-diff": "0.0.4",
|
||||
"assert-diff": "^1.0.1",
|
||||
"babel": "^5.8.21",
|
||||
"babel-core": "^5.8.22",
|
||||
"babel-eslint": "^4.0.5",
|
||||
"babel-loader": "^5.3.2",
|
||||
"coveralls": "~2.10.0",
|
||||
"eslint": "^0.13.0",
|
||||
"eslint": "^1.3.0",
|
||||
"eslint-plugin-flowtype": "^1.0.0",
|
||||
"eventemitter2": "^0.4.14",
|
||||
"flow-bin": "^0.14",
|
||||
"gulp": "~3.8.10",
|
||||
"gulp-bump": "~0.1.13",
|
||||
"gulp-clean-dest": "^0.1.0",
|
||||
"gulp-concat": "~2.4.3",
|
||||
"gulp-filelog": "^0.4.1",
|
||||
"gulp-flowtype": "^0.4.1",
|
||||
"gulp-plumber": "^0.6.6",
|
||||
"gulp-react": "^2.0.0",
|
||||
"gulp-rename": "~1.2.0",
|
||||
"gulp-uglify": "~1.1.0",
|
||||
"gulp-util": "^3.0.3",
|
||||
"gulp-watch": "^4.1.0",
|
||||
"istanbul": "~0.3.5",
|
||||
"map-stream": "~0.1.0",
|
||||
"json-loader": "^0.5.2",
|
||||
"mocha": "~2.1.0",
|
||||
"nock": "^0.34.1",
|
||||
"webpack": "~1.5.3",
|
||||
"yargs": "~1.3.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node_modules/.bin/gulp",
|
||||
"pretest": "node_modules/.bin/gulp concat-sjcl",
|
||||
"test": "./node_modules/.bin/istanbul test -x build/sjcl.js -x src/js/jsbn/* ./node_modules/mocha/bin/_mocha -- --reporter ${MOCHA_REPORTER:=spec} test/*-test.js",
|
||||
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
|
||||
"lint": "eslint --reset -c eslint.json src/js/ripple/*.js",
|
||||
"build": "gulp",
|
||||
"clean": "rm -rf dist/npm && rm -rf build/flow",
|
||||
"typecheck": "babel --optional runtime --blacklist flow -d build/flow/ src/ && flow check",
|
||||
"compile": "babel -D --optional runtime -d dist/npm/ src/",
|
||||
"watch": "babel -w -D --optional runtime -d dist/npm/ src/",
|
||||
"compile-with-source-maps": "babel -D --optional runtime -s -t -d dist/npm/ src/",
|
||||
"prepublish": "npm run clean && npm run compile",
|
||||
"test": "istanbul test _mocha",
|
||||
"coveralls": "cat ./coverage/lcov.info | coveralls",
|
||||
"lint": "if ! [ -f eslintrc ]; then curl -o eslintrc 'https://raw.githubusercontent.com/ripple/javascript-style-guide/es6/eslintrc'; echo 'parser: babel-eslint' >> eslintrc; fi; eslint -c eslintrc src/",
|
||||
"perf": "./scripts/perf_test.sh"
|
||||
},
|
||||
"repository": {
|
||||
@@ -61,6 +73,6 @@
|
||||
},
|
||||
"readmeFilename": "README.md",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ then
|
||||
mkdir -p "$DIR/cache"
|
||||
curl -L "$URL" > "$DEST"
|
||||
fi
|
||||
time node "$DIR/verify_ledger_json.js" "$DEST"
|
||||
npm run compile && time node "$DIR/verify_ledger_json.js" "$DEST"
|
||||
|
||||
@@ -17,16 +17,16 @@ echo "publish to npm"
|
||||
npm publish
|
||||
exit_on_error
|
||||
|
||||
rm -rf dist
|
||||
rm -rf dist/bower
|
||||
echo ""
|
||||
echo "publish to bower"
|
||||
|
||||
git clone git@github.com:ripple/bower-ripple.git dist
|
||||
git clone git@github.com:ripple/bower-ripple.git dist/bower
|
||||
gulp bower
|
||||
exit_on_error
|
||||
|
||||
cd dist
|
||||
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc[0-9])?')
|
||||
cd dist/bower
|
||||
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc([0-9])+)?')
|
||||
echo "version: $version"
|
||||
git add ripple.js ripple-debug.js ripple-min.js bower.json
|
||||
exit_on_error
|
||||
@@ -40,4 +40,4 @@ exit_on_error
|
||||
git push origin master
|
||||
git push --tags origin master
|
||||
|
||||
cd ..
|
||||
cd ../..
|
||||
|
||||
@@ -17,16 +17,16 @@ echo "publish rc to npm"
|
||||
npm publish --tag beta
|
||||
exit_on_error
|
||||
|
||||
rm -rf dist
|
||||
rm -rf dist/bower
|
||||
echo ""
|
||||
echo "publish to bower"
|
||||
|
||||
git clone git@github.com:ripple/bower-ripple.git dist
|
||||
git clone git@github.com:ripple/bower-ripple.git dist/bower
|
||||
gulp bower
|
||||
exit_on_error
|
||||
|
||||
cd dist
|
||||
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc[0-9])?')
|
||||
cd dist/bower
|
||||
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc([0-9])+)?')
|
||||
echo "version: $version"
|
||||
git add ripple.js ripple-debug.js ripple-min.js bower.json
|
||||
exit_on_error
|
||||
@@ -40,4 +40,4 @@ exit_on_error
|
||||
git push origin master
|
||||
git push --tags origin master
|
||||
|
||||
cd ..
|
||||
cd ../..
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
rm -rf dist
|
||||
git clone git@github.com:ripple/bower-ripple.git dist
|
||||
rm -rf dist/bower
|
||||
git clone git@github.com:ripple/bower-ripple.git dist/bower
|
||||
gulp bower
|
||||
cd dist
|
||||
cd dist/bower
|
||||
version=$(cat bower.json | grep -Eo '([0-9]\.?)+(-rc[0-9])?')
|
||||
echo "version: $version"
|
||||
git add ripple.js ripple-debug.js ripple-min.js bower.json
|
||||
@@ -9,4 +9,4 @@ git commit -m "[TASK] add v$version"
|
||||
git tag "v$version"
|
||||
git push origin master
|
||||
git push --tags origin master
|
||||
cd ..
|
||||
cd ..
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
/* eslint-disable no-var */
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var Ledger = require('../src/js/ripple/ledger').Ledger;
|
||||
var ripple = require('../dist/npm')._DEPRECATED;
|
||||
var Amount = ripple.Amount;
|
||||
var Ledger = ripple.Ledger;
|
||||
|
||||
function parse_options(from, flags) {
|
||||
var argv = from.slice(),
|
||||
opts = {argv:argv};
|
||||
var argv = from.slice();
|
||||
var opts_ = {argv: argv};
|
||||
|
||||
flags.forEach(function(f) {
|
||||
// Do we have the flag?
|
||||
var flag_index = argv.indexOf('--' + f);
|
||||
// normalize the name of the flag
|
||||
f = f.replace('-', '_');
|
||||
// opts has Boolean value for normalized flag key
|
||||
opts[f] = !!~flag_index;
|
||||
if (opts[f]) {
|
||||
var flag = f.replace('-', '_');
|
||||
// opts_ has Boolean value for normalized flag key
|
||||
opts_[flag] = flag_index !== -1;
|
||||
if (opts_[flag]) {
|
||||
// remove the flag from the argv
|
||||
argv.splice(flag_index, 1);
|
||||
}
|
||||
});
|
||||
return opts;
|
||||
return opts_;
|
||||
}
|
||||
|
||||
var opts = parse_options(process.argv.slice(2), // remove `node` and `this.js`
|
||||
['sanity-test']);
|
||||
|
||||
if (opts.argv.length < 1) {
|
||||
console.error("Usage: scripts/verify_ledger_json path/to/ledger.json");
|
||||
console.error(" optional: --sanity-test (json>binary>json>binary)");
|
||||
console.error('Usage: scripts/verify_ledger_json path/to/ledger.json');
|
||||
console.error(' optional: --sanity-test (json>binary>json>binary)');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -36,14 +41,27 @@ var ledger = Ledger.from_json(JSON.parse(json));
|
||||
// before finally serializing for hashing. This is mostly to expose any issues
|
||||
// with ripple-libs binary <--> json codecs.
|
||||
if (opts.sanity_test) {
|
||||
console.log("All accountState nodes will be processed from " +
|
||||
"json->binary->json->binary. This may take some time " +
|
||||
"with large ledgers.");
|
||||
console.log('All accountState nodes will be processed from ' +
|
||||
'json->binary->json->binary. This may take some time ' +
|
||||
'with large ledgers.');
|
||||
}
|
||||
|
||||
console.log("Transaction hash in header: " + ledger.ledger_json.transaction_hash);
|
||||
console.log("Calculated transaction hash: " + ledger.calc_tx_hash().to_hex());
|
||||
console.log("Account state hash in header: " + ledger.ledger_json.account_hash);
|
||||
console.log("Calculated account state hash: " + ledger.calc_account_hash(
|
||||
{sanity_test:opts.sanity_test})
|
||||
.to_hex());
|
||||
// To recompute the hashes of some ledgers, we must allow values that slipped in
|
||||
// before strong policies were in place.
|
||||
Amount.strict_mode = false;
|
||||
|
||||
console.log('Transaction hash in header: ' +
|
||||
ledger.ledger_json.transaction_hash);
|
||||
console.log('Calculated transaction hash: ' +
|
||||
ledger.calc_tx_hash().to_hex());
|
||||
|
||||
console.log('Account state hash in header: ' +
|
||||
ledger.ledger_json.account_hash);
|
||||
|
||||
if (ledger.ledger_json.accountState) {
|
||||
console.log('Calculated account state hash: ' +
|
||||
ledger.calc_account_hash({sanity_test: opts.sanity_test})
|
||||
.to_hex());
|
||||
} else {
|
||||
console.log('Ledger has no accountState');
|
||||
}
|
||||
|
||||
44
src/api/common/constants.js
Normal file
44
src/api/common/constants.js
Normal file
@@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
const core = require('./utils').core;
|
||||
const flagIndices = core.Transaction.set_clear_flags.AccountSet;
|
||||
const flags = core.Remote.flags.account_root;
|
||||
|
||||
const AccountFlags = {
|
||||
passwordSpent: flags.PasswordSpent,
|
||||
requireDestinationTag: flags.RequireDestTag,
|
||||
requireAuthorization: flags.RequireAuth,
|
||||
disallowIncomingXRP: flags.DisallowXRP,
|
||||
disableMasterKey: flags.DisableMaster,
|
||||
noFreeze: flags.NoFreeze,
|
||||
globalFreeze: flags.GlobalFreeze,
|
||||
defaultRipple: flags.DefaultRipple
|
||||
};
|
||||
|
||||
const AccountFlagIndices = {
|
||||
requireDestinationTag: flagIndices.asfRequireDest,
|
||||
requireAuthorization: flagIndices.asfRequireAuth,
|
||||
disallowIncomingXRP: flagIndices.asfDisallowXRP,
|
||||
disableMasterKey: flagIndices.asfDisableMaster,
|
||||
enableTransactionIDTracking: flagIndices.asfAccountTxnID,
|
||||
noFreeze: flagIndices.asfNoFreeze,
|
||||
globalFreeze: flagIndices.asfGlobalFreeze,
|
||||
defaultRipple: flagIndices.asfDefaultRipple
|
||||
};
|
||||
|
||||
const AccountFields = {
|
||||
EmailHash: {name: 'emailHash', encoding: 'hex',
|
||||
length: 32, defaults: '0'},
|
||||
WalletLocator: {name: 'walletLocator', encoding: 'hex',
|
||||
length: 64, defaults: '0'},
|
||||
WalletSize: {name: 'walletSize', defaults: 0},
|
||||
MessageKey: {name: 'messageKey'},
|
||||
Domain: {name: 'domain', encoding: 'hex'},
|
||||
TransferRate: {name: 'transferRate', defaults: 0, shift: 9},
|
||||
Signers: {name: 'signers'}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
AccountFields,
|
||||
AccountFlagIndices,
|
||||
AccountFlags
|
||||
};
|
||||
97
src/api/common/errors.js
Normal file
97
src/api/common/errors.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/* eslint-disable valid-jsdoc */
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Base class for all errors
|
||||
*/
|
||||
function RippleError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
RippleError.prototype = new Error();
|
||||
RippleError.prototype.name = 'RippleError';
|
||||
|
||||
function ValidationError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
ValidationError.prototype = new RippleError();
|
||||
ValidationError.prototype.name = 'ValidationError';
|
||||
|
||||
/**
|
||||
* Timeout, disconnects and too busy
|
||||
*/
|
||||
function NetworkError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
NetworkError.prototype = new RippleError();
|
||||
NetworkError.prototype.name = 'NetworkError';
|
||||
|
||||
/**
|
||||
* Failed transactions, no paths found, not enough balance, etc.
|
||||
*/
|
||||
function RippledNetworkError(message) {
|
||||
this.message = message !== undefined ? message : 'Cannot connect to rippled';
|
||||
}
|
||||
RippledNetworkError.prototype = new NetworkError();
|
||||
|
||||
/**
|
||||
* Failed transactions, no paths found, not enough balance, etc.
|
||||
*/
|
||||
function TransactionError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
TransactionError.prototype = new RippleError();
|
||||
TransactionError.prototype.name = 'TransactionError';
|
||||
|
||||
/**
|
||||
* Asset could not be found
|
||||
*/
|
||||
function NotFoundError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
NotFoundError.prototype = new RippleError();
|
||||
NotFoundError.prototype.name = 'NotFoundError';
|
||||
|
||||
function MissingLedgerHistoryError(message) {
|
||||
this.message = message ||
|
||||
'Server is missing ledger history in the specified range';
|
||||
}
|
||||
MissingLedgerHistoryError.prototype = new RippleError();
|
||||
MissingLedgerHistoryError.prototype.name = 'MissingLedgerHistoryError';
|
||||
|
||||
function PendingLedgerVersionError(message) {
|
||||
this.message = message ||
|
||||
'maxLedgerVersion is greater than server\'s most recent validated ledger';
|
||||
}
|
||||
PendingLedgerVersionError.prototype = new RippleError();
|
||||
PendingLedgerVersionError.prototype.name = 'PendingLedgerVersionError';
|
||||
|
||||
/**
|
||||
* Request timed out
|
||||
*/
|
||||
function TimeOutError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
TimeOutError.prototype = new RippleError();
|
||||
TimeOutError.prototype.name = 'TimeOutError';
|
||||
|
||||
/**
|
||||
* API logic failed to do what it intended
|
||||
*/
|
||||
function ApiError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
ApiError.prototype = new RippleError();
|
||||
ApiError.prototype.name = 'ApiError';
|
||||
|
||||
module.exports = {
|
||||
ValidationError,
|
||||
NetworkError,
|
||||
TransactionError,
|
||||
RippledNetworkError,
|
||||
NotFoundError,
|
||||
PendingLedgerVersionError,
|
||||
MissingLedgerHistoryError,
|
||||
TimeOutError,
|
||||
ApiError,
|
||||
RippleError
|
||||
};
|
||||
20
src/api/common/index.js
Normal file
20
src/api/common/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
const utils = require('./utils');
|
||||
|
||||
module.exports = {
|
||||
core: utils.core,
|
||||
constants: require('./constants'),
|
||||
errors: require('./errors'),
|
||||
validate: require('./validate'),
|
||||
dropsToXrp: utils.dropsToXrp,
|
||||
xrpToDrops: utils.xrpToDrops,
|
||||
toRippledAmount: utils.toRippledAmount,
|
||||
generateAddress: utils.generateAddress,
|
||||
composeAsync: utils.composeAsync,
|
||||
wrapCatch: utils.wrapCatch,
|
||||
convertErrors: utils.convertErrors,
|
||||
convertExceptions: utils.convertExceptions,
|
||||
convertKeysFromSnakeCaseToCamelCase:
|
||||
utils.convertKeysFromSnakeCaseToCamelCase,
|
||||
promisify: utils.promisify
|
||||
};
|
||||
124
src/api/common/schema-validator.js
Normal file
124
src/api/common/schema-validator.js
Normal file
@@ -0,0 +1,124 @@
|
||||
// flow is disabled for this file until support for requiring json is added:
|
||||
// https://github.com/facebook/flow/issues/167
|
||||
'use strict';
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert');
|
||||
const validator = require('is-my-json-valid');
|
||||
const core = require('./utils').core;
|
||||
const ValidationError = require('./errors').ValidationError;
|
||||
|
||||
let SCHEMAS = {};
|
||||
|
||||
function isValidAddress(address: string): boolean {
|
||||
return typeof address === 'string' && address.length > 0 &&
|
||||
address[0] === 'r' &&
|
||||
core.UInt160.is_valid(address);
|
||||
}
|
||||
|
||||
function isValidLedgerHash(ledgerHash) {
|
||||
return core.UInt256.is_valid(ledgerHash);
|
||||
}
|
||||
|
||||
function loadSchemas() {
|
||||
// listed explicitly for webpack (instead of scanning schemas directory)
|
||||
const schemas = [
|
||||
require('./schemas/address.json'),
|
||||
require('./schemas/adjustment.json'),
|
||||
require('./schemas/amount.json'),
|
||||
require('./schemas/amountbase.json'),
|
||||
require('./schemas/balance.json'),
|
||||
require('./schemas/blob.json'),
|
||||
require('./schemas/currency.json'),
|
||||
require('./schemas/get-account-info.json'),
|
||||
require('./schemas/get-balances.json'),
|
||||
require('./schemas/get-balance-sheet'),
|
||||
require('./schemas/balance-sheet-options.json'),
|
||||
require('./schemas/get-ledger.json'),
|
||||
require('./schemas/get-orderbook.json'),
|
||||
require('./schemas/get-orders.json'),
|
||||
require('./schemas/get-paths.json'),
|
||||
require('./schemas/get-server-info.json'),
|
||||
require('./schemas/get-settings.json'),
|
||||
require('./schemas/get-transaction.json'),
|
||||
require('./schemas/get-transactions.json'),
|
||||
require('./schemas/get-trustlines.json'),
|
||||
require('./schemas/hash128.json'),
|
||||
require('./schemas/hash256.json'),
|
||||
require('./schemas/instructions.json'),
|
||||
require('./schemas/issue.json'),
|
||||
require('./schemas/ledger-options.json'),
|
||||
require('./schemas/ledgerversion.json'),
|
||||
require('./schemas/max-adjustment.json'),
|
||||
require('./schemas/memo.json'),
|
||||
require('./schemas/order-cancellation-transaction.json'),
|
||||
require('./schemas/order-cancellation.json'),
|
||||
require('./schemas/order-change.json'),
|
||||
require('./schemas/order-transaction.json'),
|
||||
require('./schemas/order.json'),
|
||||
require('./schemas/orderbook-orders.json'),
|
||||
require('./schemas/orderbook.json'),
|
||||
require('./schemas/orders-options.json'),
|
||||
require('./schemas/outcome.json'),
|
||||
require('./schemas/pathfind.json'),
|
||||
require('./schemas/payment-transaction.json'),
|
||||
require('./schemas/payment.json'),
|
||||
require('./schemas/quality.json'),
|
||||
require('./schemas/remote-options.json'),
|
||||
require('./schemas/sequence.json'),
|
||||
require('./schemas/settings-options.json'),
|
||||
require('./schemas/settings-transaction.json'),
|
||||
require('./schemas/settings.json'),
|
||||
require('./schemas/sign.json'),
|
||||
require('./schemas/signed-value.json'),
|
||||
require('./schemas/submit.json'),
|
||||
require('./schemas/suspended-payment-cancellation.json'),
|
||||
require('./schemas/suspended-payment-execution.json'),
|
||||
require('./schemas/suspended-payment-creation.json'),
|
||||
require('./schemas/timestamp.json'),
|
||||
require('./schemas/transaction-options.json'),
|
||||
require('./schemas/transactions-options.json'),
|
||||
require('./schemas/trustline-transaction.json'),
|
||||
require('./schemas/trustline.json'),
|
||||
require('./schemas/trustlines-options.json'),
|
||||
require('./schemas/tx.json'),
|
||||
require('./schemas/uint32.json'),
|
||||
require('./schemas/value.json'),
|
||||
require('./schemas/prepare.json'),
|
||||
require('./schemas/ledger-closed.json')
|
||||
];
|
||||
const titles = _.map(schemas, schema => schema.title);
|
||||
const duplicates = _.keys(_.pick(_.countBy(titles), count => count > 1));
|
||||
assert(duplicates.length === 0, 'Duplicate schemas for: ' + duplicates);
|
||||
return _.indexBy(schemas, 'title');
|
||||
}
|
||||
|
||||
function formatSchemaError(error) {
|
||||
return error.field + ' ' + error.message
|
||||
+ (error.value ? ' (' + JSON.stringify(error.value) + ')' : '');
|
||||
}
|
||||
|
||||
function formatSchemaErrors(errors) {
|
||||
return errors.map(formatSchemaError).join(', ');
|
||||
}
|
||||
|
||||
function schemaValidate(schemaName: string, object: any): void {
|
||||
const formats = {address: isValidAddress,
|
||||
ledgerHash: isValidLedgerHash};
|
||||
const options = {schemas: SCHEMAS, formats: formats,
|
||||
verbose: true, greedy: true};
|
||||
const schema = SCHEMAS[schemaName];
|
||||
if (schema === undefined) {
|
||||
throw new Error('schema not found for: ' + schemaName);
|
||||
}
|
||||
const validate = validator(schema, options);
|
||||
const isValid = validate(object);
|
||||
if (!isValid) {
|
||||
throw new ValidationError(formatSchemaErrors(validate.errors));
|
||||
}
|
||||
}
|
||||
|
||||
SCHEMAS = loadSchemas();
|
||||
module.exports = {
|
||||
schemaValidate: schemaValidate,
|
||||
SCHEMAS: SCHEMAS
|
||||
};
|
||||
8
src/api/common/schemas/address.json
Normal file
8
src/api/common/schemas/address.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "address",
|
||||
"description": "A Ripple account address",
|
||||
"type": "string",
|
||||
"format": "address",
|
||||
"pattern": "^r[1-9A-HJ-NP-Za-km-z]{25,34}$"
|
||||
}
|
||||
12
src/api/common/schemas/adjustment.json
Normal file
12
src/api/common/schemas/adjustment.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "adjustment",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"address": {"$ref": "address"},
|
||||
"amount": {"$ref": "amount"},
|
||||
"tag": {"$ref": "tag"}
|
||||
},
|
||||
"required": ["address", "amount"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
9
src/api/common/schemas/amount.json
Normal file
9
src/api/common/schemas/amount.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "amount",
|
||||
"description": "An Amount on the Ripple Protocol, used also for XRP in the ripple-rest API",
|
||||
"allOf": [
|
||||
{"$ref": "amountbase"},
|
||||
{"required": ["value"]}
|
||||
]
|
||||
}
|
||||
44
src/api/common/schemas/amountbase.json
Normal file
44
src/api/common/schemas/amountbase.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "amountbase",
|
||||
"description": "Base class for amount and issue",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"description": "The quantity of the currency, denoted as a string to retain floating point precision",
|
||||
"$ref": "value"
|
||||
},
|
||||
"currency": {
|
||||
"description": "The three-character code or hex string used to denote currencies",
|
||||
"$ref": "currency"
|
||||
},
|
||||
"counterparty": {
|
||||
"description": "The Ripple account address of the currency's issuer or gateway",
|
||||
"$ref": "address"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["currency"],
|
||||
"oneOf": [
|
||||
{
|
||||
"properties": {
|
||||
"currency": {
|
||||
"not": {
|
||||
"enum": ["XRP"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["counterparty"]
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"currency": {
|
||||
"enum": ["XRP"]
|
||||
}
|
||||
},
|
||||
"not": {
|
||||
"required": ["counterparty"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
15
src/api/common/schemas/balance-sheet-options.json
Normal file
15
src/api/common/schemas/balance-sheet-options.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "balance-sheet-options",
|
||||
"description": "Options for getBalanceSheet",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"excludeAddresses": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "address"},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
44
src/api/common/schemas/balance.json
Normal file
44
src/api/common/schemas/balance.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "balance",
|
||||
"description": "Balance amount",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"description": "The balance on the trustline",
|
||||
"$ref": "signedValue"
|
||||
},
|
||||
"currency": {
|
||||
"description": "The three-character code or hex string used to denote currencies",
|
||||
"$ref": "currency"
|
||||
},
|
||||
"counterparty": {
|
||||
"description": "The Ripple account address of the currency's issuer or gateway",
|
||||
"$ref": "address"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["currency", "value"],
|
||||
"oneOf": [
|
||||
{
|
||||
"properties": {
|
||||
"currency": {
|
||||
"not": {
|
||||
"enum": ["XRP"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["counterparty"]
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"currency": {
|
||||
"enum": ["XRP"]
|
||||
}
|
||||
},
|
||||
"not": {
|
||||
"required": ["counterparty"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
8
src/api/common/schemas/blob.json
Normal file
8
src/api/common/schemas/blob.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "blob",
|
||||
"description": "An uppercase hex string representation of a transaction",
|
||||
"type": "string",
|
||||
"minLength": "1",
|
||||
"pattern": "^[0-9A-F]*$"
|
||||
}
|
||||
7
src/api/common/schemas/currency.json
Normal file
7
src/api/common/schemas/currency.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "currency",
|
||||
"description": "The three-character code or hex string used to denote currencies",
|
||||
"type": "string",
|
||||
"pattern": "^([a-zA-Z0-9<>(){}[\\]|?!@#$%^&*]{3}|[A-F0-9]{40})$"
|
||||
}
|
||||
9
src/api/common/schemas/destinationAdjustment.json
Normal file
9
src/api/common/schemas/destinationAdjustment.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "destinationAdjustment",
|
||||
"type": "object",
|
||||
"oneOf": [
|
||||
{"$ref": "adjustment"},
|
||||
{"$ref": "minAdjustment"}
|
||||
]
|
||||
}
|
||||
21
src/api/common/schemas/get-account-info.json
Normal file
21
src/api/common/schemas/get-account-info.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getAccountInfo",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sequence": {"$ref": "sequence"},
|
||||
"xrpBalance": {"$ref": "value"},
|
||||
"ownerCount": {"type": "integer", "minimum": 0},
|
||||
"previousInitiatedTransactionID": {"$ref": "hash256"},
|
||||
"previousAffectingTransactionID": {"$ref": "hash256"},
|
||||
"previousAffectingTransactionLedgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"required": [
|
||||
"sequence",
|
||||
"xrpBalance",
|
||||
"ownerCount",
|
||||
"previousAffectingTransactionID",
|
||||
"previousAffectingTransactionLedgerVersion"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
29
src/api/common/schemas/get-balance-sheet.json
Normal file
29
src/api/common/schemas/get-balance-sheet.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getBalanceSheet",
|
||||
"description": "getBalanceSheet response",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"balances": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "amount"}
|
||||
},
|
||||
"assets": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "amount"}
|
||||
},
|
||||
"obligations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["currency", "value"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"currency": {"$ref": "currency"},
|
||||
"value": {"$ref": "value"}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
6
src/api/common/schemas/get-balances.json
Normal file
6
src/api/common/schemas/get-balances.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getBalances",
|
||||
"type": "array",
|
||||
"items": {"$ref": "balance"}
|
||||
}
|
||||
39
src/api/common/schemas/get-ledger.json
Normal file
39
src/api/common/schemas/get-ledger.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getLedger",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"accepted": {"type": "boolean"},
|
||||
"closed": {"type": "boolean"},
|
||||
"stateHash": {"$ref": "hash256"},
|
||||
"closeTime": {"type": "integer", "minimum": 0},
|
||||
"closeTimeResolution": {"type": "integer", "minimum": 1},
|
||||
"closeFlags": {"type": "integer", "minimum": 0},
|
||||
"ledgerHash": {"$ref": "hash256"},
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"},
|
||||
"parentLedgerHash": {"$ref": "hash256"},
|
||||
"parentCloseTime": {"type": "integer", "minimum": 0},
|
||||
"totalDrops": {"$ref": "value"},
|
||||
"transactionHash": {"$ref": "hash256"},
|
||||
"transactions": {"type": "array", "items": {"type": "object"}},
|
||||
"rawTransactions": {"type": "string"},
|
||||
"transactionHashes": {"type": "array", "items": {"$ref": "hash256"}},
|
||||
"rawState": {"type": "string"},
|
||||
"stateHashes": {"type": "array", "items": {"$ref": "hash256"}}
|
||||
},
|
||||
"required": [
|
||||
"accepted",
|
||||
"closed",
|
||||
"stateHash",
|
||||
"closeTime",
|
||||
"closeTimeResolution",
|
||||
"closeFlags",
|
||||
"ledgerHash",
|
||||
"ledgerVersion",
|
||||
"parentLedgerHash",
|
||||
"parentCloseTime",
|
||||
"totalDrops",
|
||||
"transactionHash"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
11
src/api/common/schemas/get-orderbook.json
Normal file
11
src/api/common/schemas/get-orderbook.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getOrderbook",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bids": {"$ref": "orderbookOrders"},
|
||||
"asks": {"$ref": "orderbookOrders"}
|
||||
},
|
||||
"required": ["bids", "asks"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
23
src/api/common/schemas/get-orders.json
Normal file
23
src/api/common/schemas/get-orders.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getOrders",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"specification": {"$ref": "order"},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"maker": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"},
|
||||
"makerExchangeRate": {"$ref": "value"}
|
||||
},
|
||||
"required": ["maker", "sequence", "makerExchangeRate"],
|
||||
"addtionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["specification", "properties"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
15
src/api/common/schemas/get-paths.json
Normal file
15
src/api/common/schemas/get-paths.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getPaths",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": {"$ref": "sourceAdjustment"},
|
||||
"destination": {"$ref": "destinationAdjustment"},
|
||||
"paths": {"type": "string"}
|
||||
},
|
||||
"required": ["source", "destination", "paths"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
49
src/api/common/schemas/get-server-info.json
Normal file
49
src/api/common/schemas/get-server-info.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getServerInfo",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"buildVersion": {"type": "string"},
|
||||
"completeLedgers": {"type": "string", "pattern": "[0-9,-]+"},
|
||||
"hostid": {"type": "string"},
|
||||
"ioLatencyMs": {"type": "number"},
|
||||
"load": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"jobTypes": {
|
||||
"type": "array",
|
||||
"items": {"type": "object"}
|
||||
},
|
||||
"threads": {"type": "number"}
|
||||
}
|
||||
},
|
||||
"lastClose": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"convergeTimeS": {"type": "number"},
|
||||
"proposers": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"loadFactor": {"type": "number"},
|
||||
"peers": {"type": "integer", "minimum": 0},
|
||||
"pubkeyNode": {"type": "string"},
|
||||
"pubkeyValidator": {"type": "string"},
|
||||
"serverState": {
|
||||
"type": "string",
|
||||
"enum": ["disconnected", "connected", "syncing", "tracking", "full", "validating", "proposing"]
|
||||
},
|
||||
"validatedLedger": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"age": {"type": "integer", "minimum": 0},
|
||||
"baseFeeXrp": {"type": "number"},
|
||||
"hash": {"$ref": "hash256"},
|
||||
"reserveBaseXrp": {"type": "integer", "minimum": 0},
|
||||
"reserveIncXrp": {"type": "integer", "minimum": 0},
|
||||
"seq": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"validationQuorum": {"type": "number"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
40
src/api/common/schemas/get-settings.json
Normal file
40
src/api/common/schemas/get-settings.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getSettings",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"passwordSpent": {"type": "boolean"},
|
||||
"requireDestinationTag": {"type": "boolean"},
|
||||
"requireAuthorization": {"type": "boolean"},
|
||||
"disallowIncomingXRP": {"type": "boolean"},
|
||||
"disableMasterKey": {"type": "boolean"},
|
||||
"enableTransactionIDTracking": {"type": "boolean"},
|
||||
"noFreeze": {"type": "boolean"},
|
||||
"globalFreeze": {"type": "boolean"},
|
||||
"defaultRipple": {"type": "boolean"},
|
||||
"emailHash": {
|
||||
"oneOf": [
|
||||
{"type": "null"},
|
||||
{"$ref": "hash128"}
|
||||
]
|
||||
},
|
||||
"walletLocator": {
|
||||
"oneOf": [
|
||||
{"type": "null"},
|
||||
{"$ref": "hash256"}
|
||||
]
|
||||
},
|
||||
"walletSize": {"type": ["integer", "null"]},
|
||||
"messageKey": {"type": "string"},
|
||||
"domain": {"type": "string"},
|
||||
"transferRate": {
|
||||
"oneOf": [
|
||||
{"type": "null"},
|
||||
{"type": "number", "minimum": 1, "maximum": 4.294967295}
|
||||
]
|
||||
},
|
||||
"signers": {"type": "string"},
|
||||
"regularKey": {"$ref": "address"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
11
src/api/common/schemas/get-transaction.json
Normal file
11
src/api/common/schemas/get-transaction.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getTransaction",
|
||||
"oneOf": [
|
||||
{"$ref": "paymentTransaction"},
|
||||
{"$ref": "orderTransaction"},
|
||||
{"$ref": "orderCancellationTransaction"},
|
||||
{"$ref": "trustlineTransaction"},
|
||||
{"$ref": "settingsTransaction"}
|
||||
]
|
||||
}
|
||||
6
src/api/common/schemas/get-transactions.json
Normal file
6
src/api/common/schemas/get-transactions.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getTransactions",
|
||||
"type": "array",
|
||||
"items": {"$ref": "getTransaction"}
|
||||
}
|
||||
29
src/api/common/schemas/get-trustlines.json
Normal file
29
src/api/common/schemas/get-trustlines.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "getTrustlines",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"specification": {"$ref": "trustline"},
|
||||
"counterparty": {
|
||||
"properties": {
|
||||
"limit": {"$ref": "value"},
|
||||
"ripplingDisabled": {"type": "boolean"},
|
||||
"frozen": {"type": "boolean"},
|
||||
"authorized": {"type": "boolean"}
|
||||
},
|
||||
"required": ["limit"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"state": {
|
||||
"properties": {
|
||||
"balance": {"$ref": "value"}
|
||||
},
|
||||
"required": ["balance"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["specification", "counterparty", "state"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
7
src/api/common/schemas/hash128.json
Normal file
7
src/api/common/schemas/hash128.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "hash128",
|
||||
"description": "The hex representation of a 128-bit hash",
|
||||
"type": "string",
|
||||
"pattern": "^[A-F0-9]{32}$"
|
||||
}
|
||||
7
src/api/common/schemas/hash256.json
Normal file
7
src/api/common/schemas/hash256.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "hash256",
|
||||
"description": "The hex representation of a 256-bit hash",
|
||||
"type": "string",
|
||||
"pattern": "^[A-F0-9]{64}$"
|
||||
}
|
||||
42
src/api/common/schemas/instructions.json
Normal file
42
src/api/common/schemas/instructions.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "instructions",
|
||||
"description": "Instructions for executing a transaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sequence": {
|
||||
"description": "The sequence number, relative to the initiating account, of this transaction.",
|
||||
"$ref": "sequence"
|
||||
},
|
||||
"fee": {
|
||||
"description": "Fixed Fee",
|
||||
"$ref": "value"
|
||||
},
|
||||
"maxFee": {
|
||||
"description": "Max Fee",
|
||||
"$ref": "value"
|
||||
},
|
||||
"maxLedgerVersion": {
|
||||
"description": "Highest ledger version number that a transaction can appear in.",
|
||||
"$ref": "ledgerVersion"
|
||||
},
|
||||
"maxLedgerVersionOffset": {
|
||||
"description": "Offset from current legder version to highest ledger version that a transaction can appear in.",
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"not": {
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "fee and maxFee are mutually exclusive",
|
||||
"required": ["fee", "maxFee"]
|
||||
},
|
||||
{
|
||||
"description": "maxLedgerVersion and maxLedgerVersionOffset are mutually exclusive",
|
||||
"required": ["maxLedgerVersion", "maxLedgerVersionOffset"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
9
src/api/common/schemas/issue.json
Normal file
9
src/api/common/schemas/issue.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "issue",
|
||||
"description": "A currency-counterparty pair, or just currency if it's XRP",
|
||||
"allOf": [
|
||||
{"$ref": "amountbase"},
|
||||
{"not": {"required": ["value"]}}
|
||||
]
|
||||
}
|
||||
13
src/api/common/schemas/lax-amount.json
Normal file
13
src/api/common/schemas/lax-amount.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "laxAmount",
|
||||
"description": "Amount where counterparty is optional",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"currency": {"$ref": "currency"},
|
||||
"counterparty": {"$ref": "address"},
|
||||
"value": {"$ref": "value"}
|
||||
},
|
||||
"required": ["currency", "value"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
13
src/api/common/schemas/lax-lax-amount.json
Normal file
13
src/api/common/schemas/lax-lax-amount.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "laxLaxAmount",
|
||||
"description": "Amount where counterparty and value are optional",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"currency": {"$ref": "currency"},
|
||||
"counterparty": {"$ref": "address"},
|
||||
"value": {"$ref": "value"}
|
||||
},
|
||||
"required": ["currency"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
21
src/api/common/schemas/ledger-closed.json
Normal file
21
src/api/common/schemas/ledger-closed.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "ledgerClosed",
|
||||
"description": "A ledgerClosed event message",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"feeBase": {"type": "integer", "minimum": 0},
|
||||
"feeReference": {"type": "integer", "minimum": 0},
|
||||
"ledgerHash": {"$ref": "ledgerHash"},
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"},
|
||||
"ledgerTimestamp": {"type": "string", "format": "date-time"},
|
||||
"reserveBase": {"type": "integer", "minimum": 0},
|
||||
"reserveIncrement": {"type": "integer", "minimum": 0},
|
||||
"transactionCount": {"type": "integer", "minimum": 0},
|
||||
"validatedLedgerVersions": {"type": "string"}
|
||||
},
|
||||
"addtionalProperties": false,
|
||||
"required": ["feeBase", "feeReference", "ledgerHash", "ledgerTimestamp",
|
||||
"reserveBase", "reserveIncrement", "transactionCount",
|
||||
"ledgerVersion", "validatedLedgerVersions"]
|
||||
}
|
||||
13
src/api/common/schemas/ledger-options.json
Normal file
13
src/api/common/schemas/ledger-options.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "ledger-options",
|
||||
"description": "Options for getLedger",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"},
|
||||
"includeAllData": {"type": "boolean"},
|
||||
"includeTransactions": {"type": "boolean"},
|
||||
"includeState": {"type": "boolean"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
7
src/api/common/schemas/ledgerversion.json
Normal file
7
src/api/common/schemas/ledgerversion.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "ledgerVersion",
|
||||
"description": "A ledger version number",
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
12
src/api/common/schemas/max-adjustment.json
Normal file
12
src/api/common/schemas/max-adjustment.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "maxAdjustment",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"address": {"$ref": "address"},
|
||||
"maxAmount": {"$ref": "laxAmount"},
|
||||
"tag": {"$ref": "tag"}
|
||||
},
|
||||
"required": ["address", "maxAmount"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
22
src/api/common/schemas/memo.json
Normal file
22
src/api/common/schemas/memo.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "memo",
|
||||
"description": "Memo objects represent arbitrary data that can be included in a transaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"pattern": "^[A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=%]*$"
|
||||
},
|
||||
"format": {
|
||||
"pattern": "^[A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=%]*$"
|
||||
},
|
||||
"data": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"anyOf": [
|
||||
{"required": ["data"]},
|
||||
{"required": ["type"]}
|
||||
]
|
||||
}
|
||||
12
src/api/common/schemas/min-adjustment.json
Normal file
12
src/api/common/schemas/min-adjustment.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "minAdjustment",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"address": {"$ref": "address"},
|
||||
"minAmount": {"$ref": "laxAmount"},
|
||||
"tag": {"$ref": "tag"}
|
||||
},
|
||||
"required": ["address", "minAmount"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
15
src/api/common/schemas/order-cancellation-transaction.json
Normal file
15
src/api/common/schemas/order-cancellation-transaction.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orderCancellationTransaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"enum": ["orderCancellation"]},
|
||||
"specification": {"$ref": "orderCancellation"},
|
||||
"outcome": {"$ref": "outcome"},
|
||||
"id": {"$ref": "hash256"},
|
||||
"address": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"}
|
||||
},
|
||||
"required": ["type", "id", "address", "sequence", "specification", "outcome"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
10
src/api/common/schemas/order-cancellation.json
Normal file
10
src/api/common/schemas/order-cancellation.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orderCancellation",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"orderSequence": {"$ref": "sequence"}
|
||||
},
|
||||
"required": ["orderSequence"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
18
src/api/common/schemas/order-change.json
Normal file
18
src/api/common/schemas/order-change.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orderChange",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"direction": {
|
||||
"type": "string",
|
||||
"enum": ["buy", "sell"]
|
||||
},
|
||||
"quantity": {"$ref": "balance"},
|
||||
"totalPrice": {"$ref": "balance"},
|
||||
"makerExchangeRate": {"$ref": "value"},
|
||||
"sequence": {"$ref": "sequence"},
|
||||
"status": {"enum": ["created", "open", "closed", "canceled"]}
|
||||
},
|
||||
"required": ["direction", "quantity", "totalPrice", "sequence", "status"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
15
src/api/common/schemas/order-transaction.json
Normal file
15
src/api/common/schemas/order-transaction.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orderTransaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"enum": ["order"]},
|
||||
"specification": {"$ref": "order"},
|
||||
"outcome": {"$ref": "outcome"},
|
||||
"id": {"$ref": "hash256"},
|
||||
"address": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"}
|
||||
},
|
||||
"required": ["type", "id", "address", "sequence", "specification", "outcome"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
25
src/api/common/schemas/order.json
Normal file
25
src/api/common/schemas/order.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "order",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"direction": {
|
||||
"type": "string",
|
||||
"enum": ["buy", "sell"]
|
||||
},
|
||||
"quantity": {"$ref": "amount"},
|
||||
"totalPrice": {"$ref": "amount"},
|
||||
"immediateOrCancel": {"type": "boolean"},
|
||||
"fillOrKill": {"type": "boolean"},
|
||||
"passive": {
|
||||
"description": "If enabled, the offer will not consume offers that exactly match it, and instead becomes an Offer node in the ledger. It will still consume offers that cross it.",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["direction", "quantity", "totalPrice"],
|
||||
"additionalProperties": false,
|
||||
"not": {
|
||||
"description": "immediateOrCancel and fillOrKill are mutually exclusive",
|
||||
"required": ["immediateOrCancel", "fillOrKill"]
|
||||
}
|
||||
}
|
||||
32
src/api/common/schemas/orderbook-orders.json
Normal file
32
src/api/common/schemas/orderbook-orders.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orderbookOrders",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"specification": {"$ref": "order"},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"maker": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"},
|
||||
"makerExchangeRate": {"$ref": "value"}
|
||||
},
|
||||
"required": ["maker", "sequence", "makerExchangeRate"],
|
||||
"addtionalProperties": false
|
||||
},
|
||||
"state": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fundedAmount": {"$ref": "amount"},
|
||||
"priceOfFundedAmount": {"$ref": "amount"}
|
||||
},
|
||||
"required": ["fundedAmount", "priceOfFundedAmount"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["specification", "properties"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
11
src/api/common/schemas/orderbook.json
Normal file
11
src/api/common/schemas/orderbook.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orderbook",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"base": {"$ref": "issue"},
|
||||
"counter": {"$ref": "issue"}
|
||||
},
|
||||
"required": ["base", "counter"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
14
src/api/common/schemas/orders-options.json
Normal file
14
src/api/common/schemas/orders-options.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "orders-options",
|
||||
"description": "Options for getOrders and getOrderbook",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
31
src/api/common/schemas/outcome.json
Normal file
31
src/api/common/schemas/outcome.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "outcome",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"result": {"type": "string"},
|
||||
"timestamp": {"type": "string", "format": "date-time"},
|
||||
"fee": {"$ref": "value"},
|
||||
"balanceChanges": {
|
||||
"type": "object",
|
||||
"description": "Key is the ripple address; value is an array of changes",
|
||||
"additionalProperties": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "balance"}
|
||||
}
|
||||
},
|
||||
"orderbookChanges": {
|
||||
"type": "object",
|
||||
"description": "Key is the maker's ripple address; value is an array of changes",
|
||||
"additionalProperties": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "orderChange"}
|
||||
}
|
||||
},
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"},
|
||||
"indexInLedger": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"required": ["result", "fee", "balanceChanges",
|
||||
"orderbookChanges", "ledgerVersion", "indexInLedger"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
43
src/api/common/schemas/pathfind.json
Normal file
43
src/api/common/schemas/pathfind.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "pathfind",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"address": {"$ref": "address"},
|
||||
"amount": {"$ref": "laxAmount"},
|
||||
"currencies": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"currency": {"$ref": "currency"},
|
||||
"counterparty": {"$ref": "address"}
|
||||
},
|
||||
"required": ["currency"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"not": {
|
||||
"required": ["amount", "currencies"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["address"]
|
||||
},
|
||||
"destination": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"address": {"$ref": "address"},
|
||||
"amount": {"$ref": "laxLaxAmount"}
|
||||
},
|
||||
"required": ["address", "amount"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["source", "destination"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
15
src/api/common/schemas/payment-transaction.json
Normal file
15
src/api/common/schemas/payment-transaction.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "paymentTransaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"enum": ["payment"]},
|
||||
"specification": {"$ref": "payment"},
|
||||
"outcome": {"$ref": "outcome"},
|
||||
"id": {"$ref": "hash256"},
|
||||
"address": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"}
|
||||
},
|
||||
"required": ["type", "id", "address", "sequence", "specification", "outcome"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
31
src/api/common/schemas/payment.json
Normal file
31
src/api/common/schemas/payment.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "payment",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": {"$ref": "sourceAdjustment"},
|
||||
"destination": {"$ref": "destinationAdjustment"},
|
||||
"paths": {"type": "string"},
|
||||
"memos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "memo"
|
||||
}
|
||||
},
|
||||
"invoiceID": {
|
||||
"description": "A 256-bit hash that can be used to identify a particular payment",
|
||||
"$ref": "hash256"
|
||||
},
|
||||
"allowPartialPayment": {
|
||||
"description": "A boolean that, if set to true, indicates that this payment should go through even if the whole amount cannot be delivered because of a lack of liquidity or funds in the source_account account",
|
||||
"type": "boolean"
|
||||
},
|
||||
"noDirectRipple": {
|
||||
"description": "A boolean that can be set to true if paths are specified and the sender would like the Ripple Network to disregard any direct paths from the source_account to the destination_account. This may be used to take advantage of an arbitrage opportunity or by gateways wishing to issue balances from a hot wallet to a user who has mistakenly set a trustline directly to the hot wallet",
|
||||
"type": "boolean"
|
||||
},
|
||||
"limitQuality": {"type": "boolean"}
|
||||
},
|
||||
"required": ["source", "destination"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
21
src/api/common/schemas/prepare.json
Normal file
21
src/api/common/schemas/prepare.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "prepare",
|
||||
"description": "Result of prepare function",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"txJSON": {"type": "string"},
|
||||
"instructions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fee": {"$ref": "value"},
|
||||
"sequence": {"$ref": "sequence"},
|
||||
"maxLedgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["fee", "sequence"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["txJSON", "instructions"]
|
||||
}
|
||||
8
src/api/common/schemas/quality.json
Normal file
8
src/api/common/schemas/quality.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "quality",
|
||||
"description": "Ratio for incoming/outgoing transit fees.",
|
||||
"type": "number",
|
||||
"minimum": 0.000000001,
|
||||
"maximum": 4.294967295
|
||||
}
|
||||
17
src/api/common/schemas/remote-options.json
Normal file
17
src/api/common/schemas/remote-options.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "remote-options",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"trace": {"type": "boolean"},
|
||||
"servers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"pattern": "^wss?://"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
7
src/api/common/schemas/sequence.json
Normal file
7
src/api/common/schemas/sequence.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "sequence",
|
||||
"description": "An account transaction sequence number",
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
10
src/api/common/schemas/settings-options.json
Normal file
10
src/api/common/schemas/settings-options.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "settings-options",
|
||||
"description": "Options for getSettings and getAccountInfo",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
15
src/api/common/schemas/settings-transaction.json
Normal file
15
src/api/common/schemas/settings-transaction.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "settingsTransaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"enum": ["settings"]},
|
||||
"specification": {"$ref": "getSettings"},
|
||||
"outcome": {"$ref": "outcome"},
|
||||
"id": {"$ref": "hash256"},
|
||||
"address": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"}
|
||||
},
|
||||
"required": ["type", "id", "address", "sequence", "specification"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
13
src/api/common/schemas/settings.json
Normal file
13
src/api/common/schemas/settings.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "settings",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "getSettings"
|
||||
},
|
||||
{
|
||||
"minProperties": 1,
|
||||
"maxProperties": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
14
src/api/common/schemas/sign.json
Normal file
14
src/api/common/schemas/sign.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "sign",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"signedTransaction": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-F0-9]+$"
|
||||
},
|
||||
"id": {"$ref": "hash256"}
|
||||
},
|
||||
"required": ["signedTransaction", "id"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
7
src/api/common/schemas/signed-value.json
Normal file
7
src/api/common/schemas/signed-value.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "signedValue",
|
||||
"description": "A string representation of a floating point number",
|
||||
"type": "string",
|
||||
"pattern": "^[-]?[0-9]*[.]?[0-9]+([eE][-+]?[0-9]+)?$"
|
||||
}
|
||||
9
src/api/common/schemas/sourceAdjustment.json
Normal file
9
src/api/common/schemas/sourceAdjustment.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "sourceAdjustment",
|
||||
"type": "object",
|
||||
"oneOf": [
|
||||
{"$ref": "adjustment"},
|
||||
{"$ref": "maxAdjustment"}
|
||||
]
|
||||
}
|
||||
15
src/api/common/schemas/submit.json
Normal file
15
src/api/common/schemas/submit.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "submit",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {"type": "boolean"},
|
||||
"engineResult": {"type": "string"},
|
||||
"engineResultCode": {"type": "integer"},
|
||||
"engineResultMessage": {"type": "string"},
|
||||
"txBlob": {"type": "string"},
|
||||
"txJson": {"type": "object"}
|
||||
},
|
||||
"required": ["success", "engineResult", "engineResultCode"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
17
src/api/common/schemas/suspended-payment-cancellation.json
Normal file
17
src/api/common/schemas/suspended-payment-cancellation.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "suspended-payment-cancellation",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"memos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "memo"
|
||||
}
|
||||
},
|
||||
"owner": {"$ref": "address"},
|
||||
"paymentSequence": {"$ref": "uint32"}
|
||||
},
|
||||
"required": ["owner", "paymentSequence"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
28
src/api/common/schemas/suspended-payment-creation.json
Normal file
28
src/api/common/schemas/suspended-payment-creation.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "suspended-payment-creation",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": {"$ref": "maxAdjustment"},
|
||||
"destination": {"$ref": "adjustment"},
|
||||
"memos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "memo"
|
||||
}
|
||||
},
|
||||
"digest": {"$ref": "hash256"},
|
||||
"allowCancelAfter": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "milliseconds since unix epoch"
|
||||
},
|
||||
"allowExecuteAfter": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "milliseconds since unix epoch"
|
||||
}
|
||||
},
|
||||
"required": ["source", "destination"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
20
src/api/common/schemas/suspended-payment-execution.json
Normal file
20
src/api/common/schemas/suspended-payment-execution.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "suspended-payment-execution",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"memos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "memo"
|
||||
}
|
||||
},
|
||||
"owner": {"$ref": "address"},
|
||||
"paymentSequence": {"$ref": "uint32"},
|
||||
"method": {"type": "integer", "minimum": 0, "maximum": 255},
|
||||
"digest": {"$ref": "hash256"},
|
||||
"proof": {"type": "string"}
|
||||
},
|
||||
"required": ["owner", "paymentSequence"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
6
src/api/common/schemas/tag.json
Normal file
6
src/api/common/schemas/tag.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "tag",
|
||||
"description": "A string representing an unsigned 32-bit integer most commonly used to refer to a sender's hosted account at a Ripple gateway",
|
||||
"$ref": "uint32"
|
||||
}
|
||||
7
src/api/common/schemas/timestamp.json
Normal file
7
src/api/common/schemas/timestamp.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "timestamp",
|
||||
"description": "An ISO 8601 combined date and time timestamp",
|
||||
"type": "string",
|
||||
"pattern": "^$|^[0-9]{4}-[0-1][0-9]-[0-3][0-9]T(2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9](Z|[+](2[0-3]|[01][0-9]):[0-5][0-9])$"
|
||||
}
|
||||
11
src/api/common/schemas/transaction-options.json
Normal file
11
src/api/common/schemas/transaction-options.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "transaction-options",
|
||||
"description": "Options for getTransaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"minLedgerVersion": {"$ref": "ledgerVersion"},
|
||||
"maxLedgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
40
src/api/common/schemas/transactions-options.json
Normal file
40
src/api/common/schemas/transactions-options.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "transactions-options",
|
||||
"description": "Options for getTransactions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start": {"$ref": "hash256"},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"minLedgerVersion": {"$ref": "ledgerVersion"},
|
||||
"maxLedgerVersion": {"$ref": "ledgerVersion"},
|
||||
"earliestFirst": {"type": "boolean"},
|
||||
"excludeFailures": {"type": "boolean"},
|
||||
"initiated": {"type": "boolean"},
|
||||
"counterparty": {"$ref": "address"},
|
||||
"types": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"payment",
|
||||
"trustline",
|
||||
"order",
|
||||
"orderCancellation",
|
||||
"settings"
|
||||
]
|
||||
}
|
||||
},
|
||||
"binary": {"type": "boolean"}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"not": {
|
||||
"anyOf": [
|
||||
{"required": ["incoming", "outgoing"]},
|
||||
{"required": ["start", "minLedgerVersion"]},
|
||||
{"required": ["start", "maxLedgerVersion"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
15
src/api/common/schemas/trustline-transaction.json
Normal file
15
src/api/common/schemas/trustline-transaction.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "trustlineTransaction",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"enum": ["trustline"]},
|
||||
"specification": {"$ref": "trustline"},
|
||||
"outcome": {"$ref": "outcome"},
|
||||
"id": {"$ref": "hash256"},
|
||||
"address": {"$ref": "address"},
|
||||
"sequence": {"$ref": "sequence"}
|
||||
},
|
||||
"required": ["type", "id", "address", "sequence", "specification", "outcome"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
17
src/api/common/schemas/trustline.json
Normal file
17
src/api/common/schemas/trustline.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "trustline",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"currency": {"$ref": "currency"},
|
||||
"counterparty": {"$ref": "address"},
|
||||
"limit": {"$ref": "value"},
|
||||
"qualityIn": {"$ref": "quality"},
|
||||
"qualityOut": {"$ref": "quality"},
|
||||
"ripplingDisabled": {"type": "boolean"},
|
||||
"authorized": {"type": "boolean"},
|
||||
"frozen": {"type": "boolean"}
|
||||
},
|
||||
"required": ["currency", "counterparty", "limit"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
16
src/api/common/schemas/trustlines-options.json
Normal file
16
src/api/common/schemas/trustlines-options.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "trustlines-options",
|
||||
"description": "Options for getTrustlines and getBalances",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"counterparty": {"$ref": "address"},
|
||||
"currency": {"$ref": "currency"},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"ledgerVersion": {"$ref": "ledgerVersion"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
10
src/api/common/schemas/tx.json
Normal file
10
src/api/common/schemas/tx.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "tx",
|
||||
"description": "An object in rippled txJSON format",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Account": {"$ref": "address"}
|
||||
},
|
||||
"required": ["Account"]
|
||||
}
|
||||
8
src/api/common/schemas/uint32.json
Normal file
8
src/api/common/schemas/uint32.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "uint32",
|
||||
"description": "A 32-bit unsigned integer",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 4294967295
|
||||
}
|
||||
7
src/api/common/schemas/value.json
Normal file
7
src/api/common/schemas/value.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"title": "value",
|
||||
"description": "A string representation of a non-negative floating point number",
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]*[.]?[0-9]+([eE][-+]?[0-9]+)?$"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user