@crossmint/client-sdk-react-native-ui 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +20 -0
- package/android/src/main/java/com/crossmint/client/sdk/reactnativeui/DeviceSignerModule.kt +61 -0
- package/dist/{chunk-XYFP2ZKE.mjs → chunk-5TKH4O3D.mjs} +1 -1
- package/dist/{chunk-34KMMXOC.mjs → chunk-63RNMZOE.mjs} +1 -1
- package/dist/chunk-6N7XF54Y.mjs +1 -0
- package/dist/chunk-7QXP7FEY.mjs +1 -0
- package/dist/{chunk-3MJP36AJ.js → chunk-BVQQ3Y6U.js} +1 -1
- package/dist/chunk-G5FBYKXO.js +1 -0
- package/dist/{chunk-2RDEJU3T.js → chunk-I6GZYBA2.js} +1 -1
- package/dist/{chunk-ILLEHF5B.mjs → chunk-JM2MKNKV.mjs} +1 -1
- package/dist/{chunk-XAJZGXTU.js → chunk-KHT2FASN.js} +1 -1
- package/dist/chunk-MGE6NVGD.mjs +1 -0
- package/dist/{chunk-W4PUVHWF.mjs → chunk-OBB3KSTZ.mjs} +1 -1
- package/dist/chunk-S75MIWI2.js +1 -0
- package/dist/{chunk-763KUIBE.js → chunk-T6JE4K3G.js} +1 -1
- package/dist/chunk-WIYF6J6B.js +1 -0
- package/dist/{chunk-ECQF6MOG.mjs → chunk-Y2UB6EIT.mjs} +1 -1
- package/dist/{chunk-WQC7H2WD.js → chunk-YFY37X57.js} +1 -1
- package/dist/{chunk-QC2NMTN3.mjs → chunk-YIC3545U.mjs} +1 -1
- package/dist/{chunk-3G67LZY4.js → chunk-Z5ATQ2JL.js} +1 -1
- package/dist/{chunk-YG2CHXKB.js → chunk-ZL3FZ2JT.js} +1 -1
- package/dist/{chunk-YMCYXFCG.mjs → chunk-ZLQHVLFA.mjs} +1 -1
- package/dist/components/embed/index.js +1 -1
- package/dist/components/embed/index.mjs +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.mjs +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.mjs +1 -1
- package/dist/components/embed/v3/index.js +1 -1
- package/dist/components/embed/v3/index.mjs +1 -1
- package/dist/components/icons/index.js +1 -1
- package/dist/components/icons/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/signers/EmailSignersDialog.js +1 -1
- package/dist/components/signers/EmailSignersDialog.mjs +1 -1
- package/dist/components/signers/PhoneSignersDialog.js +1 -1
- package/dist/components/signers/PhoneSignersDialog.mjs +1 -1
- package/dist/components/signers/index.js +1 -1
- package/dist/components/signers/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/logger/init.js +1 -1
- package/dist/logger/init.mjs +1 -1
- package/dist/native/NativeDeviceSignerKeyStorage.d.mts +20 -0
- package/dist/native/NativeDeviceSignerKeyStorage.d.ts +20 -0
- package/dist/native/NativeDeviceSignerKeyStorage.js +1 -0
- package/dist/native/NativeDeviceSignerKeyStorage.mjs +1 -0
- package/dist/plugin/withCrossmintUI.js +1 -1
- package/dist/plugin/withCrossmintUI.mjs +1 -1
- package/dist/providers/CrossmintProvider.js +1 -1
- package/dist/providers/CrossmintProvider.mjs +1 -1
- package/dist/providers/CrossmintWalletProvider.js +1 -1
- package/dist/providers/CrossmintWalletProvider.mjs +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/providers/index.mjs +1 -1
- package/dist/utils/createCrossmintApiClient.js +1 -1
- package/dist/utils/createCrossmintApiClient.mjs +1 -1
- package/expo-module.config.json +10 -0
- package/ios/CrossmintReactNativeUI.podspec +19 -0
- package/ios/DeviceSignerModule.swift +147 -0
- package/package.json +15 -20
- package/dist/chunk-HPMKZRIV.js +0 -1
- package/dist/chunk-I7PZCHYU.mjs +0 -1
- package/dist/chunk-IN4XNL7B.js +0 -1
- package/dist/chunk-YJXUDPES.mjs +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'expo-module-gradle-plugin'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
group = 'com.crossmint'
|
|
7
|
+
version = '0.0.1'
|
|
8
|
+
|
|
9
|
+
android {
|
|
10
|
+
namespace "com.crossmint.client.sdk.reactnativeui"
|
|
11
|
+
defaultConfig {
|
|
12
|
+
versionCode 1
|
|
13
|
+
versionName '0.0.1'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dependencies {
|
|
18
|
+
implementation "com.crossmint:sdk-device-signer:0.0.15"
|
|
19
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2"
|
|
20
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
package com.crossmint.client.sdk.reactnativeui
|
|
2
|
+
|
|
3
|
+
import com.crossmint.kotlin.devicesigner.DeviceSignerStorageFactory
|
|
4
|
+
import expo.modules.kotlin.modules.Module
|
|
5
|
+
import expo.modules.kotlin.modules.ModuleDefinition
|
|
6
|
+
import kotlinx.coroutines.runBlocking
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Expo native module that exposes device signer key storage to React Native.
|
|
10
|
+
*
|
|
11
|
+
* Delegates to [com.crossmint.kotlin.devicesigner.KeystoreKeyStorage] via
|
|
12
|
+
* [DeviceSignerStorageFactory], which uses Android Keystore backed by StrongBox
|
|
13
|
+
* (API 28+) or the TEE.
|
|
14
|
+
*
|
|
15
|
+
* Registered as "CrossmintDeviceSigner" and consumed on the JS side by
|
|
16
|
+
* NativeDeviceSignerKeyStorage from @crossmint/client-sdk-react-native-ui.
|
|
17
|
+
*/
|
|
18
|
+
class DeviceSignerModule : Module() {
|
|
19
|
+
|
|
20
|
+
private val storage by lazy {
|
|
21
|
+
DeviceSignerStorageFactory.create()
|
|
22
|
+
?: throw IllegalStateException("Device signer storage is not available on this platform")
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun definition() = ModuleDefinition {
|
|
26
|
+
Name("CrossmintDeviceSigner")
|
|
27
|
+
|
|
28
|
+
AsyncFunction("isAvailable") {
|
|
29
|
+
runBlocking { storage.isAvailable() }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
AsyncFunction("generateKey") { address: String? ->
|
|
33
|
+
runBlocking { storage.generateKey(address).getOrThrow() }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
AsyncFunction("mapAddressToKey") { address: String, publicKeyBase64: String ->
|
|
37
|
+
runBlocking { storage.mapAddressToKey(address, publicKeyBase64).getOrThrow() }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
AsyncFunction("getKey") { address: String ->
|
|
41
|
+
runBlocking { storage.getKey(address) }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
AsyncFunction("hasKey") { publicKeyBase64: String ->
|
|
45
|
+
runBlocking { storage.hasKey(publicKeyBase64) }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
AsyncFunction("signMessage") { address: String, message: String ->
|
|
49
|
+
val (r, s) = runBlocking { storage.signMessage(address, message).getOrThrow() }
|
|
50
|
+
mapOf("r" to r, "s" to s)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
AsyncFunction("deleteKey") { address: String ->
|
|
54
|
+
runBlocking { storage.deleteKey(address).getOrThrow() }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
AsyncFunction("deletePendingKey") { publicKeyBase64: String ->
|
|
58
|
+
runBlocking { storage.deletePendingKey(publicKeyBase64).getOrThrow() }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-Y2UB6EIT.mjs";import{useMemo as v}from"react";import d from"expo-constants";import{CrossmintProvider as f,createLoggerContext as P}from"@crossmint/client-sdk-react-base";import{jsx as p}from"react/jsx-runtime";var l=P();function N({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=v(()=>m(o,r),[o,r]),c=(n=(t=(e=d.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=d.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return p(l.Provider,{value:g,children:p(f,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}export{l as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-JM2MKNKV.mjs";import{a as e}from"./chunk-4P5ABAFD.mjs";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{requireNativeModule as l}from"expo-modules-core";import*as r from"expo-device";import{DeviceSignerKeyStorage as a}from"@crossmint/wallets-sdk";var n=null;function i(){return n==null&&(n=l("CrossmintDeviceSigner")),n}var d=class extends a{constructor(){super("")}generateKey(e){var s;return i().generateKey((s=e.address)!=null?s:null)}mapAddressToKey(e,s){return i().mapAddressToKey(e,s)}getKey(e){return i().getKey(e)}hasKey(e){return i().hasKey(e)}signMessage(e,s){return i().signMessage(e,s)}deleteKey(e){return i().deleteKey(e)}deletePendingKey(e){return i().deletePendingKey(e)}getDeviceName(){var t,o,g;let e=(o=(t=r.deviceName)!=null?t:r.modelName)!=null?o:r.brand,s=r.osName;return e!=null&&s!=null?`${e} (${s})`:(g=e!=null?e:s)!=null?g:"Unknown Device"}};export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A}from"./chunk-5TKH4O3D.mjs";import{a as K}from"./chunk-OBB3KSTZ.mjs";import{a as H}from"./chunk-ZLQHVLFA.mjs";import{a as _}from"./chunk-6N7XF54Y.mjs";import{a as W,b as G,f as b}from"./chunk-4P5ABAFD.mjs";import{useCallback as S,useRef as g,useMemo as E,useEffect as z,useState as re,useContext as ne}from"react";import{Platform as te,View as ae}from"react-native";import{RNWebView as oe,WebViewParent as se}from"@crossmint/client-sdk-rn-window";import{environmentUrlConfig as B,signerInboundEvents as ie,signerOutboundEvents as ce,SignerErrorCode as le}from"@crossmint/client-signers";import{validateAPIKey as ue}from"@crossmint/common-sdk-base";import{CrossmintWalletBaseProvider as de,CrossmintWalletBaseContext as j,useCrossmint as we}from"@crossmint/client-sdk-react-base";import{useLogger as fe}from"@crossmint/client-sdk-react-base";import{Fragment as he,jsx as p,jsxs as F}from"react/jsx-runtime";var L="Passkey signers are not supported in React Native. Use a different signer type such as 'email', 'phone', or 'device'.";function ve(c){var i,v;return c==null?!1:!!(((i=c.recovery)==null?void 0:i.type)==="passkey"||(v=c.signers)!=null&&v.some(m=>m.type==="passkey"))}function me({children:c}){let i=ne(j),v=S(d=>b(this,null,function*(){var R,I;if(((R=d.recovery)==null?void 0:R.type)==="passkey"||(I=d.signers)!=null&&I.some(r=>r.type==="passkey"))throw new Error(L);return i.createWallet(d)}),[i.createWallet]),m=S(d=>b(this,null,function*(){throw new Error(L)}),[]),V=E(()=>G(W({},i),{createWallet:v,createPasskeySigner:m}),[i,v,m]);return p(j.Provider,{value:V,children:c})}function pe({children:c,createOnLogin:i,appearance:v,showOtpSignerPrompt:m=!0,callbacks:V,deviceSignerKeyStorage:d}){let R=E(()=>d!=null?d:new _,[]),{crossmint:I}=we("CrossmintWalletProvider must be used within CrossmintProvider"),r=fe(A),{apiKey:N,appId:O}=I,D=E(()=>{let e=ue(N);if(!e.isValid)throw new Error("Invalid API key");return e},[N]),J=E(()=>B[D.environment],[D.environment]),y=g(null),t=g(null),[T,Y]=re(!1),C=g(!1),l=g(!1),s=g(0),M=g(0),$=E(()=>O!=null?{crossmintAppId:O}:{},[O]),w=S(e=>b(this,null,function*(){if(t.current!=null){let n=t.current;if(l.current){r.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:s.current});return}if(C.current&&n.isConnected){r.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:s.current});return}l.current=!0;let a=Date.now();M.current=a;let o=s.current;try{r.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:te.OS}),C.current=!0,n.isConnected=!1,yield n.handshakeWithChild();let u=Date.now()-a;r.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:u})}catch(u){let f=Date.now()-a;o===s.current&&(C.current=!1),r.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:f,error:u instanceof Error?u.message:String(u)}),console.error("[CrossmintWalletProvider] Handshake error:",u)}finally{o===s.current&&(l.current=!1)}}else r.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[r]);z(()=>{y.current!=null&&t.current==null&&(r.info("react-native.wallet.webview.initializing"),t.current=new se(y,{incomingEvents:ce,outgoingEvents:ie,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[le.IndexedDbFatal]}}),r.info("react-native.wallet.webview.initialized"),w("eager"))},[T,r,w]);let q=S(()=>b(this,null,function*(){var e,n;r.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:l.current,isConnected:(n=(e=t.current)==null?void 0:e.isConnected)!=null?n:!1,generation:s.current}),yield w("onLoadEnd")}),[r,w]),Q=S(e=>{var o,u;let n=t.current;if(n==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){r.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:l.current,isConnected:(u=(o=t.current)==null?void 0:o.isConnected)!=null?u:!1,generation:s.current,msSinceHandshakeStart:M.current>0?Date.now()-M.current:null}),w("frame-ready");return}try{let f=JSON.parse(a);if(f&&typeof f.type=="string"&&f.type.startsWith("console.")){let x=f.type.split(".")[1],U=(f.data||[]).map(h=>{try{return h==="[Function]"||h==="[Circular Reference]"||h==="[Unserializable Object]"?h:JSON.parse(h)}catch(be){return h}}),k=`react-native.wallet.webview.console.${x}`,P={webview_args:U};switch(x){case"log":r.info(k,P);break;case"error":r.error(k,P);break;case"warn":r.warn(k,P);break;case"info":r.info(k,P);break;case"debug":r.debug(k,P);break;default:r.info("react-native.wallet.webview.console.unknown",{webview_method:x,webview_args:U})}return}}catch(f){}n.handleMessage(e)},[r,w]),X=()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},Z=({emailSignerProps:e,phoneSignerProps:n})=>m?F(he,{children:[p(H,W({},e)),p(K,W({},n))]}):null,ee=()=>b(this,null,function*(){r.info("react-native.wallet.webview.init.start"),Y(!0);let e=0,n=100;for(;t.current==null&&e<n;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw r.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");r.info("react-native.wallet.webview.init.success",{attempts:e})});return z(()=>{if(ve(i))throw new Error(L)},[i]),F(de,{createOnLogin:i,appearance:v,showOtpSignerPrompt:m,initializeWebView:ee,callbacks:V,renderUI:Z,clientTEEConnection:X,deviceSignerKeyStorage:R,children:[p(me,{children:c}),T&&p(ae,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:p(oe,{ref:y,source:{uri:J},globals:$,onLoadEnd:q,onMessage:Q,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},onRenderProcessGone:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[B[D.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function Me(c){return p(pe,W({},c))}export{Me as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2UY6GCV3js = require('./chunk-2UY6GCV3.js');var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2UY6GCV3js = require('./chunk-2UY6GCV3.js');var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var _chunkZL3FZ2JTjs = require('./chunk-ZL3FZ2JT.js');var _chunk2D2RJCVXjs = require('./chunk-2D2RJCVX.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function Q(t){var u;let[e,w]=_react.useState.call(void 0, null),[C,v]=_react.useState.call(void 0, 0),E=_react.useRef.call(void 0, (u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=_react.useRef.call(void 0, t);if(U(t,n.current)){let r=_chunkIJN37RF2js.a.call(void 0, {},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunkZL3FZ2JTjs.a.call(void 0, i,{usageOrigin:"client"}),P=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});w(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{_chunk2D2RJCVXjs.a.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkYQEWHOQ7js.c,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunk2UY6GCV3js.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunkIJN37RF2js.b.call(void 0, _chunkIJN37RF2js.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}exports.a = Q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.3",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","ios","android","expo-module.config.json","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0",mitt:"3.0.1",zod:"3.22.4","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8","react-native-svg":"15.14.0","react-native-webview":"13.15.0"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-modules-core":"~3.0.29"},peerDependencies:{"@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-modules-core":">=2.0.0",react:">=17.0.2","react-native":">=0.74.3"}};exports.a = o;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2U67EBAUjs = require('./chunk-2U67EBAU.js');var _chunkLHEOII54js = require('./chunk-LHEOII54.js');var _chunkR4AKS6SVjs = require('./chunk-R4AKS6SV.js');var _chunkNVBPI6JQjs = require('./chunk-NVBPI6JQ.js');var _chunkWH3PVAVNjs = require('./chunk-WH3PVAVN.js');var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');var{width:V}=_reactnative.Dimensions.get("window");function H({phone:i,open:n,setOpen:v,step:O,onSubmitOTP:x,onResendOTPCode:I,onSubmitPhone:M,rejectRef:r,appearance:o}){var m,u,c,g,y,b;function s(){var h;n&&((h=r.current)==null||h.call(r,new Error("User cancelled")),v(!1))}let l=_reactnative.StyleSheet.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalContainer:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,width:Math.min(V-32,400),maxHeight:"80%",position:"relative",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||_chunkEI5LOD4Yjs.a["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?_jsxruntime.jsx.call(void 0, _reactnative.Modal,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:l.modalOverlay,children:_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:l.modalContainer,children:[_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:l.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:_jsxruntime.jsx.call(void 0, _chunkR4AKS6SVjs.a,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"]})}),O==="initial"?_jsxruntime.jsx.call(void 0, _chunkWH3PVAVNjs.a,{contactInfo:i!=null?i:"",contactType:"phone",icon:_jsxruntime.jsx.call(void 0, _chunk2U67EBAUjs.a,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"]}),onConfirm:M,onCancel:s,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkNVBPI6JQjs.a,{contactInfo:i!=null?i:"",contactType:"phone",icon:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{backgroundColor:((y=o==null?void 0:o.colors)==null?void 0:y.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],borderRadius:999,padding:12},children:_jsxruntime.jsx.call(void 0, _chunkLHEOII54js.a,{size:22,color:((b=o==null?void 0:o.colors)==null?void 0:b.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]})}),title:"Check your phone",description:_jsxruntime.jsxs.call(void 0, _reactnative.Text,{children:["A temporary login code has been sent via SMS to"," ",_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
|
|
2
2
|
Some messages may take several minutes to arrive.`,onSubmitOTP:x,onResendCode:I,appearance:o,otpLength:10,keyboardType:"number-pad",autoComplete:"sms-otp",textContentType:"oneTimeCode"})]})})}):null}exports.a = H;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-ZP2QWJOD.mjs";import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as f}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-ZP2QWJOD.mjs";import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as f}from"./chunk-YIC3545U.mjs";import{a as p}from"./chunk-FFQ6EQCL.mjs";import{a as d,b as m}from"./chunk-4P5ABAFD.mjs";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{useEffect as b,useRef as l,useState as g}from"react";import{View as W}from"react-native";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{RNWebView as A,WebViewParent as M}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as R,embeddedCheckoutV3OutgoingEvents as O}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as L}from"react/jsx-runtime";function Y(t){var u;let[e,w]=g(null),[C,v]=g(0),E=l((u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=l(t);if(U(t,n.current)){let r=d({},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=S(),V=f(i,{usageOrigin:"client"}),P=I({apiClient:V}),s=l(null);b(()=>{let r=s.current;if(!r||e)return;let o=new M({current:r},{incomingEvents:R,outgoingEvents:O});w(o)},[s.current,e]),b(()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{p.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return L(W,{style:{flex:1},children:[c(A,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:h,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(y,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:m(d({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}export{Y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBVQQ3Y6Ujs = require('./chunk-BVQQ3Y6U.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkBVQQ3Y6Ujs.a,_chunkIJN37RF2js.a.call(void 0, {},d))}exports.a = s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.3",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","ios","android","expo-module.config.json","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0",mitt:"3.0.1",zod:"3.22.4","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8","react-native-svg":"15.14.0","react-native-webview":"13.15.0"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-modules-core":"~3.0.29"},peerDependencies:{"@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-modules-core":">=2.0.0",react:">=17.0.2","react-native":">=0.74.3"}};export{o as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as f}from"./chunk-QHTHMZZV.mjs";import{a as C}from"./chunk-XZ5LQIRB.mjs";import{a as S}from"./chunk-TSRZEXRU.mjs";import{a as k}from"./chunk-NG4FYS2Z.mjs";import{a as T}from"./chunk-WDMEQNBX.mjs";import{a as e}from"./chunk-7USVT6EZ.mjs";import{View as d,StyleSheet as R,Dimensions as B,Modal as z,TouchableOpacity as D,Text as w}from"react-native";import{jsx as t,jsxs as P}from"react/jsx-runtime";var{width:V}=B.get("window");function L({phone:i,open:n,setOpen:v,step:O,onSubmitOTP:x,onResendOTPCode:I,onSubmitPhone:M,rejectRef:r,appearance:o}){var m,u,c,g,y,b;function s(){var h;n&&((h=r.current)==null||h.call(r,new Error("User cancelled")),v(!1))}let l=R.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalContainer:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||e["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,width:Math.min(V-32,400),maxHeight:"80%",position:"relative",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||e["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?t(z,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:t(d,{style:l.modalOverlay,children:P(d,{style:l.modalContainer,children:[t(D,{style:l.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:t(S,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||e["cm-text-secondary"]})}),O==="initial"?t(T,{contactInfo:i!=null?i:"",contactType:"phone",icon:t(f,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||e["cm-text-primary"]}),onConfirm:M,onCancel:s,appearance:o}):t(k,{contactInfo:i!=null?i:"",contactType:"phone",icon:t(d,{style:{backgroundColor:((y=o==null?void 0:o.colors)==null?void 0:y.accent)||e["cm-accent"],borderRadius:999,padding:12},children:t(C,{size:22,color:((b=o==null?void 0:o.colors)==null?void 0:b.background)||e["cm-background-primary"]})}),title:"Check your phone",description:P(w,{children:["A temporary login code has been sent via SMS to"," ",t(w,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
|
|
2
2
|
Some messages may take several minutes to arrive.`,onSubmitOTP:x,onResendCode:I,appearance:o,otpLength:10,keyboardType:"number-pad",autoComplete:"sms-otp",textContentType:"oneTimeCode"})]})})}):null}export{L as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _expomodulescore = require('expo-modules-core');var _expodevice = require('expo-device'); var r = _interopRequireWildcard(_expodevice);var _walletssdk = require('@crossmint/wallets-sdk');var n=null;function i(){return n==null&&(n=_expomodulescore.requireNativeModule.call(void 0, "CrossmintDeviceSigner")),n}var d=class extends _walletssdk.DeviceSignerKeyStorage{constructor(){super("")}generateKey(e){var s;return i().generateKey((s=e.address)!=null?s:null)}mapAddressToKey(e,s){return i().mapAddressToKey(e,s)}getKey(e){return i().getKey(e)}hasKey(e){return i().hasKey(e)}signMessage(e,s){return i().signMessage(e,s)}deleteKey(e){return i().deleteKey(e)}deletePendingKey(e){return i().deletePendingKey(e)}getDeviceName(){var t,o,g;let e=(o=(t=r.deviceName)!=null?t:r.modelName)!=null?o:r.brand,s=r.osName;return e!=null&&s!=null?`${e} (${s})`:(g=e!=null?e:s)!=null?g:"Unknown Device"}};exports.a = d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkYFY37X57js = require('./chunk-YFY37X57.js');var _react = require('react');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var l=_clientsdkreactbase.createLoggerContext.call(void 0, );function I({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=_react.useMemo.call(void 0, ()=>_chunkYFY37X57js.a.call(void 0, o,r),[o,r]),c=(n=(t=(e=_expoconstants2.default.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=_expoconstants2.default.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return _jsxruntime.jsx.call(void 0, l.Provider,{value:g,children:_jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintProvider,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}exports.a = l; exports.b = I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkT6JE4K3Gjs = require('./chunk-T6JE4K3G.js');var _chunkI6GZYBA2js = require('./chunk-I6GZYBA2.js');var _chunkZ5ATQ2JLjs = require('./chunk-Z5ATQ2JL.js');var _chunkS75MIWI2js = require('./chunk-S75MIWI2.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _clientsigners = require('@crossmint/client-signers');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var L="Passkey signers are not supported in React Native. Use a different signer type such as 'email', 'phone', or 'device'.";function ve(c){var i,v;return c==null?!1:!!(((i=c.recovery)==null?void 0:i.type)==="passkey"||(v=c.signers)!=null&&v.some(m=>m.type==="passkey"))}function me({children:c}){let i=_react.useContext.call(void 0, _clientsdkreactbase.CrossmintWalletBaseContext),v=_react.useCallback.call(void 0, d=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var R,I;if(((R=d.recovery)==null?void 0:R.type)==="passkey"||(I=d.signers)!=null&&I.some(r=>r.type==="passkey"))throw new Error(L);return i.createWallet(d)}),[i.createWallet]),m=_react.useCallback.call(void 0, d=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){throw new Error(L)}),[]),V=_react.useMemo.call(void 0, ()=>_chunkIJN37RF2js.b.call(void 0, _chunkIJN37RF2js.a.call(void 0, {},i),{createWallet:v,createPasskeySigner:m}),[i,v,m]);return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintWalletBaseContext.Provider,{value:V,children:c})}function pe({children:c,createOnLogin:i,appearance:v,showOtpSignerPrompt:m=!0,callbacks:V,deviceSignerKeyStorage:d}){let R=_react.useMemo.call(void 0, ()=>d!=null?d:new _chunkS75MIWI2js.a,[]),{crossmint:I}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintWalletProvider must be used within CrossmintProvider"),r=_clientsdkreactbase.useLogger.call(void 0, _chunkT6JE4K3Gjs.a),{apiKey:N,appId:O}=I,D=_react.useMemo.call(void 0, ()=>{let e=_commonsdkbase.validateAPIKey.call(void 0, N);if(!e.isValid)throw new Error("Invalid API key");return e},[N]),J=_react.useMemo.call(void 0, ()=>_clientsigners.environmentUrlConfig[D.environment],[D.environment]),y=_react.useRef.call(void 0, null),t=_react.useRef.call(void 0, null),[T,Y]=_react.useState.call(void 0, !1),C=_react.useRef.call(void 0, !1),l=_react.useRef.call(void 0, !1),s=_react.useRef.call(void 0, 0),M=_react.useRef.call(void 0, 0),$=_react.useMemo.call(void 0, ()=>O!=null?{crossmintAppId:O}:{},[O]),w=_react.useCallback.call(void 0, e=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){if(t.current!=null){let n=t.current;if(l.current){r.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:s.current});return}if(C.current&&n.isConnected){r.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:s.current});return}l.current=!0;let a=Date.now();M.current=a;let o=s.current;try{r.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:_reactnative.Platform.OS}),C.current=!0,n.isConnected=!1,yield n.handshakeWithChild();let u=Date.now()-a;r.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:u})}catch(u){let f=Date.now()-a;o===s.current&&(C.current=!1),r.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:f,error:u instanceof Error?u.message:String(u)}),console.error("[CrossmintWalletProvider] Handshake error:",u)}finally{o===s.current&&(l.current=!1)}}else r.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[r]);_react.useEffect.call(void 0, ()=>{y.current!=null&&t.current==null&&(r.info("react-native.wallet.webview.initializing"),t.current=new (0, _clientsdkrnwindow.WebViewParent)(y,{incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[_clientsigners.SignerErrorCode.IndexedDbFatal]}}),r.info("react-native.wallet.webview.initialized"),w("eager"))},[T,r,w]);let q=_react.useCallback.call(void 0, ()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var e,n;r.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:l.current,isConnected:(n=(e=t.current)==null?void 0:e.isConnected)!=null?n:!1,generation:s.current}),yield w("onLoadEnd")}),[r,w]),Q=_react.useCallback.call(void 0, e=>{var o,u;let n=t.current;if(n==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){r.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:l.current,isConnected:(u=(o=t.current)==null?void 0:o.isConnected)!=null?u:!1,generation:s.current,msSinceHandshakeStart:M.current>0?Date.now()-M.current:null}),w("frame-ready");return}try{let f=JSON.parse(a);if(f&&typeof f.type=="string"&&f.type.startsWith("console.")){let x=f.type.split(".")[1],U=(f.data||[]).map(h=>{try{return h==="[Function]"||h==="[Circular Reference]"||h==="[Unserializable Object]"?h:JSON.parse(h)}catch(be){return h}}),k=`react-native.wallet.webview.console.${x}`,P={webview_args:U};switch(x){case"log":r.info(k,P);break;case"error":r.error(k,P);break;case"warn":r.warn(k,P);break;case"info":r.info(k,P);break;case"debug":r.debug(k,P);break;default:r.info("react-native.wallet.webview.console.unknown",{webview_method:x,webview_args:U})}return}}catch(f){}n.handleMessage(e)},[r,w]),X=()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},Z=({emailSignerProps:e,phoneSignerProps:n})=>m?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkZ5ATQ2JLjs.a,_chunkIJN37RF2js.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunkI6GZYBA2js.a,_chunkIJN37RF2js.a.call(void 0, {},n))]}):null,ee=()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){r.info("react-native.wallet.webview.init.start"),Y(!0);let e=0,n=100;for(;t.current==null&&e<n;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw r.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");r.info("react-native.wallet.webview.init.success",{attempts:e})});return _react.useEffect.call(void 0, ()=>{if(ve(i))throw new Error(L)},[i]),_jsxruntime.jsxs.call(void 0, _clientsdkreactbase.CrossmintWalletBaseProvider,{createOnLogin:i,appearance:v,showOtpSignerPrompt:m,initializeWebView:ee,callbacks:V,renderUI:Z,clientTEEConnection:X,deviceSignerKeyStorage:R,children:[_jsxruntime.jsx.call(void 0, me,{children:c}),T&&_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:y,source:{uri:J},globals:$,onLoadEnd:q,onMessage:Q,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},onRenderProcessGone:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[_clientsigners.environmentUrlConfig[D.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function De(c){return _jsxruntime.jsx.call(void 0, pe,_chunkIJN37RF2js.a.call(void 0, {},c))}exports.a = De;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-MGE6NVGD.mjs";import{SdkLogger as C,ReactNativeDatadogSink as R,validateAPIKey as S}from"@crossmint/common-sdk-base";import{AppState as b}from"react-native";import D from"expo-constants";import*as e from"expo-device";function _(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=S(n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new C({packageName:r.name,packageVersion:r.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=D.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=D.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new R(d,N,o);return a.addSink(h),w(a),a}function w(n){b.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}export{_ as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkG5FBYKXOjs = require('./chunk-G5FBYKXO.js');var _commonsdkbase = require('@crossmint/common-sdk-base');var _reactnative = require('react-native');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _expodevice = require('expo-device'); var e = _interopRequireWildcard(_expodevice);function P(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=_commonsdkbase.validateAPIKey.call(void 0, n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new (0, _commonsdkbase.SdkLogger)({packageName:_chunkG5FBYKXOjs.a.name,packageVersion:_chunkG5FBYKXOjs.a.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=_expoconstants2.default.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=_expoconstants2.default.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new (0, _commonsdkbase.ReactNativeDatadogSink)(d,N,o);return a.addSink(h),w(a),a}function w(n){_reactnative.AppState.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}exports.a = P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-MGE6NVGD.mjs";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function C(i,t){return new e(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:n.version},apiKeyExpectations:t}})}export{C as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTQIJ7OZDjs = require('./chunk-TQIJ7OZD.js');var _chunkRIKAIN6Njs = require('./chunk-RIKAIN6N.js');var _chunkR4AKS6SVjs = require('./chunk-R4AKS6SV.js');var _chunkNVBPI6JQjs = require('./chunk-NVBPI6JQ.js');var _chunkWH3PVAVNjs = require('./chunk-WH3PVAVN.js');var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');var{width:z}=_reactnative.Dimensions.get("window");function L({email:i,open:n,setOpen:S,step:O,onSubmitOTP:v,onResendOTPCode:P,onSubmitEmail:V,rejectRef:r,appearance:o}){var m,u,c,g,b,h;function s(){var y;n&&((y=r.current)==null||y.call(r,new Error),S(!1))}let d=_reactnative.StyleSheet.create({centeredView:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalView:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,alignItems:"center",width:Math.min(z-32,400),maxHeight:"80%",position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||_chunkEI5LOD4Yjs.a["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?_jsxruntime.jsx.call(void 0, _reactnative.Modal,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:d.centeredView,children:_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:d.modalView,children:[_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:d.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:_jsxruntime.jsx.call(void 0, _chunkR4AKS6SVjs.a,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"]})}),O==="initial"?_jsxruntime.jsx.call(void 0, _chunkWH3PVAVNjs.a,{contactInfo:i!=null?i:"",contactType:"email",icon:_jsxruntime.jsx.call(void 0, _chunkRIKAIN6Njs.a,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"]}),onConfirm:V,onCancel:s,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkNVBPI6JQjs.a,{contactInfo:i!=null?i:"",contactType:"email",icon:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{backgroundColor:((b=o==null?void 0:o.colors)==null?void 0:b.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],borderRadius:999,padding:12},children:_jsxruntime.jsx.call(void 0, _chunkTQIJ7OZDjs.a,{size:22,color:((h=o==null?void 0:o.colors)==null?void 0:h.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]})}),title:"Check your email",description:_jsxruntime.jsxs.call(void 0, _reactnative.Text,{children:["A temporary login code has been sent to"," ",_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't find the email? Check spam folder.
|
|
2
2
|
Some emails may take several minutes to arrive.`,onSubmitOTP:v,onResendCode:P,appearance:o,otpLength:9,keyboardType:"default",autoComplete:"one-time-code",textContentType:"oneTimeCode"})]})})}):null}exports.a = L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkG5FBYKXOjs = require('./chunk-G5FBYKXO.js');var _commonsdkbase = require('@crossmint/common-sdk-base');function a(i,t){return new (0, _commonsdkbase.CrossmintApiClient)(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:_chunkG5FBYKXOjs.a.version},apiKeyExpectations:t}})}exports.a = a;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as f}from"./chunk-C7S2X5RD.mjs";import{a as C}from"./chunk-J62V5BQX.mjs";import{a as w}from"./chunk-TSRZEXRU.mjs";import{a as T}from"./chunk-NG4FYS2Z.mjs";import{a as k}from"./chunk-WDMEQNBX.mjs";import{a as e}from"./chunk-7USVT6EZ.mjs";import{View as l,Modal as M,StyleSheet as R,Dimensions as B,TouchableOpacity as E,Text as x}from"react-native";import{jsx as t,jsxs as I}from"react/jsx-runtime";var{width:z}=B.get("window");function X({email:i,open:n,setOpen:S,step:O,onSubmitOTP:v,onResendOTPCode:P,onSubmitEmail:V,rejectRef:r,appearance:o}){var m,u,c,g,b,h;function s(){var y;n&&((y=r.current)==null||y.call(r,new Error),S(!1))}let d=R.create({centeredView:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalView:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||e["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,alignItems:"center",width:Math.min(z-32,400),maxHeight:"80%",position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||e["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?t(M,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:t(l,{style:d.centeredView,children:I(l,{style:d.modalView,children:[t(E,{style:d.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:t(w,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||e["cm-text-secondary"]})}),O==="initial"?t(k,{contactInfo:i!=null?i:"",contactType:"email",icon:t(C,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||e["cm-text-primary"]}),onConfirm:V,onCancel:s,appearance:o}):t(T,{contactInfo:i!=null?i:"",contactType:"email",icon:t(l,{style:{backgroundColor:((b=o==null?void 0:o.colors)==null?void 0:b.accent)||e["cm-accent"],borderRadius:999,padding:12},children:t(f,{size:22,color:((h=o==null?void 0:o.colors)==null?void 0:h.background)||e["cm-background-primary"]})}),title:"Check your email",description:I(x,{children:["A temporary login code has been sent to"," ",t(x,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't find the email? Check spam folder.
|
|
2
2
|
Some emails may take several minutes to arrive.`,onSubmitOTP:v,onResendCode:P,appearance:o,otpLength:9,keyboardType:"default",autoComplete:"one-time-code",textContentType:"oneTimeCode"})]})})}):null}export{X as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-DKQZSNOO.js');require('../../chunk-72MMCJ2E.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-DKQZSNOO.js');require('../../chunk-72MMCJ2E.js');var _chunkKHT2FASNjs = require('../../chunk-KHT2FASN.js');require('../../chunk-BVQQ3Y6U.js');require('../../chunk-2UY6GCV3.js');require('../../chunk-YQEWHOQ7.js');require('../../chunk-ZL3FZ2JT.js');require('../../chunk-2D2RJCVX.js');require('../../chunk-G5FBYKXO.js');require('../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKHT2FASNjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-TIQGKXQA.mjs";import"../../chunk-MB7H3PBJ.mjs";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-TIQGKXQA.mjs";import"../../chunk-MB7H3PBJ.mjs";import{a}from"../../chunk-63RNMZOE.mjs";import"../../chunk-JM2MKNKV.mjs";import"../../chunk-ZP2QWJOD.mjs";import"../../chunk-PCJMDUSI.mjs";import"../../chunk-YIC3545U.mjs";import"../../chunk-FFQ6EQCL.mjs";import"../../chunk-MGE6NVGD.mjs";import"../../chunk-4P5ABAFD.mjs";export{a as CrossmintEmbeddedCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKHT2FASNjs = require('../../../chunk-KHT2FASN.js');require('../../../chunk-BVQQ3Y6U.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-ZL3FZ2JT.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-G5FBYKXO.js');require('../../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKHT2FASNjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-63RNMZOE.mjs";import"../../../chunk-JM2MKNKV.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-YIC3545U.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-MGE6NVGD.mjs";import"../../../chunk-4P5ABAFD.mjs";export{a as CrossmintEmbeddedCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBVQQ3Y6Ujs = require('../../../chunk-BVQQ3Y6U.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-ZL3FZ2JT.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-G5FBYKXO.js');require('../../../chunk-IJN37RF2.js');exports.EmbeddedCheckoutV3WebView = _chunkBVQQ3Y6Ujs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-JM2MKNKV.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-YIC3545U.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-MGE6NVGD.mjs";import"../../../chunk-4P5ABAFD.mjs";export{a as EmbeddedCheckoutV3WebView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-72MMCJ2E.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-72MMCJ2E.js');var _chunkKHT2FASNjs = require('../../../chunk-KHT2FASN.js');require('../../../chunk-BVQQ3Y6U.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-ZL3FZ2JT.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-G5FBYKXO.js');require('../../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKHT2FASNjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../chunk-MB7H3PBJ.mjs";import{a}from"../../../chunk-
|
|
1
|
+
import"../../../chunk-MB7H3PBJ.mjs";import{a}from"../../../chunk-63RNMZOE.mjs";import"../../../chunk-JM2MKNKV.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-YIC3545U.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-MGE6NVGD.mjs";import"../../../chunk-4P5ABAFD.mjs";export{a as CrossmintEmbeddedCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-RWTMQGU7.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-RWTMQGU7.js');var _chunkTQIJ7OZDjs = require('../../chunk-TQIJ7OZD.js');var _chunkRIKAIN6Njs = require('../../chunk-RIKAIN6N.js');var _chunk2U67EBAUjs = require('../../chunk-2U67EBAU.js');var _chunkLHEOII54js = require('../../chunk-LHEOII54.js');var _chunkR4AKS6SVjs = require('../../chunk-R4AKS6SV.js');require('../../chunk-TVASK7FQ.js');require('../../chunk-IJN37RF2.js');exports.MailCheckIcon = _chunkTQIJ7OZDjs.a; exports.MailIcon = _chunkRIKAIN6Njs.a; exports.PhoneIcon = _chunk2U67EBAUjs.a; exports.SmartphoneIcon = _chunkLHEOII54js.a; exports.XIcon = _chunkR4AKS6SVjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-YJIX6E2P.mjs";import{a
|
|
1
|
+
import"../../chunk-YJIX6E2P.mjs";import{a}from"../../chunk-C7S2X5RD.mjs";import{a as b}from"../../chunk-J62V5BQX.mjs";import{a as c}from"../../chunk-QHTHMZZV.mjs";import{a as d}from"../../chunk-XZ5LQIRB.mjs";import{a as e}from"../../chunk-TSRZEXRU.mjs";import"../../chunk-7JGGPJBX.mjs";import"../../chunk-4P5ABAFD.mjs";export{a as MailCheckIcon,b as MailIcon,c as PhoneIcon,d as SmartphoneIcon,e as XIcon};
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-2PX34LDU.js');require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-2PX34LDU.js');require('../chunk-AJMHVVST.js');var _chunkQHJA7VYDjs = require('../chunk-QHJA7VYD.js');require('../chunk-I4D3YJW2.js');require('../chunk-DKQZSNOO.js');require('../chunk-72MMCJ2E.js');var _chunkKHT2FASNjs = require('../chunk-KHT2FASN.js');require('../chunk-BVQQ3Y6U.js');require('../chunk-2UY6GCV3.js');require('../chunk-YQEWHOQ7.js');require('../chunk-ZL3FZ2JT.js');var _chunkI6GZYBA2js = require('../chunk-I6GZYBA2.js');var _chunkZ5ATQ2JLjs = require('../chunk-Z5ATQ2JL.js');require('../chunk-RWTMQGU7.js');require('../chunk-TQIJ7OZD.js');require('../chunk-RIKAIN6N.js');require('../chunk-2U67EBAU.js');require('../chunk-LHEOII54.js');require('../chunk-R4AKS6SV.js');require('../chunk-TVASK7FQ.js');require('../chunk-NVBPI6JQ.js');require('../chunk-WH3PVAVN.js');require('../chunk-EI5LOD4Y.js');require('../chunk-2D2RJCVX.js');require('../chunk-G5FBYKXO.js');require('../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKHT2FASNjs.a; exports.EmailSignersDialog = _chunkZ5ATQ2JLjs.a; exports.ExportPrivateKeyButton = _chunkQHJA7VYDjs.a; exports.PhoneSignersDialog = _chunkI6GZYBA2js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-UBHIBMTA.mjs";import"../chunk-
|
|
1
|
+
import"../chunk-UBHIBMTA.mjs";import"../chunk-5CLFJLE4.mjs";import{a as d}from"../chunk-NNGGH73Y.mjs";import"../chunk-J7Q2R6UH.mjs";import"../chunk-TIQGKXQA.mjs";import"../chunk-MB7H3PBJ.mjs";import{a as c}from"../chunk-63RNMZOE.mjs";import"../chunk-JM2MKNKV.mjs";import"../chunk-ZP2QWJOD.mjs";import"../chunk-PCJMDUSI.mjs";import"../chunk-YIC3545U.mjs";import{a as b}from"../chunk-OBB3KSTZ.mjs";import{a}from"../chunk-ZLQHVLFA.mjs";import"../chunk-YJIX6E2P.mjs";import"../chunk-C7S2X5RD.mjs";import"../chunk-J62V5BQX.mjs";import"../chunk-QHTHMZZV.mjs";import"../chunk-XZ5LQIRB.mjs";import"../chunk-TSRZEXRU.mjs";import"../chunk-7JGGPJBX.mjs";import"../chunk-NG4FYS2Z.mjs";import"../chunk-WDMEQNBX.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-MGE6NVGD.mjs";import"../chunk-4P5ABAFD.mjs";export{c as CrossmintEmbeddedCheckout,a as EmailSignersDialog,d as ExportPrivateKeyButton,b as PhoneSignersDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ5ATQ2JLjs = require('../../chunk-Z5ATQ2JL.js');require('../../chunk-RWTMQGU7.js');require('../../chunk-TQIJ7OZD.js');require('../../chunk-RIKAIN6N.js');require('../../chunk-2U67EBAU.js');require('../../chunk-LHEOII54.js');require('../../chunk-R4AKS6SV.js');require('../../chunk-TVASK7FQ.js');require('../../chunk-NVBPI6JQ.js');require('../../chunk-WH3PVAVN.js');require('../../chunk-EI5LOD4Y.js');require('../../chunk-IJN37RF2.js');exports.EmailSignersDialog = _chunkZ5ATQ2JLjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-ZLQHVLFA.mjs";import"../../chunk-YJIX6E2P.mjs";import"../../chunk-C7S2X5RD.mjs";import"../../chunk-J62V5BQX.mjs";import"../../chunk-QHTHMZZV.mjs";import"../../chunk-XZ5LQIRB.mjs";import"../../chunk-TSRZEXRU.mjs";import"../../chunk-7JGGPJBX.mjs";import"../../chunk-NG4FYS2Z.mjs";import"../../chunk-WDMEQNBX.mjs";import"../../chunk-7USVT6EZ.mjs";import"../../chunk-4P5ABAFD.mjs";export{a as EmailSignersDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkI6GZYBA2js = require('../../chunk-I6GZYBA2.js');require('../../chunk-RWTMQGU7.js');require('../../chunk-TQIJ7OZD.js');require('../../chunk-RIKAIN6N.js');require('../../chunk-2U67EBAU.js');require('../../chunk-LHEOII54.js');require('../../chunk-R4AKS6SV.js');require('../../chunk-TVASK7FQ.js');require('../../chunk-NVBPI6JQ.js');require('../../chunk-WH3PVAVN.js');require('../../chunk-EI5LOD4Y.js');require('../../chunk-IJN37RF2.js');exports.PhoneSignersDialog = _chunkI6GZYBA2js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-OBB3KSTZ.mjs";import"../../chunk-YJIX6E2P.mjs";import"../../chunk-C7S2X5RD.mjs";import"../../chunk-J62V5BQX.mjs";import"../../chunk-QHTHMZZV.mjs";import"../../chunk-XZ5LQIRB.mjs";import"../../chunk-TSRZEXRU.mjs";import"../../chunk-7JGGPJBX.mjs";import"../../chunk-NG4FYS2Z.mjs";import"../../chunk-WDMEQNBX.mjs";import"../../chunk-7USVT6EZ.mjs";import"../../chunk-4P5ABAFD.mjs";export{a as PhoneSignersDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-I4D3YJW2.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-I4D3YJW2.js');var _chunkI6GZYBA2js = require('../../chunk-I6GZYBA2.js');var _chunkZ5ATQ2JLjs = require('../../chunk-Z5ATQ2JL.js');require('../../chunk-RWTMQGU7.js');require('../../chunk-TQIJ7OZD.js');require('../../chunk-RIKAIN6N.js');require('../../chunk-2U67EBAU.js');require('../../chunk-LHEOII54.js');require('../../chunk-R4AKS6SV.js');require('../../chunk-TVASK7FQ.js');require('../../chunk-NVBPI6JQ.js');require('../../chunk-WH3PVAVN.js');require('../../chunk-EI5LOD4Y.js');require('../../chunk-IJN37RF2.js');exports.EmailSignersDialog = _chunkZ5ATQ2JLjs.a; exports.PhoneSignersDialog = _chunkI6GZYBA2js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-J7Q2R6UH.mjs";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-J7Q2R6UH.mjs";import{a as b}from"../../chunk-OBB3KSTZ.mjs";import{a}from"../../chunk-ZLQHVLFA.mjs";import"../../chunk-YJIX6E2P.mjs";import"../../chunk-C7S2X5RD.mjs";import"../../chunk-J62V5BQX.mjs";import"../../chunk-QHTHMZZV.mjs";import"../../chunk-XZ5LQIRB.mjs";import"../../chunk-TSRZEXRU.mjs";import"../../chunk-7JGGPJBX.mjs";import"../../chunk-NG4FYS2Z.mjs";import"../../chunk-WDMEQNBX.mjs";import"../../chunk-7USVT6EZ.mjs";import"../../chunk-4P5ABAFD.mjs";export{a as EmailSignersDialog,b as PhoneSignersDialog};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-C62HRWJA.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-C62HRWJA.js');var _chunkWIYF6J6Bjs = require('./chunk-WIYF6J6B.js');var _chunkT6JE4K3Gjs = require('./chunk-T6JE4K3G.js');require('./chunk-2PX34LDU.js');require('./chunk-AJMHVVST.js');var _chunkQHJA7VYDjs = require('./chunk-QHJA7VYD.js');require('./chunk-I4D3YJW2.js');require('./chunk-DKQZSNOO.js');require('./chunk-72MMCJ2E.js');var _chunkKHT2FASNjs = require('./chunk-KHT2FASN.js');require('./chunk-BVQQ3Y6U.js');require('./chunk-2UY6GCV3.js');require('./chunk-YQEWHOQ7.js');require('./chunk-ZL3FZ2JT.js');var _chunkI6GZYBA2js = require('./chunk-I6GZYBA2.js');var _chunkZ5ATQ2JLjs = require('./chunk-Z5ATQ2JL.js');require('./chunk-RWTMQGU7.js');require('./chunk-TQIJ7OZD.js');require('./chunk-RIKAIN6N.js');require('./chunk-2U67EBAU.js');require('./chunk-LHEOII54.js');require('./chunk-R4AKS6SV.js');require('./chunk-TVASK7FQ.js');require('./chunk-NVBPI6JQ.js');require('./chunk-WH3PVAVN.js');require('./chunk-EI5LOD4Y.js');var _chunkZ36IMAC2js = require('./chunk-Z36IMAC2.js');require('./chunk-U3CLRKGH.js');var _chunk77GXCNDPjs = require('./chunk-77GXCNDP.js');require('./chunk-2D2RJCVX.js');require('./chunk-YFY37X57.js');require('./chunk-G5FBYKXO.js');require('./chunk-S75MIWI2.js');require('./chunk-IJN37RF2.js');var _walletssdk = require('@crossmint/wallets-sdk');exports.CrossmintAuthProvider = _chunkZ36IMAC2js.b; exports.CrossmintCheckoutProvider = _chunk77GXCNDPjs.a; exports.CrossmintEmbeddedCheckout = _chunkKHT2FASNjs.a; exports.CrossmintProvider = _chunkT6JE4K3Gjs.b; exports.CrossmintWalletProvider = _chunkWIYF6J6Bjs.a; exports.EVMWallet = _walletssdk.EVMWallet; exports.EmailSignersDialog = _chunkZ5ATQ2JLjs.a; exports.ExportPrivateKeyButton = _chunkQHJA7VYDjs.a; exports.PhoneSignersDialog = _chunkI6GZYBA2js.a; exports.SolanaWallet = _walletssdk.SolanaWallet; exports.StellarWallet = _walletssdk.StellarWallet; exports.Wallet = _walletssdk.Wallet; exports.useCrossmint = _chunkZ36IMAC2js.d; exports.useCrossmintAuth = _chunkZ36IMAC2js.c; exports.useCrossmintCheckout = _chunk77GXCNDPjs.b; exports.useWallet = _chunkZ36IMAC2js.e; exports.useWalletOtpSigner = _chunkZ36IMAC2js.f;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-I3QSTPTV.mjs";import{a as i}from"./chunk-
|
|
1
|
+
import"./chunk-I3QSTPTV.mjs";import{a as i}from"./chunk-7QXP7FEY.mjs";import{b as p}from"./chunk-5TKH4O3D.mjs";import"./chunk-UBHIBMTA.mjs";import"./chunk-5CLFJLE4.mjs";import{a as f}from"./chunk-NNGGH73Y.mjs";import"./chunk-J7Q2R6UH.mjs";import"./chunk-TIQGKXQA.mjs";import"./chunk-MB7H3PBJ.mjs";import{a as y}from"./chunk-63RNMZOE.mjs";import"./chunk-JM2MKNKV.mjs";import"./chunk-ZP2QWJOD.mjs";import"./chunk-PCJMDUSI.mjs";import"./chunk-YIC3545U.mjs";import{a as m}from"./chunk-OBB3KSTZ.mjs";import{a as l}from"./chunk-ZLQHVLFA.mjs";import"./chunk-YJIX6E2P.mjs";import"./chunk-C7S2X5RD.mjs";import"./chunk-J62V5BQX.mjs";import"./chunk-QHTHMZZV.mjs";import"./chunk-XZ5LQIRB.mjs";import"./chunk-TSRZEXRU.mjs";import"./chunk-7JGGPJBX.mjs";import"./chunk-NG4FYS2Z.mjs";import"./chunk-WDMEQNBX.mjs";import"./chunk-7USVT6EZ.mjs";import{b as r,c as o,d as a,e as n,f as s}from"./chunk-K6ZOIECD.mjs";import"./chunk-AHAHB7QD.mjs";import{a as t,b as e}from"./chunk-IUDQDPIN.mjs";import"./chunk-FFQ6EQCL.mjs";import"./chunk-Y2UB6EIT.mjs";import"./chunk-MGE6NVGD.mjs";import"./chunk-6N7XF54Y.mjs";import"./chunk-4P5ABAFD.mjs";import{EVMWallet as v,SolanaWallet as C,StellarWallet as g,Wallet as k}from"@crossmint/wallets-sdk";export{r as CrossmintAuthProvider,t as CrossmintCheckoutProvider,y as CrossmintEmbeddedCheckout,p as CrossmintProvider,i as CrossmintWalletProvider,v as EVMWallet,l as EmailSignersDialog,f as ExportPrivateKeyButton,m as PhoneSignersDialog,C as SolanaWallet,g as StellarWallet,k as Wallet,a as useCrossmint,o as useCrossmintAuth,e as useCrossmintCheckout,n as useWallet,s as useWalletOtpSigner};
|
package/dist/logger/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYFY37X57js = require('../chunk-YFY37X57.js');require('../chunk-G5FBYKXO.js');require('../chunk-IJN37RF2.js');exports.initReactNativeLogger = _chunkYFY37X57js.a;
|
package/dist/logger/init.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-Y2UB6EIT.mjs";import"../chunk-MGE6NVGD.mjs";import"../chunk-4P5ABAFD.mjs";export{a as initReactNativeLogger};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DeviceSignerKeyStorage } from '@crossmint/wallets-sdk';
|
|
2
|
+
|
|
3
|
+
declare class NativeDeviceSignerKeyStorage extends DeviceSignerKeyStorage {
|
|
4
|
+
constructor();
|
|
5
|
+
generateKey(params: {
|
|
6
|
+
address?: string;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
mapAddressToKey(address: string, publicKeyBase64: string): Promise<void>;
|
|
9
|
+
getKey(address: string): Promise<string | null>;
|
|
10
|
+
hasKey(publicKeyBase64: string): Promise<boolean>;
|
|
11
|
+
signMessage(address: string, message: string): Promise<{
|
|
12
|
+
r: string;
|
|
13
|
+
s: string;
|
|
14
|
+
}>;
|
|
15
|
+
deleteKey(address: string): Promise<void>;
|
|
16
|
+
deletePendingKey(publicKeyBase64: string): Promise<void>;
|
|
17
|
+
getDeviceName(): string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { NativeDeviceSignerKeyStorage };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DeviceSignerKeyStorage } from '@crossmint/wallets-sdk';
|
|
2
|
+
|
|
3
|
+
declare class NativeDeviceSignerKeyStorage extends DeviceSignerKeyStorage {
|
|
4
|
+
constructor();
|
|
5
|
+
generateKey(params: {
|
|
6
|
+
address?: string;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
mapAddressToKey(address: string, publicKeyBase64: string): Promise<void>;
|
|
9
|
+
getKey(address: string): Promise<string | null>;
|
|
10
|
+
hasKey(publicKeyBase64: string): Promise<boolean>;
|
|
11
|
+
signMessage(address: string, message: string): Promise<{
|
|
12
|
+
r: string;
|
|
13
|
+
s: string;
|
|
14
|
+
}>;
|
|
15
|
+
deleteKey(address: string): Promise<void>;
|
|
16
|
+
deletePendingKey(publicKeyBase64: string): Promise<void>;
|
|
17
|
+
getDeviceName(): string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { NativeDeviceSignerKeyStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkS75MIWI2js = require('../chunk-S75MIWI2.js');require('../chunk-IJN37RF2.js');exports.NativeDeviceSignerKeyStorage = _chunkS75MIWI2js.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-6N7XF54Y.mjs";import"../chunk-4P5ABAFD.mjs";export{a as NativeDeviceSignerKeyStorage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7JOOUJJ2js = require('../chunk-7JOOUJJ2.js');var _chunkBOG3QIA2js = require('../chunk-BOG3QIA2.js');require('../chunk-LOFHVHXQ.js');var _chunkIJN37RF2js = require('../chunk-IJN37RF2.js');var _configplugins = require('@expo/config-plugins');var t=_chunkIJN37RF2js.c.call(void 0, "@crossmint/client-sdk-react-native-ui/package.json"),l=(e,i)=>(e=_chunk7JOOUJJ2js.a.call(void 0, e),e=_chunkBOG3QIA2js.a.call(void 0, e,i),e),s= exports.default =_configplugins.createRunOncePlugin.call(void 0, l,t.name,t.version);exports.default = s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as r}from"../chunk-R4DCEEUP.mjs";import{a as o}from"../chunk-QE2FX5MA.mjs";import"../chunk-D4347S2W.mjs";import{c as n}from"../chunk-4P5ABAFD.mjs";import{createRunOncePlugin as P}from"@expo/config-plugins";var t=n("@crossmint/client-sdk-react-native-ui/package.json"),l=(e,i)=>(e=r(e),e=o(e,i),e),a=P(l,t.name,t.version);export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkT6JE4K3Gjs = require('../chunk-T6JE4K3G.js');require('../chunk-YFY37X57.js');require('../chunk-G5FBYKXO.js');require('../chunk-IJN37RF2.js');exports.CrossmintProvider = _chunkT6JE4K3Gjs.b; exports.LoggerContext = _chunkT6JE4K3Gjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-5TKH4O3D.mjs";import"../chunk-Y2UB6EIT.mjs";import"../chunk-MGE6NVGD.mjs";import"../chunk-4P5ABAFD.mjs";export{b as CrossmintProvider,a as LoggerContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIYF6J6Bjs = require('../chunk-WIYF6J6B.js');require('../chunk-T6JE4K3G.js');require('../chunk-I6GZYBA2.js');require('../chunk-Z5ATQ2JL.js');require('../chunk-RWTMQGU7.js');require('../chunk-TQIJ7OZD.js');require('../chunk-RIKAIN6N.js');require('../chunk-2U67EBAU.js');require('../chunk-LHEOII54.js');require('../chunk-R4AKS6SV.js');require('../chunk-TVASK7FQ.js');require('../chunk-NVBPI6JQ.js');require('../chunk-WH3PVAVN.js');require('../chunk-EI5LOD4Y.js');require('../chunk-YFY37X57.js');require('../chunk-G5FBYKXO.js');require('../chunk-S75MIWI2.js');require('../chunk-IJN37RF2.js');exports.CrossmintWalletProvider = _chunkWIYF6J6Bjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-7QXP7FEY.mjs";import"../chunk-5TKH4O3D.mjs";import"../chunk-OBB3KSTZ.mjs";import"../chunk-ZLQHVLFA.mjs";import"../chunk-YJIX6E2P.mjs";import"../chunk-C7S2X5RD.mjs";import"../chunk-J62V5BQX.mjs";import"../chunk-QHTHMZZV.mjs";import"../chunk-XZ5LQIRB.mjs";import"../chunk-TSRZEXRU.mjs";import"../chunk-7JGGPJBX.mjs";import"../chunk-NG4FYS2Z.mjs";import"../chunk-WDMEQNBX.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-Y2UB6EIT.mjs";import"../chunk-MGE6NVGD.mjs";import"../chunk-6N7XF54Y.mjs";import"../chunk-4P5ABAFD.mjs";export{a as CrossmintWalletProvider};
|
package/dist/providers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-C62HRWJA.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-C62HRWJA.js');var _chunkWIYF6J6Bjs = require('../chunk-WIYF6J6B.js');var _chunkT6JE4K3Gjs = require('../chunk-T6JE4K3G.js');require('../chunk-I6GZYBA2.js');require('../chunk-Z5ATQ2JL.js');require('../chunk-RWTMQGU7.js');require('../chunk-TQIJ7OZD.js');require('../chunk-RIKAIN6N.js');require('../chunk-2U67EBAU.js');require('../chunk-LHEOII54.js');require('../chunk-R4AKS6SV.js');require('../chunk-TVASK7FQ.js');require('../chunk-NVBPI6JQ.js');require('../chunk-WH3PVAVN.js');require('../chunk-EI5LOD4Y.js');var _chunkZ36IMAC2js = require('../chunk-Z36IMAC2.js');require('../chunk-U3CLRKGH.js');require('../chunk-77GXCNDP.js');require('../chunk-2D2RJCVX.js');require('../chunk-YFY37X57.js');require('../chunk-G5FBYKXO.js');require('../chunk-S75MIWI2.js');require('../chunk-IJN37RF2.js');exports.CrossmintAuthProvider = _chunkZ36IMAC2js.b; exports.CrossmintProvider = _chunkT6JE4K3Gjs.b; exports.CrossmintWalletProvider = _chunkWIYF6J6Bjs.a;
|
package/dist/providers/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-I3QSTPTV.mjs";import{a as c}from"../chunk-
|
|
1
|
+
import"../chunk-I3QSTPTV.mjs";import{a as c}from"../chunk-7QXP7FEY.mjs";import{b}from"../chunk-5TKH4O3D.mjs";import"../chunk-OBB3KSTZ.mjs";import"../chunk-ZLQHVLFA.mjs";import"../chunk-YJIX6E2P.mjs";import"../chunk-C7S2X5RD.mjs";import"../chunk-J62V5BQX.mjs";import"../chunk-QHTHMZZV.mjs";import"../chunk-XZ5LQIRB.mjs";import"../chunk-TSRZEXRU.mjs";import"../chunk-7JGGPJBX.mjs";import"../chunk-NG4FYS2Z.mjs";import"../chunk-WDMEQNBX.mjs";import"../chunk-7USVT6EZ.mjs";import{b as a}from"../chunk-K6ZOIECD.mjs";import"../chunk-AHAHB7QD.mjs";import"../chunk-IUDQDPIN.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-Y2UB6EIT.mjs";import"../chunk-MGE6NVGD.mjs";import"../chunk-6N7XF54Y.mjs";import"../chunk-4P5ABAFD.mjs";export{a as CrossmintAuthProvider,b as CrossmintProvider,c as CrossmintWalletProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZL3FZ2JTjs = require('../chunk-ZL3FZ2JT.js');require('../chunk-G5FBYKXO.js');require('../chunk-IJN37RF2.js');exports.createCrossmintApiClient = _chunkZL3FZ2JTjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-YIC3545U.mjs";import"../chunk-MGE6NVGD.mjs";import"../chunk-4P5ABAFD.mjs";export{a as createCrossmintApiClient};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'CrossmintReactNativeUI'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = 'Crossmint React Native UI SDK'
|
|
9
|
+
s.homepage = 'https://github.com/Crossmint/crossmint-sdk'
|
|
10
|
+
s.license = { :type => 'Apache-2.0' }
|
|
11
|
+
s.author = 'Crossmint Inc'
|
|
12
|
+
s.platforms = { :ios => '15.0' }
|
|
13
|
+
s.source = { :git => 'https://github.com/Crossmint/crossmint-sdk.git', :tag => "client-sdk-react-native-ui@#{s.version}" }
|
|
14
|
+
s.source_files = 'DeviceSignerModule.swift'
|
|
15
|
+
s.swift_version = '6.0'
|
|
16
|
+
|
|
17
|
+
s.dependency 'ExpoModulesCore'
|
|
18
|
+
s.dependency 'CrossmintDeviceSigner', '~> 0.11'
|
|
19
|
+
end
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import CryptoKit
|
|
2
|
+
import CrossmintDeviceSigner
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import Security
|
|
5
|
+
|
|
6
|
+
/// Expo native module that exposes device signer key storage to React Native.
|
|
7
|
+
///
|
|
8
|
+
/// On physical iOS devices the module delegates to ``SecureEnclaveKeyStorage`` so all
|
|
9
|
+
/// key material lives in the Secure Enclave. On simulators it always uses
|
|
10
|
+
/// ``KeychainKeyStorage`` (Secure Enclave is not available on simulators).
|
|
11
|
+
///
|
|
12
|
+
/// The module is registered as `"CrossmintDeviceSigner"` and consumed on the JS side by
|
|
13
|
+
/// `NativeDeviceSignerKeyStorage` from `@crossmint/client-sdk-react-native-ui`.
|
|
14
|
+
public class DeviceSignerModule: Module {
|
|
15
|
+
|
|
16
|
+
// MARK: - Module definition
|
|
17
|
+
|
|
18
|
+
public func definition() -> ModuleDefinition {
|
|
19
|
+
Name("CrossmintDeviceSigner")
|
|
20
|
+
|
|
21
|
+
// Returns true — the module always has a storage backend available (hardware
|
|
22
|
+
// on real devices, software fallback on simulators).
|
|
23
|
+
AsyncFunction("isAvailable") { () -> Bool in
|
|
24
|
+
true
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Generates a new P-256 key and persists it.
|
|
28
|
+
AsyncFunction("generateKey") { (address: String?) async throws -> String in
|
|
29
|
+
do {
|
|
30
|
+
let pubKey = try await self.defaultStorage().generateKey(address: address)
|
|
31
|
+
self.trackPublicKey(pubKey)
|
|
32
|
+
return pubKey
|
|
33
|
+
} catch {
|
|
34
|
+
throw Exception(
|
|
35
|
+
name: "GenerateKeyFailed",
|
|
36
|
+
description: "generateKey failed: \(error)"
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Renames the pending Keychain entry to a wallet-address entry.
|
|
42
|
+
AsyncFunction("mapAddressToKey") { (address: String, publicKeyBase64: String) async throws in
|
|
43
|
+
do {
|
|
44
|
+
try await self.defaultStorage().mapAddressToKey(address: address, publicKeyBase64: publicKeyBase64)
|
|
45
|
+
} catch {
|
|
46
|
+
throw Exception(name: "MapAddressToKeyFailed", description: "mapAddressToKey failed: \(error)")
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Returns the stored public key for a wallet address, or nil.
|
|
51
|
+
AsyncFunction("getKey") { (address: String) async -> String? in
|
|
52
|
+
await self.defaultStorage().getKey(address: address)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Returns true if a key with the given public key was generated on this device.
|
|
56
|
+
AsyncFunction("hasKey") { (publicKeyBase64: String) -> Bool in
|
|
57
|
+
self.trackedPublicKeys().contains(publicKeyBase64)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Signs a base64-encoded message; returns { r, s } hex strings.
|
|
61
|
+
AsyncFunction("signMessage") { (address: String, message: String) async throws -> [String: String] in
|
|
62
|
+
do {
|
|
63
|
+
let sig = try await self.defaultStorage().signMessage(address: address, message: message)
|
|
64
|
+
return ["r": sig.r, "s": sig.s]
|
|
65
|
+
} catch {
|
|
66
|
+
throw Exception(name: "SignMessageFailed", description: "signMessage failed: \(error)")
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Deletes the key for a wallet address.
|
|
71
|
+
AsyncFunction("deleteKey") { (address: String) async throws in
|
|
72
|
+
let pubKey = await self.defaultStorage().getKey(address: address)
|
|
73
|
+
try await self.defaultStorage().deleteKey(address: address)
|
|
74
|
+
if let pubKey = pubKey {
|
|
75
|
+
self.untrackPublicKey(pubKey)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Deletes a pending key that was never promoted to a wallet-address key.
|
|
80
|
+
AsyncFunction("deletePendingKey") { (publicKeyBase64: String) async throws in
|
|
81
|
+
try await self.defaultStorage().deletePendingKey(publicKeyBase64: publicKeyBase64)
|
|
82
|
+
self.untrackPublicKey(publicKeyBase64)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// MARK: - Public key index (Keychain-backed)
|
|
87
|
+
|
|
88
|
+
private static let indexService = "com.crossmint.device-signer"
|
|
89
|
+
private static let indexAccount = "public_key_index"
|
|
90
|
+
|
|
91
|
+
private func trackedPublicKeys() -> Set<String> {
|
|
92
|
+
let query: [String: Any] = [
|
|
93
|
+
kSecClass as String: kSecClassGenericPassword,
|
|
94
|
+
kSecAttrService as String: Self.indexService,
|
|
95
|
+
kSecAttrAccount as String: Self.indexAccount,
|
|
96
|
+
kSecReturnData as String: true,
|
|
97
|
+
kSecMatchLimit as String: kSecMatchLimitOne,
|
|
98
|
+
]
|
|
99
|
+
var result: AnyObject?
|
|
100
|
+
guard SecItemCopyMatching(query as CFDictionary, &result) == errSecSuccess,
|
|
101
|
+
let data = result as? Data,
|
|
102
|
+
let keys = try? JSONDecoder().decode([String].self, from: data)
|
|
103
|
+
else { return [] }
|
|
104
|
+
return Set(keys)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private func saveTrackedPublicKeys(_ keys: Set<String>) {
|
|
108
|
+
guard let data = try? JSONEncoder().encode(Array(keys)) else { return }
|
|
109
|
+
let query: [String: Any] = [
|
|
110
|
+
kSecClass as String: kSecClassGenericPassword,
|
|
111
|
+
kSecAttrService as String: Self.indexService,
|
|
112
|
+
kSecAttrAccount as String: Self.indexAccount,
|
|
113
|
+
]
|
|
114
|
+
let status = SecItemUpdate(query as CFDictionary, [kSecValueData as String: data] as CFDictionary)
|
|
115
|
+
if status == errSecItemNotFound {
|
|
116
|
+
var addQuery = query
|
|
117
|
+
addQuery[kSecValueData as String] = data
|
|
118
|
+
SecItemAdd(addQuery as CFDictionary, nil)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private func trackPublicKey(_ pubKey: String) {
|
|
123
|
+
var keys = trackedPublicKeys()
|
|
124
|
+
keys.insert(pubKey)
|
|
125
|
+
saveTrackedPublicKeys(keys)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private func untrackPublicKey(_ pubKey: String) {
|
|
129
|
+
var keys = trackedPublicKeys()
|
|
130
|
+
keys.remove(pubKey)
|
|
131
|
+
saveTrackedPublicKeys(keys)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// MARK: - Private helpers
|
|
135
|
+
|
|
136
|
+
private func defaultStorage() -> any DeviceSignerKeyStorage {
|
|
137
|
+
#if targetEnvironment(simulator)
|
|
138
|
+
return SoftwareDeviceSignerKeyStorage()
|
|
139
|
+
#else
|
|
140
|
+
if SecureEnclave.isAvailable {
|
|
141
|
+
return SecureEnclaveKeyStorage()
|
|
142
|
+
} else {
|
|
143
|
+
return SoftwareDeviceSignerKeyStorage()
|
|
144
|
+
}
|
|
145
|
+
#endif
|
|
146
|
+
}
|
|
147
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossmint/client-sdk-react-native-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"repository": "https://github.com/Crossmint/crossmint-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Paella Labs Inc",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
+
"ios",
|
|
14
|
+
"android",
|
|
15
|
+
"expo-module.config.json",
|
|
13
16
|
"app.plugin.js",
|
|
14
17
|
"LICENSE"
|
|
15
18
|
],
|
|
@@ -20,41 +23,33 @@
|
|
|
20
23
|
"lodash.isequal": "4.5.0",
|
|
21
24
|
"mitt": "3.0.1",
|
|
22
25
|
"zod": "3.22.4",
|
|
26
|
+
"expo-constants": "~18.0.9",
|
|
27
|
+
"expo-device": "~8.0.9",
|
|
28
|
+
"expo-secure-store": "~15.0.7",
|
|
29
|
+
"expo-web-browser": "~15.0.8",
|
|
30
|
+
"react-native-svg": "15.14.0",
|
|
31
|
+
"react-native-webview": "13.15.0",
|
|
23
32
|
"@crossmint/client-sdk-auth": "1.3.0",
|
|
24
33
|
"@crossmint/client-sdk-base": "2.0.3",
|
|
25
|
-
"@crossmint/client-sdk-react-base": "2.0.
|
|
34
|
+
"@crossmint/client-sdk-react-base": "2.0.2",
|
|
26
35
|
"@crossmint/client-sdk-rn-window": "0.3.15",
|
|
27
36
|
"@crossmint/client-signers": "0.1.2",
|
|
28
37
|
"@crossmint/common-sdk-auth": "1.1.0",
|
|
29
38
|
"@crossmint/common-sdk-base": "0.10.0",
|
|
30
|
-
"@crossmint/
|
|
31
|
-
"@crossmint/wallets-sdk": "1.0.1"
|
|
39
|
+
"@crossmint/wallets-sdk": "1.0.2"
|
|
32
40
|
},
|
|
33
41
|
"devDependencies": {
|
|
34
42
|
"@expo/config-plugins": "^9.0.17",
|
|
35
43
|
"typedoc": "0.28.16",
|
|
36
44
|
"@types/react": "19.1.10",
|
|
37
|
-
"expo-
|
|
38
|
-
"expo-device": "~8.0.9",
|
|
39
|
-
"expo-secure-store": "~15.0.7",
|
|
40
|
-
"expo-web-browser": "~15.0.8"
|
|
45
|
+
"expo-modules-core": "~3.0.29"
|
|
41
46
|
},
|
|
42
47
|
"peerDependencies": {
|
|
43
|
-
"@crossmint/expo-device-signer": "0.1.1",
|
|
44
48
|
"@expo/config-plugins": ">=9.0.0",
|
|
45
49
|
"@solana/web3.js": "^1.98.1",
|
|
46
|
-
"expo-
|
|
47
|
-
"expo-device": ">=7 <9",
|
|
48
|
-
"expo-secure-store": ">=14 <16",
|
|
49
|
-
"expo-web-browser": ">=14 <16",
|
|
50
|
+
"expo-modules-core": ">=2.0.0",
|
|
50
51
|
"react": ">=17.0.2",
|
|
51
|
-
"react-native": ">=0.74.3"
|
|
52
|
-
"react-native-webview": ">=13.15.0 <14"
|
|
53
|
-
},
|
|
54
|
-
"peerDependenciesMeta": {
|
|
55
|
-
"@crossmint/expo-device-signer": {
|
|
56
|
-
"optional": true
|
|
57
|
-
}
|
|
52
|
+
"react-native": ">=0.74.3"
|
|
58
53
|
},
|
|
59
54
|
"scripts": {
|
|
60
55
|
"build": "cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",
|
package/dist/chunk-HPMKZRIV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.1",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0",mitt:"3.0.1",zod:"3.22.4","@crossmint/expo-device-signer":"workspace:*"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@crossmint/expo-device-signer":"0.1.1","@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"},peerDependenciesMeta:{"@crossmint/expo-device-signer":{optional:!0}}};exports.a = o;
|
package/dist/chunk-I7PZCHYU.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-XYFP2ZKE.mjs";import{a as _}from"./chunk-YMCYXFCG.mjs";import{a as H}from"./chunk-W4PUVHWF.mjs";import{a as W,b as G,f as b}from"./chunk-4P5ABAFD.mjs";import{useCallback as S,useRef as g,useMemo as E,useEffect as K,useState as ee,useContext as re}from"react";import{Platform as ne,View as te}from"react-native";import{RNWebView as ae,WebViewParent as oe}from"@crossmint/client-sdk-rn-window";import{environmentUrlConfig as z,signerInboundEvents as se,signerOutboundEvents as ie,SignerErrorCode as ce}from"@crossmint/client-signers";import{validateAPIKey as le}from"@crossmint/common-sdk-base";import{CrossmintWalletBaseProvider as ue,CrossmintWalletBaseContext as B,useCrossmint as de}from"@crossmint/client-sdk-react-base";import{NativeDeviceSignerKeyStorage as we}from"@crossmint/expo-device-signer";import{useLogger as fe}from"@crossmint/client-sdk-react-base";import{Fragment as he,jsx as p,jsxs as j}from"react/jsx-runtime";var L="Passkey signers are not supported in React Native. Use a different signer type such as 'email', 'phone', or 'device'.";function ve(c){var i,v;return c==null?!1:!!(((i=c.recovery)==null?void 0:i.type)==="passkey"||(v=c.signers)!=null&&v.some(m=>m.type==="passkey"))}function me({children:c}){let i=re(B),v=S(d=>b(this,null,function*(){var R,I;if(((R=d.recovery)==null?void 0:R.type)==="passkey"||(I=d.signers)!=null&&I.some(r=>r.type==="passkey"))throw new Error(L);return i.createWallet(d)}),[i.createWallet]),m=S(d=>b(this,null,function*(){throw new Error(L)}),[]),V=E(()=>G(W({},i),{createWallet:v,createPasskeySigner:m}),[i,v,m]);return p(B.Provider,{value:V,children:c})}function pe({children:c,createOnLogin:i,appearance:v,showOtpSignerPrompt:m=!0,callbacks:V,deviceSignerKeyStorage:d}){let R=E(()=>d!=null?d:new we,[]),{crossmint:I}=de("CrossmintWalletProvider must be used within CrossmintProvider"),r=fe(A),{apiKey:N,appId:O}=I,D=E(()=>{let e=le(N);if(!e.isValid)throw new Error("Invalid API key");return e},[N]),F=E(()=>z[D.environment],[D.environment]),y=g(null),t=g(null),[T,J]=ee(!1),C=g(!1),l=g(!1),s=g(0),M=g(0),Y=E(()=>O!=null?{crossmintAppId:O}:{},[O]),w=S(e=>b(this,null,function*(){if(t.current!=null){let n=t.current;if(l.current){r.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:s.current});return}if(C.current&&n.isConnected){r.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:s.current});return}l.current=!0;let a=Date.now();M.current=a;let o=s.current;try{r.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:ne.OS}),C.current=!0,n.isConnected=!1,yield n.handshakeWithChild();let u=Date.now()-a;r.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:u})}catch(u){let f=Date.now()-a;o===s.current&&(C.current=!1),r.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:f,error:u instanceof Error?u.message:String(u)}),console.error("[CrossmintWalletProvider] Handshake error:",u)}finally{o===s.current&&(l.current=!1)}}else r.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[r]);K(()=>{y.current!=null&&t.current==null&&(r.info("react-native.wallet.webview.initializing"),t.current=new oe(y,{incomingEvents:ie,outgoingEvents:se,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[ce.IndexedDbFatal]}}),r.info("react-native.wallet.webview.initialized"),w("eager"))},[T,r,w]);let $=S(()=>b(this,null,function*(){var e,n;r.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:l.current,isConnected:(n=(e=t.current)==null?void 0:e.isConnected)!=null?n:!1,generation:s.current}),yield w("onLoadEnd")}),[r,w]),q=S(e=>{var o,u;let n=t.current;if(n==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){r.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:l.current,isConnected:(u=(o=t.current)==null?void 0:o.isConnected)!=null?u:!1,generation:s.current,msSinceHandshakeStart:M.current>0?Date.now()-M.current:null}),w("frame-ready");return}try{let f=JSON.parse(a);if(f&&typeof f.type=="string"&&f.type.startsWith("console.")){let x=f.type.split(".")[1],U=(f.data||[]).map(h=>{try{return h==="[Function]"||h==="[Circular Reference]"||h==="[Unserializable Object]"?h:JSON.parse(h)}catch(be){return h}}),k=`react-native.wallet.webview.console.${x}`,P={webview_args:U};switch(x){case"log":r.info(k,P);break;case"error":r.error(k,P);break;case"warn":r.warn(k,P);break;case"info":r.info(k,P);break;case"debug":r.debug(k,P);break;default:r.info("react-native.wallet.webview.console.unknown",{webview_method:x,webview_args:U})}return}}catch(f){}n.handleMessage(e)},[r,w]),Q=()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},X=({emailSignerProps:e,phoneSignerProps:n})=>m?j(he,{children:[p(_,W({},e)),p(H,W({},n))]}):null,Z=()=>b(this,null,function*(){r.info("react-native.wallet.webview.init.start"),J(!0);let e=0,n=100;for(;t.current==null&&e<n;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw r.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");r.info("react-native.wallet.webview.init.success",{attempts:e})});return K(()=>{if(ve(i))throw new Error(L)},[i]),j(ue,{createOnLogin:i,appearance:v,showOtpSignerPrompt:m,initializeWebView:Z,callbacks:V,renderUI:X,clientTEEConnection:Q,deviceSignerKeyStorage:R,children:[p(me,{children:c}),T&&p(te,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:p(ae,{ref:y,source:{uri:F},globals:Y,onLoadEnd:$,onMessage:q,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},onRenderProcessGone:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[z[D.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function Me(c){return p(pe,W({},c))}export{Me as a};
|
package/dist/chunk-IN4XNL7B.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk763KUIBEjs = require('./chunk-763KUIBE.js');var _chunk3G67LZY4js = require('./chunk-3G67LZY4.js');var _chunk2RDEJU3Tjs = require('./chunk-2RDEJU3T.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _clientsigners = require('@crossmint/client-signers');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _expodevicesigner = require('@crossmint/expo-device-signer');var _jsxruntime = require('react/jsx-runtime');var L="Passkey signers are not supported in React Native. Use a different signer type such as 'email', 'phone', or 'device'.";function ve(c){var i,v;return c==null?!1:!!(((i=c.recovery)==null?void 0:i.type)==="passkey"||(v=c.signers)!=null&&v.some(m=>m.type==="passkey"))}function me({children:c}){let i=_react.useContext.call(void 0, _clientsdkreactbase.CrossmintWalletBaseContext),v=_react.useCallback.call(void 0, d=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var R,I;if(((R=d.recovery)==null?void 0:R.type)==="passkey"||(I=d.signers)!=null&&I.some(r=>r.type==="passkey"))throw new Error(L);return i.createWallet(d)}),[i.createWallet]),m=_react.useCallback.call(void 0, d=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){throw new Error(L)}),[]),V=_react.useMemo.call(void 0, ()=>_chunkIJN37RF2js.b.call(void 0, _chunkIJN37RF2js.a.call(void 0, {},i),{createWallet:v,createPasskeySigner:m}),[i,v,m]);return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintWalletBaseContext.Provider,{value:V,children:c})}function pe({children:c,createOnLogin:i,appearance:v,showOtpSignerPrompt:m=!0,callbacks:V,deviceSignerKeyStorage:d}){let R=_react.useMemo.call(void 0, ()=>d!=null?d:new _expodevicesigner.NativeDeviceSignerKeyStorage,[]),{crossmint:I}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintWalletProvider must be used within CrossmintProvider"),r=_clientsdkreactbase.useLogger.call(void 0, _chunk763KUIBEjs.a),{apiKey:N,appId:O}=I,D=_react.useMemo.call(void 0, ()=>{let e=_commonsdkbase.validateAPIKey.call(void 0, N);if(!e.isValid)throw new Error("Invalid API key");return e},[N]),F=_react.useMemo.call(void 0, ()=>_clientsigners.environmentUrlConfig[D.environment],[D.environment]),y=_react.useRef.call(void 0, null),t=_react.useRef.call(void 0, null),[T,J]=_react.useState.call(void 0, !1),C=_react.useRef.call(void 0, !1),l=_react.useRef.call(void 0, !1),s=_react.useRef.call(void 0, 0),M=_react.useRef.call(void 0, 0),Y=_react.useMemo.call(void 0, ()=>O!=null?{crossmintAppId:O}:{},[O]),w=_react.useCallback.call(void 0, e=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){if(t.current!=null){let n=t.current;if(l.current){r.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:s.current});return}if(C.current&&n.isConnected){r.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:s.current});return}l.current=!0;let a=Date.now();M.current=a;let o=s.current;try{r.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:_reactnative.Platform.OS}),C.current=!0,n.isConnected=!1,yield n.handshakeWithChild();let u=Date.now()-a;r.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:u})}catch(u){let f=Date.now()-a;o===s.current&&(C.current=!1),r.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:f,error:u instanceof Error?u.message:String(u)}),console.error("[CrossmintWalletProvider] Handshake error:",u)}finally{o===s.current&&(l.current=!1)}}else r.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[r]);_react.useEffect.call(void 0, ()=>{y.current!=null&&t.current==null&&(r.info("react-native.wallet.webview.initializing"),t.current=new (0, _clientsdkrnwindow.WebViewParent)(y,{incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[_clientsigners.SignerErrorCode.IndexedDbFatal]}}),r.info("react-native.wallet.webview.initialized"),w("eager"))},[T,r,w]);let $=_react.useCallback.call(void 0, ()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var e,n;r.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:l.current,isConnected:(n=(e=t.current)==null?void 0:e.isConnected)!=null?n:!1,generation:s.current}),yield w("onLoadEnd")}),[r,w]),q=_react.useCallback.call(void 0, e=>{var o,u;let n=t.current;if(n==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){r.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:l.current,isConnected:(u=(o=t.current)==null?void 0:o.isConnected)!=null?u:!1,generation:s.current,msSinceHandshakeStart:M.current>0?Date.now()-M.current:null}),w("frame-ready");return}try{let f=JSON.parse(a);if(f&&typeof f.type=="string"&&f.type.startsWith("console.")){let x=f.type.split(".")[1],U=(f.data||[]).map(h=>{try{return h==="[Function]"||h==="[Circular Reference]"||h==="[Unserializable Object]"?h:JSON.parse(h)}catch(be){return h}}),k=`react-native.wallet.webview.console.${x}`,P={webview_args:U};switch(x){case"log":r.info(k,P);break;case"error":r.error(k,P);break;case"warn":r.warn(k,P);break;case"info":r.info(k,P);break;case"debug":r.debug(k,P);break;default:r.info("react-native.wallet.webview.console.unknown",{webview_method:x,webview_args:U})}return}}catch(f){}n.handleMessage(e)},[r,w]),Q=()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},X=({emailSignerProps:e,phoneSignerProps:n})=>m?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunk3G67LZY4js.a,_chunkIJN37RF2js.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunk2RDEJU3Tjs.a,_chunkIJN37RF2js.a.call(void 0, {},n))]}):null,Z=()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){r.info("react-native.wallet.webview.init.start"),J(!0);let e=0,n=100;for(;t.current==null&&e<n;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw r.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");r.info("react-native.wallet.webview.init.success",{attempts:e})});return _react.useEffect.call(void 0, ()=>{if(ve(i))throw new Error(L)},[i]),_jsxruntime.jsxs.call(void 0, _clientsdkreactbase.CrossmintWalletBaseProvider,{createOnLogin:i,appearance:v,showOtpSignerPrompt:m,initializeWebView:Z,callbacks:V,renderUI:X,clientTEEConnection:Q,deviceSignerKeyStorage:R,children:[_jsxruntime.jsx.call(void 0, me,{children:c}),T&&_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:y,source:{uri:F},globals:Y,onLoadEnd:$,onMessage:q,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},onRenderProcessGone:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[_clientsigners.environmentUrlConfig[D.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function De(c){return _jsxruntime.jsx.call(void 0, pe,_chunkIJN37RF2js.a.call(void 0, {},c))}exports.a = De;
|
package/dist/chunk-YJXUDPES.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.1",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0",mitt:"3.0.1",zod:"3.22.4","@crossmint/expo-device-signer":"workspace:*"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@crossmint/expo-device-signer":"0.1.1","@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"},peerDependenciesMeta:{"@crossmint/expo-device-signer":{optional:!0}}};export{o as a};
|