Home Reference Source
import {BurstService} from 'packages/core/src/burstService.ts'
public class | source

BurstService

Generic BRS Web Service class. Extend and specific services here

Constructor Summary

Public Constructor
public

constructor(baseUrl: *, relativePath: *)

Creates Service instance

Member Summary

Public Members
public get

http: *: *

Method Summary

Public Methods
public

async query(method: string, args: undefined): Promise

Requests a query to BRS

public

async send(method: string, args: undefined): Promise

Send data to BRS

public

Mounts a BRS conform API endpoint of format <host>?requestType=getBlock&height=123

Public Constructors

public constructor(baseUrl: *, relativePath: *) source

Creates Service instance

Params:

NameTypeAttributeDescription
baseUrl *

The host url of web service

relativePath *

The relative path will be prepended before each url created with toBRSEndpoint()

Public Members

public get http: *: * source

Return:

*

The internal Http client

Public Methods

public async query(method: string, args: undefined): Promise source

Requests a query to BRS

Params:

NameTypeAttributeDescription
method string
args undefined

Return:

Promise

public async send(method: string, args: undefined): Promise source

Send data to BRS

Params:

NameTypeAttributeDescription
method string
args undefined

Return:

Promise

public toBRSEndpoint(method: string, data: undefined): string source

Mounts a BRS conform API endpoint of format <host>?requestType=getBlock&height=123

Params:

NameTypeAttributeDescription
method string
data undefined

Return:

string