zigap-utils 0.0.496 → 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/dist/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AccountType } from './types';
|
|
2
|
-
|
|
3
|
-
declare class AddressProvideService {
|
|
4
|
-
private isAccountType;
|
|
5
|
-
getAccount(): Promise<AccountType>;
|
|
6
|
-
qrAddressProvide(roomId: string): Promise<AccountType>;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: AddressProvideService;
|
|
9
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ec as EC } from 'elliptic';
|
|
2
|
-
|
|
3
|
-
declare class CryptoService {
|
|
4
|
-
private ec;
|
|
5
|
-
constructor();
|
|
6
|
-
xphereSign(msg: string, prKey: string): string;
|
|
7
|
-
xphereVerify(msg: string, pubKey: string, sig: string): boolean;
|
|
8
|
-
generateKeys(): {
|
|
9
|
-
privateKey: string;
|
|
10
|
-
publicKey: string;
|
|
11
|
-
};
|
|
12
|
-
sign(msg: string, prKey: string): EC.Signature;
|
|
13
|
-
verify(msg: string, sig: EC.Signature, pubKey: string): boolean;
|
|
14
|
-
encrypt(text: string, key: string): string;
|
|
15
|
-
decrypt(encryptedText: string, key: string): string;
|
|
16
|
-
generateNonce(length: number): string;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: CryptoService;
|
|
19
|
-
export default _default;
|
package/dist/util/login.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AccountCryptoType, ResponseLoginType } from './types';
|
|
2
|
-
|
|
3
|
-
declare class LoginService {
|
|
4
|
-
private isAccountCryptoType;
|
|
5
|
-
getAccountCrypto(): Promise<AccountCryptoType>;
|
|
6
|
-
reciveRequest(): Promise<boolean>;
|
|
7
|
-
sendMessage(roomId: string, message: string): Promise<void>;
|
|
8
|
-
qrLogin(roomId: string, message: string, nonce: string): Promise<ResponseLoginType>;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: LoginService;
|
|
11
|
-
export default _default;
|
package/dist/util/qrService.d.ts
DELETED
package/dist/util/types.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ec as EC } from 'elliptic';
|
|
2
|
-
|
|
3
|
-
export type SignatureType = EC.Signature;
|
|
4
|
-
export interface QrType {
|
|
5
|
-
qrCode: string;
|
|
6
|
-
roomId: string;
|
|
7
|
-
}
|
|
8
|
-
export interface AccountCryptoType {
|
|
9
|
-
signature: string;
|
|
10
|
-
publicKey: string;
|
|
11
|
-
address: string;
|
|
12
|
-
network: string;
|
|
13
|
-
etc: string;
|
|
14
|
-
}
|
|
15
|
-
export interface AccountType {
|
|
16
|
-
address: string;
|
|
17
|
-
network: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ResponseLoginType {
|
|
20
|
-
address: string;
|
|
21
|
-
network: string;
|
|
22
|
-
signature: string;
|
|
23
|
-
publicKey: string;
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AccountProvideType } from './types';
|
|
2
|
-
|
|
3
|
-
declare class AddressProvideService {
|
|
4
|
-
private isAccountType;
|
|
5
|
-
getAccount(): Promise<AccountProvideType>;
|
|
6
|
-
qrAddressProvide(roomId: string): Promise<AccountProvideType>;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: AddressProvideService;
|
|
9
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ec as EC } from 'elliptic';
|
|
2
|
-
|
|
3
|
-
declare class CryptoService {
|
|
4
|
-
private ec;
|
|
5
|
-
constructor();
|
|
6
|
-
xphereSign(msg: string, prKey: string): string;
|
|
7
|
-
xphereVerify(msg: string, pubKey: string, sig: string): boolean;
|
|
8
|
-
generateKeys(): {
|
|
9
|
-
privateKey: string;
|
|
10
|
-
publicKey: string;
|
|
11
|
-
};
|
|
12
|
-
sign(msg: string, prKey: string): EC.Signature;
|
|
13
|
-
verify(msg: string, sig: EC.Signature, pubKey: string): boolean;
|
|
14
|
-
encrypt(text: string, key: string): string;
|
|
15
|
-
decrypt(encryptedText: string, key: string): string;
|
|
16
|
-
generateNonce(length: number): string;
|
|
17
|
-
}
|
|
18
|
-
declare const _default: CryptoService;
|
|
19
|
-
export default _default;
|
package/dist/utils/login.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AccountCryptoType, ResponseLoginType } from './types';
|
|
2
|
-
|
|
3
|
-
declare class LoginService {
|
|
4
|
-
private isAccountCryptoType;
|
|
5
|
-
getAccountCrypto(): Promise<AccountCryptoType>;
|
|
6
|
-
reciveRequest(): Promise<boolean>;
|
|
7
|
-
sendMessage(roomId: string, message: string): Promise<void>;
|
|
8
|
-
qrLogin(roomId: string, message: string, nonce: string): Promise<ResponseLoginType>;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: LoginService;
|
|
11
|
-
export default _default;
|
package/dist/utils/types.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ec as EC } from 'elliptic';
|
|
2
|
-
|
|
3
|
-
export type SignatureType = EC.Signature;
|
|
4
|
-
export interface AccountCryptoType {
|
|
5
|
-
signature: string;
|
|
6
|
-
publicKey: string;
|
|
7
|
-
address: string;
|
|
8
|
-
network: string;
|
|
9
|
-
nickName: string;
|
|
10
|
-
etc: string;
|
|
11
|
-
}
|
|
12
|
-
export interface AccountProvideType {
|
|
13
|
-
address: string;
|
|
14
|
-
network: string;
|
|
15
|
-
nickName: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ResponseLoginType {
|
|
18
|
-
address: string;
|
|
19
|
-
network: string;
|
|
20
|
-
nickName: string;
|
|
21
|
-
signature: string;
|
|
22
|
-
publicKey: string;
|
|
23
|
-
}
|
package/dist/xphere/enc.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
package/dist/xphere/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { default as Enc } from './enc';
|
|
2
|
-
import { default as Sign } from './sign';
|
|
3
|
-
import { default as Util } from './util';
|
|
4
|
-
import { default as Validation } from './validation';
|
|
5
|
-
|
|
6
|
-
type XphereType = {
|
|
7
|
-
Enc: typeof Enc;
|
|
8
|
-
Sign: typeof Sign;
|
|
9
|
-
Util: typeof Util;
|
|
10
|
-
Validation: typeof Validation;
|
|
11
|
-
};
|
|
12
|
-
export declare const Xphere: XphereType;
|
|
13
|
-
export {};
|
package/dist/xphere/sign.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
package/dist/xphere/util.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PayloadType } from 'src/components';
|
|
2
|
-
|
|
3
|
-
declare class Validation {
|
|
4
|
-
private base64url;
|
|
5
|
-
createToken(payload: PayloadType, signature: string): string;
|
|
6
|
-
verifyToken(token: string): any;
|
|
7
|
-
getAddress(publicKey: string): string;
|
|
8
|
-
}
|
|
9
|
-
declare const _default: Validation;
|
|
10
|
-
export default _default;
|
package/dist/zigap/index.d.ts
DELETED
package/dist/zigap/qr.d.ts
DELETED
package/dist/zigap/types.d.ts
DELETED