UNPKG

blockcypher-client

Version:

A TypeScript client for interacting with BlockCypher's API that provides strong typing and safety when interacting with BlockCypher services.

20 lines (19 loc) 1.88 kB
import { AddressBalanceMap, AddressMap, BlockChainInfoMap, BlockMap, TransactionMap } from "./typings/api-response-mappings"; import { TransactionConfidence } from "./typings/api-response-types"; import { BlockCypherOptions, Coin, MethodResponse, MethodParams } from "./typings/types"; export declare function createBlockCypherClient<TCoin extends Coin | undefined = undefined>(options?: BlockCypherOptions & { coin?: TCoin; }): BlockCypherClient<TCoin>; declare class BlockCypherClient<ConstructorCoin extends Coin | undefined = undefined> { private baseUrl; private options; constructor(options?: BlockCypherOptions); private request; getAddressBalance<MethodCoin extends Coin | undefined = undefined>(...args: MethodParams<ConstructorCoin, MethodCoin, [address: string]>): Promise<MethodResponse<ConstructorCoin, MethodCoin, AddressBalanceMap>>; getBlockChainInfo<MethodCoin extends Coin | undefined = undefined>(...args: MethodParams<ConstructorCoin, MethodCoin, []>): Promise<MethodResponse<ConstructorCoin, MethodCoin, BlockChainInfoMap>>; getBlock<MethodCoin extends Coin | undefined = undefined>(...args: MethodParams<ConstructorCoin, MethodCoin, [blockHashOrHeight: string]>): Promise<MethodResponse<ConstructorCoin, MethodCoin, BlockMap>>; getAddress<MethodCoin extends Coin | undefined = undefined>(...args: MethodParams<ConstructorCoin, MethodCoin, [address: string]>): Promise<MethodResponse<ConstructorCoin, MethodCoin, AddressMap>>; getTransaction<MethodCoin extends Coin | undefined = undefined>(...args: MethodParams<ConstructorCoin, MethodCoin, [hash: string]>): Promise<MethodResponse<ConstructorCoin, MethodCoin, TransactionMap>>; getTransactionConfidence<MethodCoin extends Coin | undefined = undefined>(...args: MethodParams<ConstructorCoin, MethodCoin, [hash: string]>): Promise<TransactionConfidence>; } export {};