From d5ae9f8a933f4ca5fb7d324ad893c82105a16f35 Mon Sep 17 00:00:00 2001 From: yuval-fireblocks <109523195+yuval-fireblocks@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:56:46 +0200 Subject: [PATCH] NCW: add getWalletDevice method to retrieve specific wallet device details (#315) * add getWalletDevice method to retrieve specific wallet device details * deviceId param to doc * doc --- src/ncw-api-client.ts | 5 +++++ src/ncw-sdk.ts | 11 ++++++++++- src/types.ts | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ncw-api-client.ts b/src/ncw-api-client.ts index e75d98f..2d70fbc 100644 --- a/src/ncw-api-client.ts +++ b/src/ncw-api-client.ts @@ -51,6 +51,11 @@ export class NcwApiClient implements NcwSdk { { enabled }); } + public async getWalletDevice(walletId: string, deviceId: string): Promise { + return await this.apiClient.issueGetRequest( + `${this.NCW_BASE_PATH}/${walletId}/devices/${deviceId}`); + } + public async getWalletDevices(walletId: string): Promise { return await this.apiClient.issueGetRequest( `${this.NCW_BASE_PATH}/${walletId}/devices/`); diff --git a/src/ncw-sdk.ts b/src/ncw-sdk.ts index 6d9d7b7..21a1153 100644 --- a/src/ncw-sdk.ts +++ b/src/ncw-sdk.ts @@ -43,7 +43,16 @@ export interface NcwSdk { /** - * Get NCW wallet devices + * Get NCW wallet's device + * + * @param {string} walletId + * @param {string} deviceId + * @return {*} {Promise} + */ + getWalletDevice(walletId: string, deviceId: string): Promise; + + /** + * Get NCW wallet's devices * * @param {string} walletId * @return {*} {Promise} diff --git a/src/types.ts b/src/types.ts index 772c376..1551e85 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2362,6 +2362,7 @@ export namespace NCW { export interface Device { deviceId: string; enabled: boolean; + physicalDeviceId: string; } export enum SetupStatus {