UNPKG

bitpay-sdk

Version:

Complete version of the NodeJS library for the new cryptographically secure BitPay API

29 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Invoice = void 0; const Currency_1 = require("../../Currency"); const BitPayExceptionProvider_1 = require("../../Exceptions/BitPayExceptionProvider"); class Invoice { /** * Constructor, create a minimal request Invoice object. * * @param price The amount for which the invoice will be created. * @param currency The three digit currency type used to compute the invoice bitcoin amount. */ constructor(price, currency) { this.price = price; this.setCurrency(currency); } /** * Set currency for invoice. * @param currency string * @throws BitPayGenericException BitPayGenericException class */ setCurrency(currency) { if (!Currency_1.Currency.isValid(currency)) BitPayExceptionProvider_1.BitPayExceptionProvider.throwInvalidCurrencyException(currency); this.currency = currency; } } exports.Invoice = Invoice; //# sourceMappingURL=Invoice.js.map