Skip to content

Commit

Permalink
NCW: add getWalletDevice method to retrieve specific wallet device de…
Browse files Browse the repository at this point in the history
…tails (#315)

* add getWalletDevice method to retrieve specific wallet device details

* deviceId param to doc

* doc
  • Loading branch information
yuval-fireblocks authored Dec 18, 2024
1 parent eda99ef commit d5ae9f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ncw-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export class NcwApiClient implements NcwSdk {
{ enabled });
}

public async getWalletDevice(walletId: string, deviceId: string): Promise<NCW.Device> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/devices/${deviceId}`);
}

public async getWalletDevices(walletId: string): Promise<NCW.Device[]> {
return await this.apiClient.issueGetRequest(
`${this.NCW_BASE_PATH}/${walletId}/devices/`);
Expand Down
11 changes: 10 additions & 1 deletion src/ncw-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ export interface NcwSdk {


/**
* Get NCW wallet devices
* Get NCW wallet's device
*
* @param {string} walletId
* @param {string} deviceId
* @return {*} {Promise<NCW.Device>}
*/
getWalletDevice(walletId: string, deviceId: string): Promise<NCW.Device>;

/**
* Get NCW wallet's devices
*
* @param {string} walletId
* @return {*} {Promise<NCW.Device>}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,7 @@ export namespace NCW {
export interface Device {
deviceId: string;
enabled: boolean;
physicalDeviceId: string;
}

export enum SetupStatus {
Expand Down

0 comments on commit d5ae9f8

Please sign in to comment.