@functionland/react-native-fula 1.37.0 → 1.39.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.
@@ -1,141 +1,141 @@
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
- clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
30
- checkConnection: (timeout: number) => Promise<boolean>;
31
- get: (key: string) => Promise<string>;
32
- has: (key: Uint8Array) => Promise<boolean>;
33
- push: () => Promise<string>;
34
- put: (content: string, codec: string) => Promise<string>;
35
- mkdir: (path: string) => Promise<string>;
36
- writeFileContent: (path: string, content: string) => Promise<string>;
37
- writeFile: (
38
- fulaTargetFilename: string,
39
- localFilename: string
40
- ) => Promise<string>;
41
- ls: (path: string) => Promise<string>;
42
- rm: (path: string) => Promise<string>;
43
- cp: (sourcePath: string, targetPath: string) => Promise<string>;
44
- mv: (sourcePath: string, targetPath: string) => Promise<string>;
45
- readFile: (
46
- fulaTargetFilename: string,
47
- localFilename: string
48
- ) => Promise<string>;
49
- readFileContent: (path: string) => Promise<string>;
50
- setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
51
-
52
- shutdown: () => Promise<void>;
53
-
54
- testData: (identity: string, bloxAddr: string) => Promise<string>;
55
-
56
- //Blockchain related functions
57
- createAccount: (seed: string) => Promise<string>;
58
- checkAccountExists: (account: string) => Promise<string>;
59
- createPool: (seed: string, poolName: string) => Promise<string>;
60
- listPools: () => Promise<string>;
61
- joinPool: (poolID: string) => Promise<string>;
62
- leavePool: (poolID: number) => Promise<string>;
63
- cancelPoolJoin: (poolID: number) => Promise<string>;
64
- listPoolJoinRequests: (poolID: number) => Promise<string>;
65
- votePoolJoinRequest: (
66
- seed: string,
67
- poolID: number,
68
- account: string,
69
- accept: boolean
70
- ) => Promise<string>;
71
- newReplicationRequest: (
72
- seed: string,
73
- poolID: number,
74
- replicationFactor: number,
75
- cid: string
76
- ) => Promise<string>;
77
- newStoreRequest: (
78
- seed: string,
79
- poolID: number,
80
- uploader: string,
81
- cid: string
82
- ) => Promise<string>;
83
- listAvailableReplicationRequests: (poolID: number) => Promise<string>;
84
- removeReplicationRequest: (
85
- seed: string,
86
- poolID: number,
87
- cid: string
88
- ) => Promise<string>;
89
- removeStorer: (
90
- seed: string,
91
- storer: string,
92
- poolID: number,
93
- cid: string
94
- ) => Promise<string>;
95
- removeStoredReplication: (
96
- seed: string,
97
- uploader: string,
98
- poolID: number,
99
- cid: string
100
- ) => Promise<string>;
101
-
102
- //On Blox calls for chain
103
- //Hardware
104
- assetsBalance: (
105
- account: string,
106
- assetId: string,
107
- classId: string
108
- ) => Promise<string>;
109
- transferToFula: (
110
- amount: string,
111
- wallet: string,
112
- chain: string
113
- ) => Promise<string>;
114
- getAccount: () => Promise<string>;
115
-
116
-
117
- //Hardware
118
- eraseBlData: () => Promise<string>;
119
- bloxFreeSpace: () => Promise<string>;
120
- wifiRemoveall: () => Promise<string>;
121
- reboot: () => Promise<string>;
122
- }
123
-
124
- const LINKING_ERROR =
125
- `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
126
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
127
- '- You rebuilt the app after installing the package\n' +
128
- '- You are not using Expo managed workflow\n';
129
-
130
- const Fula = NativeModules.FulaModule
131
- ? NativeModules.FulaModule
132
- : new Proxy(
133
- {},
134
- {
135
- get() {
136
- throw new Error(LINKING_ERROR);
137
- },
138
- }
139
- );
140
-
141
- export default Fula as FulaNativeModule;
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
+ clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
30
+ checkConnection: (timeout: number) => Promise<boolean>;
31
+ get: (key: string) => Promise<string>;
32
+ has: (key: Uint8Array) => Promise<boolean>;
33
+ push: () => Promise<string>;
34
+ put: (content: string, codec: string) => Promise<string>;
35
+ mkdir: (path: string) => Promise<string>;
36
+ writeFileContent: (path: string, content: string) => Promise<string>;
37
+ writeFile: (
38
+ fulaTargetFilename: string,
39
+ localFilename: string
40
+ ) => Promise<string>;
41
+ ls: (path: string) => Promise<string>;
42
+ rm: (path: string) => Promise<string>;
43
+ cp: (sourcePath: string, targetPath: string) => Promise<string>;
44
+ mv: (sourcePath: string, targetPath: string) => Promise<string>;
45
+ readFile: (
46
+ fulaTargetFilename: string,
47
+ localFilename: string
48
+ ) => Promise<string>;
49
+ readFileContent: (path: string) => Promise<string>;
50
+ setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
51
+
52
+ shutdown: () => Promise<void>;
53
+
54
+ testData: (identity: string, bloxAddr: string) => Promise<string>;
55
+
56
+ //Blockchain related functions
57
+ createAccount: (seed: string) => Promise<string>;
58
+ checkAccountExists: (account: string) => Promise<string>;
59
+ createPool: (seed: string, poolName: string) => Promise<string>;
60
+ listPools: () => Promise<string>;
61
+ joinPool: (poolID: string) => Promise<string>;
62
+ leavePool: (poolID: number) => Promise<string>;
63
+ cancelPoolJoin: (poolID: number) => Promise<string>;
64
+ listPoolJoinRequests: (poolID: number) => Promise<string>;
65
+ votePoolJoinRequest: (
66
+ seed: string,
67
+ poolID: number,
68
+ account: string,
69
+ accept: boolean
70
+ ) => Promise<string>;
71
+ newReplicationRequest: (
72
+ seed: string,
73
+ poolID: number,
74
+ replicationFactor: number,
75
+ cid: string
76
+ ) => Promise<string>;
77
+ newStoreRequest: (
78
+ seed: string,
79
+ poolID: number,
80
+ uploader: string,
81
+ cid: string
82
+ ) => Promise<string>;
83
+ listAvailableReplicationRequests: (poolID: number) => Promise<string>;
84
+ removeReplicationRequest: (
85
+ seed: string,
86
+ poolID: number,
87
+ cid: string
88
+ ) => Promise<string>;
89
+ removeStorer: (
90
+ seed: string,
91
+ storer: string,
92
+ poolID: number,
93
+ cid: string
94
+ ) => Promise<string>;
95
+ removeStoredReplication: (
96
+ seed: string,
97
+ uploader: string,
98
+ poolID: number,
99
+ cid: string
100
+ ) => Promise<string>;
101
+
102
+ //On Blox calls for chain
103
+ //Hardware
104
+ assetsBalance: (
105
+ account: string,
106
+ assetId: number,
107
+ classId: number
108
+ ) => Promise<string>;
109
+ transferToFula: (
110
+ amount: string,
111
+ wallet: string,
112
+ chain: string
113
+ ) => Promise<string>;
114
+ getAccount: () => Promise<string>;
115
+
116
+
117
+ //Hardware
118
+ eraseBlData: () => Promise<string>;
119
+ bloxFreeSpace: () => Promise<string>;
120
+ wifiRemoveall: () => Promise<string>;
121
+ reboot: () => Promise<string>;
122
+ }
123
+
124
+ const LINKING_ERROR =
125
+ `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
126
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
127
+ '- You rebuilt the app after installing the package\n' +
128
+ '- You are not using Expo managed workflow\n';
129
+
130
+ const Fula = NativeModules.FulaModule
131
+ ? NativeModules.FulaModule
132
+ : new Proxy(
133
+ {},
134
+ {
135
+ get() {
136
+ throw new Error(LINKING_ERROR);
137
+ },
138
+ }
139
+ );
140
+
141
+ export default Fula as FulaNativeModule;