@blazium/ton-connect-mobile 1.1.0 → 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.
- package/dist/core/protocol.js +7 -2
- package/dist/types/index.d.ts +1 -3
- package/package.json +1 -1
- package/src/core/protocol.ts +7 -2
- package/src/types/index.ts +3 -3
package/dist/core/protocol.js
CHANGED
|
@@ -106,11 +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
|
-
returnScheme, // CRITICAL: Wallet needs to know the callback scheme for mobile apps
|
|
113
115
|
returnStrategy: 'back',
|
|
116
|
+
// NOTE: returnScheme is NOT in the official TON Connect protocol
|
|
117
|
+
// Wallets should handle mobile app callbacks differently
|
|
114
118
|
};
|
|
115
119
|
const encoded = encodeBase64URL(payload);
|
|
116
120
|
// Use custom wallet universal link if provided
|
|
@@ -140,8 +144,9 @@ function buildTransactionRequest(manifestUrl, request, returnScheme, walletUnive
|
|
|
140
144
|
network: request.network,
|
|
141
145
|
from: request.from,
|
|
142
146
|
},
|
|
143
|
-
returnScheme, // CRITICAL: Wallet needs to know the callback scheme for mobile apps
|
|
144
147
|
returnStrategy: 'back',
|
|
148
|
+
// NOTE: returnScheme is NOT in the official TON Connect protocol
|
|
149
|
+
// Wallets should handle mobile app callbacks differently
|
|
145
150
|
};
|
|
146
151
|
const encoded = encodeBase64URL(payload);
|
|
147
152
|
// Use custom wallet universal link if provided
|
package/dist/types/index.d.ts
CHANGED
|
@@ -75,9 +75,7 @@ export interface ConnectionRequestPayload {
|
|
|
75
75
|
items: Array<{
|
|
76
76
|
name: 'ton_addr';
|
|
77
77
|
}>;
|
|
78
|
-
/** Return
|
|
79
|
-
returnScheme?: string;
|
|
80
|
-
/** Return strategy */
|
|
78
|
+
/** Return strategy - how wallet should return to the app */
|
|
81
79
|
returnStrategy?: 'back' | 'none';
|
|
82
80
|
}
|
|
83
81
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazium/ton-connect-mobile",
|
|
3
|
-
"version": "1.1.
|
|
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",
|
package/src/core/protocol.ts
CHANGED
|
@@ -132,11 +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
|
-
returnScheme, // CRITICAL: Wallet needs to know the callback scheme for mobile apps
|
|
139
141
|
returnStrategy: 'back',
|
|
142
|
+
// NOTE: returnScheme is NOT in the official TON Connect protocol
|
|
143
|
+
// Wallets should handle mobile app callbacks differently
|
|
140
144
|
};
|
|
141
145
|
|
|
142
146
|
const encoded = encodeBase64URL(payload);
|
|
@@ -175,8 +179,9 @@ export function buildTransactionRequest(
|
|
|
175
179
|
network: request.network,
|
|
176
180
|
from: request.from,
|
|
177
181
|
},
|
|
178
|
-
returnScheme, // CRITICAL: Wallet needs to know the callback scheme for mobile apps
|
|
179
182
|
returnStrategy: 'back',
|
|
183
|
+
// NOTE: returnScheme is NOT in the official TON Connect protocol
|
|
184
|
+
// Wallets should handle mobile app callbacks differently
|
|
180
185
|
};
|
|
181
186
|
|
|
182
187
|
const encoded = encodeBase64URL(payload);
|
package/src/types/index.ts
CHANGED
|
@@ -81,10 +81,10 @@ export interface ConnectionRequestPayload {
|
|
|
81
81
|
items: Array<{
|
|
82
82
|
name: 'ton_addr';
|
|
83
83
|
}>;
|
|
84
|
-
/** Return
|
|
85
|
-
returnScheme?: string;
|
|
86
|
-
/** Return strategy */
|
|
84
|
+
/** Return strategy - how wallet should return to the app */
|
|
87
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
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/**
|