Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "eosjs-api", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Application programming interface to EOS blockchain nodes.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -6,3 +6,3 @@ [](https://travis-ci.org/eosjs/api) | ||
Application programming interface to EOS blockchain nodes. This is mostly for read-only API calls. If you decide you need to sign transactions, your better off using this API in the [eosjs](https://github.com/eosjs/eosjs) package. | ||
Application programming interface to EOS blockchain nodes. This is mostly for read-only API calls. If you decide you need to sign transactions, your better off using this API in the [eosjs](https://github.com/eosio/eosjs) package. | ||
@@ -47,3 +47,3 @@ Status: Beta | ||
The API methods and documentation are stored in JSON files in this [folder](https://github.com/eosjs/json/tree/master/api). | ||
The API methods and documentation are stored in JSON files in this [folder](https://github.com/eosio/eosjs-json/tree/master/api). | ||
@@ -50,0 +50,0 @@ ## Environment |
@@ -127,7 +127,7 @@ require('isomorphic-fetch') | ||
let apiParams | ||
// Parameteters can be: object by name or a positional array | ||
// Parameteters can be ordered or an object | ||
if (callParams.length === 1 && typeof callParams[0] === 'object') { | ||
apiParams = callParams[0] | ||
} else { | ||
// positional array | ||
// ordered params | ||
const defLen = defParams ? Object.keys(defParams).length : 0 | ||
@@ -134,0 +134,0 @@ if (callParams.length > defLen) { |
@@ -23,7 +23,7 @@ module.exports = { | ||
const chainDate = new Date(info.head_block_time + 'Z') | ||
// Back-up 3 blocks to help avoid mini-forks. | ||
const refBlockNum = (info.head_block_num - 3) & 0xFFFF | ||
// Back-up 3 blocks to help avoid mini-forks. The getBlock call does not return | ||
// its own block id but the next block has 'previous'. | ||
api.getBlock(info.head_block_num - 2, checkError(callback, block => { | ||
api.getBlock(info.head_block_num - 3, checkError(callback, block => { | ||
const headBlockId = block.previous | ||
@@ -33,3 +33,3 @@ const expiration = new Date(chainDate.getTime() + expireInSeconds * 1000) | ||
refBlockNum, | ||
refBlockPrefix: new Buffer(headBlockId, 'hex').readUInt32LE(4), | ||
refBlockPrefix: block.refBlockPrefix, | ||
expiration: expiration.toISOString().split('.')[0], | ||
@@ -36,0 +36,0 @@ scope: [], |
10097
237