diff --git a/android/src/main/java/com/reactlibrary/IndySdkModule.java b/android/src/main/java/com/reactlibrary/IndySdkModule.java index 3e22449..fb4bcbb 100644 --- a/android/src/main/java/com/reactlibrary/IndySdkModule.java +++ b/android/src/main/java/com/reactlibrary/IndySdkModule.java @@ -152,6 +152,29 @@ public void deleteWallet(String configJson, String credentialsJson, Promise prom } } + @ReactMethod + public void exportWallet(int walletHandle, String exportConfig, Promise promise) { + try { + Wallet wallet = walletMap.get(walletHandle); + Wallet.exportWallet(wallet, exportConfig).get(); + promise.resolve(null); + } catch (Exception e) { + IndySdkRejectResponse rejectResponse = new IndySdkRejectResponse(e); + promise.reject(rejectResponse.getCode(), rejectResponse.toJson(), e); + } + } + + @ReactMethod + public void importWallet(String config, String credentials, String importConfig, Promise promise) { + try { + Wallet.importWallet(config, credentials ,importConfig).get(); + promise.resolve(null); + } catch (Exception e) { + IndySdkRejectResponse rejectResponse = new IndySdkRejectResponse(e); + promise.reject(rejectResponse.getCode(), rejectResponse.toJson(), e); + } + } + // did @ReactMethod diff --git a/src/index.js b/src/index.js index cda22f2..6c1bea1 100644 --- a/src/index.js +++ b/src/index.js @@ -307,6 +307,14 @@ const indy = { return IndySdk.deleteWallet(JSON.stringify(config), JSON.stringify(credentials)) }, + exportWallet(wh: WalletHandle, exportConfig: Object): Promise { + return IndySdk.exportWallet(wh, JSON.stringify(exportConfig)) + }, + + importWallet(config: Object, credentials: Object, importConfig: Object): Promise { + return IndySdk.importWallet(JSON.stringify(config), JSON.stringify(credentials), JSON.stringify(importConfig)) + }, + // did /**