126 lines
2.9 KiB
TypeScript
126 lines
2.9 KiB
TypeScript
import { Block, Transaction } from "./electrs.interface";
|
|
|
|
export interface OptimizedMempoolStats {
|
|
added: number;
|
|
vbytes_per_second: number;
|
|
total_fee: number;
|
|
mempool_byte_weight: number;
|
|
vsizes: number[];
|
|
}
|
|
|
|
interface Ancestor {
|
|
txid: string;
|
|
weight: number;
|
|
fee: number;
|
|
}
|
|
|
|
interface BestDescendant {
|
|
txid: string;
|
|
weight: number;
|
|
fee: number;
|
|
}
|
|
|
|
export interface CpfpInfo {
|
|
ancestors: Ancestor[];
|
|
bestDescendant: BestDescendant | null;
|
|
}
|
|
|
|
export interface DifficultyAdjustment {
|
|
progressPercent: number;
|
|
difficultyChange: number;
|
|
estimatedRetargetDate: number;
|
|
remainingBlocks: number;
|
|
remainingTime: number;
|
|
previousRetarget: number;
|
|
nextRetargetHeight: number;
|
|
timeAvg: number;
|
|
timeOffset: number;
|
|
}
|
|
|
|
export interface AddressInformation {
|
|
isvalid: boolean; // (boolean) If the address is valid or not. If not, this is the only property returned.
|
|
isvalid_parent?: boolean; // (boolean) Elements only
|
|
address: string; // (string) The bitcoin address validated
|
|
scriptPubKey: string; // (string) The hex-encoded scriptPubKey generated by the address
|
|
isscript: boolean; // (boolean) If the key is a script
|
|
iswitness: boolean; // (boolean) If the address is a witness
|
|
witness_version?: number; // (numeric, optional) The version number of the witness program
|
|
witness_program: string; // (string, optional) The hex value of the witness program
|
|
confidential_key?: string; // (string) Elements only
|
|
unconfidential?: string; // (string) Elements only
|
|
}
|
|
|
|
export interface LiquidPegs {
|
|
amount: string;
|
|
date: string;
|
|
}
|
|
|
|
export interface ITranslators { [language: string]: string; }
|
|
|
|
/**
|
|
* PoolRanking component
|
|
*/
|
|
export interface SinglePoolStats {
|
|
poolId: number;
|
|
name: string;
|
|
link: string;
|
|
blockCount: number;
|
|
emptyBlocks: number;
|
|
rank: number;
|
|
share: number;
|
|
lastEstimatedHashrate: string;
|
|
emptyBlockRatio: string;
|
|
logo: string;
|
|
slug: string;
|
|
}
|
|
export interface PoolsStats {
|
|
blockCount: number;
|
|
lastEstimatedHashrate: number;
|
|
oldestIndexedBlockTimestamp: number;
|
|
pools: SinglePoolStats[];
|
|
}
|
|
|
|
/**
|
|
* Pool component
|
|
*/
|
|
export interface PoolInfo {
|
|
id: number | null; // mysql row id
|
|
name: string;
|
|
link: string;
|
|
regexes: string; // JSON array
|
|
addresses: string; // JSON array
|
|
emptyBlocks: number;
|
|
}
|
|
export interface PoolStat {
|
|
pool: PoolInfo;
|
|
blockCount: number;
|
|
emptyBlocks: number;
|
|
}
|
|
|
|
export interface BlockExtension {
|
|
totalFees?: number;
|
|
medianFee?: number;
|
|
feeRange?: number[];
|
|
reward?: number;
|
|
coinbaseTx?: Transaction;
|
|
coinbaseRaw?: string;
|
|
matchRate?: number;
|
|
pool?: {
|
|
id: number;
|
|
name: string;
|
|
slug: string;
|
|
}
|
|
|
|
stage?: number; // Frontend only
|
|
}
|
|
|
|
export interface BlockExtended extends Block {
|
|
extras?: BlockExtension;
|
|
}
|
|
|
|
export interface RewardStats {
|
|
totalReward: number;
|
|
totalFee: number;
|
|
totalTx: number;
|
|
}
|