Home Reference Source
import RPC from 'moneyro/src/RPC.mjs'
public class | source

RPC

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

apiUrl: string

public

hostname: string

public

port: uint

Method Summary

Public Methods
public

async request(method: string, params: Object): Promise<*>

Sends a request to defined host.

Private Methods
private

_getOptions(method: string, params: Object): {json: boolean, body: {jsonrpc: string, id: string, method: string, [params]: Object}}

private

_keysToCamelCase(object: Object): Object

Converts object keys to camelCase.

Public Constructors

public constructor() source

Public Members

public get apiUrl: string source

public hostname: string source

public port: uint source

Public Methods

public async request(method: string, params: Object): Promise<*> source

Sends a request to defined host.

Params:

NameTypeAttributeDescription
method string

RPC method name.

params Object

Additional parameters.

Return:

Promise<*>

Private Methods

private _getOptions(method: string, params: Object): {json: boolean, body: {jsonrpc: string, id: string, method: string, [params]: Object}} source

Params:

NameTypeAttributeDescription
method string
params Object
  • optional

Return:

{json: boolean, body: {jsonrpc: string, id: string, method: string, [params]: Object}}

private _keysToCamelCase(object: Object): Object source

Converts object keys to camelCase.

Params:

NameTypeAttributeDescription
object Object

Return:

Object