UNPKG

1.08 kBTypeScriptView Raw
1import { IResponse } from "./interfaces";
2import { AvailableResourcesName } from "./resources";
3export declare class Connection {
4 private readonly host;
5 private opts;
6 constructor(host: string);
7 api<T extends AvailableResourcesName>(name: T): InstanceType<{
8 blocks: typeof import("./resources/blocks").Blocks;
9 delegates: typeof import("./resources/delegates").Delegates;
10 locks: typeof import("./resources/locks").Locks;
11 node: typeof import("./resources/node").Node;
12 peers: typeof import("./resources/peers").Peers;
13 rounds: typeof import("./resources/rounds").Rounds;
14 transactions: typeof import("./resources/transactions").Transactions;
15 votes: typeof import("./resources/votes").Votes;
16 wallets: typeof import("./resources/wallets").Wallets;
17 }[T]>;
18 withOptions(opts: Record<string, any>): this;
19 get<T = any>(url: string, opts?: Record<string, any>): Promise<IResponse<T>>;
20 post<T = any>(url: string, opts?: Record<string, any>): Promise<IResponse<T>>;
21 private sendRequest;
22}