@tonconnect/ui 2.0.13-beta.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 +34 -2
- package/dist/tonconnect-ui.min.js +217 -217
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,6 +51,25 @@ const tonConnectUI = new TonConnectUI({
|
|
|
51
51
|
});
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
You can also specify required wallet features to filter wallets that will be shown in the connect wallet modal:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { TonConnectUI } from '@tonconnect/ui'
|
|
58
|
+
|
|
59
|
+
const tonConnectUI = new TonConnectUI({
|
|
60
|
+
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
|
|
61
|
+
buttonRootId: '<YOUR_CONNECT_BUTTON_ANCHOR_ID>',
|
|
62
|
+
walletsRequiredFeatures: {
|
|
63
|
+
sendTransaction: {
|
|
64
|
+
minMessages: 2, // Wallet must support at least 2 messages
|
|
65
|
+
extraCurrencyRequired: true // Wallet must support extra currency
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This will filter out wallets that don't support sending multiple messages or don't support extra currencies.
|
|
72
|
+
|
|
54
73
|
See all available options:
|
|
55
74
|
|
|
56
75
|
[TonConnectUiOptionsWithManifest](https://ton-connect.github.io/sdk/interfaces/_tonconnect_ui.TonConnectUiOptionsWithManifest.html)
|
|
@@ -236,7 +255,6 @@ await tonConnectUI.disconnect();
|
|
|
236
255
|
## Send transaction
|
|
237
256
|
Wallet must be connected when you call `sendTransaction`. Otherwise, an error will be thrown.
|
|
238
257
|
|
|
239
|
-
|
|
240
258
|
```ts
|
|
241
259
|
const transaction = {
|
|
242
260
|
validUntil: Math.floor(Date.now() / 1000) + 60, // 60 sec
|
|
@@ -252,7 +270,21 @@ const transaction = {
|
|
|
252
270
|
// payload: "base64bocblahblahblah==" // just for instance. Replace with your transaction payload or remove
|
|
253
271
|
}
|
|
254
272
|
]
|
|
255
|
-
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// you can also include extra currencies in your transaction
|
|
276
|
+
const transactionWithExtraCurrency = {
|
|
277
|
+
validUntil: Math.floor(Date.now() / 1000) + 60,
|
|
278
|
+
messages: [
|
|
279
|
+
{
|
|
280
|
+
address: "EQBBJBB3HagsujBqVfqeDUPJ0kXjgTPLWPFFffuNXNiJL0aA",
|
|
281
|
+
// Specify the extra currency
|
|
282
|
+
extraCurrency: {
|
|
283
|
+
100: "10000000"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
};
|
|
256
288
|
|
|
257
289
|
try {
|
|
258
290
|
const result = await tonConnectUI.sendTransaction(transaction);
|