@blazium/ton-connect-mobile 1.0.9 → 1.1.1

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.
@@ -106,10 +106,15 @@ function decodeBase64URL(encoded) {
106
106
  * Or custom wallet universal link
107
107
  */
108
108
  function buildConnectionRequest(manifestUrl, returnScheme, walletUniversalLink) {
109
+ // TON Connect protocol: payload should only contain manifestUrl, items, and returnStrategy
110
+ // returnScheme is NOT part of the official protocol payload
111
+ // For mobile apps, wallets should infer the callback scheme from the manifest or use a default
109
112
  const payload = {
110
113
  manifestUrl,
111
114
  items: [{ name: 'ton_addr' }],
112
115
  returnStrategy: 'back',
116
+ // NOTE: returnScheme is NOT in the official TON Connect protocol
117
+ // Wallets should handle mobile app callbacks differently
113
118
  };
114
119
  const encoded = encodeBase64URL(payload);
115
120
  // Use custom wallet universal link if provided
@@ -140,6 +145,8 @@ function buildTransactionRequest(manifestUrl, request, returnScheme, walletUnive
140
145
  from: request.from,
141
146
  },
142
147
  returnStrategy: 'back',
148
+ // NOTE: returnScheme is NOT in the official TON Connect protocol
149
+ // Wallets should handle mobile app callbacks differently
143
150
  };
144
151
  const encoded = encodeBase64URL(payload);
145
152
  // Use custom wallet universal link if provided
@@ -75,7 +75,7 @@ export interface ConnectionRequestPayload {
75
75
  items: Array<{
76
76
  name: 'ton_addr';
77
77
  }>;
78
- /** Return URL scheme */
78
+ /** Return strategy - how wallet should return to the app */
79
79
  returnStrategy?: 'back' | 'none';
80
80
  }
81
81
  /**
@@ -130,7 +130,9 @@ export interface TransactionRequestPayload {
130
130
  /** Optional from address */
131
131
  from?: string;
132
132
  };
133
- /** Return URL scheme */
133
+ /** Return URL scheme (for mobile apps) */
134
+ returnScheme?: string;
135
+ /** Return strategy */
134
136
  returnStrategy?: 'back' | 'none';
135
137
  }
136
138
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazium/ton-connect-mobile",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
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",
@@ -132,10 +132,15 @@ export function buildConnectionRequest(
132
132
  returnScheme: string,
133
133
  walletUniversalLink?: string
134
134
  ): string {
135
+ // TON Connect protocol: payload should only contain manifestUrl, items, and returnStrategy
136
+ // returnScheme is NOT part of the official protocol payload
137
+ // For mobile apps, wallets should infer the callback scheme from the manifest or use a default
135
138
  const payload: ConnectionRequestPayload = {
136
139
  manifestUrl,
137
140
  items: [{ name: 'ton_addr' }],
138
141
  returnStrategy: 'back',
142
+ // NOTE: returnScheme is NOT in the official TON Connect protocol
143
+ // Wallets should handle mobile app callbacks differently
139
144
  };
140
145
 
141
146
  const encoded = encodeBase64URL(payload);
@@ -175,6 +180,8 @@ export function buildTransactionRequest(
175
180
  from: request.from,
176
181
  },
177
182
  returnStrategy: 'back',
183
+ // NOTE: returnScheme is NOT in the official TON Connect protocol
184
+ // Wallets should handle mobile app callbacks differently
178
185
  };
179
186
 
180
187
  const encoded = encodeBase64URL(payload);
@@ -81,8 +81,10 @@ export interface ConnectionRequestPayload {
81
81
  items: Array<{
82
82
  name: 'ton_addr';
83
83
  }>;
84
- /** Return URL scheme */
84
+ /** Return strategy - how wallet should return to the app */
85
85
  returnStrategy?: 'back' | 'none';
86
+ // NOTE: returnScheme is NOT part of the official TON Connect protocol
87
+ // For mobile apps, wallets should handle callbacks based on the manifest URL
86
88
  }
87
89
 
88
90
  /**
@@ -138,7 +140,9 @@ export interface TransactionRequestPayload {
138
140
  /** Optional from address */
139
141
  from?: string;
140
142
  };
141
- /** Return URL scheme */
143
+ /** Return URL scheme (for mobile apps) */
144
+ returnScheme?: string;
145
+ /** Return strategy */
142
146
  returnStrategy?: 'back' | 'none';
143
147
  }
144
148