@kynesyslabs/demosdk 2.8.6 → 2.8.7
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/build/tlsnotary/TLSNotaryService.d.ts +187 -0
- package/build/tlsnotary/TLSNotaryService.js +307 -0
- package/build/tlsnotary/TLSNotaryService.js.map +1 -1
- package/build/tlsnotary/index.d.ts +1 -1
- package/build/tlsnotary/index.js.map +1 -1
- package/build/websdk/index.d.ts +1 -0
- package/build/websdk/index.js +5 -1
- package/build/websdk/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
import type { Demos } from "../websdk/demosclass";
|
|
40
|
+
import { TLSNotary } from "./TLSNotary";
|
|
41
|
+
import type { StatusCallback } from "./types";
|
|
40
42
|
/**
|
|
41
43
|
* Response from requestAttestation
|
|
42
44
|
*/
|
|
@@ -100,6 +102,35 @@ export interface StoreProofOptions {
|
|
|
100
102
|
/** Storage location: on-chain or IPFS */
|
|
101
103
|
storage: "onchain" | "ipfs";
|
|
102
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Transaction details for user confirmation
|
|
107
|
+
*/
|
|
108
|
+
export interface TransactionDetails {
|
|
109
|
+
/** The signed transaction object */
|
|
110
|
+
transaction: any;
|
|
111
|
+
/** Transaction hash */
|
|
112
|
+
txHash: string;
|
|
113
|
+
/** Amount in DEM being burned/spent */
|
|
114
|
+
amount: number;
|
|
115
|
+
/** Description of what this transaction does */
|
|
116
|
+
description: string;
|
|
117
|
+
/** Target URL for attestation requests */
|
|
118
|
+
targetUrl?: string;
|
|
119
|
+
/** Token ID for store transactions */
|
|
120
|
+
tokenId?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Callback for user to confirm or reject a transaction
|
|
124
|
+
* Return true to proceed with broadcast, false to cancel
|
|
125
|
+
*/
|
|
126
|
+
export type TransactionConfirmCallback = (details: TransactionDetails) => Promise<boolean>;
|
|
127
|
+
/**
|
|
128
|
+
* Options for methods that require user confirmation
|
|
129
|
+
*/
|
|
130
|
+
export interface WithConfirmationOptions {
|
|
131
|
+
/** Callback for user to confirm or reject the transaction */
|
|
132
|
+
onConfirm: TransactionConfirmCallback;
|
|
133
|
+
}
|
|
103
134
|
/**
|
|
104
135
|
* TLSNotary Service for managing attestation tokens and proof storage
|
|
105
136
|
*/
|
|
@@ -128,6 +159,128 @@ export declare class TLSNotaryService {
|
|
|
128
159
|
* ```
|
|
129
160
|
*/
|
|
130
161
|
requestAttestation(options: RequestAttestationOptions): Promise<AttestationTokenResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Request an attestation token with user confirmation before broadcasting
|
|
164
|
+
*
|
|
165
|
+
* This method shows the transaction details to the user via the onConfirm callback
|
|
166
|
+
* and only broadcasts if the user confirms. This is the recommended way to request
|
|
167
|
+
* attestation tokens in user-facing applications.
|
|
168
|
+
*
|
|
169
|
+
* @param options - Request options including target URL
|
|
170
|
+
* @param confirmOptions - Options containing the confirmation callback
|
|
171
|
+
* @returns Attestation token response with proxyUrl and tokenId
|
|
172
|
+
* @throws Error if user rejects the transaction
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```typescript
|
|
176
|
+
* const { proxyUrl, tokenId } = await service.requestAttestationWithConfirmation(
|
|
177
|
+
* { targetUrl: 'https://api.github.com/users/octocat' },
|
|
178
|
+
* {
|
|
179
|
+
* onConfirm: async (details) => {
|
|
180
|
+
* // Show confirmation dialog to user
|
|
181
|
+
* return await showConfirmDialog({
|
|
182
|
+
* title: 'Confirm Attestation Request',
|
|
183
|
+
* message: `This will burn ${details.amount} DEM to request attestation for ${details.targetUrl}`,
|
|
184
|
+
* txHash: details.txHash,
|
|
185
|
+
* });
|
|
186
|
+
* }
|
|
187
|
+
* }
|
|
188
|
+
* );
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
requestAttestationWithConfirmation(options: RequestAttestationOptions, confirmOptions: WithConfirmationOptions): Promise<AttestationTokenResponse>;
|
|
192
|
+
/**
|
|
193
|
+
* Request attestation token and create a pre-configured TLSNotary instance
|
|
194
|
+
*
|
|
195
|
+
* This is the recommended way to perform attestations. It handles:
|
|
196
|
+
* 1. Creating and broadcasting the TLSN_REQUEST transaction
|
|
197
|
+
* 2. Waiting for the token to be created
|
|
198
|
+
* 3. Getting the proxy URL
|
|
199
|
+
* 4. Creating a TLSNotary instance configured with that proxy
|
|
200
|
+
* 5. Initializing the WASM module
|
|
201
|
+
*
|
|
202
|
+
* The returned TLSNotary instance is ready to call `attest()` immediately.
|
|
203
|
+
*
|
|
204
|
+
* @param options - Request options including target URL
|
|
205
|
+
* @param onStatus - Optional status callback for progress updates
|
|
206
|
+
* @returns Object with TLSNotary instance, tokenId, and proxyUrl
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const service = new TLSNotaryService(demos);
|
|
211
|
+
*
|
|
212
|
+
* // Get a ready-to-use TLSNotary instance
|
|
213
|
+
* const { tlsn, tokenId, proxyUrl } = await service.createTLSNotary({
|
|
214
|
+
* targetUrl: 'https://api.github.com/users/octocat'
|
|
215
|
+
* });
|
|
216
|
+
*
|
|
217
|
+
* // Perform attestation - the proxy is already configured!
|
|
218
|
+
* const result = await tlsn.attest({
|
|
219
|
+
* url: 'https://api.github.com/users/octocat',
|
|
220
|
+
* });
|
|
221
|
+
*
|
|
222
|
+
* // Store proof on-chain
|
|
223
|
+
* await service.storeProof(tokenId, JSON.stringify(result.presentation), { storage: 'onchain' });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
createTLSNotary(options: RequestAttestationOptions, onStatus?: StatusCallback): Promise<{
|
|
227
|
+
tlsn: TLSNotary;
|
|
228
|
+
tokenId: string;
|
|
229
|
+
proxyUrl: string;
|
|
230
|
+
expiresAt: number;
|
|
231
|
+
}>;
|
|
232
|
+
/**
|
|
233
|
+
* Request attestation token and create a pre-configured TLSNotary instance
|
|
234
|
+
* WITH user confirmation before broadcasting the transaction.
|
|
235
|
+
*
|
|
236
|
+
* This is the recommended way to perform attestations in user-facing applications.
|
|
237
|
+
* It handles:
|
|
238
|
+
* 1. Creating the TLSN_REQUEST transaction
|
|
239
|
+
* 2. **Asking the user to confirm via the onConfirm callback**
|
|
240
|
+
* 3. Broadcasting the transaction if confirmed
|
|
241
|
+
* 4. Waiting for the token to be created
|
|
242
|
+
* 5. Getting the proxy URL
|
|
243
|
+
* 6. Creating a TLSNotary instance configured with that proxy
|
|
244
|
+
* 7. Initializing the WASM module
|
|
245
|
+
*
|
|
246
|
+
* @param options - Request options including target URL
|
|
247
|
+
* @param confirmOptions - Options containing the confirmation callback
|
|
248
|
+
* @param onStatus - Optional status callback for progress updates
|
|
249
|
+
* @returns Object with TLSNotary instance, tokenId, and proxyUrl
|
|
250
|
+
* @throws Error if user rejects the transaction
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```typescript
|
|
254
|
+
* const service = new TLSNotaryService(demos);
|
|
255
|
+
*
|
|
256
|
+
* // Get a ready-to-use TLSNotary instance with user confirmation
|
|
257
|
+
* const { tlsn, tokenId, proxyUrl } = await service.createTLSNotaryWithConfirmation(
|
|
258
|
+
* { targetUrl: 'https://api.github.com/users/octocat' },
|
|
259
|
+
* {
|
|
260
|
+
* onConfirm: async (details) => {
|
|
261
|
+
* // Show confirmation dialog to user in your UI
|
|
262
|
+
* return await showConfirmDialog({
|
|
263
|
+
* title: 'Confirm Attestation',
|
|
264
|
+
* message: `Burn ${details.amount} DEM for attestation?`,
|
|
265
|
+
* txHash: details.txHash,
|
|
266
|
+
* });
|
|
267
|
+
* }
|
|
268
|
+
* },
|
|
269
|
+
* (status) => console.log(status)
|
|
270
|
+
* );
|
|
271
|
+
*
|
|
272
|
+
* // Perform attestation - the proxy is already configured!
|
|
273
|
+
* const result = await tlsn.attest({
|
|
274
|
+
* url: 'https://api.github.com/users/octocat',
|
|
275
|
+
* });
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
createTLSNotaryWithConfirmation(options: RequestAttestationOptions, confirmOptions: WithConfirmationOptions, onStatus?: StatusCallback): Promise<{
|
|
279
|
+
tlsn: TLSNotary;
|
|
280
|
+
tokenId: string;
|
|
281
|
+
proxyUrl: string;
|
|
282
|
+
expiresAt: number;
|
|
283
|
+
}>;
|
|
131
284
|
/**
|
|
132
285
|
* Store a TLSNotary proof on-chain or IPFS
|
|
133
286
|
*
|
|
@@ -151,6 +304,40 @@ export declare class TLSNotaryService {
|
|
|
151
304
|
* ```
|
|
152
305
|
*/
|
|
153
306
|
storeProof(tokenId: string, proof: string, options: StoreProofOptions): Promise<StoreProofResponse>;
|
|
307
|
+
/**
|
|
308
|
+
* Store a TLSNotary proof on-chain or IPFS with user confirmation
|
|
309
|
+
*
|
|
310
|
+
* This method shows the transaction details to the user via the onConfirm callback
|
|
311
|
+
* and only broadcasts if the user confirms. This is the recommended way to store
|
|
312
|
+
* proofs in user-facing applications.
|
|
313
|
+
*
|
|
314
|
+
* @param tokenId - The attestation token ID
|
|
315
|
+
* @param proof - The proof data (JSON string or serialized presentation)
|
|
316
|
+
* @param options - Storage options (on-chain or IPFS)
|
|
317
|
+
* @param confirmOptions - Options containing the confirmation callback
|
|
318
|
+
* @returns Storage response with transaction hash and fee
|
|
319
|
+
* @throws Error if user rejects the transaction
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```typescript
|
|
323
|
+
* const { txHash, storageFee } = await service.storeProofWithConfirmation(
|
|
324
|
+
* tokenId,
|
|
325
|
+
* JSON.stringify(presentation),
|
|
326
|
+
* { storage: 'onchain' },
|
|
327
|
+
* {
|
|
328
|
+
* onConfirm: async (details) => {
|
|
329
|
+
* // Show confirmation dialog to user
|
|
330
|
+
* return await showConfirmDialog({
|
|
331
|
+
* title: 'Confirm Proof Storage',
|
|
332
|
+
* message: `This will burn ${details.amount} DEM to store the proof on-chain`,
|
|
333
|
+
* txHash: details.txHash,
|
|
334
|
+
* });
|
|
335
|
+
* }
|
|
336
|
+
* }
|
|
337
|
+
* );
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
storeProofWithConfirmation(tokenId: string, proof: string, options: StoreProofOptions, confirmOptions: WithConfirmationOptions): Promise<StoreProofResponse>;
|
|
154
341
|
/**
|
|
155
342
|
* Calculate the storage fee for a proof
|
|
156
343
|
*
|
|
@@ -41,6 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.TLSNotaryService = void 0;
|
|
42
42
|
const DemosTransactions_1 = require("../websdk/DemosTransactions");
|
|
43
43
|
const unifiedCrypto_1 = require("../encryption/unifiedCrypto");
|
|
44
|
+
const TLSNotary_1 = require("./TLSNotary");
|
|
44
45
|
/**
|
|
45
46
|
* TLSNotary Service for managing attestation tokens and proof storage
|
|
46
47
|
*/
|
|
@@ -131,6 +132,246 @@ class TLSNotaryService {
|
|
|
131
132
|
retriesLeft: proxyResponse.retriesLeft ?? 3,
|
|
132
133
|
};
|
|
133
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Request an attestation token with user confirmation before broadcasting
|
|
137
|
+
*
|
|
138
|
+
* This method shows the transaction details to the user via the onConfirm callback
|
|
139
|
+
* and only broadcasts if the user confirms. This is the recommended way to request
|
|
140
|
+
* attestation tokens in user-facing applications.
|
|
141
|
+
*
|
|
142
|
+
* @param options - Request options including target URL
|
|
143
|
+
* @param confirmOptions - Options containing the confirmation callback
|
|
144
|
+
* @returns Attestation token response with proxyUrl and tokenId
|
|
145
|
+
* @throws Error if user rejects the transaction
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const { proxyUrl, tokenId } = await service.requestAttestationWithConfirmation(
|
|
150
|
+
* { targetUrl: 'https://api.github.com/users/octocat' },
|
|
151
|
+
* {
|
|
152
|
+
* onConfirm: async (details) => {
|
|
153
|
+
* // Show confirmation dialog to user
|
|
154
|
+
* return await showConfirmDialog({
|
|
155
|
+
* title: 'Confirm Attestation Request',
|
|
156
|
+
* message: `This will burn ${details.amount} DEM to request attestation for ${details.targetUrl}`,
|
|
157
|
+
* txHash: details.txHash,
|
|
158
|
+
* });
|
|
159
|
+
* }
|
|
160
|
+
* }
|
|
161
|
+
* );
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
async requestAttestationWithConfirmation(options, confirmOptions) {
|
|
165
|
+
const { targetUrl } = options;
|
|
166
|
+
const { onConfirm } = confirmOptions;
|
|
167
|
+
// Validate URL is HTTPS
|
|
168
|
+
const url = new URL(targetUrl);
|
|
169
|
+
if (url.protocol !== "https:") {
|
|
170
|
+
throw new Error("Only HTTPS URLs are supported for TLS attestation");
|
|
171
|
+
}
|
|
172
|
+
// 1. Create the transaction (but don't broadcast yet)
|
|
173
|
+
const tx = await this.createTlsnRequestTransaction(targetUrl);
|
|
174
|
+
// 2. Get confirmation from user
|
|
175
|
+
const details = {
|
|
176
|
+
transaction: tx,
|
|
177
|
+
txHash: tx.hash,
|
|
178
|
+
amount: 1,
|
|
179
|
+
description: "TLSNotary attestation request (burns 1 DEM)",
|
|
180
|
+
targetUrl,
|
|
181
|
+
};
|
|
182
|
+
const confirmed = await onConfirm(details);
|
|
183
|
+
if (!confirmed) {
|
|
184
|
+
throw new Error("Transaction rejected by user");
|
|
185
|
+
}
|
|
186
|
+
// 3. Now confirm and broadcast the transaction
|
|
187
|
+
const confirmResult = await DemosTransactions_1.DemosTransactions.confirm(tx, this.demos);
|
|
188
|
+
const broadcastResult = await DemosTransactions_1.DemosTransactions.broadcast(confirmResult, this.demos);
|
|
189
|
+
if (broadcastResult.result !== 200) {
|
|
190
|
+
throw new Error(`Failed to submit attestation request: ${broadcastResult.response?.message || "Unknown error"}`);
|
|
191
|
+
}
|
|
192
|
+
// 4. Wait for token to be created by polling with txHash
|
|
193
|
+
const txHash = tx.hash;
|
|
194
|
+
let tokenId;
|
|
195
|
+
const maxAttempts = 30;
|
|
196
|
+
const pollInterval = 1000;
|
|
197
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
198
|
+
const tokenResponse = await this.demos.nodeCall("tlsnotary.getToken", {
|
|
199
|
+
txHash,
|
|
200
|
+
});
|
|
201
|
+
if (tokenResponse?.token?.id) {
|
|
202
|
+
tokenId = tokenResponse.token.id;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
if (attempt < maxAttempts - 1) {
|
|
206
|
+
await new Promise(resolve => setTimeout(resolve, pollInterval));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (!tokenId) {
|
|
210
|
+
throw new Error(`Token not created after ${maxAttempts} seconds. Transaction may still be pending in mempool. txHash: ${txHash}`);
|
|
211
|
+
}
|
|
212
|
+
// 5. Get owner address
|
|
213
|
+
const { publicKey } = await this.demos.crypto.getIdentity("ed25519");
|
|
214
|
+
const owner = (0, unifiedCrypto_1.uint8ArrayToHex)(publicKey);
|
|
215
|
+
// 6. Call nodeCall to get proxy URL using the actual tokenId
|
|
216
|
+
const proxyResponse = (await this.demos.nodeCall("requestTLSNproxy", {
|
|
217
|
+
tokenId,
|
|
218
|
+
owner,
|
|
219
|
+
targetUrl,
|
|
220
|
+
}));
|
|
221
|
+
if (!proxyResponse || !proxyResponse.websocketProxyUrl) {
|
|
222
|
+
throw new Error("Failed to get proxy URL from node");
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
proxyUrl: proxyResponse.websocketProxyUrl,
|
|
226
|
+
tokenId,
|
|
227
|
+
expiresAt: Date.now() + (proxyResponse.expiresIn || 30000),
|
|
228
|
+
retriesLeft: proxyResponse.retriesLeft ?? 3,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Request attestation token and create a pre-configured TLSNotary instance
|
|
233
|
+
*
|
|
234
|
+
* This is the recommended way to perform attestations. It handles:
|
|
235
|
+
* 1. Creating and broadcasting the TLSN_REQUEST transaction
|
|
236
|
+
* 2. Waiting for the token to be created
|
|
237
|
+
* 3. Getting the proxy URL
|
|
238
|
+
* 4. Creating a TLSNotary instance configured with that proxy
|
|
239
|
+
* 5. Initializing the WASM module
|
|
240
|
+
*
|
|
241
|
+
* The returned TLSNotary instance is ready to call `attest()` immediately.
|
|
242
|
+
*
|
|
243
|
+
* @param options - Request options including target URL
|
|
244
|
+
* @param onStatus - Optional status callback for progress updates
|
|
245
|
+
* @returns Object with TLSNotary instance, tokenId, and proxyUrl
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* const service = new TLSNotaryService(demos);
|
|
250
|
+
*
|
|
251
|
+
* // Get a ready-to-use TLSNotary instance
|
|
252
|
+
* const { tlsn, tokenId, proxyUrl } = await service.createTLSNotary({
|
|
253
|
+
* targetUrl: 'https://api.github.com/users/octocat'
|
|
254
|
+
* });
|
|
255
|
+
*
|
|
256
|
+
* // Perform attestation - the proxy is already configured!
|
|
257
|
+
* const result = await tlsn.attest({
|
|
258
|
+
* url: 'https://api.github.com/users/octocat',
|
|
259
|
+
* });
|
|
260
|
+
*
|
|
261
|
+
* // Store proof on-chain
|
|
262
|
+
* await service.storeProof(tokenId, JSON.stringify(result.presentation), { storage: 'onchain' });
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
265
|
+
async createTLSNotary(options, onStatus) {
|
|
266
|
+
const status = onStatus || (() => { });
|
|
267
|
+
// Step 1: Request attestation token and get proxy URL
|
|
268
|
+
status("Requesting attestation token...");
|
|
269
|
+
const tokenResponse = await this.requestAttestation(options);
|
|
270
|
+
status(`Token obtained: ${tokenResponse.tokenId}`);
|
|
271
|
+
// Step 2: Get notary info from the node
|
|
272
|
+
status("Getting notary configuration...");
|
|
273
|
+
const notaryInfo = (await this.demos.nodeCall("tlsnotary.getInfo", {}));
|
|
274
|
+
if (!notaryInfo?.notaryUrl) {
|
|
275
|
+
throw new Error("Failed to get notary info from node");
|
|
276
|
+
}
|
|
277
|
+
// Step 3: Create TLSNotary instance with the pre-obtained proxy URL
|
|
278
|
+
// IMPORTANT: We only set websocketProxyUrl (not rpcUrl) so that TLSNotary
|
|
279
|
+
// uses our pre-obtained proxy instead of trying to request its own
|
|
280
|
+
status("Creating TLSNotary instance...");
|
|
281
|
+
const tlsn = new TLSNotary_1.TLSNotary({
|
|
282
|
+
notaryUrl: notaryInfo.notaryUrl,
|
|
283
|
+
websocketProxyUrl: tokenResponse.proxyUrl, // Use the proxy we already obtained!
|
|
284
|
+
notaryPublicKey: notaryInfo.publicKey,
|
|
285
|
+
// Note: rpcUrl is intentionally NOT set - this prevents TLSNotary
|
|
286
|
+
// from trying to request its own proxy in getProxyUrl()
|
|
287
|
+
});
|
|
288
|
+
// Step 4: Initialize WASM
|
|
289
|
+
status("Initializing TLSNotary WASM...");
|
|
290
|
+
await tlsn.initialize();
|
|
291
|
+
status("TLSNotary ready for attestation!");
|
|
292
|
+
return {
|
|
293
|
+
tlsn,
|
|
294
|
+
tokenId: tokenResponse.tokenId,
|
|
295
|
+
proxyUrl: tokenResponse.proxyUrl,
|
|
296
|
+
expiresAt: tokenResponse.expiresAt,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Request attestation token and create a pre-configured TLSNotary instance
|
|
301
|
+
* WITH user confirmation before broadcasting the transaction.
|
|
302
|
+
*
|
|
303
|
+
* This is the recommended way to perform attestations in user-facing applications.
|
|
304
|
+
* It handles:
|
|
305
|
+
* 1. Creating the TLSN_REQUEST transaction
|
|
306
|
+
* 2. **Asking the user to confirm via the onConfirm callback**
|
|
307
|
+
* 3. Broadcasting the transaction if confirmed
|
|
308
|
+
* 4. Waiting for the token to be created
|
|
309
|
+
* 5. Getting the proxy URL
|
|
310
|
+
* 6. Creating a TLSNotary instance configured with that proxy
|
|
311
|
+
* 7. Initializing the WASM module
|
|
312
|
+
*
|
|
313
|
+
* @param options - Request options including target URL
|
|
314
|
+
* @param confirmOptions - Options containing the confirmation callback
|
|
315
|
+
* @param onStatus - Optional status callback for progress updates
|
|
316
|
+
* @returns Object with TLSNotary instance, tokenId, and proxyUrl
|
|
317
|
+
* @throws Error if user rejects the transaction
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```typescript
|
|
321
|
+
* const service = new TLSNotaryService(demos);
|
|
322
|
+
*
|
|
323
|
+
* // Get a ready-to-use TLSNotary instance with user confirmation
|
|
324
|
+
* const { tlsn, tokenId, proxyUrl } = await service.createTLSNotaryWithConfirmation(
|
|
325
|
+
* { targetUrl: 'https://api.github.com/users/octocat' },
|
|
326
|
+
* {
|
|
327
|
+
* onConfirm: async (details) => {
|
|
328
|
+
* // Show confirmation dialog to user in your UI
|
|
329
|
+
* return await showConfirmDialog({
|
|
330
|
+
* title: 'Confirm Attestation',
|
|
331
|
+
* message: `Burn ${details.amount} DEM for attestation?`,
|
|
332
|
+
* txHash: details.txHash,
|
|
333
|
+
* });
|
|
334
|
+
* }
|
|
335
|
+
* },
|
|
336
|
+
* (status) => console.log(status)
|
|
337
|
+
* );
|
|
338
|
+
*
|
|
339
|
+
* // Perform attestation - the proxy is already configured!
|
|
340
|
+
* const result = await tlsn.attest({
|
|
341
|
+
* url: 'https://api.github.com/users/octocat',
|
|
342
|
+
* });
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
async createTLSNotaryWithConfirmation(options, confirmOptions, onStatus) {
|
|
346
|
+
const status = onStatus || (() => { });
|
|
347
|
+
// Step 1: Request attestation token with user confirmation
|
|
348
|
+
status("Preparing attestation request...");
|
|
349
|
+
const tokenResponse = await this.requestAttestationWithConfirmation(options, confirmOptions);
|
|
350
|
+
status(`Token obtained: ${tokenResponse.tokenId}`);
|
|
351
|
+
// Step 2: Get notary info from the node
|
|
352
|
+
status("Getting notary configuration...");
|
|
353
|
+
const notaryInfo = (await this.demos.nodeCall("tlsnotary.getInfo", {}));
|
|
354
|
+
if (!notaryInfo?.notaryUrl) {
|
|
355
|
+
throw new Error("Failed to get notary info from node");
|
|
356
|
+
}
|
|
357
|
+
// Step 3: Create TLSNotary instance with the pre-obtained proxy URL
|
|
358
|
+
status("Creating TLSNotary instance...");
|
|
359
|
+
const tlsn = new TLSNotary_1.TLSNotary({
|
|
360
|
+
notaryUrl: notaryInfo.notaryUrl,
|
|
361
|
+
websocketProxyUrl: tokenResponse.proxyUrl,
|
|
362
|
+
notaryPublicKey: notaryInfo.publicKey,
|
|
363
|
+
});
|
|
364
|
+
// Step 4: Initialize WASM
|
|
365
|
+
status("Initializing TLSNotary WASM...");
|
|
366
|
+
await tlsn.initialize();
|
|
367
|
+
status("TLSNotary ready for attestation!");
|
|
368
|
+
return {
|
|
369
|
+
tlsn,
|
|
370
|
+
tokenId: tokenResponse.tokenId,
|
|
371
|
+
proxyUrl: tokenResponse.proxyUrl,
|
|
372
|
+
expiresAt: tokenResponse.expiresAt,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
134
375
|
/**
|
|
135
376
|
* Store a TLSNotary proof on-chain or IPFS
|
|
136
377
|
*
|
|
@@ -173,6 +414,72 @@ class TLSNotaryService {
|
|
|
173
414
|
broadcastMessage: broadcastResult.response?.message || "Transaction accepted",
|
|
174
415
|
};
|
|
175
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* Store a TLSNotary proof on-chain or IPFS with user confirmation
|
|
419
|
+
*
|
|
420
|
+
* This method shows the transaction details to the user via the onConfirm callback
|
|
421
|
+
* and only broadcasts if the user confirms. This is the recommended way to store
|
|
422
|
+
* proofs in user-facing applications.
|
|
423
|
+
*
|
|
424
|
+
* @param tokenId - The attestation token ID
|
|
425
|
+
* @param proof - The proof data (JSON string or serialized presentation)
|
|
426
|
+
* @param options - Storage options (on-chain or IPFS)
|
|
427
|
+
* @param confirmOptions - Options containing the confirmation callback
|
|
428
|
+
* @returns Storage response with transaction hash and fee
|
|
429
|
+
* @throws Error if user rejects the transaction
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* const { txHash, storageFee } = await service.storeProofWithConfirmation(
|
|
434
|
+
* tokenId,
|
|
435
|
+
* JSON.stringify(presentation),
|
|
436
|
+
* { storage: 'onchain' },
|
|
437
|
+
* {
|
|
438
|
+
* onConfirm: async (details) => {
|
|
439
|
+
* // Show confirmation dialog to user
|
|
440
|
+
* return await showConfirmDialog({
|
|
441
|
+
* title: 'Confirm Proof Storage',
|
|
442
|
+
* message: `This will burn ${details.amount} DEM to store the proof on-chain`,
|
|
443
|
+
* txHash: details.txHash,
|
|
444
|
+
* });
|
|
445
|
+
* }
|
|
446
|
+
* }
|
|
447
|
+
* );
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
async storeProofWithConfirmation(tokenId, proof, options, confirmOptions) {
|
|
451
|
+
const { storage } = options;
|
|
452
|
+
const { onConfirm } = confirmOptions;
|
|
453
|
+
// 1. Calculate storage fee
|
|
454
|
+
const proofSizeKB = Math.ceil(proof.length / 1024);
|
|
455
|
+
const storageFee = this.calculateStorageFee(proofSizeKB);
|
|
456
|
+
// 2. Create the transaction (but don't broadcast yet)
|
|
457
|
+
const tx = await this.createTlsnStoreTransaction(tokenId, proof, storage, storageFee);
|
|
458
|
+
// 3. Get confirmation from user
|
|
459
|
+
const details = {
|
|
460
|
+
transaction: tx,
|
|
461
|
+
txHash: tx.hash,
|
|
462
|
+
amount: storageFee,
|
|
463
|
+
description: `Store TLSNotary proof ${storage === 'onchain' ? 'on-chain' : 'on IPFS'} (burns ${storageFee} DEM)`,
|
|
464
|
+
tokenId,
|
|
465
|
+
};
|
|
466
|
+
const confirmed = await onConfirm(details);
|
|
467
|
+
if (!confirmed) {
|
|
468
|
+
throw new Error("Transaction rejected by user");
|
|
469
|
+
}
|
|
470
|
+
// 4. Confirm and broadcast
|
|
471
|
+
const confirmResult = await DemosTransactions_1.DemosTransactions.confirm(tx, this.demos);
|
|
472
|
+
const broadcastResult = await DemosTransactions_1.DemosTransactions.broadcast(confirmResult, this.demos);
|
|
473
|
+
if (broadcastResult.result !== 200) {
|
|
474
|
+
throw new Error(`Failed to store proof: ${broadcastResult.response?.message || "Unknown error"}`);
|
|
475
|
+
}
|
|
476
|
+
return {
|
|
477
|
+
txHash: tx.hash,
|
|
478
|
+
storageFee,
|
|
479
|
+
broadcastStatus: broadcastResult.result,
|
|
480
|
+
broadcastMessage: broadcastResult.response?.message || "Transaction accepted",
|
|
481
|
+
};
|
|
482
|
+
}
|
|
176
483
|
/**
|
|
177
484
|
* Calculate the storage fee for a proof
|
|
178
485
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TLSNotaryService.js","sourceRoot":"","sources":["../../../src/tlsnotary/TLSNotaryService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;;;AAGH,kEAA8D;AAC9D,8DAA4D;AAsE5D;;GAEG;AACH,MAAa,gBAAgB;IAGzB;;;;OAIG;IACH,YAAY,KAAY;QACpB,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;QACjE,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;QACvE,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,kBAAkB,CACpB,OAAkC;QAElC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;QAE7B,wBAAwB;QACxB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAA;QAC9B,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACxE,CAAC;QAED,qEAAqE;QACrE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,4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AO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACjC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG;YACd,QAAQ;YACR;gBACI,eAAe,EAAE,YAAY;gBAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC;aACtC;SACJ,CAAA;QAED,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACpC,CAAC;CACJ;AAzrBD,4CAyrBC;AAED,kBAAe,gBAAgB,CAAA"}
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
export { TLSNotary } from "./TLSNotary";
|
|
57
|
-
export { TLSNotaryService, type AttestationTokenResponse, type StoreProofResponse, type TLSNotaryToken, type RequestAttestationOptions, type StoreProofOptions, } from "./TLSNotaryService";
|
|
57
|
+
export { TLSNotaryService, type AttestationTokenResponse, type StoreProofResponse, type TLSNotaryToken, type RequestAttestationOptions, type StoreProofOptions, type TransactionDetails, type TransactionConfirmCallback, type WithConfirmationOptions, } from "./TLSNotaryService";
|
|
58
58
|
export type { TLSNotaryConfig, TLSNotaryDiscoveryInfo, AttestRequest, AttestResult, AttestOptions, CommitRanges, Range, PresentationJSON, VerificationResult, TranscriptInfo, StatusCallback, ProxyRequestResponse, ProxyRequestError, } from "./types";
|
|
59
59
|
export { default } from "./TLSNotary";
|
|
60
60
|
export { calculateStorageFee } from "./helpers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tlsnotary/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;;;;;;AAEH,uCAAuC;AACvC,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAElB,2DAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tlsnotary/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;;;;;;AAEH,uCAAuC;AACvC,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAElB,2DAA2D;AAC3D,uDAU2B;AATvB,oHAAA,gBAAgB,OAAA;AA4BpB,oBAAoB;AACpB,yCAAqC;AAA5B,qHAAA,OAAO,OAAA;AAEhB,0BAA0B;AAC1B,qCAA+C;AAAtC,8GAAA,mBAAmB,OAAA;AAE5B;;;;;;;;GAQG;AACH,mCAegB;AAdZ,sBAAsB;AACtB,gHAAA,OAAO,OAAQ;AACf,eAAe;AACf,iGAAA,MAAM,OAAA;AACN,uGAAA,YAAY,OAAA;AACZ,uGAAA,YAAY,OAAA;AACZ,qGAAA,UAAU,OAAA"}
|
package/build/websdk/index.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export { bufferize } from "./utils/bufferizer";
|
|
|
10
10
|
export { required, _required } from "./utils/required";
|
|
11
11
|
export { forgeToString, stringToForge } from "./utils/forge_converter";
|
|
12
12
|
export * as skeletons from "./utils/skeletons";
|
|
13
|
+
export { uint8ArrayToHex, hexToUint8Array } from "../encryption/unifiedCrypto";
|
|
13
14
|
export { RubicBridge } from "./bridge";
|
package/build/websdk/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.RubicBridge = exports.skeletons = exports.stringToForge = exports.forgeToString = exports._required = exports.required = exports.bufferize = exports.sha256 = exports.HandleNativeOperations = exports.GCRGeneration = exports.prepareXMScript = exports.prepareXMPayload = exports.XMTransactions = exports.DemosWebAuth = exports.RSA = exports.DemosTransactions = exports.Demos = exports.demos = void 0;
|
|
36
|
+
exports.RubicBridge = exports.hexToUint8Array = exports.uint8ArrayToHex = exports.skeletons = exports.stringToForge = exports.forgeToString = exports._required = exports.required = exports.bufferize = exports.sha256 = exports.HandleNativeOperations = exports.GCRGeneration = exports.prepareXMScript = exports.prepareXMPayload = exports.XMTransactions = exports.DemosWebAuth = exports.RSA = exports.DemosTransactions = exports.Demos = exports.demos = void 0;
|
|
37
37
|
// @ts-nocheck
|
|
38
38
|
var demos_1 = require("./demos");
|
|
39
39
|
Object.defineProperty(exports, "demos", { enumerable: true, get: function () { return demos_1.demos; } });
|
|
@@ -64,6 +64,10 @@ var forge_converter_1 = require("./utils/forge_converter");
|
|
|
64
64
|
Object.defineProperty(exports, "forgeToString", { enumerable: true, get: function () { return forge_converter_1.forgeToString; } });
|
|
65
65
|
Object.defineProperty(exports, "stringToForge", { enumerable: true, get: function () { return forge_converter_1.stringToForge; } });
|
|
66
66
|
exports.skeletons = __importStar(require("./utils/skeletons"));
|
|
67
|
+
// Crypto utilities (useful for developers)
|
|
68
|
+
var unifiedCrypto_1 = require("../encryption/unifiedCrypto");
|
|
69
|
+
Object.defineProperty(exports, "uint8ArrayToHex", { enumerable: true, get: function () { return unifiedCrypto_1.uint8ArrayToHex; } });
|
|
70
|
+
Object.defineProperty(exports, "hexToUint8Array", { enumerable: true, get: function () { return unifiedCrypto_1.hexToUint8Array; } });
|
|
67
71
|
// Bridge
|
|
68
72
|
var bridge_1 = require("./bridge");
|
|
69
73
|
Object.defineProperty(exports, "RubicBridge", { enumerable: true, get: function () { return bridge_1.RubicBridge; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/websdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AACd,2CAAoC;AAA3B,mGAAA,KAAK,OAAA;AACd,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAE1B,6BAA2B;AAAlB,0FAAA,GAAG,OAAA;AACZ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