tsukino 4f9c6f3ee6 fix: enable error catching for wasm module (#10)
* wip: testing error catching

* chore: version update

* chore: add mocha test boilerplate

* chore: fix linter
2024-01-30 09:38:18 -05:00
2023-11-14 09:19:56 +03:00
2023-11-14 07:10:20 +03:00
2024-01-08 17:08:48 -05:00
2023-11-14 09:41:01 +03:00
2023-12-19 21:11:10 -08:00
2023-12-19 21:11:10 -08:00
2024-01-08 18:11:26 -04:00
2023-11-16 09:46:19 +03:00
2023-11-14 09:19:56 +03:00
2023-12-19 21:11:10 -08:00
2023-12-19 21:11:10 -08:00

tlsn-js

NPM Modules for proving and verifying using TLS Notary in the browser.

The prover requires a notary-server and websockify proxy

Example

import { prove, verify } from '../src';

// To create a proof
const proof = await prove('https://swapi.dev/api/people/1', {
    method: 'GET',
    headers: {
      Connection: 'close',
      Accept: 'application/json',
      'Accept-Encoding': 'identity',
    },
    body: '',
    maxTranscriptSize: 20000,
    notaryUrl: 'https://127.0.0.1:7047',
    websocketProxyUrl: 'ws://127.0.0.1:55688',
});

// To verify a proof
const result = await verify(proof);
console.log(result);

Running a local websockify proxy for https://swapi.dev

git clone https://github.com/novnc/websockify && cd websockify
./docker/build.sh
docker run -it --rm -p 55688:80 novnc/websockify 80 swapi.dev:443

Install as NPM Package

npm install tlsn-js

Development

# make sure you have rust install
# https://www.rust-lang.org/tools/install
npm install

# this serve a page that will execute the example code at http://localhost:3001 
npm run dev

Build for NPM

npm install
npm run build
Description
No description provided
Readme 11 MiB
Latest
2025-06-19 15:23:49 -04:00
Languages
TypeScript 87.2%
JavaScript 9.8%
Shell 1.6%
EJS 1.4%