UNPKG

incubed

Version:

Typescript-version of the incubed client

36 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class HttpProvider { constructor(_host, options = {}, client) { this.IN3Client = client; this.host = _host; this.connected = true; } send(method, parameters) { let request; if (typeof (method) == "string") request = { method: method, params: parameters }; else request = method; if (typeof parameters == "function") return this.IN3Client.send(request, parameters); else return this.IN3Client.send(request); } sendBatch(methods, moduleInstance) { let methodCalls = []; methods.forEach((method) => { method.beforeExecution(moduleInstance); methodCalls.push(this.send(method.rpcMethod, method.parameters)); }); return Promise.all(methodCalls); } supportsSubscriptions() { return false; } disconnect() { return true; } } exports.HttpProvider = HttpProvider; //# sourceMappingURL=provider.js.map