@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.
- package/README.md +22 -3
- package/circle.yml +1 -1
- package/config.json +1 -1
- package/dist/steem-tests.min.js +4097 -23
- package/dist/steem.min.js +2089 -18
- package/docker-webpack.config.js +44 -0
- package/lib/api/index.js +305 -412
- package/lib/api/methods.js +16 -1
- package/lib/api/rpc-auth.js +135 -0
- package/lib/api/transports/base.js +25 -66
- package/lib/api/transports/http.js +114 -129
- package/lib/api/transports/index.js +8 -15
- package/lib/api/transports/ws.js +107 -207
- package/lib/auth/ecc/index.js +9 -9
- package/lib/auth/ecc/src/address.js +48 -78
- package/lib/auth/ecc/src/aes.js +93 -129
- package/lib/auth/ecc/src/brain_key.js +7 -7
- package/lib/auth/ecc/src/ecdsa.js +7 -33
- package/lib/auth/ecc/src/ecsignature.js +4 -30
- package/lib/auth/ecc/src/enforce_types.js +1 -8
- package/lib/auth/ecc/src/hash.js +16 -25
- package/lib/auth/ecc/src/key_private.js +146 -199
- package/lib/auth/ecc/src/key_public.js +130 -202
- package/lib/auth/ecc/src/key_utils.js +64 -106
- package/lib/auth/ecc/src/signature.js +125 -177
- package/lib/auth/index.js +84 -97
- package/lib/auth/memo.js +90 -118
- package/lib/auth/serializer/index.js +12 -18
- package/lib/auth/serializer/src/ChainTypes.js +0 -3
- package/lib/auth/serializer/src/convert.js +29 -32
- package/lib/auth/serializer/src/error_with_cause.js +22 -37
- package/lib/auth/serializer/src/fast_parser.js +54 -74
- package/lib/auth/serializer/src/number_utils.js +30 -54
- package/lib/auth/serializer/src/object_id.js +37 -62
- package/lib/auth/serializer/src/operations.js +597 -689
- package/lib/auth/serializer/src/precision.js +55 -73
- package/lib/auth/serializer/src/serializer.js +158 -204
- package/lib/auth/serializer/src/template.js +13 -8
- package/lib/auth/serializer/src/types.js +949 -1102
- package/lib/auth/serializer/src/validation.js +268 -328
- package/lib/broadcast/helpers.js +61 -98
- package/lib/broadcast/index.js +61 -82
- package/lib/browser.js +15 -19
- package/lib/config.js +16 -38
- package/lib/formatter.js +89 -115
- package/lib/index.js +19 -17
- package/lib/utils.js +4 -9
- package/node-18.dockerfile +28 -0
- package/package.json +62 -38
- package/test/Crypto.js +16 -16
- package/test/KeyFormats.js +1 -1
- package/test/api.test.js +37 -0
- package/test/broadcast.test.js +14 -8
- package/test/comment.test.js +17 -3
- package/test/operations_test.js +1 -1
- package/test/promise-broadcast.test.js +86 -0
- package/test/reputation.test.js +68 -0
- package/test/smt.test.js +10 -10
- package/test-github-workflow.bat +19 -0
- package/test-github-workflow.sh +15 -0
- package/webpack/makeConfig.js +25 -17
- package/.circleci/config.yml +0 -23
- package/dist/statistics.html +0 -208
- package/dist/steem-tests.min.js.gz +0 -0
- package/dist/steem-tests.min.js.map +0 -1
- package/dist/steem.min.js.gz +0 -0
- package/dist/steem.min.js.map +0 -1
- package/lib/auth/ecc/README.md +0 -20
- package/lib/auth/ecc/package.json +0 -36
- package/lib/auth/serializer/README.md +0 -13
- package/lib/auth/serializer/package.json +0 -32
- package/node-4.dockerfile +0 -6
- package/node-6.dockerfile +0 -6
- 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
|
|
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