Skip to content

Commit 3ab844f

Browse files
committed
docs(ui-react): add extra currency and wallets required features
(cherry picked from commit 6688b36)
1 parent 18f779a commit 3ab844f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

packages/ui-react/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ export function App() {
4040

4141
```
4242

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+
4361
## Add TonConnect Button
4462
TonConnect Button is universal UI component for initializing connection. After wallet is connected it transforms to a wallet menu.
4563
It is recommended to place it in the top right corner of your app.
@@ -161,6 +179,20 @@ export const Settings = () => {
161179
]
162180
}
163181

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+
164196
return (
165197
<div>
166198
<button onClick={() => tonConnectUI.sendTransaction(myTransaction)}>

0 commit comments

Comments
 (0)