@tonconnect/ui-react 2.1.0 → 2.1.1-beta.0
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 +32 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,6 +40,24 @@ export function App() {
|
|
|
40
40
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
You can also specify required wallet features to filter wallets that will be displayed in the connect wallet modal:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<TonConnectUIProvider
|
|
47
|
+
manifestUrl="https://<YOUR_APP_URL>/tonconnect-manifest.json"
|
|
48
|
+
walletsRequiredFeatures={{
|
|
49
|
+
sendTransaction: {
|
|
50
|
+
minMessages: 2, // Wallet must support at least 2 messages
|
|
51
|
+
extraCurrencyRequired: true // Wallet must support extra currency
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
{ /* Your app */ }
|
|
56
|
+
</TonConnectUIProvider>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This will only display wallets that support sending at least 2 messages and support extra currencies in transactions.
|
|
60
|
+
|
|
43
61
|
## Add TonConnect Button
|
|
44
62
|
TonConnect Button is universal UI component for initializing connection. After wallet is connected it transforms to a wallet menu.
|
|
45
63
|
It is recommended to place it in the top right corner of your app.
|
|
@@ -161,6 +179,20 @@ export const Settings = () => {
|
|
|
161
179
|
]
|
|
162
180
|
}
|
|
163
181
|
|
|
182
|
+
// Example with extra currency support
|
|
183
|
+
const transactionWithExtraCurrency = {
|
|
184
|
+
validUntil: Math.floor(Date.now() / 1000) + 60,
|
|
185
|
+
messages: [
|
|
186
|
+
{
|
|
187
|
+
address: "EQBBJBB3HagsujBqVfqeDUPJ0kXjgTPLWPFFffuNXNiJL0aA",
|
|
188
|
+
// Specify the extra currency
|
|
189
|
+
extraCurrency: {
|
|
190
|
+
100: "10000000"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
|
|
164
196
|
return (
|
|
165
197
|
<div>
|
|
166
198
|
<button onClick={() => tonConnectUI.sendTransaction(myTransaction)}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonconnect/ui-react",
|
|
3
|
-
"version": "2.1.0",
|
|
3
|
+
"version": "2.1.1-beta.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite",
|
|
6
6
|
"build": "tsc && vite build"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vite-plugin-dts": "^1.7.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@tonconnect/ui": "2.1.0"
|
|
55
|
+
"@tonconnect/ui": "2.1.1-beta.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": ">=17.0.0",
|