@dubsdotapp/expo 0.2.49 → 0.2.50
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/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/managed-wallet.tsx +28 -4
package/dist/index.js
CHANGED
|
@@ -1404,6 +1404,29 @@ var styles = import_react_native3.StyleSheet.create({
|
|
|
1404
1404
|
// src/managed-wallet.tsx
|
|
1405
1405
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1406
1406
|
var TAG3 = "[Dubs:ManagedWallet]";
|
|
1407
|
+
function getDefaultRedirectUri() {
|
|
1408
|
+
if (import_react_native4.Platform.OS !== "ios") return void 0;
|
|
1409
|
+
try {
|
|
1410
|
+
const expoLinking = require("expo-linking");
|
|
1411
|
+
if (expoLinking.createURL) {
|
|
1412
|
+
const uri = expoLinking.createURL("phantom-callback");
|
|
1413
|
+
console.log(TAG3, "Auto-detected redirect URI via expo-linking:", uri);
|
|
1414
|
+
return uri;
|
|
1415
|
+
}
|
|
1416
|
+
} catch {
|
|
1417
|
+
}
|
|
1418
|
+
try {
|
|
1419
|
+
const Constants = require("expo-constants").default;
|
|
1420
|
+
const scheme = Constants.expoConfig?.scheme;
|
|
1421
|
+
if (scheme) {
|
|
1422
|
+
const uri = `${scheme}://phantom-callback`;
|
|
1423
|
+
console.log(TAG3, "Auto-detected redirect URI via expo-constants:", uri);
|
|
1424
|
+
return uri;
|
|
1425
|
+
}
|
|
1426
|
+
} catch {
|
|
1427
|
+
}
|
|
1428
|
+
return void 0;
|
|
1429
|
+
}
|
|
1407
1430
|
var phantomSingleton = null;
|
|
1408
1431
|
function getOrCreatePhantomAdapter(config) {
|
|
1409
1432
|
if (!phantomSingleton) {
|
|
@@ -1450,14 +1473,15 @@ function ManagedWalletProvider({
|
|
|
1450
1473
|
const [connecting, setConnecting] = (0, import_react2.useState)(false);
|
|
1451
1474
|
const [isReady, setIsReady] = (0, import_react2.useState)(false);
|
|
1452
1475
|
const [error, setError] = (0, import_react2.useState)(null);
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1476
|
+
const resolvedRedirectUri = redirectUri || getDefaultRedirectUri();
|
|
1477
|
+
const usePhantom = import_react_native4.Platform.OS === "ios" && !!resolvedRedirectUri;
|
|
1478
|
+
console.log(TAG3, `Platform: ${import_react_native4.Platform.OS}, redirectUri: ${resolvedRedirectUri ?? "none"} (explicit: ${!!redirectUri}), usePhantom: ${usePhantom}`);
|
|
1455
1479
|
const adapterRef = (0, import_react2.useRef)(null);
|
|
1456
1480
|
const transactRef = (0, import_react2.useRef)(null);
|
|
1457
1481
|
if (!adapterRef.current) {
|
|
1458
1482
|
if (usePhantom) {
|
|
1459
1483
|
adapterRef.current = getOrCreatePhantomAdapter({
|
|
1460
|
-
redirectUri,
|
|
1484
|
+
redirectUri: resolvedRedirectUri,
|
|
1461
1485
|
appUrl,
|
|
1462
1486
|
cluster,
|
|
1463
1487
|
storage
|