@account-kit/react-native-signer 4.1.8-alpha
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/.github/actions/setup/action.yml +27 -0
- package/.github/workflows/ci.yml +157 -0
- package/.npmrc +1 -0
- package/.turbo/turbo-prepare.log +21 -0
- package/.watchmanconfig +1 -0
- package/README.md +37 -0
- package/account-kit-react-native-signer.podspec +41 -0
- package/android/build.gradle +132 -0
- package/android/generated/java/com/accountkit/reactnativesigner/NativeTEKStamperSpec.java +55 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/NativeTEKStamperSpec-generated.cpp +56 -0
- package/android/generated/jni/NativeTEKStamperSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/ComponentDescriptors.h +24 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/EventEmitters.cpp +16 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/EventEmitters.h +17 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/NativeTEKStamperSpecJSI-generated.cpp +54 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/NativeTEKStamperSpecJSI.h +150 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/Props.cpp +19 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/Props.h +18 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/ShadowNodes.cpp +17 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/ShadowNodes.h +23 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/NativeTEKStamperSpec/States.h +19 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/KeyExtensions.kt +77 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/NativeTEKStamperModule.kt +234 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/ReactNativeSignerPackage.kt +33 -0
- package/android/src/main/java/com/accountkit/reactnativesigner/TEKManager.kt +88 -0
- package/babel.config.js +5 -0
- package/example/.bundle/config +2 -0
- package/example/.watchmanconfig +1 -0
- package/example/Gemfile +9 -0
- package/example/README.md +79 -0
- package/example/android/app/build.gradle +133 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +9 -0
- package/example/android/app/src/main/AndroidManifest.xml +17 -0
- package/example/android/app/src/main/java/accountkit/reactnativesigner/example/MainActivity.kt +27 -0
- package/example/android/app/src/main/java/accountkit/reactnativesigner/example/MainApplication.kt +48 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- 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 +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +21 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/example/android/gradle.properties +41 -0
- package/example/android/gradlew +252 -0
- package/example/android/gradlew.bat +94 -0
- package/example/android/settings.gradle +6 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +12 -0
- package/example/index.js +6 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/File.swift +6 -0
- package/example/ios/Podfile +47 -0
- package/example/ios/ReactNativeSignerExample/AppDelegate.h +6 -0
- package/example/ios/ReactNativeSignerExample/AppDelegate.mm +31 -0
- package/example/ios/ReactNativeSignerExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/ReactNativeSignerExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/ReactNativeSignerExample/Info.plist +52 -0
- package/example/ios/ReactNativeSignerExample/LaunchScreen.storyboard +47 -0
- package/example/ios/ReactNativeSignerExample/PrivacyInfo.xcprivacy +37 -0
- package/example/ios/ReactNativeSignerExample/main.m +10 -0
- package/example/ios/ReactNativeSignerExample-Bridging-Header.h +3 -0
- package/example/ios/ReactNativeSignerExample.xcodeproj/project.pbxproj +690 -0
- package/example/ios/ReactNativeSignerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeSignerExample.xcscheme +98 -0
- package/example/ios/ReactNativeSignerExampleTests/Info.plist +24 -0
- package/example/ios/ReactNativeSignerExampleTests/ReactNativeSignerExampleTests.m +66 -0
- package/example/jest.config.js +3 -0
- package/example/metro.config.js +22 -0
- package/example/package.json +56 -0
- package/example/react-native.config.js +15 -0
- package/example/redirect-server/index.ts +19 -0
- package/example/src/App.tsx +30 -0
- package/example/src/screens/Home.tsx +149 -0
- package/example/turbo.json +38 -0
- package/ios/ReactNativeSigner.h +12 -0
- package/ios/ReactNativeSigner.mm +21 -0
- package/ios/generated/NativeTEKStamperSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/NativeTEKStamperSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/NativeTEKStamperSpec/EventEmitters.cpp +16 -0
- package/ios/generated/NativeTEKStamperSpec/EventEmitters.h +17 -0
- package/ios/generated/NativeTEKStamperSpec/NativeTEKStamperSpec-generated.mm +67 -0
- package/ios/generated/NativeTEKStamperSpec/NativeTEKStamperSpec.h +68 -0
- package/ios/generated/NativeTEKStamperSpec/Props.cpp +19 -0
- package/ios/generated/NativeTEKStamperSpec/Props.h +18 -0
- package/ios/generated/NativeTEKStamperSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/NativeTEKStamperSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/NativeTEKStamperSpec/ShadowNodes.h +23 -0
- package/ios/generated/NativeTEKStamperSpec/States.cpp +16 -0
- package/ios/generated/NativeTEKStamperSpec/States.h +19 -0
- package/ios/generated/NativeTEKStamperSpecJSI-generated.cpp +54 -0
- package/ios/generated/NativeTEKStamperSpecJSI.h +150 -0
- package/lib/commonjs/NativeTEKStamper.js +9 -0
- package/lib/commonjs/NativeTEKStamper.js.map +1 -0
- package/lib/commonjs/client.js +103 -0
- package/lib/commonjs/client.js.map +1 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/signer.js +39 -0
- package/lib/commonjs/signer.js.map +1 -0
- package/lib/commonjs/utils/mmkv-localstorage-polyfill.js +38 -0
- package/lib/commonjs/utils/mmkv-localstorage-polyfill.js.map +1 -0
- package/lib/module/NativeTEKStamper.js +5 -0
- package/lib/module/NativeTEKStamper.js.map +1 -0
- package/lib/module/client.js +96 -0
- package/lib/module/client.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/signer.js +33 -0
- package/lib/module/signer.js.map +1 -0
- package/lib/module/utils/mmkv-localstorage-polyfill.js +38 -0
- package/lib/module/utils/mmkv-localstorage-polyfill.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeTEKStamper.d.ts +34 -0
- package/lib/typescript/commonjs/src/NativeTEKStamper.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/client.d.ts +107 -0
- package/lib/typescript/commonjs/src/client.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/signer.d.ts +185 -0
- package/lib/typescript/commonjs/src/signer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/mmkv-localstorage-polyfill.d.ts +2 -0
- package/lib/typescript/commonjs/src/utils/mmkv-localstorage-polyfill.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeTEKStamper.d.ts +34 -0
- package/lib/typescript/module/src/NativeTEKStamper.d.ts.map +1 -0
- package/lib/typescript/module/src/client.d.ts +107 -0
- package/lib/typescript/module/src/client.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +2 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/signer.d.ts +185 -0
- package/lib/typescript/module/src/signer.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/mmkv-localstorage-polyfill.d.ts +2 -0
- package/lib/typescript/module/src/utils/mmkv-localstorage-polyfill.d.ts.map +1 -0
- package/package.json +153 -0
- package/react-native.config.js +11 -0
- package/src/NativeTEKStamper.ts +42 -0
- package/src/client.ts +128 -0
- package/src/index.tsx +2 -0
- package/src/signer.ts +39 -0
- package/src/utils/mmkv-localstorage-polyfill.ts +41 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +30 -0
- package/turbo.json +9 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _reactNativeMmkv = require("react-native-mmkv");
|
|
4
|
+
class MMKVLocalStorage {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.storage = new _reactNativeMmkv.MMKV({
|
|
7
|
+
id: "mmkv-localstorage"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// implement the Storage interface
|
|
12
|
+
getItem(key) {
|
|
13
|
+
return this.storage.getString(key) ?? null;
|
|
14
|
+
}
|
|
15
|
+
setItem(key, value) {
|
|
16
|
+
return this.storage.set(key, value);
|
|
17
|
+
}
|
|
18
|
+
removeItem(key) {
|
|
19
|
+
if (this.storage.contains(key)) {
|
|
20
|
+
this.storage.delete(key);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
clear() {
|
|
24
|
+
this.storage.clearAll();
|
|
25
|
+
}
|
|
26
|
+
get length() {
|
|
27
|
+
return this.storage.getAllKeys().length;
|
|
28
|
+
}
|
|
29
|
+
key(index) {
|
|
30
|
+
const keys = this.storage.getAllKeys();
|
|
31
|
+
return keys[index] || null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (!global.localStorage) {
|
|
35
|
+
const mmkvLocalStorage = new MMKVLocalStorage();
|
|
36
|
+
global.localStorage = mmkvLocalStorage;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=mmkv-localstorage-polyfill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeMmkv","require","MMKVLocalStorage","constructor","storage","MMKV","id","getItem","key","getString","setItem","value","set","removeItem","contains","delete","clear","clearAll","length","getAllKeys","index","keys","global","localStorage","mmkvLocalStorage"],"sourceRoot":"../../../src","sources":["utils/mmkv-localstorage-polyfill.ts"],"mappings":";;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,MAAMC,gBAAgB,CAAC;EAErBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,OAAO,GAAG,IAAIC,qBAAI,CAAC;MAAEC,EAAE,EAAE;IAAoB,CAAC,CAAC;EACtD;;EAEA;EACAC,OAAOA,CAACC,GAAW,EAAE;IACnB,OAAO,IAAI,CAACJ,OAAO,CAACK,SAAS,CAACD,GAAG,CAAC,IAAI,IAAI;EAC5C;EAEAE,OAAOA,CAACF,GAAW,EAAEG,KAAa,EAAE;IAClC,OAAO,IAAI,CAACP,OAAO,CAACQ,GAAG,CAACJ,GAAG,EAAEG,KAAK,CAAC;EACrC;EAEAE,UAAUA,CAACL,GAAW,EAAE;IACtB,IAAI,IAAI,CAACJ,OAAO,CAACU,QAAQ,CAACN,GAAG,CAAC,EAAE;MAC9B,IAAI,CAACJ,OAAO,CAACW,MAAM,CAACP,GAAG,CAAC;IAC1B;EACF;EAEAQ,KAAKA,CAAA,EAAG;IACN,IAAI,CAACZ,OAAO,CAACa,QAAQ,CAAC,CAAC;EACzB;EAEA,IAAIC,MAAMA,CAAA,EAAG;IACX,OAAO,IAAI,CAACd,OAAO,CAACe,UAAU,CAAC,CAAC,CAACD,MAAM;EACzC;EAEAV,GAAGA,CAACY,KAAa,EAAE;IACjB,MAAMC,IAAI,GAAG,IAAI,CAACjB,OAAO,CAACe,UAAU,CAAC,CAAC;IACtC,OAAOE,IAAI,CAACD,KAAK,CAAC,IAAI,IAAI;EAC5B;AACF;AAEA,IAAI,CAACE,MAAM,CAACC,YAAY,EAAE;EACxB,MAAMC,gBAAgB,GAAG,IAAItB,gBAAgB,CAAC,CAAC;EAC/CoB,MAAM,CAACC,YAAY,GAAGC,gBAAgB;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTEKStamper.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAsClD,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,kBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/extensions */
|
|
4
|
+
import "./utils/mmkv-localstorage-polyfill.js";
|
|
5
|
+
import { BaseSignerClient } from "@account-kit/signer";
|
|
6
|
+
import NativeTEKStamper from "./NativeTEKStamper.js";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
export const RNSignerClientParamsSchema = z.object({
|
|
9
|
+
connection: z.custom(),
|
|
10
|
+
rootOrgId: z.string().optional()
|
|
11
|
+
});
|
|
12
|
+
// TODO: need to emit events
|
|
13
|
+
export class RNSignerClient extends BaseSignerClient {
|
|
14
|
+
stamper = NativeTEKStamper;
|
|
15
|
+
constructor(params) {
|
|
16
|
+
const {
|
|
17
|
+
connection,
|
|
18
|
+
rootOrgId
|
|
19
|
+
} = RNSignerClientParamsSchema.parse(params);
|
|
20
|
+
super({
|
|
21
|
+
stamper: NativeTEKStamper,
|
|
22
|
+
rootOrgId: rootOrgId ?? "24c1acf5-810f-41e0-a503-d5d13fa8e830",
|
|
23
|
+
connection
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async createAccount(params) {
|
|
27
|
+
if (params.type !== "email") {
|
|
28
|
+
throw new Error("Only email account creation is supported");
|
|
29
|
+
}
|
|
30
|
+
this.eventEmitter.emit("authenticating", {
|
|
31
|
+
type: "email"
|
|
32
|
+
});
|
|
33
|
+
const {
|
|
34
|
+
email,
|
|
35
|
+
expirationSeconds
|
|
36
|
+
} = params;
|
|
37
|
+
const publicKey = await this.stamper.init();
|
|
38
|
+
const response = await this.request("/v1/signup", {
|
|
39
|
+
email,
|
|
40
|
+
targetPublicKey: publicKey,
|
|
41
|
+
expirationSeconds,
|
|
42
|
+
redirectParams: params.redirectParams?.toString()
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
async initEmailAuth(params) {
|
|
47
|
+
this.eventEmitter.emit("authenticating", {
|
|
48
|
+
type: "email"
|
|
49
|
+
});
|
|
50
|
+
let targetPublicKey = await this.stamper.init();
|
|
51
|
+
return this.request("/v1/auth", {
|
|
52
|
+
email: params.email,
|
|
53
|
+
targetPublicKey
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async completeAuthWithBundle(params) {
|
|
57
|
+
if (params.authenticatingType !== "email") {
|
|
58
|
+
throw new Error("Unsupported authenticating type");
|
|
59
|
+
}
|
|
60
|
+
this.eventEmitter.emit("authenticating", {
|
|
61
|
+
type: "email"
|
|
62
|
+
});
|
|
63
|
+
await this.stamper.init();
|
|
64
|
+
const result = await this.stamper.injectCredentialBundle(params.bundle);
|
|
65
|
+
if (!result) {
|
|
66
|
+
throw new Error("Failed to inject credential bundle");
|
|
67
|
+
}
|
|
68
|
+
const user = await this.whoami(params.orgId, params.idToken);
|
|
69
|
+
this.eventEmitter.emit(params.connectedEventName, user, params.bundle);
|
|
70
|
+
return user;
|
|
71
|
+
}
|
|
72
|
+
oauthWithRedirect(_args) {
|
|
73
|
+
throw new Error("Method not implemented.");
|
|
74
|
+
}
|
|
75
|
+
oauthWithPopup(_args) {
|
|
76
|
+
throw new Error("Method not implemented.");
|
|
77
|
+
}
|
|
78
|
+
async disconnect() {
|
|
79
|
+
this.user = undefined;
|
|
80
|
+
this.stamper.clear();
|
|
81
|
+
await this.stamper.init();
|
|
82
|
+
}
|
|
83
|
+
exportWallet(_params) {
|
|
84
|
+
throw new Error("Method not implemented.");
|
|
85
|
+
}
|
|
86
|
+
lookupUserWithPasskey(_user) {
|
|
87
|
+
throw new Error("Method not implemented.");
|
|
88
|
+
}
|
|
89
|
+
getOauthConfig() {
|
|
90
|
+
throw new Error("Method not implemented.");
|
|
91
|
+
}
|
|
92
|
+
getWebAuthnAttestation(_options, _userDetails) {
|
|
93
|
+
throw new Error("Method not implemented.");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BaseSignerClient","NativeTEKStamper","z","RNSignerClientParamsSchema","object","connection","custom","rootOrgId","string","optional","RNSignerClient","stamper","constructor","params","parse","createAccount","type","Error","eventEmitter","emit","email","expirationSeconds","publicKey","init","response","request","targetPublicKey","redirectParams","toString","initEmailAuth","completeAuthWithBundle","authenticatingType","result","injectCredentialBundle","bundle","user","whoami","orgId","idToken","connectedEventName","oauthWithRedirect","_args","oauthWithPopup","disconnect","undefined","clear","exportWallet","_params","lookupUserWithPasskey","_user","getOauthConfig","getWebAuthnAttestation","_options","_userDetails"],"sourceRoot":"../../src","sources":["client.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNAlchemySigner"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAQ,aAAU","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { BaseAlchemySigner, SessionManagerParamsSchema } from "@account-kit/signer";
|
|
5
|
+
// eslint-disable-next-line import/extensions
|
|
6
|
+
import { RNSignerClient, RNSignerClientParamsSchema } from "./client.js";
|
|
7
|
+
const RNAlchemySignerParamsSchema = z.object({
|
|
8
|
+
client: z.custom().or(RNSignerClientParamsSchema)
|
|
9
|
+
}).extend({
|
|
10
|
+
sessionConfig: SessionManagerParamsSchema.omit({
|
|
11
|
+
client: true,
|
|
12
|
+
storage: true
|
|
13
|
+
}).optional()
|
|
14
|
+
});
|
|
15
|
+
export class RNAlchemySigner extends BaseAlchemySigner {
|
|
16
|
+
constructor(params) {
|
|
17
|
+
const {
|
|
18
|
+
sessionConfig,
|
|
19
|
+
...params_
|
|
20
|
+
} = RNAlchemySignerParamsSchema.parse(params);
|
|
21
|
+
let client;
|
|
22
|
+
if ("connection" in params_.client) {
|
|
23
|
+
client = new RNSignerClient(params_.client);
|
|
24
|
+
} else {
|
|
25
|
+
client = params_.client;
|
|
26
|
+
}
|
|
27
|
+
super({
|
|
28
|
+
client,
|
|
29
|
+
sessionConfig
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=signer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["z","BaseAlchemySigner","SessionManagerParamsSchema","RNSignerClient","RNSignerClientParamsSchema","RNAlchemySignerParamsSchema","object","client","custom","or","extend","sessionConfig","omit","storage","optional","RNAlchemySigner","constructor","params","params_","parse"],"sourceRoot":"../../src","sources":["signer.ts"],"mappings":";;AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SACEC,iBAAiB,EACjBC,0BAA0B,QACrB,qBAAqB;AAC5B;AACA,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,aAAU;AAErE,MAAMC,2BAA2B,GAAGL,CAAC,CAClCM,MAAM,CAAC;EACNC,MAAM,EAAEP,CAAC,CAACQ,MAAM,CAAiB,CAAC,CAACC,EAAE,CAACL,0BAA0B;AAClE,CAAC,CAAC,CACDM,MAAM,CAAC;EACNC,aAAa,EAAET,0BAA0B,CAACU,IAAI,CAAC;IAC7CL,MAAM,EAAE,IAAI;IACZM,OAAO,EAAE;EACX,CAAC,CAAC,CAACC,QAAQ,CAAC;AACd,CAAC,CAAC;AAIJ,OAAO,MAAMC,eAAe,SAASd,iBAAiB,CAAiB;EACrEe,WAAWA,CAACC,MAA6B,EAAE;IACzC,MAAM;MAAEN,aAAa;MAAE,GAAGO;IAAQ,CAAC,GACjCb,2BAA2B,CAACc,KAAK,CAACF,MAAM,CAAC;IAE3C,IAAIV,MAAsB;IAE1B,IAAI,YAAY,IAAIW,OAAO,CAACX,MAAM,EAAE;MAClCA,MAAM,GAAG,IAAIJ,cAAc,CAACe,OAAO,CAACX,MAAM,CAAC;IAC7C,CAAC,MAAM;MACLA,MAAM,GAAGW,OAAO,CAACX,MAAM;IACzB;IACA,KAAK,CAAC;MACJA,MAAM;MACNI;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MMKV } from "react-native-mmkv";
|
|
4
|
+
class MMKVLocalStorage {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.storage = new MMKV({
|
|
7
|
+
id: "mmkv-localstorage"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// implement the Storage interface
|
|
12
|
+
getItem(key) {
|
|
13
|
+
return this.storage.getString(key) ?? null;
|
|
14
|
+
}
|
|
15
|
+
setItem(key, value) {
|
|
16
|
+
return this.storage.set(key, value);
|
|
17
|
+
}
|
|
18
|
+
removeItem(key) {
|
|
19
|
+
if (this.storage.contains(key)) {
|
|
20
|
+
this.storage.delete(key);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
clear() {
|
|
24
|
+
this.storage.clearAll();
|
|
25
|
+
}
|
|
26
|
+
get length() {
|
|
27
|
+
return this.storage.getAllKeys().length;
|
|
28
|
+
}
|
|
29
|
+
key(index) {
|
|
30
|
+
const keys = this.storage.getAllKeys();
|
|
31
|
+
return keys[index] || null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (!global.localStorage) {
|
|
35
|
+
const mmkvLocalStorage = new MMKVLocalStorage();
|
|
36
|
+
global.localStorage = mmkvLocalStorage;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=mmkv-localstorage-polyfill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MMKV","MMKVLocalStorage","constructor","storage","id","getItem","key","getString","setItem","value","set","removeItem","contains","delete","clear","clearAll","length","getAllKeys","index","keys","global","localStorage","mmkvLocalStorage"],"sourceRoot":"../../../src","sources":["utils/mmkv-localstorage-polyfill.ts"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,mBAAmB;AAExC,MAAMC,gBAAgB,CAAC;EAErBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,OAAO,GAAG,IAAIH,IAAI,CAAC;MAAEI,EAAE,EAAE;IAAoB,CAAC,CAAC;EACtD;;EAEA;EACAC,OAAOA,CAACC,GAAW,EAAE;IACnB,OAAO,IAAI,CAACH,OAAO,CAACI,SAAS,CAACD,GAAG,CAAC,IAAI,IAAI;EAC5C;EAEAE,OAAOA,CAACF,GAAW,EAAEG,KAAa,EAAE;IAClC,OAAO,IAAI,CAACN,OAAO,CAACO,GAAG,CAACJ,GAAG,EAAEG,KAAK,CAAC;EACrC;EAEAE,UAAUA,CAACL,GAAW,EAAE;IACtB,IAAI,IAAI,CAACH,OAAO,CAACS,QAAQ,CAACN,GAAG,CAAC,EAAE;MAC9B,IAAI,CAACH,OAAO,CAACU,MAAM,CAACP,GAAG,CAAC;IAC1B;EACF;EAEAQ,KAAKA,CAAA,EAAG;IACN,IAAI,CAACX,OAAO,CAACY,QAAQ,CAAC,CAAC;EACzB;EAEA,IAAIC,MAAMA,CAAA,EAAG;IACX,OAAO,IAAI,CAACb,OAAO,CAACc,UAAU,CAAC,CAAC,CAACD,MAAM;EACzC;EAEAV,GAAGA,CAACY,KAAa,EAAE;IACjB,MAAMC,IAAI,GAAG,IAAI,CAAChB,OAAO,CAACc,UAAU,CAAC,CAAC;IACtC,OAAOE,IAAI,CAACD,KAAK,CAAC,IAAI,IAAI;EAC5B;AACF;AAEA,IAAI,CAACE,MAAM,CAACC,YAAY,EAAE;EACxB,MAAMC,gBAAgB,GAAG,IAAIrB,gBAAgB,CAAC,CAAC;EAC/CmB,MAAM,CAACC,YAAY,GAAGC,gBAAgB;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TurboModule } from "react-native";
|
|
2
|
+
type TStamp = {
|
|
3
|
+
stampHeaderName: string;
|
|
4
|
+
stampHeaderValue: string;
|
|
5
|
+
};
|
|
6
|
+
export interface Spec extends TurboModule {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of the stamper and returns the public key of TEK
|
|
9
|
+
*/
|
|
10
|
+
init(): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Clears the stored bundle and TEK
|
|
13
|
+
*/
|
|
14
|
+
clear(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the public key, or `null` if the stamper isn't properly initialized.
|
|
17
|
+
*/
|
|
18
|
+
publicKey(): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Function to inject a new credential into the iframe
|
|
21
|
+
* The bundle should be encrypted to the stamper's initial public key
|
|
22
|
+
* Encryption should be performed with HPKE (RFC 9180).
|
|
23
|
+
* This is used during recovery and auth flows.
|
|
24
|
+
*/
|
|
25
|
+
injectCredentialBundle(bundle: string): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Function to sign a payload with the underlying credential bundle
|
|
28
|
+
* Should throw an error if the bundle was never injected
|
|
29
|
+
*/
|
|
30
|
+
stamp(payload: string): Promise<TStamp>;
|
|
31
|
+
}
|
|
32
|
+
declare const _default: Spec;
|
|
33
|
+
export default _default;
|
|
34
|
+
//# sourceMappingURL=NativeTEKStamper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeTEKStamper.d.ts","sourceRoot":"","sources":["../../../../src/NativeTEKStamper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,KAAK,MAAM,GAAG;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAExB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAE3B;;;;;OAKG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzD;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzC;wBAII,IAAI;AAFT,wBAEU"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import "./utils/mmkv-localstorage-polyfill";
|
|
2
|
+
import { BaseSignerClient, type AlchemySignerClientEvents, type AuthenticatingEventMetadata, type CreateAccountParams, type EmailAuthParams, type GetWebAuthnAttestationResult, type OauthConfig, type OauthParams, type SignupResponse, type User } from "@account-kit/signer";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
export declare const RNSignerClientParamsSchema: z.ZodObject<{
|
|
5
|
+
connection: z.ZodType<{
|
|
6
|
+
apiKey: string;
|
|
7
|
+
rpcUrl?: undefined;
|
|
8
|
+
jwt?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
jwt: string;
|
|
11
|
+
rpcUrl?: undefined;
|
|
12
|
+
apiKey?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
rpcUrl: string;
|
|
15
|
+
apiKey?: undefined;
|
|
16
|
+
jwt?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
rpcUrl: string;
|
|
19
|
+
jwt: string;
|
|
20
|
+
apiKey?: undefined;
|
|
21
|
+
}, z.ZodTypeDef, {
|
|
22
|
+
apiKey: string;
|
|
23
|
+
rpcUrl?: undefined;
|
|
24
|
+
jwt?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
jwt: string;
|
|
27
|
+
rpcUrl?: undefined;
|
|
28
|
+
apiKey?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
rpcUrl: string;
|
|
31
|
+
apiKey?: undefined;
|
|
32
|
+
jwt?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
rpcUrl: string;
|
|
35
|
+
jwt: string;
|
|
36
|
+
apiKey?: undefined;
|
|
37
|
+
}>;
|
|
38
|
+
rootOrgId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
connection: {
|
|
41
|
+
apiKey: string;
|
|
42
|
+
rpcUrl?: undefined;
|
|
43
|
+
jwt?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
jwt: string;
|
|
46
|
+
rpcUrl?: undefined;
|
|
47
|
+
apiKey?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
rpcUrl: string;
|
|
50
|
+
apiKey?: undefined;
|
|
51
|
+
jwt?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
rpcUrl: string;
|
|
54
|
+
jwt: string;
|
|
55
|
+
apiKey?: undefined;
|
|
56
|
+
};
|
|
57
|
+
rootOrgId?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
connection: {
|
|
60
|
+
apiKey: string;
|
|
61
|
+
rpcUrl?: undefined;
|
|
62
|
+
jwt?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
jwt: string;
|
|
65
|
+
rpcUrl?: undefined;
|
|
66
|
+
apiKey?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
rpcUrl: string;
|
|
69
|
+
apiKey?: undefined;
|
|
70
|
+
jwt?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
rpcUrl: string;
|
|
73
|
+
jwt: string;
|
|
74
|
+
apiKey?: undefined;
|
|
75
|
+
};
|
|
76
|
+
rootOrgId?: string | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
export type RNSignerClientParams = z.input<typeof RNSignerClientParamsSchema>;
|
|
79
|
+
export declare class RNSignerClient extends BaseSignerClient<undefined> {
|
|
80
|
+
private stamper;
|
|
81
|
+
constructor(params: RNSignerClientParams);
|
|
82
|
+
createAccount(params: CreateAccountParams): Promise<SignupResponse>;
|
|
83
|
+
initEmailAuth(params: Omit<EmailAuthParams, "targetPublicKey">): Promise<{
|
|
84
|
+
orgId: string;
|
|
85
|
+
}>;
|
|
86
|
+
completeAuthWithBundle(params: {
|
|
87
|
+
bundle: string;
|
|
88
|
+
orgId: string;
|
|
89
|
+
connectedEventName: keyof AlchemySignerClientEvents;
|
|
90
|
+
authenticatingType: AuthenticatingEventMetadata["type"];
|
|
91
|
+
idToken?: string;
|
|
92
|
+
}): Promise<User>;
|
|
93
|
+
oauthWithRedirect(_args: Extract<OauthParams, {
|
|
94
|
+
mode: "redirect";
|
|
95
|
+
}>): Promise<never>;
|
|
96
|
+
oauthWithPopup(_args: Extract<OauthParams, {
|
|
97
|
+
mode: "popup";
|
|
98
|
+
}>): Promise<User>;
|
|
99
|
+
disconnect(): Promise<void>;
|
|
100
|
+
exportWallet(_params: unknown): Promise<boolean>;
|
|
101
|
+
lookupUserWithPasskey(_user?: User): Promise<User>;
|
|
102
|
+
protected getOauthConfig(): Promise<OauthConfig>;
|
|
103
|
+
protected getWebAuthnAttestation(_options: CredentialCreationOptions, _userDetails?: {
|
|
104
|
+
username: string;
|
|
105
|
+
}): Promise<GetWebAuthnAttestationResult>;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EACL,gBAAgB,EAChB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,IAAI,EACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,qBAAa,cAAe,SAAQ,gBAAgB,CAAC,SAAS,CAAC;IAC7D,OAAO,CAAC,OAAO,CAAoB;gBACvB,MAAM,EAAE,oBAAoB;IAUzB,aAAa,CAC1B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,cAAc,CAAC;IAmBX,aAAa,CAC1B,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,GAC/C,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAUd,sBAAsB,CAAC,MAAM,EAAE;QAC5C,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;QACpD,kBAAkB,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;QACxD,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBR,iBAAiB,CACxB,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,GAChD,OAAO,CAAC,KAAK,CAAC;IAGR,cAAc,CACrB,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,GAC7C,OAAO,CAAC,IAAI,CAAC;IAID,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAGhD,qBAAqB,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;cAGxC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;cAGtC,sBAAsB,CACvC,QAAQ,EAAE,yBAAyB,EACnC,YAAY,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAClC,OAAO,CAAC,4BAA4B,CAAC;CAGzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseAlchemySigner } from "@account-kit/signer";
|
|
3
|
+
import { RNSignerClient } from "./client";
|
|
4
|
+
declare const RNAlchemySignerParamsSchema: z.ZodObject<{
|
|
5
|
+
client: z.ZodUnion<[z.ZodType<RNSignerClient, z.ZodTypeDef, RNSignerClient>, z.ZodObject<{
|
|
6
|
+
connection: z.ZodType<{
|
|
7
|
+
apiKey: string;
|
|
8
|
+
rpcUrl?: undefined;
|
|
9
|
+
jwt?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
jwt: string;
|
|
12
|
+
rpcUrl?: undefined;
|
|
13
|
+
apiKey?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
rpcUrl: string;
|
|
16
|
+
apiKey?: undefined;
|
|
17
|
+
jwt?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
rpcUrl: string;
|
|
20
|
+
jwt: string;
|
|
21
|
+
apiKey?: undefined;
|
|
22
|
+
}, z.ZodTypeDef, {
|
|
23
|
+
apiKey: string;
|
|
24
|
+
rpcUrl?: undefined;
|
|
25
|
+
jwt?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
jwt: string;
|
|
28
|
+
rpcUrl?: undefined;
|
|
29
|
+
apiKey?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
rpcUrl: string;
|
|
32
|
+
apiKey?: undefined;
|
|
33
|
+
jwt?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
rpcUrl: string;
|
|
36
|
+
jwt: string;
|
|
37
|
+
apiKey?: undefined;
|
|
38
|
+
}>;
|
|
39
|
+
rootOrgId: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
connection: {
|
|
42
|
+
apiKey: string;
|
|
43
|
+
rpcUrl?: undefined;
|
|
44
|
+
jwt?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
jwt: string;
|
|
47
|
+
rpcUrl?: undefined;
|
|
48
|
+
apiKey?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
rpcUrl: string;
|
|
51
|
+
apiKey?: undefined;
|
|
52
|
+
jwt?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
rpcUrl: string;
|
|
55
|
+
jwt: string;
|
|
56
|
+
apiKey?: undefined;
|
|
57
|
+
};
|
|
58
|
+
rootOrgId?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
connection: {
|
|
61
|
+
apiKey: string;
|
|
62
|
+
rpcUrl?: undefined;
|
|
63
|
+
jwt?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
jwt: string;
|
|
66
|
+
rpcUrl?: undefined;
|
|
67
|
+
apiKey?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
rpcUrl: string;
|
|
70
|
+
apiKey?: undefined;
|
|
71
|
+
jwt?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
rpcUrl: string;
|
|
74
|
+
jwt: string;
|
|
75
|
+
apiKey?: undefined;
|
|
76
|
+
};
|
|
77
|
+
rootOrgId?: string | undefined;
|
|
78
|
+
}>]>;
|
|
79
|
+
sessionConfig: z.ZodOptional<z.ZodObject<Omit<{
|
|
80
|
+
sessionKey: z.ZodDefault<z.ZodString>;
|
|
81
|
+
storage: z.ZodUnion<[z.ZodDefault<z.ZodEnum<["localStorage", "sessionStorage"]>>, z.ZodType<Storage, z.ZodTypeDef, Storage>]>;
|
|
82
|
+
expirationTimeMs: z.ZodDefault<z.ZodNumber>;
|
|
83
|
+
client: z.ZodType<import("@account-kit/signer").BaseSignerClient<unknown>, z.ZodTypeDef, import("@account-kit/signer").BaseSignerClient<unknown>>;
|
|
84
|
+
}, "client" | "storage">, "strip", z.ZodTypeAny, {
|
|
85
|
+
sessionKey: string;
|
|
86
|
+
expirationTimeMs: number;
|
|
87
|
+
}, {
|
|
88
|
+
sessionKey?: string | undefined;
|
|
89
|
+
expirationTimeMs?: number | undefined;
|
|
90
|
+
}>>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
client: ({
|
|
93
|
+
connection: {
|
|
94
|
+
apiKey: string;
|
|
95
|
+
rpcUrl?: undefined;
|
|
96
|
+
jwt?: undefined;
|
|
97
|
+
} | {
|
|
98
|
+
jwt: string;
|
|
99
|
+
rpcUrl?: undefined;
|
|
100
|
+
apiKey?: undefined;
|
|
101
|
+
} | {
|
|
102
|
+
rpcUrl: string;
|
|
103
|
+
apiKey?: undefined;
|
|
104
|
+
jwt?: undefined;
|
|
105
|
+
} | {
|
|
106
|
+
rpcUrl: string;
|
|
107
|
+
jwt: string;
|
|
108
|
+
apiKey?: undefined;
|
|
109
|
+
};
|
|
110
|
+
rootOrgId?: string | undefined;
|
|
111
|
+
} | RNSignerClient) & ({
|
|
112
|
+
connection: {
|
|
113
|
+
apiKey: string;
|
|
114
|
+
rpcUrl?: undefined;
|
|
115
|
+
jwt?: undefined;
|
|
116
|
+
} | {
|
|
117
|
+
jwt: string;
|
|
118
|
+
rpcUrl?: undefined;
|
|
119
|
+
apiKey?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
rpcUrl: string;
|
|
122
|
+
apiKey?: undefined;
|
|
123
|
+
jwt?: undefined;
|
|
124
|
+
} | {
|
|
125
|
+
rpcUrl: string;
|
|
126
|
+
jwt: string;
|
|
127
|
+
apiKey?: undefined;
|
|
128
|
+
};
|
|
129
|
+
rootOrgId?: string | undefined;
|
|
130
|
+
} | RNSignerClient | undefined);
|
|
131
|
+
sessionConfig?: {
|
|
132
|
+
sessionKey: string;
|
|
133
|
+
expirationTimeMs: number;
|
|
134
|
+
} | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
client: ({
|
|
137
|
+
connection: {
|
|
138
|
+
apiKey: string;
|
|
139
|
+
rpcUrl?: undefined;
|
|
140
|
+
jwt?: undefined;
|
|
141
|
+
} | {
|
|
142
|
+
jwt: string;
|
|
143
|
+
rpcUrl?: undefined;
|
|
144
|
+
apiKey?: undefined;
|
|
145
|
+
} | {
|
|
146
|
+
rpcUrl: string;
|
|
147
|
+
apiKey?: undefined;
|
|
148
|
+
jwt?: undefined;
|
|
149
|
+
} | {
|
|
150
|
+
rpcUrl: string;
|
|
151
|
+
jwt: string;
|
|
152
|
+
apiKey?: undefined;
|
|
153
|
+
};
|
|
154
|
+
rootOrgId?: string | undefined;
|
|
155
|
+
} | RNSignerClient) & ({
|
|
156
|
+
connection: {
|
|
157
|
+
apiKey: string;
|
|
158
|
+
rpcUrl?: undefined;
|
|
159
|
+
jwt?: undefined;
|
|
160
|
+
} | {
|
|
161
|
+
jwt: string;
|
|
162
|
+
rpcUrl?: undefined;
|
|
163
|
+
apiKey?: undefined;
|
|
164
|
+
} | {
|
|
165
|
+
rpcUrl: string;
|
|
166
|
+
apiKey?: undefined;
|
|
167
|
+
jwt?: undefined;
|
|
168
|
+
} | {
|
|
169
|
+
rpcUrl: string;
|
|
170
|
+
jwt: string;
|
|
171
|
+
apiKey?: undefined;
|
|
172
|
+
};
|
|
173
|
+
rootOrgId?: string | undefined;
|
|
174
|
+
} | RNSignerClient | undefined);
|
|
175
|
+
sessionConfig?: {
|
|
176
|
+
sessionKey?: string | undefined;
|
|
177
|
+
expirationTimeMs?: number | undefined;
|
|
178
|
+
} | undefined;
|
|
179
|
+
}>;
|
|
180
|
+
export type RNAlchemySignerParams = z.input<typeof RNAlchemySignerParamsSchema>;
|
|
181
|
+
export declare class RNAlchemySigner extends BaseAlchemySigner<RNSignerClient> {
|
|
182
|
+
constructor(params: RNAlchemySignerParams);
|
|
183
|
+
}
|
|
184
|
+
export {};
|
|
185
|
+
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAA8B,MAAM,UAAU,CAAC;AAEtE,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEgC,EAAG,UAElE,CAAC,EAAE,SACH;iBAAe,EAAG,QAAQ,EAAE,EAAE,UAAU,CAAC,EAAE,OAAO,uCAEnC,EACb,OAAE,UAAS,EACb,UAEA;0BAAmC,EAAG,UAAU,CAAC,EAAE,SAAS;gBAAc,EAAG,OAE3E,0DAA2B,EAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAJxC,CAAC;AAEL,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,qBAAa,eAAgB,SAAQ,iBAAiB,CAAC,cAAc,CAAC;gBACxD,MAAM,EAAE,qBAAqB;CAgB1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mmkv-localstorage-polyfill.d.ts","sourceRoot":"","sources":["../../../../../src/utils/mmkv-localstorage-polyfill.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TurboModule } from "react-native";
|
|
2
|
+
type TStamp = {
|
|
3
|
+
stampHeaderName: string;
|
|
4
|
+
stampHeaderValue: string;
|
|
5
|
+
};
|
|
6
|
+
export interface Spec extends TurboModule {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of the stamper and returns the public key of TEK
|
|
9
|
+
*/
|
|
10
|
+
init(): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Clears the stored bundle and TEK
|
|
13
|
+
*/
|
|
14
|
+
clear(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the public key, or `null` if the stamper isn't properly initialized.
|
|
17
|
+
*/
|
|
18
|
+
publicKey(): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Function to inject a new credential into the iframe
|
|
21
|
+
* The bundle should be encrypted to the stamper's initial public key
|
|
22
|
+
* Encryption should be performed with HPKE (RFC 9180).
|
|
23
|
+
* This is used during recovery and auth flows.
|
|
24
|
+
*/
|
|
25
|
+
injectCredentialBundle(bundle: string): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Function to sign a payload with the underlying credential bundle
|
|
28
|
+
* Should throw an error if the bundle was never injected
|
|
29
|
+
*/
|
|
30
|
+
stamp(payload: string): Promise<TStamp>;
|
|
31
|
+
}
|
|
32
|
+
declare const _default: Spec;
|
|
33
|
+
export default _default;
|
|
34
|
+
//# sourceMappingURL=NativeTEKStamper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeTEKStamper.d.ts","sourceRoot":"","sources":["../../../../src/NativeTEKStamper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,KAAK,MAAM,GAAG;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAExB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAE3B;;;;;OAKG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzD;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzC;wBAII,IAAI;AAFT,wBAEU"}
|