chore: type cleanup (#185)

This commit is contained in:
Hendrik Eeckhaut
2025-06-02 21:30:52 +02:00
committed by GitHub
parent c67b794f40
commit 7de46bf590
3 changed files with 7 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
import { ContentScriptTypes, RPCClient } from './rpc';
import { PresentationJSON } from '../../utils/types';
import { PresentationJSON } from 'tlsn-js/build/types';
const client = new RPCClient();

View File

@@ -16,9 +16,8 @@ import {
} from 'tlsn-js';
import { convertNotaryWsToHttp, devlog, urlify } from '../../utils/misc';
import * as Comlink from 'comlink';
import { PresentationJSON as PresentationJSONa7 } from 'tlsn-js/build/types';
import { OffscreenActionTypes } from './types';
import { PresentationJSON } from '../../utils/types';
import { PresentationJSON } from 'tlsn-js/build/types';
import { waitForEvent } from '../utils';
import {
setNotaryRequestError,
@@ -368,7 +367,7 @@ async function createProof(options: {
id: string;
secretHeaders: string[];
secretResps: string[];
}): Promise<PresentationJSONa7> {
}): Promise<PresentationJSON> {
const {
url,
method = 'GET',
@@ -538,19 +537,15 @@ async function verifyProof(proof: PresentationJSON): Promise<{
};
switch (proof.version) {
case undefined:
case '0.1.0-alpha.7':
case '0.1.0-alpha.8':
case '0.1.0-alpha.9':
case '0.1.0-alpha.10':
case '0.1.0-alpha.11':
result = await verify(proof);
break;
default:
result = {
sent: 'version not supported',
recv: 'version not supported',
};
break;
case '0.1.0-alpha.11':
result = await verify(proof);
break;
}
return result!;

View File

@@ -1,10 +0,0 @@
import { PresentationJSON as PresentationJSONa7 } from 'tlsn-js/build/types';
export type PresentationJSON = PresentationJSONa5 | PresentationJSONa7;
export type PresentationJSONa5 = {
version?: undefined;
session: any;
substrings: any;
notaryUrl: string;
};