Version: 0.14.0

Class: Provider

"providers/Provider".Provider

Hierarchy#

Constructors#

constructor#

+ new Provider(ApiUrl: string, WsApiUrl: string): Provider

Defined in src/providers/Provider.ts:9

Parameters:#

NameType
ApiUrlstring
WsApiUrlstring

Returns: Provider

Properties#

ApiUrl#

ApiUrl: string

Defined in src/providers/Provider.ts:8


WsApiUrl#

WsApiUrl: string

Defined in src/providers/Provider.ts:9

Methods#

createWebsocketStream#

createWebsocketStream(endpoint: string, functionName: string, args: object, reconnectingOptions?: ReconnectingWSOptions): Observable<any>

Defined in src/providers/Provider.ts:45

Creates a websocket stream connection to the server.

Parameters:#

NameTypeDescription
endpointstringWebsocket stream endpoint to connect to.
functionNamestringFunction to call on connection.
argsobjectFunction arguments.
reconnectingOptions?ReconnectingWSOptions-

Returns: Observable<any>


fetchEndpoint#

fetchEndpoint<T>(endpoint: string, options?: object): Promise<T>

Defined in src/providers/Provider.ts:21

Returns a JSON response from the REST API of the server.

Type parameters:#

Name
T

Parameters:#

NameTypeDescription
endpointstringEndpoint to fetch.
options?objectOptional fetch options.

Returns: Promise<T>


getVersion#

getVersion(): Promise<string>

Defined in src/providers/Provider.ts:64

Returns the version of the currently configured provider server.

Returns: Promise<string>

Version of relay in the format <name>/vX.X.X.


postToEndpoint#

postToEndpoint<T>(endpoint: string, data: any): Promise<T>

Defined in src/providers/Provider.ts:29

Type parameters:#

Name
T

Parameters:#

NameType
endpointstring
dataany

Returns: Promise<T>