//
//  NoPassRNBridgeAccountServiceiOS.m
//  SdkTest
//
//  Created by Artsiom Shmaenkov on 1.07.21.
//

#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_MODULE(NoPassRNBridgeAccountServiceiOS, NSObject)

RCT_EXTERN_METHOD(subscribeOnAccountsUpdates)

RCT_EXTERN_METHOD(fetchAccounts:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(fetchAccount:(NSString*) userCode
                  resolver:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(fetchHistory:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(removeAccount:(NSString*) userCode
                  biometricType:(NSString*) biometricType
                  isScreenLock:(BOOL) isScreenLock
                  resolver:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(clearBackupData)

RCT_EXTERN_METHOD(createEmptyBackupData:(NSString*)pin
                  resolver:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(canDecodeBackupFile:(NSString*)encodedString
                  pin:(NSString*)pin
                  resolver:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(backupAccounts:(NSString*)pin
                  encryptedBackupData:(NSString*)encryptedBackupData
                  biometricType:(NSString*) biometricType
                  isScreenLock:(BOOL) isScreenLock
                  resolver:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

RCT_EXTERN_METHOD(startRestoreDataFromBackup:(NSString*)backupData
                  pin:(NSString*)pin
                  biometricType:(NSString*) biometricType
                  isScreenLock:(BOOL) isScreenLock
                  resolver:(RCTPromiseResolveBlock) resolver
                  rejecter:(RCTPromiseRejectBlock) rejecter)

@end
