Skip to main content
Module

x/polkadot/mod.ts>rpcProvider.HttpProvider

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

@polkadot/rpc-provider

Examples

import Api from 'https://deno.land/x/polkadot@0.2.12/api/promise/index.ts';
import { HttpProvider } from 'https://deno.land/x/polkadot@0.2.12/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
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>