@account-kit/react-native-signer 4.1.8-alpha → 4.6.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/LICENSE +21 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/NativeTEKStamperModule.kt +12 -180
- package/android/src/main/java/com/accountkit/reactnativesigner/{KeyExtensions.kt → core/KeyExtensions.kt} +1 -1
- package/android/src/main/java/com/accountkit/reactnativesigner/{TEKManager.kt → core/TEKManager.kt} +3 -2
- package/android/src/main/java/com/accountkit/reactnativesigner/core/TEKStamper.kt +199 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/core/errors/NoInjectedBundleException.kt +3 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/core/errors/NoTEKException.kt +3 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/core/errors/StamperNotInitialized.kt +3 -0
- package/package.json +6 -5
- package/.github/actions/setup/action.yml +0 -27
- package/.github/workflows/ci.yml +0 -157
- package/.npmrc +0 -1
- package/.turbo/turbo-prepare.log +0 -21
- package/.watchmanconfig +0 -1
- package/babel.config.js +0 -5
- package/example/.bundle/config +0 -2
- package/example/.watchmanconfig +0 -1
- package/example/Gemfile +0 -9
- package/example/README.md +0 -79
- package/example/android/app/build.gradle +0 -133
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +0 -10
- package/example/android/app/src/debug/AndroidManifest.xml +0 -9
- package/example/android/app/src/main/AndroidManifest.xml +0 -17
- package/example/android/app/src/main/java/accountkit/reactnativesigner/example/MainActivity.kt +0 -27
- package/example/android/app/src/main/java/accountkit/reactnativesigner/example/MainApplication.kt +0 -48
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -37
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +0 -3
- package/example/android/app/src/main/res/values/styles.xml +0 -9
- package/example/android/build.gradle +0 -21
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/example/android/gradle.properties +0 -41
- package/example/android/gradlew +0 -252
- package/example/android/gradlew.bat +0 -94
- package/example/android/settings.gradle +0 -6
- package/example/app.json +0 -4
- package/example/babel.config.js +0 -12
- package/example/index.js +0 -6
- package/example/ios/.xcode.env +0 -11
- package/example/ios/File.swift +0 -6
- package/example/ios/Podfile +0 -47
- package/example/ios/ReactNativeSignerExample/AppDelegate.h +0 -6
- package/example/ios/ReactNativeSignerExample/AppDelegate.mm +0 -31
- package/example/ios/ReactNativeSignerExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
- package/example/ios/ReactNativeSignerExample/Images.xcassets/Contents.json +0 -6
- package/example/ios/ReactNativeSignerExample/Info.plist +0 -52
- package/example/ios/ReactNativeSignerExample/LaunchScreen.storyboard +0 -47
- package/example/ios/ReactNativeSignerExample/PrivacyInfo.xcprivacy +0 -37
- package/example/ios/ReactNativeSignerExample/main.m +0 -10
- package/example/ios/ReactNativeSignerExample-Bridging-Header.h +0 -3
- package/example/ios/ReactNativeSignerExample.xcodeproj/project.pbxproj +0 -690
- package/example/ios/ReactNativeSignerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeSignerExample.xcscheme +0 -98
- package/example/ios/ReactNativeSignerExampleTests/Info.plist +0 -24
- package/example/ios/ReactNativeSignerExampleTests/ReactNativeSignerExampleTests.m +0 -66
- package/example/jest.config.js +0 -3
- package/example/metro.config.js +0 -22
- package/example/package.json +0 -56
- package/example/react-native.config.js +0 -15
- package/example/redirect-server/index.ts +0 -19
- package/example/src/App.tsx +0 -30
- package/example/src/screens/Home.tsx +0 -149
- package/example/turbo.json +0 -38
- package/react-native.config.js +0 -11
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -30
- package/turbo.json +0 -9
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1210"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
|
|
9
|
-
<PreActions>
|
|
10
|
-
<ExecutionAction
|
|
11
|
-
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
|
12
|
-
<ActionContent
|
|
13
|
-
title = "Invoke Codegen"
|
|
14
|
-
scriptText = "cd "$WORKSPACE_PATH/../../../" && npx bob build --target codegen ">
|
|
15
|
-
</ActionContent>
|
|
16
|
-
</ExecutionAction>
|
|
17
|
-
</PreActions>
|
|
18
|
-
<BuildActionEntries>
|
|
19
|
-
<BuildActionEntry
|
|
20
|
-
buildForTesting = "YES"
|
|
21
|
-
buildForRunning = "YES"
|
|
22
|
-
buildForProfiling = "YES"
|
|
23
|
-
buildForArchiving = "YES"
|
|
24
|
-
buildForAnalyzing = "YES">
|
|
25
|
-
<BuildableReference
|
|
26
|
-
BuildableIdentifier = "primary"
|
|
27
|
-
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
28
|
-
BuildableName = "ReactNativeSignerExample.app"
|
|
29
|
-
BlueprintName = "ReactNativeSignerExample"
|
|
30
|
-
ReferencedContainer = "container:ReactNativeSignerExample.xcodeproj">
|
|
31
|
-
</BuildableReference>
|
|
32
|
-
</BuildActionEntry>
|
|
33
|
-
</BuildActionEntries>
|
|
34
|
-
</BuildAction>
|
|
35
|
-
<TestAction
|
|
36
|
-
buildConfiguration = "Debug"
|
|
37
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
38
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
39
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
40
|
-
<Testables>
|
|
41
|
-
<TestableReference
|
|
42
|
-
skipped = "NO">
|
|
43
|
-
<BuildableReference
|
|
44
|
-
BuildableIdentifier = "primary"
|
|
45
|
-
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
|
46
|
-
BuildableName = "ReactNativeSignerExampleTests.xctest"
|
|
47
|
-
BlueprintName = "ReactNativeSignerExampleTests"
|
|
48
|
-
ReferencedContainer = "container:ReactNativeSignerExample.xcodeproj">
|
|
49
|
-
</BuildableReference>
|
|
50
|
-
</TestableReference>
|
|
51
|
-
</Testables>
|
|
52
|
-
</TestAction>
|
|
53
|
-
<LaunchAction
|
|
54
|
-
buildConfiguration = "Debug"
|
|
55
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
56
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
57
|
-
launchStyle = "0"
|
|
58
|
-
useCustomWorkingDirectory = "NO"
|
|
59
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
60
|
-
debugDocumentVersioning = "YES"
|
|
61
|
-
debugServiceExtension = "internal"
|
|
62
|
-
allowLocationSimulation = "YES">
|
|
63
|
-
<BuildableProductRunnable
|
|
64
|
-
runnableDebuggingMode = "0">
|
|
65
|
-
<BuildableReference
|
|
66
|
-
BuildableIdentifier = "primary"
|
|
67
|
-
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
68
|
-
BuildableName = "ReactNativeSignerExample.app"
|
|
69
|
-
BlueprintName = "ReactNativeSignerExample"
|
|
70
|
-
ReferencedContainer = "container:ReactNativeSignerExample.xcodeproj">
|
|
71
|
-
</BuildableReference>
|
|
72
|
-
</BuildableProductRunnable>
|
|
73
|
-
</LaunchAction>
|
|
74
|
-
<ProfileAction
|
|
75
|
-
buildConfiguration = "Release"
|
|
76
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
77
|
-
savedToolIdentifier = ""
|
|
78
|
-
useCustomWorkingDirectory = "NO"
|
|
79
|
-
debugDocumentVersioning = "YES">
|
|
80
|
-
<BuildableProductRunnable
|
|
81
|
-
runnableDebuggingMode = "0">
|
|
82
|
-
<BuildableReference
|
|
83
|
-
BuildableIdentifier = "primary"
|
|
84
|
-
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
85
|
-
BuildableName = "ReactNativeSignerExample.app"
|
|
86
|
-
BlueprintName = "ReactNativeSignerExample"
|
|
87
|
-
ReferencedContainer = "container:ReactNativeSignerExample.xcodeproj">
|
|
88
|
-
</BuildableReference>
|
|
89
|
-
</BuildableProductRunnable>
|
|
90
|
-
</ProfileAction>
|
|
91
|
-
<AnalyzeAction
|
|
92
|
-
buildConfiguration = "Debug">
|
|
93
|
-
</AnalyzeAction>
|
|
94
|
-
<ArchiveAction
|
|
95
|
-
buildConfiguration = "Release"
|
|
96
|
-
revealArchiveInOrganizer = "YES">
|
|
97
|
-
</ArchiveAction>
|
|
98
|
-
</Scheme>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>en</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>BNDL</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleSignature</key>
|
|
20
|
-
<string>????</string>
|
|
21
|
-
<key>CFBundleVersion</key>
|
|
22
|
-
<string>1</string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
#import <XCTest/XCTest.h>
|
|
3
|
-
|
|
4
|
-
#import <React/RCTLog.h>
|
|
5
|
-
#import <React/RCTRootView.h>
|
|
6
|
-
|
|
7
|
-
#define TIMEOUT_SECONDS 600
|
|
8
|
-
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
9
|
-
|
|
10
|
-
@interface ReactNativeSignerExampleTests : XCTestCase
|
|
11
|
-
|
|
12
|
-
@end
|
|
13
|
-
|
|
14
|
-
@implementation ReactNativeSignerExampleTests
|
|
15
|
-
|
|
16
|
-
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
|
17
|
-
{
|
|
18
|
-
if (test(view)) {
|
|
19
|
-
return YES;
|
|
20
|
-
}
|
|
21
|
-
for (UIView *subview in [view subviews]) {
|
|
22
|
-
if ([self findSubviewInView:subview matching:test]) {
|
|
23
|
-
return YES;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return NO;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
- (void)testRendersWelcomeScreen
|
|
30
|
-
{
|
|
31
|
-
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
32
|
-
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
33
|
-
BOOL foundElement = NO;
|
|
34
|
-
|
|
35
|
-
__block NSString *redboxError = nil;
|
|
36
|
-
#ifdef DEBUG
|
|
37
|
-
RCTSetLogFunction(
|
|
38
|
-
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
39
|
-
if (level >= RCTLogLevelError) {
|
|
40
|
-
redboxError = message;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
46
|
-
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
47
|
-
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
48
|
-
|
|
49
|
-
foundElement = [self findSubviewInView:vc.view
|
|
50
|
-
matching:^BOOL(UIView *view) {
|
|
51
|
-
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
52
|
-
return YES;
|
|
53
|
-
}
|
|
54
|
-
return NO;
|
|
55
|
-
}];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#ifdef DEBUG
|
|
59
|
-
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
63
|
-
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@end
|
package/example/jest.config.js
DELETED
package/example/metro.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const { getDefaultConfig } = require("@react-native/metro-config");
|
|
3
|
-
const { getConfig } = require("react-native-builder-bob/metro-config");
|
|
4
|
-
const pkg = require("../package.json");
|
|
5
|
-
|
|
6
|
-
const root = path.resolve(__dirname, "..");
|
|
7
|
-
// handles the hoisted modules
|
|
8
|
-
const repoRoot = path.resolve(__dirname, "../../..");
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Metro configuration
|
|
12
|
-
* https://facebook.github.io/metro/docs/configuration
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
module.exports = {
|
|
16
|
-
...getConfig(getDefaultConfig(__dirname), {
|
|
17
|
-
root,
|
|
18
|
-
pkg,
|
|
19
|
-
project: __dirname,
|
|
20
|
-
}),
|
|
21
|
-
watchFolders: [root, repoRoot],
|
|
22
|
-
};
|
package/example/package.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@account-kit/react-native-signer-example",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"android": "react-native run-android && yarn start:redirect-server",
|
|
7
|
-
"ios": "react-native run-ios",
|
|
8
|
-
"start": "react-native start",
|
|
9
|
-
"start:redirect-server": "tsx ./redirect-server/index.ts",
|
|
10
|
-
"build:android": "react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"",
|
|
11
|
-
"build:ios": "react-native build-ios --scheme ReactNativeSignerExample --mode Debug --extra-params \"-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\""
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@account-kit/signer": "^4.3.0",
|
|
15
|
-
"@react-navigation/native": "7.0.3",
|
|
16
|
-
"@react-navigation/native-stack": "7.1.0",
|
|
17
|
-
"dotenv": "^16.4.5",
|
|
18
|
-
"express": "^4.21.1",
|
|
19
|
-
"react": "18.3.1",
|
|
20
|
-
"react-native": "0.76.1",
|
|
21
|
-
"react-native-config": "1.5.3",
|
|
22
|
-
"react-native-gesture-handler": "2.21.2",
|
|
23
|
-
"react-native-mmkv": "3.1.0",
|
|
24
|
-
"react-native-safe-area-context": "4.14.0",
|
|
25
|
-
"react-native-screens": "4.2.0",
|
|
26
|
-
"util": "^0.12.5",
|
|
27
|
-
"viem": "^2.21.41",
|
|
28
|
-
"zustand": "^5.0.1"
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"@types/react": "18.3.1",
|
|
32
|
-
"react": "18.3.1",
|
|
33
|
-
"react-native": "0.76.1"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@babel/core": "^7.25.2",
|
|
37
|
-
"@babel/preset-env": "^7.25.3",
|
|
38
|
-
"@babel/runtime": "^7.25.0",
|
|
39
|
-
"@react-native-community/cli": "15.0.0",
|
|
40
|
-
"@react-native-community/cli-platform-android": "15.0.0",
|
|
41
|
-
"@react-native-community/cli-platform-ios": "15.0.0",
|
|
42
|
-
"@react-native/babel-preset": "0.76.1",
|
|
43
|
-
"@react-native/metro-config": "0.76.1",
|
|
44
|
-
"@react-native/typescript-config": "0.76.1",
|
|
45
|
-
"react-native-builder-bob": "^0.30.3",
|
|
46
|
-
"tsx": "^4.19.2"
|
|
47
|
-
},
|
|
48
|
-
"engines": {
|
|
49
|
-
"node": ">=18"
|
|
50
|
-
},
|
|
51
|
-
"workspaces": {
|
|
52
|
-
"nohoist": [
|
|
53
|
-
"**"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const pkg = require("../package.json");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
project: {
|
|
6
|
-
ios: {
|
|
7
|
-
automaticPodsInstallation: true,
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
dependencies: {
|
|
11
|
-
[pkg.name]: {
|
|
12
|
-
root: path.join(__dirname, ".."),
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import dotenv from "dotenv";
|
|
3
|
-
|
|
4
|
-
dotenv.config();
|
|
5
|
-
|
|
6
|
-
const app = express();
|
|
7
|
-
const port = process.env.PORT || 5500;
|
|
8
|
-
const appScheme = process.env.APP_SCHEME || "rn-signer-demo";
|
|
9
|
-
|
|
10
|
-
app.get("/", (req, res) => {
|
|
11
|
-
const bundle = req.query.bundle;
|
|
12
|
-
const orgId = req.query.orgId;
|
|
13
|
-
|
|
14
|
-
res.redirect(`${appScheme}://home?bundle=${bundle}&orgId=${orgId}`);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
app.listen(port, () => {
|
|
18
|
-
console.log(`Server is running on port ${port}`);
|
|
19
|
-
});
|
package/example/src/App.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/extensions */
|
|
2
|
-
import { createStaticNavigation } from "@react-navigation/native";
|
|
3
|
-
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
|
4
|
-
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
5
|
-
|
|
6
|
-
import HomeScreen from "./screens/Home";
|
|
7
|
-
|
|
8
|
-
const linking = {
|
|
9
|
-
enabled: "auto" as const /* Automatically generate paths for all screens */,
|
|
10
|
-
prefixes: ["rn-signer-demo://"],
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const RootStack = createNativeStackNavigator({
|
|
14
|
-
initialRouteName: "Home",
|
|
15
|
-
screens: {
|
|
16
|
-
Home: {
|
|
17
|
-
screen: HomeScreen,
|
|
18
|
-
linking: { path: "home" },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export default function App() {
|
|
24
|
-
const Navigation = createStaticNavigation(RootStack);
|
|
25
|
-
return (
|
|
26
|
-
<SafeAreaProvider>
|
|
27
|
-
<Navigation linking={linking} />
|
|
28
|
-
</SafeAreaProvider>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/extensions */
|
|
2
|
-
import { RNAlchemySigner } from "@account-kit/react-native-signer";
|
|
3
|
-
import type { User } from "@account-kit/signer";
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
5
|
-
import {
|
|
6
|
-
View,
|
|
7
|
-
Text,
|
|
8
|
-
TextInput,
|
|
9
|
-
StyleSheet,
|
|
10
|
-
Linking,
|
|
11
|
-
TouchableOpacity,
|
|
12
|
-
} from "react-native";
|
|
13
|
-
import Config from "react-native-config";
|
|
14
|
-
|
|
15
|
-
export default function HomeScreen() {
|
|
16
|
-
const [email, setEmail] = useState<string>("");
|
|
17
|
-
const [user, setUser] = useState<User | null>(null);
|
|
18
|
-
const signer = new RNAlchemySigner({
|
|
19
|
-
client: { connection: { apiKey: Config.API_KEY! } },
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const handleUserAuth = ({ bundle }: { bundle: string }) => {
|
|
23
|
-
signer
|
|
24
|
-
.authenticate({
|
|
25
|
-
bundle,
|
|
26
|
-
type: "email",
|
|
27
|
-
})
|
|
28
|
-
.then(setUser)
|
|
29
|
-
.catch(console.error);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const handleIncomingURL = (event: { url: string }) => {
|
|
33
|
-
const regex = /[?&]([^=#]+)=([^&#]*)/g;
|
|
34
|
-
|
|
35
|
-
let params: Record<string, string> = {};
|
|
36
|
-
let match: RegExpExecArray | null;
|
|
37
|
-
|
|
38
|
-
while ((match = regex.exec(event.url))) {
|
|
39
|
-
if (match[1] && match[2]) {
|
|
40
|
-
params[match[1]] = match[2];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (!params.bundle || !params.orgId) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
handleUserAuth({
|
|
49
|
-
bundle: params.bundle ?? "",
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
// get the user if already logged in
|
|
55
|
-
signer.getAuthDetails().then(setUser);
|
|
56
|
-
}, []);
|
|
57
|
-
|
|
58
|
-
// Add listener for incoming links
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
const subscription = Linking.addEventListener("url", handleIncomingURL);
|
|
61
|
-
|
|
62
|
-
return () => subscription.remove();
|
|
63
|
-
}, []);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<View style={styles.container}>
|
|
67
|
-
{!user ? (
|
|
68
|
-
<>
|
|
69
|
-
<TextInput
|
|
70
|
-
style={styles.textInput}
|
|
71
|
-
placeholderTextColor="gray"
|
|
72
|
-
placeholder="enter your email"
|
|
73
|
-
onChangeText={setEmail}
|
|
74
|
-
value={email}
|
|
75
|
-
/>
|
|
76
|
-
<TouchableOpacity
|
|
77
|
-
style={styles.button}
|
|
78
|
-
onPress={() => {
|
|
79
|
-
signer
|
|
80
|
-
.authenticate({ email, type: "email" })
|
|
81
|
-
.catch(console.error);
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
<Text style={styles.buttonText}>Sign in</Text>
|
|
85
|
-
</TouchableOpacity>
|
|
86
|
-
</>
|
|
87
|
-
) : (
|
|
88
|
-
<>
|
|
89
|
-
<Text style={styles.userText}>
|
|
90
|
-
Currently logged in as: {user.email}
|
|
91
|
-
</Text>
|
|
92
|
-
<Text style={styles.userText}>OrgId: {user.orgId}</Text>
|
|
93
|
-
<Text style={styles.userText}>Address: {user.address}</Text>
|
|
94
|
-
|
|
95
|
-
<TouchableOpacity
|
|
96
|
-
style={styles.button}
|
|
97
|
-
onPress={() => signer.disconnect().then(() => setUser(null))}
|
|
98
|
-
>
|
|
99
|
-
<Text style={styles.buttonText}>Sign out</Text>
|
|
100
|
-
</TouchableOpacity>
|
|
101
|
-
</>
|
|
102
|
-
)}
|
|
103
|
-
</View>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const styles = StyleSheet.create({
|
|
108
|
-
container: {
|
|
109
|
-
flex: 1,
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
justifyContent: "center",
|
|
112
|
-
backgroundColor: "#FFFFF",
|
|
113
|
-
paddingHorizontal: 20,
|
|
114
|
-
},
|
|
115
|
-
textInput: {
|
|
116
|
-
width: "100%",
|
|
117
|
-
height: 40,
|
|
118
|
-
borderColor: "gray",
|
|
119
|
-
borderWidth: 1,
|
|
120
|
-
paddingHorizontal: 10,
|
|
121
|
-
backgroundColor: "rgba(0,0,0,0.05)",
|
|
122
|
-
marginTop: 20,
|
|
123
|
-
marginBottom: 10,
|
|
124
|
-
},
|
|
125
|
-
box: {
|
|
126
|
-
width: 60,
|
|
127
|
-
height: 60,
|
|
128
|
-
marginVertical: 20,
|
|
129
|
-
},
|
|
130
|
-
button: {
|
|
131
|
-
width: 200,
|
|
132
|
-
padding: 10,
|
|
133
|
-
height: 50,
|
|
134
|
-
backgroundColor: "rgb(147, 197, 253)",
|
|
135
|
-
borderRadius: 5,
|
|
136
|
-
alignItems: "center",
|
|
137
|
-
justifyContent: "center",
|
|
138
|
-
marginTop: 20,
|
|
139
|
-
},
|
|
140
|
-
buttonText: {
|
|
141
|
-
color: "white",
|
|
142
|
-
fontWeight: "bold",
|
|
143
|
-
textAlign: "center",
|
|
144
|
-
},
|
|
145
|
-
userText: {
|
|
146
|
-
marginBottom: 10,
|
|
147
|
-
fontSize: 18,
|
|
148
|
-
},
|
|
149
|
-
});
|
package/example/turbo.json
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["//"],
|
|
3
|
-
"tasks": {
|
|
4
|
-
"build:android": {
|
|
5
|
-
"dependsOn": ["^build"],
|
|
6
|
-
"env": ["ANDROID_HOME", "ORG_GRADLE_PROJECT_newArchEnabled"],
|
|
7
|
-
"inputs": [
|
|
8
|
-
"package.json",
|
|
9
|
-
"android",
|
|
10
|
-
"!android/build",
|
|
11
|
-
"src/*.ts",
|
|
12
|
-
"src/*.tsx",
|
|
13
|
-
"example/package.json",
|
|
14
|
-
"example/android",
|
|
15
|
-
"!example/android/.gradle",
|
|
16
|
-
"!example/android/build",
|
|
17
|
-
"!example/android/app/build"
|
|
18
|
-
],
|
|
19
|
-
"outputs": []
|
|
20
|
-
},
|
|
21
|
-
"build:ios": {
|
|
22
|
-
"dependsOn": ["^build"],
|
|
23
|
-
"env": ["RCT_NEW_ARCH_ENABLED"],
|
|
24
|
-
"inputs": [
|
|
25
|
-
"package.json",
|
|
26
|
-
"*.podspec",
|
|
27
|
-
"ios",
|
|
28
|
-
"src/*.ts",
|
|
29
|
-
"src/*.tsx",
|
|
30
|
-
"example/package.json",
|
|
31
|
-
"example/ios",
|
|
32
|
-
"!example/ios/build",
|
|
33
|
-
"!example/ios/Pods"
|
|
34
|
-
],
|
|
35
|
-
"outputs": []
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
package/react-native.config.js
DELETED
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "typescript-template/base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"rootDir": ".",
|
|
5
|
-
"paths": {
|
|
6
|
-
"@account-kit/react-native-signer": ["./src/index"]
|
|
7
|
-
},
|
|
8
|
-
"allowUnreachableCode": false,
|
|
9
|
-
"allowUnusedLabels": false,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"jsx": "react-jsx",
|
|
13
|
-
"lib": ["ESNext"],
|
|
14
|
-
"module": "ESNext",
|
|
15
|
-
"moduleResolution": "Bundler",
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true,
|
|
18
|
-
"noImplicitReturns": true,
|
|
19
|
-
"noImplicitUseStrict": false,
|
|
20
|
-
"noStrictGenericChecks": false,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
"noUnusedLocals": true,
|
|
23
|
-
"noUnusedParameters": true,
|
|
24
|
-
"resolveJsonModule": true,
|
|
25
|
-
"skipLibCheck": true,
|
|
26
|
-
"strict": true,
|
|
27
|
-
"target": "ESNext",
|
|
28
|
-
"verbatimModuleSyntax": true
|
|
29
|
-
}
|
|
30
|
-
}
|