@zkproofport-app/sdk 0.4.3 → 0.5.0-beta.0
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/circuits.d.ts +1 -236
- package/dist/circuits.esm.js +1 -250
- package/dist/circuits.esm.js.map +1 -1
- package/dist/circuits.js +9 -261
- package/dist/circuits.js.map +1 -1
- package/dist/circuits.mjs +1 -250
- package/dist/circuits.mjs.map +1 -1
- package/dist/constants.d.ts +1 -166
- package/dist/index.esm.js +39 -913
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +137 -951
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -913
- package/dist/index.mjs.map +1 -1
- package/dist/offChainVerifier.d.ts +17 -16
- package/dist/typedAction.d.ts +1 -34
- package/dist/typedAction.esm.js +1 -76
- package/dist/typedAction.esm.js.map +1 -1
- package/dist/typedAction.js +9 -76
- package/dist/typedAction.js.map +1 -1
- package/dist/typedAction.mjs +1 -76
- package/dist/typedAction.mjs.map +1 -1
- package/dist/types.d.ts +2 -83
- package/dist/verifier.d.ts +1 -186
- package/package.json +8 -4
|
@@ -11,27 +11,28 @@
|
|
|
11
11
|
* (through mopro's native Barretenberg); it was only the JavaScript side that
|
|
12
12
|
* had no such thing.
|
|
13
13
|
*
|
|
14
|
-
* HOW IT WORKS. Proofs here are made
|
|
15
|
-
* the matching check is
|
|
16
|
-
*
|
|
14
|
+
* HOW IT WORKS. Proofs here are made for the EVM target (`bb prove -t evm`:
|
|
15
|
+
* keccak transcript, ZK on), so the matching check is bb.js's
|
|
16
|
+
* `UltraHonkVerifierBackend.verifyProof(..., { verifierTarget: 'evm' })`. Two
|
|
17
|
+
* things have to line up:
|
|
17
18
|
*
|
|
18
|
-
* The version. `@aztec/bb.js
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* The version. `@aztec/bb.js` must be the WASM build of the same bb the
|
|
20
|
+
* circuits are compiled with -- `BB_VERSION` in circuits/toolchain.env,
|
|
21
|
+
* 4.2.0-aztecnr-rc.2 since the beta.19 toolchain. Versions are not
|
|
22
|
+
* interchangeable: on the Korea Mobile ID age circuit the 2025 nightly wrote
|
|
23
|
+
* a 16256-byte proof where bb 1.2.0 wrote 16224 for the identical circuit and
|
|
24
|
+
* witness, with the SAME verification key, so the key cannot warn you. A
|
|
25
|
+
* mismatch shows up only as verification failing.
|
|
24
26
|
*
|
|
25
|
-
* The
|
|
26
|
-
*
|
|
27
|
-
* a
|
|
28
|
-
*
|
|
29
|
-
* a corrupt proof, a mismatched key, or a missing SRS.
|
|
27
|
+
* The target. Verifying an EVM proof as any other target is not a polite
|
|
28
|
+
* false. With the 2025 nightly, keccak-without-ZK trapped the WebAssembly
|
|
29
|
+
* with a bare "unreachable" and the poseidon flavour answered false for a
|
|
30
|
+
* good proof.
|
|
30
31
|
*
|
|
31
32
|
* THE PROOF ARRIVES IN TWO PIECES. The mobile app splits what Barretenberg
|
|
32
33
|
* produced into `proof` and `publicInputs` before sending it, because the
|
|
33
|
-
* Solidity verifier takes them separately.
|
|
34
|
-
*
|
|
34
|
+
* Solidity verifier takes them separately. bb.js 4.x's verifier takes the same
|
|
35
|
+
* two pieces, so nothing is joined back here.
|
|
35
36
|
*/
|
|
36
37
|
import { type CircuitId } from './circuits';
|
|
37
38
|
export interface OffChainVerifyResult {
|
package/dist/typedAction.d.ts
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Checking the EIP-712 action a `giwa_attestation` proof binds to.
|
|
3
|
-
*
|
|
4
|
-
* Three places need this answer and they have to agree: a dapp building the
|
|
5
|
-
* request, this SDK validating a deep link, and the mobile app before it asks
|
|
6
|
-
* a wallet to sign. The check lived in the mobile app's demo screen and
|
|
7
|
-
* nowhere else, so an action arriving from a dapp reached the prover
|
|
8
|
-
* unexamined — and that is the path that ships.
|
|
9
|
-
*
|
|
10
|
-
* The circuit hashes the domain and the struct and proves the wallet signed
|
|
11
|
-
* them. It never learns what the action says, so a malformed one does not
|
|
12
|
-
* fail: it produces a valid proof of the wrong thing.
|
|
13
|
-
*/
|
|
14
|
-
import type { TypedAction } from './types';
|
|
15
|
-
export type { TypedAction };
|
|
16
|
-
/**
|
|
17
|
-
* The reason the value is not a usable action, or `null` when it is one.
|
|
18
|
-
*
|
|
19
|
-
* Structural validation only, not application authorization policy. Consumers
|
|
20
|
-
* (e.g. EligibilityGate) must independently enforce the expected chain, verifying
|
|
21
|
-
* contract, actor, action parameters, nonce and deadline as applicable.
|
|
22
|
-
* EIP-712 signs only fields declared in types, not extra message properties.
|
|
23
|
-
*
|
|
24
|
-
* A string rather than a boolean because every caller shows it to somebody —
|
|
25
|
-
* a dapp developer reading a validation error, or a person looking at the
|
|
26
|
-
* mobile app's demo screen.
|
|
27
|
-
*/
|
|
28
|
-
export declare function validateTypedAction(value: unknown): string | null;
|
|
29
|
-
/** The action, or the reason it is not one. For text a person typed. */
|
|
30
|
-
export declare function parseTypedAction(text: string): {
|
|
31
|
-
action: TypedAction;
|
|
32
|
-
} | {
|
|
33
|
-
error: string;
|
|
34
|
-
};
|
|
1
|
+
export * from '@zkproofport-app/core/typedAction';
|
package/dist/typedAction.esm.js
CHANGED
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* The reason the value is not a usable action, or `null` when it is one.
|
|
4
|
-
*
|
|
5
|
-
* Structural validation only, not application authorization policy. Consumers
|
|
6
|
-
* (e.g. EligibilityGate) must independently enforce the expected chain, verifying
|
|
7
|
-
* contract, actor, action parameters, nonce and deadline as applicable.
|
|
8
|
-
* EIP-712 signs only fields declared in types, not extra message properties.
|
|
9
|
-
*
|
|
10
|
-
* A string rather than a boolean because every caller shows it to somebody —
|
|
11
|
-
* a dapp developer reading a validation error, or a person looking at the
|
|
12
|
-
* mobile app's demo screen.
|
|
13
|
-
*/
|
|
14
|
-
function validateTypedAction(value) {
|
|
15
|
-
if (value === undefined || value === null) {
|
|
16
|
-
return 'action is required. The circuit proves that a wallet authorised ONE EIP-712 action; there is nothing to prove without it.';
|
|
17
|
-
}
|
|
18
|
-
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
19
|
-
return 'action must be an object.';
|
|
20
|
-
}
|
|
21
|
-
const a = value;
|
|
22
|
-
const d = a.domain;
|
|
23
|
-
if (!d || typeof d !== 'object') {
|
|
24
|
-
return 'action.domain is required.';
|
|
25
|
-
}
|
|
26
|
-
for (const k of ['name', 'version', 'verifyingContract']) {
|
|
27
|
-
if (typeof d[k] !== 'string' || !d[k]) {
|
|
28
|
-
return `action.domain.${k} must be a non-empty string.`;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (typeof d.chainId !== 'number' || !Number.isInteger(d.chainId)) {
|
|
32
|
-
return 'action.domain.chainId must be an integer.';
|
|
33
|
-
}
|
|
34
|
-
if (!ADDRESS.test(d.verifyingContract)) {
|
|
35
|
-
return 'action.domain.verifyingContract must be a 20-byte hex address.';
|
|
36
|
-
}
|
|
37
|
-
if (!a.types || typeof a.types !== 'object' || Array.isArray(a.types)) {
|
|
38
|
-
return 'action.types is required.';
|
|
39
|
-
}
|
|
40
|
-
if (typeof a.primaryType !== 'string' || !a.primaryType) {
|
|
41
|
-
return 'action.primaryType is required.';
|
|
42
|
-
}
|
|
43
|
-
if (!(a.primaryType in a.types)) {
|
|
44
|
-
return `action.primaryType '${a.primaryType}' is not one of the structs in action.types.`;
|
|
45
|
-
}
|
|
46
|
-
if (!a.message || typeof a.message !== 'object' || Array.isArray(a.message)) {
|
|
47
|
-
return 'action.message is required.';
|
|
48
|
-
}
|
|
49
|
-
// Every field the struct declares must be present, or the wallet signs a
|
|
50
|
-
// different message than the one the caller described.
|
|
51
|
-
const fields = a.types[a.primaryType];
|
|
52
|
-
if (!Array.isArray(fields) || fields.length === 0) {
|
|
53
|
-
return `action.types.${a.primaryType} declares no fields.`;
|
|
54
|
-
}
|
|
55
|
-
const missing = fields
|
|
56
|
-
.map(f => f?.name)
|
|
57
|
-
.filter(n => typeof n === 'string' && !(n in a.message));
|
|
58
|
-
if (missing.length) {
|
|
59
|
-
return `action.message is missing: ${missing.join(', ')}`;
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
/** The action, or the reason it is not one. For text a person typed. */
|
|
64
|
-
function parseTypedAction(text) {
|
|
65
|
-
let raw;
|
|
66
|
-
try {
|
|
67
|
-
raw = JSON.parse(text);
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
return { error: `Not valid JSON: ${e.message}` };
|
|
71
|
-
}
|
|
72
|
-
const error = validateTypedAction(raw);
|
|
73
|
-
return error ? { error } : { action: raw };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export { parseTypedAction, validateTypedAction };
|
|
1
|
+
export * from '@zkproofport-app/core/typedAction';
|
|
77
2
|
//# sourceMappingURL=typedAction.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedAction.esm.js","sources":[
|
|
1
|
+
{"version":3,"file":"typedAction.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/typedAction.js
CHANGED
|
@@ -1,80 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The reason the value is not a usable action, or `null` when it is one.
|
|
6
|
-
*
|
|
7
|
-
* Structural validation only, not application authorization policy. Consumers
|
|
8
|
-
* (e.g. EligibilityGate) must independently enforce the expected chain, verifying
|
|
9
|
-
* contract, actor, action parameters, nonce and deadline as applicable.
|
|
10
|
-
* EIP-712 signs only fields declared in types, not extra message properties.
|
|
11
|
-
*
|
|
12
|
-
* A string rather than a boolean because every caller shows it to somebody —
|
|
13
|
-
* a dapp developer reading a validation error, or a person looking at the
|
|
14
|
-
* mobile app's demo screen.
|
|
15
|
-
*/
|
|
16
|
-
function validateTypedAction(value) {
|
|
17
|
-
if (value === undefined || value === null) {
|
|
18
|
-
return 'action is required. The circuit proves that a wallet authorised ONE EIP-712 action; there is nothing to prove without it.';
|
|
19
|
-
}
|
|
20
|
-
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
21
|
-
return 'action must be an object.';
|
|
22
|
-
}
|
|
23
|
-
const a = value;
|
|
24
|
-
const d = a.domain;
|
|
25
|
-
if (!d || typeof d !== 'object') {
|
|
26
|
-
return 'action.domain is required.';
|
|
27
|
-
}
|
|
28
|
-
for (const k of ['name', 'version', 'verifyingContract']) {
|
|
29
|
-
if (typeof d[k] !== 'string' || !d[k]) {
|
|
30
|
-
return `action.domain.${k} must be a non-empty string.`;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (typeof d.chainId !== 'number' || !Number.isInteger(d.chainId)) {
|
|
34
|
-
return 'action.domain.chainId must be an integer.';
|
|
35
|
-
}
|
|
36
|
-
if (!ADDRESS.test(d.verifyingContract)) {
|
|
37
|
-
return 'action.domain.verifyingContract must be a 20-byte hex address.';
|
|
38
|
-
}
|
|
39
|
-
if (!a.types || typeof a.types !== 'object' || Array.isArray(a.types)) {
|
|
40
|
-
return 'action.types is required.';
|
|
41
|
-
}
|
|
42
|
-
if (typeof a.primaryType !== 'string' || !a.primaryType) {
|
|
43
|
-
return 'action.primaryType is required.';
|
|
44
|
-
}
|
|
45
|
-
if (!(a.primaryType in a.types)) {
|
|
46
|
-
return `action.primaryType '${a.primaryType}' is not one of the structs in action.types.`;
|
|
47
|
-
}
|
|
48
|
-
if (!a.message || typeof a.message !== 'object' || Array.isArray(a.message)) {
|
|
49
|
-
return 'action.message is required.';
|
|
50
|
-
}
|
|
51
|
-
// Every field the struct declares must be present, or the wallet signs a
|
|
52
|
-
// different message than the one the caller described.
|
|
53
|
-
const fields = a.types[a.primaryType];
|
|
54
|
-
if (!Array.isArray(fields) || fields.length === 0) {
|
|
55
|
-
return `action.types.${a.primaryType} declares no fields.`;
|
|
56
|
-
}
|
|
57
|
-
const missing = fields
|
|
58
|
-
.map(f => f?.name)
|
|
59
|
-
.filter(n => typeof n === 'string' && !(n in a.message));
|
|
60
|
-
if (missing.length) {
|
|
61
|
-
return `action.message is missing: ${missing.join(', ')}`;
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
/** The action, or the reason it is not one. For text a person typed. */
|
|
66
|
-
function parseTypedAction(text) {
|
|
67
|
-
let raw;
|
|
68
|
-
try {
|
|
69
|
-
raw = JSON.parse(text);
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
return { error: `Not valid JSON: ${e.message}` };
|
|
73
|
-
}
|
|
74
|
-
const error = validateTypedAction(raw);
|
|
75
|
-
return error ? { error } : { action: raw };
|
|
76
|
-
}
|
|
3
|
+
var typedAction = require('@zkproofport-app/core/typedAction');
|
|
77
4
|
|
|
78
|
-
|
|
79
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(typedAction).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return typedAction[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
80
13
|
//# sourceMappingURL=typedAction.js.map
|
package/dist/typedAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedAction.js","sources":[
|
|
1
|
+
{"version":3,"file":"typedAction.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/dist/typedAction.mjs
CHANGED
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* The reason the value is not a usable action, or `null` when it is one.
|
|
4
|
-
*
|
|
5
|
-
* Structural validation only, not application authorization policy. Consumers
|
|
6
|
-
* (e.g. EligibilityGate) must independently enforce the expected chain, verifying
|
|
7
|
-
* contract, actor, action parameters, nonce and deadline as applicable.
|
|
8
|
-
* EIP-712 signs only fields declared in types, not extra message properties.
|
|
9
|
-
*
|
|
10
|
-
* A string rather than a boolean because every caller shows it to somebody —
|
|
11
|
-
* a dapp developer reading a validation error, or a person looking at the
|
|
12
|
-
* mobile app's demo screen.
|
|
13
|
-
*/
|
|
14
|
-
function validateTypedAction(value) {
|
|
15
|
-
if (value === undefined || value === null) {
|
|
16
|
-
return 'action is required. The circuit proves that a wallet authorised ONE EIP-712 action; there is nothing to prove without it.';
|
|
17
|
-
}
|
|
18
|
-
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
19
|
-
return 'action must be an object.';
|
|
20
|
-
}
|
|
21
|
-
const a = value;
|
|
22
|
-
const d = a.domain;
|
|
23
|
-
if (!d || typeof d !== 'object') {
|
|
24
|
-
return 'action.domain is required.';
|
|
25
|
-
}
|
|
26
|
-
for (const k of ['name', 'version', 'verifyingContract']) {
|
|
27
|
-
if (typeof d[k] !== 'string' || !d[k]) {
|
|
28
|
-
return `action.domain.${k} must be a non-empty string.`;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (typeof d.chainId !== 'number' || !Number.isInteger(d.chainId)) {
|
|
32
|
-
return 'action.domain.chainId must be an integer.';
|
|
33
|
-
}
|
|
34
|
-
if (!ADDRESS.test(d.verifyingContract)) {
|
|
35
|
-
return 'action.domain.verifyingContract must be a 20-byte hex address.';
|
|
36
|
-
}
|
|
37
|
-
if (!a.types || typeof a.types !== 'object' || Array.isArray(a.types)) {
|
|
38
|
-
return 'action.types is required.';
|
|
39
|
-
}
|
|
40
|
-
if (typeof a.primaryType !== 'string' || !a.primaryType) {
|
|
41
|
-
return 'action.primaryType is required.';
|
|
42
|
-
}
|
|
43
|
-
if (!(a.primaryType in a.types)) {
|
|
44
|
-
return `action.primaryType '${a.primaryType}' is not one of the structs in action.types.`;
|
|
45
|
-
}
|
|
46
|
-
if (!a.message || typeof a.message !== 'object' || Array.isArray(a.message)) {
|
|
47
|
-
return 'action.message is required.';
|
|
48
|
-
}
|
|
49
|
-
// Every field the struct declares must be present, or the wallet signs a
|
|
50
|
-
// different message than the one the caller described.
|
|
51
|
-
const fields = a.types[a.primaryType];
|
|
52
|
-
if (!Array.isArray(fields) || fields.length === 0) {
|
|
53
|
-
return `action.types.${a.primaryType} declares no fields.`;
|
|
54
|
-
}
|
|
55
|
-
const missing = fields
|
|
56
|
-
.map(f => f?.name)
|
|
57
|
-
.filter(n => typeof n === 'string' && !(n in a.message));
|
|
58
|
-
if (missing.length) {
|
|
59
|
-
return `action.message is missing: ${missing.join(', ')}`;
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
/** The action, or the reason it is not one. For text a person typed. */
|
|
64
|
-
function parseTypedAction(text) {
|
|
65
|
-
let raw;
|
|
66
|
-
try {
|
|
67
|
-
raw = JSON.parse(text);
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
return { error: `Not valid JSON: ${e.message}` };
|
|
71
|
-
}
|
|
72
|
-
const error = validateTypedAction(raw);
|
|
73
|
-
return error ? { error } : { action: raw };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export { parseTypedAction, validateTypedAction };
|
|
1
|
+
export * from '@zkproofport-app/core/typedAction';
|
|
77
2
|
//# sourceMappingURL=typedAction.mjs.map
|
package/dist/typedAction.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedAction.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"typedAction.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ZKProofport SDK Types
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
* Zero-knowledge circuit identifiers.
|
|
7
|
-
* Uses canonical circuit names matching Nargo.toml circuit definitions.
|
|
8
|
-
*
|
|
9
|
-
* Alias of {@link CircuitId}, which is defined in `./circuits` — the single
|
|
10
|
-
* source of truth for circuit identifiers. Adding a circuit there widens this
|
|
11
|
-
* type automatically, so the two can never disagree.
|
|
12
|
-
*
|
|
13
|
-
* Note that this union includes circuits marked `planned` in
|
|
14
|
-
* `CIRCUIT_SUPPORT_STATUS`; being assignable is not a support guarantee.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const circuit: CircuitType = 'coinbase_attestation';
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export type CircuitType = CircuitId;
|
|
4
|
+
import type { CircuitType, TypedAction, ParsedProof, VerifierContract } from '@zkproofport-app/core';
|
|
5
|
+
export type { CircuitType, TypedAction, ParsedProof, VerifierContract };
|
|
22
6
|
/**
|
|
23
7
|
* Proof request lifecycle status.
|
|
24
8
|
*
|
|
@@ -167,43 +151,6 @@ export interface MdlKrRegionInputs {
|
|
|
167
151
|
*/
|
|
168
152
|
export interface EmptyInputs {
|
|
169
153
|
}
|
|
170
|
-
/**
|
|
171
|
-
* The EIP-712 action a `giwa_attestation` proof binds the wallet's signature to.
|
|
172
|
-
*
|
|
173
|
-
* Exactly what `eth_signTypedData_v4` takes, because that is what the wallet is
|
|
174
|
-
* shown and what it signs. The app does not build this — the dapp does — so the
|
|
175
|
-
* user reads the dapp's own field names and values in their wallet instead of
|
|
176
|
-
* an opaque hash.
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```typescript
|
|
180
|
-
* const action: TypedAction = {
|
|
181
|
-
* domain: { name: 'MyVault', version: '1', chainId: 91342,
|
|
182
|
-
* verifyingContract: '0x…' },
|
|
183
|
-
* types: { Deposit: [ { name: 'amount', type: 'uint256' },
|
|
184
|
-
* { name: 'nonce', type: 'uint256' } ] },
|
|
185
|
-
* primaryType: 'Deposit',
|
|
186
|
-
* message: { amount: '1000000', nonce: '7' },
|
|
187
|
-
* };
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
export interface TypedAction {
|
|
191
|
-
domain: {
|
|
192
|
-
name: string;
|
|
193
|
-
version: string;
|
|
194
|
-
chainId: number;
|
|
195
|
-
/** The contract that will verify this signature. */
|
|
196
|
-
verifyingContract: string;
|
|
197
|
-
};
|
|
198
|
-
/** EIP-712 struct definitions. `EIP712Domain` is added by the wallet. */
|
|
199
|
-
types: Record<string, Array<{
|
|
200
|
-
name: string;
|
|
201
|
-
type: string;
|
|
202
|
-
}>>;
|
|
203
|
-
/** Which struct in `types` the message is. */
|
|
204
|
-
primaryType: string;
|
|
205
|
-
message: Record<string, unknown>;
|
|
206
|
-
}
|
|
207
154
|
/**
|
|
208
155
|
* Input parameters for circuits that can bind an EIP-712 action
|
|
209
156
|
* (`giwa_attestation`).
|
|
@@ -334,20 +281,6 @@ export interface ProofResponse {
|
|
|
334
281
|
/** Chain ID where verifier contract is deployed (provided by mobile app) */
|
|
335
282
|
chainId?: number;
|
|
336
283
|
}
|
|
337
|
-
/**
|
|
338
|
-
* Parsed and formatted proof data ready for on-chain verification.
|
|
339
|
-
*
|
|
340
|
-
* Internal representation used by the SDK to prepare proof data
|
|
341
|
-
* for smart contract verification calls.
|
|
342
|
-
*/
|
|
343
|
-
export interface ParsedProof {
|
|
344
|
-
/** Proof bytes as hex string with 0x prefix */
|
|
345
|
-
proofHex: string;
|
|
346
|
-
/** Public inputs as array of hex strings with 0x prefix */
|
|
347
|
-
publicInputsHex: string[];
|
|
348
|
-
/** Number of public inputs (must match circuit specification) */
|
|
349
|
-
numPublicInputs: number;
|
|
350
|
-
}
|
|
351
284
|
/**
|
|
352
285
|
* QR code generation options for deep link encoding.
|
|
353
286
|
*
|
|
@@ -376,20 +309,6 @@ export interface QRCodeOptions {
|
|
|
376
309
|
/** Background color as hex string (default: #ffffff) */
|
|
377
310
|
lightColor?: string;
|
|
378
311
|
}
|
|
379
|
-
/**
|
|
380
|
-
* Verifier smart contract configuration.
|
|
381
|
-
*
|
|
382
|
-
* Contains the address and ABI for a circuit's verifier contract on a specific chain.
|
|
383
|
-
* Each circuit has its own verifier contract that validates proofs on-chain.
|
|
384
|
-
*/
|
|
385
|
-
export interface VerifierContract {
|
|
386
|
-
/** Verifier contract address (checksummed) */
|
|
387
|
-
address: string;
|
|
388
|
-
/** Chain ID where contract is deployed (e.g., 84532 for Base Sepolia) */
|
|
389
|
-
chainId: number;
|
|
390
|
-
/** Contract ABI for verify function (ethers v6 format) */
|
|
391
|
-
abi: string[];
|
|
392
|
-
}
|
|
393
312
|
/**
|
|
394
313
|
* ZKProofport SDK configuration options.
|
|
395
314
|
*
|