From 27d8dabd7a5d94c0dabfadaa1da082691a498f86 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 16 Jun 2017 11:43:09 +0200 Subject: [PATCH] Stringify output.amount --- src/transaction/makeOutput.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/transaction/makeOutput.js b/src/transaction/makeOutput.js index d8eb1f3..820f3c3 100644 --- a/src/transaction/makeOutput.js +++ b/src/transaction/makeOutput.js @@ -3,10 +3,13 @@ * Create an Output from a Condition. * Note: Assumes the given Condition was generated from a single public key (e.g. a Ed25519 Condition) * @param {object} condition Condition (e.g. a Ed25519 Condition from `makeEd25519Condition()`) - * @param {number} amount Amount of the output + * @param {string} amount Amount of the output * @returns {object} An Output usable in a Transaction */ -export default function makeOutput(condition, amount = 1) { +export default function makeOutput(condition, amount = '1') { + if (typeof amount !== 'string') { + throw new TypeError('`amount` must be of type string') + } return { 'amount': amount, condition,