UNPKG

@helium/http

Version:

HTTP library for interacting with the Helium blockchain API

21 lines 908 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Transaction_1 = __importDefault(require("../models/Transaction")); const ResourceList_1 = __importDefault(require("../ResourceList")); class StateChannels { constructor(client) { this.client = client; } async list(params = {}) { const url = '/state_channels'; const response = await this.client.get(url, { cursor: params.cursor }); const { data: { data: stateChannels, cursor }, } = response; const data = stateChannels.map((d) => Transaction_1.default.fromJsonObject(d)); return new ResourceList_1.default(data, this.list.bind(this), cursor); } } exports.default = StateChannels; //# sourceMappingURL=StateChannels.js.map