diff --git a/config.json b/config.json index dd15d9931b5ba5aefd843a2dc041c7bf49947bdc..d56446e27ddbec4865830ca514ca6fe186d84923 100644 --- a/config.json +++ b/config.json @@ -8,5 +8,6 @@ "address_prefix": "STM", "chain_id": "beeab0de00000000000000000000000000000000000000000000000000000000", "alternative_api_endpoints": ["https://api.hive.blog", "https://anyx.io"], - "failover_threshold": 3 + "failover_threshold": 3, + "useAppbaseApi": true } diff --git a/package.json b/package.json index ef40823907f6e2a6c546a332b7eeb5b5c6514695..ae8770feaa479e426a377f13944f51d884edc746 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hiveio/hive-js", - "version": "2.0.0", + "version": "2.0.1", "description": "Hive.js the JavaScript API for Hive blockchain", "main": "lib/index.js", "scripts": { diff --git a/src/api/transports/http.js b/src/api/transports/http.js index b5370108889cf6bf063368c4afde5c66e105b98a..0093d6e306cae7c0669c52a07b2904c6c3c603b2 100644 --- a/src/api/transports/http.js +++ b/src/api/transports/http.js @@ -2,6 +2,7 @@ import fetch from 'cross-fetch'; import newDebug from 'debug'; import retry from 'retry'; import Transport from './base'; +import config from '../../config'; const debug = newDebug('steem:http'); @@ -54,7 +55,7 @@ export function jsonRpc(uri, {method, id, params, fetchMethod=fetch}) { export default class HttpTransport extends Transport { send(api, data, callback) { 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'; } if (api === 'condenser_api') {