Module

x/polkadot/mod.ts>api.HttpProvider

Package publishing for deno.land/x/polkadot
Go to Latest
class api.HttpProvider
implements ProviderInterface
import { api } from "https://dotland.deno.dev/x/polkadot@0.2.38/mod.ts";
const { HttpProvider } = api;

@polkadot/rpc-provider

Examples

import Api from 'https://deno.land/x/polkadot@0.2.38/api/promise/index.ts';
import { HttpProvider } from 'https://deno.land/x/polkadot@0.2.38/rpc-provider/mod.ts';

const provider = new HttpProvider('http://127.0.0.1:9933');
const api = new Api(provider);

Constructors

new
HttpProvider(endpoint?: string, headers?: Record<string, string>)

Properties

readonly
hasSubscriptions: boolean
readonly
isClonable: boolean
readonly
isConnected: boolean
readonly
stats: ProviderStats

Methods

connect(): Promise<void>
disconnect(): Promise<void>
on(_type: ProviderInterfaceEmitted, _sub: ProviderInterfaceEmitCb): () => void
send<T>(
method: string,
params: unknown[],
isCacheable?: boolean,
): Promise<T>
subscribe(
_types: string,
_method: string,
_params: unknown[],
_cb: ProviderInterfaceCallback,
): Promise<number>
unsubscribe(
_type: string,
_method: string,
_id: number,
): Promise<boolean>