libnemo
Version:
Nano cryptocurrency wallet library.
26 lines (25 loc) • 924 B
TypeScript
/**
* Represents a Nano network node. It primarily consists of a URL which will
* accept RPC calls, and an optional API key header construction can be passed if
* required by the node. Once instantiated, the Rpc object can be used to call
* any action supported by the Nano protocol. The URL protocol must be HTTPS; any
* other value will be changed automatically.
*/
export declare class Rpc {
#private;
/**
* @param {(string|URL)} url
* @param {string} [apiKeyName]
*/
constructor(url: string | URL, apiKeyName?: string);
/**
* Sends a nano RPC call to a node endpoint.
*
* @param {string} action - Nano protocol RPC call to execute
* @param {object} [data] - JSON to send to the node as defined by the action
* @returns {Promise<any>} JSON-formatted RPC results from the node
*/
post(action: string, data?: {
[key: string]: unknown;
}): Promise<any>;
}