@synonymdev/react-native-pubky 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -24,6 +24,9 @@ npm install @synonymdev/react-native-pubky
24
24
  - [x] [list](#list): Returns a list of Pubky URLs of the files in the path of the `url` provided.
25
25
  - [x] [generateSecretKey](#generateSecretKey): Generate a secret key.
26
26
  - [x] [getPublicKeyFromSecretKey](#getPublicKeyFromSecretKey): Get the public key string and uri from a secret key.
27
+ - [x] [create_recovery_file](#createRecoveryFile): Create a recovery file.
28
+ - [x] [decrypt_recovery_file](#decryptRecoveryFile): Decrypt a recovery file.
29
+
27
30
  ### Methods to be Implemented
28
31
  - [ ] getProfile: Retrieve the profile of a user.
29
32
  - [ ] editProfile: Submit changes to the specified profile.
@@ -225,6 +228,36 @@ if (signOutRes.isErr()) {
225
228
  console.log(signOutRes.value);
226
229
  ```
227
230
 
231
+ ### <a name="createRecoveryFile"></a>createRecoveryFile
232
+ ```js
233
+ import { createRecoveryFile } from '@synonymdev/react-native-pubky';
234
+
235
+ const createRecoveryFileRes = await createRecoveryFile(
236
+ 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret Key
237
+ 'passphrase', // Passphrase
238
+ );
239
+ if (createRecoveryFileRes.isErr()) {
240
+ console.log(createRecoveryFileRes.error.message);
241
+ return;
242
+ }
243
+ console.log(createRecoveryFileRes.value);
244
+ ```
245
+
246
+ ### <a name="decryptRecoveryFile"></a>decryptRecoveryFile
247
+ ```js
248
+ import { decryptRecoveryFile } from '@synonymdev/react-native-pubky';
249
+
250
+ const decryptRecoveryFileRes = await decryptRecoveryFile(
251
+ 'cHVia3kub3JnL3JlY292ZXJ5CkZRt1NHIjxyTo0whSSgTgNrH56MPpGrSxvAQSE0x5FeklVJpNJqcNP4zjdwW/OpdBOsEC1qZ5MI/mcEUKFKVAEZwikdclsLZg==', // Recovery File
252
+ 'passphrase', // Passphrase
253
+ );
254
+ if (decryptRecoveryFileRes.isErr()) {
255
+ console.log(decryptRecoveryFileRes.error.message);
256
+ return;
257
+ }
258
+ console.log(decryptRecoveryFileRes.value);
259
+ ```
260
+
228
261
  ## Local Installation
229
262
 
230
263
  1. Clone & npm install:
@@ -278,6 +278,32 @@ class PubkyModule(reactContext: ReactApplicationContext) :
278
278
  }
279
279
  }
280
280
 
281
+ @ReactMethod
282
+ fun createRecoveryFile(secretKey: String, passphrase: String, promise: Promise) {
283
+ try {
284
+ val result = createRecoveryFile(secretKey, passphrase)
285
+ val array = Arguments.createArray().apply {
286
+ result.forEach { pushString(it) }
287
+ }
288
+ promise.resolve(array)
289
+ } catch (e: Exception) {
290
+ promise.reject("Error", e.message)
291
+ }
292
+ }
293
+
294
+ @ReactMethod
295
+ fun decryptRecoveryFile(recoveryFile: String, passphrase: String, promise: Promise) {
296
+ try {
297
+ val result = decryptRecoveryFile(recoveryFile, passphrase)
298
+ val array = Arguments.createArray().apply {
299
+ result.forEach { pushString(it) }
300
+ }
301
+ promise.resolve(array)
302
+ } catch (e: Exception) {
303
+ promise.reject("Error", e.message)
304
+ }
305
+ }
306
+
281
307
  companion object {
282
308
  const val NAME = "Pubky"
283
309
  }
@@ -10,7 +10,7 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64-simulator</string>
13
+ <string>ios-arm64</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libpubkymobile.a</string>
16
16
  <key>SupportedArchitectures</key>
@@ -19,8 +19,6 @@
19
19
  </array>
20
20
  <key>SupportedPlatform</key>
21
21
  <string>ios</string>
22
- <key>SupportedPlatformVariant</key>
23
- <string>simulator</string>
24
22
  </dict>
25
23
  <dict>
26
24
  <key>BinaryPath</key>
@@ -28,7 +26,7 @@
28
26
  <key>HeadersPath</key>
29
27
  <string>Headers</string>
30
28
  <key>LibraryIdentifier</key>
31
- <string>ios-arm64</string>
29
+ <string>ios-arm64-simulator</string>
32
30
  <key>LibraryPath</key>
33
31
  <string>libpubkymobile.a</string>
34
32
  <key>SupportedArchitectures</key>
@@ -37,6 +35,8 @@
37
35
  </array>
38
36
  <key>SupportedPlatform</key>
39
37
  <string>ios</string>
38
+ <key>SupportedPlatformVariant</key>
39
+ <string>simulator</string>
40
40
  </dict>
41
41
  </array>
42
42
  <key>CFBundlePackageType</key>
@@ -65,6 +65,10 @@ typedef void (*UniFfiRustFutureContinuation)(void * _Nonnull, int8_t);
65
65
  // Scaffolding functions
66
66
  RustBuffer uniffi_pubkymobile_fn_func_auth(RustBuffer url, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
67
67
  );
68
+ RustBuffer uniffi_pubkymobile_fn_func_create_recovery_file(RustBuffer secret_key, RustBuffer passphrase, RustCallStatus *_Nonnull out_status
69
+ );
70
+ RustBuffer uniffi_pubkymobile_fn_func_decrypt_recovery_file(RustBuffer recovery_file, RustBuffer passphrase, RustCallStatus *_Nonnull out_status
71
+ );
68
72
  RustBuffer uniffi_pubkymobile_fn_func_generate_secret_key(RustCallStatus *_Nonnull out_status
69
73
 
70
74
  );
@@ -208,6 +212,12 @@ void ffi_pubkymobile_rust_future_complete_void(void* _Nonnull handle, RustCallSt
208
212
  );
209
213
  uint16_t uniffi_pubkymobile_checksum_func_auth(void
210
214
 
215
+ );
216
+ uint16_t uniffi_pubkymobile_checksum_func_create_recovery_file(void
217
+
218
+ );
219
+ uint16_t uniffi_pubkymobile_checksum_func_decrypt_recovery_file(void
220
+
211
221
  );
212
222
  uint16_t uniffi_pubkymobile_checksum_func_generate_secret_key(void
213
223
 
@@ -65,6 +65,10 @@ typedef void (*UniFfiRustFutureContinuation)(void * _Nonnull, int8_t);
65
65
  // Scaffolding functions
66
66
  RustBuffer uniffi_pubkymobile_fn_func_auth(RustBuffer url, RustBuffer secret_key, RustCallStatus *_Nonnull out_status
67
67
  );
68
+ RustBuffer uniffi_pubkymobile_fn_func_create_recovery_file(RustBuffer secret_key, RustBuffer passphrase, RustCallStatus *_Nonnull out_status
69
+ );
70
+ RustBuffer uniffi_pubkymobile_fn_func_decrypt_recovery_file(RustBuffer recovery_file, RustBuffer passphrase, RustCallStatus *_Nonnull out_status
71
+ );
68
72
  RustBuffer uniffi_pubkymobile_fn_func_generate_secret_key(RustCallStatus *_Nonnull out_status
69
73
 
70
74
  );
@@ -208,6 +212,12 @@ void ffi_pubkymobile_rust_future_complete_void(void* _Nonnull handle, RustCallSt
208
212
  );
209
213
  uint16_t uniffi_pubkymobile_checksum_func_auth(void
210
214
 
215
+ );
216
+ uint16_t uniffi_pubkymobile_checksum_func_create_recovery_file(void
217
+
218
+ );
219
+ uint16_t uniffi_pubkymobile_checksum_func_decrypt_recovery_file(void
220
+
211
221
  );
212
222
  uint16_t uniffi_pubkymobile_checksum_func_generate_secret_key(void
213
223
 
package/ios/Pubky.mm CHANGED
@@ -64,6 +64,16 @@ RCT_EXTERN_METHOD(getPublicKeyFromSecretKey:(NSString *)secretKey
64
64
  withResolver:(RCTPromiseResolveBlock)resolve
65
65
  withRejecter:(RCTPromiseRejectBlock)reject)
66
66
 
67
+ RCT_EXTERN_METHOD(createRecoveryFile:(NSString *)secretKey
68
+ passphrase:(NSString *)passphrase
69
+ withResolver:(RCTPromiseResolveBlock)resolve
70
+ withRejecter:(RCTPromiseRejectBlock)reject)
71
+
72
+ RCT_EXTERN_METHOD(decryptRecoveryFile:(NSString *)recoveryFile
73
+ passphrase:(NSString *)passphrase
74
+ withResolver:(RCTPromiseResolveBlock)resolve
75
+ withRejecter:(RCTPromiseRejectBlock)reject)
76
+
67
77
  + (BOOL)requiresMainQueueSetup
68
78
  {
69
79
  return NO;
package/ios/Pubky.swift CHANGED
@@ -167,4 +167,24 @@ class Pubky: NSObject {
167
167
  }
168
168
  }
169
169
  }
170
+
171
+ @objc(createRecoveryFile:passphrase:withResolver:withRejecter:)
172
+ func createRecoveryFile(_ secretKey: String, passphrase: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
173
+ do {
174
+ let result = react_native_pubky.createRecoveryFile(secretKey: secretKey, passphrase: passphrase)
175
+ resolve(result)
176
+ } catch {
177
+ reject("createRecoveryFile Error", "Failed to create recovery file", error)
178
+ }
179
+ }
180
+
181
+ @objc(decryptRecoveryFile:passphrase:withResolver:withRejecter:)
182
+ func decryptRecoveryFile(_ recoveryFile: String, passphrase: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
183
+ do {
184
+ let result = react_native_pubky.decryptRecoveryFile(recoveryFile: recoveryFile, passphrase: passphrase)
185
+ resolve(result)
186
+ } catch {
187
+ reject("decryptRecoveryFile Error", "Failed to decrypt recovery file", error)
188
+ }
189
+ }
170
190
  }
@@ -367,6 +367,26 @@ public func auth(url: String, secretKey: String) -> [String] {
367
367
  )
368
368
  }
369
369
 
370
+ public func createRecoveryFile(secretKey: String, passphrase: String) -> [String] {
371
+ return try! FfiConverterSequenceString.lift(
372
+ try! rustCall() {
373
+ uniffi_pubkymobile_fn_func_create_recovery_file(
374
+ FfiConverterString.lower(secretKey),
375
+ FfiConverterString.lower(passphrase),$0)
376
+ }
377
+ )
378
+ }
379
+
380
+ public func decryptRecoveryFile(recoveryFile: String, passphrase: String) -> [String] {
381
+ return try! FfiConverterSequenceString.lift(
382
+ try! rustCall() {
383
+ uniffi_pubkymobile_fn_func_decrypt_recovery_file(
384
+ FfiConverterString.lower(recoveryFile),
385
+ FfiConverterString.lower(passphrase),$0)
386
+ }
387
+ )
388
+ }
389
+
370
390
  public func generateSecretKey() -> [String] {
371
391
  return try! FfiConverterSequenceString.lift(
372
392
  try! rustCall() {
@@ -507,6 +527,12 @@ private var initializationResult: InitializationResult {
507
527
  if (uniffi_pubkymobile_checksum_func_auth() != 61378) {
508
528
  return InitializationResult.apiChecksumMismatch
509
529
  }
530
+ if (uniffi_pubkymobile_checksum_func_create_recovery_file() != 55903) {
531
+ return InitializationResult.apiChecksumMismatch
532
+ }
533
+ if (uniffi_pubkymobile_checksum_func_decrypt_recovery_file() != 59688) {
534
+ return InitializationResult.apiChecksumMismatch
535
+ }
510
536
  if (uniffi_pubkymobile_checksum_func_generate_secret_key() != 63116) {
511
537
  return InitializationResult.apiChecksumMismatch
512
538
  }
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.auth = auth;
7
+ exports.createRecoveryFile = createRecoveryFile;
8
+ exports.decryptRecoveryFile = decryptRecoveryFile;
7
9
  exports.generateSecretKey = generateSecretKey;
8
10
  exports.get = get;
9
11
  exports.getPublicKeyFromSecretKey = getPublicKeyFromSecretKey;
@@ -179,4 +181,26 @@ async function getPublicKeyFromSecretKey(secretKey) {
179
181
  return (0, _result.err)(JSON.stringify(e));
180
182
  }
181
183
  }
184
+ async function createRecoveryFile(secretKey, passphrase) {
185
+ try {
186
+ const res = await Pubky.createRecoveryFile(secretKey, passphrase);
187
+ if (res[0] === 'error') {
188
+ return (0, _result.err)(res[1]);
189
+ }
190
+ return (0, _result.ok)(res[1]);
191
+ } catch (e) {
192
+ return (0, _result.err)(JSON.stringify(e));
193
+ }
194
+ }
195
+ async function decryptRecoveryFile(recoveryFile, passphrase) {
196
+ try {
197
+ const res = await Pubky.decryptRecoveryFile(recoveryFile, passphrase);
198
+ if (res[0] === 'error') {
199
+ return (0, _result.err)(res[1]);
200
+ }
201
+ return (0, _result.ok)(res[1]);
202
+ } catch (e) {
203
+ return (0, _result.err)(JSON.stringify(e));
204
+ }
205
+ }
182
206
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_result","LINKING_ERROR","Platform","select","ios","default","Pubky","NativeModules","Proxy","get","Error","auth","url","secretKey","res","err","ok","parseAuthUrl","parsed","JSON","parse","e","stringify","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","generateSecretKey","getPublicKeyFromSecretKey"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;A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,CAAC,CAAC;EAC/B,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV,OAAO,IAAAN,WAAG,EAACI,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF;AAEO,eAAekB,yBAAyBA,CAC7C1B,SAAiB,EACgB;EACjC,IAAI;IACF,MAAMC,GAAG,GAAG,MAAMR,KAAK,CAACiC,yBAAyB,CAAC1B,SAAS,CAAC;IAC5D,IAAIC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAO,IAAAC,WAAG,EAACD,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAO,IAAAE,UAAE,EAACG,IAAI,CAACC,KAAK,CAACN,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EAC/B,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV,OAAO,IAAAN,WAAG,EAACI,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_result","LINKING_ERROR","Platform","select","ios","default","Pubky","NativeModules","Proxy","get","Error","auth","url","secretKey","res","err","ok","parseAuthUrl","parsed","JSON","parse","e","stringify","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","generateSecretKey","getPublicKeyFromSecretKey","createRecoveryFile","passphrase","decryptRecoveryFile","recoveryFile"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GACjB,6EAA6E,GAC7EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,KAAK,GAAGC,0BAAa,CAACD,KAAK,GAC7BC,0BAA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C;EAC/B;AACF","ignoreList":[]}
@@ -162,4 +162,26 @@ export async function getPublicKeyFromSecretKey(secretKey) {
162
162
  return err(JSON.stringify(e));
163
163
  }
164
164
  }
165
+ export async function createRecoveryFile(secretKey, passphrase) {
166
+ try {
167
+ const res = await Pubky.createRecoveryFile(secretKey, passphrase);
168
+ if (res[0] === 'error') {
169
+ return err(res[1]);
170
+ }
171
+ return ok(res[1]);
172
+ } catch (e) {
173
+ return err(JSON.stringify(e));
174
+ }
175
+ }
176
+ export async function decryptRecoveryFile(recoveryFile, passphrase) {
177
+ try {
178
+ const res = await Pubky.decryptRecoveryFile(recoveryFile, passphrase);
179
+ if (res[0] === 'error') {
180
+ return err(res[1]);
181
+ }
182
+ return ok(res[1]);
183
+ } catch (e) {
184
+ return err(JSON.stringify(e));
185
+ }
186
+ }
165
187
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","ok","err","LINKING_ERROR","select","ios","default","Pubky","Proxy","get","Error","auth","url","secretKey","res","parseAuthUrl","parsed","JSON","parse","e","stringify","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","generateSecretKey","getPublicKeyFromSecretKey"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,EAAE,EAAEC,GAAG,QAAqB,oBAAoB;AAEzD,MAAMC,aAAa,GACjB,6EAA6E,GAC7EH,QAAQ,CAACI,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,KAAK,GAAGR,aAAa,CAACQ,KAAK,GAC7BR,aAAa,CAACQ,KAAK,GACnB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP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EAAE;IACV,OAAOjB,GAAG,CAACe,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","Platform","ok","err","LINKING_ERROR","select","ios","default","Pubky","Proxy","get","Error","auth","url","secretKey","res","parseAuthUrl","parsed","JSON","parse","e","stringify","publish","recordName","recordContent","resolve","publicKey","signUp","homeserver","signIn","signOut","put","content","publishHttps","target","resolveHttps","list","generateSecretKey","getPublicKeyFromSecretKey","createRecoveryFile","passphrase","decryptRecoveryFile","recoveryFile"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,EAAE,EAAEC,GAAG,QAAqB,oBAAoB;AAEzD,MAAMC,aAAa,GACjB,6EAA6E,GAC7EH,QAAQ,CAACI,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,KAAK,GAAGR,aAAa,CAACQ,KAAK,GAC7BR,aAAa,CAACQ,KAAK,GACnB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,eAAeQ,IAAIA,CACxBC,GAAW,EACXC,SAAiB,EACU;EAC3B,MAAMC,GAAG,GAAG,MAAMP,KAAK,CAACI,IAAI,CAACC,GAAG,EAAEC,SAAS,CAAC;EAC5C,IAAIC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;IACtB,OAAOZ,GAAG,CAACY,GAAG,CAAC,CAAC,CAAC,CAAC;EACpB;EACA,OAAOb,EAAE,CAACa,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB;AAaA,OAAO,eAAeC,YAAYA,CAChCH,GAAW,EACwB;EACnC,IAAI;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AAC,CAAC;EACnB,CAAC,CAAC,OAAOK,CAAC,EAAE;IACV,OAAOjB,GAAG,CAACe,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF;AAEA,OAAO,eAAeqB,mBAAmBA,CACvCC,YAAoB,EACpBF,UAAkB,EACO;EACzB,IAAI;IACF,MAAMzB,GAAG,GAAG,MAAMP,KAAK,CAACiC,mBAAmB,CAACC,YAAY,EAAEF,UAAU,CAAC;IACrE,IAAIzB,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAOZ,GAAG,CAACY,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB;IACA,OAAOb,EAAE,CAACa,GAAG,CAAC,CAAC,CAAC,CAAC;EACnB,CAAC,CAAC,OAAOK,CAAC,EAAE;IACV,OAAOjB,GAAG,CAACe,IAAI,CAACG,SAAS,CAACD,CAAC,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
@@ -61,5 +61,7 @@ interface IGenerateSecretKey extends IPublicKeyInfo {
61
61
  }
62
62
  export declare function generateSecretKey(): Promise<Result<IGenerateSecretKey>>;
63
63
  export declare function getPublicKeyFromSecretKey(secretKey: string): Promise<Result<IPublicKeyInfo>>;
64
+ export declare function createRecoveryFile(secretKey: string, passphrase: string): Promise<Result<string>>;
65
+ export declare function decryptRecoveryFile(recoveryFile: string, passphrase: string): Promise<Result<string>>;
64
66
  export {};
65
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAmB1D,wBAAsB,IAAI,CACxB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAM3B;AAED,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;I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CAAC;IACnB,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAUtC;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAUjE;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,UAAU,kBAAmB,SAAQ,cAAc;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAU7E;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAUjC;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB;AAED,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB"}
@@ -61,5 +61,7 @@ interface IGenerateSecretKey extends IPublicKeyInfo {
61
61
  }
62
62
  export declare function generateSecretKey(): Promise<Result<IGenerateSecretKey>>;
63
63
  export declare function getPublicKeyFromSecretKey(secretKey: string): Promise<Result<IPublicKeyInfo>>;
64
+ export declare function createRecoveryFile(secretKey: string, passphrase: string): Promise<Result<string>>;
65
+ export declare function decryptRecoveryFile(recoveryFile: string, passphrase: string): Promise<Result<string>>;
64
66
  export {};
65
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[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AC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAUtC;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAUjE;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,UAAU,kBAAmB,SAAQ,cAAc;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAU7E;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAUjC;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB;AAED,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAUzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synonymdev/react-native-pubky",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "React Native Implementation of Pubky",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
package/src/index.tsx CHANGED
@@ -257,3 +257,33 @@ export async function getPublicKeyFromSecretKey(
257
257
  return err(JSON.stringify(e));
258
258
  }
259
259
  }
260
+
261
+ export async function createRecoveryFile(
262
+ secretKey: string,
263
+ passphrase: string
264
+ ): Promise<Result<string>> {
265
+ try {
266
+ const res = await Pubky.createRecoveryFile(secretKey, passphrase);
267
+ if (res[0] === 'error') {
268
+ return err(res[1]);
269
+ }
270
+ return ok(res[1]);
271
+ } catch (e) {
272
+ return err(JSON.stringify(e));
273
+ }
274
+ }
275
+
276
+ export async function decryptRecoveryFile(
277
+ recoveryFile: string,
278
+ passphrase: string
279
+ ): Promise<Result<string>> {
280
+ try {
281
+ const res = await Pubky.decryptRecoveryFile(recoveryFile, passphrase);
282
+ if (res[0] === 'error') {
283
+ return err(res[1]);
284
+ }
285
+ return ok(res[1]);
286
+ } catch (e) {
287
+ return err(JSON.stringify(e));
288
+ }
289
+ }