diff --git a/README.md b/README.md index b23d45817e..c88106f413 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-

Lit Protocol Javascript/Typescript SDK V2

+

Lit Protocol Javascript/Typescript SDK V3


@@ -16,7 +16,7 @@ https://developer.litprotocol.com/SDK/Explanation/installation

-This new V2 SDK is written in Typescript and is a complete rewrite of the old SDK. It is much more modular and easier to use, and has a much smaller bundle size. +This new V3 SDK is written in Typescript and is a complete rewrite of the old SDK. It is much more modular and easier to use, and has a much smaller bundle size.
@@ -69,8 +69,8 @@ For usage directly in the browser with a script tag Package | Category | Version | Download --- | --- | --- | --- -| [@lit-protocol/lit-node-client-nodejs](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-node-client-nodejs) | ![lit-node-client-nodejs](https://img.shields.io/badge/-nodejs-2E8B57 "lit-node-client-nodejs") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/lit-node-client](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-node-client) | ![lit-node-client](https://img.shields.io/badge/-universal-8A6496 "lit-node-client") | 3.0.2 | npm
Vanilla JS (UMD) +| [@lit-protocol/lit-node-client-nodejs](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-node-client-nodejs) | ![lit-node-client-nodejs](https://img.shields.io/badge/-nodejs-2E8B57 "lit-node-client-nodejs") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/lit-node-client](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-node-client) | ![lit-node-client](https://img.shields.io/badge/-universal-8A6496 "lit-node-client") | 3.0.3 | npm
Vanilla JS (UMD) If you're a tech-savvy user and wish to utilize only specific submodules that our main module relies upon, you can find individual packages listed below. This way, you can import only the necessary packages that cater to your specific use case:: @@ -78,28 +78,28 @@ If you're a tech-savvy user and wish to utilize only specific submodules that ou Package | Category | Version | Download --- | --- | --- | --- -| [@lit-protocol/access-control-conditions](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/access-control-conditions) | ![access-control-conditions](https://img.shields.io/badge/-universal-8A6496 "access-control-conditions") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/auth-helpers](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-helpers) | ![auth-helpers](https://img.shields.io/badge/-universal-8A6496 "auth-helpers") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/bls-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/bls-sdk) | ![bls-sdk](https://img.shields.io/badge/-universal-8A6496 "bls-sdk") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/constants](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/constants) | ![constants](https://img.shields.io/badge/-universal-8A6496 "constants") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/contracts-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/contracts-sdk) | ![contracts-sdk](https://img.shields.io/badge/-universal-8A6496 "contracts-sdk") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/core](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/core) | ![core](https://img.shields.io/badge/-universal-8A6496 "core") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/crypto](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/crypto) | ![crypto](https://img.shields.io/badge/-universal-8A6496 "crypto") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/ecdsa-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/ecdsa-sdk) | ![ecdsa-sdk](https://img.shields.io/badge/-universal-8A6496 "ecdsa-sdk") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/encryption](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/encryption) | ![encryption](https://img.shields.io/badge/-universal-8A6496 "encryption") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/lit-third-party-libs](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-third-party-libs) | ![lit-third-party-libs](https://img.shields.io/badge/-universal-8A6496 "lit-third-party-libs") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/misc](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc) | ![misc](https://img.shields.io/badge/-universal-8A6496 "misc") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/nacl](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/nacl) | ![nacl](https://img.shields.io/badge/-universal-8A6496 "nacl") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/pkp-base](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-base) | ![pkp-base](https://img.shields.io/badge/-universal-8A6496 "pkp-base") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/pkp-client](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-client) | ![pkp-client](https://img.shields.io/badge/-universal-8A6496 "pkp-client") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/pkp-cosmos](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-cosmos) | ![pkp-cosmos](https://img.shields.io/badge/-universal-8A6496 "pkp-cosmos") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/pkp-ethers](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-ethers) | ![pkp-ethers](https://img.shields.io/badge/-universal-8A6496 "pkp-ethers") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/pkp-sui](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-sui) | ![pkp-sui](https://img.shields.io/badge/-universal-8A6496 "pkp-sui") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/pkp-walletconnect](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-walletconnect) | ![pkp-walletconnect](https://img.shields.io/badge/-universal-8A6496 "pkp-walletconnect") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/types](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/types) | ![types](https://img.shields.io/badge/-universal-8A6496 "types") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/uint8arrays](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/uint8arrays) | ![uint8arrays](https://img.shields.io/badge/-universal-8A6496 "uint8arrays") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/auth-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-browser) | ![auth-browser](https://img.shields.io/badge/-browser-E98869 "auth-browser") | 3.0.2 | npm
Vanilla JS (UMD) -| [@lit-protocol/misc-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc-browser) | ![misc-browser](https://img.shields.io/badge/-browser-E98869 "misc-browser") | 3.0.2 | npm
Vanilla JS (UMD) +| [@lit-protocol/access-control-conditions](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/access-control-conditions) | ![access-control-conditions](https://img.shields.io/badge/-universal-8A6496 "access-control-conditions") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/auth-helpers](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-helpers) | ![auth-helpers](https://img.shields.io/badge/-universal-8A6496 "auth-helpers") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/bls-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/bls-sdk) | ![bls-sdk](https://img.shields.io/badge/-universal-8A6496 "bls-sdk") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/constants](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/constants) | ![constants](https://img.shields.io/badge/-universal-8A6496 "constants") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/contracts-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/contracts-sdk) | ![contracts-sdk](https://img.shields.io/badge/-universal-8A6496 "contracts-sdk") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/core](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/core) | ![core](https://img.shields.io/badge/-universal-8A6496 "core") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/crypto](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/crypto) | ![crypto](https://img.shields.io/badge/-universal-8A6496 "crypto") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/ecdsa-sdk](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/ecdsa-sdk) | ![ecdsa-sdk](https://img.shields.io/badge/-universal-8A6496 "ecdsa-sdk") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/encryption](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/encryption) | ![encryption](https://img.shields.io/badge/-universal-8A6496 "encryption") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/lit-third-party-libs](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/lit-third-party-libs) | ![lit-third-party-libs](https://img.shields.io/badge/-universal-8A6496 "lit-third-party-libs") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/misc](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc) | ![misc](https://img.shields.io/badge/-universal-8A6496 "misc") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/nacl](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/nacl) | ![nacl](https://img.shields.io/badge/-universal-8A6496 "nacl") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/pkp-base](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-base) | ![pkp-base](https://img.shields.io/badge/-universal-8A6496 "pkp-base") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/pkp-client](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-client) | ![pkp-client](https://img.shields.io/badge/-universal-8A6496 "pkp-client") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/pkp-cosmos](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-cosmos) | ![pkp-cosmos](https://img.shields.io/badge/-universal-8A6496 "pkp-cosmos") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/pkp-ethers](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-ethers) | ![pkp-ethers](https://img.shields.io/badge/-universal-8A6496 "pkp-ethers") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/pkp-sui](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-sui) | ![pkp-sui](https://img.shields.io/badge/-universal-8A6496 "pkp-sui") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/pkp-walletconnect](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/pkp-walletconnect) | ![pkp-walletconnect](https://img.shields.io/badge/-universal-8A6496 "pkp-walletconnect") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/types](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/types) | ![types](https://img.shields.io/badge/-universal-8A6496 "types") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/uint8arrays](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/uint8arrays) | ![uint8arrays](https://img.shields.io/badge/-universal-8A6496 "uint8arrays") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/auth-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-browser) | ![auth-browser](https://img.shields.io/badge/-browser-E98869 "auth-browser") | 3.0.3 | npm
Vanilla JS (UMD) +| [@lit-protocol/misc-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc-browser) | ![misc-browser](https://img.shields.io/badge/-browser-E98869 "misc-browser") | 3.0.3 | npm
Vanilla JS (UMD) @@ -109,15 +109,6 @@ http://docs.lit-js-sdk-v2.litprotocol.com/
-## Demo - -| App | Link | -| ---------------------- | --------------------------------------------------- | -| Simple Encrypt Decrypt | https://demo.encrypt-decrypt.react.litprotocol.com/ | -| Contracts SDK | https://demo.contracts-sdk.react.litprotocol.com/ | -| (Test) Html | http://test.lit-js-sdk-v2.html.litprotocol.com/ | -| (Test) React | http://test.lit-js-sdk-v2.react.litprotocol.com/ | - > NOTE: For (Test) apps, all packages and functions can be called inside the browser console. eg. `window.LitJsSdk_[package_name].[function_name]` # Contributing and developing to this SDK @@ -182,10 +173,15 @@ yarn test:unit ## Run E2E tests ``` -yarn test:e2e + +// -- web +yarn test:e2e:web + +// -- node +yarn test:e2e:node ``` -# (WIP) Advanced +# Advanced ## Creating a new library @@ -228,11 +224,29 @@ yarn nx run :build During development you may wish to build your code changes in `packages/` in a client application to test the correctness of the functionality. -If you would like to establish a dependency between packages within this monorepo and an external client application that consumes these packages, +If you would like to establish a dependency between packages within this monorepo and an external client application that consumes these packages: 1. Run `npm link` at the root of the specific package you are making code changes in. -2. Run `yarn build:target ` to build that specific package. -3. In the client application, run `npm link --force` to ensure that the `package.json` of the client application is updated with a `file:` link to the dependency. This effectively creates a symlink in the `node_modules` of the client application to the local dependency in this repository. + +``` +cd ./packages/*/ +npm link +``` + +2. Build the packages with or without dependencies + +``` +yarn build +# or +yarn nx run lit-node-client-nodejs:build --with-deps=false +``` + +3. In the client application, run `npm link --save` to ensure that the `package.json` of the client application is updated with a `file:` link to the dependency. This effectively creates a symlink in the `node_modules` of the client application to the local dependency in this repository. + +``` +cd path/to/client-application +npm link --save +``` Having done this setup, this is what the development cycle looks like moving forward: @@ -259,13 +273,13 @@ yarn tools --clone <(?) --publish> <(?) --re yarn tools --clone lit-node-client @litprotocol/dev --publish --remove-after ``` -## bump, build, test, gen docs, publish, git push +## The Publish Pipeline - bump, build, test, gen docs, publish, git push ```sh yarn bump yarn build yarn test:unit -yarn test:e2e +yarn test:e2e:nodejs yarn gen:docs --push yarn publish:packages git add * @@ -280,7 +294,9 @@ git push The following will serve the react testing app and launch the cypress e2e testing after ```sh -yarn test:e2e +yarn test:e2e:web +or +yarn test:e2e:node ``` ### Environments @@ -293,7 +309,7 @@ There are currently three environments can be tested on, each of which can be ge | React | `yarn gen:react` | http://localhost:4003 | | NodeJs | `yarn gen:nodejs` | `yarn nx run nodejs:serve` | -### Unit Tests (for Node) +### Unit Tests ```jsx yarn test:unit @@ -348,6 +364,10 @@ To run manual tests: - LIT_JS_SDK_LOCAL_NODE_DEV - set to true to use a local node - LIT_JS_SDK_FUNDED_WALLET_PRIVATE_KEY - set to a funded wallet on Chronicle Testnet +# Dockerfile + +...coming soon + ## Other Commands ### Interactive graph dependencies using NX diff --git a/apps/html/index.html b/apps/html/index.html index 5351fb2425..8ddd6394bd 100644 --- a/apps/html/index.html +++ b/apps/html/index.html @@ -1,4 +1,4 @@ - + @@ -62,1782 +62,30 @@ - (HTML) THIS FILE IS AUTOMATICALLY GENERATED FROM tools/scripts/gen-html.mjs Tue, 19 Sep 2023 22:44:05 GMT + (HTML) THIS FILE IS AUTOMATICALLY GENERATED FROM tools/scripts/gen-html.mjs Mon, 25 Sep 2023 16:18:36 GMT - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -