UNPKG

@fioprotocol/fiosdk

Version:

The Foundation for Interwallet Operability (FIO) is a consortium of leading blockchain wallets, exchanges and payments providers that seeks to accelerate blockchain adoption by reducing the risk, complexity, and inconvenience of sending and receiving cryp

52 lines 2.13 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Query = void 0; const Transactions_1 = require("../Transactions"); class Query extends Transactions_1.Transactions { constructor() { super(...arguments); this.isEncrypted = false; this.requestTimeout = 5000; } execute(publicKey_1) { return __awaiter(this, arguments, void 0, function* (publicKey, privateKey = '') { var _a, _b; this.publicKey = publicKey; this.privateKey = privateKey; const result = yield this.multicastServers({ body: JSON.stringify(this.getData()), endpoint: this.getEndPoint(), requestTimeout: this.requestTimeout, }); try { return this.isEncrypted ? yield this.decrypt(result) : result; } catch (error) { (_b = (_a = this.config).logger) === null || _b === void 0 ? void 0 : _b.call(_a, { context: { error: error }, type: 'decrypt', }); throw error; } }); } decrypt(result) { return __awaiter(this, void 0, void 0, function* () { throw new Error('Not implemented'); }); } getEndPoint() { return this.ENDPOINT; } } exports.Query = Query; //# sourceMappingURL=Query.js.map