@functionland/react-native-fula 1.8.0 → 1.9.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.
Files changed (40) hide show
  1. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  3. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/7.6/checksums/checksums.lock +0 -0
  5. package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
  6. package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
  7. package/android/.gradle/7.6/executionHistory/executionHistory.bin +0 -0
  8. package/android/.gradle/7.6/executionHistory/executionHistory.lock +0 -0
  9. package/android/.gradle/7.6/fileHashes/fileHashes.bin +0 -0
  10. package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
  11. package/android/.gradle/7.6/fileHashes/resourceHashesCache.bin +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  14. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  15. package/android/.gradle/file-system.probe +0 -0
  16. package/android/build.gradle +69 -69
  17. package/android/src/main/java/land/fx/fula/FulaModule.java +1384 -1368
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
  20. package/lib/commonjs/protocols/blockchain.js +12 -12
  21. package/lib/commonjs/protocols/blockchain.js.map +1 -1
  22. package/lib/commonjs/protocols/fxblox.js +23 -4
  23. package/lib/commonjs/protocols/fxblox.js.map +1 -1
  24. package/lib/commonjs/types/fxblox.js.map +1 -1
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
  27. package/lib/module/protocols/blockchain.js +12 -12
  28. package/lib/module/protocols/blockchain.js.map +1 -1
  29. package/lib/module/protocols/fxblox.js +21 -3
  30. package/lib/module/protocols/fxblox.js.map +1 -1
  31. package/lib/module/types/fxblox.js.map +1 -1
  32. package/lib/typescript/interfaces/fulaNativeModule.d.ts +1 -0
  33. package/lib/typescript/protocols/fxblox.d.ts +1 -0
  34. package/lib/typescript/types/fxblox.d.ts +4 -0
  35. package/package.json +157 -157
  36. package/src/index.tsx +4 -4
  37. package/src/interfaces/fulaNativeModule.ts +119 -87
  38. package/src/protocols/blockchain.ts +318 -274
  39. package/src/protocols/fxblox.ts +49 -28
  40. package/src/types/fxblox.ts +8 -4
