mirror of
https://github.com/tlsnotary/tlsn-extension.git
synced 2026-01-09 21:18:02 -05:00
chore: type cleanup (#185)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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!;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user