@berrywallet/core
Version:
Berrywallet main Core for work with common cryptocurrencies like Bitcoin, Ethereum, Dash, Litecoin
94 lines (93 loc) • 2.43 kB
TypeScript
import { Coin, Wallet } from '../../';
declare namespace blockcypher {
type Network = {
name: string;
height: number;
hash: string;
time: string;
latest_url: string;
previous_hash: string;
previous_url: string;
peer_count: number;
unconfirmed_count: number;
high_fee_per_kb: number;
medium_fee_per_kb: number;
low_fee_per_kb: number;
last_fork_height?: number;
last_fork_hash?: string;
};
type Block = {
hash: string;
depth: number;
height: number;
chain: string;
relayed_by: string;
total: number;
fees: number;
ver: number;
time: string;
received_time: string;
bits: number;
nonce: number;
n_tx: number;
prev_block: string;
mrkl_root: string;
txids: string[];
prev_block_url: string;
tx_url: string;
};
type Input = {
prev_hash: string;
output_index: number;
script?: string;
output_value: number;
sequence: number;
addresses?: string[];
script_type: string;
witness?: string[];
};
type Output = {
value: number;
script: string;
spent_by: string;
addresses: string[];
script_type: string;
};
type Transaction = {
block_hash: string;
block_height: number;
hash: string;
addresses: string[];
total: number;
fees: number;
size: number;
preference: string;
relayed_by: string;
confirmed?: string;
receive_count?: string;
received: string;
ver: number;
lock_time: number;
double_spend: boolean;
vin_sz: number;
vout_sz: number;
confirmations: number;
confidence: number;
inputs: Input[];
outputs: Output[];
};
interface AddressInfo {
address: string;
total_received: number;
total_sent: number;
balance: number;
unconfirmed_balance: number;
final_balance: number;
n_tx: number;
unconfirmed_n_tx: number;
final_n_tx: number;
txs: Transaction[];
}
function toWalletTx(tx: Transaction, coin: Coin.CoinInterface): Wallet.Entity.BIPTransaction;
}
export default blockcypher;