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.

getLedgerIndex.js 1.1KB

12345678910111213141516171819202122
  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. function getLedgerIndex() {
  13. return __awaiter(this, void 0, void 0, function* () {
  14. const ledgerResponse = yield this.request({
  15. command: 'ledger',
  16. ledger_index: 'validated',
  17. });
  18. return ledgerResponse.result.ledger_index;
  19. });
  20. }
  21. exports.default = getLedgerIndex;
  22. //# sourceMappingURL=getLedgerIndex.js.map