zigap-utils 0.0.489 → 0.0.492
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 +9 -7
- package/dist/index.cjs.js +10 -10
- package/dist/index.es.js +303 -312
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# zigap-utils
|
|
2
2
|
|
|
3
|
-
It is a library that collects utils that help communicate between dapp and zigap.
|
|
3
|
+
It is a library that collects utils that help communicate between dapp and zigap.<br /> You can find out more at https://seoul-labs.gitbook.io/zigap-utils
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
npm i zigap-utils
|
|
8
|
+
npm i zigap-utils
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -24,11 +24,12 @@ const App = () => {
|
|
|
24
24
|
availableNetworks={['xphere']}
|
|
25
25
|
isShowLogo={false}
|
|
26
26
|
logoSize={25}
|
|
27
|
-
validTime={
|
|
27
|
+
validTime={600}
|
|
28
28
|
sigMessage="hello world"
|
|
29
|
-
|
|
29
|
+
expire={{type: 'EXTEND', seconds: 3600}}
|
|
30
|
+
onReceive={({ isSuccess }) => {
|
|
30
31
|
if(isSuccess) {
|
|
31
|
-
// something to do after login
|
|
32
|
+
// something to do after login (refresh page...)
|
|
32
33
|
}
|
|
33
34
|
}}
|
|
34
35
|
/>
|
|
@@ -49,8 +50,9 @@ const App = () => {
|
|
|
49
50
|
| `url` | true | string | | The url of dapp to connect |
|
|
50
51
|
| `availableNetworks` | true | string[] | | List of connectable networks in dapp |
|
|
51
52
|
| `sigMessage` | true | string | | Messages signed to verify the identity of the user |
|
|
52
|
-
| `
|
|
53
|
+
| `validSeconds` | true | number | | QR code valid time(minutes) |
|
|
53
54
|
| `onReceive` | true | (value) => void | | Function called after login request |
|
|
55
|
+
| `expire` | true | {type: "NONE / FIX / EXTEND", seconds: number} | | time and type for user login to expire |
|
|
54
56
|
| `size` | false | number | 128 | canvas width |
|
|
55
57
|
| `bgColor` | false | string | #fff | background color |
|
|
56
58
|
| `fgColor` | false | string | #000 | foreground color |
|
|
@@ -67,7 +69,7 @@ const App = () => {
|
|
|
67
69
|
| `dapp` | true | string | | Name of the dapp to use |
|
|
68
70
|
| `url` | true | string | | The url of dapp to connect |
|
|
69
71
|
| `availableNetworks` | true | string[] | | List of connectable networks in dapp |
|
|
70
|
-
| `
|
|
72
|
+
| `validSeconds` | true | number | | QR code valid time(seconds) |
|
|
71
73
|
| `onReceive` | true | (value) => void | | Function called after login request |
|
|
72
74
|
| `size` | false | number | 128 | canvas width |
|
|
73
75
|
| `bgColor` | false | string | #fff | background color |
|