@tonconnect/ui-react 0.0.7 → 0.0.9
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
CHANGED
|
@@ -149,7 +149,7 @@ export const Settings = () => {
|
|
|
149
149
|
## Add connect request parameters (ton_proof)
|
|
150
150
|
Pass `getConnectParameters` async function to the `TonConnectUIProvider`. This callback will be called after `connectWallet` method call or `Connect Button` click before wallets list render.
|
|
151
151
|
|
|
152
|
-
In other words, if `getConnectParameters` is passed, there will be
|
|
152
|
+
In other words, if `getConnectParameters` is passed, there will be following steps:
|
|
153
153
|
1. User clicks to the 'Connect Wallet' button, or `connectWallet` method is called
|
|
154
154
|
2. Wallets modal opens
|
|
155
155
|
3. Loader renders in the center of the modal
|
|
@@ -179,14 +179,15 @@ const tonProofPayloadPromise = getTonProofFromYourBackend(); // will be executed
|
|
|
179
179
|
You can find `ton_proof` result in the `wallet` object when wallet will be connected:
|
|
180
180
|
|
|
181
181
|
```ts
|
|
182
|
-
import {
|
|
182
|
+
import {useTonConnectUI} from "@tonconnect/ui-react";
|
|
183
183
|
|
|
184
|
-
const
|
|
184
|
+
const [tonConnectUI] = useTonConnectUI();
|
|
185
185
|
|
|
186
|
-
useEffect(() =>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
186
|
+
useEffect(() =>
|
|
187
|
+
tonConnectUI.onStatusChange(wallet => {
|
|
188
|
+
if (wallet.connectItems?.tonProof && 'proof' in wallet.connectItems.tonProof) {
|
|
189
|
+
checkProofInYourBackend(wallet.connectItems.tonProof.proof, wallet.account);
|
|
190
|
+
}
|
|
191
|
+
}), []);
|
|
191
192
|
```
|
|
192
193
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionConfiguration, Locales,
|
|
1
|
+
import { ActionConfiguration, Locales, TonConnectUI, UIPreferences, WalletsListConfiguration } from '@tonconnect/ui';
|
|
2
2
|
import type { ConnectAdditionalRequest, ITonConnect } from '@tonconnect/sdk';
|
|
3
3
|
export declare const TonConnectUIContext: import("react").Context<TonConnectUI | null>;
|
|
4
4
|
export declare type TonConnectUIProviderProps = {
|
|
@@ -23,11 +23,6 @@ export interface TonConnectUIProviderPropsBase {
|
|
|
23
23
|
* @default true.
|
|
24
24
|
*/
|
|
25
25
|
restoreConnection: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Color theme for the UI elements.
|
|
28
|
-
* @default SYSTEM theme.
|
|
29
|
-
*/
|
|
30
|
-
theme: Theme;
|
|
31
26
|
/**
|
|
32
27
|
* Language for the phrases it the UI elements.
|
|
33
28
|
* @default system
|