@functionland/react-native-fula 1.14.7 → 1.19.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 (141) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +226 -214
  3. package/android/build.gradle +110 -110
  4. package/android/gradle.properties +5 -5
  5. package/android/src/main/AndroidManifest.xml +3 -3
  6. package/android/src/main/AndroidManifestNew.xml +2 -2
  7. package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
  8. package/android/src/main/java/land/fx/fula/Cryptography.java +62 -62
  9. package/android/src/main/java/land/fx/fula/FulaModule.java +1435 -1466
  10. package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
  11. package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
  12. package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
  13. package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
  14. package/ios/Cryptography.swift +49 -49
  15. package/ios/Fula-Bridging-Header.h +3 -3
  16. package/ios/Fula.mm +197 -199
  17. package/ios/Fula.swift +1221 -1221
  18. package/ios/UserDataHelper.swift +143 -143
  19. package/lib/commonjs/index.js +2 -2
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/commonjs/interfaces/augment-api-errors.js +4 -0
  22. package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -0
  23. package/lib/commonjs/interfaces/augment-api-rpc.js +4 -0
  24. package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -0
  25. package/lib/commonjs/interfaces/augment-api-runtime.js +4 -0
  26. package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -0
  27. package/lib/commonjs/interfaces/augment-api.js +10 -0
  28. package/lib/commonjs/interfaces/augment-api.js.map +1 -0
  29. package/lib/commonjs/interfaces/augment-types.js +4 -0
  30. package/lib/commonjs/interfaces/augment-types.js.map +1 -0
  31. package/lib/commonjs/interfaces/fulaNativeModule.js +1 -2
  32. package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
  33. package/lib/commonjs/interfaces/index.js +6 -0
  34. package/lib/commonjs/interfaces/index.js.map +1 -0
  35. package/lib/commonjs/interfaces/{api-lookup.js → lookup.js} +623 -382
  36. package/lib/commonjs/interfaces/lookup.js.map +1 -0
  37. package/lib/commonjs/interfaces/registry.js +4 -0
  38. package/lib/commonjs/interfaces/registry.js.map +1 -0
  39. package/lib/commonjs/interfaces/types-lookup.js +4 -0
  40. package/lib/commonjs/interfaces/types-lookup.js.map +1 -0
  41. package/lib/commonjs/interfaces/types.js +4 -0
  42. package/lib/commonjs/interfaces/types.js.map +1 -0
  43. package/lib/commonjs/protocols/blockchain.js +123 -76
  44. package/lib/commonjs/protocols/blockchain.js.map +1 -1
  45. package/lib/commonjs/protocols/chain-api.js +151 -37
  46. package/lib/commonjs/protocols/chain-api.js.map +1 -1
  47. package/lib/commonjs/protocols/fula.js +195 -99
  48. package/lib/commonjs/protocols/fula.js.map +1 -1
  49. package/lib/commonjs/protocols/fxblox.js +3 -3
  50. package/lib/commonjs/protocols/fxblox.js.map +1 -1
  51. package/lib/commonjs/types/blockchain.js.map +1 -1
  52. package/lib/commonjs/types/fxblox.js.map +1 -1
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/interfaces/augment-api-errors.js +9 -0
  55. package/lib/module/interfaces/augment-api-errors.js.map +1 -0
  56. package/lib/module/interfaces/augment-api-rpc.js +9 -0
  57. package/lib/module/interfaces/augment-api-rpc.js.map +1 -0
  58. package/lib/module/interfaces/augment-api-runtime.js +9 -0
  59. package/lib/module/interfaces/augment-api-runtime.js.map +1 -0
  60. package/lib/module/interfaces/augment-api.js +11 -0
  61. package/lib/module/interfaces/augment-api.js.map +1 -0
  62. package/lib/module/interfaces/augment-types.js +9 -0
  63. package/lib/module/interfaces/augment-types.js.map +1 -0
  64. package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
  65. package/lib/module/interfaces/index.js +5 -0
  66. package/lib/module/interfaces/index.js.map +1 -0
  67. package/lib/module/interfaces/{api-lookup.js → lookup.js} +622 -380
  68. package/lib/module/interfaces/lookup.js.map +1 -0
  69. package/lib/module/interfaces/registry.js +9 -0
  70. package/lib/module/interfaces/registry.js.map +1 -0
  71. package/lib/module/interfaces/types-lookup.js +9 -0
  72. package/lib/module/interfaces/types-lookup.js.map +1 -0
  73. package/lib/module/interfaces/types.js +3 -0
  74. package/lib/module/interfaces/types.js.map +1 -0
  75. package/lib/module/protocols/blockchain.js +120 -75
  76. package/lib/module/protocols/blockchain.js.map +1 -1
  77. package/lib/module/protocols/chain-api.js +142 -31
  78. package/lib/module/protocols/chain-api.js.map +1 -1
  79. package/lib/module/protocols/fula.js +191 -99
  80. package/lib/module/protocols/fula.js.map +1 -1
  81. package/lib/module/protocols/fxblox.js +3 -3
  82. package/lib/module/protocols/fxblox.js.map +1 -1
  83. package/lib/module/types/blockchain.js.map +1 -1
  84. package/lib/module/types/fxblox.js.map +1 -1
  85. package/lib/typescript/interfaces/augment-api-errors.d.ts +442 -0
  86. package/lib/typescript/interfaces/augment-api-errors.d.ts.map +1 -0
  87. package/lib/typescript/interfaces/augment-api-rpc.d.ts +680 -0
  88. package/lib/typescript/interfaces/augment-api-rpc.d.ts.map +1 -0
  89. package/lib/typescript/interfaces/augment-api-runtime.d.ts +248 -0
  90. package/lib/typescript/interfaces/augment-api-runtime.d.ts.map +1 -0
  91. package/lib/typescript/interfaces/augment-api.d.ts +8 -0
  92. package/lib/typescript/interfaces/augment-api.d.ts.map +1 -0
  93. package/lib/typescript/interfaces/augment-types.d.ts +1224 -0
  94. package/lib/typescript/interfaces/augment-types.d.ts.map +1 -0
  95. package/lib/typescript/interfaces/fulaNativeModule.d.ts +7 -3
  96. package/lib/typescript/interfaces/fulaNativeModule.d.ts.map +1 -1
  97. package/lib/typescript/interfaces/index.d.ts +1 -0
  98. package/lib/typescript/interfaces/index.d.ts.map +1 -0
  99. package/lib/typescript/interfaces/{api-lookup.d.ts → lookup.d.ts} +441 -199
  100. package/lib/typescript/interfaces/lookup.d.ts.map +1 -0
  101. package/lib/typescript/interfaces/registry.d.ts +146 -0
  102. package/lib/typescript/interfaces/registry.d.ts.map +1 -0
  103. package/lib/typescript/interfaces/types-lookup.d.ts +1910 -0
  104. package/lib/typescript/interfaces/types-lookup.d.ts.map +1 -0
  105. package/lib/typescript/interfaces/types.d.ts +1 -0
  106. package/lib/typescript/interfaces/types.d.ts.map +1 -0
  107. package/lib/typescript/protocols/blockchain.d.ts +5 -3
  108. package/lib/typescript/protocols/blockchain.d.ts.map +1 -1
  109. package/lib/typescript/protocols/chain-api.d.ts +5 -0
  110. package/lib/typescript/protocols/chain-api.d.ts.map +1 -1
  111. package/lib/typescript/protocols/fula.d.ts +16 -0
  112. package/lib/typescript/protocols/fula.d.ts.map +1 -1
  113. package/lib/typescript/types/blockchain.d.ts +6 -0
  114. package/lib/typescript/types/blockchain.d.ts.map +1 -1
  115. package/package.json +178 -172
  116. package/react-native-fula.podspec +47 -47
  117. package/src/index.tsx +4 -4
  118. package/src/interfaces/augment-api-errors.ts +449 -0
  119. package/src/interfaces/augment-api-rpc.ts +617 -0
  120. package/src/interfaces/augment-api-runtime.ts +224 -0
  121. package/src/interfaces/augment-api.ts +10 -0
  122. package/src/interfaces/augment-types.ts +1230 -0
  123. package/src/interfaces/fulaNativeModule.ts +130 -122
  124. package/src/interfaces/index.ts +4 -0
  125. package/src/interfaces/{api-lookup.ts → lookup.ts} +1889 -1647
  126. package/src/interfaces/registry.ts +152 -0
  127. package/src/interfaces/types-lookup.ts +2043 -0
  128. package/src/interfaces/types.ts +3 -0
  129. package/src/protocols/blockchain.ts +549 -504
  130. package/src/protocols/chain-api.ts +148 -24
  131. package/src/protocols/fula.ts +419 -314
  132. package/src/protocols/fxblox.ts +49 -49
  133. package/src/types/blockchain.ts +89 -81
  134. package/src/types/fxblox.ts +8 -8
  135. package/ios/Fula.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  136. package/ios/Fula.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  137. package/ios/Fula.xcodeproj/project.xcworkspace/xcuserdata/user246549.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  138. package/ios/Fula.xcodeproj/xcuserdata/user246549.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  139. package/lib/commonjs/interfaces/api-lookup.js.map +0 -1
  140. package/lib/module/interfaces/api-lookup.js.map +0 -1
  141. package/lib/typescript/interfaces/api-lookup.d.ts.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import Fula from '../interfaces/fulaNativeModule';
