zigap-utils 0.0.27 → 0.0.28
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 +29 -25
- package/dist/components/AddressProvideQR/AddressProvideQR.d.ts +1 -1
- package/dist/components/AddressProvideQR/AddressProvideQR.types.d.ts +3 -1
- package/dist/components/LoginQR/LoginQR.d.ts +1 -1
- package/dist/components/LoginQR/LoginQR.types.d.ts +4 -1
- package/dist/index.cjs.js +10 -10
- package/dist/index.es.js +770 -755
- package/dist/util/qrService.d.ts +1 -1
- package/dist/util/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,10 +20,12 @@ const App = () => {
|
|
|
20
20
|
<div>
|
|
21
21
|
<LoginQR
|
|
22
22
|
dapp='Mintus'
|
|
23
|
-
|
|
23
|
+
availableNetworks={['xphere']}
|
|
24
|
+
isShowLogo={true}
|
|
25
|
+
logoSize={25}
|
|
24
26
|
validTime={10}
|
|
25
27
|
sigMessage="hello world"
|
|
26
|
-
onReceive={({ isSuccess, address })=>{
|
|
28
|
+
onReceive={({ isSuccess, address, network }) => {
|
|
27
29
|
if(isSuccess) {
|
|
28
30
|
// something to do after login
|
|
29
31
|
}
|
|
@@ -40,31 +42,33 @@ const App = () => {
|
|
|
40
42
|
|
|
41
43
|
### `LoginQR` props
|
|
42
44
|
|
|
43
|
-
| prop
|
|
44
|
-
|
|
|
45
|
-
| `dapp`
|
|
46
|
-
| `
|
|
47
|
-
| `sigMessage` |
|
|
48
|
-
| `validTime`
|
|
49
|
-
| `onReceive`
|
|
50
|
-
| `size`
|
|
51
|
-
| `bgColor`
|
|
52
|
-
| `fgColor`
|
|
53
|
-
| `style`
|
|
54
|
-
| `isShowLogo` |
|
|
45
|
+
| prop | required | type | default value | description |
|
|
46
|
+
| --- | :-: | --- | --- | --- |
|
|
47
|
+
| `dapp` | true | string | | Name of the dapp to use |
|
|
48
|
+
| `availableNetworks` | true | string[] | | The main network you want to access |
|
|
49
|
+
| `sigMessage` | true | string | | Messages signed to verify the identity of the user |
|
|
50
|
+
| `validTime` | true | number | | QR code valid time(minutes) |
|
|
51
|
+
| `onReceive` | true | (value) => void | | Function called after login request |
|
|
52
|
+
| `size` | false | number | 128 | canvas width |
|
|
53
|
+
| `bgColor` | false | string | #fff | background color |
|
|
54
|
+
| `fgColor` | false | string | #000 | foreground color |
|
|
55
|
+
| `style` | false | CSSProperties | | custom css style |
|
|
56
|
+
| `isShowLogo` | false | boolean | false | Zigap logo in the middle of the QR code |
|
|
57
|
+
| `logoSize` | false | number | 30 | logo width & height |
|
|
55
58
|
|
|
56
59
|
<br>
|
|
57
60
|
|
|
58
61
|
### `AddressProvideQR` props
|
|
59
62
|
|
|
60
|
-
| prop
|
|
61
|
-
|
|
|
62
|
-
| `dapp`
|
|
63
|
-
| `
|
|
64
|
-
| `validTime`
|
|
65
|
-
| `onReceive`
|
|
66
|
-
| `size`
|
|
67
|
-
| `bgColor`
|
|
68
|
-
| `fgColor`
|
|
69
|
-
| `style`
|
|
70
|
-
| `isShowLogo`
|
|
63
|
+
| prop | required | type | default value | description |
|
|
64
|
+
| ------------------- | :------: | --------------- | ------------- | --------------------------------------- |
|
|
65
|
+
| `dapp` | true | string | | Name of the dapp to use |
|
|
66
|
+
| `availableNetworks` | true | string[] | | The main network you want to access |
|
|
67
|
+
| `validTime` | true | number | | QR code valid time(minutes) |
|
|
68
|
+
| `onReceive` | true | (value) => void | | Function called after login request |
|
|
69
|
+
| `size` | false | number | 128 | canvas width |
|
|
70
|
+
| `bgColor` | false | string | #fff | background color |
|
|
71
|
+
| `fgColor` | false | string | #000 | foreground color |
|
|
72
|
+
| `style` | false | CSSProperties | | custom css style |
|
|
73
|
+
| `isShowLogo` | false | boolean | false | Zigap logo in the middle of the QR code |
|
|
74
|
+
| `logoSize` | false | number | 30 | logo width & height |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AddressProvideQRProps } from './AddressProvideQR.types';
|
|
2
2
|
|
|
3
|
-
declare const AddressProvideQR: ({
|
|
3
|
+
declare const AddressProvideQR: ({ availableNetworks, dapp, url, validTime, onReceive, isShowLogo, logoSize, ...props }: AddressProvideQRProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default AddressProvideQR;
|
|
@@ -3,10 +3,12 @@ import { CommonStyleType } from 'src/components/LoginQR/LoginQR.types';
|
|
|
3
3
|
export type AddressProvideResultType = {
|
|
4
4
|
isSuccess: boolean;
|
|
5
5
|
address?: string;
|
|
6
|
+
network?: string;
|
|
6
7
|
};
|
|
7
8
|
export type AddressProvideQRProps = {
|
|
8
|
-
|
|
9
|
+
availableNetworks: string[];
|
|
9
10
|
dapp: string;
|
|
11
|
+
url: string;
|
|
10
12
|
validTime: number;
|
|
11
13
|
onReceive: (result: AddressProvideResultType) => void;
|
|
12
14
|
} & CommonStyleType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LoginQRProps } from './LoginQR.types';
|
|
2
2
|
|
|
3
|
-
declare const LoginQR: ({
|
|
3
|
+
declare const LoginQR: ({ availableNetworks, dapp, url, sigMessage, validTime, onReceive, isShowLogo, logoSize, ...props }: LoginQRProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default LoginQR;
|
|
@@ -6,14 +6,17 @@ export type CommonStyleType = {
|
|
|
6
6
|
fgColor?: string;
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
isShowLogo?: boolean;
|
|
9
|
+
logoSize?: number;
|
|
9
10
|
};
|
|
10
11
|
export type LoginResultType = {
|
|
11
12
|
isSuccess: boolean;
|
|
12
13
|
address?: string;
|
|
14
|
+
network?: string;
|
|
13
15
|
};
|
|
14
16
|
export type LoginQRProps = {
|
|
15
|
-
|
|
17
|
+
availableNetworks: string[];
|
|
16
18
|
dapp: string;
|
|
19
|
+
url: string;
|
|
17
20
|
sigMessage: string;
|
|
18
21
|
validTime: number;
|
|
19
22
|
onReceive: (result: LoginResultType) => void;
|