@functionland/react-native-fula 1.55.15 → 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.
Files changed (93) hide show
  1. package/LICENSE +20 -20
  2. package/android/build.gradle +114 -114
  3. package/android/gradle.properties +8 -8
  4. package/android/src/main/AndroidManifest.xml +3 -3
  5. package/android/src/main/AndroidManifestNew.xml +2 -2
  6. package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
  7. package/android/src/main/java/land/fx/fula/Cryptography.java +62 -62
  8. package/android/src/main/java/land/fx/fula/FulaModule.java +0 -0
  9. package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
  10. package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
  11. package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
  12. package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
  13. package/ios/Cryptography.swift +59 -59
  14. package/ios/Fula-Bridging-Header.h +3 -3
  15. package/ios/Fula.mm +272 -272
  16. package/ios/Fula.swift +18 -15
  17. package/ios/UserDataHelper.swift +143 -143
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/interfaces/augment-api-consts.js.map +1 -1
  20. package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -1
  21. package/lib/commonjs/interfaces/augment-api-events.js.map +1 -1
  22. package/lib/commonjs/interfaces/augment-api-query.js.map +1 -1
  23. package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -1
  24. package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -1
  25. package/lib/commonjs/interfaces/augment-api-tx.js.map +1 -1
  26. package/lib/commonjs/interfaces/augment-api.js.map +1 -1
  27. package/lib/commonjs/interfaces/augment-types.js.map +1 -1
  28. package/lib/commonjs/interfaces/definitions.js.map +1 -1
  29. package/lib/commonjs/interfaces/defintions.js.map +1 -1
  30. package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
  31. package/lib/commonjs/interfaces/index.js.map +1 -1
  32. package/lib/commonjs/interfaces/lookup.js +300 -300
  33. package/lib/commonjs/interfaces/lookup.js.map +1 -1
  34. package/lib/commonjs/interfaces/registry.js.map +1 -1
  35. package/lib/commonjs/interfaces/types-lookup.js.map +1 -1
  36. package/lib/commonjs/interfaces/types.js.map +1 -1
  37. package/lib/commonjs/protocols/blockchain.js +70 -70
  38. package/lib/commonjs/protocols/blockchain.js.map +1 -1
  39. package/lib/commonjs/protocols/chain-api.js.map +1 -1
  40. package/lib/commonjs/protocols/fula.js.map +1 -1
  41. package/lib/commonjs/protocols/fx-ai.js.map +1 -1
  42. package/lib/commonjs/protocols/fxblox.js +3 -3
  43. package/lib/commonjs/protocols/fxblox.js.map +1 -1
  44. package/lib/commonjs/types/blockchain.js.map +1 -1
  45. package/lib/commonjs/types/fxblox.js.map +1 -1
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/interfaces/augment-api-consts.js.map +1 -1
  48. package/lib/module/interfaces/augment-api-errors.js.map +1 -1
  49. package/lib/module/interfaces/augment-api-events.js.map +1 -1
  50. package/lib/module/interfaces/augment-api-query.js.map +1 -1
  51. package/lib/module/interfaces/augment-api-rpc.js.map +1 -1
  52. package/lib/module/interfaces/augment-api-runtime.js.map +1 -1
  53. package/lib/module/interfaces/augment-api-tx.js.map +1 -1
  54. package/lib/module/interfaces/augment-api.js.map +1 -1
  55. package/lib/module/interfaces/augment-types.js.map +1 -1
  56. package/lib/module/interfaces/definitions.js.map +1 -1
  57. package/lib/module/interfaces/defintions.js.map +1 -1
  58. package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
  59. package/lib/module/interfaces/index.js.map +1 -1
  60. package/lib/module/interfaces/lookup.js +300 -300
  61. package/lib/module/interfaces/lookup.js.map +1 -1
  62. package/lib/module/interfaces/registry.js.map +1 -1
  63. package/lib/module/interfaces/types-lookup.js.map +1 -1
  64. package/lib/module/interfaces/types.js.map +1 -1
  65. package/lib/module/protocols/blockchain.js +70 -70
  66. package/lib/module/protocols/blockchain.js.map +1 -1
  67. package/lib/module/protocols/chain-api.js.map +1 -1
  68. package/lib/module/protocols/fula.js.map +1 -1
  69. package/lib/module/protocols/fx-ai.js.map +1 -1
  70. package/lib/module/protocols/fxblox.js +3 -3
  71. package/lib/module/protocols/fxblox.js.map +1 -1
  72. package/lib/module/types/blockchain.js.map +1 -1
  73. package/lib/module/types/fxblox.js.map +1 -1
  74. package/package.json +177 -176
  75. package/src/index.tsx +4 -4
  76. package/src/interfaces/augment-api-consts.ts +273 -273
  77. package/src/interfaces/augment-api-errors.ts +474 -474
  78. package/src/interfaces/augment-api-events.ts +448 -448
  79. package/src/interfaces/augment-api-query.ts +466 -466
  80. package/src/interfaces/augment-api-rpc.ts +617 -617
  81. package/src/interfaces/augment-api-runtime.ts +223 -223
  82. package/src/interfaces/augment-api-tx.ts +709 -709
  83. package/src/interfaces/augment-api.ts +9 -9
  84. package/src/interfaces/augment-types.ts +1322 -1322
  85. package/src/interfaces/definitions.ts +1 -1
  86. package/src/interfaces/defintions.ts +1 -1
  87. package/src/interfaces/index.ts +3 -3
  88. package/src/interfaces/lookup.ts +2011 -2011
  89. package/src/interfaces/registry.ts +163 -163
  90. package/src/interfaces/types-lookup.ts +2165 -2165
  91. package/src/interfaces/types.ts +2 -2
  92. package/src/protocols/blockchain.ts +716 -716
  93. package/src/protocols/fxblox.ts +442 -442
