@provex/proving 1.8.0 → 1.9.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/{chunk-LFDS3XGK.js → chunk-OSBIXUFA.js} +46 -11
- package/dist/chunk-OSBIXUFA.js.map +1 -0
- package/dist/index.cjs +64 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -5
- package/dist/index.d.ts +157 -5
- package/dist/index.js +75 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-ByiBb7AN.d.ts → useProving-h4RtlSEU.d.cts} +98 -1
- package/dist/{types-ByiBb7AN.d.cts → useProving-h4RtlSEU.d.ts} +98 -1
- package/dist/useProving.cjs +43 -8
- package/dist/useProving.cjs.map +1 -1
- package/dist/useProving.d.cts +3 -90
- package/dist/useProving.d.ts +3 -90
- package/dist/useProving.js +1 -1
- package/package.json +2 -8
- package/dist/adapters/extensionEnclave.cjs +0 -160
- package/dist/adapters/extensionEnclave.cjs.map +0 -1
- package/dist/adapters/extensionEnclave.d.cts +0 -5
- package/dist/adapters/extensionEnclave.d.ts +0 -5
- package/dist/adapters/extensionEnclave.js +0 -3
- package/dist/adapters/extensionEnclave.js.map +0 -1
- package/dist/chunk-LFDS3XGK.js.map +0 -1
- package/dist/chunk-QLPNUQDA.js +0 -157
- package/dist/chunk-QLPNUQDA.js.map +0 -1
- package/dist/extensionEnclave-BjxXsuaj.d.cts +0 -119
- package/dist/extensionEnclave-DLCjCWxT.d.ts +0 -119
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { C as CaptureCandidate, c as CaptureAdapter } from './types-ByiBb7AN.js';
|
|
2
|
-
import { Hex } from 'viem';
|
|
3
|
-
import { V3AttestationResponseObject } from '@provex/utils';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @fileoverview Buyer trusted-execution attestation client.
|
|
7
|
-
*
|
|
8
|
-
* In PeerAuth extension 0.5.2+, capture produces a buyerTee proof —
|
|
9
|
-
* `{ proofType: 'buyerTee', encryptedSessionMaterial, params }` — where the
|
|
10
|
-
* bank session is already encrypted toward the enclave (cookies never reach
|
|
11
|
-
* our page in plaintext). Instead of re-signing a Reclaim proof through our
|
|
12
|
-
* gate, we hand that material to zkp2p's trusted-execution attestation
|
|
13
|
-
* service, which verifies the payment inside an Amazon Web Services Nitro
|
|
14
|
-
* enclave and signs the attestation directly.
|
|
15
|
-
*
|
|
16
|
-
* The response `responseObject` is the same `V3AttestationResponseObject`
|
|
17
|
-
* shape our gate returns, so it flows through the existing
|
|
18
|
-
* `encodeV3PaymentProof` path unchanged.
|
|
19
|
-
*
|
|
20
|
-
* Moved verbatim from `@provex/ui` (packages/ui/src/lib/buyerTeeAttestation.ts)
|
|
21
|
-
* with the base URL changed from a `@provex/ui` config import to an injected
|
|
22
|
-
* `attestationBaseUrl` argument so this package carries no `@provex/ui` dep.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Runtime shape of a buyerTee proof emitted by the PeerAuth extension.
|
|
27
|
-
* Narrow with {@link asBuyerTeeProof} before use.
|
|
28
|
-
*/
|
|
29
|
-
interface BuyerTeeProof {
|
|
30
|
-
proofType: 'buyerTee';
|
|
31
|
-
/** Session material already encrypted toward the enclave (opaque to us). */
|
|
32
|
-
encryptedSessionMaterial: string;
|
|
33
|
-
/** Platform-specific params, e.g. Revolut `{ index }`, Chase `{ index }`. */
|
|
34
|
-
params: unknown;
|
|
35
|
-
actionType?: string;
|
|
36
|
-
actionPlatform?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Narrow an extension proof to a buyerTee proof, or null when it is the
|
|
40
|
-
* legacy Reclaim shape (or malformed).
|
|
41
|
-
*/
|
|
42
|
-
declare function asBuyerTeeProof(proof: unknown): BuyerTeeProof | null;
|
|
43
|
-
/** Intent details the enclave binds the attestation to. */
|
|
44
|
-
interface BuyerTeeIntent {
|
|
45
|
-
intentHash: Hex;
|
|
46
|
-
amount: string;
|
|
47
|
-
timestampMs: string;
|
|
48
|
-
paymentMethod: Hex;
|
|
49
|
-
fiatCurrency: Hex;
|
|
50
|
-
conversionRate: string;
|
|
51
|
-
payeeDetails: Hex;
|
|
52
|
-
timestampBufferMs?: string;
|
|
53
|
-
}
|
|
54
|
-
interface RequestBuyerTeeAttestationArgs {
|
|
55
|
-
/** Gate/attestation origin (was `gateForwarderBaseUrl` in @provex/ui). */
|
|
56
|
-
attestationBaseUrl: string;
|
|
57
|
-
/** Extension platform / bank key, e.g. `revolut`, `chase`. */
|
|
58
|
-
platform: string;
|
|
59
|
-
/** Action type, e.g. `transfer_revolut`, `transfer_zelle`. */
|
|
60
|
-
actionType: string;
|
|
61
|
-
/** Encrypted session material from the buyerTee capture. */
|
|
62
|
-
encryptedSessionMaterial: string;
|
|
63
|
-
/** Platform params from the capture (e.g. `{ index }`). */
|
|
64
|
-
params: unknown;
|
|
65
|
-
/** PulseChain UnifiedPaymentVerifier the gate re-signs the attestation for. */
|
|
66
|
-
verifyingContract: string;
|
|
67
|
-
intent: BuyerTeeIntent;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Verify a buyer payment via the gate. The gate proxies the encrypted capture
|
|
71
|
-
* to zkp2p's enclave, then re-signs the resulting attestation for PulseChain
|
|
72
|
-
* with our witness key — the enclave itself refuses to sign for 369.
|
|
73
|
-
*
|
|
74
|
-
* Throws with the gate's error text on a non-2xx response.
|
|
75
|
-
*/
|
|
76
|
-
declare function requestBuyerTeeAttestation(args: RequestBuyerTeeAttestationArgs): Promise<V3AttestationResponseObject>;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @fileoverview Extension + enclave CaptureAdapter (the v1 capture backend).
|
|
80
|
-
*
|
|
81
|
-
* Mirrors the live AuthenticateStep + GenerateProofStep enclave path
|
|
82
|
-
* (AuthenticateStep.tsx:224-281, GenerateProofStep.tsx:237-251) reduced to
|
|
83
|
-
* the buyerTee branch. Talks to an injected `window.peer`-shaped client so
|
|
84
|
-
* @provex/proving stays framework-agnostic and needs no @provex/extension-react
|
|
85
|
-
* import (spec dependency-direction, lines 103-110).
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/** Minimal shape of the metadata response the extension posts back. */
|
|
89
|
-
interface MetadataResponse {
|
|
90
|
-
platform: string;
|
|
91
|
-
metadata: CaptureCandidate[];
|
|
92
|
-
buyerTeeCapture?: {
|
|
93
|
-
encryptedSessionMaterial: string;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/** Minimal slice of `window.peer` this adapter depends on. */
|
|
97
|
-
interface PeerClient {
|
|
98
|
-
authenticate(inputs: {
|
|
99
|
-
actionType: string;
|
|
100
|
-
platform: string;
|
|
101
|
-
captureMode: 'buyerTee';
|
|
102
|
-
}): Promise<void>;
|
|
103
|
-
onMetadataMessage(fn: (data: MetadataResponse) => void): () => void;
|
|
104
|
-
}
|
|
105
|
-
interface ExtensionEnclaveAdapterConfig {
|
|
106
|
-
/** Resolve the live peer client (e.g. `() => window.peer`). */
|
|
107
|
-
getPeer: () => PeerClient | undefined;
|
|
108
|
-
/** Gate/attestation origin handed to requestBuyerTeeAttestation. */
|
|
109
|
-
attestationBaseUrl: string;
|
|
110
|
-
/**
|
|
111
|
-
* Milliseconds before awaitMetadata rejects if the extension never posts a
|
|
112
|
-
* matching metadata message. Mirrors the 60-second timeout in
|
|
113
|
-
* AuthenticateStep.tsx:232-236. Defaults to 60000.
|
|
114
|
-
*/
|
|
115
|
-
timeoutMs?: number;
|
|
116
|
-
}
|
|
117
|
-
declare function createExtensionEnclaveAdapter(config: ExtensionEnclaveAdapterConfig): CaptureAdapter;
|
|
118
|
-
|
|
119
|
-
export { type BuyerTeeProof as B, type ExtensionEnclaveAdapterConfig as E, type PeerClient as P, type RequestBuyerTeeAttestationArgs as R, asBuyerTeeProof as a, type BuyerTeeIntent as b, createExtensionEnclaveAdapter as c, requestBuyerTeeAttestation as r };
|