@blazium/ton-connect-mobile 1.2.3 → 1.2.4

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/README.md CHANGED
@@ -144,6 +144,7 @@ Access the TonConnectUI instance with all methods and features.
144
144
  ```typescript
145
145
  const tonConnectUI = useTonConnectUI();
146
146
 
147
+ <<<<<<< HEAD
147
148
  // Connection methods:
148
149
  await tonConnectUI.connectWallet();
149
150
  await tonConnectUI.disconnect();
@@ -240,6 +241,7 @@ new TonConnectMobile(config: TonConnectMobileConfig)
240
241
  - `manifestUrl` (required): URL to your TonConnect manifest file
241
242
  - `scheme` (required): Your app's deep link scheme
242
243
  - `storageKeyPrefix` (optional): Prefix for storage keys (default: `'tonconnect_'`)
244
+ <<<<<<< HEAD
243
245
  - `connectionTimeout` (optional): Connection timeout in ms (default: `300000` = 5 minutes)
244
246
  - `transactionTimeout` (optional): Transaction timeout in ms (default: `300000` = 5 minutes)
245
247
  - `skipCanOpenURLCheck` (optional): Skip canOpenURL check (default: `true` for Android compatibility)
@@ -284,7 +286,6 @@ const signed = await ton.signData('Hello, TON!', '1.0');
284
286
  ##### `disconnect(): Promise<void>`
285
287
 
286
288
  Disconnect from wallet.
287
-
288
289
  ```typescript
289
290
  await ton.disconnect();
290
291
  ```
@@ -324,6 +325,7 @@ const unsubscribe = ton.onStatusChange((status) => {
324
325
  });
325
326
  ```
326
327
 
328
+ <<<<<<< HEAD
327
329
  ##### `getNetwork(): Network`
328
330
 
329
331
  Get current network (mainnet or testnet).
@@ -443,6 +445,20 @@ ton.removeAllListeners(); // Remove all listeners
443
445
  - iOS device or simulator
444
446
  - Web browsers (for wallets with web support like Tonkeeper Web)
445
447
 
448
+ ## Platform Support
449
+
450
+ - ✅ **Android**: Full support via Expo or React Native CLI
451
+ - ✅ **iOS**: Full support via Expo or React Native CLI
452
+ - ⚠️ **Web**: Deep links are not supported. The SDK will throw a clear error message if you try to use it in a web browser.
453
+
454
+ **Why?** The `tonconnect://` protocol is a custom URI scheme that requires a mobile app handler. Web browsers cannot handle these custom protocols.
455
+
456
+ **Testing**: To test wallet connections, use:
457
+ - Android device or emulator
458
+ - iOS device or simulator
459
+ - Not web browsers
460
+ >>>>>>> af0bd46f78c13fb8e9799027e48d4fa228a49e3c
461
+
446
462
  ## Configuration
447
463
 
448
464
  ### Expo Setup
@@ -510,13 +526,13 @@ The manifest URL must be accessible via HTTPS.
510
526
 
511
527
  ## Supported Wallets
512
528
 
529
+ <<<<<<< HEAD
513
530
  - **Tonkeeper** - Full support (iOS, Android, Web)
514
531
  - **MyTonWallet** - Full support (iOS, Android, Web)
515
532
  - **Tonhub** - Full support (iOS, Android)
516
533
  - **Wallet in Telegram** - Full support (iOS, Android)
517
534
 
518
535
  **Note**: Wallet icons are automatically loaded from official sources. If an icon fails to load, a placeholder with the wallet's initial is shown.
519
-
520
536
  ## Migration from @tonconnect/ui-react
521
537
 
522
538
  This SDK is a drop-in replacement for `@tonconnect/ui-react` in React Native/Expo environments.
@@ -597,6 +613,7 @@ MIT
597
613
  For issues and questions:
