@zkproofport-app/sdk 0.5.0-beta.1 → 0.5.0-beta.3

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.
@@ -35,6 +35,7 @@
35
35
  * two pieces, so nothing is joined back here.
36
36
  */
37
37
  import { type CircuitId } from './circuits';
38
+ import { type OidcRequestContext } from '@zkproofport-app/core';
38
39
  export interface OffChainVerifyResult {
39
40
  valid: boolean;
40
41
  error?: string;
@@ -48,6 +49,12 @@ export interface OffChainVerifyOptions {
48
49
  verificationKey?: Uint8Array;
49
50
  /** Milliseconds before the fetch is abandoned. Default 30000. */
50
51
  timeoutMs?: number;
52
+ /**
53
+ * For `oidc_domain_attestation`: the request the proof answers. A proof made
54
+ * with a request-bound nonce (the app path) must be bound to exactly this
55
+ * scope and requestId. See core's `checkOidcPolicy`.
56
+ */
57
+ request?: OidcRequestContext;
51
58
  }
52
59
  /**
53
60
  * Verify a proof off-chain, against its verification key.
@@ -55,6 +62,12 @@ export interface OffChainVerifyOptions {
55
62
  * Needs no setup from the caller: the verifier ships with this SDK and is
56
63
  * loaded on first use.
57
64
  *
65
+ * For `oidc_domain_attestation` it first checks the token's audience, nonce and
66
+ * time (core's `checkOidcPolicy`, against `options.request` when given) and the
67
+ * proof's RSA key against the provider's published JWKS (core's
68
+ * `checkOidcProviderKey`); any refusal, or a JWKS that cannot be fetched, is
69
+ * `{ valid: false }`.
70
+ *
58
71
  * @param circuit - Canonical circuit identifier
59
72
  * @param proof - Proof bytes as hex, WITHOUT public inputs (as the relay sends it)
60
73
  * @param publicInputs - Public inputs as hex strings, in circuit order
package/dist/types.d.ts CHANGED
@@ -350,6 +350,14 @@ export interface ProofportConfig {
350
350
  relayUrl?: string;
351
351
  /** Custom verifier contract addresses per circuit type (overrides defaults) */
352
352
  verifiers?: Partial<Record<CircuitType, VerifierContract>>;
353
+ /**
354
+ * @internal Which environment's chains a circuit with no configured
355
+ * verifier is verified on (the pinned verifier on that chain).
356
+ * `ProofportSDK.create(env)` sets it; set it yourself only alongside a custom
357
+ * `relayUrl`, e.g. a local relay on a LAN address. Without it, and without a
358
+ * configured verifier, verification fails rather than guessing.
359
+ */
360
+ environment?: SDKEnvironment;
353
361
  }
354
362
  /**
355
363
  * Parsed deep link URL components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkproofport-app/sdk",
3
- "version": "0.5.0-beta.1",
3
+ "version": "0.5.0-beta.3",
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.1.2"
45
+ "@zkproofport-app/core": "0.3.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@rollup/plugin-commonjs": "^25.0.7",