@tonconnect/ui-react 0.0.7 → 0.0.8
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 +8 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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
|
|