@dubsdotapp/expo 0.2.21 → 0.2.22
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.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +69 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/managed-wallet.tsx +6 -4
- package/src/utils/device.ts +13 -0
package/dist/index.mjs
CHANGED
|
@@ -494,7 +494,7 @@ import { Connection as Connection2 } from "@solana/web3.js";
|
|
|
494
494
|
|
|
495
495
|
// src/managed-wallet.tsx
|
|
496
496
|
import { createContext, useContext, useState, useEffect, useRef, useCallback } from "react";
|
|
497
|
-
import { Platform } from "react-native";
|
|
497
|
+
import { Platform as Platform2 } from "react-native";
|
|
498
498
|
|
|
499
499
|
// src/wallet/mwa-adapter.ts
|
|
500
500
|
import { PublicKey } from "@solana/web3.js";
|
|
@@ -963,6 +963,53 @@ var PhantomDeeplinkAdapter = class {
|
|
|
963
963
|
}
|
|
964
964
|
};
|
|
965
965
|
|
|
966
|
+
// src/utils/device.ts
|
|
967
|
+
import { Platform } from "react-native";
|
|
968
|
+
function isSolanaSeeker() {
|
|
969
|
+
try {
|
|
970
|
+
const Device = __require("expo-device");
|
|
971
|
+
return Device.brand?.toLowerCase() === "solanamobile";
|
|
972
|
+
} catch {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
async function getDeviceInfo() {
|
|
977
|
+
try {
|
|
978
|
+
const Device = __require("expo-device");
|
|
979
|
+
return {
|
|
980
|
+
platform: Platform.OS,
|
|
981
|
+
modelName: Device.modelName,
|
|
982
|
+
brand: Device.brand,
|
|
983
|
+
manufacturer: Device.manufacturer,
|
|
984
|
+
osName: Device.osName,
|
|
985
|
+
osVersion: Device.osVersion,
|
|
986
|
+
deviceType: Device.deviceType,
|
|
987
|
+
deviceName: Device.deviceName,
|
|
988
|
+
totalMemory: Device.totalMemory,
|
|
989
|
+
modelId: Device.modelId,
|
|
990
|
+
designName: Device.designName,
|
|
991
|
+
productName: Device.productName,
|
|
992
|
+
isDevice: Device.isDevice
|
|
993
|
+
};
|
|
994
|
+
} catch {
|
|
995
|
+
return {
|
|
996
|
+
platform: Platform.OS,
|
|
997
|
+
modelName: null,
|
|
998
|
+
brand: null,
|
|
999
|
+
manufacturer: null,
|
|
1000
|
+
osName: null,
|
|
1001
|
+
osVersion: null,
|
|
1002
|
+
deviceType: null,
|
|
1003
|
+
deviceName: null,
|
|
1004
|
+
totalMemory: null,
|
|
1005
|
+
modelId: null,
|
|
1006
|
+
designName: null,
|
|
1007
|
+
productName: null,
|
|
1008
|
+
isDevice: null
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
966
1013
|
// src/ui/ConnectWalletScreen.tsx
|
|
967
1014
|
import {
|
|
968
1015
|
View,
|
|
@@ -1187,8 +1234,9 @@ function ManagedWalletProvider({
|
|
|
1187
1234
|
const [connecting, setConnecting] = useState(false);
|
|
1188
1235
|
const [isReady, setIsReady] = useState(false);
|
|
1189
1236
|
const [error, setError] = useState(null);
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1237
|
+
const seeker = Platform2.OS === "android" && isSolanaSeeker();
|
|
1238
|
+
const usePhantom = !seeker && !!redirectUri;
|
|
1239
|
+
console.log(TAG3, `Platform: ${Platform2.OS}, seeker: ${seeker}, redirectUri: ${redirectUri ? "provided" : "not set"}, usePhantom: ${usePhantom}`);
|
|
1192
1240
|
const adapterRef = useRef(null);
|
|
1193
1241
|
const transactRef = useRef(null);
|
|
1194
1242
|
if (!adapterRef.current) {
|
|
@@ -1744,45 +1792,6 @@ import bs583 from "bs58";
|
|
|
1744
1792
|
import { createContext as createContext2 } from "react";
|
|
1745
1793
|
var AuthContext = createContext2(null);
|
|
1746
1794
|
|
|
1747
|
-
// src/utils/device.ts
|
|
1748
|
-
import { Platform as Platform2 } from "react-native";
|
|
1749
|
-
async function getDeviceInfo() {
|
|
1750
|
-
try {
|
|
1751
|
-
const Device = __require("expo-device");
|
|
1752
|
-
return {
|
|
1753
|
-
platform: Platform2.OS,
|
|
1754
|
-
modelName: Device.modelName,
|
|
1755
|
-
brand: Device.brand,
|
|
1756
|
-
manufacturer: Device.manufacturer,
|
|
1757
|
-
osName: Device.osName,
|
|
1758
|
-
osVersion: Device.osVersion,
|
|
1759
|
-
deviceType: Device.deviceType,
|
|
1760
|
-
deviceName: Device.deviceName,
|
|
1761
|
-
totalMemory: Device.totalMemory,
|
|
1762
|
-
modelId: Device.modelId,
|
|
1763
|
-
designName: Device.designName,
|
|
1764
|
-
productName: Device.productName,
|
|
1765
|
-
isDevice: Device.isDevice
|
|
1766
|
-
};
|
|
1767
|
-
} catch {
|
|
1768
|
-
return {
|
|
1769
|
-
platform: Platform2.OS,
|
|
1770
|
-
modelName: null,
|
|
1771
|
-
brand: null,
|
|
1772
|
-
manufacturer: null,
|
|
1773
|
-
osName: null,
|
|
1774
|
-
osVersion: null,
|
|
1775
|
-
deviceType: null,
|
|
1776
|
-
deviceName: null,
|
|
1777
|
-
totalMemory: null,
|
|
1778
|
-
modelId: null,
|
|
1779
|
-
designName: null,
|
|
1780
|
-
productName: null,
|
|
1781
|
-
isDevice: null
|
|
1782
|
-
};
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
1795
|
// src/hooks/useAuth.ts
|
|
1787
1796
|
function useAuth() {
|
|
1788
1797
|
const sharedAuth = useContext2(AuthContext);
|
|
@@ -3666,6 +3675,7 @@ export {
|
|
|
3666
3675
|
UserProfileCard,
|
|
3667
3676
|
createSecureStoreStorage,
|
|
3668
3677
|
getDeviceInfo,
|
|
3678
|
+
isSolanaSeeker,
|
|
3669
3679
|
mergeTheme,
|
|
3670
3680
|
parseSolanaError,
|
|
3671
3681
|
signAndSendBase64Transaction,
|