@functionland/react-native-fula 1.9.0 → 1.12.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.
- package/README.md +214 -205
- package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.idea/compiler.xml +1 -1
- package/android/.idea/gradle.xml +1 -0
- package/android/.idea/misc.xml +9 -9
- package/android/.idea/sonarlint/securityhotspotstore/index.pb +0 -0
- package/android/build.gradle +70 -69
- package/android/src/main/java/land/fx/fula/Cryptography.java +60 -60
- package/android/src/main/java/land/fx/fula/FulaModule.java +1477 -1384
- package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/protocols/fula.js +113 -98
- package/lib/commonjs/protocols/fula.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/protocols/fula.js +109 -96
- package/lib/module/protocols/fula.js.map +1 -1
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +2 -0
- package/lib/typescript/protocols/fula.d.ts +5 -0
- package/package.json +157 -157
- package/src/interfaces/fulaNativeModule.ts +122 -119
- package/src/protocols/fula.ts +301 -286
package/package.json
CHANGED
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@functionland/react-native-fula",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "This package is a bridge to use the Fula libp2p protocols in the react-native which is using wnfs",
|
|
5
|
-
"main": "lib/commonjs/index",
|
|
6
|
-
"module": "lib/module/index",
|
|
7
|
-
"types": "lib/typescript/index.d.ts",
|
|
8
|
-
"react-native": "src/index",
|
|
9
|
-
"source": "src/index",
|
|
10
|
-
"files": [
|
|
11
|
-
"src",
|
|
12
|
-
"lib",
|
|
13
|
-
"android",
|
|
14
|
-
"ios",
|
|
15
|
-
"cpp",
|
|
16
|
-
"!example/",
|
|
17
|
-
"react-native-fula.podspec",
|
|
18
|
-
"!lib/typescript/example",
|
|
19
|
-
"!android/build",
|
|
20
|
-
"!ios/build",
|
|
21
|
-
"!**/__tests__",
|
|
22
|
-
"!**/__fixtures__",
|
|
23
|
-
"!**/__mocks__"
|
|
24
|
-
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "jest",
|
|
27
|
-
"typescript": "tsc --noEmit",
|
|
28
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
29
|
-
"prepare": "bob build",
|
|
30
|
-
"release": "release-it",
|
|
31
|
-
"example": "set NODE_OPTIONS='' && yarn --cwd example",
|
|
32
|
-
"pods": "cd example && pod-install --quiet",
|
|
33
|
-
"bootstrap": "yarn example && yarn && yarn pods"
|
|
34
|
-
},
|
|
35
|
-
"keywords": [
|
|
36
|
-
"react-native",
|
|
37
|
-
"ios",
|
|
38
|
-
"android"
|
|
39
|
-
],
|
|
40
|
-
"repository": "https://github.com/functionland/react-native-fula",
|
|
41
|
-
"author": "Ehsan Shariati <ehsan6sha@gmail.com> (https://github.com/ehsan6sha)",
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"bugs": {
|
|
44
|
-
"url": "https://github.com/functionland/react-native-fula/issues"
|
|
45
|
-
},
|
|
46
|
-
"homepage": "https://github.com/functionland/react-native-fula#readme",
|
|
47
|
-
"publishConfig": {
|
|
48
|
-
"registry": "https://registry.npmjs.org"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.16.7",
|
|
52
|
-
"@commitlint/config-conventional": "^11.0.0",
|
|
53
|
-
"@react-native-community/eslint-config": "^2.0.0",
|
|
54
|
-
"@release-it/conventional-changelog": "^2.0.0",
|
|
55
|
-
"@types/jest": "^26.0.0",
|
|
56
|
-
"@types/react": "^16.9.19",
|
|
57
|
-
"@types/react-native": "0.70.8",
|
|
58
|
-
"commitlint": "^11.0.0",
|
|
59
|
-
"eslint": "^7.2.0",
|
|
60
|
-
"eslint-config-prettier": "^7.0.0",
|
|
61
|
-
"eslint-plugin-prettier": "^3.1.3",
|
|
62
|
-
"husky": "^6.0.0",
|
|
63
|
-
"jest": "^26.0.1",
|
|
64
|
-
"pod-install": "^0.1.0",
|
|
65
|
-
"prettier": "^2.0.5",
|
|
66
|
-
"react": "^18.1.0",
|
|
67
|
-
"react-native": "0.70.6",
|
|
68
|
-
"react-native-builder-bob": "^0.18.0",
|
|
69
|
-
"release-it": "^14.2.2",
|
|
70
|
-
"typescript": "^4.1.3"
|
|
71
|
-
},
|
|
72
|
-
"peerDependencies": {
|
|
73
|
-
"@babel/core": "^7.0.0-0",
|
|
74
|
-
"@babel/preset-env": "^7.1.6",
|
|
75
|
-
"react": "*",
|
|
76
|
-
"react-native": "*"
|
|
77
|
-
},
|
|
78
|
-
"jest": {
|
|
79
|
-
"preset": "react-native",
|
|
80
|
-
"modulePathIgnorePatterns": [
|
|
81
|
-
"<rootDir>/example/node_modules",
|
|
82
|
-
"<rootDir>/lib/"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"commitlint": {
|
|
86
|
-
"extends": [
|
|
87
|
-
"@commitlint/config-conventional"
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
"release-it": {
|
|
91
|
-
"git": {
|
|
92
|
-
"commitMessage": "chore: release ${version}",
|
|
93
|
-
"tagName": "v${version}"
|
|
94
|
-
},
|
|
95
|
-
"npm": {
|
|
96
|
-
"publish": true
|
|
97
|
-
},
|
|
98
|
-
"github": {
|
|
99
|
-
"release": true
|
|
100
|
-
},
|
|
101
|
-
"plugins": {
|
|
102
|
-
"@release-it/conventional-changelog": {
|
|
103
|
-
"preset": "angular"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"eslintConfig": {
|
|
108
|
-
"root": true,
|
|
109
|
-
"extends": [
|
|
110
|
-
"@react-native-community",
|
|
111
|
-
"prettier"
|
|
112
|
-
],
|
|
113
|
-
"rules": {
|
|
114
|
-
"prettier/prettier": [
|
|
115
|
-
"error",
|
|
116
|
-
{
|
|
117
|
-
"quoteProps": "consistent",
|
|
118
|
-
"singleQuote": true,
|
|
119
|
-
"tabWidth": 2,
|
|
120
|
-
"trailingComma": "es5",
|
|
121
|
-
"useTabs": false
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"eslintIgnore": [
|
|
127
|
-
"node_modules/",
|
|
128
|
-
"lib/"
|
|
129
|
-
],
|
|
130
|
-
"prettier": {
|
|
131
|
-
"quoteProps": "consistent",
|
|
132
|
-
"singleQuote": true,
|
|
133
|
-
"tabWidth": 2,
|
|
134
|
-
"trailingComma": "es5",
|
|
135
|
-
"useTabs": false
|
|
136
|
-
},
|
|
137
|
-
"react-native-builder-bob": {
|
|
138
|
-
"source": "src",
|
|
139
|
-
"output": "lib",
|
|
140
|
-
"targets": [
|
|
141
|
-
"commonjs",
|
|
142
|
-
"module",
|
|
143
|
-
[
|
|
144
|
-
"typescript",
|
|
145
|
-
{
|
|
146
|
-
"project": "tsconfig.build.json"
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
"dependencies": {
|
|
152
|
-
"@polkadot/api": "^9.11.3",
|
|
153
|
-
"@polkadot/keyring": "^10.2.6",
|
|
154
|
-
"@polkadot/util": "^10.2.6",
|
|
155
|
-
"@polkadot/util-crypto": "^10.2.6"
|
|
156
|
-
}
|
|
157
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@functionland/react-native-fula",
|
|
3
|
+
"version": "1.12.0",
|
|
4
|
+
"description": "This package is a bridge to use the Fula libp2p protocols in the react-native which is using wnfs",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"android",
|
|
14
|
+
"ios",
|
|
15
|
+
"cpp",
|
|
16
|
+
"!example/",
|
|
17
|
+
"react-native-fula.podspec",
|
|
18
|
+
"!lib/typescript/example",
|
|
19
|
+
"!android/build",
|
|
20
|
+
"!ios/build",
|
|
21
|
+
"!**/__tests__",
|
|
22
|
+
"!**/__fixtures__",
|
|
23
|
+
"!**/__mocks__"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "jest",
|
|
27
|
+
"typescript": "tsc --noEmit",
|
|
28
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
29
|
+
"prepare": "bob build",
|
|
30
|
+
"release": "release-it",
|
|
31
|
+
"example": "set NODE_OPTIONS='' && yarn --cwd example",
|
|
32
|
+
"pods": "cd example && pod-install --quiet",
|
|
33
|
+
"bootstrap": "yarn example && yarn && yarn pods"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"react-native",
|
|
37
|
+
"ios",
|
|
38
|
+
"android"
|
|
39
|
+
],
|
|
40
|
+
"repository": "https://github.com/functionland/react-native-fula",
|
|
41
|
+
"author": "Ehsan Shariati <ehsan6sha@gmail.com> (https://github.com/ehsan6sha)",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/functionland/react-native-fula/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/functionland/react-native-fula#readme",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.16.7",
|
|
52
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
53
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
54
|
+
"@release-it/conventional-changelog": "^2.0.0",
|
|
55
|
+
"@types/jest": "^26.0.0",
|
|
56
|
+
"@types/react": "^16.9.19",
|
|
57
|
+
"@types/react-native": "0.70.8",
|
|
58
|
+
"commitlint": "^11.0.0",
|
|
59
|
+
"eslint": "^7.2.0",
|
|
60
|
+
"eslint-config-prettier": "^7.0.0",
|
|
61
|
+
"eslint-plugin-prettier": "^3.1.3",
|
|
62
|
+
"husky": "^6.0.0",
|
|
63
|
+
"jest": "^26.0.1",
|
|
64
|
+
"pod-install": "^0.1.0",
|
|
65
|
+
"prettier": "^2.0.5",
|
|
66
|
+
"react": "^18.1.0",
|
|
67
|
+
"react-native": "0.70.6",
|
|
68
|
+
"react-native-builder-bob": "^0.18.0",
|
|
69
|
+
"release-it": "^14.2.2",
|
|
70
|
+
"typescript": "^4.1.3"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@babel/core": "^7.0.0-0",
|
|
74
|
+
"@babel/preset-env": "^7.1.6",
|
|
75
|
+
"react": "*",
|
|
76
|
+
"react-native": "*"
|
|
77
|
+
},
|
|
78
|
+
"jest": {
|
|
79
|
+
"preset": "react-native",
|
|
80
|
+
"modulePathIgnorePatterns": [
|
|
81
|
+
"<rootDir>/example/node_modules",
|
|
82
|
+
"<rootDir>/lib/"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"commitlint": {
|
|
86
|
+
"extends": [
|
|
87
|
+
"@commitlint/config-conventional"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"release-it": {
|
|
91
|
+
"git": {
|
|
92
|
+
"commitMessage": "chore: release ${version}",
|
|
93
|
+
"tagName": "v${version}"
|
|
94
|
+
},
|
|
95
|
+
"npm": {
|
|
96
|
+
"publish": true
|
|
97
|
+
},
|
|
98
|
+
"github": {
|
|
99
|
+
"release": true
|
|
100
|
+
},
|
|
101
|
+
"plugins": {
|
|
102
|
+
"@release-it/conventional-changelog": {
|
|
103
|
+
"preset": "angular"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"eslintConfig": {
|
|
108
|
+
"root": true,
|
|
109
|
+
"extends": [
|
|
110
|
+
"@react-native-community",
|
|
111
|
+
"prettier"
|
|
112
|
+
],
|
|
113
|
+
"rules": {
|
|
114
|
+
"prettier/prettier": [
|
|
115
|
+
"error",
|
|
116
|
+
{
|
|
117
|
+
"quoteProps": "consistent",
|
|
118
|
+
"singleQuote": true,
|
|
119
|
+
"tabWidth": 2,
|
|
120
|
+
"trailingComma": "es5",
|
|
121
|
+
"useTabs": false
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"eslintIgnore": [
|
|
127
|
+
"node_modules/",
|
|
128
|
+
"lib/"
|
|
129
|
+
],
|
|
130
|
+
"prettier": {
|
|
131
|
+
"quoteProps": "consistent",
|
|
132
|
+
"singleQuote": true,
|
|
133
|
+
"tabWidth": 2,
|
|
134
|
+
"trailingComma": "es5",
|
|
135
|
+
"useTabs": false
|
|
136
|
+
},
|
|
137
|
+
"react-native-builder-bob": {
|
|
138
|
+
"source": "src",
|
|
139
|
+
"output": "lib",
|
|
140
|
+
"targets": [
|
|
141
|
+
"commonjs",
|
|
142
|
+
"module",
|
|
143
|
+
[
|
|
144
|
+
"typescript",
|
|
145
|
+
{
|
|
146
|
+
"project": "tsconfig.build.json"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"dependencies": {
|
|
152
|
+
"@polkadot/api": "^9.11.3",
|
|
153
|
+
"@polkadot/keyring": "^10.2.6",
|
|
154
|
+
"@polkadot/util": "^10.2.6",
|
|
155
|
+
"@polkadot/util-crypto": "^10.2.6"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -1,119 +1,122 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
interface FulaNativeModule {
|
|
4
|
-
init: (
|
|
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; private_ref: 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
interface FulaNativeModule {
|
|
4
|
+
init: (
|
|
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; private_ref: 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;
|