Skip to content

Commit

Permalink
feat(cactus-core-api): add ISendRequestResultV1<T> for Fujitsu verifier
Browse files Browse the repository at this point in the history
An interface representing the response object of the send sync and send async
request methods on the connection-chain verifier API.

Also great when trying to help bridge the gap between the API returning
results as `unknown` and the tests needing auto-completion for the properties
to assert for type of data at runtime.

@see {ISocketApiClient<BlockType>}
@see {Verifier<LedgerApiType extends ISocketApiClient<unknown>>}
@see {IVerifier}

[skip ci]

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Oct 12, 2023
1 parent da47e3c commit 483de38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* An interface representing the response object of the send sync and send async
* request methods on the connection-chain verifier API.
*
* Also great when trying to help bridge the gap between the API returning
* results as `unknown` and the tests needing auto-completion for the properties
* to assert for type of data at runtime.
*
* @see {ISocketApiClient<BlockType>}
* @see {Verifier<LedgerApiType extends ISocketApiClient<unknown>>}
* @see {IVerifier}
*/
export interface ISendRequestResultV1<T> {
readonly data: T;
readonly errorDetail?: string;
readonly status: number;
}
2 changes: 2 additions & 0 deletions packages/cactus-core-api/src/main/typescript/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ export {
LedgerEvent,
IVerifierEventListener,
} from "./client/i-verifier";

export { ISendRequestResultV1 } from "./plugin/ledger-connector/i-send-request-response-v1";

0 comments on commit 483de38

Please sign in to comment.