diff --git a/package.json b/package.json index 454f0c32aac9a78c4b92f73cf23c75304e209e10..d7c24529f780d0c2042513be3fb03c8b93043178 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hiveio/hive-js", - "version": "0.8.10", + "version": "0.8.11", "description": "Hive.js the JavaScript API for Hive blockchain", "main": "lib/index.js", "scripts": { diff --git a/src/api/index.js b/src/api/index.js index 505fafca26573760899a70bc17feca0bc00a4ff4..fafe3b02b9543db5449122c77832b6521fb19851 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -43,6 +43,10 @@ class Hive extends EventEmitter { }; this[methodName] = (...args) => { + if (methodName === 'getAccountHistory' && args.length < 5) { + methodParams.pop(); + methodParams.pop(); + } const options = methodParams.reduce((memo, param, i) => { memo[param] = args[i]; // eslint-disable-line no-param-reassign return memo; diff --git a/src/api/transports/http.js b/src/api/transports/http.js index 7a23b2dc0a62eb685ed615a9d643389ce430c17c..f4faff25de6440c7a70aaef3469655b1b05b8f03 100644 --- a/src/api/transports/http.js +++ b/src/api/transports/http.js @@ -60,16 +60,16 @@ export default class HttpTransport extends Transport { const id = data.id || this.id++; let params = [api, data.method, data.params]; //SPECIAL CODE - can be removed after all API node operators upgrade to get the updated get_account_history api call - if (this.options.uri !== 'https://api.hive.blog' && data.method === 'get_account_history' && data.params.length >= 4) - { - //We are experimenting with a new version of get_account_history that can now take up to 5 params - //but this is only deployed on api.hive.blog nodes, so if this particular request is going to a different - //backend, just strip the extra parameters off the call to avoid breaking it. Once all API nodes have upgraded - //this code can be removed. - while (data.params.length > 3) - data.params.pop(); - params = [api, data.method, data.params]; - } + // if (this.options.uri !== 'https://api.hive.blog' && data.method === 'get_account_history' && data.params.length >= 4) + // { + // //We are experimenting with a new version of get_account_history that can now take up to 5 params + // //but this is only deployed on api.hive.blog nodes, so if this particular request is going to a different + // //backend, just strip the extra parameters off the call to avoid breaking it. Once all API nodes have upgraded + // //this code can be removed. + // while (data.params.length > 3) + // data.params.pop(); + // params = [api, data.method, data.params]; + // } //END SPECIAL CODE const retriable = this.retriable(api, data); const fetchMethod = this.options.fetchMethod;