UNPKG

@hippocampus-web3/blockfrost-js

Version:

A JavaScript/TypeScript SDK for interacting with the https://blockfrost.io API

183 lines (182 loc) 9.06 kB
import { components } from '@blockfrost/openapi'; import { BlockFrostAPI } from '../../../index'; import { AllMethodOptions, PaginationOptions } from '../../../types'; export declare class GovernanceAPI { blockfrostAPI: BlockFrostAPI; constructor(blockfrostAPI: BlockFrostAPI); /** * Obtains list of Delegate Representatives (DReps). * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps | API docs for Delegate Representatives (DReps)} * * @param pagination - Optional, Pagination options * @returns List of registered stake pools. * */ dreps(pagination?: PaginationOptions): Promise<components['schemas']['dreps']>; /** * Obtains information of a specific DRep. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D | API docs for Stake Pool} * * @param drepId - DRep ID * @returns Information of a specific DRep * */ drepsById(drepId: string): Promise<components['schemas']['drep']>; /** * Obtains DRep metadata. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/metadata | API docs for DRep Metadata} * * @param drepId - DRep ID * @returns DRep Metadata * */ drepsByIdMetadata(drepId: string, pagination?: PaginationOptions): Promise<components['schemas']['drep_metadata']>; /** * Obtains current DRep delegators. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/delegators | API docs for DRep Delegators} * * @param drepId - DRep ID * @returns Current DRep delegators * */ drepsByIdDelegators(drepId: string, pagination?: PaginationOptions): Promise<components['schemas']['drep_delegators']>; /** * Obtains current DRep delegators. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/delegators | API docs for DRep Delegators} * @remarks * Variant of `drepsByIdDelegators` method for fetching all pages with built-in requests batching * * @param drepId - DRep ID * @param allMethodOptions - Optional, Options for request batching * @returns Current DRep delegators * */ drepsByIdDelegatorsAll(drepId: string, allMethodOptions?: AllMethodOptions): Promise<components['schemas']['drep_delegators']>; /** * Obtains List of certificate updates to the DRep. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/updates | API docs for DRep Updates} * * @param drepId - DRep ID * @returns List of certificate updates to the DRep * */ drepsByIdUpdates(drepId: string, pagination?: PaginationOptions): Promise<components['schemas']['drep_updates']>; /** * Obtains List of certificate updates to the DRep. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/updates | API docs for History of DRep updates} * @remarks * Variant of `drepsByIdUpdates` method for fetching all pages with built-in requests batching * * @param drepId - DRep ID * @param allMethodOptions - Optional, Options for request batching * @returns List of certificate updates to the DRep * */ drepsByIdUpdatesAll(drepId: string, allMethodOptions?: AllMethodOptions): Promise<components['schemas']['drep_updates']>; /** * Obtains History of DRep votes. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/votes | API docs for History of DRep votes} * * @param drepId - DRep ID * @returns History of DRep votes * */ drepsByIdVotes(drepId: string, pagination?: PaginationOptions): Promise<components['schemas']['drep_votes']>; /** * Obtains History of DRep votes. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/dreps/%7Bdrep_id%7D/votes | API docs for History of DRep votes} * @remarks * Variant of `drepsByIdVotes` method for fetching all pages with built-in requests batching * * @param drepId - DRep ID * @param allMethodOptions - Optional, Options for request batching * @returns History of DRep votes * */ drepsByIdVotesAll(drepId: string, allMethodOptions?: AllMethodOptions): Promise<components['schemas']['drep_votes']>; /** * Obtains list of proposals. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals | API docs for Proposals} * * @param pagination - Optional, Pagination options * @returns List of proposals * */ proposals(pagination?: PaginationOptions): Promise<components['schemas']['proposals']>; /** * Obtains a specific Proposal * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D | API docs for Specific Proposal} * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @returns Proposal information * */ proposal(txHash: string, certIndex: number): Promise<components['schemas']['proposal']>; /** * Obtains a parameters of specific proposal * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D/parameters | API docs for Specific Proposal parameters} * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @returns Parameters proposal details. * */ proposalParameters(txHash: string, certIndex: number): Promise<components['schemas']['proposal_parameters']>; /** * Obtains Specific withdrawals proposal * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D/withdrawals | API docs for Specific withdrawals proposal} * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @returns Parameters withdrawals details. * */ proposalWithdrawals(txHash: string, certIndex: number, pagination?: PaginationOptions): Promise<components['schemas']['proposal_withdrawals']>; /** * Obtains Specific withdrawals proposal * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D/withdrawals | API docs for Specific withdrawals proposal} * @remarks * Variant of `proposalWithdrawals` method for fetching all pages with built-in requests batching * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @param allMethodOptions - Optional, Options for request batching * @returns Parameters withdrawals details. * */ proposalWithdrawalsAll(txHash: string, certIndex: number, allMethodOptions?: AllMethodOptions): Promise<components['schemas']['proposal_withdrawals']>; /** * Obtains History of Proposal votes. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D/votes | API docs for Proposal votes} * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @returns History of Proposal votes. * */ proposalVotes(txHash: string, certIndex: number, pagination?: PaginationOptions): Promise<components['schemas']['proposal_votes']>; /** * Obtains History of Proposal votes. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D/votes | API docs for Proposal votes} * @remarks * Variant of `proposalVotes` method for fetching all pages with built-in requests batching * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @param allMethodOptions - Optional, Options for request batching * @returns History of DRep votes * */ proposalVotesAll(txHash: string, certIndex: number, allMethodOptions?: AllMethodOptions): Promise<components['schemas']['proposal_votes']>; /** * Obtains Proposal metadata information. * @see {@link https://docs.blockfrost.io/#tag/cardano--governance/GET/governance/proposals/%tx_hash%7D/%cert_index%7D/metadata | API docs for Proposal metadata} * * @param txHash - Transaction Hash * @param cert_index - Index of the certificate within the proposal transaction. * @returns Proposal metadata information * */ proposalMetadata(txHash: string, certIndex: number): Promise<components['schemas']['proposal_metadata']>; }