Skip to content
Snippets Groups Projects
Commit cd701088 authored by Mahdi Yari's avatar Mahdi Yari
Browse files

Merge branch 'useAppbaseApi-true' into 'master'

Use appbase api true by default

See merge request hive/hive-js!46
parents 2643b3e1 13490ea9
No related branches found
No related tags found
No related merge requests found
...@@ -8,5 +8,6 @@ ...@@ -8,5 +8,6 @@
"address_prefix": "STM", "address_prefix": "STM",
"chain_id": "beeab0de00000000000000000000000000000000000000000000000000000000", "chain_id": "beeab0de00000000000000000000000000000000000000000000000000000000",
"alternative_api_endpoints": ["https://api.hive.blog", "https://anyx.io"], "alternative_api_endpoints": ["https://api.hive.blog", "https://anyx.io"],
"failover_threshold": 3 "failover_threshold": 3,
"useAppbaseApi": true
} }
{ {
"name": "@hiveio/hive-js", "name": "@hiveio/hive-js",
"version": "2.0.0", "version": "2.0.1",
"description": "Hive.js the JavaScript API for Hive blockchain", "description": "Hive.js the JavaScript API for Hive blockchain",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {
......
...@@ -2,6 +2,7 @@ import fetch from 'cross-fetch'; ...@@ -2,6 +2,7 @@ import fetch from 'cross-fetch';
import newDebug from 'debug'; import newDebug from 'debug';
import retry from 'retry'; import retry from 'retry';
import Transport from './base'; import Transport from './base';
import config from '../../config';
const debug = newDebug('steem:http'); const debug = newDebug('steem:http');
...@@ -54,7 +55,7 @@ export function jsonRpc(uri, {method, id, params, fetchMethod=fetch}) { ...@@ -54,7 +55,7 @@ export function jsonRpc(uri, {method, id, params, fetchMethod=fetch}) {
export default class HttpTransport extends Transport { export default class HttpTransport extends Transport {
send(api, data, callback) { send(api, data, callback) {
let params = data.params let params = data.params
if (this.options.useAppbaseApi && api !== 'transaction_status_api') { if ((config.get('useAppbaseApi') || this.options.useAppbaseApi) && api !== 'transaction_status_api') {
api = 'condenser_api'; api = 'condenser_api';
} }
if (api === 'condenser_api') { if (api === 'condenser_api') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment