@qntx/wallet-native 0.13.0 → 0.14.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 +184 -31
- package/WalletNative.podspec +11 -2
- package/android/CMakeLists.txt +7 -1
- package/android/build.gradle +4 -0
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/margelo/nitro/qntxwallet/CardReader.kt +316 -0
- package/android/src/main/java/com/margelo/nitro/qntxwallet/HybridGoogleDriveAuth.kt +142 -0
- package/android/src/main/java/com/margelo/nitro/qntxwallet/HybridSecureInputView.kt +25 -0
- package/android/src/main/java/com/margelo/nitro/qntxwallet/Keystore.kt +148 -9
- package/android/src/main/java/com/margelo/nitro/qntxwallet/SecureInputField.kt +422 -0
- package/android/src/main/java/com/margelo/nitro/qntxwallet/VaultAnchor.kt +90 -0
- package/android/src/main/java/com/margelo/nitro/qntxwallet/WalletNativePackage.java +10 -0
- package/cpp/host/CardReader.hpp +70 -0
- package/cpp/host/HybridKernelHost.cpp +90 -15
- package/cpp/host/HybridKernelHost.hpp +21 -5
- package/cpp/host/KernelFile.cpp +79 -15
- package/cpp/host/KernelFile.hpp +17 -6
- package/cpp/host/KernelSlot.hpp +103 -0
- package/cpp/host/Keystore.hpp +35 -11
- package/cpp/host/Lifecycle.cpp +11 -0
- package/cpp/host/Lifecycle.hpp +3 -0
- package/cpp/host/Passkey.hpp +8 -0
- package/cpp/host/SecureInput.cpp +233 -0
- package/cpp/host/SecureInput.hpp +103 -0
- package/cpp/host/VaultAnchor.cpp +39 -0
- package/cpp/host/VaultAnchor.hpp +28 -0
- package/cpp/host/VaultDirectory.hpp +1 -1
- package/cpp/platform/CardReaderAndroid.cpp +146 -0
- package/cpp/platform/CardReaderIos.mm +318 -0
- package/cpp/platform/KeystoreAndroid.cpp +48 -1
- package/cpp/platform/KeystoreIos.mm +109 -19
- package/cpp/platform/PasskeyAndroid.cpp +2 -0
- package/cpp/platform/PasskeyIos.mm +20 -18
- package/cpp/platform/QntxSecureInputField.h +24 -0
- package/cpp/platform/SecureInputAndroid.cpp +110 -0
- package/cpp/platform/SecureInputIos.mm +282 -0
- package/cpp/platform/VaultAnchorAndroid.cpp +76 -0
- package/cpp/platform/VaultAnchorIos.mm +76 -0
- package/cpp/runtime/KernelBackends.cpp +35 -28
- package/cpp/runtime/KernelBuffer.hpp +2 -5
- package/cpp/runtime/KernelCardReader.cpp +385 -0
- package/cpp/runtime/KernelCardReader.hpp +27 -0
- package/cpp/runtime/KernelGlobals.cpp +176 -63
- package/cpp/runtime/KernelGlobals.hpp +13 -7
- package/cpp/runtime/KernelJs.cpp +14 -0
- package/cpp/runtime/KernelJs.hpp +4 -0
- package/cpp/runtime/KernelKeystore.cpp +78 -2
- package/cpp/runtime/KernelKeystore.hpp +1 -0
- package/cpp/runtime/KernelPasskey.cpp +15 -12
- package/cpp/runtime/KernelRuntime.cpp +24 -7
- package/cpp/runtime/KernelRuntime.hpp +14 -6
- package/cpp/runtime/KernelSecureInput.cpp +154 -0
- package/cpp/runtime/KernelSecureInput.hpp +25 -0
- package/cpp/runtime/platform/KernelArgon2.cpp +34 -0
- package/cpp/runtime/platform/KernelArgon2.hpp +23 -0
- package/cpp/vendor/argon2/LICENSE +314 -0
- package/cpp/vendor/argon2/README.md +20 -0
- package/cpp/vendor/argon2/include/argon2.h +437 -0
- package/cpp/vendor/argon2/src/argon2.c +452 -0
- package/cpp/vendor/argon2/src/blake2/blake2-impl.h +156 -0
- package/cpp/vendor/argon2/src/blake2/blake2.h +89 -0
- package/cpp/vendor/argon2/src/blake2/blake2b.c +390 -0
- package/cpp/vendor/argon2/src/blake2/blamka-round-ref.h +56 -0
- package/cpp/vendor/argon2/src/core.c +648 -0
- package/cpp/vendor/argon2/src/core.h +228 -0
- package/cpp/vendor/argon2/src/encoding.c +463 -0
- package/cpp/vendor/argon2/src/encoding.h +57 -0
- package/cpp/vendor/argon2/src/ref.c +194 -0
- package/cpp/vendor/argon2/src/thread.c +57 -0
- package/cpp/vendor/argon2/src/thread.h +67 -0
- package/dist/cloud.d.mts +58 -0
- package/dist/cloud.mjs +114 -0
- package/dist/cloud.mjs.map +1 -0
- package/dist/index.d.mts +13 -4
- package/dist/index.mjs +89 -14
- package/dist/index.mjs.map +1 -1
- package/dist/secure-input.d.mts +24 -0
- package/dist/secure-input.mjs +25 -0
- package/dist/secure-input.mjs.map +1 -0
- package/ios/HybridCloudKitStore.swift +159 -0
- package/ios/HybridSecureInputView.swift +35 -0
- package/ios/cloud/CloudKitEnvelopeStore.swift +179 -0
- package/kernel/generated/kernel-entry.js +42170 -12741
- package/kernel/generated/kernel.manifest.json +17 -7
- package/nitrogen/generated/android/WalletNative+autolinking.cmake +7 -1
- package/nitrogen/generated/android/WalletNativeOnLoad.cpp +37 -2
- package/nitrogen/generated/android/c++/JFunc_void_SecureInputState.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridGoogleDriveAuthSpec.cpp +82 -0
- package/nitrogen/generated/android/c++/JHybridGoogleDriveAuthSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridSecureInputViewSpec.cpp +70 -0
- package/nitrogen/generated/android/c++/JHybridSecureInputViewSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JSecureInputState.hpp +64 -0
- package/nitrogen/generated/android/c++/views/JHybridSecureInputViewStateUpdater.cpp +74 -0
- package/nitrogen/generated/android/c++/views/JHybridSecureInputViewStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qntxwallet/Func_void_SecureInputState.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qntxwallet/HybridGoogleDriveAuthSpec.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qntxwallet/HybridSecureInputViewSpec.kt +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qntxwallet/SecureInputState.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qntxwallet/views/HybridSecureInputViewManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/qntxwallet/views/HybridSecureInputViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/WalletNative-Swift-Cxx-Bridge.cpp +74 -1
- package/nitrogen/generated/ios/WalletNative-Swift-Cxx-Bridge.hpp +252 -3
- package/nitrogen/generated/ios/WalletNative-Swift-Cxx-Umbrella.hpp +21 -3
- package/nitrogen/generated/ios/WalletNativeAutolinking.mm +17 -1
- package/nitrogen/generated/ios/WalletNativeAutolinking.swift +22 -0
- package/nitrogen/generated/ios/c++/HybridCloudKitStoreSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCloudKitStoreSpecSwift.hpp +116 -0
- package/nitrogen/generated/ios/c++/HybridSecureInputViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridSecureInputViewSpecSwift.hpp +83 -0
- package/nitrogen/generated/ios/c++/views/HybridSecureInputViewComponent.mm +144 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_SecureInputState.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridCloudKitStoreSpec.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridCloudKitStoreSpec_cxx.swift +230 -0
- package/nitrogen/generated/ios/swift/HybridSecureInputViewSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridSecureInputViewSpec_cxx.swift +164 -0
- package/nitrogen/generated/ios/swift/SecureInputState.swift +48 -0
- package/nitrogen/generated/shared/c++/HybridCloudKitStoreSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridCloudKitStoreSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridGoogleDriveAuthSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridGoogleDriveAuthSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridKernelHostSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridKernelHostSpec.hpp +1 -0
- package/nitrogen/generated/shared/c++/HybridSecureInputViewSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridSecureInputViewSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/SecureInputState.hpp +84 -0
- package/nitrogen/generated/shared/c++/views/HybridSecureInputViewComponent.cpp +34 -0
- package/nitrogen/generated/shared/c++/views/HybridSecureInputViewComponent.hpp +85 -0
- package/nitrogen/generated/shared/json/SecureInputViewConfig.json +10 -0
- package/package.json +24 -6
- package/scripts/compile-kernel.mjs +7 -3
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridSecureInputViewComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <NitroModules/ReactProp.hpp>
|
|
11
|
+
#include <NitroModules/ViewComponentDescriptor.hpp>
|
|
12
|
+
#include <NitroModules/ViewPropsHolderState.hpp>
|
|
13
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
14
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/core/RawProps.h>
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
19
|
+
|
|
20
|
+
#include "SecureInputState.hpp"
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <memory>
|
|
23
|
+
#include "HybridSecureInputViewSpec.hpp"
|
|
24
|
+
#include <optional>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::qntxwallet::views {
|
|
27
|
+
|
|
28
|
+
using namespace facebook;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The name of the actual native View.
|
|
32
|
+
*/
|
|
33
|
+
extern const char HybridSecureInputViewComponentName[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Props for the "SecureInputView" View.
|
|
37
|
+
*/
|
|
38
|
+
class HybridSecureInputViewProps final: public react::ViewProps {
|
|
39
|
+
public:
|
|
40
|
+
HybridSecureInputViewProps() = default;
|
|
41
|
+
HybridSecureInputViewProps(const react::PropsParserContext& context,
|
|
42
|
+
const HybridSecureInputViewProps& sourceProps,
|
|
43
|
+
const react::RawProps& rawProps);
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
nitro::ReactProp<std::function<void(SecureInputState /* state */)>> onStateChange;
|
|
47
|
+
nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridSecureInputViewSpec>& /* ref */)>>> hybridRef;
|
|
48
|
+
|
|
49
|
+
[[nodiscard]]
|
|
50
|
+
bool hasSameProps(const HybridSecureInputViewProps& other) const noexcept {
|
|
51
|
+
return onStateChange.hasSameValue(other.onStateChange) &&
|
|
52
|
+
hybridRef.hasSameValue(other.hybridRef);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[[nodiscard]]
|
|
56
|
+
bool hasAnyProvidedProps() const noexcept {
|
|
57
|
+
return onStateChange.isProvided() ||
|
|
58
|
+
hybridRef.isProvided();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private:
|
|
62
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* State for the "SecureInputView" View.
|
|
67
|
+
*/
|
|
68
|
+
using HybridSecureInputViewState = nitro::ViewPropsHolderState<HybridSecureInputViewProps>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The Shadow Node for the "SecureInputView" View.
|
|
72
|
+
*/
|
|
73
|
+
using HybridSecureInputViewShadowNode = react::ConcreteViewShadowNode<HybridSecureInputViewComponentName /* "HybridSecureInputView" */,
|
|
74
|
+
HybridSecureInputViewProps /* custom props */,
|
|
75
|
+
react::ViewEventEmitter /* default */,
|
|
76
|
+
HybridSecureInputViewState /* custom state */>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The Component Descriptor for the "SecureInputView" View.
|
|
80
|
+
*/
|
|
81
|
+
using HybridSecureInputViewComponentDescriptor = nitro::ViewComponentDescriptor<HybridSecureInputViewShadowNode>;
|
|
82
|
+
|
|
83
|
+
/* The actual view for "SecureInputView" needs to be implemented in platform-specific code. */
|
|
84
|
+
|
|
85
|
+
} // namespace margelo::nitro::qntxwallet::views
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qntx/wallet-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Native kernel runtime host for the qntx wallet — CBOR transport, KernelHost adapter and createNativeWallet",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "QuantX <x@qntx.org>",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dist",
|
|
14
14
|
"cpp",
|
|
15
15
|
"android",
|
|
16
|
+
"ios",
|
|
16
17
|
"kernel/generated",
|
|
17
18
|
"nitrogen",
|
|
18
19
|
"scripts",
|
|
@@ -30,6 +31,16 @@
|
|
|
30
31
|
"types": "./dist/index.d.mts",
|
|
31
32
|
"import": "./dist/index.mjs",
|
|
32
33
|
"default": "./dist/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./secure-input": {
|
|
36
|
+
"types": "./dist/secure-input.d.mts",
|
|
37
|
+
"import": "./dist/secure-input.mjs",
|
|
38
|
+
"default": "./dist/secure-input.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./cloud": {
|
|
41
|
+
"types": "./dist/cloud.d.mts",
|
|
42
|
+
"import": "./dist/cloud.mjs",
|
|
43
|
+
"default": "./dist/cloud.mjs"
|
|
33
44
|
}
|
|
34
45
|
},
|
|
35
46
|
"publishConfig": {
|
|
@@ -41,28 +52,35 @@
|
|
|
41
52
|
"test:coverage": "vp test --coverage",
|
|
42
53
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
43
54
|
"codegen": "nitrogen",
|
|
44
|
-
"check:pkg": "vp pack && bun ../../scripts/check-dist-deps.ts . && publint && attw --pack . --profile esm-only && bun ../../scripts/check-native-pack.ts ."
|
|
55
|
+
"check:pkg": "vp pack && bun ../../scripts/check-dist-deps.ts . && bun ../../scripts/check-api.ts . && publint && attw --pack . --profile esm-only && bun ../../scripts/check-native-pack.ts ."
|
|
45
56
|
},
|
|
46
57
|
"dependencies": {
|
|
47
58
|
"cborg": "6.1.5"
|
|
48
59
|
},
|
|
49
60
|
"devDependencies": {
|
|
50
61
|
"@arethetypeswrong/cli": "0.18.5",
|
|
51
|
-
"@qntx/nostr": "0.
|
|
52
|
-
"@qntx/nostr-native": "0.
|
|
62
|
+
"@qntx/nostr": "0.16.0",
|
|
63
|
+
"@qntx/nostr-native": "0.16.0",
|
|
53
64
|
"@qntx/spark": "0.5.2",
|
|
54
65
|
"@qntx/spark-native": "0.5.2",
|
|
55
66
|
"@qntx/tsconfig": "1.0.1",
|
|
67
|
+
"@qntx/wallet-engine": "0.14.0",
|
|
56
68
|
"@scure/base": "2.4.0",
|
|
57
69
|
"nitrogen": "0.37.1",
|
|
58
70
|
"publint": "0.3.25",
|
|
59
71
|
"react-native-nitro-modules": "0.37.1"
|
|
60
72
|
},
|
|
61
73
|
"peerDependencies": {
|
|
62
|
-
"@qntx/nostr-native": "0.
|
|
74
|
+
"@qntx/nostr-native": "0.16.0",
|
|
63
75
|
"@qntx/spark-native": "0.5.2",
|
|
64
|
-
"@qntx/wallet": "0.
|
|
76
|
+
"@qntx/wallet": "0.14.0",
|
|
77
|
+
"@qntx/wallet-engine": "0.14.0",
|
|
65
78
|
"react-native": "~0.88.0",
|
|
66
79
|
"react-native-nitro-modules": "~0.37.1"
|
|
80
|
+
},
|
|
81
|
+
"peerDependenciesMeta": {
|
|
82
|
+
"@qntx/wallet-engine": {
|
|
83
|
+
"optional": true
|
|
84
|
+
}
|
|
67
85
|
}
|
|
68
86
|
}
|
|
@@ -80,9 +80,13 @@ const hermesc = resolve(
|
|
|
80
80
|
mkdirSync(outDir, { recursive: true });
|
|
81
81
|
const tmpHbc = resolve(outDir, ".kernel.hbc");
|
|
82
82
|
try {
|
|
83
|
-
execFileSync(
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
execFileSync(
|
|
84
|
+
hermesc,
|
|
85
|
+
["-O", "-Xes6-block-scoping", "-emit-async-break-check", "-emit-binary", "-out", tmpHbc, entry],
|
|
86
|
+
{
|
|
87
|
+
stdio: ["ignore", "pipe", "inherit"],
|
|
88
|
+
},
|
|
89
|
+
);
|
|
86
90
|
} catch (error) {
|
|
87
91
|
console.error(
|
|
88
92
|
`hermesc failed on ${entry}: ${error instanceof Error ? error.message : String(error)}`,
|