import { ProviderInterface, ProviderInterface$Callback, ProviderInterface$Emitted, ProviderInterface$EmitCb } from '../types'; import './polyfill'; /** * The HTTP Provider allows sending requests using HTTP. it does not support subscriptions * so you won´t be able to listen to events such as new blocks or balance changes. * It is usually preferrable using the [[WsProvider]]. * * @example * import createApi from '@polkadot/api'; * import WsProvider from '@polkadot/api-provider/ws'; * * const provider = new WsProvider('http://127.0.0.1:9933'); * const api = createApi(provider); * * @see [[WsProvider]] */ export default class HttpProvider implements ProviderInterface { private coder; private endpoint; private l; constructor(endpoint: string); /** * Whether the node is connected or not. * @return {boolean} true if connected */ isConnected(): boolean; /** * Events are not supported with the HttpProvider, see [[WsProvider]]. */ on(type: ProviderInterface$Emitted, sub: ProviderInterface$EmitCb): void; send(method: string, params: Array): Promise; /** * Subscriptions are not supported with the HttpProvider, see [[WsProvider]]. */ subscribe(types: string, method: string, params: Array, cb: ProviderInterface$Callback): Promise; /** * Subscriptions are not supported with the HttpProvider, see [[WsProvider]]. */ unsubscribe(type: string, method: string, id: number): Promise; }