example: import Api from '@polkadot/api'; import WsProvider from '@polkadot/api-provider/ws';

const provider = new WsProvider('http://127.0.0.1:9944')); const api = new Api(provider);

Hierarchy

Api

Implements

  • object

Constructors

constructor

⊕ new Api(provider: ProviderInterface): Api

Defined in index.ts:29

constructor: Default constructor for the Api Object

Parameters:

Param Type Description
provider ProviderInterface An API provider using HTTP or WebSocket

Returns: Api


Properties

author

● author: ApiInterface$Section

Defined in index.ts:26


chain

● chain: ApiInterface$Section

Defined in index.ts:27


state

● state: ApiInterface$Section

Defined in index.ts:28


system

● system: ApiInterface$Section

Defined in index.ts:29


Methods

<Static> signature

▸ signature(__namedParameters: object): string

Defined in index.ts:58

name: signature

signature: jsonrpcSignature (method: InterfaceMethodDefinition): string

summary: Returns a string representation of the method with inputs and outputs.

description: Formats the name, inputs and outputs into a human-readable string. This contains the input parameter names input types and output type.

example: import Api from '@polkadot/Api';

Api.signature({ name: 'test_method', params: [ { name: 'dest', type: 'Address' } ], type: 'Address' }); // => test_method (dest: Address): Address

Parameters:

Param Type
__namedParameters object

Returns: string


results matching ""

    No results matching ""