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
- # React + TypeScript + Vite
1
+ # zigap-utils
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ It is a library that collects utils that help communicate between dapp and zigap.
4
4
 
5
- Currently, two official plugins are available:
5
+ ## Installation
6
6
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7
+ ```
8
+ npm i zigap-utils --save -D
9
+ ```
9
10
 
10
- ## Expanding the ESLint configuration
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
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
35
+ <br />
13
36
 
14
- - Configure the top-level `parserOptions` property like this:
37
+ ---
15
38
 
16
- ```js
17
- export default {
18
- // other rules...
19
- parserOptions: {
20
- ecmaVersion: 'latest',
21
- sourceType: 'module',
22
- project: ['./tsconfig.json', './tsconfig.node.json'],
23
- tsconfigRootDir: __dirname,
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
- - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29
- - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
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 |
@@ -8,9 +8,7 @@ export type AddressProvideQRProps = {
8
8
  validTime: number;
9
9
  onReceive: (result: AddressProvideResultType) => void;
10
10
  size?: number;
11
- level?: string;
12
11
  bgColor?: string;
13
12
  fgColor?: string;
14
13
  style?: CSSProperties;
15
- includeMargin?: boolean;
16
14
  };
@@ -9,9 +9,7 @@ export type LoginQRProps = {
9
9
  validTime: number;
10
10
  onReceive: (result: LoginResultType) => void;
11
11
  size?: number;
12
- level?: string;
13
12
  bgColor?: string;
14
13
  fgColor?: string;
15
14
  style?: CSSProperties;
16
- includeMargin?: boolean;
17
15
  };
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "zigap-utils",
3
- "version": "0.0.1",
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
  ],