nano-wallet-js-test-1
Version:
SDK for developers to create and interact with Nanocurrency wallet easily
25 lines (24 loc) • 1.12 kB
TypeScript
import { BlockRepresentation } from 'nanocurrency';
import { AccountBalanceResponse, AccountInfoResponse, ProcessResponse, ReceivableWithThresholdResponse, WorkGenerateResponse } from './RpControllerc.types';
export interface NanoRpcConfig {
rpcUrls: string | string[];
workerUrls: string | string[];
timeout?: number;
debug?: boolean;
}
export default class NanoRPC {
rpcUrls: string[];
workerUrls: string[];
timeout: number;
private logger;
constructor({ rpcUrls, workerUrls, timeout, debug, }: NanoRpcConfig);
postRPC<TRPCResponse = unknown>(data: any, urls?: string[], retry?: number): Promise<TRPCResponse>;
process(block: BlockRepresentation): Promise<ProcessResponse>;
workGenerate(hash: string, difficulty: string): Promise<WorkGenerateResponse>;
accountInfo(account: string): Promise<AccountInfoResponse>;
accountBalance(account: string): Promise<AccountBalanceResponse>;
receivable(account: string, { count, threshold }: {
count?: number | undefined;
threshold?: string | undefined;
}): Promise<ReceivableWithThresholdResponse>;
}