diff --git a/src/ncw-api-client.ts b/src/ncw-api-client.ts index 592ab556..8e4dbc4b 100644 --- a/src/ncw-api-client.ts +++ b/src/ncw-api-client.ts @@ -147,4 +147,15 @@ export class NcwApiClient implements NcwSdk { `${this.NCW_BASE_PATH}/${walletId}/accounts/${accountId}/assets/${assetId}/balance`, {}); } + + public async getWalletSetupStatus(walletId: string): Promise { + return await this.apiClient.issueGetRequest( + `${this.NCW_BASE_PATH}/${walletId}/setup_status`); + } + + public async getDeviceSetupStatus(walletId: string, deviceId: string): Promise { + return await this.apiClient.issueGetRequest( + `${this.NCW_BASE_PATH}/${walletId}/devices/${deviceId}/setup_status`); + + } } diff --git a/src/ncw-sdk.ts b/src/ncw-sdk.ts index b50f086c..533627e8 100644 --- a/src/ncw-sdk.ts +++ b/src/ncw-sdk.ts @@ -165,4 +165,21 @@ export interface NcwSdk { * @return {*} {Promise} */ refreshWalletAssetBalance(walletId: string, accountId: number, assetId: string): Promise; + + /** + * get NCW wallet setup status + * + * @param {string} walletId + * @return {*} {Promise} + */ + getWalletSetupStatus(walletId: string): Promise; + + /** + * get NCW device setup status + * + * @param {string} walletId + * @param {string} deviceId + * @return {*} {Promise} + */ + getDeviceSetupStatus(walletId: string, deviceId: string): Promise; } diff --git a/src/types.ts b/src/types.ts index 13d1355b..2842b271 100644 --- a/src/types.ts +++ b/src/types.ts @@ -2164,6 +2164,30 @@ export namespace NCW { deviceId: string; enabled: boolean; } + + export enum SetupStatus { + COMPLETE = "COMPLETE", + INCOMPLETE = "INCOMPLETE", + } + + export class KeySetup { + status: SetupStatus; + algorithmName: string; + confirmed: boolean; + backedUp: boolean; + } + + export class DeviceKeySetupResponse { + status: SetupStatus; + deviceId: string; + setupStatus: Array; + } + + export class WalletSetupStatusResponse { + status: SetupStatus; + deviceSetupStatus: Array; + } + } export namespace TAP {