2022-02-04 12:51:45 +09:00
|
|
|
import { Block, Transaction } from "./electrs.interface";
|
|
|
|
|
2020-02-17 00:26:57 +07:00
|
|
|
export interface OptimizedMempoolStats {
|
2021-12-11 00:04:20 +09:00
|
|
|
added: number;
|
2020-02-16 22:15:07 +07:00
|
|
|
vbytes_per_second: number;
|
2020-02-17 00:26:57 +07:00
|
|
|
total_fee: number;
|
2020-02-16 22:15:07 +07:00
|
|
|
mempool_byte_weight: number;
|
2021-09-07 17:48:43 -03:00
|
|
|
vsizes: number[];
|
2020-02-16 22:15:07 +07:00
|
|
|
}
|
2021-03-18 23:47:40 +07:00
|
|
|
|
|
|
|
interface Ancestor {
|
|
|
|
txid: string;
|
|
|
|
weight: number;
|
|
|
|
fee: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BestDescendant {
|
|
|
|
txid: string;
|
|
|
|
weight: number;
|
|
|
|
fee: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CpfpInfo {
|
|
|
|
ancestors: Ancestor[];
|
|
|
|
bestDescendant: BestDescendant | null;
|
|
|
|
}
|
2021-07-24 19:26:48 -03:00
|
|
|
|
|
|
|
export interface DifficultyAdjustment {
|
2022-03-12 14:55:42 +01:00
|
|
|
progressPercent: number;
|
2021-07-24 19:26:48 -03:00
|
|
|
difficultyChange: number;
|
|
|
|
estimatedRetargetDate: number;
|
|
|
|
remainingBlocks: number;
|
|
|
|
remainingTime: number;
|
2022-03-12 14:55:42 +01:00
|
|
|
previousRetarget: number;
|
|
|
|
nextRetargetHeight: number;
|
|
|
|
timeAvg: number;
|
|
|
|
timeOffset: number;
|
2021-07-24 19:26:48 -03:00
|
|
|
}
|
2021-09-06 10:20:31 +04:00
|
|
|
|
|
|
|
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
|
2021-12-16 04:53:27 +04:00
|
|
|
witness_version?: number; // (numeric, optional) The version number of the witness program
|
2021-09-06 10:20:31 +04:00
|
|
|
witness_program: string; // (string, optional) The hex value of the witness program
|
|
|
|
confidential_key?: string; // (string) Elements only
|
|
|
|
unconfidential?: string; // (string) Elements only
|
|
|
|
}
|
2021-09-25 03:13:07 +04:00
|
|
|
|
|
|
|
export interface LiquidPegs {
|
|
|
|
amount: string;
|
|
|
|
date: string;
|
|
|
|
}
|
2022-01-13 03:58:12 +04:00
|
|
|
|
|
|
|
export interface ITranslators { [language: string]: string; }
|
2022-01-06 19:59:33 +09:00
|
|
|
|
2022-02-09 19:41:05 +09:00
|
|
|
/**
|
|
|
|
* PoolRanking component
|
|
|
|
*/
|
2022-01-14 18:09:40 +09:00
|
|
|
export interface SinglePoolStats {
|
2022-02-08 19:04:53 +09:00
|
|
|
poolId: number;
|
2022-01-21 11:17:36 +09:00
|
|
|
name: string;
|
|
|
|
link: string;
|
|
|
|
blockCount: number;
|
|
|
|
emptyBlocks: number;
|
|
|
|
rank: number;
|
2022-03-05 18:47:21 +01:00
|
|
|
share: number;
|
2022-01-21 11:17:36 +09:00
|
|
|
lastEstimatedHashrate: string;
|
|
|
|
emptyBlockRatio: string;
|
|
|
|
logo: string;
|
2022-03-25 14:22:22 +09:00
|
|
|
slug: string;
|
2022-01-14 18:09:40 +09:00
|
|
|
}
|
2022-01-06 19:59:33 +09:00
|
|
|
export interface PoolsStats {
|
2022-01-21 11:17:36 +09:00
|
|
|
blockCount: number;
|
|
|
|
lastEstimatedHashrate: number;
|
|
|
|
pools: SinglePoolStats[];
|
2022-01-06 19:59:33 +09:00
|
|
|
}
|
2022-02-09 19:41:05 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
2022-04-05 00:36:00 +09:00
|
|
|
blockCount: {
|
|
|
|
all: number,
|
|
|
|
'24h': number,
|
|
|
|
'1w': number,
|
|
|
|
};
|
|
|
|
blockShare: {
|
|
|
|
all: number,
|
|
|
|
'24h': number,
|
|
|
|
'1w': number,
|
|
|
|
};
|
|
|
|
estimatedHashrate: number;
|
|
|
|
reportedHashrate: number;
|
|
|
|
luck?: number;
|
2022-01-14 18:09:40 +09:00
|
|
|
}
|
|
|
|
|
2022-02-04 12:51:45 +09:00
|
|
|
export interface BlockExtension {
|
2022-02-22 23:57:54 +09:00
|
|
|
totalFees?: number;
|
2022-02-04 12:51:45 +09:00
|
|
|
medianFee?: number;
|
|
|
|
feeRange?: number[];
|
|
|
|
reward?: number;
|
|
|
|
coinbaseTx?: Transaction;
|
2022-03-15 23:33:51 +01:00
|
|
|
coinbaseRaw?: string;
|
2022-02-04 12:51:45 +09:00
|
|
|
matchRate?: number;
|
2022-02-14 13:21:35 +09:00
|
|
|
pool?: {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
2022-03-25 14:22:22 +09:00
|
|
|
slug: string;
|
2022-02-14 13:21:35 +09:00
|
|
|
}
|
2022-02-04 12:51:45 +09:00
|
|
|
|
|
|
|
stage?: number; // Frontend only
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BlockExtended extends Block {
|
2022-02-04 19:28:00 +09:00
|
|
|
extras?: BlockExtension;
|
2022-02-04 12:51:45 +09:00
|
|
|
}
|
2022-03-22 12:34:29 +09:00
|
|
|
|
2022-07-07 19:11:42 +02:00
|
|
|
export interface BlockAudit extends BlockExtended {
|
|
|
|
missingTxs: string[],
|
|
|
|
addedTxs: string[],
|
|
|
|
matchRate: number,
|
|
|
|
template: TransactionStripped[],
|
|
|
|
transactions: TransactionStripped[],
|
|
|
|
}
|
|
|
|
|
2022-06-14 16:39:37 +00:00
|
|
|
export interface TransactionStripped {
|
|
|
|
txid: string;
|
|
|
|
fee: number;
|
|
|
|
vsize: number;
|
|
|
|
value: number;
|
2022-07-07 19:11:42 +02:00
|
|
|
status?: 'found' | 'missing' | 'added';
|
2022-06-14 16:39:37 +00:00
|
|
|
}
|
|
|
|
|
2022-03-22 12:34:29 +09:00
|
|
|
export interface RewardStats {
|
2022-04-01 12:41:25 +09:00
|
|
|
startBlock: number;
|
|
|
|
endBlock: number;
|
2022-03-22 12:34:29 +09:00
|
|
|
totalReward: number;
|
|
|
|
totalFee: number;
|
|
|
|
totalTx: number;
|
|
|
|
}
|
2022-08-17 12:53:26 +02:00
|
|
|
|
|
|
|
export interface ITopNodesPerChannels {
|
2022-08-17 16:19:01 +02:00
|
|
|
publicKey: string,
|
2022-08-17 12:53:26 +02:00
|
|
|
alias: string,
|
2022-08-17 16:19:01 +02:00
|
|
|
channels?: number,
|
|
|
|
capacity: number,
|
|
|
|
firstSeen?: number,
|
|
|
|
updatedAt?: number,
|
|
|
|
city?: any,
|
|
|
|
country?: any,
|
2022-09-02 10:08:25 +02:00
|
|
|
subdivision?: any,
|
|
|
|
iso_code?: string,
|
|
|
|
geolocation?: any;
|
2022-08-17 12:53:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ITopNodesPerCapacity {
|
2022-08-17 16:00:30 +02:00
|
|
|
publicKey: string,
|
2022-08-17 12:53:26 +02:00
|
|
|
alias: string,
|
|
|
|
capacity: number,
|
2022-08-17 16:00:30 +02:00
|
|
|
channels?: number,
|
|
|
|
firstSeen?: number,
|
|
|
|
updatedAt?: number,
|
|
|
|
city?: any,
|
|
|
|
country?: any,
|
2022-09-02 10:08:25 +02:00
|
|
|
subdivision?: any,
|
|
|
|
iso_code?: string,
|
|
|
|
geolocation?: any;
|
2022-08-17 12:53:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface INodesRanking {
|
|
|
|
topByCapacity: ITopNodesPerCapacity[];
|
|
|
|
topByChannels: ITopNodesPerChannels[];
|
2022-08-17 21:20:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IOldestNodes {
|
|
|
|
publicKey: string,
|
|
|
|
alias: string,
|
|
|
|
firstSeen: number,
|
|
|
|
channels?: number,
|
|
|
|
capacity: number,
|
|
|
|
updatedAt?: number,
|
|
|
|
city?: any,
|
|
|
|
country?: any,
|
2022-09-02 10:08:25 +02:00
|
|
|
subdivision?: any,
|
|
|
|
iso_code?: string,
|
|
|
|
geolocation?: any;
|
2022-08-23 11:26:00 +02:00
|
|
|
}
|
2022-08-27 16:00:58 +02:00
|
|
|
|
|
|
|
export interface IChannel {
|
|
|
|
id: number;
|
|
|
|
short_id: string;
|
|
|
|
capacity: number;
|
|
|
|
transaction_id: string;
|
|
|
|
transaction_vout: number;
|
|
|
|
closing_transaction_id: string;
|
|
|
|
closing_reason: string;
|
|
|
|
updated_at: string;
|
|
|
|
created: string;
|
|
|
|
status: number;
|
|
|
|
node_left: Node,
|
|
|
|
node_right: Node,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface INode {
|
|
|
|
alias: string;
|
|
|
|
public_key: string;
|
|
|
|
channels: number;
|
|
|
|
capacity: number;
|
|
|
|
base_fee_mtokens: number;
|
|
|
|
cltv_delta: number;
|
|
|
|
fee_rate: number;
|
|
|
|
is_disabled: boolean;
|
|
|
|
max_htlc_mtokens: number;
|
|
|
|
min_htlc_mtokens: number;
|
|
|
|
updated_at: string;
|
|
|
|
longitude: number;
|
|
|
|
latitude: number;
|
|
|
|
}
|