-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new ledger-state query: governanceProposals.
- Loading branch information
Showing
28 changed files
with
415 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
clients/TypeScript/packages/client/src/LedgerStateQuery/query/governanceProposals.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { InteractionContext, Method } from '../../Connection' | ||
import { | ||
Ogmios, | ||
GovernanceProposalReference, | ||
GovernanceProposalState | ||
} from '@cardano-ogmios/schema' | ||
|
||
type Request = Ogmios['QueryLedgerStateGovernanceProposals'] | ||
type Response = Ogmios['QueryLedgerStateGovernanceProposalsResponse'] | ||
|
||
/** | ||
* Get currently active {@link GovernanceProposalState}, possibly filtered by {@link GovernanceProposalReference}. | ||
* | ||
* @category LedgerStateQuery | ||
*/ | ||
export function governanceProposals ( | ||
context: InteractionContext, | ||
proposals?: GovernanceProposalReference[] | ||
): Promise<GovernanceProposalState[]> { | ||
return Method<Request, Response, GovernanceProposalState[]>( | ||
{ | ||
method: 'queryLedgerState/governanceProposals', | ||
...Array.isArray(proposals) ? { params: { proposals } } : {} | ||
}, | ||
{}, | ||
context | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.