@functionland/react-native-fula 1.55.12 → 1.55.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/android/build.gradle +114 -114
- package/android/gradle.properties +8 -8
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/AndroidManifestNew.xml +2 -2
- package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
- package/android/src/main/java/land/fx/fula/Cryptography.java +62 -62
- package/android/src/main/java/land/fx/fula/FulaModule.java +2057 -1991
- package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
- package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
- package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
- package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
- package/ios/Cryptography.swift +59 -59
- package/ios/Fula-Bridging-Header.h +3 -3
- package/ios/Fula.mm +272 -262
- package/ios/Fula.swift +2284 -2207
- package/ios/Fula.xcodeproj/project.pbxproj +2 -2
- package/ios/UserDataHelper.swift +143 -143
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-consts.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-events.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-query.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-tx.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api.js.map +1 -1
- package/lib/commonjs/interfaces/augment-types.js.map +1 -1
- package/lib/commonjs/interfaces/definitions.js.map +1 -1
- package/lib/commonjs/interfaces/defintions.js.map +1 -1
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/interfaces/lookup.js +300 -300
- package/lib/commonjs/interfaces/lookup.js.map +1 -1
- package/lib/commonjs/interfaces/registry.js.map +1 -1
- package/lib/commonjs/interfaces/types-lookup.js.map +1 -1
- package/lib/commonjs/interfaces/types.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +133 -67
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/chain-api.js.map +1 -1
- package/lib/commonjs/protocols/fula.js.map +1 -1
- package/lib/commonjs/protocols/fx-ai.js.map +1 -1
- package/lib/commonjs/protocols/fxblox.js +3 -3
- package/lib/commonjs/protocols/fxblox.js.map +1 -1
- package/lib/commonjs/types/blockchain.js.map +1 -1
- package/lib/commonjs/types/fxblox.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/augment-api-consts.js.map +1 -1
- package/lib/module/interfaces/augment-api-errors.js.map +1 -1
- package/lib/module/interfaces/augment-api-events.js.map +1 -1
- package/lib/module/interfaces/augment-api-query.js.map +1 -1
- package/lib/module/interfaces/augment-api-rpc.js.map +1 -1
- package/lib/module/interfaces/augment-api-runtime.js.map +1 -1
- package/lib/module/interfaces/augment-api-tx.js.map +1 -1
- package/lib/module/interfaces/augment-api.js.map +1 -1
- package/lib/module/interfaces/augment-types.js.map +1 -1
- package/lib/module/interfaces/definitions.js.map +1 -1
- package/lib/module/interfaces/defintions.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/interfaces/lookup.js +300 -300
- package/lib/module/interfaces/lookup.js.map +1 -1
- package/lib/module/interfaces/registry.js.map +1 -1
- package/lib/module/interfaces/types-lookup.js.map +1 -1
- package/lib/module/interfaces/types.js.map +1 -1
- package/lib/module/protocols/blockchain.js +130 -66
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/chain-api.js.map +1 -1
- package/lib/module/protocols/fula.js.map +1 -1
- package/lib/module/protocols/fx-ai.js.map +1 -1
- package/lib/module/protocols/fxblox.js +3 -3
- package/lib/module/protocols/fxblox.js.map +1 -1
- package/lib/module/types/blockchain.js.map +1 -1
- package/lib/module/types/fxblox.js.map +1 -1
- package/package.json +177 -176
- package/react-native-fula.podspec +47 -47
- package/src/index.tsx +4 -4
- package/src/interfaces/augment-api-consts.ts +273 -273
- package/src/interfaces/augment-api-errors.ts +474 -474
- package/src/interfaces/augment-api-events.ts +448 -448
- package/src/interfaces/augment-api-query.ts +466 -466
- package/src/interfaces/augment-api-rpc.ts +617 -617
- package/src/interfaces/augment-api-runtime.ts +223 -223
- package/src/interfaces/augment-api-tx.ts +709 -709
- package/src/interfaces/augment-api.ts +9 -9
- package/src/interfaces/augment-types.ts +1322 -1322
- package/src/interfaces/definitions.ts +1 -1
- package/src/interfaces/defintions.ts +1 -1
- package/src/interfaces/fulaNativeModule.ts +177 -175
- package/src/interfaces/index.ts +3 -3
- package/src/interfaces/lookup.ts +2011 -2011
- package/src/interfaces/registry.ts +163 -163
- package/src/interfaces/types-lookup.ts +2165 -2165
- package/src/interfaces/types.ts +2 -2
- package/src/protocols/blockchain.ts +716 -644
- package/src/protocols/fxblox.ts +442 -442
|
@@ -1 +1 @@
|
|
|
1
|
-
// no custom definitions
|
|
1
|
+
// no custom definitions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,175 +1,177 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
interface FulaNativeModule {
|
|
4
|
-
registerLifecycleListener: () => Promise<void>;
|
|
5
|
-
initFula: (
|
|
6
|
-
identity: string, //Private key of did identity
|
|
7
|
-
storePath: string, //You can leave empty
|
|
8
|
-
bloxAddr: string, //Blox multiadddr needs to be manually entered now
|
|
9
|
-
exchange: string, //set to 'noope' for testing
|
|
10
|
-
autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
|
|
11
|
-
rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem
|
|
12
|
-
useRelay: boolean | null, // if true it forces the use of relay
|
|
13
|
-
refresh: boolean // if true it forces to refresh the fula object
|
|
14
|
-
) => Promise<{ peerId: string; rootCid: string }>;
|
|
15
|
-
newClient: (
|
|
16
|
-
identity: string, //Private key of did identity
|
|
17
|
-
storePath: string, //You can leave empty
|
|
18
|
-
bloxAddr: string, //Blox multiadddr needs to be manually entered now
|
|
19
|
-
exchange: string, //set to 'noope' for testing
|
|
20
|
-
autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
|
|
21
|
-
useRelay: boolean | null, // if true it forces the use of relay
|
|
22
|
-
refresh: boolean // if true it forces to refresh the fula object
|
|
23
|
-
) => Promise<string>;
|
|
24
|
-
isReady: (filesystemCheck: boolean) => Promise<boolean>;
|
|
25
|
-
logout: (identity: string, storePath: string) => Promise<boolean>;
|
|
26
|
-
checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
|
|
27
|
-
listFailedActions: (cids: string[]) => Promise<string[]>;
|
|
28
|
-
listRecentCidsAsString: () => Promise<string[]>;
|
|
29
|
-
listRecentCidsAsStringWithChildren: () => Promise<string[]>;
|
|
30
|
-
clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
|
|
31
|
-
checkConnection: (timeout: number) => Promise<boolean>;
|
|
32
|
-
get: (key: string) => Promise<string>;
|
|
33
|
-
has: (key: Uint8Array) => Promise<boolean>;
|
|
34
|
-
push: () => Promise<string>;
|
|
35
|
-
put: (content: string, codec: string) => Promise<string>;
|
|
36
|
-
mkdir: (path: string) => Promise<string>;
|
|
37
|
-
writeFileContent: (path: string, content: string) => Promise<string>;
|
|
38
|
-
writeFile: (
|
|
39
|
-
fulaTargetFilename: string,
|
|
40
|
-
localFilename: string
|
|
41
|
-
) => Promise<string>;
|
|
42
|
-
ls: (path: string) => Promise<string>;
|
|
43
|
-
rm: (path: string) => Promise<string>;
|
|
44
|
-
cp: (sourcePath: string, targetPath: string) => Promise<string>;
|
|
45
|
-
mv: (sourcePath: string, targetPath: string) => Promise<string>;
|
|
46
|
-
readFile: (
|
|
47
|
-
fulaTargetFilename: string,
|
|
48
|
-
localFilename: string
|
|
49
|
-
) => Promise<string>;
|
|
50
|
-
readFileContent: (path: string) => Promise<string>;
|
|
51
|
-
setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
|
|
52
|
-
|
|
53
|
-
shutdown: () => Promise<void>;
|
|
54
|
-
|
|
55
|
-
testData: (identity: string, bloxAddr: string) => Promise<string>;
|
|
56
|
-
|
|
57
|
-
//Blockchain related functions
|
|
58
|
-
createAccount: (seed: string) => Promise<string>;
|
|
59
|
-
checkAccountExists: (account: string) => Promise<string>;
|
|
60
|
-
accountFund: (account: string) => Promise<string>;
|
|
61
|
-
createPool: (seed: string, poolName: string) => Promise<string>;
|
|
62
|
-
listPools: () => Promise<string>;
|
|
63
|
-
joinPool: (poolID: string) => Promise<string>;
|
|
64
|
-
leavePool: (poolID: string) => Promise<string>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
'-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
interface FulaNativeModule {
|
|
4
|
+
registerLifecycleListener: () => Promise<void>;
|
|
5
|
+
initFula: (
|
|
6
|
+
identity: string, //Private key of did identity
|
|
7
|
+
storePath: string, //You can leave empty
|
|
8
|
+
bloxAddr: string, //Blox multiadddr needs to be manually entered now
|
|
9
|
+
exchange: string, //set to 'noope' for testing
|
|
10
|
+
autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
|
|
11
|
+
rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem
|
|
12
|
+
useRelay: boolean | null, // if true it forces the use of relay
|
|
13
|
+
refresh: boolean // if true it forces to refresh the fula object
|
|
14
|
+
) => Promise<{ peerId: string; rootCid: string }>;
|
|
15
|
+
newClient: (
|
|
16
|
+
identity: string, //Private key of did identity
|
|
17
|
+
storePath: string, //You can leave empty
|
|
18
|
+
bloxAddr: string, //Blox multiadddr needs to be manually entered now
|
|
19
|
+
exchange: string, //set to 'noope' for testing
|
|
20
|
+
autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
|
|
21
|
+
useRelay: boolean | null, // if true it forces the use of relay
|
|
22
|
+
refresh: boolean // if true it forces to refresh the fula object
|
|
23
|
+
) => Promise<string>;
|
|
24
|
+
isReady: (filesystemCheck: boolean) => Promise<boolean>;
|
|
25
|
+
logout: (identity: string, storePath: string) => Promise<boolean>;
|
|
26
|
+
checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
|
|
27
|
+
listFailedActions: (cids: string[]) => Promise<string[]>;
|
|
28
|
+
listRecentCidsAsString: () => Promise<string[]>;
|
|
29
|
+
listRecentCidsAsStringWithChildren: () => Promise<string[]>;
|
|
30
|
+
clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
|
|
31
|
+
checkConnection: (timeout: number) => Promise<boolean>;
|
|
32
|
+
get: (key: string) => Promise<string>;
|
|
33
|
+
has: (key: Uint8Array) => Promise<boolean>;
|
|
34
|
+
push: () => Promise<string>;
|
|
35
|
+
put: (content: string, codec: string) => Promise<string>;
|
|
36
|
+
mkdir: (path: string) => Promise<string>;
|
|
37
|
+
writeFileContent: (path: string, content: string) => Promise<string>;
|
|
38
|
+
writeFile: (
|
|
39
|
+
fulaTargetFilename: string,
|
|
40
|
+
localFilename: string
|
|
41
|
+
) => Promise<string>;
|
|
42
|
+
ls: (path: string) => Promise<string>;
|
|
43
|
+
rm: (path: string) => Promise<string>;
|
|
44
|
+
cp: (sourcePath: string, targetPath: string) => Promise<string>;
|
|
45
|
+
mv: (sourcePath: string, targetPath: string) => Promise<string>;
|
|
46
|
+
readFile: (
|
|
47
|
+
fulaTargetFilename: string,
|
|
48
|
+
localFilename: string
|
|
49
|
+
) => Promise<string>;
|
|
50
|
+
readFileContent: (path: string) => Promise<string>;
|
|
51
|
+
setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
|
|
52
|
+
|
|
53
|
+
shutdown: () => Promise<void>;
|
|
54
|
+
|
|
55
|
+
testData: (identity: string, bloxAddr: string) => Promise<string>;
|
|
56
|
+
|
|
57
|
+
//Blockchain related functions
|
|
58
|
+
createAccount: (seed: string) => Promise<string>;
|
|
59
|
+
checkAccountExists: (account: string) => Promise<string>;
|
|
60
|
+
accountFund: (account: string) => Promise<string>;
|
|
61
|
+
createPool: (seed: string, poolName: string) => Promise<string>;
|
|
62
|
+
listPools: () => Promise<string>;
|
|
63
|
+
joinPool: (poolID: string) => Promise<string>;
|
|
64
|
+
leavePool: (poolID: string) => Promise<string>;
|
|
65
|
+
joinPoolWithChain: (poolID: string, chainName: string) => Promise<string>;
|
|
66
|
+
leavePoolWithChain: (poolID: string, chainName: string) => Promise<string>;
|
|
67
|
+
cancelPoolJoin: (poolID: string) => Promise<string>;
|
|
68
|
+
listPoolJoinRequests: (poolID: string) => Promise<string>;
|
|
69
|
+
votePoolJoinRequest: (
|
|
70
|
+
seed: string,
|
|
71
|
+
poolID: number,
|
|
72
|
+
account: string,
|
|
73
|
+
accept: boolean
|
|
74
|
+
) => Promise<string>;
|
|
75
|
+
batchUploadManifest: (
|
|
76
|
+
cid: string[],
|
|
77
|
+
poolID: string,
|
|
78
|
+
replicationFactor: string
|
|
79
|
+
) => Promise<string>;
|
|
80
|
+
replicateInPool: (
|
|
81
|
+
cid: string[],
|
|
82
|
+
account: string,
|
|
83
|
+
poolID: string
|
|
84
|
+
) => Promise<string>;
|
|
85
|
+
newStoreRequest: (
|
|
86
|
+
seed: string,
|
|
87
|
+
poolID: number,
|
|
88
|
+
uploader: string,
|
|
89
|
+
cid: string
|
|
90
|
+
) => Promise<string>;
|
|
91
|
+
listAvailableReplicationRequests: (poolID: string) => Promise<string>;
|
|
92
|
+
removeReplicationRequest: (
|
|
93
|
+
seed: string,
|
|
94
|
+
poolID: number,
|
|
95
|
+
cid: string
|
|
96
|
+
) => Promise<string>;
|
|
97
|
+
removeStorer: (
|
|
98
|
+
seed: string,
|
|
99
|
+
storer: string,
|
|
100
|
+
poolID: number,
|
|
101
|
+
cid: string
|
|
102
|
+
) => Promise<string>;
|
|
103
|
+
removeStoredReplication: (
|
|
104
|
+
seed: string,
|
|
105
|
+
uploader: string,
|
|
106
|
+
poolID: number,
|
|
107
|
+
cid: string
|
|
108
|
+
) => Promise<string>;
|
|
109
|
+
|
|
110
|
+
//On Blox calls for chain
|
|
111
|
+
//Hardware
|
|
112
|
+
assetsBalance: (
|
|
113
|
+
account: string,
|
|
114
|
+
assetId: string,
|
|
115
|
+
classId: string
|
|
116
|
+
) => Promise<string>;
|
|
117
|
+
transferToFula: (
|
|
118
|
+
amount: string,
|
|
119
|
+
wallet: string,
|
|
120
|
+
chain: string
|
|
121
|
+
) => Promise<string>;
|
|
122
|
+
getAccount: () => Promise<string>;
|
|
123
|
+
|
|
124
|
+
//Hardware
|
|
125
|
+
eraseBlData: () => Promise<string>;
|
|
126
|
+
fetchContainerLogs: (
|
|
127
|
+
containerName: string,
|
|
128
|
+
tailCount: string
|
|
129
|
+
) => Promise<string>;
|
|
130
|
+
findBestAndTargetInLogs: (
|
|
131
|
+
containerName: string,
|
|
132
|
+
tailCount: string
|
|
133
|
+
) => Promise<string>;
|
|
134
|
+
getFolderSize: (folderPath: string) => Promise<string>;
|
|
135
|
+
getDatastoreSize: () => Promise<string>;
|
|
136
|
+
bloxFreeSpace: () => Promise<string>;
|
|
137
|
+
wifiRemoveall: () => Promise<string>;
|
|
138
|
+
reboot: () => Promise<string>;
|
|
139
|
+
partition: () => Promise<string>;
|
|
140
|
+
|
|
141
|
+
// Plugin related functions
|
|
142
|
+
listPlugins: () => Promise<string>;
|
|
143
|
+
listActivePlugins: () => Promise<string>;
|
|
144
|
+
installPlugin: (pluginName: string, params: string) => Promise<string>;
|
|
145
|
+
uninstallPlugin: (pluginName: string) => Promise<string>;
|
|
146
|
+
showPluginStatus: (pluginName: string, lines: number) => Promise<string>;
|
|
147
|
+
getInstallOutput: (pluginName: string, params: string) => Promise<string>;
|
|
148
|
+
getInstallStatus: (pluginName: string) => Promise<string>;
|
|
149
|
+
updatePlugin: (pluginName: string) => Promise<string>;
|
|
150
|
+
deleteDsLock: () => Promise<void>;
|
|
151
|
+
|
|
152
|
+
//AI
|
|
153
|
+
chatWithAI: (aiModel: string, userMessage: string) => Promise<string>;
|
|
154
|
+
getChatChunk: (streamID: string) => Promise<string>;
|
|
155
|
+
streamChunks: (streamID: string) => Promise<void>;
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const LINKING_ERROR =
|
|
161
|
+
`The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
|
|
162
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
163
|
+
'- You rebuilt the app after installing the package\n' +
|
|
164
|
+
'- You are not using Expo managed workflow\n';
|
|
165
|
+
|
|
166
|
+
const Fula = NativeModules.FulaModule
|
|
167
|
+
? NativeModules.FulaModule
|
|
168
|
+
: new Proxy(
|
|
169
|
+
{},
|
|
170
|
+
{
|
|
171
|
+
get() {
|
|
172
|
+
throw new Error(LINKING_ERROR);
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
export default Fula as FulaNativeModule;
|
package/src/interfaces/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|