@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.
Files changed (2) hide show
  1. package/README.md +8 -7
  2. 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 {useEffect} from "react";
182
+ import {useTonConnectUI} from "@tonconnect/ui-react";
183
183
 
184
- const wallet = useTonWallet();
184
+ const [tonConnectUI] = useTonConnectUI();
185
185
 
186
- useEffect(() => {
187
- if (wallet && wallet.connectItems?.tonProof && 'proof' in wallet.connectItems.tonProof) {
188
- checkProofInYourBackend(wallet.connectItems.tonProof.proof);
189
- }
190
- }, [wallet]);
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonconnect/ui-react",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ton-connect/sdk.git"