@depay/widgets 9.4.2 → 10.0.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 +2 -2
- package/dist/esm/index.bundle.js +1 -1
- package/dist/esm/index.js +13 -3
- package/dist/umd/index.bundle.js +1 -1
- package/dist/umd/index.js +13 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1778,7 +1778,7 @@ Returns `account` if successfully signed and recovered log in message.
|
|
|
1778
1778
|
|
|
1779
1779
|
```javascript
|
|
1780
1780
|
let message = "Sign to login"
|
|
1781
|
-
let account = await DePayWidgets.Login({ message })
|
|
1781
|
+
let { account, wallet } = await DePayWidgets.Login({ message })
|
|
1782
1782
|
```
|
|
1783
1783
|
|
|
1784
1784
|
Connects wallet and instructs connected wallet to sign `message`, afterwards sends `signature` and `message` to `POST /login` (or `endpoint` if defined):
|
|
@@ -1848,7 +1848,7 @@ DePayWidgets.Login({ message, recover: ({ message, signature })=>{
|
|
|
1848
1848
|
In case you want to include the wallet account identifier in the to be signed message, pass a callback function returning a string to `message`:
|
|
1849
1849
|
|
|
1850
1850
|
```javascript
|
|
1851
|
-
let account = await DePayWidgets.Login({
|
|
1851
|
+
let { account } = await DePayWidgets.Login({
|
|
1852
1852
|
message: (account)=>`Click to log in to DePay and to accept DePay's Terms of Service: https://depay.com/legal/terms\n${dateTime}\n${account}`
|
|
1853
1853
|
})
|
|
1854
1854
|
console.log("Logged in via signature", account)
|