zigap-utils 0.0.27 → 0.0.29

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,10 +20,13 @@ const App = () => {
20
20
  <div>
21
21
  <LoginQR
22
22
  dapp='Mintus'
23
+ url='http://Xphere.mintus.io'
24
+ availableNetworks={['xphere']}
23
25
  isShowLogo={false}
26
+ logoSize={25}
24
27
  validTime={10}
25
28
  sigMessage="hello world"
26
- onReceive={({ isSuccess, address })=>{
29
+ onReceive={({ isSuccess, address, network }) => {
27
30
  if(isSuccess) {
28
31
  // something to do after login
29
32
  }
@@ -40,31 +43,35 @@ const App = () => {
40
43
 
41
44
  ### `LoginQR` props
42
45
 
43
- | prop | required | type | default value | description |
44
- | ------------ | :------: | --------------- | ------------- | -------------------------------------------------- |
45
- | `dapp` | true | string | | Name of the dapp to use |
46
- | `network` | true | string | | The main network you want to access |
47
- | `sigMessage` | true | string | | Messages signed to verify the identity of the user |
48
- | `validTime` | true | number | | QR code valid time(minutes) |
49
- | `onReceive` | true | (value) => void | | Function called after login request |
50
- | `size` | false | number | 128 | canvas width |
51
- | `bgColor` | false | string | #fff | background color |
52
- | `fgColor` | false | string | #000 | foreground color |
53
- | `style` | false | CSSProperties | | custom css style |
54
- | `isShowLogo` | false | boolean | true | Zigap logo in the middle of the QR code |
46
+ | prop | required | type | default value | description |
47
+ | --- | :-: | --- | --- | --- |
48
+ | `dapp` | true | string | | Name of the dapp to use |
49
+ | `url` | true | string | | The url of dapp to connect |
50
+ | `availableNetworks` | true | string[] | | The main network you want to access |
51
+ | `sigMessage` | true | string | | Messages signed to verify the identity of the user |
52
+ | `validTime` | true | number | | QR code valid time(minutes) |
53
+ | `onReceive` | true | (value) => void | | Function called after login request |
54
+ | `size` | false | number | 128 | canvas width |
55
+ | `bgColor` | false | string | #fff | background color |
56
+ | `fgColor` | false | string | #000 | foreground color |
57
+ | `style` | false | CSSProperties | | custom css style |
58
+ | `isShowLogo` | false | boolean | false | Zigap logo in the middle of the QR code |
59
+ | `logoSize` | false | number | 30 | logo width & height |
55
60
 
56
61
  <br>
57
62
 
58
63
  ### `AddressProvideQR` props
59
64
 
60
- | prop | required | type | default value | description |
61
- | ------------ | :------: | --------------- | ------------- | --------------------------------------- |
62
- | `dapp` | true | string | | Name of the dapp to use |
63
- | `network` | true | string | | The main network you want to access |
64
- | `validTime` | true | number | | QR code valid time(minutes) |
65
- | `onReceive` | true | (value) => void | | Function called after login request |
66
- | `size` | false | number | 128 | canvas width |
67
- | `bgColor` | false | string | #fff | background color |
68
- | `fgColor` | false | string | #000 | foreground color |
69
- | `style` | false | CSSProperties | | custom css style |
70
- | `isShowLogo` | false | boolean | true | Zigap logo in the middle of the QR code |
65
+ | prop | required | type | default value | description |
66
+ | ------------------- | :------: | --------------- | ------------- | --------------------------------------- |
67
+ | `dapp` | true | string | | Name of the dapp to use |
68
+ | `url` | true | string | | The url of dapp to connect |
69
+ | `availableNetworks` | true | string[] | | The main network you want to access |
70
+ | `validTime` | true | number | | QR code valid time(minutes) |
71
+ | `onReceive` | true | (value) => void | | Function called after login request |
72
+ | `size` | false | number | 128 | canvas width |
73
+ | `bgColor` | false | string | #fff | background color |
74
+ | `fgColor` | false | string | #000 | foreground color |
75
+ | `style` | false | CSSProperties | | custom css style |
76
+ | `isShowLogo` | false | boolean | false | Zigap logo in the middle of the QR code |
77
+ | `logoSize` | false | number | 30 | logo width & height |
@@ -1,4 +1,4 @@
1
1
  import { AddressProvideQRProps } from './AddressProvideQR.types';
2
2
 
3
- declare const AddressProvideQR: ({ network, 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,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
- network: string;
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: ({ network, 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,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
- network: string;
17
+ availableNetworks: string[];
16
18
  dapp: string;
19
+ url: string;
17
20
  sigMessage: string;
18
21
  validTime: number;
19
22
  onReceive: (result: LoginResultType) => void;