@btcfun/mempool.js
Version:
Mirror NPM package module for Mempool APIs.
56 lines (55 loc) • 1.36 kB
TypeScript
import { Tx } from './transactions';
export interface Block {
id: string;
height: number;
version: number;
timestamp: number;
tx_count: number;
size: number;
weight: number;
merkle_root: string;
previousblockhash: string;
mediantime: number;
nonce: number;
bits: number;
difficulty: number;
extras: any;
}
export interface BlockStatus {
in_best_chain: boolean;
height: number;
next_best: string;
}
export interface BlockInstance {
getBlock: (params: {
hash: string;
}) => Promise<Block>;
getBlocks: (params: {
start_height?: number;
}) => Promise<Block[]>;
getBlockStatus: (params: {
hash: string;
}) => Promise<BlockStatus>;
getBlockTxs: (params: {
hash: string;
start_index?: number;
}) => Promise<Tx>;
getBlockTxids: (params: {
hash: string;
}) => Promise<string[]>;
getBlockTxid: (params: {
hash: string;
index: number;
}) => Promise<string>;
getBlockRaw: (params: {
hash: string;
}) => Promise<string>;
getBlockHeader: (params: {
hash: string;
}) => Promise<string>;
getBlockHeight: (params: {
height: number;
}) => Promise<string>;
getBlocksTipHeight: () => Promise<number>;
getBlocksTipHash: () => Promise<string>;
}