@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.mjs
CHANGED
|
@@ -1339,6 +1339,29 @@ var styles = StyleSheet.create({
|
|
|
1339
1339
|
// src/managed-wallet.tsx
|
|
1340
1340
|
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
|
1341
1341
|
var TAG3 = "[Dubs:ManagedWallet]";
|
|
1342
|
+
function getDefaultRedirectUri() {
|
|
1343
|
+
if (Platform.OS !== "ios") return void 0;
|
|
1344
|
+
try {
|
|
1345
|
+
const expoLinking = __require("expo-linking");
|
|
1346
|
+
if (expoLinking.createURL) {
|
|
1347
|
+
const uri = expoLinking.createURL("phantom-callback");
|
|
1348
|
+
console.log(TAG3, "Auto-detected redirect URI via expo-linking:", uri);
|
|
1349
|
+
return uri;
|
|
1350
|
+
}
|
|
1351
|
+
} catch {
|
|
1352
|
+
}
|
|
1353
|
+
try {
|
|
1354
|
+
const Constants = __require("expo-constants").default;
|
|
1355
|
+
const scheme = Constants.expoConfig?.scheme;
|
|
1356
|
+
if (scheme) {
|
|
1357
|
+
const uri = `${scheme}://phantom-callback`;
|
|
1358
|
+
console.log(TAG3, "Auto-detected redirect URI via expo-constants:", uri);
|
|
1359
|
+
return uri;
|
|
1360
|
+
}
|
|
1361
|
+
} catch {
|
|
1362
|
+
}
|
|
1363
|
+
return void 0;
|
|
1364
|
+
}
|
|
1342
1365
|
var phantomSingleton = null;
|
|
1343
1366
|
function getOrCreatePhantomAdapter(config) {
|
|
1344
1367
|
if (!phantomSingleton) {
|
|
@@ -1385,14 +1408,15 @@ function ManagedWalletProvider({
|
|
|
1385
1408
|
const [connecting, setConnecting] = useState(false);
|
|
1386
1409
|
const [isReady, setIsReady] = useState(false);
|
|
1387
1410
|
const [error, setError] = useState(null);
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1411
|
+
const resolvedRedirectUri = redirectUri || getDefaultRedirectUri();
|
|
1412
|
+
const usePhantom = Platform.OS === "ios" && !!resolvedRedirectUri;
|
|
1413
|
+
console.log(TAG3, `Platform: ${Platform.OS}, redirectUri: ${resolvedRedirectUri ?? "none"} (explicit: ${!!redirectUri}), usePhantom: ${usePhantom}`);
|
|
1390
1414
|
const adapterRef = useRef(null);
|
|
1391
1415
|
const transactRef = useRef(null);
|
|
1392
1416
|
if (!adapterRef.current) {
|
|
1393
1417
|
if (usePhantom) {
|
|
1394
1418
|
adapterRef.current = getOrCreatePhantomAdapter({
|
|
1395
|
-
redirectUri,
|
|
1419
|
+
redirectUri: resolvedRedirectUri,
|
|
1396
1420
|
appUrl,
|
|
1397
1421
|
cluster,
|
|
1398
1422
|
storage
|