2
-
3
- /**
4
- * Get gets the value corresponding to the given key from the local datastore.
5
- // The key must be a valid ipld.Link.
6
- * @param config
7
- * @returns boolean
2
+ import { init as chainApiInit, batchUploadManifest, checkAccountBalance, getAccountIdFromSeed } from './chain-api';
3
+ /**
4
+ * Get gets the value corresponding to the given key from the local datastore.
5
+ // The key must be a valid ipld.Link.
6
+ * @param config
7
+ * @returns boolean
8
8
  */
9
9
 
10
10
  export const init = function (identity, storePath, bloxAddr, exchange) {
@@ -16,11 +16,11 @@ export const init = function (identity, storePath, bloxAddr, exchange) {
16
16
  return Fula.initFula(identity, storePath, bloxAddr, exchange, autoFlush, rootCid, useRelay, refresh);
17
17
  };
18
18
 
19
- /**
20
- * Get gets the value corresponding to the given key from the local datastore.
21
- // The key must be a valid ipld.Link.
22
- * @param config
23
- * @returns boolean
19
+ /**
20
+ * Get gets the value corresponding to the given key from the local datastore.
21
+ // The key must be a valid ipld.Link.
22
+ * @param config
23
+ * @returns boolean
24
24
  */
25
25
 
26
26
  export const newClient = function (identity, storePath, bloxAddr, exchange) {
@@ -31,17 +31,17 @@ export const newClient = function (identity, storePath, bloxAddr, exchange) {
31
31
  return Fula.newClient(identity, storePath, bloxAddr, exchange, autoFlush, useRelay, refresh);
32
32
  };
33
33
 
34
- /**
35
- * rm removes all data
36
- * @param path
37
- * @returns string: new cid of the root
34
+ /**
35
+ * rm removes all data
36
+ * @param path
37
+ * @returns string: new cid of the root
38
38
  */
39
39
  export const logout = (identity, storePath) => {
40
40
  return Fula.logout(identity, storePath);
41
41
  };
42
42
 
43
- /**
44
- * Checks if there are any un-synced changes on the device
43
+ /**
44
+ * Checks if there are any un-synced changes on the device
45
45
  */
46
46
  export const checkFailedActions = function () {
47
47
  let retry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
@@ -49,48 +49,63 @@ export const checkFailedActions = function () {
49
49
  return Fula.checkFailedActions(retry, timeout);
50
50
  };
51
51
 
52
- /**
53
- * Lists the cids that failed to be sent to backend and are kept only locally
52
+ /**
53
+ * Lists the cids that failed to be sent to backend and are kept only locally
54
54
  */
55
55
  export const listFailedActions = function () {
56
56
  let cids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
57
57
  return Fula.listFailedActions(cids);
58
58
  };
59
59
 
60
- /**
61
- * Checks if there are any un-synced changes on the device
60
+ /**
61
+ * Lists the cids that are recent
62
+ */
63
+ export const listRecentCidsAsString = () => {
64
+ return Fula.listRecentCidsAsString();
65
+ };
66
+
67
+ /**
68
+ * Clears the cids that ar recent
69
+ */
70
+ export const clearCidsFromRecent = function () {
71
+ let cids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
72
+ return Fula.clearCidsFromRecent(cids);
73
+ };
74
+
75
+ /**
76
+ * Checks if there are any un-synced changes on the device
62
77
  */
63
78
  export const checkConnection = function () {
64
79
  let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 20;
65
80
  return Fula.checkConnection(timeout);
66
81
  };
67
82
 
68
- /**
69
- * Get gets the value corresponding to the given key from the local datastore.
70
- // The key must be a valid ipld.Link.
71
- * @param key
72
- * @returns value
83
+ /**
84
+ * Get gets the value corresponding to the given key from the local datastore.
85
+ // The key must be a valid ipld.Link.
86
+ * @param key
87
+ * @returns value
73
88
  */
74
89
  export const get = key => {
75
90
  return Fula.get(key);
76
91
  };
77
92
 
78
- /**
79
- * Has checks whether the value corresponding to the given key is present in the local datastore.
80
- // The key must be a valid ipld.Link.
81
- * @param key
82
- * @returns boolean
93
+ /**
94
+ * Has checks whether the value corresponding to the given key is present in the local datastore.
95
+ // The key must be a valid ipld.Link.
96
+ * @param key
97
+ * @returns boolean
83
98
  */
84
99
  export const has = key => {
85
100
  return Fula.has(key);
86
101
  };
87
102
 
88
- /**
89
- * Push requests the given addr to download the root cid from this node.
90
- // The addr must be a valid multiaddr that includes peer ID.
91
- // this function.
92
- * @param addr
93
- * @returns null or error
103
+ /**
104
+ * Push requests the given addr to download the root cid from this node.
105
+ // The addr must be a valid multiaddr that includes peer ID.
106
+ // this function.
107
+ * @param addr
108
+ * @returns null or error
94
109
  */
95
110
  export const push = () => {
96
111
  return Fula.push();
@@ -101,52 +116,52 @@ export const testData = (identity, bloxAddr) => {
101
116
  return Fula.testData(identity, bloxAddr);
102
117
  };
103
118
 
104
- /**
105
- * Put stores the given key value onto the local datastore.
106
- // The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
107
- // to the given key.
108
- * @param key, value
109
- * @returns null or string
119
+ /**
120
+ * Put stores the given key value onto the local datastore.
121
+ // The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
122
+ // to the given key.
123
+ * @param key, value
124
+ * @returns null or string
110
125
  */
111
126
  export const put = (value, codec) => {
112
127
  return Fula.put(value, codec);
113
128
  };
114
129
 
115
- /**
116
- * mkdir creates a directory at the given path.
117
- * @param path
118
- * @returns string: new cid of the root
130
+ /**
131
+ * mkdir creates a directory at the given path.
132
+ * @param path
133
+ * @returns string: new cid of the root
119
134
  */
120
135
  export const mkdir = path => {
121
136
  return Fula.mkdir(path);
122
137
  };
123
138
 
124
- /**
125
- * writeFileContent writes content at a given path
126
- * @param path
127
- * @returns string: new cid of the root
139
+ /**
140
+ * writeFileContent writes content at a given path
141
+ * @param path
142
+ * @returns string: new cid of the root
128
143
  */
129
144
  export const writeFileContent = (path, content) => {
130
145
  return Fula.writeFileContent(path, content);
131
146
  };
132
147
 
133
- /*
134
- // reads content of the file form localFilename (should include full absolute path to local file with read permission
135
- // writes content to the specified location by fulaTargetFilename in Fula filesystem
136
- // It keeps the original file modiifcation date
137
- // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
138
- // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
139
- // Returns: new cid of the root after this file is placed in the tree
148
+ /*
149
+ // reads content of the file form localFilename (should include full absolute path to local file with read permission
150
+ // writes content to the specified location by fulaTargetFilename in Fula filesystem
151
+ // It keeps the original file modiifcation date
152
+ // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
153
+ // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
154
+ // Returns: new cid of the root after this file is placed in the tree
140
155
  */
141
156
  export const writeFile = (fulaTargetFilename, localFilename) => {
142
157
  return Fula.writeFile(fulaTargetFilename, localFilename);
143
158
  };
144
159
 
145
- /**
146
- * ls lists the name of files and folders at a given path
147
- * @param path
148
- * @returns string: list of items
149
- * TODO: Findout how is the string and convert to array
160
+ /**
161
+ * ls lists the name of files and folders at a given path
162
+ * @param path
163
+ * @returns string: list of items
164
+ * TODO: Findout how is the string and convert to array
150
165
  */
151
166
  export const ls = path => {
152
167
  return Fula.ls(path).then(res => {
@@ -177,80 +192,157 @@ export const ls = path => {
177
192
  });
178
193
  };
179
194
 
180
- /**
181
- * rm removes all files and folders at a given path
182
- * @param path
183
- * @returns string: new cid of the root
195
+ /**
196
+ * rm removes all files and folders at a given path
197
+ * @param path
198
+ * @returns string: new cid of the root
184
199
  */
185
200
  export const rm = path => {
186
201
  return Fula.rm(path);
187
202
  };
188
203
 
189
- /**
190
- * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
191
- * @param sourcePath, targetPath
192
- * @returns string: new cid of the root
204
+ /**
205
+ * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
206
+ * @param sourcePath, targetPath
207
+ * @returns string: new cid of the root
193
208
  */
194
209
  export const cp = (sourcePath, targetPath) => {
195
210
  return Fula.cp(sourcePath, targetPath);
196
211
  };
197
212
 
198
- /**
199
- * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
200
- * @param sourcePath, targetPath
201
- * @returns string: new cid of the root
213
+ /**
214
+ * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
215
+ * @param sourcePath, targetPath
216
+ * @returns string: new cid of the root
202
217
  */
203
218
  export const mv = (sourcePath, targetPath) => {
204
219
  return Fula.mv(sourcePath, targetPath);
205
220
  };
206
221
 
207
- /*
208
- // reads content of the file form localFilename (should include full absolute path to local file with read permission
209
- // writes content to the specified location by fulaTargetFilename in Fula filesystem
210
- // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
211
- // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
212
- // Returns: new cid of the root after this file is placed in the tree
222
+ /*
223
+ // reads content of the file form localFilename (should include full absolute path to local file with read permission
224
+ // writes content to the specified location by fulaTargetFilename in Fula filesystem
225
+ // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
226
+ // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
227
+ // Returns: new cid of the root after this file is placed in the tree
213
228
  */
214
229
  export const readFile = (fulaTargetFilename, localFilename) => {
215
230
  return Fula.readFile(fulaTargetFilename, localFilename);
216
231
  };
217
232
 
218
- /**
219
- * readFile reads content of a given path
220
- * @param path
221
- * @returns string: cotent
233
+ /**
234
+ * readFile reads content of a given path
235
+ * @param path
236
+ * @returns string: cotent
222
237
  */
223
238
  export const readFileContent = path => {
224
239
  return Fula.readFileContent(path);
225
240
  };
226
241
 
227
- /**
228
- * Shutdown closes all resources used by Client.
229
- // After calling this function Client must be discarded.
230
- * @param
231
- * @returns
242
+ /**
243
+ * Shutdown closes all resources used by Client.
244
+ // After calling this function Client must be discarded.
245
+ * @param
246
+ * @returns
232
247
  */
233
248
  export const shutdown = () => {
234
249
  return Fula.shutdown();
235
250
  };
236
251
 
237
- /**
238
- * setAuth adds or removes a peer from the list of peers that are allowed to push to this node.
239
- * This can only be called on a peer that is added as an owner of blox by --authorizer parameter
240
- * @param peerId, allow
241
- * @returns boolean: true if successful or false if not
252
+ /**
253
+ * setAuth adds or removes a peer from the list of peers that are allowed to push to this node.
254
+ * This can only be called on a peer that is added as an owner of blox by --authorizer parameter
255
+ * @param peerId, allow
256
+ * @returns boolean: true if successful or false if not
242
257
  */
243
258
  export const setAuth = (peerId, allow) => {
244
259
  return Fula.setAuth(peerId, allow);
245
260
  };
246
261
 
247
- /**
248
- * isReady checks if the connection is ready to be used.
249
- * @param filesystemCheck: also check if the wnfs is ready
250
- * @returns boolean: true if ready or false if not
262
+ /**
263
+ * isReady checks if the connection is ready to be used.
264
+ * @param filesystemCheck: also check if the wnfs is ready
265
+ * @returns boolean: true if ready or false if not
251
266
  */
252
267
  export const isReady = function () {
253
268
  let filesystemCheck = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
254
269
  return Fula.isReady(filesystemCheck);
255
270
  };
271
+
272
+ /**
273
+ * replicate replicates data on the nework
274
+ */
275
+ export const replicateRecentCids = async function (api, seed, poolId) {
276
+ let replicationNo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 4;
277
+ let status = true;
278
+ let msg = '';
279
+ if (!api) {
280
+ api = await chainApiInit();
281
+ }
282
+ if (api) {
283
+ console.log('uploading manifests');
284
+ try {
285
+ let account = await getAccountIdFromSeed(seed);
286
+ console.log('account: ' + account);
287
+ const accountBal = await checkAccountBalance(api, account);
288
+ console.log('account balance: ' + accountBal);
289
+ if (accountBal !== '0') {
290
+ const recentCids = await listRecentCidsAsString();
291
+ console.log(recentCids);
292
+ if (recentCids) {
293
+ console.log({
294
+ api,
295
+ seed,
296
+ recentCids,
297
+ poolId,
298
+ replicationNo
299
+ });
300
+ const res = await batchUploadManifest(api, seed, recentCids, poolId, replicationNo);
301
+ console.log('batchUploadManifest res received');
302
+ console.log(res);
303
+ if (res && res.hash) {
304
+ var _signedBlock$block;
305
+ const signedBlock = await api.rpc.chain.getBlock(res.hash);
306
+ if (signedBlock !== null && signedBlock !== void 0 && (_signedBlock$block = signedBlock.block) !== null && _signedBlock$block !== void 0 && (_signedBlock$block = _signedBlock$block.extrinsics) !== null && _signedBlock$block !== void 0 && _signedBlock$block.length) {
307
+ await clearCidsFromRecent(recentCids);
308
+ msg = res.hash;
309
+ } else {
310
+ status = false;
311
+ msg = 'block data is not found';
312
+ }
313
+ } else {
314
+ status = false;
315
+ msg = 'hash is not returned';
316
+ }
317
+ } else {
318
+ status = false;
319
+ msg = 'No recent Cids found';
320
+ }
321
+ } else {
322
+ status = false;
323
+ msg = 'Account balance is not enough or account does not exists';
324
+ }
325
+ } catch (e) {
326
+ console.log('res failed');
327
+ console.log(e);
328
+ let errorMessage = '';
329
+ if (e instanceof Error) {
330
+ // If it's an Error instance, use the message property
331
+ errorMessage = e.message;
332
+ } else {
333
+ // If it's not an Error instance, convert it to string
334
+ errorMessage = e.toString();
335
+ }
336
+ status = false;
337
+ msg = errorMessage;
338
+ }
339
+ }
340
+
341
+ // Return a value (true/false) depending on the outcome of the function
342
+ // For example:
343
+ return {
344
+ status: status,
345
+ msg: msg
346
+ }; // or false, depending on your logic
347
+ };
256
348
  //# sourceMappingURL=fula.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Fula","init","identity","storePath","bloxAddr","exchange","autoFlush","arguments","length","undefined","rootCid","useRelay","refresh","console","log","initFula","newClient","logout","checkFailedActions","retry","timeout","listFailedActions","cids","checkConnection","get","key","has","push","testData","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","then","res","lsResult","lsRows","split","element","rowItems","item","name","created","modified","jsonRes","JSON","parse","stringify","catch","e","rm","cp","sourcePath","targetPath","mv","readFile","readFileContent","shutdown","setAuth","peerId","allow","isReady","filesystemCheck"],"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;EACrD,OAAOP,IAAI,CAACoE,OAAO,CAACC,eAAe,CAAC;AACtC,CAAC"}
1
+ {"version":3,"names":["Fula","init","chainApiInit","batchUploadManifest","checkAccountBalance","getAccountIdFromSeed","identity","storePath","bloxAddr","exchange","autoFlush","arguments","length","undefined","rootCid","useRelay","refresh","console","log","initFula","newClient","logout","checkFailedActions","retry","timeout","listFailedActions","cids","listRecentCidsAsString","clearCidsFromRecent","checkConnection","get","key","has","push","testData","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","then","res","lsResult","lsRows","split","element","rowItems","item","name","created","modified","jsonRes","JSON","parse","stringify","catch","e","rm","cp","sourcePath","targetPath","mv","readFile","readFileContent","shutdown","setAuth","peerId","allow","isReady","filesystemCheck","replicateRecentCids","api","seed","poolId","replicationNo","status","msg","account","accountBal","recentCids","hash","_signedBlock$block","signedBlock","rpc","chain","getBlock","block","extrinsics","errorMessage","Error","message","toString"],"sourceRoot":"..\\..\\..\\src","sources":["protocols/fula.ts"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;AACjD,SACEC,IAAI,IAAIC,YAAY,EACpBC,mBAAmB,EACnBC,mBAAmB,EACnBC,oBAAoB,QACf,aAAa;AAGpB;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMJ,IAAI,GAAG,SAAAA,CAClBK,QAAgB,EAChBC,SAAiB,EACjBC,QAAgB,EAChBC,QAAgB,EAKiC;EAAA,IAJjDC,SAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAAA,IAC1BG,OAAsB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAAA,IAC7BI,QAAiB,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAAA,IACxBK,OAAgB,GAAAL,SA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AW,aAAXA,WAAW,gBAAAD,kBAAA,GAAXC,WAAW,CAAEI,KAAK,cAAAL,kBAAA,gBAAAA,kBAAA,GAAlBA,kBAAA,CAAoBM,UAAU,cAAAN,kBAAA,eAA9BA,kBAAA,CAAgC3E,MAAM,EAAE;cAC1C,MAAMgB,mBAAmB,CAACyD,UAAU,CAAC;cACrCH,GAAG,GAAGnC,GAAG,CAACuC,IAAI;YAChB,CAAC,MAAM;cACLL,MAAM,GAAG,KAAK;cACdC,GAAG,GAAG,yBAAyB;YACjC;UACF,CAAC,MAAM;YACLD,MAAM,GAAG,KAAK;YACdC,GAAG,GAAG,sBAAsB;UAC9B;QACF,CAAC,MAAM;UACLD,MAAM,GAAG,KAAK;UACdC,GAAG,GAAG,sBAAsB;QAC9B;MACF,CAAC,MAAM;QACLD,MAAM,GAAG,KAAK;QACdC,GAAG,GAAG,0DAA0D;MAClE;IACF,CAAC,CAAC,OAAOpB,CAAM,EAAE;MACf7C,OAAO,CAACC,GAAG,CAAC,YAAY,CAAC;MACzBD,OAAO,CAACC,GAAG,CAAC4C,CAAC,CAAC;MACd,IAAIgC,YAAY,GAAG,EAAE;MAErB,IAAIhC,CAAC,YAAYiC,KAAK,EAAE;QACtB;QACAD,YAAY,GAAGhC,CAAC,CAACkC,OAAO;MAC1B,CAAC,MAAM;QACL;QACAF,YAAY,GAAGhC,CAAC,CAACmC,QAAQ,CAAC,CAAC;MAC7B;MACAhB,MAAM,GAAG,KAAK;MACdC,GAAG,GAAGY,YAAY;IACpB;EACF;;EAEA;EACA;EACA,OAAO;IAAEb,MAAM,EAAEA,MAAM;IAAEC,GAAG,EAAEA;EAAI,CAAC,CAAC,CAAC;AACvC,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 = () => {
@@ -1 +1 @@
1
- {"version":3,"names":["Fula","wifiRemoveall","console","log","res","then","jsonRes","JSON","parse","e","catch","err","reboot"],"sourceRoot":"../../../src","sources":["protocols/fxblox.ts"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAA4C;EACvEC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGJ,IAAI,CAACC,aAAa,CAAC,CAAC,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,GAAGA,CAAA,KAAqC;EACzDV,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC7C,IAAIC,GAAG,GAAGJ,IAAI,CAACY,MAAM,CAAC,CAAC,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
+ {"version":3,"names":["Fula","wifiRemoveall","console","log","res","then","jsonRes","JSON","parse","e","catch","err","reboot"],"sourceRoot":"..\\..\\..\\src","sources":["protocols/fxblox.ts"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAA4C;EACvEC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGJ,IAAI,CAACC,aAAa,CAAC,CAAC,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,GAAGA,CAAA,KAAqC;EACzDV,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC7C,IAAIC,GAAG,GAAGJ,IAAI,CAACY,MAAM,CAAC,CAAC,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":[],"sourceRoot":"../../../src","sources":["types/blockchain.ts"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/blockchain.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/fxblox.ts"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["types/fxblox.ts"],"mappings":""}