@altangent/lib-blockbook
Version:
Basic Blockbook API client
146 lines (145 loc) • 3.43 kB
TypeScript
export declare namespace V2 {
type Status = {
blockbook: BlockbookInfo;
backend: BackendInfo;
};
type BlockbookInfo = {
coin: string;
host: string;
version: string;
gitCommit: string;
buildTime: string;
syncMode: boolean;
initialSync: boolean;
inSync: boolean;
bestHeight: number;
lastBlockTime: string;
inSyncMempool: boolean;
mempoolSize: number;
decimals: number;
dbSize: number;
about: string;
};
type BackendInfo = {
chain: string;
blocks: number;
headers: number;
bestBlockHash: string;
difficulty: string;
sizeOnDisk: number;
version: string;
subversion: string;
protocolVersion: string;
warnings: string;
};
type BlockHash = {
blockHash: string;
};
type Tx = {
txid: string;
version: number;
blockHash: string;
blockHeight: number;
confirmations: number;
blockTime: number;
value: string;
valueIn: string;
fees: string;
hex: string;
vin: TxInput[];
vout: TxOutput[];
};
type TxInput = {
txid: string;
vout: number;
sequence: number;
n: number;
addresses: string[];
isAddress: boolean;
value: string;
hex: string;
};
type TxOutput = {
value: string;
n: number;
hex: string;
addresses: string[];
spent: boolean;
isAddress: boolean;
};
type AddressResult = {
page: number;
totalPages: number;
itemsOnPage: number;
address: string;
balance: string;
totalReceived: string;
totalSent: string;
unconfirmedBalance: string;
unconfirmedTxs: number;
txs: number;
txids?: string[];
transactions?: TxLight[] | Tx[];
};
type TxLight = {
txid: string;
vin: TxInputLight[];
vout: TxOutputLight[];
};
type TxInputLight = {
n: number;
addresses: string[];
isAddress: boolean;
value: string;
};
type TxOutputLight = {
value: string;
n: number;
addresses: string[];
isAddress: boolean;
};
type Block = {
page: number;
totalPages: number;
itemsOnPage: number;
hash: string;
previousBlockHash: string;
nextBlockHash: string;
height: number;
confirmations: number;
size: number;
time: number;
version: number;
merkleRoot: string;
nonce: string;
bits: string;
difficulty: string;
txCount: number;
txs: BlockTx[];
};
type BlockTx = {
txid: string;
blockHash: string;
blockHeight: number;
confirmations: number;
blockTime: number;
value: string;
valueIn: string;
fees: string;
vin: BlockTxInput[];
vout: BlockTxOutput[];
};
type BlockTxInput = {
n: number;
addresses: string[];
isAddress: boolean;
value: string;
};
type BlockTxOutput = {
value: string;
n: number;
spent: boolean;
addresses: string[];
isAddress: boolean;
};
}