@functionland/react-native-fula 1.8.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +214 -205
- package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.6/checksums/checksums.lock +0 -0
- package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.6/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.idea/compiler.xml +1 -1
- package/android/.idea/gradle.xml +1 -0
- package/android/.idea/misc.xml +9 -9
- package/android/.idea/sonarlint/securityhotspotstore/index.pb +0 -0
- package/android/build.gradle +2 -1
- package/android/src/main/java/land/fx/fula/Cryptography.java +60 -60
- package/android/src/main/java/land/fx/fula/FulaModule.java +126 -17
- package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +12 -12
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/fula.js +113 -98
- package/lib/commonjs/protocols/fula.js.map +1 -1
- package/lib/commonjs/protocols/fxblox.js +23 -4
- package/lib/commonjs/protocols/fxblox.js.map +1 -1
- package/lib/commonjs/types/fxblox.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/protocols/blockchain.js +12 -12
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/fula.js +109 -96
- package/lib/module/protocols/fula.js.map +1 -1
- package/lib/module/protocols/fxblox.js +21 -3
- package/lib/module/protocols/fxblox.js.map +1 -1
- package/lib/module/types/fxblox.js.map +1 -1
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +3 -0
- package/lib/typescript/protocols/fula.d.ts +5 -0
- package/lib/typescript/protocols/fxblox.d.ts +1 -0
- package/lib/typescript/types/fxblox.d.ts +4 -0
- package/package.json +1 -1
- package/src/index.tsx +4 -4
- package/src/interfaces/fulaNativeModule.ts +43 -8
- package/src/protocols/blockchain.ts +318 -274
- package/src/protocols/fula.ts +301 -286
- package/src/protocols/fxblox.ts +49 -28
- package/src/types/fxblox.ts +8 -4
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
package land.fx.fula;
|
|
2
|
-
|
|
3
|
-
import android.util.Base64;
|
|
4
|
-
|
|
5
|
-
import java.io.UnsupportedEncodingException;
|
|
6
|
-
import java.nio.charset.StandardCharsets;
|
|
7
|
-
import java.security.InvalidAlgorithmParameterException;
|
|
8
|
-
import java.security.InvalidKeyException;
|
|
9
|
-
import java.security.NoSuchAlgorithmException;
|
|
10
|
-
import java.security.spec.InvalidKeySpecException;
|
|
11
|
-
import java.security.SecureRandom;
|
|
12
|
-
import java.nio.ByteBuffer;
|
|
13
|
-
import java.security.spec.InvalidParameterSpecException;
|
|
14
|
-
|
|
15
|
-
import javax.crypto.BadPaddingException;
|
|
16
|
-
import javax.crypto.Cipher;
|
|
17
|
-
import javax.crypto.IllegalBlockSizeException;
|
|
18
|
-
import javax.crypto.NoSuchPaddingException;
|
|
19
|
-
import javax.crypto.SecretKey;
|
|
20
|
-
import javax.crypto.SecretKeyFactory;
|
|
21
|
-
import javax.crypto.spec.PBEKeySpec;
|
|
22
|
-
import javax.crypto.spec.SecretKeySpec;
|
|
23
|
-
import javax.crypto.spec.GCMParameterSpec;
|
|
24
|
-
|
|
25
|
-
public class Cryptography {
|
|
26
|
-
public static String encryptMsg(String message, SecretKey secret)
|
|
27
|
-
throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {
|
|
28
|
-
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
|
29
|
-
byte[] iv = new byte[12]; // Ensure this is randomly generated for each encryption.
|
|
30
|
-
new SecureRandom().nextBytes(iv);
|
|
31
|
-
GCMParameterSpec spec = new GCMParameterSpec(128, iv);
|
|
32
|
-
cipher.init(Cipher.ENCRYPT_MODE, secret, spec);
|
|
33
|
-
byte[] cipherText = cipher.doFinal(message.getBytes(StandardCharsets.UTF_8));
|
|
34
|
-
ByteBuffer byteBuffer = ByteBuffer.allocate(iv.length + cipherText.length);
|
|
35
|
-
byteBuffer.put(iv);
|
|
36
|
-
byteBuffer.put(cipherText);
|
|
37
|
-
return Base64.encodeToString(byteBuffer.array(), Base64.NO_WRAP);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public static String decryptMsg(String cipherText, SecretKey secret)
|
|
41
|
-
throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
|
|
42
|
-
ByteBuffer byteBuffer = ByteBuffer.wrap(Base64.decode(cipherText, Base64.NO_WRAP));
|
|
43
|
-
byte[] iv = new byte[12];
|
|
44
|
-
byteBuffer.get(iv);
|
|
45
|
-
byte[] cipherBytes = new byte[byteBuffer.remaining()];
|
|
46
|
-
byteBuffer.get(cipherBytes);
|
|
47
|
-
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
|
48
|
-
GCMParameterSpec spec = new GCMParameterSpec(128, iv);
|
|
49
|
-
cipher.init(Cipher.DECRYPT_MODE, secret, spec);
|
|
50
|
-
String decryptString = new String(cipher.doFinal(cipherBytes), StandardCharsets.UTF_8);
|
|
51
|
-
return decryptString;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public static SecretKey generateKey(byte[] key)
|
|
55
|
-
throws NoSuchAlgorithmException, InvalidKeySpecException {
|
|
56
|
-
PBEKeySpec pbeKeySpec = new PBEKeySpec(StaticHelper.bytesToBase64(key).toCharArray(), key, 1000, 128);
|
|
57
|
-
SecretKey pbeKey = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256").generateSecret(pbeKeySpec);
|
|
58
|
-
return new SecretKeySpec(pbeKey.getEncoded(), "AES");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
package land.fx.fula;
|
|
2
|
+
|
|
3
|
+
import android.util.Base64;
|
|
4
|
+
|
|
5
|
+
import java.io.UnsupportedEncodingException;
|
|
6
|
+
import java.nio.charset.StandardCharsets;
|
|
7
|
+
import java.security.InvalidAlgorithmParameterException;
|
|
8
|
+
import java.security.InvalidKeyException;
|
|
9
|
+
import java.security.NoSuchAlgorithmException;
|
|
10
|
+
import java.security.spec.InvalidKeySpecException;
|
|
11
|
+
import java.security.SecureRandom;
|
|
12
|
+
import java.nio.ByteBuffer;
|
|
13
|
+
import java.security.spec.InvalidParameterSpecException;
|
|
14
|
+
|
|
15
|
+
import javax.crypto.BadPaddingException;
|
|
16
|
+
import javax.crypto.Cipher;
|
|
17
|
+
import javax.crypto.IllegalBlockSizeException;
|
|
18
|
+
import javax.crypto.NoSuchPaddingException;
|
|
19
|
+
import javax.crypto.SecretKey;
|
|
20
|
+
import javax.crypto.SecretKeyFactory;
|
|
21
|
+
import javax.crypto.spec.PBEKeySpec;
|
|
22
|
+
import javax.crypto.spec.SecretKeySpec;
|
|
23
|
+
import javax.crypto.spec.GCMParameterSpec;
|
|
24
|
+
|
|
25
|
+
public class Cryptography {
|
|
26
|
+
public static String encryptMsg(String message, SecretKey secret)
|
|
27
|
+
throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {
|
|
28
|
+
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
|
29
|
+
byte[] iv = new byte[12]; // Ensure this is randomly generated for each encryption.
|
|
30
|
+
new SecureRandom().nextBytes(iv);
|
|
31
|
+
GCMParameterSpec spec = new GCMParameterSpec(128, iv);
|
|
32
|
+
cipher.init(Cipher.ENCRYPT_MODE, secret, spec);
|
|
33
|
+
byte[] cipherText = cipher.doFinal(message.getBytes(StandardCharsets.UTF_8));
|
|
34
|
+
ByteBuffer byteBuffer = ByteBuffer.allocate(iv.length + cipherText.length);
|
|
35
|
+
byteBuffer.put(iv);
|
|
36
|
+
byteBuffer.put(cipherText);
|
|
37
|
+
return Base64.encodeToString(byteBuffer.array(), Base64.NO_WRAP);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static String decryptMsg(String cipherText, SecretKey secret)
|
|
41
|
+
throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
|
|
42
|
+
ByteBuffer byteBuffer = ByteBuffer.wrap(Base64.decode(cipherText, Base64.NO_WRAP));
|
|
43
|
+
byte[] iv = new byte[12];
|
|
44
|
+
byteBuffer.get(iv);
|
|
45
|
+
byte[] cipherBytes = new byte[byteBuffer.remaining()];
|
|
46
|
+
byteBuffer.get(cipherBytes);
|
|
47
|
+
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
|
48
|
+
GCMParameterSpec spec = new GCMParameterSpec(128, iv);
|
|
49
|
+
cipher.init(Cipher.DECRYPT_MODE, secret, spec);
|
|
50
|
+
String decryptString = new String(cipher.doFinal(cipherBytes), StandardCharsets.UTF_8);
|
|
51
|
+
return decryptString;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public static SecretKey generateKey(byte[] key)
|
|
55
|
+
throws NoSuchAlgorithmException, InvalidKeySpecException {
|
|
56
|
+
PBEKeySpec pbeKeySpec = new PBEKeySpec(StaticHelper.bytesToBase64(key).toCharArray(), key, 1000, 128);
|
|
57
|
+
SecretKey pbeKey = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256").generateSecret(pbeKeySpec);
|
|
58
|
+
return new SecretKeySpec(pbeKey.getEncoded(), "AES");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -11,6 +11,10 @@ import com.facebook.react.bridge.ReactMethod;
|
|
|
11
11
|
import com.facebook.react.bridge.WritableMap;
|
|
12
12
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
13
13
|
import com.facebook.react.module.annotations.ReactModule;
|
|
14
|
+
import com.facebook.react.bridge.Arguments;
|
|
15
|
+
import com.facebook.react.bridge.WritableArray;
|
|
16
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
17
|
+
|
|
14
18
|
|
|
15
19
|
import org.apache.commons.io.FileUtils;
|
|
16
20
|
import org.jetbrains.annotations.Contract;
|
|
@@ -23,6 +27,7 @@ import java.security.InvalidAlgorithmParameterException;
|
|
|
23
27
|
import java.security.InvalidKeyException;
|
|
24
28
|
import java.security.NoSuchAlgorithmException;
|
|
25
29
|
import java.util.Arrays;
|
|
30
|
+
import java.util.ArrayList;
|
|
26
31
|
|
|
27
32
|
import javax.crypto.BadPaddingException;
|
|
28
33
|
import javax.crypto.IllegalBlockSizeException;
|
|
@@ -36,9 +41,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
36
41
|
import java.util.concurrent.Future;
|
|
37
42
|
import java.util.concurrent.TimeoutException;
|
|
38
43
|
|
|
39
|
-
import org.json.JSONObject;
|
|
40
|
-
import org.json.JSONArray;
|
|
41
|
-
|
|
42
44
|
import fulamobile.Config;
|
|
43
45
|
import fulamobile.Fulamobile;
|
|
44
46
|
|
|
@@ -328,7 +330,7 @@ public class FulaModule extends ReactContextBaseJavaModule {
|
|
|
328
330
|
}
|
|
329
331
|
|
|
330
332
|
@ReactMethod
|
|
331
|
-
|
|
333
|
+
public void checkFailedActions(boolean retry, int timeout, Promise promise) throws Exception {
|
|
332
334
|
try {
|
|
333
335
|
if (this.fula != null) {
|
|
334
336
|
if (!retry) {
|
|
@@ -354,6 +356,57 @@ public class FulaModule extends ReactContextBaseJavaModule {
|
|
|
354
356
|
}
|
|
355
357
|
}
|
|
356
358
|
|
|
359
|
+
@ReactMethod
|
|
360
|
+
private void listFailedActions(ReadableArray cids, Promise promise) throws Exception {
|
|
361
|
+
try {
|
|
362
|
+
if (this.fula != null) {
|
|
363
|
+
Log.d("ReactNative", "listFailedActions");
|
|
364
|
+
fulamobile.StringIterator failedLinks = this.fula.listFailedPushesAsString();
|
|
365
|
+
ArrayList<String> failedLinksList = new ArrayList<>();
|
|
366
|
+
while (failedLinks.hasNext()) {
|
|
367
|
+
failedLinksList.add(failedLinks.next());
|
|
368
|
+
}
|
|
369
|
+
if (cids.size() > 0) {
|
|
370
|
+
// If cids array is provided, filter the failedLinksList
|
|
371
|
+
ArrayList<String> cidsList = new ArrayList<>();
|
|
372
|
+
for (int i = 0; i < cids.size(); i++) {
|
|
373
|
+
cidsList.add(cids.getString(i));
|
|
374
|
+
}
|
|
375
|
+
cidsList.retainAll(failedLinksList); // Keep only the elements in both cidsList and failedLinksList
|
|
376
|
+
if (!cidsList.isEmpty()) {
|
|
377
|
+
// If there are any matching cids, return them
|
|
378
|
+
WritableArray cidsArray = Arguments.createArray();
|
|
379
|
+
for (String cid : cidsList) {
|
|
380
|
+
cidsArray.pushString(cid);
|
|
381
|
+
}
|
|
382
|
+
promise.resolve(cidsArray);
|
|
383
|
+
} else {
|
|
384
|
+
// If there are no matching cids, return false
|
|
385
|
+
promise.resolve(false);
|
|
386
|
+
}
|
|
387
|
+
} else if (!failedLinksList.isEmpty()) {
|
|
388
|
+
// If cids array is not provided, return the whole list
|
|
389
|
+
Log.d("ReactNative", "listFailedActions found: "+ failedLinksList);
|
|
390
|
+
WritableArray failedLinksArray = Arguments.createArray();
|
|
391
|
+
for (String link : failedLinksList) {
|
|
392
|
+
failedLinksArray.pushString(link);
|
|
393
|
+
}
|
|
394
|
+
promise.resolve(failedLinksArray);
|
|
395
|
+
} else {
|
|
396
|
+
promise.resolve(false);
|
|
397
|
+
}
|
|
398
|
+
} else {
|
|
399
|
+
throw new Exception("listFailedActions: Fula is not initialized");
|
|
400
|
+
}
|
|
401
|
+
} catch (Exception e) {
|
|
402
|
+
Log.d("ReactNative", "listFailedActions failed with Error: " + e.getMessage());
|
|
403
|
+
throw (e);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
357
410
|
private boolean retryFailedActionsInternal(int timeout) throws Exception {
|
|
358
411
|
try {
|
|
359
412
|
Log.d("ReactNative", "retryFailedActionsInternal started");
|
|
@@ -410,22 +463,22 @@ public class FulaModule extends ReactContextBaseJavaModule {
|
|
|
410
463
|
return true;
|
|
411
464
|
}*/
|
|
412
465
|
} else {
|
|
413
|
-
Log.d("ReactNative", "
|
|
466
|
+
Log.d("ReactNative", "retryFailedActionsInternal failed because blox is offline");
|
|
414
467
|
//Blox Offline
|
|
415
468
|
return false;
|
|
416
469
|
}
|
|
417
470
|
}
|
|
418
471
|
catch (Exception e) {
|
|
419
|
-
Log.d("ReactNative", "
|
|
472
|
+
Log.d("ReactNative", "retryFailedActionsInternal failed with Error: " + e.getMessage());
|
|
420
473
|
return false;
|
|
421
474
|
}
|
|
422
475
|
} else {
|
|
423
|
-
Log.d("ReactNative", "
|
|
476
|
+
Log.d("ReactNative", "retryFailedActionsInternal failed because fula is not initialized");
|
|
424
477
|
//Fula is not initialized
|
|
425
478
|
return false;
|
|
426
479
|
}
|
|
427
480
|
} catch (Exception e) {
|
|
428
|
-
Log.d("ReactNative", "
|
|
481
|
+
Log.d("ReactNative", "retryFailedActionsInternal failed with Error: " + e.getMessage());
|
|
429
482
|
throw (e);
|
|
430
483
|
}
|
|
431
484
|
}
|
|
@@ -739,17 +792,26 @@ public class FulaModule extends ReactContextBaseJavaModule {
|
|
|
739
792
|
ThreadUtils.runOnExecutor(() -> {
|
|
740
793
|
Log.d("ReactNative", "writeFile to : path = " + fulaTargetFilename + ", from: " + localFilename);
|
|
741
794
|
try {
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
this.rootConfig
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
this.
|
|
795
|
+
if (this.client != null) {
|
|
796
|
+
Log.d("ReactNative", "writeFileFromPath started: this.rootConfig.getCid=" + this.rootConfig.getCid()+ ", fulaTargetFilename="+fulaTargetFilename + ", localFilename="+localFilename);
|
|
797
|
+
land.fx.wnfslib.Config config = Fs.writeFileFromPath(this.client, this.rootConfig.getCid(), this.rootConfig.getPrivate_ref(), fulaTargetFilename, localFilename);
|
|
798
|
+
if(config != null) {
|
|
799
|
+
this.rootConfig = config;
|
|
800
|
+
this.encrypt_and_store_config();
|
|
801
|
+
if (this.fula != null) {
|
|
802
|
+
this.fula.flush();
|
|
803
|
+
promise.resolve(config.getCid());
|
|
804
|
+
} else {
|
|
805
|
+
Log.d("ReactNative", "writeFile Error: fula is null");
|
|
806
|
+
promise.reject(new Exception("writeFile Error: fula is null"));
|
|
807
|
+
}
|
|
808
|
+
} else {
|
|
809
|
+
Log.d("ReactNative", "writeFile Error: config is null");
|
|
810
|
+
promise.reject(new Exception("writeFile Error: config is null"));
|
|
748
811
|
}
|
|
749
|
-
promise.resolve(config.getCid());
|
|
750
812
|
} else {
|
|
751
|
-
Log.d("ReactNative", "writeFile Error:
|
|
752
|
-
promise.reject(new Exception("writeFile Error:
|
|
813
|
+
Log.d("ReactNative", "writeFile Error: client is null");
|
|
814
|
+
promise.reject(new Exception("writeFile Error: client is null"));
|
|
753
815
|
}
|
|
754
816
|
} catch (Exception e) {
|
|
755
817
|
Log.d("get", e.getMessage());
|
|
@@ -1365,4 +1427,51 @@ public class FulaModule extends ReactContextBaseJavaModule {
|
|
|
1365
1427
|
});
|
|
1366
1428
|
}
|
|
1367
1429
|
|
|
1430
|
+
@ReactMethod
|
|
1431
|
+
public void reboot(Promise promise) {
|
|
1432
|
+
ThreadUtils.runOnExecutor(() -> {
|
|
1433
|
+
Log.d("ReactNative", "reboot");
|
|
1434
|
+
try {
|
|
1435
|
+
byte[] result = this.fula.reboot();
|
|
1436
|
+
String resultString = toString(result);
|
|
1437
|
+
Log.d("ReactNative", "result string="+resultString);
|
|
1438
|
+
promise.resolve(resultString);
|
|
1439
|
+
} catch (Exception e) {
|
|
1440
|
+
Log.d("ReactNative", e.getMessage());
|
|
1441
|
+
promise.reject(e);
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
@ReactMethod
|
|
1447
|
+
public void testData(String identityString, String bloxAddr, Promise promise) {
|
|
1448
|
+
try {
|
|
1449
|
+
byte[] identity = toByte(identityString);
|
|
1450
|
+
byte[] peerIdByte = this.newClientInternal(identity, "", bloxAddr, "", true, true, true);
|
|
1451
|
+
|
|
1452
|
+
String peerIdReturned = Arrays.toString(peerIdByte);
|
|
1453
|
+
Log.d("ReactNative", "newClient peerIdReturned= " + peerIdReturned);
|
|
1454
|
+
String peerId = this.fula.id();
|
|
1455
|
+
Log.d("ReactNative", "newClient peerId= " + peerId);
|
|
1456
|
+
byte[] bytes = {1, 85, 18, 32, 11, -31, 75, -78, -109, 11, -111, 97, -47, -78, -22, 84, 39, -117, -64, -70, -91, 55, -23, -80, 116, -123, -97, -26, 126, -70, -76, 35, 54, -106, 55, -9};
|
|
1457
|
+
|
|
1458
|
+
byte[] key = this.fula.put(bytes, 85);
|
|
1459
|
+
Log.d("ReactNative", "testData put result string="+Arrays.toString(key));
|
|
1460
|
+
|
|
1461
|
+
byte[] value = this.fula.get(key);
|
|
1462
|
+
Log.d("ReactNative", "testData get result string="+Arrays.toString(value));
|
|
1463
|
+
|
|
1464
|
+
this.fula.push(key);
|
|
1465
|
+
//this.fula.flush();
|
|
1466
|
+
|
|
1467
|
+
byte[] fetchedVal = this.fula.get(key);
|
|
1468
|
+
this.fula.pull(key);
|
|
1469
|
+
|
|
1470
|
+
promise.resolve(Arrays.toString(fetchedVal));
|
|
1471
|
+
} catch (Exception e) {
|
|
1472
|
+
Log.d("ReactNative", "ERROR:" + e.getMessage());
|
|
1473
|
+
promise.reject(e);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1368
1477
|
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
package land.fx.fula;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.ReactPackage;
|
|
6
|
-
import com.facebook.react.bridge.NativeModule;
|
|
7
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
9
|
-
|
|
10
|
-
import java.util.ArrayList;
|
|
11
|
-
import java.util.Collections;
|
|
12
|
-
import java.util.List;
|
|
13
|
-
|
|
14
|
-
public class FulaPackage implements ReactPackage {
|
|
15
|
-
@NonNull
|
|
16
|
-
@Override
|
|
17
|
-
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
18
|
-
List<NativeModule> modules = new ArrayList<>();
|
|
19
|
-
try {
|
|
20
|
-
modules.add(new FulaModule(reactContext));
|
|
21
|
-
} catch (Exception e) {
|
|
22
|
-
e.printStackTrace();
|
|
23
|
-
}
|
|
24
|
-
return modules;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@NonNull
|
|
28
|
-
@Override
|
|
29
|
-
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
30
|
-
return Collections.emptyList();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
package land.fx.fula;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.ReactPackage;
|
|
6
|
+
import com.facebook.react.bridge.NativeModule;
|
|
7
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
9
|
+
|
|
10
|
+
import java.util.ArrayList;
|
|
11
|
+
import java.util.Collections;
|
|
12
|
+
import java.util.List;
|
|
13
|
+
|
|
14
|
+
public class FulaPackage implements ReactPackage {
|
|
15
|
+
@NonNull
|
|
16
|
+
@Override
|
|
17
|
+
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
18
|
+
List<NativeModule> modules = new ArrayList<>();
|
|
19
|
+
try {
|
|
20
|
+
modules.add(new FulaModule(reactContext));
|
|
21
|
+
} catch (Exception e) {
|
|
22
|
+
e.printStackTrace();
|
|
23
|
+
}
|
|
24
|
+
return modules;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@NonNull
|
|
28
|
+
@Override
|
|
29
|
+
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
30
|
+
return Collections.emptyList();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * as fula from './protocols/fula';\nexport * as blockchain from './protocols/blockchain';\nexport * as chainApi from './protocols/chain-api';\nexport * as fxblox from './protocols/fxblox';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * as fula from './protocols/fula';\r\nexport * as blockchain from './protocols/blockchain';\r\nexport * as chainApi from './protocols/chain-api';\r\nexport * as fxblox from './protocols/fxblox';\r\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","Fula","NativeModules","FulaModule","Proxy","get","Error"],"sources":["fulaNativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\ninterface FulaNativeModule {\n init: (\n identity: string, //Private key of did identity\n storePath: string, //You can leave empty\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\n exchange: string, //set to 'noope' for testing\n autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write\n rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem\n useRelay: boolean | null, // if true it forces the use of relay\n refresh: boolean // if true it forces to refresh the fula object\n ) => Promise<{ peerId: string; rootCid: string; private_ref: string }>;\n newClient: (\n identity: string, //Private key of did identity\n storePath: string, //You can leave empty\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\n exchange: string, //set to 'noope' for testing\n autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write\n useRelay: boolean | null, // if true it forces the use of relay\n refresh: boolean // if true it forces to refresh the fula object\n
|
|
1
|
+
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","Fula","NativeModules","FulaModule","Proxy","get","Error"],"sources":["fulaNativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\ninterface FulaNativeModule {\n init: (\n identity: string, //Private key of did identity\n storePath: string, //You can leave empty\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\n exchange: string, //set to 'noope' for testing\n autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write\n rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem\n useRelay: boolean | null, // if true it forces the use of relay\n refresh: boolean // if true it forces to refresh the fula object\n ) => Promise<{ peerId: string; rootCid: string; private_ref: string }>;\n newClient: (\n identity: string, //Private key of did identity\n storePath: string, //You can leave empty\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\n exchange: string, //set to 'noope' for testing\n autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write\n useRelay: boolean | null, // if true it forces the use of relay\n refresh: boolean // if true it forces to refresh the fula object\n ) => Promise<string>;\n isReady: (filesystemCheck: boolean) => Promise<boolean>;\n logout: (identity: string, storePath: string) => Promise<boolean>;\n checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;\n listFailedActions: (cids: string[]) => Promise<string[]>;\n checkConnection: (timeout: number) => Promise<boolean>;\n get: (key: string) => Promise<string>;\n has: (key: Uint8Array) => Promise<boolean>;\n push: () => Promise<string>;\n put: (content: string, codec: string) => Promise<string>;\n mkdir: (path: string) => Promise<string>;\n writeFileContent: (path: string, content: string) => Promise<string>;\n writeFile: (\n fulaTargetFilename: string,\n localFilename: string\n ) => Promise<string>;\n ls: (path: string) => Promise<string>;\n rm: (path: string) => Promise<string>;\n cp: (sourcePath: string, targetPath: string) => Promise<string>;\n mv: (sourcePath: string, targetPath: string) => Promise<string>;\n readFile: (\n fulaTargetFilename: string,\n localFilename: string\n ) => Promise<string>;\n readFileContent: (path: string) => Promise<string>;\n setAuth: (peerId: string, allow: boolean) => Promise<boolean>;\n\n shutdown: () => Promise<void>;\n\n testData: (identity: string, bloxAddr: string) => Promise<string>;\n\n //Blockchain related functions\n createAccount: (seed: string) => Promise<string>;\n checkAccountExists: (account: string) => Promise<string>;\n createPool: (seed: string, poolName: string) => Promise<string>;\n listPools: () => Promise<string>;\n joinPool: (seed: string, poolID: number) => Promise<string>;\n leavePool: (seed: string, poolID: number) => Promise<string>;\n cancelPoolJoin: (seed: string, poolID: number) => Promise<string>;\n listPoolJoinRequests: (poolID: number) => Promise<string>;\n votePoolJoinRequest: (\n seed: string,\n poolID: number,\n account: string,\n accept: boolean\n ) => Promise<string>;\n newReplicationRequest: (\n seed: string,\n poolID: number,\n replicationFactor: number,\n cid: string\n ) => Promise<string>;\n newStoreRequest: (\n seed: string,\n poolID: number,\n uploader: string,\n cid: string\n ) => Promise<string>;\n listAvailableReplicationRequests: (poolID: number) => Promise<string>;\n removeReplicationRequest: (\n seed: string,\n poolID: number,\n cid: string\n ) => Promise<string>;\n removeStorer: (\n seed: string,\n storer: string,\n poolID: number,\n cid: string\n ) => Promise<string>;\n removeStoredReplication: (\n seed: string,\n uploader: string,\n poolID: number,\n cid: string\n ) => Promise<string>;\n\n //Hardware\n bloxFreeSpace: () => Promise<string>;\n wifiRemoveall: () => Promise<string>;\n reboot: () => Promise<string>;\n}\n\nconst LINKING_ERROR =\n `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst Fula = NativeModules.FulaModule\n ? NativeModules.FulaModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport default Fula as FulaNativeModule;\n"],"mappings":";;;;;;AAAA;AAwGA,MAAMA,aAAa,GAChB,iFAAgF,GACjFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGC,0BAAa,CAACC,UAAU,GACjCD,0BAAa,CAACC,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CAAC,CACF;AAAC,eAESK,IAAI;AAAA"}
|
|
@@ -9,8 +9,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
9
9
|
/*
|
|
10
10
|
createAccount: This function takes a seed argument, which is used to create an account. The seed must start with "/". The function returns a promise of an object that contains the seed and the account that was created.
|
|
11
11
|
*/
|
|
12
|
-
const createAccount =
|
|
13
|
-
) => {
|
|
12
|
+
const createAccount = seed => {
|
|
14
13
|
console.log('createAccount in react-native started', seed);
|
|
15
14
|
let res = _fulaNativeModule.default.createAccount(seed).then(res => {
|
|
16
15
|
try {
|
|
@@ -76,8 +75,8 @@ const createPool = (seed, poolName) => {
|
|
|
76
75
|
};
|
|
77
76
|
|
|
78
77
|
/*
|
|
79
|
-
listPools: This function takes no arguments and returns a promise of an object that contains a list of pools. Each pool in the list contains the poolID, owner, poolName, parent, and participants of the pool
|
|
80
|
-
*/
|
|
78
|
+
listPools: This function takes no arguments and returns a promise of an object that contains a list of pools. Each pool in the list contains the poolID, owner, poolName, parent, and participants of the pool
|
|
79
|
+
*/
|
|
81
80
|
exports.createPool = createPool;
|
|
82
81
|
const listPools = () => {
|
|
83
82
|
console.log('listPools in react-native started');
|
|
@@ -99,8 +98,8 @@ const listPools = () => {
|
|
|
99
98
|
};
|
|
100
99
|
|
|
101
100
|
/*
|
|
102
|
-
joinPool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is joining the pool, and the poolID is the ID of the pool the account is joining. The function returns a promise of an object that contains the account joining the pool and the poolID of the joined pool.
|
|
103
|
-
*/
|
|
101
|
+
joinPool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is joining the pool, and the poolID is the ID of the pool the account is joining. The function returns a promise of an object that contains the account joining the pool and the poolID of the joined pool.
|
|
102
|
+
*/
|
|
104
103
|
exports.listPools = listPools;
|
|
105
104
|
const joinPool = (seed, poolID) => {
|
|
106
105
|
console.log('joinPool in react-native started', seed, poolID);
|
|
@@ -122,8 +121,8 @@ const joinPool = (seed, poolID) => {
|
|
|
122
121
|
};
|
|
123
122
|
|
|
124
123
|
/*
|
|
125
|
-
leavePool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is leaving the pool, and the poolID is the ID of the pool the account is leaving. The function returns a promise of an object that contains the `
|
|
126
|
-
*/
|
|
124
|
+
leavePool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is leaving the pool, and the poolID is the ID of the pool the account is leaving. The function returns a promise of an object that contains the `
|
|
125
|
+
*/
|
|
127
126
|
exports.joinPool = joinPool;
|
|
128
127
|
const leavePool = (seed, poolID) => {
|
|
129
128
|
console.log('leavePool in react-native started', seed, poolID);
|
|
@@ -183,7 +182,7 @@ const listPoolJoinRequests = poolID => {
|
|
|
183
182
|
};
|
|
184
183
|
|
|
185
184
|
/*
|
|
186
|
-
seed is used to authorize the request.
|
|
185
|
+
seed is used to authorize the request.
|
|
187
186
|
poolID is the ID of the pool in which the account is requesting to join.
|
|
188
187
|
account is the account that is requesting to join the pool.
|
|
189
188
|
accept is a boolean value that indicates whether to accept or reject the join request.
|
|
@@ -211,12 +210,13 @@ const votePoolJoinRequest = (seed, poolID, account, accept) => {
|
|
|
211
210
|
|
|
212
211
|
/*
|
|
213
212
|
It takes four arguments:
|
|
213
|
+
|
|
214
214
|
seed is used to authorize the request.
|
|
215
215
|
poolID is the ID of the pool in which the replication request is made.
|
|
216
216
|
replicationFactor is the number of copies of the content to be stored.
|
|
217
217
|
cid is the content identifier of the content to be replicated.
|
|
218
218
|
It returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID
|
|
219
|
-
*/
|
|
219
|
+
*/
|
|
220
220
|
exports.votePoolJoinRequest = votePoolJoinRequest;
|
|
221
221
|
const newReplicationRequest = (seed, poolID, replicationFactor, cid) => {
|
|
222
222
|
console.log('newReplicationRequest in react-native started', seed, poolID, replicationFactor, cid);
|
|
@@ -379,8 +379,8 @@ const removeStoredReplication = (seed, uploader, poolID, cid) => {
|
|
|
379
379
|
};
|
|
380
380
|
|
|
381
381
|
/*
|
|
382
|
-
bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.
|
|
383
|
-
*/
|
|
382
|
+
bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.
|
|
383
|
+
*/
|
|
384
384
|
exports.removeStoredReplication = removeStoredReplication;
|
|
385
385
|
const bloxFreeSpace = () => {
|
|
386
386
|
console.log('bloxFreeSpace in react-native started');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAccount","seed","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","checkAccountExists","account","createPool","poolName","listPools","joinPool","poolID","leavePool","cancelPoolJoin","listPoolJoinRequests","votePoolJoinRequest","accept","newReplicationRequest","replicationFactor","cid","newStoreRequest","uploader","listAvailableReplicationRequests","removeReplicationRequest","removeStorer","storer","removeStoredReplication","bloxFreeSpace"],"sources":["blockchain.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\nimport type * as BType from '../types/blockchain';\r\n\r\n/*\r\ncreateAccount: This function takes a seed argument, which is used to create an account. The seed must start with \"/\". The function returns a promise of an object that contains the seed and the account that was created.\r\n*/\r\nexport const createAccount = (\r\n seed: string, //seed that is used to create the account. It must start with \"/\"\r\n): Promise<BType.SeededResponse> => {\r\n console.log(\r\n 'createAccount in react-native started',\r\n seed\r\n );\r\n let res = Fula.createAccount(seed).then((res) => {\r\n try{\r\n let jsonRes:BType.SeededResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res)\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\ncheckAccountExists: This function takes an account argument, and returns a promise of an object that contains the account and a boolean exists flag. If exists is true, it means the account exists, otherwise, the account does not exist\r\n*/\r\nexport const checkAccountExists = (\r\n account: string,\r\n): Promise<BType.AccountExistsResponse> => {\r\n console.log(\r\n 'checkAccountExists in react-native started',\r\n account\r\n );\r\n let res = Fula.checkAccountExists(account).then((res) => {\r\n try{\r\n let jsonRes: BType.AccountExistsResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res)\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\ncreatePool: This function takes two arguments: seed and poolName. The seed is used to identify the account that is creating the pool, and the poolName is the name of the pool being created. The function returns a promise of an object that contains the owner of the pool and the poolID of the created pool.\r\n*/\r\nexport const createPool = (seed: string, poolName: string): Promise<BType.PoolCreateResponse> => {\r\n console.log(\r\n 'createPool in react-native started',\r\n seed,\r\n poolName\r\n );\r\n let res = Fula.createPool(seed, poolName).then((res) => {\r\n try {\r\n let jsonRes: BType.PoolCreateResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n \r\n /*\r\n listPools: This function takes no arguments and returns a promise of an object that contains a list of pools. Each pool in the list contains the poolID, owner, poolName, parent, and participants of the pool\r\n */\r\n export const listPools = (): Promise<BType.PoolListResponse> => {\r\n console.log(\r\n 'listPools in react-native started'\r\n );\r\n let res = Fula.listPools().then((res) => {\r\n try {\r\n let jsonRes: BType.PoolListResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n\r\n /*\r\n joinPool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is joining the pool, and the poolID is the ID of the pool the account is joining. The function returns a promise of an object that contains the account joining the pool and the poolID of the joined pool.\r\n */\r\n\r\n export const joinPool = (seed: string, poolID: number): Promise<BType.PoolJoinResponse> => {\r\n console.log(\r\n 'joinPool in react-native started',\r\n seed,\r\n poolID\r\n );\r\n let res = Fula.joinPool(seed, poolID).then((res) => {\r\n try {\r\n let jsonRes: BType.PoolJoinResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n\r\n /*\r\n leavePool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is leaving the pool, and the poolID is the ID of the pool the account is leaving. The function returns a promise of an object that contains the `\r\n */\r\n \r\n export const leavePool = (seed: string, poolID: number): Promise<BType.PoolLeaveResponse> => {\r\n console.log(\r\n 'leavePool in react-native started',\r\n seed,\r\n poolID\r\n );\r\n let res = Fula.leavePool(seed, poolID).then((res) => {\r\n try {\r\n let jsonRes: BType.PoolLeaveResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n\r\n export const cancelPoolJoin = (seed: string, poolID: number): Promise<BType.PoolCancelJoinResponse> => {\r\n console.log(\r\n 'cancelPoolJoin in react-native started',\r\n seed,\r\n poolID\r\n );\r\n let res = Fula.cancelPoolJoin(seed, poolID).then((res) => {\r\n try {\r\n let jsonRes: BType.PoolCancelJoinResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n export const listPoolJoinRequests = (poolID: number): Promise<BType.PoolRequestsResponse> => {\r\n console.log(\r\n 'listPoolJoinRequests in react-native started',\r\n poolID\r\n );\r\n let res = Fula.listPoolJoinRequests(poolID).then((res) => {\r\n try {\r\n let jsonRes: BType.PoolRequestsResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n\r\n /*\r\n seed is used to authorize the request.\r\npoolID is the ID of the pool in which the account is requesting to join.\r\naccount is the account that is requesting to join the pool.\r\naccept is a boolean value that indicates whether to accept or reject the join request.\r\nIt returns a promise of BType.PoolVoteResponse which includes the account and poolID\r\n*/\r\n export const votePoolJoinRequest = (seed: string, poolID: number, account: string, accept: boolean): Promise<BType.PoolVoteResponse> => {\r\n console.log(\r\n 'votePoolJoinRequest in react-native started',\r\n seed,\r\n poolID,\r\n account,\r\n accept\r\n );\r\n let res = Fula.votePoolJoinRequest(seed, poolID, account, accept).then((res) => {\r\n try {\r\n let jsonRes: BType.PoolVoteResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };\r\n \r\n\r\n /*\r\nIt takes four arguments:\r\n\r\nseed is used to authorize the request.\r\npoolID is the ID of the pool in which the replication request is made.\r\nreplicationFactor is the number of copies of the content to be stored.\r\ncid is the content identifier of the content to be replicated.\r\nIt returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID\r\n */\r\n export const newReplicationRequest = (seed: string, poolID: number, replicationFactor: number, cid: string): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'newReplicationRequest in react-native started',\r\n seed,\r\n poolID,\r\n replicationFactor,\r\n cid\r\n );\r\n let res = Fula.newReplicationRequest(seed, poolID, replicationFactor, cid).then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is used to authorize the request.\r\npoolID is the ID of the pool in which the replication request is made.\r\nuploader is the account of the user making the request\r\ncid is the content identifier of the content to be stored.\r\nIt returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const newStoreRequest = (seed: string, poolID: number, uploader: string, cid: string): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'newStoreRequest in react-native started',\r\n seed,\r\n poolID,\r\n uploader,\r\n cid\r\n );\r\n let res = Fula.newStoreRequest(seed, poolID, uploader, cid).then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n\r\n/*\r\nIt takes one argument:\r\n\r\npoolID is the ID of the pool for which the replication requests are listed\r\nIt returns a promise of BType.ManifestUploadResponse[] which is an array of the replication requests, including the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const listAvailableReplicationRequests = (poolID: number): Promise<BType.ManifestUploadResponse[]> => {\r\n console.log(\r\n 'listAvailableReplicationRequests in react-native started',\r\n poolID\r\n );\r\n let res = Fula.listAvailableReplicationRequests(poolID).then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse[] = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n\r\n/*\r\nIt takes three arguments:\r\n\r\nseed is the seed of the account that is removing the replication request\r\npoolID is the ID of the pool for which the replication request is being removed\r\ncid is the content ID of the replication request being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the removed replication request, including the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const removeReplicationRequest = (seed: string, poolID: number, cid: string): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeReplicationRequest in react-native started',\r\n seed,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeReplicationRequest(seed, poolID, cid).then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is the seed of the account that is removing the storer\r\nstorer is the address of the storer that is being removed\r\npoolID is the ID of the pool for which the storer is being removed\r\ncid is the content ID of the replication request for which the storer is being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the replication request, including the uploader, storage, ManifestMetadata, and poolID after the storer has been removed.\r\n*/\r\nexport const removeStorer = (seed: string, storer: string, poolID: number, cid: string): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeStorer in react-native started',\r\n seed,\r\n storer,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeStorer(seed, storer, poolID, cid).then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is the seed of the account that is removing the stored replication\r\nuploader is the address of the uploader that is being removed\r\npoolID is the ID of the pool for which the stored replication is being removed\r\ncid is the content ID of the replication request for which the stored replication is being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the replication request, including the uploader, storage, ManifestMetadata, and poolID after the stored replication has been removed.\r\n*/\r\nexport const removeStoredReplication = (seed: string, uploader: string, poolID: number, cid: string): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeStoredReplication in react-native started',\r\n seed,\r\n uploader,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeStoredReplication(seed, uploader, poolID, cid).then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n /*\r\n bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.\r\n */\r\n export const bloxFreeSpace = (): Promise<BType.BloxFreeSpaceResponse> => {\r\n console.log(\r\n 'bloxFreeSpace in react-native started'\r\n );\r\n let res = Fula.bloxFreeSpace().then((res) => {\r\n try {\r\n let jsonRes: BType.BloxFreeSpaceResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n }).catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n };"],"mappings":";;;;;;AAAA;AAAkD;AAGlD;AACA;AACA;AACO,MAAMA,aAAa,GAAG,CAC3BC,IAAY,CAAE;AAAA,KACoB;EAClCC,OAAO,CAACC,GAAG,CACT,uCAAuC,EACvCF,IAAI,CACL;EACD,IAAIG,GAAG,GAAGC,yBAAI,CAACL,aAAa,CAACC,IAAI,CAAC,CAACK,IAAI,CAAEF,GAAG,IAAK;IAC/C,IAAG;MACD,IAAIG,OAA4B,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MAClD,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CAACO,KAAK,CAAEC,GAAG,IAAK;IAChB,OAAOA,GAAG;EACZ,CAAC,CAAC;EACF,OAAOR,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AAFA;AAGO,MAAMS,kBAAkB,GAC7BC,OAAe,IAC0B;EACzCZ,OAAO,CAACC,GAAG,CACT,4CAA4C,EAC5CW,OAAO,CACR;EACD,IAAIV,GAAG,GAAGC,yBAAI,CAACQ,kBAAkB,CAACC,OAAO,CAAC,CAACR,IAAI,CAAEF,GAAG,IAAK;IACvD,IAAG;MACD,IAAIG,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MAC1D,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GA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G,CAAC;MAC3D,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CAACO,KAAK,CAAEC,GAAG,IAAK;IAChB,OAAOA,GAAG;EACZ,CAAC,CAAC;EACF,OAAOR,GAAG;AACZ,CAAC;;AAEC;AACF;AACA;AAFE;AAGO,MAAM+B,aAAa,GAAG,MAA4C;EACvEjC,OAAO,CAACC,GAAG,CACX,uCAAuC,CACtC;EACD,IAAIC,GAAG,GAAGC,yBAAI,CAAC8B,aAAa,EAAE,CAAC7B,IAAI,CAAEF,GAAG,IAAK;IAC7C,IAAI;MACJ,IAAIG,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MAC1D,OAAOG,OAAO;IACd,CAAC,CAAC,OAAOG,CAAC,EAAE;MACZ,IAAI;QACJ,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACtB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACZ,OAAON,GAAG;MACV;IACA;EACA,CAAC,CAAC,CAACO,KAAK,CAAEC,GAAG,IAAK;IAClB,OAAOA,GAAG;EACV,CAAC,CAAC;EACF,OAAOR,GAAG;AACV,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["createAccount","seed","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","checkAccountExists","account","createPool","poolName","listPools","joinPool","poolID","leavePool","cancelPoolJoin","listPoolJoinRequests","votePoolJoinRequest","accept","newReplicationRequest","replicationFactor","cid","newStoreRequest","uploader","listAvailableReplicationRequests","removeReplicationRequest","removeStorer","storer","removeStoredReplication","bloxFreeSpace"],"sources":["blockchain.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\nimport type * as BType from '../types/blockchain';\r\n\r\n/*\r\ncreateAccount: This function takes a seed argument, which is used to create an account. The seed must start with \"/\". The function returns a promise of an object that contains the seed and the account that was created.\r\n*/\r\nexport const createAccount = (\r\n seed: string //seed that is used to create the account. It must start with \"/\"\r\n): Promise<BType.SeededResponse> => {\r\n console.log('createAccount in react-native started', seed);\r\n let res = Fula.createAccount(seed)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.SeededResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\ncheckAccountExists: This function takes an account argument, and returns a promise of an object that contains the account and a boolean exists flag. If exists is true, it means the account exists, otherwise, the account does not exist\r\n*/\r\nexport const checkAccountExists = (\r\n account: string\r\n): Promise<BType.AccountExistsResponse> => {\r\n console.log('checkAccountExists in react-native started', account);\r\n let res = Fula.checkAccountExists(account)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.AccountExistsResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\ncreatePool: This function takes two arguments: seed and poolName. The seed is used to identify the account that is creating the pool, and the poolName is the name of the pool being created. The function returns a promise of an object that contains the owner of the pool and the poolID of the created pool.\r\n*/\r\nexport const createPool = (\r\n seed: string,\r\n poolName: string\r\n): Promise<BType.PoolCreateResponse> => {\r\n console.log('createPool in react-native started', seed, poolName);\r\n let res = Fula.createPool(seed, poolName)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolCreateResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n listPools: This function takes no arguments and returns a promise of an object that contains a list of pools. Each pool in the list contains the poolID, owner, poolName, parent, and participants of the pool\r\n */\r\nexport const listPools = (): Promise<BType.PoolListResponse> => {\r\n console.log('listPools in react-native started');\r\n let res = Fula.listPools()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolListResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n joinPool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is joining the pool, and the poolID is the ID of the pool the account is joining. The function returns a promise of an object that contains the account joining the pool and the poolID of the joined pool.\r\n */\r\n\r\nexport const joinPool = (\r\n seed: string,\r\n poolID: number\r\n): Promise<BType.PoolJoinResponse> => {\r\n console.log('joinPool in react-native started', seed, poolID);\r\n let res = Fula.joinPool(seed, poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolJoinResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n leavePool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is leaving the pool, and the poolID is the ID of the pool the account is leaving. The function returns a promise of an object that contains the `\r\n */\r\n\r\nexport const leavePool = (\r\n seed: string,\r\n poolID: number\r\n): Promise<BType.PoolLeaveResponse> => {\r\n console.log('leavePool in react-native started', seed, poolID);\r\n let res = Fula.leavePool(seed, poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolLeaveResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\nexport const cancelPoolJoin = (\r\n seed: string,\r\n poolID: number\r\n): Promise<BType.PoolCancelJoinResponse> => {\r\n console.log('cancelPoolJoin in react-native started', seed, poolID);\r\n let res = Fula.cancelPoolJoin(seed, poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolCancelJoinResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\nexport const listPoolJoinRequests = (\r\n poolID: number\r\n): Promise<BType.PoolRequestsResponse> => {\r\n console.log('listPoolJoinRequests in react-native started', poolID);\r\n let res = Fula.listPoolJoinRequests(poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolRequestsResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n seed is used to authorize the request.\r\npoolID is the ID of the pool in which the account is requesting to join.\r\naccount is the account that is requesting to join the pool.\r\naccept is a boolean value that indicates whether to accept or reject the join request.\r\nIt returns a promise of BType.PoolVoteResponse which includes the account and poolID\r\n*/\r\nexport const votePoolJoinRequest = (\r\n seed: string,\r\n poolID: number,\r\n account: string,\r\n accept: boolean\r\n): Promise<BType.PoolVoteResponse> => {\r\n console.log(\r\n 'votePoolJoinRequest in react-native started',\r\n seed,\r\n poolID,\r\n account,\r\n accept\r\n );\r\n let res = Fula.votePoolJoinRequest(seed, poolID, account, accept)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolVoteResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is used to authorize the request.\r\npoolID is the ID of the pool in which the replication request is made.\r\nreplicationFactor is the number of copies of the content to be stored.\r\ncid is the content identifier of the content to be replicated.\r\nIt returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID\r\n */\r\nexport const newReplicationRequest = (\r\n seed: string,\r\n poolID: number,\r\n replicationFactor: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'newReplicationRequest in react-native started',\r\n seed,\r\n poolID,\r\n replicationFactor,\r\n cid\r\n );\r\n let res = Fula.newReplicationRequest(seed, poolID, replicationFactor, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is used to authorize the request.\r\npoolID is the ID of the pool in which the replication request is made.\r\nuploader is the account of the user making the request\r\ncid is the content identifier of the content to be stored.\r\nIt returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const newStoreRequest = (\r\n seed: string,\r\n poolID: number,\r\n uploader: string,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'newStoreRequest in react-native started',\r\n seed,\r\n poolID,\r\n uploader,\r\n cid\r\n );\r\n let res = Fula.newStoreRequest(seed, poolID, uploader, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes one argument:\r\n\r\npoolID is the ID of the pool for which the replication requests are listed\r\nIt returns a promise of BType.ManifestUploadResponse[] which is an array of the replication requests, including the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const listAvailableReplicationRequests = (\r\n poolID: number\r\n): Promise<BType.ManifestUploadResponse[]> => {\r\n console.log(\r\n 'listAvailableReplicationRequests in react-native started',\r\n poolID\r\n );\r\n let res = Fula.listAvailableReplicationRequests(poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse[] = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes three arguments:\r\n\r\nseed is the seed of the account that is removing the replication request\r\npoolID is the ID of the pool for which the replication request is being removed\r\ncid is the content ID of the replication request being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the removed replication request, including the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const removeReplicationRequest = (\r\n seed: string,\r\n poolID: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeReplicationRequest in react-native started',\r\n seed,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeReplicationRequest(seed, poolID, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is the seed of the account that is removing the storer\r\nstorer is the address of the storer that is being removed\r\npoolID is the ID of the pool for which the storer is being removed\r\ncid is the content ID of the replication request for which the storer is being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the replication request, including the uploader, storage, ManifestMetadata, and poolID after the storer has been removed.\r\n*/\r\nexport const removeStorer = (\r\n seed: string,\r\n storer: string,\r\n poolID: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeStorer in react-native started',\r\n seed,\r\n storer,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeStorer(seed, storer, poolID, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is the seed of the account that is removing the stored replication\r\nuploader is the address of the uploader that is being removed\r\npoolID is the ID of the pool for which the stored replication is being removed\r\ncid is the content ID of the replication request for which the stored replication is being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the replication request, including the uploader, storage, ManifestMetadata, and poolID after the stored replication has been removed.\r\n*/\r\nexport const removeStoredReplication = (\r\n seed: string,\r\n uploader: string,\r\n poolID: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeStoredReplication in react-native started',\r\n seed,\r\n uploader,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeStoredReplication(seed, uploader, poolID, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.\r\n */\r\nexport const bloxFreeSpace = (): Promise<BType.BloxFreeSpaceResponse> => {\r\n console.log('bloxFreeSpace in react-native started');\r\n let res = Fula.bloxFreeSpace()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.BloxFreeSpaceResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n"],"mappings":";;;;;;AAAA;AAAkD;AAGlD;AACA;AACA;AACO,MAAMA,aAAa,GACxBC,IAAY,IACsB;EAClCC,OAAO,CAACC,GAAG,CAAC,uCAAuC,EAAEF,IAAI,CAAC;EAC1D,IAAIG,GAAG,GAAGC,yBAAI,CAACL,aAAa,CAACC,IAAI,CAAC,CAC/BK,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACnD,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AAFA;AAGO,MAAMS,kBAAkB,GAC7BC,OAAe,IAC0B;EACzCZ,OAAO,CAACC,GAAG,CAAC,4CAA4C,EAAEW,OAAO,CAAC;EAClE,IAAIV,GAAG,GAAGC,yBAAI,CAACQ,kBAAkB,CAACC,OAAO,CAAC,CACvCR,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MAC1D,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC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