@functionland/react-native-fula 1.32.0 → 1.33.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/android/build.gradle +110 -110
- package/android/src/main/java/land/fx/fula/FulaModule.java +1473 -1438
- package/ios/Fula.mm +16 -0
- package/ios/Fula.swift +114 -43
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +23 -1
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/fxblox.js +26 -7
- package/lib/commonjs/protocols/fxblox.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/protocols/blockchain.js +21 -0
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/fxblox.js +24 -6
- package/lib/module/protocols/fxblox.js.map +1 -1
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +4 -2
- package/lib/typescript/interfaces/fulaNativeModule.d.ts.map +1 -1
- package/lib/typescript/protocols/blockchain.d.ts +1 -0
- package/lib/typescript/protocols/blockchain.d.ts.map +1 -1
- package/lib/typescript/protocols/fxblox.d.ts +1 -0
- package/lib/typescript/protocols/fxblox.d.ts.map +1 -1
- package/lib/typescript/types/blockchain.d.ts +4 -0
- package/lib/typescript/types/blockchain.d.ts.map +1 -1
- package/lib/typescript/types/fxblox.d.ts +4 -0
- package/lib/typescript/types/fxblox.d.ts.map +1 -1
- package/package.json +178 -178
- package/src/interfaces/fulaNativeModule.ts +14 -4
- package/src/protocols/blockchain.ts +27 -0
- package/src/protocols/fxblox.ts +27 -6
- package/src/types/blockchain.ts +5 -0
- package/src/types/fxblox.ts +5 -0
|
@@ -16,6 +16,10 @@ export interface GetAccountResponse {
|
|
|
16
16
|
export interface AssetsBalanceResponse {
|
|
17
17
|
amount: string;
|
|
18
18
|
}
|
|
19
|
+
export interface TransferToFulaResponse {
|
|
20
|
+
msg: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}
|
|
19
23
|
export interface PoolJoinResponse {
|
|
20
24
|
account: string;
|
|
21
25
|
poolID: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockchain.d.ts","sourceRoot":"","sources":["../../../src/types/blockchain.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"blockchain.d.ts","sourceRoot":"","sources":["../../../src/types/blockchain.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fxblox.d.ts","sourceRoot":"","sources":["../../../src/types/fxblox.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"fxblox.d.ts","sourceRoot":"","sources":["../../../src/types/fxblox.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
package/package.json
CHANGED
|
@@ -1,178 +1,178 @@
|
|
|
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
|
-
"*.podspec",
|
|
17
|
-
"!lib/typescript/example",
|
|
18
|
-
"!ios/build",
|
|
19
|
-
"!android/build",
|
|
20
|
-
"!android/gradle",
|
|
21
|
-
"!android/gradlew",
|
|
22
|
-
"!android/gradlew.bat",
|
|
23
|
-
"!android/local.properties",
|
|
24
|
-
"!**/__tests__",
|
|
25
|
-
"!**/__fixtures__",
|
|
26
|
-
"!**/__mocks__",
|
|
27
|
-
"!**/.*"
|
|
28
|
-
],
|
|
29
|
-
"scripts": {
|
|
30
|
-
"test": "jest",
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
33
|
-
"prepack": "bob build",
|
|
34
|
-
"release": "release-it",
|
|
35
|
-
"example": "yarn --cwd example",
|
|
36
|
-
"build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
37
|
-
"build:ios": "cd example/ios && xcodebuild -workspace FulaExample.xcworkspace -scheme FulaExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
|
|
38
|
-
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
39
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
|
|
40
|
-
"build:polkadot": "yarn generate:defs && yarn generate:meta",
|
|
41
|
-
"generate:defs": "ts-node --skip-project node_modules/.bin/polkadot-types-from-defs --input ./src/interfaces --endpoint ./edgeware.json",
|
|
42
|
-
"generate:meta": "ts-node --skip-project node_modules/.bin/polkadot-types-from-chain --endpoint ./edgeware.json --output ./src/interfaces"
|
|
43
|
-
},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"react-native",
|
|
46
|
-
"ios",
|
|
47
|
-
"android"
|
|
48
|
-
],
|
|
49
|
-
"repository": "https://github.com/functionland/react-native-fula",
|
|
50
|
-
"author": "Ehsan Shariati <ehsan6sha@gmail.com> (https://github.com/ehsan6sha)",
|
|
51
|
-
"license": "MIT",
|
|
52
|
-
"bugs": {
|
|
53
|
-
"url": "https://github.com/functionland/react-native-fula/issues"
|
|
54
|
-
},
|
|
55
|
-
"homepage": "https://github.com/functionland/react-native-fula#readme",
|
|
56
|
-
"publishConfig": {
|
|
57
|
-
"registry": "https://registry.npmjs.org/"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.16.7",
|
|
61
|
-
"@commitlint/config-conventional": "^17.0.2",
|
|
62
|
-
"@evilmartians/lefthook": "^1.2.2",
|
|
63
|
-
"@react-native-community/eslint-config": "^3.0.2",
|
|
64
|
-
"@release-it/conventional-changelog": "^5.0.0",
|
|
65
|
-
"@types/jest": "^28.1.2",
|
|
66
|
-
"@types/react": "~17.0.21",
|
|
67
|
-
"@types/react-native": "0.70.0",
|
|
68
|
-
"commitlint": "^17.0.2",
|
|
69
|
-
"del-cli": "^5.0.0",
|
|
70
|
-
"eslint": "^8.4.1",
|
|
71
|
-
"eslint-config-prettier": "^8.5.0",
|
|
72
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
73
|
-
"jest": "^28.1.1",
|
|
74
|
-
"pod-install": "^0.1.0",
|
|
75
|
-
"prettier": "^2.0.5",
|
|
76
|
-
"react": "18.2.0",
|
|
77
|
-
"react-native": "0.72.3",
|
|
78
|
-
"react-native-builder-bob": "^0.20.0",
|
|
79
|
-
"release-it": "^15.0.0",
|
|
80
|
-
"ts-node": "^10.9.1",
|
|
81
|
-
"turbo": "^1.10.7",
|
|
82
|
-
"typescript": "^5.0.2"
|
|
83
|
-
},
|
|
84
|
-
"resolutions": {
|
|
85
|
-
"@types/react": "17.0.21"
|
|
86
|
-
},
|
|
87
|
-
"peerDependencies": {
|
|
88
|
-
"@babel/core": "^7.0.0-0",
|
|
89
|
-
"@babel/preset-env": "^7.1.6",
|
|
90
|
-
"react": "*",
|
|
91
|
-
"react-native": "*"
|
|
92
|
-
},
|
|
93
|
-
"engines": {
|
|
94
|
-
"node": ">= 16.0.0"
|
|
95
|
-
},
|
|
96
|
-
"packageManager": "^yarn@1.22.15",
|
|
97
|
-
"jest": {
|
|
98
|
-
"preset": "react-native",
|
|
99
|
-
"modulePathIgnorePatterns": [
|
|
100
|
-
"<rootDir>/example/node_modules",
|
|
101
|
-
"<rootDir>/lib/"
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
"commitlint": {
|
|
105
|
-
"extends": [
|
|
106
|
-
"@commitlint/config-conventional"
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
|
-
"release-it": {
|
|
110
|
-
"git": {
|
|
111
|
-
"commitMessage": "chore: release ${version}",
|
|
112
|
-
"tagName": "v${version}"
|
|
113
|
-
},
|
|
114
|
-
"npm": {
|
|
115
|
-
"publish": true
|
|
116
|
-
},
|
|
117
|
-
"github": {
|
|
118
|
-
"release": true
|
|
119
|
-
},
|
|
120
|
-
"plugins": {
|
|
121
|
-
"@release-it/conventional-changelog": {
|
|
122
|
-
"preset": "angular"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"eslintConfig": {
|
|
127
|
-
"root": true,
|
|
128
|
-
"extends": [
|
|
129
|
-
"@react-native-community",
|
|
130
|
-
"prettier"
|
|
131
|
-
],
|
|
132
|
-
"rules": {
|
|
133
|
-
"prettier/prettier": [
|
|
134
|
-
"error",
|
|
135
|
-
{
|
|
136
|
-
"quoteProps": "consistent",
|
|
137
|
-
"singleQuote": true,
|
|
138
|
-
"tabWidth": 2,
|
|
139
|
-
"trailingComma": "es5",
|
|
140
|
-
"useTabs": false
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
"eslintIgnore": [
|
|
146
|
-
"node_modules/",
|
|
147
|
-
"lib/"
|
|
148
|
-
],
|
|
149
|
-
"prettier": {
|
|
150
|
-
"quoteProps": "consistent",
|
|
151
|
-
"singleQuote": true,
|
|
152
|
-
"tabWidth": 2,
|
|
153
|
-
"trailingComma": "es5",
|
|
154
|
-
"useTabs": false
|
|
155
|
-
},
|
|
156
|
-
"react-native-builder-bob": {
|
|
157
|
-
"source": "src",
|
|
158
|
-
"output": "lib",
|
|
159
|
-
"targets": [
|
|
160
|
-
"commonjs",
|
|
161
|
-
"module",
|
|
162
|
-
[
|
|
163
|
-
"typescript",
|
|
164
|
-
{
|
|
165
|
-
"project": "tsconfig.build.json"
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
]
|
|
169
|
-
},
|
|
170
|
-
"dependencies": {
|
|
171
|
-
"@polkadot/api": "^9.11.3",
|
|
172
|
-
"@polkadot/keyring": "^10.2.6",
|
|
173
|
-
"@polkadot/typegen": "^10.10.1",
|
|
174
|
-
"@polkadot/util": "^10.2.6",
|
|
175
|
-
"@polkadot/util-crypto": "^10.2.6",
|
|
176
|
-
"text-encoding": "^0.7.0"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@functionland/react-native-fula",
|
|
3
|
+
"version": "1.33.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
|
+
"*.podspec",
|
|
17
|
+
"!lib/typescript/example",
|
|
18
|
+
"!ios/build",
|
|
19
|
+
"!android/build",
|
|
20
|
+
"!android/gradle",
|
|
21
|
+
"!android/gradlew",
|
|
22
|
+
"!android/gradlew.bat",
|
|
23
|
+
"!android/local.properties",
|
|
24
|
+
"!**/__tests__",
|
|
25
|
+
"!**/__fixtures__",
|
|
26
|
+
"!**/__mocks__",
|
|
27
|
+
"!**/.*"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
33
|
+
"prepack": "bob build",
|
|
34
|
+
"release": "release-it",
|
|
35
|
+
"example": "yarn --cwd example",
|
|
36
|
+
"build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
37
|
+
"build:ios": "cd example/ios && xcodebuild -workspace FulaExample.xcworkspace -scheme FulaExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
|
|
38
|
+
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
39
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
|
|
40
|
+
"build:polkadot": "yarn generate:defs && yarn generate:meta",
|
|
41
|
+
"generate:defs": "ts-node --skip-project node_modules/.bin/polkadot-types-from-defs --input ./src/interfaces --endpoint ./edgeware.json",
|
|
42
|
+
"generate:meta": "ts-node --skip-project node_modules/.bin/polkadot-types-from-chain --endpoint ./edgeware.json --output ./src/interfaces"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"react-native",
|
|
46
|
+
"ios",
|
|
47
|
+
"android"
|
|
48
|
+
],
|
|
49
|
+
"repository": "https://github.com/functionland/react-native-fula",
|
|
50
|
+
"author": "Ehsan Shariati <ehsan6sha@gmail.com> (https://github.com/ehsan6sha)",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/functionland/react-native-fula/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/functionland/react-native-fula#readme",
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"registry": "https://registry.npmjs.org/"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.16.7",
|
|
61
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
62
|
+
"@evilmartians/lefthook": "^1.2.2",
|
|
63
|
+
"@react-native-community/eslint-config": "^3.0.2",
|
|
64
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
65
|
+
"@types/jest": "^28.1.2",
|
|
66
|
+
"@types/react": "~17.0.21",
|
|
67
|
+
"@types/react-native": "0.70.0",
|
|
68
|
+
"commitlint": "^17.0.2",
|
|
69
|
+
"del-cli": "^5.0.0",
|
|
70
|
+
"eslint": "^8.4.1",
|
|
71
|
+
"eslint-config-prettier": "^8.5.0",
|
|
72
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
73
|
+
"jest": "^28.1.1",
|
|
74
|
+
"pod-install": "^0.1.0",
|
|
75
|
+
"prettier": "^2.0.5",
|
|
76
|
+
"react": "18.2.0",
|
|
77
|
+
"react-native": "0.72.3",
|
|
78
|
+
"react-native-builder-bob": "^0.20.0",
|
|
79
|
+
"release-it": "^15.0.0",
|
|
80
|
+
"ts-node": "^10.9.1",
|
|
81
|
+
"turbo": "^1.10.7",
|
|
82
|
+
"typescript": "^5.0.2"
|
|
83
|
+
},
|
|
84
|
+
"resolutions": {
|
|
85
|
+
"@types/react": "17.0.21"
|
|
86
|
+
},
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"@babel/core": "^7.0.0-0",
|
|
89
|
+
"@babel/preset-env": "^7.1.6",
|
|
90
|
+
"react": "*",
|
|
91
|
+
"react-native": "*"
|
|
92
|
+
},
|
|
93
|
+
"engines": {
|
|
94
|
+
"node": ">= 16.0.0"
|
|
95
|
+
},
|
|
96
|
+
"packageManager": "^yarn@1.22.15",
|
|
97
|
+
"jest": {
|
|
98
|
+
"preset": "react-native",
|
|
99
|
+
"modulePathIgnorePatterns": [
|
|
100
|
+
"<rootDir>/example/node_modules",
|
|
101
|
+
"<rootDir>/lib/"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"commitlint": {
|
|
105
|
+
"extends": [
|
|
106
|
+
"@commitlint/config-conventional"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"release-it": {
|
|
110
|
+
"git": {
|
|
111
|
+
"commitMessage": "chore: release ${version}",
|
|
112
|
+
"tagName": "v${version}"
|
|
113
|
+
},
|
|
114
|
+
"npm": {
|
|
115
|
+
"publish": true
|
|
116
|
+
},
|
|
117
|
+
"github": {
|
|
118
|
+
"release": true
|
|
119
|
+
},
|
|
120
|
+
"plugins": {
|
|
121
|
+
"@release-it/conventional-changelog": {
|
|
122
|
+
"preset": "angular"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"eslintConfig": {
|
|
127
|
+
"root": true,
|
|
128
|
+
"extends": [
|
|
129
|
+
"@react-native-community",
|
|
130
|
+
"prettier"
|
|
131
|
+
],
|
|
132
|
+
"rules": {
|
|
133
|
+
"prettier/prettier": [
|
|
134
|
+
"error",
|
|
135
|
+
{
|
|
136
|
+
"quoteProps": "consistent",
|
|
137
|
+
"singleQuote": true,
|
|
138
|
+
"tabWidth": 2,
|
|
139
|
+
"trailingComma": "es5",
|
|
140
|
+
"useTabs": false
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"eslintIgnore": [
|
|
146
|
+
"node_modules/",
|
|
147
|
+
"lib/"
|
|
148
|
+
],
|
|
149
|
+
"prettier": {
|
|
150
|
+
"quoteProps": "consistent",
|
|
151
|
+
"singleQuote": true,
|
|
152
|
+
"tabWidth": 2,
|
|
153
|
+
"trailingComma": "es5",
|
|
154
|
+
"useTabs": false
|
|
155
|
+
},
|
|
156
|
+
"react-native-builder-bob": {
|
|
157
|
+
"source": "src",
|
|
158
|
+
"output": "lib",
|
|
159
|
+
"targets": [
|
|
160
|
+
"commonjs",
|
|
161
|
+
"module",
|
|
162
|
+
[
|
|
163
|
+
"typescript",
|
|
164
|
+
{
|
|
165
|
+
"project": "tsconfig.build.json"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"dependencies": {
|
|
171
|
+
"@polkadot/api": "^9.11.3",
|
|
172
|
+
"@polkadot/keyring": "^10.2.6",
|
|
173
|
+
"@polkadot/typegen": "^10.10.1",
|
|
174
|
+
"@polkadot/util": "^10.2.6",
|
|
175
|
+
"@polkadot/util-crypto": "^10.2.6",
|
|
176
|
+
"text-encoding": "^0.7.0"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -98,16 +98,26 @@ interface FulaNativeModule {
|
|
|
98
98
|
cid: string
|
|
99
99
|
) => Promise<string>;
|
|
100
100
|
|
|
101
|
+
//On Blox calls for chain
|
|
101
102
|
//Hardware
|
|
102
|
-
bloxFreeSpace: () => Promise<string>;
|
|
103
|
-
wifiRemoveall: () => Promise<string>;
|
|
104
|
-
reboot: () => Promise<string>;
|
|
105
|
-
getAccount: () => Promise<string>;
|
|
106
103
|
assetsBalance: (
|
|
107
104
|
account: string,
|
|
108
105
|
assetId: string,
|
|
109
106
|
classId: string
|
|
110
107
|
) => Promise<string>;
|
|
108
|
+
transferToFula: (
|
|
109
|
+
amount: string,
|
|
110
|
+
wallet: string,
|
|
111
|
+
chain: string
|
|
112
|
+
) => Promise<string>;
|
|
113
|
+
getAccount: () => Promise<string>;
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
//Hardware
|
|
117
|
+
eraseBlData: () => Promise<string>;
|
|
118
|
+
bloxFreeSpace: () => Promise<string>;
|
|
119
|
+
wifiRemoveall: () => Promise<string>;
|
|
120
|
+
reboot: () => Promise<string>;
|
|
111
121
|
}
|
|
112
122
|
|
|
113
123
|
const LINKING_ERROR =
|
|
@@ -547,3 +547,30 @@ export const assetsBalance = (
|
|
|
547
547
|
});
|
|
548
548
|
return res;
|
|
549
549
|
};
|
|
550
|
+
|
|
551
|
+
export const transferToFula = (
|
|
552
|
+
amount: string,
|
|
553
|
+
wallet: string,
|
|
554
|
+
chain: string
|
|
555
|
+
): Promise<BType.TransferToFulaResponse> => {
|
|
556
|
+
console.log('transferToFula in react-native started');
|
|
557
|
+
let res = Fula.transferToFula(amount, wallet, chain)
|
|
558
|
+
.then((res) => {
|
|
559
|
+
try {
|
|
560
|
+
let jsonRes: BType.TransferToFulaResponse = JSON.parse(res);
|
|
561
|
+
return jsonRes;
|
|
562
|
+
} catch (e) {
|
|
563
|
+
try {
|
|
564
|
+
return JSON.parse(res);
|
|
565
|
+
} catch (e1) {
|
|
566
|
+
console.error('Error parsing res in transferToFula:', e1);
|
|
567
|
+
throw e1; // Rethrow the error to maintain the rejection state
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
})
|
|
571
|
+
.catch((err) => {
|
|
572
|
+
console.error('Error getting transferToFula:', err);
|
|
573
|
+
throw err; // Rethrow the error to maintain the rejection state
|
|
574
|
+
});
|
|
575
|
+
return res;
|
|
576
|
+
};
|
package/src/protocols/fxblox.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type * as BType from '../types/fxblox';
|
|
|
8
8
|
|
|
9
9
|
export const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {
|
|
10
10
|
console.log('wifiRemoveall in react-native started');
|
|
11
|
-
let
|
|
11
|
+
let res2 = Fula.wifiRemoveall()
|
|
12
12
|
.then((res) => {
|
|
13
13
|
try {
|
|
14
14
|
let jsonRes: BType.wifiRemoveallResponse = JSON.parse(res);
|
|
@@ -16,7 +16,7 @@ export const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {
|
|
|
16
16
|
} catch (e) {
|
|
17
17
|
try {
|
|
18
18
|
return JSON.parse(res);
|
|
19
|
-
} catch (
|
|
19
|
+
} catch (e2) {
|
|
20
20
|
return res;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -24,12 +24,12 @@ export const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {
|
|
|
24
24
|
.catch((err) => {
|
|
25
25
|
return err;
|
|
26
26
|
});
|
|
27
|
-
return
|
|
27
|
+
return res2;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export const reboot = (): Promise<BType.rebootResponse> => {
|
|
31
31
|
console.log('reboot in react-native started');
|
|
32
|
-
let
|
|
32
|
+
let res2 = Fula.reboot()
|
|
33
33
|
.then((res) => {
|
|
34
34
|
try {
|
|
35
35
|
let jsonRes: BType.rebootResponse = JSON.parse(res);
|
|
@@ -37,7 +37,7 @@ export const reboot = (): Promise<BType.rebootResponse> => {
|
|
|
37
37
|
} catch (e) {
|
|
38
38
|
try {
|
|
39
39
|
return JSON.parse(res);
|
|
40
|
-
} catch (
|
|
40
|
+
} catch (e2) {
|
|
41
41
|
return res;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -45,5 +45,26 @@ export const reboot = (): Promise<BType.rebootResponse> => {
|
|
|
45
45
|
.catch((err) => {
|
|
46
46
|
return err;
|
|
47
47
|
});
|
|
48
|
-
return
|
|
48
|
+
return res2;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const eraseBlData = (): Promise<BType.rebootResponse> => {
|
|
52
|
+
console.log('eraseBlData in react-native started');
|
|
53
|
+
let res2 = Fula.eraseBlData()
|
|
54
|
+
.then((res) => {
|
|
55
|
+
try {
|
|
56
|
+
let jsonRes: BType.eraseBlDataResponse = JSON.parse(res);
|
|
57
|
+
return jsonRes;
|
|
58
|
+
} catch (e) {
|
|
59
|
+
try {
|
|
60
|
+
return JSON.parse(res);
|
|
61
|
+
} catch (e2) {
|
|
62
|
+
return res;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
.catch((err) => {
|
|
67
|
+
return err;
|
|
68
|
+
});
|
|
69
|
+
return res2;
|
|
49
70
|
};
|
package/src/types/blockchain.ts
CHANGED