@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,122 +1,130 @@
1
- import { NativeModules, Platform } from 'react-native';
2
-
3
- interface FulaNativeModule {
4
- initFula: (
5
- identity: string, //Private key of did identity
6
- storePath: string, //You can leave empty
7
- bloxAddr: string, //Blox multiadddr needs to be manually entered now
8
- exchange: string, //set to 'noope' for testing
9
- autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
10
- rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem
11
- useRelay: boolean | null, // if true it forces the use of relay
12
- refresh: boolean // if true it forces to refresh the fula object
13
- ) => Promise<{ peerId: string; rootCid: string }>;
14
- newClient: (
15
- identity: string, //Private key of did identity
16
- storePath: string, //You can leave empty
17
- bloxAddr: string, //Blox multiadddr needs to be manually entered now
18
- exchange: string, //set to 'noope' for testing
19
- autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
20
- useRelay: boolean | null, // if true it forces the use of relay
21
- refresh: boolean // if true it forces to refresh the fula object
22
- ) => Promise<string>;
23
- isReady: (filesystemCheck: boolean) => Promise<boolean>;
24
- logout: (identity: string, storePath: string) => Promise<boolean>;
25
- checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
26
- listFailedActions: (cids: string[]) => Promise<string[]>;
27
- checkConnection: (timeout: number) => Promise<boolean>;
28
- get: (key: string) => Promise<string>;
29
- has: (key: Uint8Array) => Promise<boolean>;
30
- push: () => Promise<string>;
31
- put: (content: string, codec: string) => Promise<string>;
32
- mkdir: (path: string) => Promise<string>;
33
- writeFileContent: (path: string, content: string) => Promise<string>;
34
- writeFile: (
35
- fulaTargetFilename: string,
36
- localFilename: string
37
- ) => Promise<string>;
38
- ls: (path: string) => Promise<string>;
39
- rm: (path: string) => Promise<string>;
40
- cp: (sourcePath: string, targetPath: string) => Promise<string>;
41
- mv: (sourcePath: string, targetPath: string) => Promise<string>;
42
- readFile: (
43
- fulaTargetFilename: string,
44
- localFilename: string
45
- ) => Promise<string>;
46
- readFileContent: (path: string) => Promise<string>;
47
- setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
48
-
49
- shutdown: () => Promise<void>;
50
-
51
- testData: (identity: string, bloxAddr: string) => Promise<string>;
52
-
53
- //Blockchain related functions
54
- createAccount: (seed: string) => Promise<string>;
55
- checkAccountExists: (account: string) => Promise<string>;
56
- createPool: (seed: string, poolName: string) => Promise<string>;
57
- listPools: () => Promise<string>;
58
- joinPool: (seed: string, poolID: number) => Promise<string>;
59
- leavePool: (seed: string, poolID: number) => Promise<string>;
60
- cancelPoolJoin: (seed: string, poolID: number) => Promise<string>;
61
- listPoolJoinRequests: (poolID: number) => Promise<string>;
62
- votePoolJoinRequest: (
63
- seed: string,
64
- poolID: number,
65
- account: string,
66
- accept: boolean
67
- ) => Promise<string>;
68
- newReplicationRequest: (
69
- seed: string,
70
- poolID: number,
71
- replicationFactor: number,
72
- cid: string
73
- ) => Promise<string>;
74
- newStoreRequest: (
75
- seed: string,
76
- poolID: number,
77
- uploader: string,
78
- cid: string
79
- ) => Promise<string>;
80
- listAvailableReplicationRequests: (poolID: number) => Promise<string>;
81
- removeReplicationRequest: (
82
- seed: string,
83
- poolID: number,
84
- cid: string
85
- ) => Promise<string>;
86
- removeStorer: (
87
- seed: string,
88
- storer: string,
89
- poolID: number,
90
- cid: string
91
- ) => Promise<string>;
92
- removeStoredReplication: (
93
- seed: string,
94
- uploader: string,
95
- poolID: number,
96
- cid: string
97
- ) => Promise<string>;
98
-
99
- //Hardware
100
- bloxFreeSpace: () => Promise<string>;
101
- wifiRemoveall: () => Promise<string>;
102
- reboot: () => Promise<string>;
103
- }
104
-
105
- const LINKING_ERROR =
106
- `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
107
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
108
- '- You rebuilt the app after installing the package\n' +
109
- '- You are not using Expo managed workflow\n';
110
-
111
- const Fula = NativeModules.FulaModule
112
- ? NativeModules.FulaModule
113
- : new Proxy(
114
- {},
115
- {
116
- get() {
117
- throw new Error(LINKING_ERROR);
118
- },
119
- }
120
- );
121
-
122
- export default Fula as FulaNativeModule;
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ interface FulaNativeModule {
4
+ initFula: (
5
+ identity: string, //Private key of did identity
6
+ storePath: string, //You can leave empty
7
+ bloxAddr: string, //Blox multiadddr needs to be manually entered now
8
+ exchange: string, //set to 'noope' for testing
9
+ autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
10
+ rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem
11
+ useRelay: boolean | null, // if true it forces the use of relay
12
+ refresh: boolean // if true it forces to refresh the fula object
13
+ ) => Promise<{ peerId: string; rootCid: string }>;
14
+ newClient: (
15
+ identity: string, //Private key of did identity
16
+ storePath: string, //You can leave empty
17
+ bloxAddr: string, //Blox multiadddr needs to be manually entered now
18
+ exchange: string, //set to 'noope' for testing
19
+ autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
20
+ useRelay: boolean | null, // if true it forces the use of relay
21
+ refresh: boolean // if true it forces to refresh the fula object
22
+ ) => Promise<string>;
23
+ isReady: (filesystemCheck: boolean) => Promise<boolean>;
24
+ logout: (identity: string, storePath: string) => Promise<boolean>;
25
+ checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
26
+ listFailedActions: (cids: string[]) => Promise<string[]>;
27
+ listRecentCidsAsString: () => Promise<string[]>;
28
+ clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
29
+ checkConnection: (timeout: number) => Promise<boolean>;
30
+ get: (key: string) => Promise<string>;
31
+ has: (key: Uint8Array) => Promise<boolean>;
32
+ push: () => Promise<string>;
33
+ put: (content: string, codec: string) => Promise<string>;
34
+ mkdir: (path: string) => Promise<string>;
35
+ writeFileContent: (path: string, content: string) => Promise<string>;
36
+ writeFile: (
37
+ fulaTargetFilename: string,
38
+ localFilename: string
39
+ ) => Promise<string>;
40
+ ls: (path: string) => Promise<string>;
41
+ rm: (path: string) => Promise<string>;
42
+ cp: (sourcePath: string, targetPath: string) => Promise<string>;
43
+ mv: (sourcePath: string, targetPath: string) => Promise<string>;
44
+ readFile: (
45
+ fulaTargetFilename: string,
46
+ localFilename: string
47
+ ) => Promise<string>;
48
+ readFileContent: (path: string) => Promise<string>;
49
+ setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
50
+
51
+ shutdown: () => Promise<void>;
52
+
53
+ testData: (identity: string, bloxAddr: string) => Promise<string>;
54
+
55
+ //Blockchain related functions
56
+ createAccount: (seed: string) => Promise<string>;
57
+ checkAccountExists: (account: string) => Promise<string>;
58
+ createPool: (seed: string, poolName: string) => Promise<string>;
59
+ listPools: () => Promise<string>;
60
+ joinPool: (poolID: string) => Promise<string>;
61
+ leavePool: (poolID: number) => Promise<string>;
62
+ cancelPoolJoin: (poolID: number) => Promise<string>;
63
+ listPoolJoinRequests: (poolID: number) => Promise<string>;
64
+ votePoolJoinRequest: (
65
+ seed: string,
66
+ poolID: number,
67
+ account: string,
68
+ accept: boolean
69
+ ) => Promise<string>;
70
+ newReplicationRequest: (
71
+ seed: string,
72
+ poolID: number,
73
+ replicationFactor: number,
74
+ cid: string
75
+ ) => Promise<string>;
76
+ newStoreRequest: (
77
+ seed: string,
78
+ poolID: number,
79
+ uploader: string,
80
+ cid: string
81
+ ) => Promise<string>;
82
+ listAvailableReplicationRequests: (poolID: number) => Promise<string>;
83
+ removeReplicationRequest: (
84
+ seed: string,
85
+ poolID: number,
86
+ cid: string
87
+ ) => Promise<string>;
88
+ removeStorer: (
89
+ seed: string,
90
+ storer: string,
91
+ poolID: number,
92
+ cid: string
93
+ ) => Promise<string>;
94
+ removeStoredReplication: (
95
+ seed: string,
96
+ uploader: string,
97
+ poolID: number,
98
+ cid: string
99
+ ) => Promise<string>;
100
+
101
+ //Hardware
102
+ bloxFreeSpace: () => Promise<string>;
103
+ wifiRemoveall: () => Promise<string>;
104
+ reboot: () => Promise<string>;
105
+ getAccount: () => Promise<string>;
106
+ assetsBalance: (
107
+ account: string,
108
+ assetId: string,
109
+ classId: string
110
+ ) => Promise<string>;
111
+ }
112
+
113
+ const LINKING_ERROR =
114
+ `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
115
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
116
+ '- You rebuilt the app after installing the package\n' +
117
+ '- You are not using Expo managed workflow\n';
118
+
119
+ const Fula = NativeModules.FulaModule
120
+ ? NativeModules.FulaModule
121
+ : new Proxy(
122
+ {},
123
+ {
124
+ get() {
125
+ throw new Error(LINKING_ERROR);
126
+ },
127
+ }
128
+ );
129
+
130
+ export default Fula as FulaNativeModule;
@@ -0,0 +1,4 @@
1
+ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
+ /* eslint-disable */
3
+
4
+ //export * from './types.ts';