Skip to content

Commit

Permalink
chore: wrap gov endpoints under BlockfrostAPI.governance
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Oct 31, 2024
1 parent 5dfcb35 commit 14b50ac
Show file tree
Hide file tree
Showing 6 changed files with 465 additions and 524 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- methods for querying [governance](https://docs.blockfrost.io/#tag/cardano--governance) DReps endpoints - `dreps`, `drepsById`, `drepsByIdDelegators`, `drepsByIdDelegatorsAll`, `drepsByIdMetadata`, `drepsByIdUpdates`, `drepsByIdUpdatesAll`, `drepsByIdVotes`, `drepsByIdVotesAll`
- methods for querying [governance](https://docs.blockfrost.io/#tag/cardano--governance) proposals endpoints - `proposals`, `proposal`, `proposalMetadata`, `proposalParameters`, `proposalVotes`, `proposalVotesAll`, `proposalWithdrawals`, `proposalWithdrawalsAll`,
- Methods for querying [governance DReps endpoints](https://docs.blockfrost.io/#tag/cardano--governance.) - `governance.dreps`, `governance.drepsById`, `governance.drepsByIdDelegators`, `governance.drepsByIdMetadata`, `governance.drepsByIdUpdates`, `governance.drepsByIdVotes`
- Methods for querying [governance proposals endpoints](https://docs.blockfrost.io/#tag/cardano--governance.) - `governance.proposals`, `governance.proposal`, `governance.proposalMetadata`, `governance.proposalParameters`, `governance.proposalVotes`, `governance.proposalWithdrawals`

## [5.6.0] - 2024-10-03

Expand Down
45 changes: 4 additions & 41 deletions src/BlockFrostAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,7 @@ import {
blocksAddressesAll,
} from './endpoints/api/blocks';

import {
dreps,
drepsById,
drepsByIdDelegators,
drepsByIdDelegatorsAll,
drepsByIdMetadata,
drepsByIdUpdates,
drepsByIdUpdatesAll,
drepsByIdVotes,
drepsByIdVotesAll,
} from './endpoints/api/governance/dreps';

import {
proposals,
proposal,
proposalMetadata,
proposalParameters,
proposalVotes,
proposalVotesAll,
proposalWithdrawals,
proposalWithdrawalsAll,
} from './endpoints/api/governance/proposals';
import { GovernanceAPI } from './endpoints/api/governance';

import {
epochs,
Expand Down Expand Up @@ -195,6 +174,7 @@ class BlockFrostAPI {
instance: Got;
/** @ignore */
rateLimiter: Bottleneck | undefined;
governance: GovernanceAPI;

constructor(options?: Options) {
this.options = validateOptions(options);
Expand Down Expand Up @@ -229,6 +209,8 @@ class BlockFrostAPI {
this.userAgent,
this.rateLimiter,
);

this.governance = new GovernanceAPI(this);
}

accounts = accounts;
Expand Down Expand Up @@ -280,16 +262,6 @@ class BlockFrostAPI {
blocksAddresses = blocksAddresses;
blocksAddressesAll = blocksAddressesAll;

dreps = dreps;
drepsById = drepsById;
drepsByIdDelegators = drepsByIdDelegators;
drepsByIdDelegatorsAll = drepsByIdDelegatorsAll;
drepsByIdMetadata = drepsByIdMetadata;
drepsByIdUpdates = drepsByIdUpdates;
drepsByIdUpdatesAll = drepsByIdUpdatesAll;
drepsByIdVotes = drepsByIdVotes;
drepsByIdVotesAll = drepsByIdVotesAll;

epochs = epochs;
epochsBlocks = epochsBlocks;
epochsBlocksAll = epochsBlocksAll;
Expand Down Expand Up @@ -343,15 +315,6 @@ class BlockFrostAPI {
poolsExtended = poolsExtended;
poolsExtendedAll = poolsExtendedAll;

proposals = proposals;
proposal = proposal;
proposalMetadata = proposalMetadata;
proposalParameters = proposalParameters;
proposalVotes = proposalVotes;
proposalVotesAll = proposalVotesAll;
proposalWithdrawals = proposalWithdrawals;
proposalWithdrawalsAll = proposalWithdrawalsAll;

root = root;

scripts = scripts;
Expand Down
252 changes: 0 additions & 252 deletions src/endpoints/api/governance/dreps/index.ts

This file was deleted.

Loading

0 comments on commit 14b50ac

Please sign in to comment.