@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/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -107,5 +107,5 @@ export type {
|
|
|
107
107
|
|
|
108
108
|
// Utils
|
|
109
109
|
export { signAndSendBase64Transaction } from './utils/transaction';
|
|
110
|
-
export { getDeviceInfo } from './utils/device';
|
|
110
|
+
export { getDeviceInfo, isSolanaSeeker } from './utils/device';
|
|
111
111
|
export type { DeviceInfo } from './utils/device';
|
package/src/managed-wallet.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { MwaWalletAdapter } from './wallet/mwa-adapter';
|
|
|
4
4
|
import { PhantomDeeplinkAdapter } from './wallet/phantom-deeplink';
|
|
5
5
|
import type { PhantomSession } from './wallet/phantom-deeplink';
|
|
6
6
|
import type { WalletAdapter } from './wallet/types';
|
|
7
|
+
import { isSolanaSeeker } from './utils/device';
|
|
7
8
|
import { ConnectWalletScreen } from './ui/ConnectWalletScreen';
|
|
8
9
|
import type { ConnectWalletScreenProps } from './ui/ConnectWalletScreen';
|
|
9
10
|
import type { TokenStorage } from './storage';
|
|
@@ -94,11 +95,12 @@ export function ManagedWalletProvider({
|
|
|
94
95
|
const [error, setError] = useState<string | null>(null);
|
|
95
96
|
|
|
96
97
|
// Determine which adapter to use:
|
|
97
|
-
// -
|
|
98
|
-
// - Android
|
|
99
|
-
const
|
|
98
|
+
// - Solana Seeker (Android) → MWA (native Mobile Wallet Adapter support)
|
|
99
|
+
// - Everything else (iOS + regular Android) → Phantom deeplinks
|
|
100
|
+
const seeker = Platform.OS === 'android' && isSolanaSeeker();
|
|
101
|
+
const usePhantom = !seeker && !!redirectUri;
|
|
100
102
|
|
|
101
|
-
console.log(TAG, `Platform: ${Platform.OS}, redirectUri: ${redirectUri ? 'provided' : 'not set'}, usePhantom: ${usePhantom}`);
|
|
103
|
+
console.log(TAG, `Platform: ${Platform.OS}, seeker: ${seeker}, redirectUri: ${redirectUri ? 'provided' : 'not set'}, usePhantom: ${usePhantom}`);
|
|
102
104
|
|
|
103
105
|
const adapterRef = useRef<WalletAdapter | null>(null);
|
|
104
106
|
const transactRef = useRef<any>(null);
|
package/src/utils/device.ts
CHANGED
|
@@ -16,6 +16,19 @@ export interface DeviceInfo {
|
|
|
16
16
|
isDevice: boolean | null;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Detect Solana Seeker device (synchronous — safe to call during render).
|
|
21
|
+
* Checks brand from expo-device; returns false if expo-device isn't installed.
|
|
22
|
+
*/
|
|
23
|
+
export function isSolanaSeeker(): boolean {
|
|
24
|
+
try {
|
|
25
|
+
const Device = require('expo-device');
|
|
26
|
+
return Device.brand?.toLowerCase() === 'solanamobile';
|
|
27
|
+
} catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
19
32
|
export async function getDeviceInfo(): Promise<DeviceInfo> {
|
|
20
33
|
try {
|
|
21
34
|
const Device = require('expo-device');
|