@crossmint/client-sdk-react-native-ui 1.0.2 → 1.0.4
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-3TFUHD5V.mjs +1 -0
- package/dist/{chunk-BIBUUAZH.mjs → chunk-4PB62QZH.mjs} +1 -1
- package/dist/chunk-6N7XF54Y.mjs +1 -0
- package/dist/{chunk-MHJ2Q527.mjs → chunk-DL5D6VSE.mjs} +1 -1
- package/dist/{chunk-ICIFOVRL.js → chunk-FVINRPAB.js} +1 -1
- package/dist/{chunk-55XI6CDP.js → chunk-INFXPCQ2.js} +1 -1
- package/dist/chunk-JPPAYHQP.js +1 -0
- package/dist/{chunk-23I6ET2L.mjs → chunk-L3FU4JVL.mjs} +1 -1
- package/dist/{chunk-EVYDNZ35.mjs → chunk-MIIWRDK7.mjs} +1 -1
- package/dist/{chunk-IRONB2PO.mjs → chunk-NSOPIJTO.mjs} +1 -1
- package/dist/chunk-PHECZO2O.mjs +1 -0
- package/dist/chunk-S75MIWI2.js +1 -0
- package/dist/chunk-SNGN2C5V.js +1 -0
- package/dist/{chunk-IMNH3CSG.js → chunk-T6FKCQE2.js} +1 -1
- package/dist/{chunk-KEKOTVHY.js → chunk-UO2GSJW5.js} +1 -1
- package/dist/{chunk-JTTV37HU.js → chunk-W62R4744.js} +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/index.js +1 -1
- package/dist/components/index.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 +18 -23
- package/dist/chunk-2QJWVOG2.js +0 -1
- package/dist/chunk-DPOR56Z4.mjs +0 -1
- package/dist/chunk-MGB2PYEB.js +0 -1
- package/dist/chunk-YPB3DBUN.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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.4",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 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-DL5D6VSE.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};
|
|
@@ -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-MIIWRDK7.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 _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 _chunkUO2GSJW5js = require('./chunk-UO2GSJW5.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=_chunkUO2GSJW5js.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;
|
|
@@ -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 _chunkSNGN2C5Vjs = require('./chunk-SNGN2C5V.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:_chunkSNGN2C5Vjs.a.name,packageVersion:_chunkSNGN2C5Vjs.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW62R4744js = require('./chunk-W62R4744.js');var _chunk2RDEJU3Tjs = require('./chunk-2RDEJU3T.js');var _chunk3G67LZY4js = require('./chunk-3G67LZY4.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, _chunkW62R4744js.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, _chunk3G67LZY4js.a,_chunkIJN37RF2js.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunk2RDEJU3Tjs.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 m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-NSOPIJTO.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 n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-3TFUHD5V.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 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-3TFUHD5V.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A}from"./chunk-L3FU4JVL.mjs";import{a as K}from"./chunk-W4PUVHWF.mjs";import{a as H}from"./chunk-YMCYXFCG.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};
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.4",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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFVINRPABjs = require('./chunk-FVINRPAB.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkFVINRPABjs.a,_chunkIJN37RF2js.a.call(void 0, {},d))}exports.a = s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSNGN2C5Vjs = require('./chunk-SNGN2C5V.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:_chunkSNGN2C5Vjs.a.version},apiKeyExpectations:t}})}exports.a = a;
|
|
@@ -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 _chunkINFXPCQ2js = require('./chunk-INFXPCQ2.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, ()=>_chunkINFXPCQ2js.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;
|
|
@@ -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 _chunkT6FKCQE2js = require('../../chunk-T6FKCQE2.js');require('../../chunk-FVINRPAB.js');require('../../chunk-2UY6GCV3.js');require('../../chunk-YQEWHOQ7.js');require('../../chunk-UO2GSJW5.js');require('../../chunk-2D2RJCVX.js');require('../../chunk-SNGN2C5V.js');require('../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkT6FKCQE2js.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-4PB62QZH.mjs";import"../../chunk-DL5D6VSE.mjs";import"../../chunk-ZP2QWJOD.mjs";import"../../chunk-PCJMDUSI.mjs";import"../../chunk-MIIWRDK7.mjs";import"../../chunk-FFQ6EQCL.mjs";import"../../chunk-3TFUHD5V.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 _chunkT6FKCQE2js = require('../../../chunk-T6FKCQE2.js');require('../../../chunk-FVINRPAB.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-UO2GSJW5.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-SNGN2C5V.js');require('../../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkT6FKCQE2js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-4PB62QZH.mjs";import"../../../chunk-DL5D6VSE.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-MIIWRDK7.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-3TFUHD5V.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 _chunkFVINRPABjs = require('../../../chunk-FVINRPAB.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-UO2GSJW5.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-SNGN2C5V.js');require('../../../chunk-IJN37RF2.js');exports.EmbeddedCheckoutV3WebView = _chunkFVINRPABjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-DL5D6VSE.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-MIIWRDK7.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-3TFUHD5V.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 _chunkT6FKCQE2js = require('../../../chunk-T6FKCQE2.js');require('../../../chunk-FVINRPAB.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-UO2GSJW5.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-SNGN2C5V.js');require('../../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkT6FKCQE2js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../chunk-MB7H3PBJ.mjs";import{a}from"../../../chunk-
|
|
1
|
+
import"../../../chunk-MB7H3PBJ.mjs";import{a}from"../../../chunk-4PB62QZH.mjs";import"../../../chunk-DL5D6VSE.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-MIIWRDK7.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-3TFUHD5V.mjs";import"../../../chunk-4P5ABAFD.mjs";export{a as CrossmintEmbeddedCheckout};
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-2PX34LDU.js');require('../chunk-I4D3YJW2.js');require('../chunk-AJMHVVST.js');var _chunkQHJA7VYDjs = require('../chunk-QHJA7VYD.js');require('../chunk-DKQZSNOO.js');require('../chunk-72MMCJ2E.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-2PX34LDU.js');require('../chunk-I4D3YJW2.js');require('../chunk-AJMHVVST.js');var _chunkQHJA7VYDjs = require('../chunk-QHJA7VYD.js');require('../chunk-DKQZSNOO.js');require('../chunk-72MMCJ2E.js');var _chunkT6FKCQE2js = require('../chunk-T6FKCQE2.js');require('../chunk-FVINRPAB.js');require('../chunk-2UY6GCV3.js');require('../chunk-YQEWHOQ7.js');require('../chunk-UO2GSJW5.js');var _chunk2RDEJU3Tjs = require('../chunk-2RDEJU3T.js');var _chunk3G67LZY4js = require('../chunk-3G67LZY4.js');require('../chunk-RWTMQGU7.js');require('../chunk-LHEOII54.js');require('../chunk-R4AKS6SV.js');require('../chunk-NVBPI6JQ.js');require('../chunk-WH3PVAVN.js');require('../chunk-TQIJ7OZD.js');require('../chunk-RIKAIN6N.js');require('../chunk-2U67EBAU.js');require('../chunk-TVASK7FQ.js');require('../chunk-EI5LOD4Y.js');require('../chunk-2D2RJCVX.js');require('../chunk-SNGN2C5V.js');require('../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkT6FKCQE2js.a; exports.EmailSignersDialog = _chunk3G67LZY4js.a; exports.ExportPrivateKeyButton = _chunkQHJA7VYDjs.a; exports.PhoneSignersDialog = _chunk2RDEJU3Tjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-UBHIBMTA.mjs";import"../chunk-J7Q2R6UH.mjs";import"../chunk-5CLFJLE4.mjs";import{a as d}from"../chunk-NNGGH73Y.mjs";import"../chunk-TIQGKXQA.mjs";import"../chunk-MB7H3PBJ.mjs";import{a as c}from"../chunk-
|
|
1
|
+
import"../chunk-UBHIBMTA.mjs";import"../chunk-J7Q2R6UH.mjs";import"../chunk-5CLFJLE4.mjs";import{a as d}from"../chunk-NNGGH73Y.mjs";import"../chunk-TIQGKXQA.mjs";import"../chunk-MB7H3PBJ.mjs";import{a as c}from"../chunk-4PB62QZH.mjs";import"../chunk-DL5D6VSE.mjs";import"../chunk-ZP2QWJOD.mjs";import"../chunk-PCJMDUSI.mjs";import"../chunk-MIIWRDK7.mjs";import{a as b}from"../chunk-W4PUVHWF.mjs";import{a}from"../chunk-YMCYXFCG.mjs";import"../chunk-YJIX6E2P.mjs";import"../chunk-XZ5LQIRB.mjs";import"../chunk-TSRZEXRU.mjs";import"../chunk-NG4FYS2Z.mjs";import"../chunk-WDMEQNBX.mjs";import"../chunk-C7S2X5RD.mjs";import"../chunk-J62V5BQX.mjs";import"../chunk-QHTHMZZV.mjs";import"../chunk-7JGGPJBX.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-FFQ6EQCL.mjs";import"../chunk-3TFUHD5V.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});require('../../chunk-I4D3YJW2.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-I4D3YJW2.js');var _chunk2RDEJU3Tjs = require('../../chunk-2RDEJU3T.js');var _chunk3G67LZY4js = require('../../chunk-3G67LZY4.js');require('../../chunk-RWTMQGU7.js');require('../../chunk-LHEOII54.js');require('../../chunk-R4AKS6SV.js');require('../../chunk-NVBPI6JQ.js');require('../../chunk-WH3PVAVN.js');require('../../chunk-TQIJ7OZD.js');require('../../chunk-RIKAIN6N.js');require('../../chunk-2U67EBAU.js');require('../../chunk-TVASK7FQ.js');require('../../chunk-EI5LOD4Y.js');require('../../chunk-IJN37RF2.js');exports.EmailSignersDialog = _chunk3G67LZY4js.a; exports.PhoneSignersDialog = _chunk2RDEJU3Tjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-J7Q2R6UH.mjs";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-J7Q2R6UH.mjs";import{a as b}from"../../chunk-W4PUVHWF.mjs";import{a}from"../../chunk-YMCYXFCG.mjs";import"../../chunk-YJIX6E2P.mjs";import"../../chunk-XZ5LQIRB.mjs";import"../../chunk-TSRZEXRU.mjs";import"../../chunk-NG4FYS2Z.mjs";import"../../chunk-WDMEQNBX.mjs";import"../../chunk-C7S2X5RD.mjs";import"../../chunk-J62V5BQX.mjs";import"../../chunk-QHTHMZZV.mjs";import"../../chunk-7JGGPJBX.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 _chunkJPPAYHQPjs = require('./chunk-JPPAYHQP.js');var _chunkW62R4744js = require('./chunk-W62R4744.js');require('./chunk-2PX34LDU.js');require('./chunk-I4D3YJW2.js');require('./chunk-AJMHVVST.js');var _chunkQHJA7VYDjs = require('./chunk-QHJA7VYD.js');require('./chunk-DKQZSNOO.js');require('./chunk-72MMCJ2E.js');var _chunkT6FKCQE2js = require('./chunk-T6FKCQE2.js');require('./chunk-FVINRPAB.js');require('./chunk-2UY6GCV3.js');require('./chunk-YQEWHOQ7.js');require('./chunk-UO2GSJW5.js');var _chunk2RDEJU3Tjs = require('./chunk-2RDEJU3T.js');var _chunk3G67LZY4js = require('./chunk-3G67LZY4.js');require('./chunk-RWTMQGU7.js');require('./chunk-LHEOII54.js');require('./chunk-R4AKS6SV.js');require('./chunk-NVBPI6JQ.js');require('./chunk-WH3PVAVN.js');require('./chunk-TQIJ7OZD.js');require('./chunk-RIKAIN6N.js');require('./chunk-2U67EBAU.js');require('./chunk-TVASK7FQ.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-INFXPCQ2.js');require('./chunk-SNGN2C5V.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 = _chunkT6FKCQE2js.a; exports.CrossmintProvider = _chunkW62R4744js.b; exports.CrossmintWalletProvider = _chunkJPPAYHQPjs.a; exports.EVMWallet = _walletssdk.EVMWallet; exports.EmailSignersDialog = _chunk3G67LZY4js.a; exports.ExportPrivateKeyButton = _chunkQHJA7VYDjs.a; exports.PhoneSignersDialog = _chunk2RDEJU3Tjs.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-PHECZO2O.mjs";import{b as p}from"./chunk-L3FU4JVL.mjs";import"./chunk-UBHIBMTA.mjs";import"./chunk-J7Q2R6UH.mjs";import"./chunk-5CLFJLE4.mjs";import{a as f}from"./chunk-NNGGH73Y.mjs";import"./chunk-TIQGKXQA.mjs";import"./chunk-MB7H3PBJ.mjs";import{a as y}from"./chunk-4PB62QZH.mjs";import"./chunk-DL5D6VSE.mjs";import"./chunk-ZP2QWJOD.mjs";import"./chunk-PCJMDUSI.mjs";import"./chunk-MIIWRDK7.mjs";import{a as m}from"./chunk-W4PUVHWF.mjs";import{a as l}from"./chunk-YMCYXFCG.mjs";import"./chunk-YJIX6E2P.mjs";import"./chunk-XZ5LQIRB.mjs";import"./chunk-TSRZEXRU.mjs";import"./chunk-NG4FYS2Z.mjs";import"./chunk-WDMEQNBX.mjs";import"./chunk-C7S2X5RD.mjs";import"./chunk-J62V5BQX.mjs";import"./chunk-QHTHMZZV.mjs";import"./chunk-7JGGPJBX.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-NSOPIJTO.mjs";import"./chunk-3TFUHD5V.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 _chunkINFXPCQ2js = require('../chunk-INFXPCQ2.js');require('../chunk-SNGN2C5V.js');require('../chunk-IJN37RF2.js');exports.initReactNativeLogger = _chunkINFXPCQ2js.a;
|
package/dist/logger/init.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-NSOPIJTO.mjs";import"../chunk-3TFUHD5V.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 _chunkW62R4744js = require('../chunk-W62R4744.js');require('../chunk-INFXPCQ2.js');require('../chunk-SNGN2C5V.js');require('../chunk-IJN37RF2.js');exports.CrossmintProvider = _chunkW62R4744js.b; exports.LoggerContext = _chunkW62R4744js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-L3FU4JVL.mjs";import"../chunk-NSOPIJTO.mjs";import"../chunk-3TFUHD5V.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 _chunkJPPAYHQPjs = require('../chunk-JPPAYHQP.js');require('../chunk-W62R4744.js');require('../chunk-2RDEJU3T.js');require('../chunk-3G67LZY4.js');require('../chunk-RWTMQGU7.js');require('../chunk-LHEOII54.js');require('../chunk-R4AKS6SV.js');require('../chunk-NVBPI6JQ.js');require('../chunk-WH3PVAVN.js');require('../chunk-TQIJ7OZD.js');require('../chunk-RIKAIN6N.js');require('../chunk-2U67EBAU.js');require('../chunk-TVASK7FQ.js');require('../chunk-EI5LOD4Y.js');require('../chunk-INFXPCQ2.js');require('../chunk-SNGN2C5V.js');require('../chunk-S75MIWI2.js');require('../chunk-IJN37RF2.js');exports.CrossmintWalletProvider = _chunkJPPAYHQPjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-PHECZO2O.mjs";import"../chunk-L3FU4JVL.mjs";import"../chunk-W4PUVHWF.mjs";import"../chunk-YMCYXFCG.mjs";import"../chunk-YJIX6E2P.mjs";import"../chunk-XZ5LQIRB.mjs";import"../chunk-TSRZEXRU.mjs";import"../chunk-NG4FYS2Z.mjs";import"../chunk-WDMEQNBX.mjs";import"../chunk-C7S2X5RD.mjs";import"../chunk-J62V5BQX.mjs";import"../chunk-QHTHMZZV.mjs";import"../chunk-7JGGPJBX.mjs";import"../chunk-7USVT6EZ.mjs";import"../chunk-NSOPIJTO.mjs";import"../chunk-3TFUHD5V.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 _chunkJPPAYHQPjs = require('../chunk-JPPAYHQP.js');var _chunkW62R4744js = require('../chunk-W62R4744.js');require('../chunk-2RDEJU3T.js');require('../chunk-3G67LZY4.js');require('../chunk-RWTMQGU7.js');require('../chunk-LHEOII54.js');require('../chunk-R4AKS6SV.js');require('../chunk-NVBPI6JQ.js');require('../chunk-WH3PVAVN.js');require('../chunk-TQIJ7OZD.js');require('../chunk-RIKAIN6N.js');require('../chunk-2U67EBAU.js');require('../chunk-TVASK7FQ.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-INFXPCQ2.js');require('../chunk-SNGN2C5V.js');require('../chunk-S75MIWI2.js');require('../chunk-IJN37RF2.js');exports.CrossmintAuthProvider = _chunkZ36IMAC2js.b; exports.CrossmintProvider = _chunkW62R4744js.b; exports.CrossmintWalletProvider = _chunkJPPAYHQPjs.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-PHECZO2O.mjs";import{b}from"../chunk-L3FU4JVL.mjs";import"../chunk-W4PUVHWF.mjs";import"../chunk-YMCYXFCG.mjs";import"../chunk-YJIX6E2P.mjs";import"../chunk-XZ5LQIRB.mjs";import"../chunk-TSRZEXRU.mjs";import"../chunk-NG4FYS2Z.mjs";import"../chunk-WDMEQNBX.mjs";import"../chunk-C7S2X5RD.mjs";import"../chunk-J62V5BQX.mjs";import"../chunk-QHTHMZZV.mjs";import"../chunk-7JGGPJBX.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-NSOPIJTO.mjs";import"../chunk-3TFUHD5V.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 _chunkUO2GSJW5js = require('../chunk-UO2GSJW5.js');require('../chunk-SNGN2C5V.js');require('../chunk-IJN37RF2.js');exports.createCrossmintApiClient = _chunkUO2GSJW5js.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-MIIWRDK7.mjs";import"../chunk-3TFUHD5V.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.4",
|
|
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",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
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",
|
|
32
|
+
"@crossmint/client-sdk-base": "2.1.0",
|
|
33
|
+
"@crossmint/client-sdk-react-base": "2.0.3",
|
|
25
34
|
"@crossmint/client-sdk-rn-window": "0.3.15",
|
|
35
|
+
"@crossmint/client-sdk-auth": "1.3.1",
|
|
26
36
|
"@crossmint/client-signers": "0.1.2",
|
|
27
|
-
"@crossmint/
|
|
28
|
-
"@crossmint/common-sdk-auth": "1.1.0",
|
|
37
|
+
"@crossmint/common-sdk-auth": "1.1.1",
|
|
29
38
|
"@crossmint/common-sdk-base": "0.10.0",
|
|
30
|
-
"@crossmint/
|
|
31
|
-
"@crossmint/wallets-sdk": "1.0.2"
|
|
39
|
+
"@crossmint/wallets-sdk": "1.0.3"
|
|
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.2",
|
|
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-2QJWVOG2.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.2",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.2","@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-DPOR56Z4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-23I6ET2L.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-MGB2PYEB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJTTV37HUjs = require('./chunk-JTTV37HU.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, _chunkJTTV37HUjs.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-YPB3DBUN.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.2",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.2","@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};
|