@dubsdotapp/expo 0.2.47 → 0.2.48
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 +3 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/managed-wallet.tsx +5 -49
package/dist/index.mjs
CHANGED
|
@@ -1317,32 +1317,6 @@ var styles = StyleSheet.create({
|
|
|
1317
1317
|
// src/managed-wallet.tsx
|
|
1318
1318
|
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
|
1319
1319
|
var TAG3 = "[Dubs:ManagedWallet]";
|
|
1320
|
-
function getDefaultRedirectUri() {
|
|
1321
|
-
if (Platform.OS !== "ios") return void 0;
|
|
1322
|
-
try {
|
|
1323
|
-
const expoLinking = __require("expo-linking");
|
|
1324
|
-
if (expoLinking.createURL) {
|
|
1325
|
-
const uri = expoLinking.createURL("phantom-callback");
|
|
1326
|
-
console.log(TAG3, "Auto-detected redirect URI via expo-linking:", uri);
|
|
1327
|
-
return uri;
|
|
1328
|
-
}
|
|
1329
|
-
} catch (e) {
|
|
1330
|
-
console.log(TAG3, "expo-linking createURL failed:", e instanceof Error ? e.message : e);
|
|
1331
|
-
}
|
|
1332
|
-
try {
|
|
1333
|
-
const Constants = __require("expo-constants").default;
|
|
1334
|
-
const scheme = Constants.expoConfig?.scheme;
|
|
1335
|
-
if (scheme) {
|
|
1336
|
-
const uri = `${scheme}://phantom-callback`;
|
|
1337
|
-
console.log(TAG3, "Auto-detected redirect URI via expo-constants:", uri);
|
|
1338
|
-
return uri;
|
|
1339
|
-
}
|
|
1340
|
-
} catch (e) {
|
|
1341
|
-
console.log(TAG3, "expo-constants fallback failed:", e instanceof Error ? e.message : e);
|
|
1342
|
-
}
|
|
1343
|
-
console.log(TAG3, "Could not auto-detect redirect URI on iOS \u2014 pass redirectUri to DubsProvider");
|
|
1344
|
-
return void 0;
|
|
1345
|
-
}
|
|
1346
1320
|
var phantomSingleton = null;
|
|
1347
1321
|
function getOrCreatePhantomAdapter(config) {
|
|
1348
1322
|
if (!phantomSingleton) {
|
|
@@ -1389,20 +1363,14 @@ function ManagedWalletProvider({
|
|
|
1389
1363
|
const [connecting, setConnecting] = useState(false);
|
|
1390
1364
|
const [isReady, setIsReady] = useState(false);
|
|
1391
1365
|
const [error, setError] = useState(null);
|
|
1392
|
-
const usePhantom = Platform.OS === "ios";
|
|
1393
|
-
|
|
1394
|
-
console.log(TAG3, `Platform: ${Platform.OS}, redirectUri: ${resolvedRedirectUri ?? "none"} (explicit: ${!!redirectUri}), usePhantom: ${usePhantom}`);
|
|
1366
|
+
const usePhantom = Platform.OS === "ios" && !!redirectUri;
|
|
1367
|
+
console.log(TAG3, `Platform: ${Platform.OS}, redirectUri: ${redirectUri ? "provided" : "not set"}, usePhantom: ${usePhantom}`);
|
|
1395
1368
|
const adapterRef = useRef(null);
|
|
1396
1369
|
const transactRef = useRef(null);
|
|
1397
1370
|
if (!adapterRef.current) {
|
|
1398
1371
|
if (usePhantom) {
|
|
1399
|
-
if (!resolvedRedirectUri) {
|
|
1400
|
-
throw new Error(
|
|
1401
|
-
'@dubsdotapp/expo: Could not auto-detect redirect URI on iOS. Either set a "scheme" in your app.json or pass redirectUri to <DubsProvider>.'
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
1372
|
adapterRef.current = getOrCreatePhantomAdapter({
|
|
1405
|
-
redirectUri
|
|
1373
|
+
redirectUri,
|
|
1406
1374
|
appUrl,
|
|
1407
1375
|
cluster,
|
|
1408
1376
|
storage
|