You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

paymentChannelFund.js 1.1KB

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.validatePaymentChannelFund = void 0;
  4. const errors_1 = require("../../errors");
  5. const common_1 = require("./common");
  6. function validatePaymentChannelFund(tx) {
  7. (0, common_1.validateBaseTransaction)(tx);
  8. if (tx.Channel === undefined) {
  9. throw new errors_1.ValidationError('PaymentChannelFund: missing Channel');
  10. }
  11. if (typeof tx.Channel !== 'string') {
  12. throw new errors_1.ValidationError('PaymentChannelFund: Channel must be a string');
  13. }
  14. if (tx.Amount === undefined) {
  15. throw new errors_1.ValidationError('PaymentChannelFund: missing Amount');
  16. }
  17. if (typeof tx.Amount !== 'string') {
  18. throw new errors_1.ValidationError('PaymentChannelFund: Amount must be a string');
  19. }
  20. if (tx.Expiration !== undefined && typeof tx.Expiration !== 'number') {
  21. throw new errors_1.ValidationError('PaymentChannelFund: Expiration must be a number');
  22. }
  23. }
  24. exports.validatePaymentChannelFund = validatePaymentChannelFund;
  25. //# sourceMappingURL=paymentChannelFund.js.map