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.

ledger.js 1.4KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4. return new (P || (P = Promise))(function (resolve, reject) {
  5. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9. });
  10. };
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. const common_1 = require("../common");
  13. const ledger_1 = require("./parse/ledger");
  14. function getLedger(options = {}) {
  15. return __awaiter(this, void 0, void 0, function* () {
  16. common_1.validate.getLedger({ options });
  17. const response = yield this.request('ledger', {
  18. ledger_hash: options.ledgerHash,
  19. ledger_index: options.ledgerVersion || 'validated',
  20. expand: options.includeAllData,
  21. transactions: options.includeTransactions,
  22. accounts: options.includeState
  23. });
  24. return ledger_1.parseLedger(response.ledger);
  25. });
  26. }
  27. exports.default = getLedger;
  28. //# sourceMappingURL=ledger.js.map