lib/currencies.js
function Currencies (currencies) {
    if (!currencies) {
        throw new Error('Missing currencies object');
    }

    this.keys = parseInt(currencies.keys || 0);
    this.metal = parseFloat(currencies.metal || 0);

    if (isNaN(this.keys) || isNaN(this.metal)) {
        throw new Error('Not a valid currencies object');
    }

    this.metal = toRefined(toScrap(this.metal));
}
function Currencies (currencies) {
    if (!currencies) {
        throw new Error('Missing currencies object');
    }

    this.keys = parseInt(currencies.keys || 0);
    this.metal = parseFloat(currencies.metal || 0);

    if (isNaN(this.keys) || isNaN(this.metal)) {
        throw new Error('Not a valid currencies object');
    }

    this.metal = toRefined(toScrap(this.metal));
}
Creates a new Currencies instance
@class
@param {object} currencies The currencies object
@throws Will throw an error if missing currencies object, or if it is not valid