zigap-utils 0.0.2 → 0.0.22

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.
@@ -3,8 +3,8 @@ import { ec as EC } from 'elliptic';
3
3
  declare class CryptoService {
4
4
  private ec;
5
5
  constructor();
6
- xphereSign(msg: string, prKey: string): any;
7
- xphereVerify(msg: string, pubKey: string, sig: string): any;
6
+ xphereSign(msg: string, prKey: string): string;
7
+ xphereVerify(msg: string, pubKey: string, sig: string): boolean;
8
8
  generateKeys(): {
9
9
  privateKey: string;
10
10
  publicKey: string;
@@ -1,7 +1,7 @@
1
1
  import { QrType } from './types';
2
2
 
3
3
  declare class QrService {
4
- generateQrCode(type: string): QrType;
4
+ generateQrCode(type: string, dapp: string): QrType;
5
5
  }
6
6
  declare const _default: QrService;
7
7
  export default _default;
@@ -0,0 +1,12 @@
1
+ type CryptoJSAlgo = 'SHA256' | 'RIPEMD160';
2
+ declare class Enc {
3
+ string(obj: any): string;
4
+ crypto(algo: CryptoJSAlgo, string: string): string;
5
+ hash(obj: any): string;
6
+ shortHash(obj: any): string;
7
+ checksum(hash: string): string;
8
+ idHash(obj: any): string;
9
+ isHex(str: string): boolean;
10
+ }
11
+ declare const _default: Enc;
12
+ export default _default;
@@ -0,0 +1,18 @@
1
+ interface KeyPair {
2
+ private_key: string;
3
+ public_key: string;
4
+ address: string;
5
+ }
6
+ declare class Sign {
7
+ private KEY_SIZE;
8
+ private SIGNATURE_SIZE;
9
+ constructor();
10
+ keyPair(): KeyPair;
11
+ privateKey(): string;
12
+ publicKey(private_key: string): string;
13
+ address(public_key: string): string;
14
+ signature(obj: any, private_key: string): string;
15
+ signatureValidity(obj: any, public_key: string, signature: string): boolean;
16
+ }
17
+ declare const _default: Sign;
18
+ export default _default;
@@ -0,0 +1,10 @@
1
+ declare class Util {
2
+ string(input: any): string;
3
+ stringToByte(str: string): Uint8Array;
4
+ stringToUnicode(str: string): string;
5
+ byteToHex(byte_array: Uint8Array): string;
6
+ hexToByte(hex: string): Uint8Array;
7
+ isHex(input: any): boolean;
8
+ }
9
+ declare const _default: Util;
10
+ export default _default;
@@ -0,0 +1,9 @@
1
+ <svg width="167" height="166" viewBox="0 0 167 166" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M116.052 115.296H166.355H166.36V0H51.0675V50.3042H0.759995V165.6H116.052V115.296ZM90.3366 65.3428L40.21 115.296H40.4307L40.2551 115.471H101.014V150.561H15.7981V65.3428H90.3366ZM76.7327 100.257H151.317V15.0386H66.1006V50.1536L109.424 50.3042H126.684L126.624 50.364L126.669 50.3642L113.846 63.1431L76.7327 100.257Z" fill="url(#paint0_linear_2322_66)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_2322_66" x1="167.74" y1="-2.07" x2="-3.37985" y2="172.5" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#1349F8"/>
6
+ <stop offset="1" stop-color="#5C13F8"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigap-utils",
3
- "version": "0.0.2",
3
+ "version": "0.0.22",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "dependencies": {
24
24
  "react": "^18.2.0",
25
25
  "react-dom": "^18.2.0",
26
- "saseul": "^2.8.0",
27
26
  "styled-components": "^6.1.11",
27
+ "tweetnacl": "^1.0.3",
28
28
  "vite-plugin-commonjs": "^0.10.1"
29
29
  },
30
30
  "devDependencies": {