diff --git a/src/connection/index.js b/src/connection/index.js index ccef76b..6819694 100644 --- a/src/connection/index.js +++ b/src/connection/index.js @@ -41,12 +41,12 @@ export default class Connection { /** * @public - * @param tx_id + * @param txId */ - getStatus(tx_id) { + getStatus(txId) { return this._req(this.getApiUrls('statuses'), { query: { - tx_id + txId } }) } @@ -65,13 +65,13 @@ export default class Connection { /** * @public - * @param tx_id + * @param txId * @param status */ - listBlocks({ tx_id, status }) { + listBlocks({ txId, status }) { return this._req(this.getApiUrls('blocks'), { query: { - tx_id, + txId, status } }) @@ -108,33 +108,33 @@ export default class Connection { /** * @public - * @param block_id + * @param blockId */ - listVotes(block_id) { + listVotes(blockId) { return this._req(this.getApiUrls('votes'), { query: { - block_id + blockId } }) } /** * @public - * @param tx_id + * @param txId * @return {Promise} */ - pollStatusAndFetchTransaction(tx_id) { + pollStatusAndFetchTransaction(txId) { return new Promise((resolve, reject) => { const timer = setInterval(() => { - this.getStatus(tx_id) + this.getStatus(txId) .then((res) => { - console.log('Fetched transaction status:', res) + console.log('Fetched transaction status:', res) // eslint-disable-line no-console if (res.status === 'valid') { clearInterval(timer) - this.getTransaction(tx_id) - .then((res) => { - console.log('Fetched transaction:', res) - resolve(res) + this.getTransaction(txId) + .then((res_) => { + console.log('Fetched transaction:', res_) // eslint-disable-line no-console + resolve(res_) }) } }) diff --git a/src/format_text.js b/src/format_text.js index 97bf47f..63bb5ed 100644 --- a/src/format_text.js +++ b/src/format_text.js @@ -3,7 +3,7 @@ import { sprintf } from 'sprintf-js' // Regexes taken from or inspired by sprintf-js const Regex = { - TEMPLATE_LITERAL: /\${([^\)]+?)}/g, + TEMPLATE_LITERAL: /\${([^)]+?)}/g, KEY: /^([a-z_][a-z_\d]*)/i, KEY_ACCESS: /^\.([a-z_][a-z_\d]*)/i, INDEX_ACCESS: /^\[(\d+)\]/ diff --git a/src/request.js b/src/request.js index 6e3d255..f532c60 100644 --- a/src/request.js +++ b/src/request.js @@ -29,7 +29,7 @@ export default function request(url, config = {}, onlyJsonResponse = true) { } return baseRequest(apiUrl, requestConfig) - .then((res) => onlyJsonResponse ? res.json() : + .then(res => onlyJsonResponse ? res.json() : { json: res.json(), url: res.url diff --git a/src/transaction/makeTransferTransaction.js b/src/transaction/makeTransferTransaction.js index 0820761..d28dae8 100644 --- a/src/transaction/makeTransferTransaction.js +++ b/src/transaction/makeTransferTransaction.js @@ -22,7 +22,12 @@ import makeTransaction from './makeTransaction' * @returns {object} Unsigned transaction -- make sure to call signTransaction() on it before * sending it off! */ -export default function makeTransferTransaction(unspentTransaction, metadata, outputs, ...fulfilledOutputs) { +export default function makeTransferTransaction( + unspentTransaction, + metadata, + outputs, + ...fulfilledOutputs + ) { const inputs = fulfilledOutputs.map((outputIndex) => { const fulfilledOutput = unspentTransaction.outputs[outputIndex] const transactionLink = { diff --git a/src/transaction/utils/ccJsonify.js b/src/transaction/utils/ccJsonify.js index 6da0360..c80ec24 100644 --- a/src/transaction/utils/ccJsonify.js +++ b/src/transaction/utils/ccJsonify.js @@ -3,7 +3,7 @@ import base58 from 'bs58' /** * @public * Serializes a crypto-condition class (Condition or Fulfillment) into a BigchainDB-compatible JSON - * @param {cc.Fulfillment} fulfillment base58 encoded Ed25519 public key for the recipient of the Transaction + * @param {cc.Fulfillment} fulfillment base58 encoded Ed25519 public key for recipient of the Transaction * @returns {object} Ed25519 Condition (that will need to wrapped in an Output) */ export default function ccJsonify(fulfillment) {