@superorange/zka-js-sdk 1.0.119 → 1.0.122
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/dist/index.d.mts +113 -0
- package/dist/index.d.ts +113 -19
- package/dist/index.js +595 -229
- package/dist/index.mjs +591 -0
- package/package.json +24 -12
- package/dist/classes/AttRequest.d.ts +0 -15
- package/dist/classes/AttRequest.js +0 -41
- package/dist/classes/AttRequest.js.map +0 -1
- package/dist/config/constants.d.ts +0 -9
- package/dist/config/constants.js +0 -14
- package/dist/config/constants.js.map +0 -1
- package/dist/error.d.ts +0 -45
- package/dist/error.js +0 -66
- package/dist/error.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils.d.ts +0 -9
- package/dist/utils.js +0 -70
- package/dist/utils.js.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
primus?: any;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type AttestationParams = {
|
|
8
|
+
chainID: number;
|
|
9
|
+
walletAddress: string;
|
|
10
|
+
attestationTypeID: string;
|
|
11
|
+
attestationParameters: any[];
|
|
12
|
+
algorithmType?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type AttNetworkRequest = {
|
|
16
|
+
url: string,
|
|
17
|
+
header: string, // json string
|
|
18
|
+
method: string,
|
|
19
|
+
body: string
|
|
20
|
+
}
|
|
21
|
+
type AttNetworkResponseResolve = {
|
|
22
|
+
keyName: string,
|
|
23
|
+
parseType: string, //json or html
|
|
24
|
+
parsePath: string
|
|
25
|
+
}
|
|
26
|
+
type Attestor = {
|
|
27
|
+
attestorAddr: string,
|
|
28
|
+
url: string
|
|
29
|
+
}
|
|
30
|
+
type Attestation = {
|
|
31
|
+
recipient: string,
|
|
32
|
+
request: AttNetworkRequest,
|
|
33
|
+
reponseResolve: AttNetworkResponseResolve[],
|
|
34
|
+
data: string, // json string
|
|
35
|
+
attConditions: string, // json string
|
|
36
|
+
timestamp: number,
|
|
37
|
+
additionParams: string,
|
|
38
|
+
attestors: Attestor[],
|
|
39
|
+
signatures: string[],
|
|
40
|
+
}
|
|
41
|
+
type ErrorData = {
|
|
42
|
+
code: string;
|
|
43
|
+
title: string;
|
|
44
|
+
desc: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
type StartAttestationReturn = {
|
|
49
|
+
result: boolean;
|
|
50
|
+
data?: Attestation;
|
|
51
|
+
errorData?: ErrorData,
|
|
52
|
+
reStartFlag?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type VerifyParamsReturn = {
|
|
56
|
+
result: boolean;
|
|
57
|
+
message: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type InitAttestationReturn = {
|
|
61
|
+
result: boolean;
|
|
62
|
+
errorData?: ErrorData;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type Env = 'development' | 'test' | 'production'
|
|
66
|
+
|
|
67
|
+
type AttModeAlgorithmType = 'mpctls' | 'proxytls'
|
|
68
|
+
type AttModeResultType = 'plain' | 'cipher'
|
|
69
|
+
type AttMode = {
|
|
70
|
+
algorithmType: AttModeAlgorithmType;
|
|
71
|
+
resultType: AttModeResultType;
|
|
72
|
+
}
|
|
73
|
+
type BaseAttestationParams = {
|
|
74
|
+
appId: string;
|
|
75
|
+
attTemplateID: string;
|
|
76
|
+
userAddress: string;
|
|
77
|
+
}
|
|
78
|
+
type FullAttestationParams = BaseAttestationParams & {
|
|
79
|
+
timestamp: number;
|
|
80
|
+
attMode?: AttMode;
|
|
81
|
+
attConditions?: AttConditions;
|
|
82
|
+
additionParams?: string;
|
|
83
|
+
requestid?: string;
|
|
84
|
+
backUrl?: string;
|
|
85
|
+
}
|
|
86
|
+
type SignedAttRequest = {
|
|
87
|
+
attRequest: FullAttestationParams,
|
|
88
|
+
appSignature: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare global {
|
|
92
|
+
interface Window {
|
|
93
|
+
primus?: any;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
type ComparisonOp = '>' | '>=' | '=' | '!=' | '<' | '<=';
|
|
97
|
+
type OpType = ComparisonOp | 'SHA256' | 'REVEAL_STRING';
|
|
98
|
+
type AttSubCondition = {
|
|
99
|
+
field: string,
|
|
100
|
+
op: OpType,
|
|
101
|
+
value?: string,
|
|
102
|
+
}
|
|
103
|
+
type AttCondition = AttSubCondition[]
|
|
104
|
+
type AttConditions = AttCondition[]
|
|
105
|
+
|
|
106
|
+
type InitOptions = {
|
|
107
|
+
platform?: string,
|
|
108
|
+
env?: Env,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type ComputeMode = 'nonecomplete' | 'nonepartial' | 'normal';
|
|
112
|
+
|
|
113
|
+
export type { AttCondition, AttConditions, AttMode, AttModeAlgorithmType, AttModeResultType, AttNetworkRequest, AttNetworkResponseResolve, AttSubCondition, Attestation, AttestationParams, Attestor, BaseAttestationParams, ComparisonOp, ComputeMode, Env, ErrorData, FullAttestationParams, InitAttestationReturn, InitOptions, OpType, SignedAttRequest, StartAttestationReturn, VerifyParamsReturn };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
primus?: any;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type AttestationParams = {
|
|
8
|
+
chainID: number;
|
|
9
|
+
walletAddress: string;
|
|
10
|
+
attestationTypeID: string;
|
|
11
|
+
attestationParameters: any[];
|
|
12
|
+
algorithmType?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type AttNetworkRequest = {
|
|
16
|
+
url: string,
|
|
17
|
+
header: string, // json string
|
|
18
|
+
method: string,
|
|
19
|
+
body: string
|
|
20
|
+
}
|
|
21
|
+
type AttNetworkResponseResolve = {
|
|
22
|
+
keyName: string,
|
|
23
|
+
parseType: string, //json or html
|
|
24
|
+
parsePath: string
|
|
25
|
+
}
|
|
26
|
+
type Attestor = {
|
|
27
|
+
attestorAddr: string,
|
|
28
|
+
url: string
|
|
29
|
+
}
|
|
30
|
+
type Attestation = {
|
|
31
|
+
recipient: string,
|
|
32
|
+
request: AttNetworkRequest,
|
|
33
|
+
reponseResolve: AttNetworkResponseResolve[],
|
|
34
|
+
data: string, // json string
|
|
35
|
+
attConditions: string, // json string
|
|
36
|
+
timestamp: number,
|
|
37
|
+
additionParams: string,
|
|
38
|
+
attestors: Attestor[],
|
|
39
|
+
signatures: string[],
|
|
40
|
+
}
|
|
41
|
+
type ErrorData = {
|
|
42
|
+
code: string;
|
|
43
|
+
title: string;
|
|
44
|
+
desc: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
type StartAttestationReturn = {
|
|
49
|
+
result: boolean;
|
|
50
|
+
data?: Attestation;
|
|
51
|
+
errorData?: ErrorData,
|
|
52
|
+
reStartFlag?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type VerifyParamsReturn = {
|
|
56
|
+
result: boolean;
|
|
57
|
+
message: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type InitAttestationReturn = {
|
|
61
|
+
result: boolean;
|
|
62
|
+
errorData?: ErrorData;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type Env = 'development' | 'test' | 'production'
|
|
66
|
+
|
|
67
|
+
type AttModeAlgorithmType = 'mpctls' | 'proxytls'
|
|
68
|
+
type AttModeResultType = 'plain' | 'cipher'
|
|
69
|
+
type AttMode = {
|
|
70
|
+
algorithmType: AttModeAlgorithmType;
|
|
71
|
+
resultType: AttModeResultType;
|
|
72
|
+
}
|
|
73
|
+
type BaseAttestationParams = {
|
|
74
|
+
appId: string;
|
|
75
|
+
attTemplateID: string;
|
|
76
|
+
userAddress: string;
|
|
77
|
+
}
|
|
78
|
+
type FullAttestationParams = BaseAttestationParams & {
|
|
79
|
+
timestamp: number;
|
|
80
|
+
attMode?: AttMode;
|
|
81
|
+
attConditions?: AttConditions;
|
|
82
|
+
additionParams?: string;
|
|
83
|
+
requestid?: string;
|
|
84
|
+
backUrl?: string;
|
|
85
|
+
}
|
|
86
|
+
type SignedAttRequest = {
|
|
87
|
+
attRequest: FullAttestationParams,
|
|
88
|
+
appSignature: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare global {
|
|
92
|
+
interface Window {
|
|
93
|
+
primus?: any;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
type ComparisonOp = '>' | '>=' | '=' | '!=' | '<' | '<=';
|
|
97
|
+
type OpType = ComparisonOp | 'SHA256' | 'REVEAL_STRING';
|
|
98
|
+
type AttSubCondition = {
|
|
99
|
+
field: string,
|
|
100
|
+
op: OpType,
|
|
101
|
+
value?: string,
|
|
102
|
+
}
|
|
103
|
+
type AttCondition = AttSubCondition[]
|
|
104
|
+
type AttConditions = AttCondition[]
|
|
105
|
+
|
|
106
|
+
type InitOptions = {
|
|
107
|
+
platform?: string,
|
|
108
|
+
env?: Env,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type ComputeMode = 'nonecomplete' | 'nonepartial' | 'normal';
|
|
112
|
+
|
|
113
|
+
export type { AttCondition, AttConditions, AttMode, AttModeAlgorithmType, AttModeResultType, AttNetworkRequest, AttNetworkResponseResolve, AttSubCondition, Attestation, AttestationParams, Attestor, BaseAttestationParams, ComparisonOp, ComputeMode, Env, ErrorData, FullAttestationParams, InitAttestationReturn, InitOptions, OpType, SignedAttRequest, StartAttestationReturn, VerifyParamsReturn };
|