@tonconnect/ui 2.1.1-beta.0 → 2.2.0-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 +27 -1
- package/dist/tonconnect-ui.min.js +312 -217
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +997 -223
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +43 -4
- package/lib/index.mjs +998 -224
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -70,6 +70,26 @@ const tonConnectUI = new TonConnectUI({
|
|
|
70
70
|
|
|
71
71
|
This will filter out wallets that don't support sending multiple messages or don't support extra currencies.
|
|
72
72
|
|
|
73
|
+
You can also specify preferred wallet features to prioritize wallets that support them in the connect wallet modal. These wallets will be shown first in the list, but others will still be available:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { TonConnectUI } from '@tonconnect/ui'
|
|
77
|
+
|
|
78
|
+
const tonConnectUI = new TonConnectUI({
|
|
79
|
+
manifestUrl: 'https://<YOUR_APP_URL>/tonconnect-manifest.json',
|
|
80
|
+
buttonRootId: '<YOUR_CONNECT_BUTTON_ANCHOR_ID>',
|
|
81
|
+
walletsPreferredFeatures: {
|
|
82
|
+
sendTransaction: {
|
|
83
|
+
minMessages: 2,
|
|
84
|
+
extraCurrencyRequired: true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This will highlight wallets that support sending multiple messages and extra currencies, but won’t hide those that don’t. Use this to gently recommend more feature-rich wallets without excluding others.
|
|
91
|
+
|
|
92
|
+
|
|
73
93
|
See all available options:
|
|
74
94
|
|
|
75
95
|
[TonConnectUiOptionsWithManifest](https://ton-connect.github.io/sdk/interfaces/_tonconnect_ui.TonConnectUiOptionsWithManifest.html)
|
|
@@ -660,9 +680,12 @@ UI components:
|
|
|
660
680
|
| Wallets list modal page | `[data-tc-wallets-modal-list="true"]` | Content of the modal page with all available wallets list (desktop and mobile). |
|
|
661
681
|
| Info modal page | `[data-tc-wallets-modal-info="true"]` | Content of the modal page with "What is a wallet information". |
|
|
662
682
|
| Action modal container | `[data-tc-actions-modal-container="true"]` | Container of the modal window that opens when you call `sendTransaction` or other action. |
|
|
663
|
-
| Confirm
|
|
683
|
+
| Confirm transaction modal content | `[data-tc-confirm-modal="true"]` | Content of the modal window asking for confirmation of the action in the wallet. |
|
|
664
684
|
| "Transaction sent" modal content | `[data-tc-transaction-sent-modal="true"]` | Content of the modal window informing that the transaction was successfully sent. |
|
|
665
685
|
| "Transaction canceled" modal content | `[data-tc-transaction-canceled-modal="true"]` | Content of the modal window informing that the transaction was not sent. |
|
|
686
|
+
| Confirm sign data modal | `[data-tc-sign-data-confirm-modal="true"]` | Content of the modal window asking for confirmation of the signing data in the wallet. |
|
|
687
|
+
| "Sign data canceled" moda l | `[data-tc-notification-sign-data-cancelled="true"]` | Content of the modal window informing that the signing data was not confirmed. |
|
|
688
|
+
| "Sign data error" modal | `[data-tc-notification-sign-data-error="true"]` | Content of the modal window informing that the signing data was not confirmed due to an error. |
|
|
666
689
|
| "Connect Wallet" button | `[data-tc-connect-button="true"]` | "Connect Wallet" button element. |
|
|
667
690
|
| Wallet menu loading button | `[data-tc-connect-button-loading="true"]` | Button element which appears instead of "Connect Wallet" and dropdown menu buttons while restoring connection process |
|
|
668
691
|
| Wallet menu dropdown button | `[data-tc-dropdown-button="true"]` | Wallet menu button -- host of the dropdown wallet menu (copy address/disconnect). |
|
|
@@ -801,6 +824,9 @@ List of events:
|
|
|
801
824
|
* `transaction-sent-for-signature`: when a user sends a transaction for signature.
|
|
802
825
|
* `transaction-signed`: when a user successfully signs a transaction.
|
|
803
826
|
* `transaction-signing-failed`: when a user cancels transaction signing or there is an error during the signing process.
|
|
827
|
+
* `sign-data-request-initiated`: when a user sends data for signing.
|
|
828
|
+
* `sign-data-request-completed` when a user successfully signs data.
|
|
829
|
+
* `sign-data-request-failed`: when a user cancels data signing or there is an error during the signing process.
|
|
804
830
|
|
|
805
831
|
If you want to track user actions, you can subscribe to the window events with prefix `ton-connect-ui-`:
|
|
806
832
|
|