jcc_rpc
Version:
rpc api of jcc
80 lines (79 loc) • 2.38 kB
TypeScript
/// <reference path="types/index.d.ts" />
import JcBase from "./base";
/**
* creation example:
*
* 1: `new JcExplorer(["http://localhost:8080", "https://localhost:8090"])`
*
* 2: `new JcExplorer(["localhost"], 8080, false)`
*
* @export
* @class JcExplorer
* @extends {JcBase}
*/
export default class JcExplorer extends JcBase {
constructor(...args: any[]);
/**
* request balances via explorer
*
* @param {string} uuid
* @param {string} address
* @returns {Promise<IResponse>}
* @memberof JcExplorer
*/
getBalances(uuid: string, address: string): Promise<IResponse>;
/**
* request order detail via explorer
*
* @param {string} uuid
* @param {string} hash
* @returns {Promise<IResponse>}
* @memberof JcExplorer
*/
orderDetail(uuid: string, hash: string): Promise<IResponse>;
/**
* request history via explorer
*
* @param {string} uuid
* @param {string} address
* @param {number} page
* @param {number} size
* @param {{ begin: string, end: string, currency: string, type: string, buyOrsell: number, otherWallet: string }} options
* @returns {Promise<IResponse>}
* @memberof JcExplorer
*/
getHistory(uuid: string, address: string, page: number, size: number, options: {
begin: string;
end: string;
currency: string;
type: string;
buyOrsell: number;
otherWallet: string;
}): Promise<IResponse>;
/**
* request current order via explorer
*
* @param {string} uuid
* @param {string} address
* @param {number} page
* @param {number} size default 20, there are four choices of 10, 20, 50, 100
* @param {{ pair: string, buyOrsell: number }} options pair:swtc-cny or SWTC-CNY; buyOrsell:0 buy or sell,1 buy,2 sell
* @returns {Promise<IResponse>}
* @memberof JcExplorer
*/
getOrders(uuid: string, address: string, page: number, size: number, options: {
pair: string;
buyOrsell: number;
}): Promise<IResponse>;
/**
* request tokens via explorer
*
* @param {string} uuid
* @param {{ currency: string }} options
* @returns {Promise<IResponse>}
* @memberof JcExplorer
*/
getTokens(uuid: string, options: {
currency: string;
}): Promise<IResponse>;
}