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