@steemit/steem-js 0.7.11 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +22 -3
  2. package/circle.yml +1 -1
  3. package/config.json +1 -1
  4. package/dist/steem-tests.min.js +4097 -23
  5. package/dist/steem.min.js +2089 -18
  6. package/docker-webpack.config.js +44 -0
  7. package/lib/api/index.js +305 -412
  8. package/lib/api/methods.js +16 -1
  9. package/lib/api/rpc-auth.js +135 -0
  10. package/lib/api/transports/base.js +25 -66
  11. package/lib/api/transports/http.js +114 -129
  12. package/lib/api/transports/index.js +8 -15
  13. package/lib/api/transports/ws.js +107 -207
  14. package/lib/auth/ecc/index.js +9 -9
  15. package/lib/auth/ecc/src/address.js +48 -78
  16. package/lib/auth/ecc/src/aes.js +93 -129
  17. package/lib/auth/ecc/src/brain_key.js +7 -7
  18. package/lib/auth/ecc/src/ecdsa.js +7 -33
  19. package/lib/auth/ecc/src/ecsignature.js +4 -30
  20. package/lib/auth/ecc/src/enforce_types.js +1 -8
  21. package/lib/auth/ecc/src/hash.js +16 -25
  22. package/lib/auth/ecc/src/key_private.js +146 -199
  23. package/lib/auth/ecc/src/key_public.js +130 -202
  24. package/lib/auth/ecc/src/key_utils.js +64 -106
  25. package/lib/auth/ecc/src/signature.js +125 -177
  26. package/lib/auth/index.js +84 -97
  27. package/lib/auth/memo.js +90 -118
  28. package/lib/auth/serializer/index.js +12 -18
  29. package/lib/auth/serializer/src/ChainTypes.js +0 -3
  30. package/lib/auth/serializer/src/convert.js +29 -32
  31. package/lib/auth/serializer/src/error_with_cause.js +22 -37
  32. package/lib/auth/serializer/src/fast_parser.js +54 -74
  33. package/lib/auth/serializer/src/number_utils.js +30 -54
  34. package/lib/auth/serializer/src/object_id.js +37 -62
  35. package/lib/auth/serializer/src/operations.js +597 -689
  36. package/lib/auth/serializer/src/precision.js +55 -73
  37. package/lib/auth/serializer/src/serializer.js +158 -204
  38. package/lib/auth/serializer/src/template.js +13 -8
  39. package/lib/auth/serializer/src/types.js +949 -1102
  40. package/lib/auth/serializer/src/validation.js +268 -328
  41. package/lib/broadcast/helpers.js +61 -98
  42. package/lib/broadcast/index.js +61 -82
  43. package/lib/browser.js +15 -19
  44. package/lib/config.js +16 -38
  45. package/lib/formatter.js +89 -115
  46. package/lib/index.js +19 -17
  47. package/lib/utils.js +4 -9
  48. package/node-18.dockerfile +28 -0
  49. package/package.json +62 -38
  50. package/test/Crypto.js +16 -16
  51. package/test/KeyFormats.js +1 -1
  52. package/test/api.test.js +37 -0
  53. package/test/broadcast.test.js +14 -8
  54. package/test/comment.test.js +17 -3
  55. package/test/operations_test.js +1 -1
  56. package/test/promise-broadcast.test.js +86 -0
  57. package/test/reputation.test.js +68 -0
  58. package/test/smt.test.js +10 -10
  59. package/test-github-workflow.bat +19 -0
  60. package/test-github-workflow.sh +15 -0
  61. package/webpack/makeConfig.js +25 -17
  62. package/.circleci/config.yml +0 -23
  63. package/dist/statistics.html +0 -208
  64. package/dist/steem-tests.min.js.gz +0 -0
  65. package/dist/steem-tests.min.js.map +0 -1
  66. package/dist/steem.min.js.gz +0 -0
  67. package/dist/steem.min.js.map +0 -1
  68. package/lib/auth/ecc/README.md +0 -20
  69. package/lib/auth/ecc/package.json +0 -36
  70. package/lib/auth/serializer/README.md +0 -13
  71. package/lib/auth/serializer/package.json +0 -32
  72. package/node-4.dockerfile +0 -6
  73. package/node-6.dockerfile +0 -6
  74. package/yarn.lock +0 -3336
package/README.md CHANGED
@@ -58,8 +58,6 @@ $ npm install steem --save
58
58
 
59
59
  ## RPC Servers
60
60
  https://api.steemit.com By Default<br/>
61
- https://node.steem.ws<br/>
62
- https://this.piston.rocks<br/>
63
61
 
64
62
  ## Examples
65
63
  ### Broadcast Vote
@@ -72,6 +70,27 @@ steem.broadcast.vote(wif, voter, author, permlink, weight, function(err, result)
72
70
  });
73
71
  ```
74
72
 
73
+ ### Broadcast Vote with Promises
74
+ ```js
75
+ var steem = require('steem');
76
+
77
+ var wif = steem.auth.toWif(username, password, 'posting');
78
+ // Using Promises
79
+ steem.broadcast.vote(wif, voter, author, permlink, weight)
80
+ .then(result => console.log(result))
81
+ .catch(error => console.error(error));
82
+
83
+ // Or using async/await
84
+ async function castVote() {
85
+ try {
86
+ const result = await steem.broadcast.vote(wif, voter, author, permlink, weight);
87
+ console.log(result);
88
+ } catch (error) {
89
+ console.error(error);
90
+ }
91
+ }
92
+ ```
93
+
75
94
  ### Get Accounts
76
95
  ```js
77
96
  steem.api.getAccounts(['ned', 'dan'], function(err, result) {
@@ -107,7 +126,7 @@ steem.api.setOptions({
107
126
  The Chain ID could change. If it does, it may not be reflected here, but will be documented on any testnet launch announcements.
108
127
 
109
128
  ## Contributions
110
- Patches are welcome! Contributors are listed in the package.json file. Please run the tests before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list or on Steemit Chat channel #steemjs https://steemit.chat/channel/steemjs.
129
+ Patches are welcome! Contributors are listed in the package.json file. Please run the tests before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list.
111
130
 
112
131
  ## Issues
113
132
  When you find issues, please report them!
package/circle.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  machine:
2
2
  node:
3
- version: 6
3
+ version: 18
package/config.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "transport": "http",
3
- "websocket": "wss://gtg.steem.house:8090",
3
+ "websocket": "wss://api.steemit.com",
4
4
  "uri": "https://api.steemit.com",
5
5
  "url": "",
6
6
  "dev_uri": "https://api.steemitdev.com",