import * as url from 'url'; declare namespace io.gimbalabs.hilltop.api.v0.enums { type Country = 'IE' | 'UK'; } declare namespace io.gimbalabs.hilltop.api.v0.models { interface ActiveStakeAmount { readonly 'amount_in_lovelaces': number; } interface AddressStakeAmount { readonly 'stake_address': string; readonly 'amount_in_lovelaces': number; } interface Block { readonly 'number': number; readonly 'epoch_number': number; readonly 'slot_number': number; readonly 'epoch_slot_number': number; readonly 'size': number; readonly 'transaction_count': number; readonly 'time': string; } interface CnftMetadataV001 { readonly 'policyId': string; readonly 'tokens': Record; readonly 'asset': io.gimbalabs.hilltop.api.v0.models.CnftMetadataV001Asset; } interface CnftMetadataV001Asset { readonly 'assetName'?: string; readonly 'attributes'?: any/*json*/; readonly 'ipfs': string; readonly 'mimeType'?: string; } interface DayBlock { readonly 'first': io.gimbalabs.hilltop.api.v0.models.Block; readonly 'last': io.gimbalabs.hilltop.api.v0.models.Block; } interface Delegation { readonly 'staking_address': string; readonly 'delegations': io.gimbalabs.hilltop.api.v0.models.StakepoolDelegation[]; } interface DelegatorsCount { readonly 'delegators_count_total': number; } interface Epoch { readonly 'out_sum': number; readonly 'fees': number; readonly 'tx_count': number; readonly 'blk_count': number; readonly 'number': number; readonly 'start_time': string; readonly 'end_time': string; } interface GenericError { readonly 'description': string; } interface Healthcheck { readonly 'status': string; } interface NativeAsset { readonly 'transaction_id': string; readonly 'policy_id': string; readonly 'token_name': string; readonly 'metadata': any/*json*/; readonly 'block_number': number; readonly 'epoch_slot_number': number; readonly 'epoch_number': number; readonly 'invalid_before'?: number; readonly 'invalid_hereafter'?: number; readonly 'quantity': number; } interface NativeAssetDetails { readonly 'policy_id': string; readonly 'asset_name': string; readonly 'metadata': any/*json*/; readonly 'minted_at': string; readonly 'last_minted_at': string; readonly 'first_minting_tx_block': number; readonly 'last_minting_tx_block': number; readonly 'minting_tx_hash': string; readonly 'circulating_supply': number; readonly 'fingerprint': string; } interface NativeAssetDetailsRequest { readonly 'policy_id': string; readonly 'asset_names'?: string[]; } interface NativeAssetId { readonly 'policy_id': string; readonly 'asset_name': string; readonly 'block_number': number; readonly 'block_time': string; readonly 'fingerprint': string; } interface NftDetails { readonly 'policy_id': string; readonly 'asset_name_raw': string; readonly 'asset_name'?: string; readonly 'metadata': any/*json*/; readonly 'minted_at': string; readonly 'minted_at_block': number; readonly 'minting_tx_hash': string; readonly 'amount': number; readonly 'fingerprint': string; } interface NftMetadata { readonly 'name'?: string; readonly 'image'?: string; readonly 'mediaType'?: string; readonly 'files'?: io.gimbalabs.hilltop.api.v0.models.NftMetadataFile[]; } interface NftMetadataFile { readonly 'name'?: string; readonly 'src'?: string; readonly 'mediaType'?: string; } interface NftMetadataFilesAsObject { readonly 'name'?: string; readonly 'image'?: string; readonly 'mediaType'?: string; readonly 'files'?: io.gimbalabs.hilltop.api.v0.models.NftMetadataFile; } interface NftMetadataImgArray { readonly 'name'?: string; readonly 'image'?: string[]; readonly 'mediaType'?: string; readonly 'files'?: io.gimbalabs.hilltop.api.v0.models.NftMetadataFile[]; } interface NftMetadataNoFiles { readonly 'name'?: string; readonly 'image'?: string; readonly 'mediaType'?: string; } interface PoolRetiring { readonly 'ticker_name'?: string; readonly 'pool_id': string; readonly 'certificate_index': number; readonly 'epoch_number': number; readonly 'block_number': number; readonly 'retiring_at_epoch': number; readonly 'tx_hash': string; } interface PoolUpdate { readonly 'epoch_number': number; readonly 'block_number': number; readonly 'tx_hash': string; readonly 'pool_ticker_name'?: string; readonly 'pool_bech32_id': string; readonly 'certificate_index': number; readonly 'vrf_key_hash': string; readonly 'pledge': number; readonly 'reward_address': string; readonly 'active_epoch_number': number; readonly 'margin': number; readonly 'fixed_cost': number; } interface Reward { readonly 'staking_address': string; readonly 'epoch': number; readonly 'amount': number; readonly 'pool_id': string; } interface Sigma { readonly 'sigma': number; readonly 'epoch': number; readonly 'total_staked': number; readonly 'active_stake': number; readonly 'nonce': string; readonly 'd': number; } interface Stakepool { readonly 'id': string; readonly 'pool_id_bech32': string; readonly 'metadata'?: io.gimbalabs.hilltop.api.v0.models.StakepoolMetadata; readonly 'cost': number; readonly 'margin': number; readonly 'pledge': number; readonly 'active_stake': number; readonly 'saturation': number; readonly 'retiring_at_epoch'?: number; } interface StakepoolDelegation { readonly 'stakepool': io.gimbalabs.hilltop.api.v0.models.Stakepool; readonly 'epoch': number; } interface StakepoolMetadata { readonly 'name': string; readonly 'ticker': string; readonly 'homepage': string; readonly 'description': string; readonly 'extended'?: string; } interface Transaction { readonly 'hash': string; readonly 'block': number; readonly 'timestamp': string; } interface TransactionHistoryRequest { readonly 'addresses': string[]; } interface WalletBalance { readonly 'balance': number; } } export type ActiveStakeAmount = io.gimbalabs.hilltop.api.v0.models.ActiveStakeAmount; export type AddressStakeAmount = io.gimbalabs.hilltop.api.v0.models.AddressStakeAmount; export type Block = io.gimbalabs.hilltop.api.v0.models.Block; export type CnftMetadataV001 = io.gimbalabs.hilltop.api.v0.models.CnftMetadataV001; export type CnftMetadataV001Asset = io.gimbalabs.hilltop.api.v0.models.CnftMetadataV001Asset; export type Country = io.gimbalabs.hilltop.api.v0.enums.Country; export type DayBlock = io.gimbalabs.hilltop.api.v0.models.DayBlock; export type Delegation = io.gimbalabs.hilltop.api.v0.models.Delegation; export type DelegatorsCount = io.gimbalabs.hilltop.api.v0.models.DelegatorsCount; export type Epoch = io.gimbalabs.hilltop.api.v0.models.Epoch; export type GenericError = io.gimbalabs.hilltop.api.v0.models.GenericError; export type Healthcheck = io.gimbalabs.hilltop.api.v0.models.Healthcheck; export type NativeAsset = io.gimbalabs.hilltop.api.v0.models.NativeAsset; export type NativeAssetDetails = io.gimbalabs.hilltop.api.v0.models.NativeAssetDetails; export type NativeAssetDetailsRequest = io.gimbalabs.hilltop.api.v0.models.NativeAssetDetailsRequest; export type NativeAssetId = io.gimbalabs.hilltop.api.v0.models.NativeAssetId; export type NftDetails = io.gimbalabs.hilltop.api.v0.models.NftDetails; export type NftMetadata = io.gimbalabs.hilltop.api.v0.models.NftMetadata; export type NftMetadataFile = io.gimbalabs.hilltop.api.v0.models.NftMetadataFile; export type NftMetadataFilesAsObject = io.gimbalabs.hilltop.api.v0.models.NftMetadataFilesAsObject; export type NftMetadataImgArray = io.gimbalabs.hilltop.api.v0.models.NftMetadataImgArray; export type NftMetadataNoFiles = io.gimbalabs.hilltop.api.v0.models.NftMetadataNoFiles; export type PoolRetiring = io.gimbalabs.hilltop.api.v0.models.PoolRetiring; export type PoolUpdate = io.gimbalabs.hilltop.api.v0.models.PoolUpdate; export type Reward = io.gimbalabs.hilltop.api.v0.models.Reward; export type Sigma = io.gimbalabs.hilltop.api.v0.models.Sigma; export type Stakepool = io.gimbalabs.hilltop.api.v0.models.Stakepool; export type StakepoolDelegation = io.gimbalabs.hilltop.api.v0.models.StakepoolDelegation; export type StakepoolMetadata = io.gimbalabs.hilltop.api.v0.models.StakepoolMetadata; export type Transaction = io.gimbalabs.hilltop.api.v0.models.Transaction; export type TransactionHistoryRequest = io.gimbalabs.hilltop.api.v0.models.TransactionHistoryRequest; export type WalletBalance = io.gimbalabs.hilltop.api.v0.models.WalletBalance; export interface $FetchOptions { body?: string; headers?: $HttpHeaders; method?: $HttpMethod; } export type $FetchFunction = (url: string, options?: $FetchOptions) => Promise; export interface $HttpHeaders { [key: string]: string; } export type $HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE'; export interface $HttpQuery { [key: string]: string | number | boolean | string[] | number[] | boolean[] | undefined | null; } export interface $HttpRequest { body?: any; url: string; headers: $HttpHeaders; method: $HttpMethod; } export interface $HttpRequestOptions { body?: any; endpoint: string; headers?: $HttpHeaders; method: $HttpMethod; query?: $HttpQuery; } export interface $HttpResponse { body: B; headers: $HttpHeaders; ok: O; request: $HttpRequest; status: S; statusText: string; } export type $HttpContinue = $HttpResponse; export type $HttpSwitchingProtocol = $HttpResponse; export type $HttpProcessing = $HttpResponse; export type $HttpOk = $HttpResponse; export type $HttpCreated = $HttpResponse; export type $HttpAccepted = $HttpResponse; export type $HttpNonAuthoritativeInformation = $HttpResponse; export type $HttpNoContent = $HttpResponse; export type $HttpResetContent = $HttpResponse; export type $HttpPartialContent = $HttpResponse; export type $HttpMultiStatus = $HttpResponse; export type $HttpAlreadyReported = $HttpResponse; export type $HttpImUsed = $HttpResponse; export type $HttpMultipleChoices = $HttpResponse; export type $HttpMovedPermanently = $HttpResponse; export type $HttpFound = $HttpResponse; export type $HttpSeeOther = $HttpResponse; export type $HttpNotModified = $HttpResponse; export type $HttpUseProxy = $HttpResponse; export type $HttpTemporaryRedirect = $HttpResponse; export type $HttpPermanentRedirect = $HttpResponse; export type $HttpBadRequest = $HttpResponse; export type $HttpUnauthorized = $HttpResponse; export type $HttpPaymentRequired = $HttpResponse; export type $HttpForbidden = $HttpResponse; export type $HttpNotFound = $HttpResponse; export type $HttpMethodNotAllowed = $HttpResponse; export type $HttpNotAcceptable = $HttpResponse; export type $HttpProxyAuthenticationRequired = $HttpResponse; export type $HttpRequestTimeout = $HttpResponse; export type $HttpConflict = $HttpResponse; export type $HttpGone = $HttpResponse; export type $HttpLengthRequired = $HttpResponse; export type $HttpPreconditionFailed = $HttpResponse; export type $HttpRequestEntityTooLarge = $HttpResponse; export type $HttpRequestUriTooLong = $HttpResponse; export type $HttpUnsupportedMediaType = $HttpResponse; export type $HttpRequestedRangeNotSatisfiable = $HttpResponse; export type $HttpExpectationFailed = $HttpResponse; export type $HttpMisdirectedRequest = $HttpResponse; export type $HttpUnprocessableEntity = $HttpResponse; export type $HttpLocked = $HttpResponse; export type $HttpFailedDependency = $HttpResponse; export type $HttpUpgradeRequired = $HttpResponse; export type $HttpPreconditionRequired = $HttpResponse; export type $HttpTooManyRequests = $HttpResponse; export type $HttpRequestHeaderFieldsTooLarge = $HttpResponse; export type $HttpNoResponse = $HttpResponse; export type $HttpRetryWith = $HttpResponse; export type $HttpBlockedByWindowsParentalControls = $HttpResponse; export type $HttpUnavailableForLegalReasons = $HttpResponse; export type $HttpClientClosedRequest = $HttpResponse; export type $HttpInternalServerError = $HttpResponse; export type $HttpNotImplemented = $HttpResponse; export type $HttpBadGateway = $HttpResponse; export type $HttpServiceUnavailable = $HttpResponse; export type $HttpGatewayTimeout = $HttpResponse; export type $HttpHttpVersionNotSupported = $HttpResponse; export type $HttpInsufficientStorage = $HttpResponse; export type $HttpLoopDetected = $HttpResponse; export type $HttpBandwidthLimitExceeded = $HttpResponse; export type $HttpNotExtended = $HttpResponse; export type $HttpNetworkAuthenticationRequired = $HttpResponse; export type $HttpNetworkReadTimeoutError = $HttpResponse; export type $HttpNetworkConnectTimeoutError = $HttpResponse; export interface $HttpClientOptions { fetch: $FetchFunction; } export function isResponseEmpty(response: Response): boolean { const contentLength = response.headers.get('Content-Length'); return response.status === 204 || contentLength != null && Number.parseInt(contentLength, 10) === 0; } export function isResponseJson(response: Response): boolean { const contentType = response.headers.get('Content-Type'); return contentType != null && contentType.indexOf('json') >= 0; } export function parseJson(response: Response): Promise { return !isResponseEmpty(response) && isResponseJson(response) ? response.json() : Promise.resolve(); } export function parseHeaders(response: Response): Record { const headers: Record = {}; response.headers.forEach((value, key) => { headers[key.toLowerCase()] = value; }); return headers; } export function stripQuery(query: $HttpQuery = {}): $HttpQuery { const initialValue: $HttpQuery = {}; return Object.keys(query).reduce((previousValue, key) => { const value = query[key]; if (value != null) previousValue[key] = value; return previousValue; }, initialValue); } export class $HttpClient { private options: $HttpClientOptions; constructor(options: $HttpClientOptions) { this.options = options; } public request(options: $HttpRequestOptions): Promise<$HttpResponse> { const finalUrl: string = url.format({ hostname: 'hilltop-api.mainnet.dandelion.link', pathname: options.endpoint, protocol: 'https:', query: stripQuery(options.query), }); const finalHeaders: $HttpHeaders = { accept: 'application/json', 'content-type': 'application/json', ...options.headers, }; const request: $HttpRequest = { body: options.body, headers: finalHeaders, method: options.method, url: finalUrl, }; return this.options.fetch(request.url, { body: JSON.stringify(request.body), headers: request.headers, method: request.method, }).then((response) => { return parseJson(response).then((json) => { return { body: json, headers: parseHeaders(response), ok: response.ok, request, status: response.status, statusText: response.statusText, }; }); }); } } export class $Resource { protected client: $HttpClient; constructor(options: $HttpClientOptions) { this.client = new $HttpClient(options); } } export interface ActiveStakeAmountsGetParameters { headers?: $HttpHeaders; epoch_number?: number; } export interface ActiveStakeAmountsGetByPoolBech32IdParameters { headers?: $HttpHeaders; pool_bech32_id: string; epoch_number?: number; } export interface ActiveStakeAmountsGetAddressesByPoolBech32IdParameters { headers?: $HttpHeaders; pool_bech32_id: string; epoch_number: number; } export interface BlocksGetBlocksInDayParameters { headers?: $HttpHeaders; date: string; } export interface BlocksGetByBlockNumberParameters { headers?: $HttpHeaders; /*the block number*/ block_number: number; } export interface DelegationsGetSafePaymentByStakingAddressParameters { headers?: $HttpHeaders; staking_address: string; } export interface DelegationsGetStakepoolByStakingAddressParameters { headers?: $HttpHeaders; staking_address: string; } export interface DelegatorsCountsGetByPoolBech32IdParameters { headers?: $HttpHeaders; pool_bech32_id: string; } export interface EpochsGetCurrentParameters { headers?: $HttpHeaders; } export interface EpochsGetByEpochNumberParameters { headers?: $HttpHeaders; epoch_number: number; } export interface HealthchecksGetParameters { headers?: $HttpHeaders; } export interface NativeAssetsGetIdsParameters { headers?: $HttpHeaders; /*the block number from when fetching updates, it's the pagination index*/ block_number_from?: number; /*the number of updates to fetch*/ limit?: number; } export interface NativeAssetsGetAssetNamesByPolicyIdParameters { headers?: $HttpHeaders; /*the policy id to get the asset name*/ policy_id: string; } export interface NativeAssetsGetNftsParameters { headers?: $HttpHeaders; block_number_from: number; block_number_to: number; } export interface NativeAssetsPostNativeAssetsDetailsParameters { body: io.gimbalabs.hilltop.api.v0.models.NativeAssetDetailsRequest; headers?: $HttpHeaders; } export interface NativeAssetsGetByStakeAddressParameters { headers?: $HttpHeaders; stake_address: string; } export interface PoolUpdatesGetRetiringParameters { headers?: $HttpHeaders; /*the block number from when fetching updates, it's the pagination index*/ block_number_from?: number; /*the number of updates to fetch*/ limit?: number; } export interface PoolUpdatesGetByPoolIdParameters { headers?: $HttpHeaders; pool_id: string; /*the block number from when fetching updates, it's the pagination index*/ block_number_from?: number; /*the number of updates to fetch*/ limit?: number; } export interface PoolUpdatesGetParameters { headers?: $HttpHeaders; /*the block number from when fetching updates, it's the pagination index*/ block_number_from?: number; /*the number of updates to fetch*/ limit?: number; } export interface RewardsGetByStakingAddressParameters { headers?: $HttpHeaders; staking_address: string; epoch_from?: number; epoch_to?: number; } export interface SigmasGetByPoolIdParameters { headers?: $HttpHeaders; pool_id: string; epoch_number: number; } export interface StakepoolsGetVrfVkeyByVrfVkeyHashParameters { headers?: $HttpHeaders; /*the hash of the vrf_vkey*/ vrf_vkey_hash: string; } export interface StakepoolsGetEstablishedEpochByPoolIdParameters { headers?: $HttpHeaders; /*id of the pool to query. Both id and bech32 formats are supported*/ pool_id: string; } export interface StakepoolsGetLiveStakeByPoolIdParameters { headers?: $HttpHeaders; /*id of the pool to query. Both id and bech32 formats are supported*/ pool_id: string; } export interface StakepoolsGetBlocksByPoolIdParameters { headers?: $HttpHeaders; /*id of the pool to query. Both id and bech32 formats are supported*/ pool_id: string; /*epoch in which to query number of produced blocks or current epoch if not specified*/ epoch?: number; } export interface StakepoolsGetParameters { headers?: $HttpHeaders; } export interface StakepoolMetadataGetByPoolIdBech32Parameters { headers?: $HttpHeaders; pool_id_bech32: string; } export interface TransactionsPostHistoryParameters { body: io.gimbalabs.hilltop.api.v0.models.TransactionHistoryRequest; headers?: $HttpHeaders; } export interface WalletBalancesGetByStakingAddressParameters { headers?: $HttpHeaders; staking_address: string; } export type ActiveStakeAmountsGetResponse = $HttpOk; export type ActiveStakeAmountsGetByPoolBech32IdResponse = $HttpOk; export type ActiveStakeAmountsGetAddressesByPoolBech32IdResponse = $HttpOk; export type BlocksGetBlocksInDayResponse = $HttpOk | $HttpNotFound; export type BlocksGetByBlockNumberResponse = $HttpOk | $HttpNotFound; export type DelegationsGetSafePaymentByStakingAddressResponse = $HttpOk | $HttpNotFound; export type DelegationsGetStakepoolByStakingAddressResponse = $HttpOk | $HttpNotFound; export type DelegatorsCountsGetByPoolBech32IdResponse = $HttpOk; export type EpochsGetCurrentResponse = $HttpOk; export type EpochsGetByEpochNumberResponse = $HttpOk; export type HealthchecksGetResponse = $HttpOk; export type NativeAssetsGetIdsResponse = $HttpOk; export type NativeAssetsGetAssetNamesByPolicyIdResponse = $HttpOk; export type NativeAssetsGetNftsResponse = $HttpOk | $HttpNotFound; export type NativeAssetsPostNativeAssetsDetailsResponse = $HttpOk; export type NativeAssetsGetByStakeAddressResponse = $HttpOk; export type PoolUpdatesGetRetiringResponse = $HttpOk | $HttpNotFound; export type PoolUpdatesGetByPoolIdResponse = $HttpOk | $HttpNotFound; export type PoolUpdatesGetResponse = $HttpOk | $HttpNotFound; export type RewardsGetByStakingAddressResponse = $HttpOk; export type SigmasGetByPoolIdResponse = $HttpOk; export type StakepoolsGetVrfVkeyByVrfVkeyHashResponse = $HttpOk | $HttpNotFound; export type StakepoolsGetEstablishedEpochByPoolIdResponse = $HttpOk | $HttpNotFound; export type StakepoolsGetLiveStakeByPoolIdResponse = $HttpOk | $HttpNotFound; export type StakepoolsGetBlocksByPoolIdResponse = $HttpOk | $HttpNotFound; export type StakepoolsGetResponse = $HttpOk; export type StakepoolMetadataGetByPoolIdBech32Response = $HttpOk | $HttpNotFound; export type TransactionsPostHistoryResponse = $HttpOk; export type WalletBalancesGetByStakingAddressResponse = $HttpOk; export class ActiveStakeAmountsResource extends $Resource { public get(params: ActiveStakeAmountsGetParameters = {}): Promise { return this.client.request({ endpoint: '/active_stake_amounts', headers: params.headers, method: 'GET', query: { epoch_number: params.epoch_number, }, }); } public getByPoolBech32Id(params: ActiveStakeAmountsGetByPoolBech32IdParameters): Promise { return this.client.request({ endpoint: `/active_stake_amounts/${encodeURIComponent(params.pool_bech32_id)}`, headers: params.headers, method: 'GET', query: { epoch_number: params.epoch_number, }, }); } public getAddressesByPoolBech32Id(params: ActiveStakeAmountsGetAddressesByPoolBech32IdParameters): Promise { return this.client.request({ endpoint: `/active_stake_amounts/${encodeURIComponent(params.pool_bech32_id)}/addresses`, headers: params.headers, method: 'GET', query: { epoch_number: params.epoch_number, }, }); } } export class BlocksResource extends $Resource { public getBlocksInDay(params: BlocksGetBlocksInDayParameters): Promise { return this.client.request({ endpoint: '/blocks/blocks_in_day', headers: params.headers, method: 'GET', query: { date: params.date, }, }); } public getByBlockNumber(params: BlocksGetByBlockNumberParameters): Promise { return this.client.request({ endpoint: `/blocks/${encodeURIComponent(params.block_number)}`, headers: params.headers, method: 'GET', }); } } export class DelegationsResource extends $Resource { public getSafePaymentByStakingAddress(params: DelegationsGetSafePaymentByStakingAddressParameters): Promise { return this.client.request({ endpoint: `/delegations/${encodeURIComponent(params.staking_address)}/safe_payment`, headers: params.headers, method: 'GET', }); } public getStakepoolByStakingAddress(params: DelegationsGetStakepoolByStakingAddressParameters): Promise { return this.client.request({ endpoint: `/delegations/${encodeURIComponent(params.staking_address)}/stakepool`, headers: params.headers, method: 'GET', }); } } export class DelegatorsCountsResource extends $Resource { public getByPoolBech32Id(params: DelegatorsCountsGetByPoolBech32IdParameters): Promise { return this.client.request({ endpoint: `/delegators_counts/${encodeURIComponent(params.pool_bech32_id)}`, headers: params.headers, method: 'GET', }); } } export class EpochsResource extends $Resource { public getCurrent(params: EpochsGetCurrentParameters = {}): Promise { return this.client.request({ endpoint: '/epochs/current', headers: params.headers, method: 'GET', }); } public getByEpochNumber(params: EpochsGetByEpochNumberParameters): Promise { return this.client.request({ endpoint: `/epochs/${encodeURIComponent(params.epoch_number)}`, headers: params.headers, method: 'GET', }); } } export class HealthchecksResource extends $Resource { public get(params: HealthchecksGetParameters = {}): Promise { return this.client.request({ endpoint: '/healthchecks', headers: params.headers, method: 'GET', }); } } export class NativeAssetsResource extends $Resource { public getIds(params: NativeAssetsGetIdsParameters = {}): Promise { return this.client.request({ endpoint: '/native_assets/ids', headers: params.headers, method: 'GET', query: { block_number_from: params.block_number_from, limit: params.limit, }, }); } public getAssetNamesByPolicyId(params: NativeAssetsGetAssetNamesByPolicyIdParameters): Promise { return this.client.request({ endpoint: `/native_assets/${encodeURIComponent(params.policy_id)}/asset_names`, headers: params.headers, method: 'GET', }); } public getNfts(params: NativeAssetsGetNftsParameters): Promise { return this.client.request({ endpoint: '/native_assets/nfts', headers: params.headers, method: 'GET', query: { block_number_from: params.block_number_from, block_number_to: params.block_number_to, }, }); } public postNativeAssetsDetails(params: NativeAssetsPostNativeAssetsDetailsParameters): Promise { return this.client.request({ body: params.body, endpoint: '/native_assets/native_assets_details', headers: params.headers, method: 'POST', }); } public getByStakeAddress(params: NativeAssetsGetByStakeAddressParameters): Promise { return this.client.request({ endpoint: `/native_assets/${encodeURIComponent(params.stake_address)}`, headers: params.headers, method: 'GET', }); } } export class PoolUpdatesResource extends $Resource { public getRetiring(params: PoolUpdatesGetRetiringParameters = {}): Promise { return this.client.request({ endpoint: '/pool_updates/retiring', headers: params.headers, method: 'GET', query: { block_number_from: params.block_number_from, limit: params.limit, }, }); } public getByPoolId(params: PoolUpdatesGetByPoolIdParameters): Promise { return this.client.request({ endpoint: `/pool_updates/${encodeURIComponent(params.pool_id)}`, headers: params.headers, method: 'GET', query: { block_number_from: params.block_number_from, limit: params.limit, }, }); } public get(params: PoolUpdatesGetParameters = {}): Promise { return this.client.request({ endpoint: '/pool_updates', headers: params.headers, method: 'GET', query: { block_number_from: params.block_number_from, limit: params.limit, }, }); } } export class RewardsResource extends $Resource { public getByStakingAddress(params: RewardsGetByStakingAddressParameters): Promise { return this.client.request({ endpoint: `/rewards/${encodeURIComponent(params.staking_address)}`, headers: params.headers, method: 'GET', query: { epoch_from: params.epoch_from, epoch_to: params.epoch_to, }, }); } } export class SigmasResource extends $Resource { /*can be either the pool_id (e.g. pool1wcwe923r...) or the pool_hash*/ public getByPoolId(params: SigmasGetByPoolIdParameters): Promise { return this.client.request({ endpoint: `/sigmas/${encodeURIComponent(params.pool_id)}`, headers: params.headers, method: 'GET', query: { epoch_number: params.epoch_number, }, }); } } export class StakepoolsResource extends $Resource { /*find pool details by vrf_vkey*/ public getVrfVkeyByVrfVkeyHash(params: StakepoolsGetVrfVkeyByVrfVkeyHashParameters): Promise { return this.client.request({ endpoint: `/stakepools/vrf_vkey/${encodeURIComponent(params.vrf_vkey_hash)}`, headers: params.headers, method: 'GET', }); } /*Epoch at which stake pool was originally registered*/ public getEstablishedEpochByPoolId(params: StakepoolsGetEstablishedEpochByPoolIdParameters): Promise { return this.client.request({ endpoint: `/stakepools/${encodeURIComponent(params.pool_id)}/established_epoch`, headers: params.headers, method: 'GET', }); } /*live stake in lovelaces*/ public getLiveStakeByPoolId(params: StakepoolsGetLiveStakeByPoolIdParameters): Promise { return this.client.request({ endpoint: `/stakepools/${encodeURIComponent(params.pool_id)}/live_stake`, headers: params.headers, method: 'GET', }); } /*number minted blocks in epoch*/ public getBlocksByPoolId(params: StakepoolsGetBlocksByPoolIdParameters): Promise { return this.client.request({ endpoint: `/stakepools/${encodeURIComponent(params.pool_id)}/blocks`, headers: params.headers, method: 'GET', query: { epoch: params.epoch, }, }); } public get(params: StakepoolsGetParameters = {}): Promise { return this.client.request({ endpoint: '/stakepools', headers: params.headers, method: 'GET', }); } } export class StakepoolMetadataResource extends $Resource { public getByPoolIdBech32(params: StakepoolMetadataGetByPoolIdBech32Parameters): Promise { return this.client.request({ endpoint: `/stakepool_metadata/${encodeURIComponent(params.pool_id_bech32)}`, headers: params.headers, method: 'GET', }); } } export class TransactionsResource extends $Resource { public postHistory(params: TransactionsPostHistoryParameters): Promise { return this.client.request({ body: params.body, endpoint: '/transactions/history', headers: params.headers, method: 'POST', }); } } export class WalletBalancesResource extends $Resource { public getByStakingAddress(params: WalletBalancesGetByStakingAddressParameters): Promise { return this.client.request({ endpoint: `/wallet_balances/${encodeURIComponent(params.staking_address)}`, headers: params.headers, method: 'GET', }); } } export interface ClientInstance { activeStakeAmounts: ActiveStakeAmountsResource; blocks: BlocksResource; delegations: DelegationsResource; delegatorsCounts: DelegatorsCountsResource; epochs: EpochsResource; healthchecks: HealthchecksResource; nativeAssets: NativeAssetsResource; poolUpdates: PoolUpdatesResource; rewards: RewardsResource; sigmas: SigmasResource; stakepools: StakepoolsResource; stakepoolMetadata: StakepoolMetadataResource; transactions: TransactionsResource; walletBalances: WalletBalancesResource; } export function createClient(options: $HttpClientOptions): ClientInstance { return { activeStakeAmounts: new ActiveStakeAmountsResource(options), blocks: new BlocksResource(options), delegations: new DelegationsResource(options), delegatorsCounts: new DelegatorsCountsResource(options), epochs: new EpochsResource(options), healthchecks: new HealthchecksResource(options), nativeAssets: new NativeAssetsResource(options), poolUpdates: new PoolUpdatesResource(options), rewards: new RewardsResource(options), sigmas: new SigmasResource(options), stakepools: new StakepoolsResource(options), stakepoolMetadata: new StakepoolMetadataResource(options), transactions: new TransactionsResource(options), walletBalances: new WalletBalancesResource(options), }; }