Skip to content

Commit 13a4186

Browse files
authored
Merge pull request #209 from steemit/72-http-socket-support
Http socket support
2 parents 1883be1 + ee88e81 commit 13a4186

12 files changed

Lines changed: 486 additions & 363 deletions

File tree

config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2+
"transport": "ws",
23
"websocket": "wss://steemd.steemit.com",
4+
"uri": "https://steemd.steemit.com",
5+
"dev_uri": "https://steemd.steemitdev.com",
6+
"stage_uri": "https://steemd.steemitstage.com",
37
"address_prefix": "STM",
48
"chain_id": "0000000000000000000000000000000000000000000000000000000000000000"
59
}

doc/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- [Install](#install)
44
- [Browser](#browser)
55
- [Config](#config)
6+
- [JSON-RPC](#jsonrpc)
67
- [Database API](#api)
78
- [Subscriptions](#subscriptions)
89
- [Tags](#tags)
@@ -54,6 +55,16 @@ steem.config.set('address_prefix','STM');
5455
steem.config.get('chain_id');
5556
```
5657

58+
## JSON-RPC
59+
Here is how to activate JSON-RPC transport:
60+
```js
61+
steem.api.setOptions({
62+
transport: 'http',
63+
uri: 'https://steemd.steemitdev.com' // Optional, by default https://steemd.steemit.com is used.
64+
});
65+
66+
```
67+
5768
# API
5869

5970
## Subscriptions
@@ -517,12 +528,6 @@ steem.api.getFollowCount(account, function(err, result) {
517528

518529
## Broadcast API
519530

520-
### Broadcast Transaction
521-
```
522-
steem.api.broadcastTransaction(trx, function(err, result) {
523-
console.log(err, result);
524-
});
525-
```
526531
### Broadcast Transaction Synchronous
527532
```
528533
steem.api.broadcastTransactionSynchronous(trx, function(err, result) {
@@ -535,12 +540,7 @@ steem.api.broadcastBlock(b, function(err, result) {
535540
console.log(err, result);
536541
});
537542
```
538-
### Broadcast Transaction With Callback
539-
```
540-
steem.api.broadcastTransactionWithCallback(confirmationCallback, trx, function(err, result) {
541-
console.log(err, result);
542-
});
543-
```
543+
544544
# Broadcast
545545

546546
### Account Create

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "steem",
3-
"version": "0.5.20",
3+
"version": "0.6.0",
44
"description": "Steem.js the JavaScript API for Steem blockchain",
55
"main": "lib/index.js",
66
"scripts": {
@@ -45,9 +45,10 @@
4545
"debug": "^2.6.8",
4646
"detect-node": "^2.0.3",
4747
"ecurve": "^1.0.5",
48+
"isomorphic-fetch": "^2.2.1",
4849
"lodash": "^4.16.4",
4950
"secure-random": "^1.1.1",
50-
"ws": "^1.1.1"
51+
"ws": "^3.0.0"
5152
},
5253
"devDependencies": {
5354
"babel-cli": "^6.16.0",

0 commit comments

Comments
 (0)