zigap-utils 0.0.1 → 0.0.2
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
|
@@ -1,30 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# zigap-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
It is a library that collects utils that help communicate between dapp and zigap.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
```
|
|
8
|
+
npm i zigap-utils --save -D
|
|
9
|
+
```
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { LoginQR } from 'zigap-utils';
|
|
15
|
+
|
|
16
|
+
const App = () => {
|
|
17
|
+
...
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div>
|
|
21
|
+
<LoginQR
|
|
22
|
+
validTime={10}
|
|
23
|
+
sigMessage="hello world"
|
|
24
|
+
onReceive={({ isSuccess, address })=>{
|
|
25
|
+
if(isSuccess) {
|
|
26
|
+
// something to do after login
|
|
27
|
+
}
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
11
34
|
|
|
12
|
-
|
|
35
|
+
<br />
|
|
13
36
|
|
|
14
|
-
|
|
37
|
+
---
|
|
15
38
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
### `LoginQR` props
|
|
40
|
+
|
|
41
|
+
| prop | required | type | default value | description |
|
|
42
|
+
| ------------ | :------: | --------------- | ------------- | -------------------------------------------------- |
|
|
43
|
+
| `sigMessage` | true | string | | Messages signed to verify the identity of the user |
|
|
44
|
+
| `validTime` | true | number | | QR code valid time(minutes) |
|
|
45
|
+
| `onReceive` | true | (value) => void | | Function called after login request |
|
|
46
|
+
| `size` | false | number | 128 | canvas width |
|
|
47
|
+
| `bgColor` | false | string | #fff | background color |
|
|
48
|
+
| `fgColor` | false | string | #000 | foreground color |
|
|
49
|
+
| `style` | false | CSSProperties | | custom css style |
|
|
50
|
+
|
|
51
|
+
<br>
|
|
52
|
+
|
|
53
|
+
### `AddressProvideQR` props
|
|
27
54
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
55
|
+
| prop | required | type | default value | description |
|
|
56
|
+
| ------------ | :------: | --------------- | ------------- | -------------------------------------------------- |
|
|
57
|
+
| `sigMessage` | true | string | | Messages signed to verify the identity of the user |
|
|
58
|
+
| `validTime` | true | number | | QR code valid time(minutes) |
|
|
59
|
+
| `onReceive` | true | (value) => void | | Function called after login request |
|
|
60
|
+
| `size` | false | number | 128 | canvas width |
|
|
61
|
+
| `bgColor` | false | string | #fff | background color |
|
|
62
|
+
| `fgColor` | false | string | #000 | foreground color |
|
|
63
|
+
| `style` | false | CSSProperties | | custom css style |
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zigap-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"author": "Seoullabs",
|
|
8
8
|
"license": "ISC",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Seoullabs-official/zigap-utils"
|
|
12
|
+
},
|
|
9
13
|
"files": [
|
|
10
14
|
"dist"
|
|
11
15
|
],
|