zigap-utils 0.0.497 → 0.0.498
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 +11 -8
- package/package.json +1 -1
- package/dist/App.d.ts +0 -2
- package/dist/components/AddressProvideQR/AddressProvideQR.d.ts +0 -4
- package/dist/components/AddressProvideQR/AddressProvideQR.types.d.ts +0 -17
- package/dist/components/AddressProvideQR/index.d.ts +0 -2
- package/dist/components/LoginQR/LoginQR.d.ts +0 -4
- package/dist/components/LoginQR/LoginQR.types.d.ts +0 -47
- package/dist/components/LoginQR/index.d.ts +0 -2
- package/dist/components/index.d.ts +0 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useZigap.d.ts +0 -14
- package/dist/index.cjs.js +0 -55
- package/dist/index.d.ts +0 -4
- package/dist/index.es.js +0 -14516
- package/dist/main.d.ts +0 -1
- package/dist/util/addressProvide.d.ts +0 -9
- package/dist/util/cryptoUtils.d.ts +0 -19
- package/dist/util/login.d.ts +0 -11
- package/dist/util/qrService.d.ts +0 -7
- package/dist/util/socketInstance.d.ts +0 -9
- package/dist/util/types.d.ts +0 -24
- package/dist/utils/addressProvide.d.ts +0 -9
- package/dist/utils/cryptoUtils.d.ts +0 -19
- package/dist/utils/login.d.ts +0 -11
- package/dist/utils/socketInstance.d.ts +0 -9
- package/dist/utils/types.d.ts +0 -23
- package/dist/validation/hashing.d.ts +0 -2
- package/dist/validation/token.d.ts +0 -5
- package/dist/xphere/enc.d.ts +0 -12
- package/dist/xphere/index.d.ts +0 -13
- package/dist/xphere/sign.d.ts +0 -18
- package/dist/xphere/util.d.ts +0 -10
- package/dist/xphere/validation.d.ts +0 -10
- package/dist/zigap/index.d.ts +0 -7
- package/dist/zigap/qr.d.ts +0 -7
- package/dist/zigap/types.d.ts +0 -4
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ const App = () => {
|
|
|
26
26
|
logoSize={25}
|
|
27
27
|
validSeconds={600}
|
|
28
28
|
sigMessage="hello world"
|
|
29
|
-
expire={{type: 'EXTEND', seconds: 3600}}
|
|
29
|
+
expire={{ type: 'EXTEND', seconds: 3600 }}
|
|
30
|
+
icon="http://sample.icon-url.com"
|
|
30
31
|
onReceive={({ isSuccess }) => {
|
|
31
32
|
if(isSuccess) {
|
|
32
33
|
// something to do after login (refresh page...)
|
|
@@ -53,18 +54,20 @@ const App = () => {
|
|
|
53
54
|
| `validSeconds` | number | QR code valid time(minutes) |
|
|
54
55
|
| `onReceive` | (value) => void | Function called after login request |
|
|
55
56
|
| `expire` | {type: "NONE / FIX / EXTEND", seconds: number} | time and type for user login to expire |
|
|
57
|
+
| `icon` | string | Your dapp icon url to be displayed on zigap app |
|
|
56
58
|
|
|
57
59
|
<br>
|
|
58
60
|
|
|
59
61
|
### `AddressProvideQR` props
|
|
60
62
|
|
|
61
|
-
| prop type |
|
|
62
|
-
| ------------------- | --------------- |
|
|
63
|
-
| `dapp` | string | Name of the dapp to use
|
|
64
|
-
| `url` | string | The url of dapp to connect
|
|
65
|
-
| `availableNetworks` | string[] | List of connectable networks in dapp
|
|
66
|
-
| `validSeconds` | number | QR code valid time(seconds)
|
|
67
|
-
| `onReceive` | (value) => void | Function called after login request
|
|
63
|
+
| prop type | type | description |
|
|
64
|
+
| ------------------- | --------------- | ----------------------------------------------- |
|
|
65
|
+
| `dapp` | string | Name of the dapp to use |
|
|
66
|
+
| `url` | string | The url of dapp to connect |
|
|
67
|
+
| `availableNetworks` | string[] | List of connectable networks in dapp |
|
|
68
|
+
| `validSeconds` | number | QR code valid time(seconds) |
|
|
69
|
+
| `onReceive` | (value) => void | Function called after login request |
|
|
70
|
+
| `icon` | string | Your dapp icon url to be displayed on zigap app |
|
|
68
71
|
|
|
69
72
|
<br>
|
|
70
73
|
|
package/package.json
CHANGED
package/dist/App.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AddressProvideQRProps } from './AddressProvideQR.types';
|
|
2
|
-
|
|
3
|
-
declare const AddressProvideQR: ({ availableNetworks, dapp, url, validSeconds, onReceive, isShowLogo, logoSize, ...props }: AddressProvideQRProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export default AddressProvideQR;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CommonStyleType } from 'src/components/LoginQR/LoginQR.types';
|
|
2
|
-
|
|
3
|
-
export type AddressProvideResultType = {
|
|
4
|
-
isSuccess: boolean;
|
|
5
|
-
address?: string;
|
|
6
|
-
network?: string;
|
|
7
|
-
nickName?: string;
|
|
8
|
-
};
|
|
9
|
-
export type AddressProvideQRProps = {
|
|
10
|
-
availableNetworks: string[];
|
|
11
|
-
dapp: string;
|
|
12
|
-
url: string;
|
|
13
|
-
validSeconds: number;
|
|
14
|
-
onReceive: (res: {
|
|
15
|
-
isSuccess: boolean;
|
|
16
|
-
}) => void;
|
|
17
|
-
} & CommonStyleType;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
|
|
3
|
-
export type CommonStyleType = {
|
|
4
|
-
size?: number;
|
|
5
|
-
bgColor?: string;
|
|
6
|
-
fgColor?: string;
|
|
7
|
-
style?: CSSProperties;
|
|
8
|
-
isShowLogo?: boolean;
|
|
9
|
-
logoSize?: number;
|
|
10
|
-
};
|
|
11
|
-
export type PayloadType = {
|
|
12
|
-
publicKey: string;
|
|
13
|
-
message: string;
|
|
14
|
-
};
|
|
15
|
-
export type AccountType = {
|
|
16
|
-
address: string;
|
|
17
|
-
network: string;
|
|
18
|
-
nickName: string;
|
|
19
|
-
};
|
|
20
|
-
export type NoneLoginExpire = {
|
|
21
|
-
type: 'NONE';
|
|
22
|
-
seconds?: never;
|
|
23
|
-
};
|
|
24
|
-
export type FixedOrExtensionLoginExpire = {
|
|
25
|
-
type: 'FIX' | 'EXTEND';
|
|
26
|
-
seconds: number;
|
|
27
|
-
};
|
|
28
|
-
export type LoginExpireType = FixedOrExtensionLoginExpire | NoneLoginExpire;
|
|
29
|
-
export type LoginResultType = {
|
|
30
|
-
address: string;
|
|
31
|
-
network: string;
|
|
32
|
-
nickName: string;
|
|
33
|
-
token: string;
|
|
34
|
-
issuedDateTime: string;
|
|
35
|
-
expire: LoginExpireType;
|
|
36
|
-
};
|
|
37
|
-
export type LoginQRProps = {
|
|
38
|
-
availableNetworks: string[];
|
|
39
|
-
dapp: string;
|
|
40
|
-
url: string;
|
|
41
|
-
sigMessage: string;
|
|
42
|
-
validSeconds: number;
|
|
43
|
-
onReceive: (res: {
|
|
44
|
-
isSuccess: boolean;
|
|
45
|
-
}) => void;
|
|
46
|
-
expire: LoginExpireType;
|
|
47
|
-
} & CommonStyleType;
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useZigap } from './useZigap';
|
package/dist/hooks/useZigap.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const LOGIN_RES_KEY = "userInfo";
|
|
2
|
-
export declare const TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
3
|
-
declare const useZigap: () => {
|
|
4
|
-
userInfo: {
|
|
5
|
-
address: string | undefined;
|
|
6
|
-
network: string | undefined;
|
|
7
|
-
nickName: string | undefined;
|
|
8
|
-
token: string | undefined;
|
|
9
|
-
issuedDateTime: string | undefined;
|
|
10
|
-
expireDateTime: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
logout: () => void;
|
|
13
|
-
};
|
|
14
|
-
export default useZigap;
|