Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/firefly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ import {
FireFlyVerifierResolveRequest,
FireFlyVerifierResolveResponse,
FireFlyTokenApprovalRequest,
FireFlyNamespaceResponse,
FireFlyNamespacesResponse,
} from './interfaces';
import { FireFlyWebSocket, FireFlyWebSocketCallback } from './websocket';
import HttpBase, { mapConfig } from './http';
Expand Down Expand Up @@ -130,6 +132,17 @@ export default class FireFly extends HttpBase {
);
}

getNamespace(
name: string,
options?: FireFlyGetOptions,
): Promise<FireFlyNamespaceResponse | undefined> {
return this.getOne<FireFlyNamespaceResponse>(`/namespaces/${name}`, undefined, options, true);
}

getNamespaces(options?: FireFlyGetOptions): Promise<FireFlyNamespacesResponse[]> {
return this.getMany<FireFlyNamespacesResponse[]>('/namespaces', undefined, options, true);
}

getDatatypes(
filter?: FireFlyDatatypeFilter,
options?: FireFlyGetOptions,
Expand Down
8 changes: 8 additions & 0 deletions lib/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export interface FireFlyWebSocketOptions {
heartbeatInterval: number;
}

// Namespace
export type FireFlyNamespaceResponse = Required<
operations['getNamespace']['responses']['200']['content']['application/json']
>;

export type FireFlyNamespacesResponse = Required<
operations['getNamespaces']['responses']['200']['content']['application/json']
>;
// Network

export type FireFlyIdentityFilter = operations['getIdentities']['parameters']['query'];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/firefly-sdk",
"version": "1.2.1",
"version": "1.2.2",
"description": "Client SDK for Hyperledger FireFly",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down