Skip to content

Commit

Permalink
add getWalletDevice method to retrieve specific wallet device details
Browse files Browse the repository at this point in the history
  • Loading branch information
yuval-fireblocks committed Dec 15, 2024
1 parent 684eaee commit 7c191ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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
8 changes: 8 additions & 0 deletions src/ncw-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export interface NcwSdk {
enableWallet(walletId: string, enabled: boolean): Promise<void>;


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

/**
* Get NCW wallet devices
*
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 7c191ff

Please sign in to comment.