UNPKG

blockchain-wallet-ts

Version:

TypeScript wrapper for Blockchain.info's wallet API

49 lines (48 loc) 1.1 kB
import { AxiosInstance } from 'axios'; export default abstract class ApiClient { /** * HTTP API Client. */ protected readonly http: AxiosInstance; /** * Blockchain.com API Key. */ protected readonly apiKey?: string; /** * API Base path. */ protected basePath: string; /** * Parameters to be included in every API request. */ protected baseParams: KeyVal; /** * API Client constructor. */ protected constructor(config: ApiClientConfig); /** * Attach default request parameters. */ protected requestParams(params?: KeyVal): { api_code: string | undefined; } | { api_code: string | undefined; }; /** * Send an API request. */ protected request<T>(path: string, params?: KeyVal): Promise<T>; } export interface ApiClientConfig { /** * API Client. */ http: AxiosInstance; /** * Blockchain.com API Key. */ apiKey?: string; } export interface KeyVal { [key: string]: any; }