RPC
Constructor Summary
Public Constructor | ||
public |
|
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
method | string | ||
params | Object |
|
Return:
{json: boolean, body: {jsonrpc: string, id: string, method: string, [params]: Object}} |
private _keysToCamelCase(object: Object): Object source
Converts object keys to camelCase.
Params:
Name | Type | Attribute | Description |
object | Object |
Return:
Object |