@@ -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 ) => 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 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//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: (seed: string, poolID: number, account: string, accept: boolean) => Promise<string>;\n newReplicationRequest: (seed: string, poolID: number, replicationFactor: number, cid: string) => Promise<string>;\n newStoreRequest: (seed: string, poolID: number, uploader: string, cid: string) => Promise<string>;\n listAvailableReplicationRequests: (poolID: number) => Promise<string>;\n removeReplicationRequest: (seed: string, poolID: number, cid: string) => Promise<string>;\n removeStorer: (seed: string, storer: string, poolID: number, cid: string) => Promise<string>;\n removeStoredReplication: (seed: string, uploader: string, poolID: number, cid: string) => Promise<string>;\n bloxFreeSpace: () => Promise<string>;\n wifiRemoveall: () => 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;AAqEA,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"}
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';\r\n\r\ninterface FulaNativeModule {\r\n init: (\r\n identity: string, //Private key of did identity\r\n storePath: string, //You can leave empty\r\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\r\n exchange: string, //set to 'noope' for testing\r\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\r\n rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem\r\n useRelay: boolean | null, // if true it forces the use of relay\r\n refresh: boolean // if true it forces to refresh the fula object\r\n ) => Promise<{ peerId: string; rootCid: string; private_ref: string }>;\r\n newClient: (\r\n identity: string, //Private key of did identity\r\n storePath: string, //You can leave empty\r\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\r\n exchange: string, //set to 'noope' for testing\r\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\r\n useRelay: boolean | null, // if true it forces the use of relay\r\n refresh: boolean // if true it forces to refresh the fula object\r\n ) => Promise<string>;\r\n isReady: (filesystemCheck: boolean) => Promise<boolean>;\r\n logout: (identity: string, storePath: string) => Promise<boolean>;\r\n checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;\r\n checkConnection: (timeout: number) => Promise<boolean>;\r\n get: (key: string) => Promise<string>;\r\n has: (key: Uint8Array) => Promise<boolean>;\r\n push: () => Promise<string>;\r\n put: (content: string, codec: string) => Promise<string>;\r\n mkdir: (path: string) => Promise<string>;\r\n writeFileContent: (path: string, content: string) => Promise<string>;\r\n writeFile: (\r\n fulaTargetFilename: string,\r\n localFilename: string\r\n ) => Promise<string>;\r\n ls: (path: string) => Promise<string>;\r\n rm: (path: string) => Promise<string>;\r\n cp: (sourcePath: string, targetPath: string) => Promise<string>;\r\n mv: (sourcePath: string, targetPath: string) => Promise<string>;\r\n readFile: (\r\n fulaTargetFilename: string,\r\n localFilename: string\r\n ) => Promise<string>;\r\n readFileContent: (path: string) => Promise<string>;\r\n setAuth: (peerId: string, allow: boolean) => Promise<boolean>;\r\n\r\n shutdown: () => Promise<void>;\r\n\r\n //Blockchain related functions\r\n createAccount: (seed: string) => Promise<string>;\r\n checkAccountExists: (account: string) => Promise<string>;\r\n createPool: (seed: string, poolName: string) => Promise<string>;\r\n listPools: () => Promise<string>;\r\n joinPool: (seed: string, poolID: number) => Promise<string>;\r\n leavePool: (seed: string, poolID: number) => Promise<string>;\r\n cancelPoolJoin: (seed: string, poolID: number) => Promise<string>;\r\n listPoolJoinRequests: (poolID: number) => Promise<string>;\r\n votePoolJoinRequest: (\r\n seed: string,\r\n poolID: number,\r\n account: string,\r\n accept: boolean\r\n ) => Promise<string>;\r\n newReplicationRequest: (\r\n seed: string,\r\n poolID: number,\r\n replicationFactor: number,\r\n cid: string\r\n ) => Promise<string>;\r\n newStoreRequest: (\r\n seed: string,\r\n poolID: number,\r\n uploader: string,\r\n cid: string\r\n ) => Promise<string>;\r\n listAvailableReplicationRequests: (poolID: number) => Promise<string>;\r\n removeReplicationRequest: (\r\n seed: string,\r\n poolID: number,\r\n cid: string\r\n ) => Promise<string>;\r\n removeStorer: (\r\n seed: string,\r\n storer: string,\r\n poolID: number,\r\n cid: string\r\n ) => Promise<string>;\r\n removeStoredReplication: (\r\n seed: string,\r\n uploader: string,\r\n poolID: number,\r\n cid: string\r\n ) => Promise<string>;\r\n\r\n //Hardware\r\n bloxFreeSpace: () => Promise<string>;\r\n wifiRemoveall: () => Promise<string>;\r\n reboot: () => Promise<string>;\r\n}\r\n\r\nconst LINKING_ERROR =\r\n `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\r\n '- You rebuilt the app after installing the package\\n' +\r\n '- You are not using Expo managed workflow\\n';\r\n\r\nconst Fula = NativeModules.FulaModule\r\n ? NativeModules.FulaModule\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n }\r\n );\r\n\r\nexport default Fula as FulaNativeModule;\r\n"],"mappings":";;;;;;AAAA;AAqGA,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 = (seed //seed that is used to create the account. It must start with "/"
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,C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ACL,GAAG,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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AI,CAACC,KAAK,CAACL,GAAG,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,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AAFA;AAGO,MAAM+B,aAAa,GAAG,MAA4C;EACvEjC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGC,yBAAI,CAAC8B,aAAa,EAAE,CAC3B7B,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,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;AAAC"}
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.wifiRemoveall = void 0;
6
+ exports.wifiRemoveall = exports.reboot = void 0;
7
7
  var _fulaNativeModule = _interopRequireDefault(require("../interfaces/fulaNativeModule"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- /**
10
- * send a command to Blox hardware to remove all save wifis.
11
- * @returns json{status:true if success, false if fails; msg: error message or success log}
9
+ /**
10
+ * send a command to Blox hardware to remove all save wifis.
11
+ * @returns json{status:true if success, false if fails; msg: error message or success log}
12
12
  */
13
13
 
14
14
  const wifiRemoveall = () => {
@@ -30,4 +30,23 @@ const wifiRemoveall = () => {
30
30
  return res;
31
31
  };
32
32
  exports.wifiRemoveall = wifiRemoveall;
33
+ const reboot = () => {
34
+ console.log('reboot in react-native started');
35
+ let res = _fulaNativeModule.default.reboot().then(res => {
36
+ try {
37
+ let jsonRes = JSON.parse(res);
38
+ return jsonRes;
39
+ } catch (e) {
40
+ try {
41
+ return JSON.parse(res);
42
+ } catch (e) {
43
+ return res;
44
+ }
45
+ }
46
+ }).catch(err => {
47
+ return err;
48
+ });
49
+ return res;
50
+ };
51
+ exports.reboot = reboot;
33
52
  //# sourceMappingURL=fxblox.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["wifiRemoveall","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err"],"sources":["fxblox.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\nimport type * as BType from '../types/fxblox';\n\n/**\n * send a command to Blox hardware to remove all save wifis.\n * @returns json{status:true if success, false if fails; msg: error message or success log}\n */\n\nexport const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {\n console.log(\n 'wifiRemoveall in react-native started'\n );\n let res = Fula.wifiRemoveall().then((res) => {\n try {\n let jsonRes: BType.wifiRemoveallResponse = JSON.parse(res);\n return jsonRes;\n } catch (e) {\n try {\n return JSON.parse(res);\n } catch (e) {\n return res;\n }\n }\n }).catch((err) => {\n return err;\n });\n return res;\n };\n"],"mappings":";;;;;;AAAA;AAAkD;AAGlD;AACA;AACA;AACA;;AAEO,MAAMA,aAAa,GAAG,MAA4C;EACvEC,OAAO,CAACC,GAAG,CACX,uCAAuC,CACtC;EACD,IAAIC,GAAG,GAAGC,yBAAI,CAACJ,aAAa,EAAE,CAACK,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":["wifiRemoveall","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","reboot"],"sources":["fxblox.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\nimport type * as BType from '../types/fxblox';\r\n\r\n/**\r\n * send a command to Blox hardware to remove all save wifis.\r\n * @returns json{status:true if success, false if fails; msg: error message or success log}\r\n */\r\n\r\nexport const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {\r\n console.log('wifiRemoveall in react-native started');\r\n let res = Fula.wifiRemoveall()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.wifiRemoveallResponse = 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 reboot = (): Promise<BType.rebootResponse> => {\r\n console.log('reboot in react-native started');\r\n let res = Fula.reboot()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.rebootResponse = 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;AACA;;AAEO,MAAMA,aAAa,GAAG,MAA4C;EACvEC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGC,yBAAI,CAACJ,aAAa,EAAE,CAC3BK,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,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;AAAC;AAEK,MAAMS,MAAM,GAAG,MAAqC;EACzDX,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC7C,IAAIC,GAAG,GAAGC,yBAAI,CAACQ,MAAM,EAAE,CACpBP,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;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["fxblox.ts"],"sourcesContent":["export interface wifiRemoveallResponse {\n status: boolean;\n msg: string;\n }\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["fxblox.ts"],"sourcesContent":["export interface wifiRemoveallResponse {\r\n status: boolean;\r\n msg: string;\r\n}\r\nexport interface rebootResponse {\r\n status: boolean;\r\n msg: string;\r\n}\r\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":["fula","blockchain","chainApi","fxblox"],"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":"uBAAsB,kBAAkB;AAAA,kBAA5BA,IAAI;AAAA,6BACY,wBAAwB;AAAA,wBAAxCC,UAAU;AAAA,2BACI,uBAAuB;AAAA,sBAArCC,QAAQ;AAAA,yBACI,oBAAoB;AAAA,oBAAhCC,MAAM"}
1
+ {"version":3,"names":["fula","blockchain","chainApi","fxblox"],"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":"uBAAsB,kBAAkB;AAAA,kBAA5BA,IAAI;AAAA,6BACY,wBAAwB;AAAA,wBAAxCC,UAAU;AAAA,2BACI,uBAAuB;AAAA,sBAArCC,QAAQ;AAAA,yBACI,oBAAoB;AAAA,oBAAhCC,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Fula","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 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//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: (seed: string, poolID: number, account: string, accept: boolean) => Promise<string>;\n newReplicationRequest: (seed: string, poolID: number, replicationFactor: number, cid: string) => Promise<string>;\n newStoreRequest: (seed: string, poolID: number, uploader: string, cid: string) => Promise<string>;\n listAvailableReplicationRequests: (poolID: number) => Promise<string>;\n removeReplicationRequest: (seed: string, poolID: number, cid: string) => Promise<string>;\n removeStorer: (seed: string, storer: string, poolID: number, cid: string) => Promise<string>;\n removeStoredReplication: (seed: string, uploader: string, poolID: number, cid: string) => Promise<string>;\n bloxFreeSpace: () => Promise<string>;\n wifiRemoveall: () => 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,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAqEtD,MAAMC,aAAa,GAChB,iFAAgF,GACjFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGN,aAAa,CAACO,UAAU,GACjCP,aAAa,CAACO,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CAAC,CACF;AAEL,eAAeI,IAAI"}
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Fula","FulaModule","Proxy","get","Error"],"sources":["fulaNativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\r\n\r\ninterface FulaNativeModule {\r\n init: (\r\n identity: string, //Private key of did identity\r\n storePath: string, //You can leave empty\r\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\r\n exchange: string, //set to 'noope' for testing\r\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\r\n rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem\r\n useRelay: boolean | null, // if true it forces the use of relay\r\n refresh: boolean // if true it forces to refresh the fula object\r\n ) => Promise<{ peerId: string; rootCid: string; private_ref: string }>;\r\n newClient: (\r\n identity: string, //Private key of did identity\r\n storePath: string, //You can leave empty\r\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\r\n exchange: string, //set to 'noope' for testing\r\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\r\n useRelay: boolean | null, // if true it forces the use of relay\r\n refresh: boolean // if true it forces to refresh the fula object\r\n ) => Promise<string>;\r\n isReady: (filesystemCheck: boolean) => Promise<boolean>;\r\n logout: (identity: string, storePath: string) => Promise<boolean>;\r\n checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;\r\n checkConnection: (timeout: number) => Promise<boolean>;\r\n get: (key: string) => Promise<string>;\r\n has: (key: Uint8Array) => Promise<boolean>;\r\n push: () => Promise<string>;\r\n put: (content: string, codec: string) => Promise<string>;\r\n mkdir: (path: string) => Promise<string>;\r\n writeFileContent: (path: string, content: string) => Promise<string>;\r\n writeFile: (\r\n fulaTargetFilename: string,\r\n localFilename: string\r\n ) => Promise<string>;\r\n ls: (path: string) => Promise<string>;\r\n rm: (path: string) => Promise<string>;\r\n cp: (sourcePath: string, targetPath: string) => Promise<string>;\r\n mv: (sourcePath: string, targetPath: string) => Promise<string>;\r\n readFile: (\r\n fulaTargetFilename: string,\r\n localFilename: string\r\n ) => Promise<string>;\r\n readFileContent: (path: string) => Promise<string>;\r\n setAuth: (peerId: string, allow: boolean) => Promise<boolean>;\r\n\r\n shutdown: () => Promise<void>;\r\n\r\n //Blockchain related functions\r\n createAccount: (seed: string) => Promise<string>;\r\n checkAccountExists: (account: string) => Promise<string>;\r\n createPool: (seed: string, poolName: string) => Promise<string>;\r\n listPools: () => Promise<string>;\r\n joinPool: (seed: string, poolID: number) => Promise<string>;\r\n leavePool: (seed: string, poolID: number) => Promise<string>;\r\n cancelPoolJoin: (seed: string, poolID: number) => Promise<string>;\r\n listPoolJoinRequests: (poolID: number) => Promise<string>;\r\n votePoolJoinRequest: (\r\n seed: string,\r\n poolID: number,\r\n account: string,\r\n accept: boolean\r\n ) => Promise<string>;\r\n newReplicationRequest: (\r\n seed: string,\r\n poolID: number,\r\n replicationFactor: number,\r\n cid: string\r\n ) => Promise<string>;\r\n newStoreRequest: (\r\n seed: string,\r\n poolID: number,\r\n uploader: string,\r\n cid: string\r\n ) => Promise<string>;\r\n listAvailableReplicationRequests: (poolID: number) => Promise<string>;\r\n removeReplicationRequest: (\r\n seed: string,\r\n poolID: number,\r\n cid: string\r\n ) => Promise<string>;\r\n removeStorer: (\r\n seed: string,\r\n storer: string,\r\n poolID: number,\r\n cid: string\r\n ) => Promise<string>;\r\n removeStoredReplication: (\r\n seed: string,\r\n uploader: string,\r\n poolID: number,\r\n cid: string\r\n ) => Promise<string>;\r\n\r\n //Hardware\r\n bloxFreeSpace: () => Promise<string>;\r\n wifiRemoveall: () => Promise<string>;\r\n reboot: () => Promise<string>;\r\n}\r\n\r\nconst LINKING_ERROR =\r\n `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\r\n '- You rebuilt the app after installing the package\\n' +\r\n '- You are not using Expo managed workflow\\n';\r\n\r\nconst Fula = NativeModules.FulaModule\r\n ? NativeModules.FulaModule\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n }\r\n );\r\n\r\nexport default Fula as FulaNativeModule;\r\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAqGtD,MAAMC,aAAa,GAChB,iFAAgF,GACjFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGN,aAAa,CAACO,UAAU,GACjCP,aAAa,CAACO,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CAAC,CACF;AAEL,eAAeI,IAAI"}
@@ -2,8 +2,7 @@ import Fula from '../interfaces/fulaNativeModule';
2
2
  /*
3
3
  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.
4
4
  */
5
- export const createAccount = (seed //seed that is used to create the account. It must start with "/"
6
- ) => {
5
+ export const createAccount = seed => {
7
6
  console.log('createAccount in react-native started', seed);
8
7
  let res = Fula.createAccount(seed).then(res => {
9
8
  try {
@@ -67,8 +66,8 @@ export const createPool = (seed, poolName) => {
67
66
  };
68
67
 
69
68
  /*
70
- 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
71
- */
69
+ 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
70
+ */
72
71
  export const listPools = () => {
73
72
  console.log('listPools in react-native started');
74
73
  let res = Fula.listPools().then(res => {
@@ -89,8 +88,8 @@ export const listPools = () => {
89
88
  };
90
89
 
91
90
  /*
92
- 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.
93
- */
91
+ 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.
92
+ */
94
93
 
95
94
  export const joinPool = (seed, poolID) => {
96
95
  console.log('joinPool in react-native started', seed, poolID);
@@ -112,8 +111,8 @@ export const joinPool = (seed, poolID) => {
112
111
  };
113
112
 
114
113
  /*
115
- 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 `
116
- */
114
+ 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 `
115
+ */
117
116
 
118
117
  export const leavePool = (seed, poolID) => {
119
118
  console.log('leavePool in react-native started', seed, poolID);
@@ -171,7 +170,7 @@ export const listPoolJoinRequests = poolID => {
171
170
  };
172
171
 
173
172
  /*
174
- seed is used to authorize the request.
173
+ seed is used to authorize the request.
175
174
  poolID is the ID of the pool in which the account is requesting to join.
176
175
  account is the account that is requesting to join the pool.
177
176
  accept is a boolean value that indicates whether to accept or reject the join request.
@@ -198,12 +197,13 @@ export const votePoolJoinRequest = (seed, poolID, account, accept) => {
198
197
 
199
198
  /*
200
199
  It takes four arguments:
200
+
201
201
  seed is used to authorize the request.
202
202
  poolID is the ID of the pool in which the replication request is made.
203
203
  replicationFactor is the number of copies of the content to be stored.
204
204
  cid is the content identifier of the content to be replicated.
205
205
  It returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID
206
- */
206
+ */
207
207
  export const newReplicationRequest = (seed, poolID, replicationFactor, cid) => {
208
208
  console.log('newReplicationRequest in react-native started', seed, poolID, replicationFactor, cid);
209
209
  let res = Fula.newReplicationRequest(seed, poolID, replicationFactor, cid).then(res => {
@@ -360,8 +360,8 @@ export const removeStoredReplication = (seed, uploader, poolID, cid) => {
360
360
  };
361
361
 
362
362
  /*
363
- bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.
364
- */
363
+ bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.
364
+ */
365
365
  export const bloxFreeSpace = () => {
366
366
  console.log('bloxFreeSpace in react-native started');
367
367
  let res = Fula.bloxFreeSpace().then(res => {
@@ -1 +1 @@
1
- {"version":3,"names":["Fula","createAccount","seed","console","log","res","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,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,CAC3BC,IAAY,CAAE;AAAA,KACoB;EAClCC,OAAO,CAACC,GAAG,CACT,uCAAuC,EACvCF,IAAI,CACL;EACD,IAAIG,GAAG,GAAGL,IAAI,CAACC,aAAa,CAACC,IAAI,CAAC,CAACI,IAAI,CAAED,GAAG,IAAK;IAC/C,IAAG;MACD,IAAIE,OAA4B,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAClD,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CAACM,KAAK,CAAEC,GAAG,IAAK;IAChB,OAAOA,GAAG;EACZ,CAAC,CAAC;EACF,OAAOP,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMQ,kBAAkB,GAC7BC,OAAe,IAC0B;EACzCX,OAAO,CAACC,GAAG,CACT,4CAA4C,EAC5CU,OAAO,CACR;EACD,IAAIT,GAAG,GAAGL,IAAI,CAACa,kBAAkB,CAACC,OAAO,CAAC,CAACR,IAAI,CAAED,GAAG,IAAK;IACvD,IAAG;MACD,IAAIE,OAAoC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AAChC,IAAI,EAAE2B,QAAQ,EAAEV,MAAM,EAAEQ,GAAG,CAAC,CAACrB,IAAI,CAAED,GAAG,IAAK;IAChF,IAAI;MACF,IAAIE,OAAqC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC3D,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CAACM,KAAK,CAAEC,GAAG,IAAK;IAChB,OAAOA,GAAG;EACZ,CAAC,CAAC;EACF,OAAOP,GAAG;AACZ,CAAC;;AAEC;AACF;AACA;AACE,OAAO,MAAM8B,aAAa,GAAG,MAA4C;EACvEhC,OAAO,CAACC,GAAG,CACX,uCAAuC,CACtC;EACD,IAAIC,GAAG,GAAGL,IAAI,CAACmC,aAAa,EAAE,CAAC7B,IAAI,CAAED,GAAG,IAAK;IAC7C,IAAI;MACJ,IAAIE,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC1D,OAAOE,OAAO;IACd,CAAC,CAAC,OAAOG,CAAC,EAAE;MACZ,IAAI;QACJ,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACtB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACZ,OAAOL,GAAG;MACV;IACA;EACA,CAAC,CAAC,CAACM,KAAK,CAAEC,GAAG,IAAK;IAClB,OAAOA,GAAG;EACV,CAAC,CAAC;EACF,OAAOP,GAAG;AACV,CAAC"}
1
+ {"version":3,"names":["Fula","createAccount","seed","console","log","res","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,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACxBC,IAAY,IACsB;EAClCC,OAAO,CAACC,GAAG,CAAC,uCAAuC,EAAEF,IAAI,CAAC;EAC1D,IAAIG,GAAG,GAAGL,IAAI,CAACC,aAAa,CAACC,IAAI,CAAC,CAC/BI,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACnD,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMQ,kBAAkB,GAC7BC,OAAe,IAC0B;EACzCX,OAAO,CAACC,GAAG,CAAC,4CAA4C,EAAEU,OAAO,CAAC;EAClE,IAAIT,GAAG,GAAGL,IAAI,CAACa,kBAAkB,CAACC,OAAO,CAAC,CACvCR,IAAI,CAAED,GAAG,IAAK;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AG,GAAGL,IAAI,CAACkC,uBAAuB,CAAChC,IAAI,EAAE2B,QAAQ,EAAEV,MAAM,EAAEQ,GAAG,CAAC,CAChErB,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAAqC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC3D,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAM8B,aAAa,GAAG,MAA4C;EACvEhC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGL,IAAI,CAACmC,aAAa,EAAE,CAC3B7B,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC1D,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import Fula from '../interfaces/fulaNativeModule';
2
- /**
3
- * send a command to Blox hardware to remove all save wifis.
4
- * @returns json{status:true if success, false if fails; msg: error message or success log}
2
+ /**
3
+ * send a command to Blox hardware to remove all save wifis.
4
+ * @returns json{status:true if success, false if fails; msg: error message or success log}
5
5
  */
6
6
 
7
7
  export const wifiRemoveall = () => {
@@ -22,4 +22,22 @@ export const wifiRemoveall = () => {
22
22
  });
23
23
  return res;
24
24
  };
25
+ export const reboot = () => {
26
+ console.log('reboot in react-native started');
27
+ let res = Fula.reboot().then(res => {
28
+ try {
29
+ let jsonRes = JSON.parse(res);
30
+ return jsonRes;
31
+ } catch (e) {
32
+ try {
33
+ return JSON.parse(res);
34
+ } catch (e) {
35
+ return res;
36
+ }
37
+ }
38
+ }).catch(err => {
39
+ return err;
40
+ });
41
+ return res;
42
+ };
25
43
  //# sourceMappingURL=fxblox.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Fula","wifiRemoveall","console","log","res","then","jsonRes","JSON","parse","e","catch","err"],"sources":["fxblox.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\nimport type * as BType from '../types/fxblox';\n\n/**\n * send a command to Blox hardware to remove all save wifis.\n * @returns json{status:true if success, false if fails; msg: error message or success log}\n */\n\nexport const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {\n console.log(\n 'wifiRemoveall in react-native started'\n );\n let res = Fula.wifiRemoveall().then((res) => {\n try {\n let jsonRes: BType.wifiRemoveallResponse = JSON.parse(res);\n return jsonRes;\n } catch (e) {\n try {\n return JSON.parse(res);\n } catch (e) {\n return res;\n }\n }\n }).catch((err) => {\n return err;\n });\n return res;\n };\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAG,MAA4C;EACvEC,OAAO,CAACC,GAAG,CACX,uCAAuC,CACtC;EACD,IAAIC,GAAG,GAAGJ,IAAI,CAACC,aAAa,EAAE,CAACI,IAAI,CAAED,GAAG,IAAK;IAC7C,IAAI;MACJ,IAAIE,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC1D,OAAOE,OAAO;IACd,CAAC,CAAC,OAAOG,CAAC,EAAE;MACZ,IAAI;QACJ,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACtB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACZ,OAAOL,GAAG;MACV;IACA;EACA,CAAC,CAAC,CAACM,KAAK,CAAEC,GAAG,IAAK;IAClB,OAAOA,GAAG;EACV,CAAC,CAAC;EACF,OAAOP,GAAG;AACV,CAAC"}
1
+ {"version":3,"names":["Fula","wifiRemoveall","console","log","res","then","jsonRes","JSON","parse","e","catch","err","reboot"],"sources":["fxblox.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\nimport type * as BType from '../types/fxblox';\r\n\r\n/**\r\n * send a command to Blox hardware to remove all save wifis.\r\n * @returns json{status:true if success, false if fails; msg: error message or success log}\r\n */\r\n\r\nexport const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {\r\n console.log('wifiRemoveall in react-native started');\r\n let res = Fula.wifiRemoveall()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.wifiRemoveallResponse = 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 reboot = (): Promise<BType.rebootResponse> => {\r\n console.log('reboot in react-native started');\r\n let res = Fula.reboot()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.rebootResponse = 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,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAG,MAA4C;EACvEC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGJ,IAAI,CAACC,aAAa,EAAE,CAC3BI,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC1D,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC;AAED,OAAO,MAAMQ,MAAM,GAAG,MAAqC;EACzDV,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC7C,IAAIC,GAAG,GAAGJ,IAAI,CAACY,MAAM,EAAE,CACpBP,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACnD,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["fxblox.ts"],"sourcesContent":["export interface wifiRemoveallResponse {\n status: boolean;\n msg: string;\n }\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["fxblox.ts"],"sourcesContent":["export interface wifiRemoveallResponse {\r\n status: boolean;\r\n msg: string;\r\n}\r\nexport interface rebootResponse {\r\n status: boolean;\r\n msg: string;\r\n}\r\n"],"mappings":""}
@@ -54,6 +54,7 @@ interface FulaNativeModule {
54
54
  removeStoredReplication: (seed: string, uploader: string, poolID: number, cid: string) => Promise<string>;
55
55
  bloxFreeSpace: () => Promise<string>;
56
56
  wifiRemoveall: () => Promise<string>;
57
+ reboot: () => Promise<string>;
57
58
  }
58
59
  declare const _default: FulaNativeModule;
59
60
  export default _default;