UNPKG

@dev-ptera/nano-node-rpc

Version:

A typescript nanocurrency client used to make node RPC calls.

237 lines (236 loc) 6.09 kB
export declare type ErrorResponse = { error: string; }; export declare type Subtype = 'send' | 'receive' | 'change' | 'open' | 'epoch'; export declare type AccountBalanceResponse = { balance: string; pending: string; }; export declare type AccountBlockCountResponse = { block_count: string; }; export declare type AccountGetResponse = { account: string; }; export declare type AccountHistoryResponse = { account: string; history?: Array<{ type: Subtype; account: string; amount: string; local_timestamp: string; height: string; hash: string; }>; previous?: string; next?: string; }; export declare type AccountInfoResponse = { frontier: string; open_block: string; representative_block: string; balance: string; modified_timestamp: string; block_count: string; confirmation_height: string; confirmation_height_frontier: string; account_version: string; representative?: string; weight?: string; pending?: string; }; export declare type AccountKeyResponse = { key: string; }; export declare type AccountRepresentativeResponse = { representative: string; }; export declare type AccountWeightResponse = { weight: string; }; export declare type AccountsBalancesResponse = { balances: { [account: string]: { balance: string; pending: string; }; }; }; export declare type AccountsFrontiersResponse = { frontiers: { [account: string]: string; }; }; export declare type AccountsPendingResponse = { blocks: { [account: string]: string[] | { [block: string]: string | { amount: string; source: string; }; }; }; }; export declare type ActiveDifficultyResponse = { multiplier: string; network_current: string; network_minimum: string; network_receive_current: string; network_receive_minimum: string; difficulty_trend?: string[]; }; export declare type AvailableSupplyResponse = { available: string; }; export declare type BlockResponse = { block_account: string; amount: string; balance: string; height: string; local_timestamp: string; confirmed: boolean; contents: string; subtype: string; }; export declare type BlockAccountResponse = { account: string; }; export declare type BlockConfirmResponse = { started: '1' | '0'; }; export declare type BlockCountResponse = { count: string; unchecked: string; cemented?: string; }; export declare type BlocksResponse = { blocks: { [hash: string]: { type: string; account: string; previous: string; representative: string; balance: string; link: string; link_as_account: string; signature: string; work: string; }; }; }; export declare type BlocksInfoResponseContents = { type: string; account: string; previous: string; representative: string; balance: string; link: string; link_as_account: string; signature: string; work: string; }; export declare type BlocksInfoResponse = { blocks: { [hash: string]: { block_account: string; amount: string; balance?: string; height: string; local_timestamp: string; confirmed: boolean; contents: string | BlocksInfoResponseContents; subtype: Subtype; pending?: string; source_account?: string; }; }; blocks_not_found?: string[]; }; export declare type ChainResponse = { blocks: string[]; }; export declare type ConfirmationQuorumResponse = { quorum_delta: string; online_weight_quorum_percent: string; online_weight_minimum: string; online_stake_total: string; peers_stake_total: string; peers_stake_required: string; peers?: Array<{ account: string; ip: string; weight: string; }>; }; export declare type DelegatorsResponse = { delegators: { [account: string]: string; }; }; export declare type DelegatorsCountResponse = { count: string; }; export declare type FrontierCountResponse = { count: string; }; export declare type FrontiersResponse = { frontiers: { [account: string]: string; }; }; export declare type PeersResponseDetails = { protocol_version: string; node_id: string; type: string; }; export declare type PeersResponse<T extends PeersResponseDetails | undefined> = { peers: { [ip: string]: T extends PeersResponseDetails ? PeersResponseDetails : string; }; }; export declare type ProcessResponse = { hash: string; }; export declare type RepresentativesResponse = { representatives: { [account: string]: string; }; }; export declare type RepresentativesOnlineResponse = { representatives: string[]; }; export declare type RepresentativesOnlineWeightResponse = { representatives: { [account: string]: { weight: string; }; }; }; export declare type UnitConversionResponse = { amount: string; }; export declare type ValidateAccountNumberResponse = { valid: '1' | '0'; }; export declare type VersionResponse = { rpc_version: string; store_version: string; protocol_version: string; node_vendor: string; store_vendor?: string; network?: string; network_identifier?: string; build_info?: string; }; export declare type UptimeResponse = { seconds: string; }; export declare type WorkCancelResponse = { success: ''; }; export declare type WorkGenerateResponse = { work: string; difficulty: string; multiplier: string; hash: string; };