@functionland/react-native-fula 1.19.0 → 1.20.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,130 +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
- 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;
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;
@@ -1,4 +1,4 @@
1
- // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
- /* eslint-disable */
3
-
4
- //export * from './types.ts';
1
+ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
+ /* eslint-disable */
3
+
4
+ //export * from './types.ts';