@@ -1,143 +1,143 @@
1
- import Foundation
2
- import CommonCrypto
3
- import Foundation.NSDate // for TimeInterval
4
-
5
- struct TimedOutError: Error, Equatable {}
6
-
7
- public func withTimeout<R>(
8
- seconds: TimeInterval,
9
- operation: @escaping @Sendable () async throws -> R
10
- ) async throws -> R {
11
- return try await withThrowingTaskGroup(of: R.self) { group in
12
- defer {
13
- group.cancelAll()
14
- }
15
-
16
- // Start actual work.
17
- group.addTask {
18
- let result = try await operation()
19
- try Task.checkCancellation()
20
- return result
21
- }
22
- // Start timeout child task.
23
- group.addTask {
24
- if seconds > 0 {
25
- try await Task.sleep(nanoseconds: UInt64(seconds * 1_000_000_000))
26
- }
27
- try Task.checkCancellation()
28
- // We’ve reached the timeout.
29
- throw TimedOutError()
30
- }
31
- // First finished child task wins, cancel the other task.
32
- let result = try await group.next()!
33
- return result
34
- }
35
- }
36
-
37
-
38
- public class UserDataHelper: NSObject {
39
- var defaults: UserDefaults
40
-
41
- override init() {
42
- defaults = UserDefaults.standard
43
- }
44
-
45
- public func getValue(_ key: String) -> String? {
46
- return defaults.string(forKey: key)
47
- }
48
-
49
- public func getBooleanValue(_ key: String) -> Bool? {
50
- return defaults.bool(forKey: key)
51
- }
52
-
53
- public func add(_ key: String, _ value: String) {
54
- defaults.set(value, forKey: key)
55
- }
56
-
57
- public func add(_ key: String, _ value: Bool) {
58
- defaults.set(value, forKey: key)
59
- }
60
-
61
- public func remove(_ key: String) {
62
- defaults.removeObject(forKey: key)
63
- }
64
- }
65
-
66
- public extension String {
67
- func trim() -> String {
68
- return self.trimmingCharacters(in: NSCharacterSet.whitespaces)
69
- }
70
- func fromBase64() -> Data? {
71
- return Data(base64Encoded: self)
72
- }
73
-
74
- func toUint8Array() -> Array<UInt8> {
75
- return Array(self.utf8)
76
- }
77
-
78
- func toData() -> Data {
79
- return self.data(using: .utf8)!
80
- }
81
- }
82
-
83
- public extension Array<UInt8> {
84
- func toHex() -> String {
85
- return Data(self).toHex()
86
- }
87
- func toData() -> Data {
88
- return Data(self)
89
- }
90
- }
91
-
92
- public func toData(ptr: UnsafePointer<UInt8>?, size: Int) -> Data? {
93
- // This will clone input c bytes to a swift Data class.
94
- let buffer = UnsafeBufferPointer(start: ptr, count: size)
95
- return Data(buffer: buffer)
96
- }
97
-
98
- public extension Data {
99
- /// Fast convert to hex by reserving memory (instead of mapping and join).
100
- func toHex(uppercase: Bool = false) -> String {
101
- // Constants (Hex has 2 characters for each Byte).
102
- let size = self.count * 2;
103
- let degitToCharMap = Array((
104
- uppercase ? "0123456789ABCDEF" : "0123456789abcdef"
105
- ).utf16);
106
- // Reserve dynamic memory (plus one for null termination).
107
- let buffer = UnsafeMutablePointer<unichar>.allocate(capacity: size + 1);
108
- // Convert each byte.
109
- var index = 0
110
- for byte in self {
111
- buffer[index] = degitToCharMap[Int(byte / 16)];
112
- index += 1;
113
- buffer[index] = degitToCharMap[Int(byte % 16)];
114
- index += 1;
115
- }
116
- // Set Null termination.
117
- buffer[index] = 0;
118
- // Casts to string (without any copying).
119
- return String(utf16CodeUnitsNoCopy: buffer,
120
- count: size, freeWhenDone: true)
121
- }
122
-
123
- func toUTF8String() -> String? {
124
- return String(data: self, encoding: .utf8)
125
- }
126
-
127
- func toUint8Array() -> Array<UInt8> {
128
- return Array(self)
129
- }
130
-
131
- func fromBase64() -> Data? {
132
- // Finally, decode.
133
- return Data(base64Encoded: self)
134
- }
135
-
136
- func sha256() -> Data {
137
- var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
138
- self.withUnsafeBytes {
139
- _ = CC_SHA256($0.baseAddress, CC_LONG(self.count), &hash)
140
- }
141
- return Data(hash)
142
- }
143
- }
1
+ import Foundation
2
+ import CommonCrypto
3
+ import Foundation.NSDate // for TimeInterval
4
+
5
+ struct TimedOutError: Error, Equatable {}
6
+
7
+ public func withTimeout<R>(
8
+ seconds: TimeInterval,
9
+ operation: @escaping @Sendable () async throws -> R
10
+ ) async throws -> R {
11
+ return try await withThrowingTaskGroup(of: R.self) { group in
12
+ defer {
13
+ group.cancelAll()
14
+ }
15
+
16
+ // Start actual work.
17
+ group.addTask {
18
+ let result = try await operation()
19
+ try Task.checkCancellation()
20
+ return result
21
+ }
22
+ // Start timeout child task.
23
+ group.addTask {
24
+ if seconds > 0 {
25
+ try await Task.sleep(nanoseconds: UInt64(seconds * 1_000_000_000))
26
+ }
27
+ try Task.checkCancellation()
28
+ // We’ve reached the timeout.
29
+ throw TimedOutError()
30
+ }
31
+ // First finished child task wins, cancel the other task.
32
+ let result = try await group.next()!
33
+ return result
34
+ }
35
+ }
36
+
37
+
38
+ public class UserDataHelper: NSObject {
39
+ var defaults: UserDefaults
40
+
41
+ override init() {
42
+ defaults = UserDefaults.standard
43
+ }
44
+
45
+ public func getValue(_ key: String) -> String? {
46
+ return defaults.string(forKey: key)
47
+ }
48
+
49
+ public func getBooleanValue(_ key: String) -> Bool? {
50
+ return defaults.bool(forKey: key)
51
+ }
52
+
53
+ public func add(_ key: String, _ value: String) {
54
+ defaults.set(value, forKey: key)
55
+ }
56
+
57
+ public func add(_ key: String, _ value: Bool) {
58
+ defaults.set(value, forKey: key)
59
+ }
60
+
61
+ public func remove(_ key: String) {
62
+ defaults.removeObject(forKey: key)
63
+ }
64
+ }
65
+
66
+ public extension String {
67
+ func trim() -> String {
68
+ return self.trimmingCharacters(in: NSCharacterSet.whitespaces)
69
+ }
70
+ func fromBase64() -> Data? {
71
+ return Data(base64Encoded: self)
72
+ }
73
+
74
+ func toUint8Array() -> Array<UInt8> {
75
+ return Array(self.utf8)
76
+ }
77
+
78
+ func toData() -> Data {
79
+ return self.data(using: .utf8)!
80
+ }
81
+ }
82
+
83
+ public extension Array<UInt8> {
84
+ func toHex() -> String {
85
+ return Data(self).toHex()
86
+ }
87
+ func toData() -> Data {
88
+ return Data(self)
89
+ }
90
+ }
91
+
92
+ public func toData(ptr: UnsafePointer<UInt8>?, size: Int) -> Data? {
93
+ // This will clone input c bytes to a swift Data class.
94
+ let buffer = UnsafeBufferPointer(start: ptr, count: size)
95
+ return Data(buffer: buffer)
96
+ }
97
+
98
+ public extension Data {
99
+ /// Fast convert to hex by reserving memory (instead of mapping and join).
100
+ func toHex(uppercase: Bool = false) -> String {
101
+ // Constants (Hex has 2 characters for each Byte).
102
+ let size = self.count * 2;
103
+ let degitToCharMap = Array((
104
+ uppercase ? "0123456789ABCDEF" : "0123456789abcdef"
105
+ ).utf16);
106
+ // Reserve dynamic memory (plus one for null termination).
107
+ let buffer = UnsafeMutablePointer<unichar>.allocate(capacity: size + 1);
108
+ // Convert each byte.
109
+ var index = 0
110
+ for byte in self {
111
+ buffer[index] = degitToCharMap[Int(byte / 16)];
112
+ index += 1;
113
+ buffer[index] = degitToCharMap[Int(byte % 16)];
114
+ index += 1;
115
+ }
116
+ // Set Null termination.
117
+ buffer[index] = 0;
118
+ // Casts to string (without any copying).
119
+ return String(utf16CodeUnitsNoCopy: buffer,
120
+ count: size, freeWhenDone: true)
121
+ }
122
+
123
+ func toUTF8String() -> String? {
124
+ return String(data: self, encoding: .utf8)
125
+ }
126
+
127
+ func toUint8Array() -> Array<UInt8> {
128
+ return Array(self)
129
+ }
130
+
131
+ func fromBase64() -> Data? {
132
+ // Finally, decode.
133
+ return Data(base64Encoded: self)
134
+ }
135
+
136
+ func sha256() -> Data {
137
+ var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
138
+ self.withUnsafeBytes {
139
+ _ = CC_SHA256($0.baseAddress, CC_LONG(self.count), &hash)
140
+ }
141
+ return Data(hash)
142
+ }
143
+ }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-consts.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-consts.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-errors.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-errors.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-events.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-events.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-query.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-query.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-rpc.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-rpc.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-runtime.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-runtime.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api-tx.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api-tx.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-api.ts"],"mappings":";;AAGAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-api.ts"],"mappings":";;AAGAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/augment-types.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["require"],"sourceRoot":"../../../src","sources":["interfaces/augment-types.ts"],"mappings":";;AAKAA,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/definitions.ts"],"mappings":"AAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["interfaces/definitions.ts"],"mappings":"AAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/defintions.ts"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["interfaces/defintions.ts"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","Fula","NativeModules","FulaModule","Proxy","get","Error","_default","exports"],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/fulaNativeModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AA+JA,MAAMC,aAAa,GACjB,iFAAiF,GACjFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGC,0BAAa,CAACC,UAAU,GACjCD,0BAAa,CAACC,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAESC,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","Fula","NativeModules","FulaModule","Proxy","get","Error","_default","exports"],"sourceRoot":"../../../src","sources":["interfaces/fulaNativeModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AA+JA,MAAMC,aAAa,GACjB,iFAAiF,GACjFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGC,0BAAa,CAACC,UAAU,GACjCD,0BAAa,CAACC,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAESC,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["interfaces/index.ts"],"mappings":"AAAA;AACA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["interfaces/index.ts"],"mappings":"AAAA;AACA;AAAA","ignoreList":[]}