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.

escrowFinish.js 1.2KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.validateEscrowFinish = void 0;
  4. const errors_1 = require("../../errors");
  5. const common_1 = require("./common");
  6. function validateEscrowFinish(tx) {
  7. (0, common_1.validateBaseTransaction)(tx);
  8. if (tx.Owner === undefined) {
  9. throw new errors_1.ValidationError('EscrowFinish: missing field Owner');
  10. }
  11. if (typeof tx.Owner !== 'string') {
  12. throw new errors_1.ValidationError('EscrowFinish: Owner must be a string');
  13. }
  14. if (tx.OfferSequence === undefined) {
  15. throw new errors_1.ValidationError('EscrowFinish: missing field OfferSequence');
  16. }
  17. if (typeof tx.OfferSequence !== 'number') {
  18. throw new errors_1.ValidationError('EscrowFinish: OfferSequence must be a number');
  19. }
  20. if (tx.Condition !== undefined && typeof tx.Condition !== 'string') {
  21. throw new errors_1.ValidationError('EscrowFinish: Condition must be a string');
  22. }
  23. if (tx.Fulfillment !== undefined && typeof tx.Fulfillment !== 'string') {
  24. throw new errors_1.ValidationError('EscrowFinish: Fulfillment must be a string');
  25. }
  26. }
  27. exports.validateEscrowFinish = validateEscrowFinish;
  28. //# sourceMappingURL=escrowFinish.js.map