598
614
  - GitHub Issues: [https://github.com/blaziumdev/ton-connect-mobile/issues](https://github.com/blaziumdev/ton-connect-mobile/issues)
599
615
 
616
+ <<<<<<< HEAD
600
617
  ## New Features in v1.2.3
601
618
 
602
619
  ### 🌐 Network Switching
@@ -845,7 +862,6 @@ try {
845
862
  - ✅ **IMPROVED**: All wallets shown on web platform (with availability status)
846
863
  - ✅ **IMPROVED**: Chain ID automatically updates when network changes
847
864
  - ✅ **FIXED**: Tonkeeper now correctly shows as available on web
848
- - ✅ **FIXED**: All Turkish comments translated to English
849
865
 
850
866
  ### v1.2.0
851
867
  - ✅ **NEW**: Beautiful wallet selection modal component
@@ -857,6 +873,7 @@ try {
857
873
  - ✅ Enhanced logging and debugging
858
874
  - ✅ Better TypeScript types
859
875
 
876
+
860
877
  ### v1.1.5
861
878
  - ✅ Full `@tonconnect/ui-react` compatibility
862
879
  - ✅ React integration layer with hooks and components
@@ -35,9 +35,9 @@ exports.SUPPORTED_WALLETS = [
35
35
  {
36
36
  name: 'Wallet in Telegram',
37
37
  appName: 'Wallet',
38
- universalLink: 'https://wallet.tonapi.io/ton-connect',
38
+ universalLink: 'https://wallet.tg/ton-connect',
39
39
  deepLink: 'tg://',
40
- iconUrl: 'https://wallet.tonapi.io/icon.png',
40
+ iconUrl: 'https://wallet.tg/images/logo-288.png',
41
41
  platforms: ['ios', 'android'],
42
42
  preferredReturnStrategy: 'post_redirect',
43
43
  requiresReturnScheme: true, // Telegram Wallet requires explicit returnScheme
@@ -22,6 +22,7 @@ function WalletSelectionModal({ visible, onClose, wallets: customWallets, style,
22
22
  const [wallets, setWallets] = react_1.default.useState([]);
23
23
  const [connectingWallet, setConnectingWallet] = react_1.default.useState(null);
24
24
  const [walletAvailability, setWalletAvailability] = react_1.default.useState({});
25
+ const [imageErrors, setImageErrors] = react_1.default.useState({});
25
26
  // Load wallets and check availability
26
27
  react_1.default.useEffect(() => {
27
28
  const loadWallets = async () => {
@@ -95,13 +96,17 @@ function WalletSelectionModal({ visible, onClose, wallets: customWallets, style,
95
96
  react_1.default.createElement(react_native_1.Text, { style: styles.emptyStateSubtext }, "Please install a TON wallet app to continue"))) : (wallets.map((wallet) => {
96
97
  const isConnecting = connectingWallet === wallet.name;
97
98
  const isAvailable = walletAvailability[wallet.name] !== false;
99
+ const imageError = imageErrors[wallet.name] || false;
98
100
  return (react_1.default.createElement(react_native_1.TouchableOpacity, { key: wallet.name, style: [
99
101
  styles.walletCard,
100
102
  !isAvailable && styles.walletCardUnavailable,
101
103
  isConnecting && styles.walletCardConnecting,
102
104
  ], onPress: () => isAvailable && !isConnecting && handleSelectWallet(wallet), disabled: !isAvailable || isConnecting },
103
- react_1.default.createElement(react_native_1.View, { style: styles.walletIconContainer }, wallet.iconUrl && react_native_1.Platform.OS !== 'web' ? (react_1.default.createElement(react_native_1.Image, { source: { uri: wallet.iconUrl }, style: styles.walletIcon, onError: () => {
104
- // Fallback to placeholder on error
105
+ react_1.default.createElement(react_native_1.View, { style: styles.walletIconContainer }, wallet.iconUrl && !imageError ? (react_1.default.createElement(react_native_1.Image, { source: { uri: wallet.iconUrl }, style: styles.walletIcon, onError: (error) => {
106
+ console.log(`[WalletSelectionModal] Failed to load image for ${wallet.name}:`, wallet.iconUrl, error);
107
+ setImageErrors((prev) => ({ ...prev, [wallet.name]: true }));
108
+ }, onLoad: () => {
109
+ console.log(`[WalletSelectionModal] Successfully loaded image for ${wallet.name}:`, wallet.iconUrl);
105
110
  }, resizeMode: "cover" })) : (react_1.default.createElement(react_native_1.View, { style: styles.walletIconPlaceholder },
106
111
  react_1.default.createElement(react_native_1.Text, { style: styles.walletIconText }, wallet.name.charAt(0).toUpperCase())))),
107
112
  react_1.default.createElement(react_native_1.Text, { style: styles.walletName, numberOfLines: 1 }, wallet.name),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazium/ton-connect-mobile",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Production-ready TON Connect Mobile SDK for React Native and Expo. Implements the real TonConnect protocol for mobile applications using deep links and callbacks.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -49,9 +49,9 @@ export const SUPPORTED_WALLETS: WalletDefinition[] = [
49
49
  {
50
50
  name: 'Wallet in Telegram',
51
51
  appName: 'Wallet',
52
- universalLink: 'https://wallet.tonapi.io/ton-connect',
52
+ universalLink: 'https://wallet.tg/ton-connect',
53
53
  deepLink: 'tg://',
54
- iconUrl: 'https://wallet.tonapi.io/icon.png',
54
+ iconUrl: 'https://wallet.tg/images/logo-288.png',
55
55
  platforms: ['ios', 'android'],
56
56
  preferredReturnStrategy: 'post_redirect',
57
57
  requiresReturnScheme: true, // Telegram Wallet requires explicit returnScheme
@@ -45,6 +45,7 @@ export function WalletSelectionModal({
45
45
  const [wallets, setWallets] = React.useState<WalletDefinition[]>([]);
46
46
  const [connectingWallet, setConnectingWallet] = React.useState<string | null>(null);
47
47
  const [walletAvailability, setWalletAvailability] = React.useState<Record<string, boolean>>({});
48
+ const [imageErrors, setImageErrors] = React.useState<Record<string, boolean>>({});
48
49
 
49
50
  // Load wallets and check availability
50
51
  React.useEffect(() => {
@@ -147,6 +148,7 @@ export function WalletSelectionModal({
147
148
  wallets.map((wallet) => {
148
149
  const isConnecting = connectingWallet === wallet.name;
149
150
  const isAvailable = walletAvailability[wallet.name] !== false;
151
+ const imageError = imageErrors[wallet.name] || false;
150
152
  return (
151
153
  <TouchableOpacity
152
154
  key={wallet.name}
@@ -159,12 +161,16 @@ export function WalletSelectionModal({
159
161
  disabled={!isAvailable || isConnecting}
160
162
  >
161
163
  <View style={styles.walletIconContainer}>
162
- {wallet.iconUrl && Platform.OS !== 'web' ? (
164
+ {wallet.iconUrl && !imageError ? (
163
165
  <Image
164
166
  source={{ uri: wallet.iconUrl }}
165
167
  style={styles.walletIcon}
166
- onError={() => {
167
- // Fallback to placeholder on error
168
+ onError={(error) => {
169
+ console.log(`[WalletSelectionModal] Failed to load image for ${wallet.name}:`, wallet.iconUrl, error);
170
+ setImageErrors((prev) => ({ ...prev, [wallet.name]: true }));
171
+ }}
172
+ onLoad={() => {
173
+ console.log(`[WalletSelectionModal] Successfully loaded image for ${wallet.name}:`, wallet.iconUrl);
168
174
  }}
169
175
  resizeMode="cover"
170
176
  />