UNPKG

xdb-digitalbits-sdk

Version:

xdb-digitalbits-sdk is a library for working with the DigitalBits Frontier server.

29 lines (28 loc) 1.02 kB
/// <reference types="eventsource" /> import URI from "urijs"; import { Frontier } from "./frontier_api"; import { ServerApi } from "./server_api"; export interface EventSourceOptions<T> { onmessage?: (value: T) => void; onerror?: (event: MessageEvent) => void; reconnectTimeout?: number; } export declare class CallBuilder<T extends Frontier.FeeStatsResponse | Frontier.BaseResponse | ServerApi.CollectionPage<Frontier.BaseResponse>> { protected url: URI; filter: string[][]; protected originalSegments: string[]; constructor(serverUrl: URI); call(): Promise<T>; stream(options?: EventSourceOptions<T>): () => void; cursor(cursor: string): this; limit(recordsNumber: number): this; order(direction: "asc" | "desc"): this; join(include: "transactions"): this; private checkFilter; private _requestFnForLink; private _parseRecord; private _sendNormalRequest; private _parseResponse; private _toCollectionPage; private _handleNetworkError; }