@depay/widgets 8.0.3 → 8.0.4

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
@@ -364,9 +364,7 @@ Those values are supposed to be set by your backend not the widget nor the front
364
364
 
365
365
  Make sure you read the [Payment Tracking API](https://depay.com/documentation/api#payments) for further details on how to integrate payment tracking.
366
366
 
367
- Payment tracking requests will be attempted up to 3 times by the widget and will display "Payment tracking failed!" to the user if the widget was not able to start payment tracking via the given endpoint after 3 attempts.
368
-
369
- A failed payment tracking will also call the [error callback](#error) with `{code: "TRACKING_FAILED"}`.
367
+ Payment tracking requests will be attempted indefinitely. After 2 minutes a warning dialog will be presented to users asking them to ensure an internet connection so that the payment tracking can be performed.
370
368
 
371
369
  ##### Asynchronous Validation
372
370
 
@@ -1796,7 +1794,18 @@ BODY
1796
1794
  }
1797
1795
  ```
1798
1796
 
1799
- The `/login` endpoint needs to recover the address for `message` and `signature` and needs to return it in the response:
1797
+ The `/login` endpoint needs to recover the address for `message` and `signature`.
1798
+
1799
+ e.g. your backend could use node + ethers.js to recover the signature
1800
+
1801
+ ```javascript
1802
+ const ethers = require('ethers')
1803
+ const hashedMessage = ethers.utils.hashMessage(inputs.message)
1804
+ const address = ethers.utils.recoverAddress(hashedMessage, inputs.signature)
1805
+ return address
1806
+ ```
1807
+
1808
+ make sure you return the recovered address back to the widget:
1800
1809
 
1801
1810
  ```
1802
1811
  POST /login
@@ -1804,6 +1813,7 @@ RESPONSE
1804
1813
  "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
1805
1814
  ```
1806
1815
 
1816
+
1807
1817
  Which will resolve the `DePayWidgets.Login` request to the resolved account:
1808
1818
 
1809
1819
  ```javascript