export interface AddressBalance { /** @format uint256 */ balance: string; /** @format uint256 */ lockedBalance: string; } export interface AddressInfo { /** @format uint256 */ balance: string; /** @format uint256 */ lockedBalance: string; txNumber: number; } export interface BadRequest { detail: string; } export interface BlockEntryLite { hash: string; /** @format int64 */ timestamp: number; chainFrom: number; chainTo: number; height: number; txNumber: number; mainChain: boolean; /** @format bigint */ hashRate: string; } export interface ConfirmedTransaction { hash: string; blockHash: string; /** @format int64 */ timestamp: number; inputs?: Input[]; outputs?: Output[]; gasAmount: number; /** @format uint256 */ gasPrice: string; type: string; } export interface ExplorerInfo { releaseVersion: string; commit: string; } export interface Hashrate { /** @format int64 */ timestamp: number; value: string; } export interface Input { outputRef: OutputRef; unlockScript?: string; txHashRef: string; address: string; /** @format uint256 */ amount: string; } export interface InternalServerError { detail: string; } export interface ListBlocks { total: number; blocks?: BlockEntryLite[]; } export interface NotFound { detail: string; resource: string; } export interface Output { hint: number; /** @format 32-byte-hash */ key: string; /** @format uint256 */ amount: string; address: string; /** @format int64 */ lockTime?: number; spent?: string; } export interface OutputRef { hint: number; /** @format 32-byte-hash */ key: string; } export interface PerChainValue { chainFrom: number; chainTo: number; /** @format int64 */ value: number; } export interface ServiceUnavailable { detail: string; } export interface TokenSupply { /** @format int64 */ timestamp: number; /** @format uint256 */ total: string; /** @format uint256 */ circulating: string; /** @format uint256 */ reserved: string; /** @format uint256 */ locked: string; /** @format uint256 */ maximum: string; } export interface Transaction { hash: string; blockHash: string; /** @format int64 */ timestamp: number; inputs?: Input[]; outputs?: Output[]; gasAmount: number; /** @format uint256 */ gasPrice: string; } export declare type TransactionLike = ConfirmedTransaction | UnconfirmedTransaction; export interface UInput { outputRef: OutputRef; unlockScript?: string; } export interface UOutput { /** @format uint256 */ amount: string; address: string; /** @format int64 */ lockTime?: number; } export interface Unauthorized { detail: string; } export interface UnconfirmedTransaction { hash: string; chainFrom: number; chainTo: number; inputs?: UInput[]; outputs?: UOutput[]; gasAmount: number; /** @format uint256 */ gasPrice: string; type: string; } import fetch from 'cross-fetch'; export declare type QueryParamsType = Record; export declare type ResponseFormat = keyof Omit; export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ path: string; /** content type of request body */ type?: ContentType; /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -> format: "json") */ format?: ResponseFormat; /** request body */ body?: unknown; /** base url */ baseUrl?: string; /** request cancellation token */ cancelToken?: CancelToken; } export declare type RequestParams = Omit; export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit; securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; customFetch?: typeof fetch; } export interface HttpResponse extends Response { data: D; error: E; } declare type CancelToken = Symbol | string | number; export declare enum ContentType { Json = "application/json", FormData = "multipart/form-data", UrlEncoded = "application/x-www-form-urlencoded" } export declare class HttpClient { baseUrl: string; private securityData; private securityWorker?; private abortControllers; private customFetch; private baseApiParams; constructor(apiConfig?: ApiConfig); setSecurityData: (data: SecurityDataType | null) => void; private encodeQueryParam; private addQueryParam; private addArrayQueryParam; protected toQueryString(rawQuery?: QueryParamsType): string; protected addQueryParams(rawQuery?: QueryParamsType): string; private contentFormatters; private mergeRequestParams; private createAbortSignal; abortRequest: (cancelToken: CancelToken) => void; request: ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise>; } /** * @title Alephium Explorer API * @version 1.0 */ export declare class Api extends HttpClient { blocks: { /** * @description List blocks within time interval * * @tags Blocks * @name GetBlocks * @request GET:/blocks */ getBlocks: (query?: { page?: number | undefined; limit?: number | undefined; reverse?: boolean | undefined; } | undefined, params?: RequestParams) => Promise; /** * @description Get a block with hash * * @tags Blocks * @name GetBlocksBlockHash * @request GET:/blocks/{block-hash} */ getBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise; /** * @description Get block's transactions * * @tags Blocks * @name GetBlocksBlockHashTransactions * @request GET:/blocks/{block-hash}/transactions */ getBlocksBlockHashTransactions: (blockHash: string, query?: { page?: number | undefined; limit?: number | undefined; reverse?: boolean | undefined; } | undefined, params?: RequestParams) => Promise; }; transactions: { /** * @description Get a transaction with hash * * @tags Transactions * @name GetTransactionsTransactionHash * @request GET:/transactions/{transaction-hash} */ getTransactionsTransactionHash: (transactionHash: string, params?: RequestParams) => Promise; }; addresses: { /** * @description Get address information * * @tags Addresses * @name GetAddressesAddress * @request GET:/addresses/{address} */ getAddressesAddress: (address: string, params?: RequestParams) => Promise; /** * @description List transactions of a given address * * @tags Addresses * @name GetAddressesAddressTransactions * @request GET:/addresses/{address}/transactions */ getAddressesAddressTransactions: (address: string, query?: { page?: number | undefined; limit?: number | undefined; reverse?: boolean | undefined; } | undefined, params?: RequestParams) => Promise; /** * @description Get total transactions of a given address * * @tags Addresses * @name GetAddressesAddressTotalTransactions * @request GET:/addresses/{address}/total-transactions */ getAddressesAddressTotalTransactions: (address: string, params?: RequestParams) => Promise; /** * @description Get address balance * * @tags Addresses * @name GetAddressesAddressBalance * @request GET:/addresses/{address}/balance */ getAddressesAddressBalance: (address: string, params?: RequestParams) => Promise; }; infos: { /** * @description Get explorer informations * * @tags Infos * @name GetInfos * @request GET:/infos */ getInfos: (params?: RequestParams) => Promise; /** * @description List latest height for each chain * * @tags Infos * @name GetInfosHeights * @request GET:/infos/heights */ getInfosHeights: (params?: RequestParams) => Promise; /** * @description Get token supply list * * @tags Infos * @name GetInfosSupply * @request GET:/infos/supply */ getInfosSupply: (query?: { page?: number | undefined; limit?: number | undefined; reverse?: boolean | undefined; } | undefined, params?: RequestParams) => Promise; /** * @description Get the ALPH total supply * * @tags Infos * @name GetInfosSupplyTotalAlph * @request GET:/infos/supply/total-alph */ getInfosSupplyTotalAlph: (params?: RequestParams) => Promise; /** * @description Get the ALPH circulating supply * * @tags Infos * @name GetInfosSupplyCirculatingAlph * @request GET:/infos/supply/circulating-alph */ getInfosSupplyCirculatingAlph: (params?: RequestParams) => Promise; /** * @description Get the ALPH reserved supply * * @tags Infos * @name GetInfosSupplyReservedAlph * @request GET:/infos/supply/reserved-alph */ getInfosSupplyReservedAlph: (params?: RequestParams) => Promise; /** * @description Get the ALPH locked supply * * @tags Infos * @name GetInfosSupplyLockedAlph * @request GET:/infos/supply/locked-alph */ getInfosSupplyLockedAlph: (params?: RequestParams) => Promise; /** * @description Get the total number of transactions * * @tags Infos * @name GetInfosTotalTransactions * @request GET:/infos/total-transactions */ getInfosTotalTransactions: (params?: RequestParams) => Promise; /** * @description Get the average block time for each chain * * @tags Infos * @name GetInfosAverageBlockTimes * @request GET:/infos/average-block-times */ getInfosAverageBlockTimes: (params?: RequestParams) => Promise; }; charts: { /** * @description `interval-type` query param: hourly, daily * * @tags Charts * @name GetChartsHashrates * @summary Get hashrate chart in H/s * @request GET:/charts/hashrates */ getChartsHashrates: (query: { fromTs: number; toTs: number; 'interval-type': string; }, params?: RequestParams) => Promise; }; utils: { /** * @description Perform a sanity check * * @tags Utils * @name PutUtilsSanityCheck * @request PUT:/utils/sanity-check */ putUtilsSanityCheck: (params?: RequestParams) => Promise; }; } export {};