@zkproofport-app/sdk 0.5.0-beta.3 → 0.5.0-beta.5
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 +45 -133
- package/dist/ProofportSDK.d.ts +3 -18
- package/dist/constants.d.ts +3 -12
- package/dist/deeplink.d.ts +17 -18
- package/dist/index.d.ts +6 -6
- package/dist/index.esm.js +66 -202
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +99 -202
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -202
- package/dist/index.mjs.map +1 -1
- package/dist/offChainVerifier.d.ts +8 -1
- package/dist/relayStatus.d.ts +11 -0
- package/dist/types.d.ts +11 -63
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* The version. `@aztec/bb.js` must be the WASM build of the same bb the
|
|
20
20
|
* circuits are compiled with -- `BB_VERSION` in circuits/toolchain.env,
|
|
21
21
|
* 4.2.0-aztecnr-rc.2 since the beta.19 toolchain. Versions are not
|
|
22
|
-
* interchangeable: on
|
|
22
|
+
* interchangeable: on one of our circuits the 2025 nightly wrote
|
|
23
23
|
* a 16256-byte proof where bb 1.2.0 wrote 16224 for the identical circuit and
|
|
24
24
|
* witness, with the SAME verification key, so the key cannot warn you. A
|
|
25
25
|
* mismatch shows up only as verification failing.
|
|
@@ -55,6 +55,13 @@ export interface OffChainVerifyOptions {
|
|
|
55
55
|
* scope and requestId. See core's `checkOidcPolicy`.
|
|
56
56
|
*/
|
|
57
57
|
request?: OidcRequestContext;
|
|
58
|
+
/**
|
|
59
|
+
* Which of the circuit's packages made the proof, as its result says. Omitted
|
|
60
|
+
* means `standard`; a proof with another package's length is then refused.
|
|
61
|
+
* Selects whose verification key is fetched (ignored when `verificationKey`
|
|
62
|
+
* is given).
|
|
63
|
+
*/
|
|
64
|
+
signerVariant?: string;
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
67
|
* Verify a proof off-chain, against its verification key.
|
package/dist/relayStatus.d.ts
CHANGED
|
@@ -7,3 +7,14 @@ import type { RelayTerminalStatus } from './types';
|
|
|
7
7
|
export declare const RELAY_TERMINAL_STATUSES: readonly ["completed", "error", "failed", "cancelled", "expired"];
|
|
8
8
|
/** True when `status` is one a relay request ends in. */
|
|
9
9
|
export declare function isTerminalRelayStatus(status: string): status is RelayTerminalStatus;
|
|
10
|
+
/**
|
|
11
|
+
* How long `waitForProof()` / `waitForResult()` wait when the caller passes no
|
|
12
|
+
* `timeoutMs`: 600 000 ms (10 min).
|
|
13
|
+
*
|
|
14
|
+
* The relay answers `expired` itself at 540 s, so with this default a dApp
|
|
15
|
+
* always gets a terminal status to branch on rather than its own timeout. A
|
|
16
|
+
* heavy proof on an older phone takes a few minutes after the user confirms;
|
|
17
|
+
* the earlier 300 000 ms default could fire while such a proof was still being
|
|
18
|
+
* made.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_RELAY_WAIT_MS = 600000;
|
package/dist/types.d.ts
CHANGED
|
@@ -83,68 +83,6 @@ export interface OidcDomainInputs {
|
|
|
83
83
|
scope: string;
|
|
84
84
|
provider?: 'google' | 'microsoft';
|
|
85
85
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Input parameters for Korea Mobile ID (mDL) ownership attestation circuit.
|
|
88
|
-
*
|
|
89
|
-
* Proves the user holds a valid Korean mobile driver's license. The license
|
|
90
|
-
* data never leaves the device; only the selected attributes indicated by
|
|
91
|
-
* `discloseFlags` are revealed through the proof's public inputs.
|
|
92
|
-
*
|
|
93
|
-
* @property scope - Application-specific identifier for proof uniqueness (e.g., dapp domain)
|
|
94
|
-
* @property discloseFlags - Attribute disclosure bitmask 0x00–0x0F
|
|
95
|
-
* (0x01 name | 0x02 birth | 0x04 sex | 0x08 phone). Omit or 0 for a fully
|
|
96
|
-
* anonymous ownership proof. The attribute values themselves are entered
|
|
97
|
-
* by the user on-device, never supplied by the dapp.
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```typescript
|
|
101
|
-
* // Anonymous "I hold a valid Korean mobile ID" proof
|
|
102
|
-
* const inputs: MdlKrOwnershipInputs = { scope: 'myapp.com' };
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
export interface MdlKrOwnershipInputs {
|
|
106
|
-
scope: string;
|
|
107
|
-
discloseFlags?: number;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Input parameters for Korea Mobile ID (mDL) age attestation circuit.
|
|
111
|
-
*
|
|
112
|
-
* Proves the user is at least `ageThreshold` years old according to their
|
|
113
|
-
* Korean mobile driver's license, without revealing the birth date.
|
|
114
|
-
*
|
|
115
|
-
* @property scope - Application-specific identifier for proof uniqueness
|
|
116
|
-
* @property ageThreshold - Minimum age to prove (integer, 1–150). E.g., 19 for
|
|
117
|
-
* Korean adult verification.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```typescript
|
|
121
|
-
* const inputs: MdlKrAgeInputs = { scope: 'myapp.com', ageThreshold: 19 };
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
export interface MdlKrAgeInputs {
|
|
125
|
-
scope: string;
|
|
126
|
-
ageThreshold: number;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Input parameters for Korea Mobile ID (mDL) region attestation circuit.
|
|
130
|
-
*
|
|
131
|
-
* Proves the user's registered address is in the specified si/do region
|
|
132
|
-
* without revealing the full address.
|
|
133
|
-
*
|
|
134
|
-
* @property scope - Application-specific identifier for proof uniqueness
|
|
135
|
-
* @property targetRegion - Region (si/do) to prove residency in, in Korean
|
|
136
|
-
* (e.g., '경기도', '서울특별시'). Chosen by the dapp; the proof succeeds only
|
|
137
|
-
* if the license address matches.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* const inputs: MdlKrRegionInputs = { scope: 'myapp.com', targetRegion: '경기도' };
|
|
142
|
-
* ```
|
|
143
|
-
*/
|
|
144
|
-
export interface MdlKrRegionInputs {
|
|
145
|
-
scope: string;
|
|
146
|
-
targetRegion: string;
|
|
147
|
-
}
|
|
148
86
|
/**
|
|
149
87
|
* Empty input type for circuits that retrieve all data from the mobile app.
|
|
150
88
|
* Used when SDK doesn't need to provide any circuit-specific parameters.
|
|
@@ -189,7 +127,7 @@ export type DojangPlaygroundInputs = ActionBoundInputs;
|
|
|
189
127
|
* Union type of all circuit-specific input types.
|
|
190
128
|
* Each circuit type has a corresponding input interface.
|
|
191
129
|
*/
|
|
192
|
-
export type CircuitInputs = CoinbaseKycInputs | ActionBoundInputs | CoinbaseCountryInputs | OidcDomainInputs |
|
|
130
|
+
export type CircuitInputs = CoinbaseKycInputs | ActionBoundInputs | CoinbaseCountryInputs | OidcDomainInputs | EmptyInputs;
|
|
193
131
|
/**
|
|
194
132
|
* Zero-knowledge proof request sent to mobile app via deep link.
|
|
195
133
|
*
|
|
@@ -280,6 +218,14 @@ export interface ProofResponse {
|
|
|
280
218
|
verifierAddress?: string;
|
|
281
219
|
/** Chain ID where verifier contract is deployed (provided by mobile app) */
|
|
282
220
|
chainId?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Which of the circuit's packages made the proof (a `SignerVariant`:
|
|
223
|
+
* `standard`, `android` or `android_factory`; provided by mobile app). Pass the relay result's `signerVariant` through
|
|
224
|
+
* unchanged; a value the circuit has no package for is refused by name.
|
|
225
|
+
* Omitted means `standard`; a proof whose length is another package's is
|
|
226
|
+
* then refused.
|
|
227
|
+
*/
|
|
228
|
+
signerVariant?: string;
|
|
283
229
|
}
|
|
284
230
|
/**
|
|
285
231
|
* QR code generation options for deep link encoding.
|
|
@@ -460,6 +406,8 @@ export interface RelayProofResult {
|
|
|
460
406
|
verifierAddress?: string;
|
|
461
407
|
chainId?: number;
|
|
462
408
|
circuit?: string;
|
|
409
|
+
/** Which of the circuit's packages made the proof; copy it into `ProofResponse.signerVariant`. */
|
|
410
|
+
signerVariant?: string;
|
|
463
411
|
/** Human-readable reason, present when status is 'error', 'failed' or 'expired' */
|
|
464
412
|
error?: string;
|
|
465
413
|
/** The app's error code (`E` + four digits, e.g. `E2007`), present on some 'error' results */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkproofport-app/sdk",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.5",
|
|
4
4
|
"description": "ZKProofport SDK for requesting zero-knowledge proofs from the ZKProofport mobile app and verifying them on-chain",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"buffer": "^6.0.3",
|
|
43
43
|
"qrcode": "^1.5.3",
|
|
44
44
|
"socket.io-client": "^4.8.0",
|
|
45
|
-
"@zkproofport-app/core": "0.
|
|
45
|
+
"@zkproofport-app/core": "0.4.0-beta.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@rollup/plugin-commonjs": "^25.0.7",
|