diff --git a/lib/firefly.ts b/lib/firefly.ts index 130b009..1a2136e 100644 --- a/lib/firefly.ts +++ b/lib/firefly.ts @@ -70,6 +70,7 @@ import { FireFlyVerifierResolveRequest, FireFlyVerifierResolveResponse, FireFlyTokenApprovalRequest, + FireFlyNamespaceResponse, } from './interfaces'; import { FireFlyWebSocket, FireFlyWebSocketCallback } from './websocket'; import HttpBase, { mapConfig } from './http'; @@ -130,6 +131,17 @@ export default class FireFly extends HttpBase { ); } + getNamespace( + name: string, + options?: FireFlyGetOptions, + ): Promise { + return this.getOne(`/namespaces/${name}`, undefined, options, true); + } + + getNamespaces(options?: FireFlyGetOptions): Promise { + return this.getMany('/namespaces', undefined, options, true); + } + getDatatypes( filter?: FireFlyDatatypeFilter, options?: FireFlyGetOptions, diff --git a/lib/interfaces.ts b/lib/interfaces.ts index 207b6e8..ae68ceb 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -63,6 +63,11 @@ export interface FireFlyWebSocketOptions { heartbeatInterval: number; } +// Namespace +export type FireFlyNamespaceResponse = Required< + operations['getNamespace']['responses']['200']['content']['application/json'] +>; + // Network export type FireFlyIdentityFilter = operations['getIdentities']['parameters']['query']; diff --git a/package.json b/package.json index 8939ae6..27a8ecd 100644 --- a/package.json +++ b/package.json @@ -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",