Skip to content

Commit

Permalink
[WIP] Feature/lit 1568 js sdk v3 merge v3 into sdk revamp branch (#228)
Browse files Browse the repository at this point in the history
* upgrade signature combination for cait sith changes

* update test

* upgrade crypto and ecdsa lib for hd key signature and public key derivation

* add support for public key derivation

* update claim and signing tests

* add auth callback statement

* updates for new enums on nodes

* add hd key support

* update claim impls

* add rootkeys to handshake

* add mint claim callback

* update claim types  per node updates

* Fix/humanize acc (#196)

* updates from contract abi import

* update test

* feat: option to not build into react app

* Published version 2.2.49

* chore: update pkgs in lit auth example

* remove key id from signing request

* chore: update pkgs in lit auth example

* Revert "chore: update pkgs in lit auth example"

This reverts commit 83263dd.

* Merge pull request #194 from LIT-Protocol/feat/update-mint-relay

feat: support new mint and fetch endpoints

* merge of pr #194 fixes

* feat: support WC v2 for lit-connect-modal (#197)

* implement relay fetch call

* add telem endpoint

* fix build issues from merge

* Revert to 3118e29

* Revert "chore: update pkgs in lit auth example"

This reverts commit 3118e29.

* Revert "feat: support WC v2 for lit-connect-modal (#197)"

This reverts commit a3b83cd.

* fix types

* migrate hd pubkey method from lit-node-client to lit-core

* [V2/V3] [Feat] Update lit modal to support wallet connect (#198)

* feat: support wc v2 for lit-connect-modal

* chore: remove old file

* - moved lit-connect-model dependency

* Update esbuilder/lit-connect-modal/esbuild.js

Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>
Signed-off-by: Anson <ansonox@gmail.com>

* fix: minor changes required

---------

Signed-off-by: Anson <ansonox@gmail.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* Published version 2.2.50

* update claim endpoint

* chore: update pkgs

* updates for key claiming

* docs: update lit-connect-modal demo readme

Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>

* wip update contracts

* update manifest urls and add  access token headers on fetch

* move sig reformatting to client

* read auth method acc token from cfg

* update contract-client

* updates for cayenne

* update lit config for auth method pass through

* update sig recomb for new key type value

* update tests

* update contract addresses for cayenne

* add contract ignore statement

* update contract sdk bindings

* update contracts lookup for cayenne

* update claim types for explicit claim processing types.

* add check for expiration on auth sig generation

* update type comment

* fix import

* change network for demo

* update relay endpoints

* fix webauth options generation url endpoint

* Published Version 2.2.53

* [V2/V3] feat: add handshake body checks on 'successful' handhshakes (#207)

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* update relay url

* update relayer endpoint

* update import

* get rp id from origin domain

* remove check for webauthn from claim

* add logging of request id on http request failure

* update function name

* revery webauthn create options url change

* Published Version 2.2.54

* fmt

* update baseProvider claimKey

* type update

* [Master <> V3 Merge] Feature/lit 1322 js sdk merge in v3 to revamp branch (#209)

* Feature/lit 856 add sych support (#186)

* start stych refactor

* add basic token validation for otp authentication

* updates from testing

* remove stale types

* remove test data from test source

* type fixes

* typo

* fmt

* type updates

* initigrate both otp auth methods

* version 2.2.42

* fix provider options union

* fix base provider relay body

* Published Version 2.2.43

* Use setup-node GH action with yarn caching (#180)

* Use setup-node GH action with yarn caching

* Add step name

* fix url route formatting

* Published Version 2.2.44 --alpha

* add public goods network (#190)

* Feature/pkp sui (#185)

* feat: add pkp-sui

* feat: add pkp-sui test

* fix typo

* change to use bs58

* fix pkp-sui test

fix typo
Devnet is reset weekly, Testnet was reset on May 11

---------

Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>

* Publish version 2.2.45

* feat: add optimismGoerli

* Published version 2.2.46

* feat: add manual tests on optimismGoerli

* docs: update pkp-sui readme (#191)

Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>

* added waev chain (#192)

* Pass in statement from authCallbackParams to signSessionKey (#193)

* wip: support new mint endpoint

* wip: update lit-auth-client demo app

* wip: expand provider options, export stytch

* wip: local testing

* chore: remove logs, local relay

* misc: update copy in demo app

* fix: different type to represent data for registering auth methods

* fix: handle parsing err

* fix: set routes

* Fix/humanize acc (#196)

* updates from contract abi import

* update test

* feat: option to not build into react app

* Published version 2.2.49

* chore: update pkgs in lit auth example

* feat: support WC v2 for lit-connect-modal (#197)

* Revert to 3118e29

* Revert "chore: update pkgs in lit auth example"

This reverts commit 3118e29.

* Revert "feat: support WC v2 for lit-connect-modal (#197)"

This reverts commit a3b83cd.

* [V2/V3] [Feat] Update lit modal to support wallet connect (#198)

* feat: support wc v2 for lit-connect-modal

* chore: remove old file

* - moved lit-connect-model dependency

* Update esbuilder/lit-connect-modal/esbuild.js

Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>
Signed-off-by: Anson <ansonox@gmail.com>

* fix: minor changes required

---------

Signed-off-by: Anson <ansonox@gmail.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* Published version 2.2.50

* chore: update pkgs

* docs: update lit-connect-modal demo readme

Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>

* fix webauth options generation url endpoint

* Published Version 2.2.53

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* [V2/V3] feat: add handshake body checks on 'successful' handhshakes (#207)

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* fix: build issues

* revery webauthn create options url change

* Published Version 2.2.54

* explicit any types

---------

Signed-off-by: Anson <ansonox@gmail.com>
Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Bean <josh@litprotocol.com>
Co-authored-by: Howard <hwrdtm@users.noreply.github.com>
Co-authored-by: Chris Cassano <1285652+glitch003@users.noreply.github.com>
Co-authored-by: yhl125 <54613623+yhl125@users.noreply.github.com>
Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* add connect call to claimKeyId

* remove access list contract

* update contract addresses

* remove allow list

* remove access control conditions contract

* add WithAuthMethodSigning type

* update contract manifest

* update deployment addresses

* remove twillio otp auth provider

* remove duplicated package

* feat: ability to npm link and unlink packages

* feat: add scripts to either bun/npm link

* getSignatures works

* fix: publish version

* feat: ES2021 to make "replaceAll" work

* fix: add chore back to be able to publish

* fix: had to add "DOM" to use global "crypto"

* feat: add script to generate config

* feat: add flatten object

* fix: when lit action is used as pure serverless function

* fix: general worker api

* chore: add success exit

* enable nx cache

* remove nx cache

* Feat/manual claim test (#213)

* add manual claim test

* got past last error

* fixing stuff as i go

* remove manual overrides for relay url.  use cayenne which seems to work fine now

* test working but wrong derived pubkey

* more debugging

* fix tests

* remove local overrides

* Added lit action fixes

* it works

* use cayenne

* added 2 signatures

* built

* add check for sig properties before conversion

* update config

* update config

* feat: add UNKNOWN_SIGNATURE_ERROR

* updates for claim key comments and abstractions

* fix typescript errors with nodejs app

* Feature/easier local node testing (#215)

* fix typescript errors with nodejs app

* config and docs for testing against a local node

* local testing works

* restore cayenne contracts

* add env var docs

* cleanup

* feat: script to enable/disable nx build cache

* chore: update text

* feat: add bun test script

* chore: make test exit

* chore: bun test lit node client

* Update executeJs for claim processing from execution response

* chage claim test

* add new error type

* ref loop to map stmt

* add lit actions comment

* add claim combiner test

* update comments

* disallow webauthn authentication

* add explicit return type

* make cayenne use 3 nodes by default (#217)

* update key claim combiner and types

* Feature/fixes to manual test for local chronicle node (#218)

* added a sleep to the manual test so there's time for the minted PKP to propagate to the local chronicle replica

* debug: false

* add address conversion

* update api docs for v3

* format account addr to eip-55

* add casing normalize to eth sign message check

* bump version to 3.0.1

* bump version 3.0.2

* update project id

* update api docs

* add auth method scopes and pkp helper method

* add pkp helper methods

* Hash the toSign parameter before signing in tests (#220)

* [Merge Branch] Feature/lit 1498 js sdk merge e2e nodejs branch into v3 (#221)

* update ecdsa sdk

* refactor combiination entry point for new method signature

* update ecdsa-sdk from ecdsa wasm

* updates for new cait sith ecdsa-sdk

* fixes to key remapping

* update to crypto tests for ecdsa sdk

* update tests for sign recombination

* remove unused import

* Add new ECDSA signature types

* remove enum from types

* add enum for ecdsa key type.

* update enums

* remove static v value from test

* update ecdsa-sdk with new recid calculation

* fix update to ecdsa-sdk for recid fixes

* Integrate new BLS WASM

* Update crypto wrappers around BLS WASM

* Add return types to utility functions

* Use generics in IEither

* Use generics in IEither

* Refactor param validation, add coverage, use IEither to return error instead of throwing

* Fix map

* Fix crypto package logic + tests

* Update encryption helpers and integrate new BLS encryption to lit-node-client-nodejs package

* Remove jalapeno support and make serrano the default

* Build fixes + bug fixes

* Make demo app use TS

* Use better names, fixes

* Fix bug, make errors more verbose

* Update encryption logic in demo app

* Couple of important bug fixes + tidy up

* Demo using human-readable strings

* Update comments and JSDocs

* Fix bugs, update all e2e & manual tests, simplify encryptString to just arrayify utf-16 strings

* Update bls-sdk,crypto with verify_signature, implement demo-locked-express-app

* Add getSignedToken + verification to e2e tests

* Update manual_tests for signed JWT tests

* Cleanup

* Fix types

* Use cayenne as default

* Update to cayenne contracts

* fix tsc error

* rebuilt wasm module

* bump major to 3 -> 3.0.0

* add sig type

* fix test and sig combination logic

* update logic for removing postifxed polarity on signature

* upgrade signature combination for cait sith changes

* update test

* upgrade crypto and ecdsa lib for hd key signature and public key derivation

* add support for public key derivation

* update claim and signing tests

* add auth callback statement

* updates for new enums on nodes

* add hd key support

* update claim impls

* add rootkeys to handshake

* add mint claim callback

* update claim types  per node updates

* remove key id from signing request

* chore: update pkgs in lit auth example

* Revert "chore: update pkgs in lit auth example"

This reverts commit 83263dd.

* Merge pull request #194 from LIT-Protocol/feat/update-mint-relay

feat: support new mint and fetch endpoints

* merge of pr #194 fixes

* implement relay fetch call

* add telem endpoint

* fix build issues from merge

* fix types

* migrate hd pubkey method from lit-node-client to lit-core

* update claim endpoint

* updates for key claiming

* wip update contracts

* update manifest urls and add  access token headers on fetch

* move sig reformatting to client

* read auth method acc token from cfg

* update contract-client

* updates for cayenne

* update lit config for auth method pass through

* update sig recomb for new key type value

* update tests

* update contract addresses for cayenne

* add contract ignore statement

* update contract sdk bindings

* update contracts lookup for cayenne

* update claim types for explicit claim processing types.

* add check for expiration on auth sig generation

* update type comment

* fix import

* change network for demo

* update relay endpoints

* update relay url

* update relayer endpoint

* update import

* get rp id from origin domain

* remove check for webauthn from claim

* add logging of request id on http request failure

* update function name

* revery webauthn create options url change

* Published Version 2.2.54

* fmt

* update baseProvider claimKey

* type update

* [Master <> V3 Merge] Feature/lit 1322 js sdk merge in v3 to revamp branch (#209)

* Feature/lit 856 add sych support (#186)

* start stych refactor

* add basic token validation for otp authentication

* updates from testing

* remove stale types

* remove test data from test source

* type fixes

* typo

* fmt

* type updates

* initigrate both otp auth methods

* version 2.2.42

* fix provider options union

* fix base provider relay body

* Published Version 2.2.43

* Use setup-node GH action with yarn caching (#180)

* Use setup-node GH action with yarn caching

* Add step name

* fix url route formatting

* Published Version 2.2.44 --alpha

* add public goods network (#190)

* Feature/pkp sui (#185)

* feat: add pkp-sui

* feat: add pkp-sui test

* fix typo

* change to use bs58

* fix pkp-sui test

fix typo
Devnet is reset weekly, Testnet was reset on May 11

---------

Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>

* Publish version 2.2.45

* feat: add optimismGoerli

* Published version 2.2.46

* feat: add manual tests on optimismGoerli

* docs: update pkp-sui readme (#191)

Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>

* added waev chain (#192)

* Pass in statement from authCallbackParams to signSessionKey (#193)

* wip: support new mint endpoint

* wip: update lit-auth-client demo app

* wip: expand provider options, export stytch

* wip: local testing

* chore: remove logs, local relay

* misc: update copy in demo app

* fix: different type to represent data for registering auth methods

* fix: handle parsing err

* fix: set routes

* Fix/humanize acc (#196)

* updates from contract abi import

* update test

* feat: option to not build into react app

* Published version 2.2.49

* chore: update pkgs in lit auth example

* feat: support WC v2 for lit-connect-modal (#197)

* Revert to 3118e29

* Revert "chore: update pkgs in lit auth example"

This reverts commit 3118e29.

* Revert "feat: support WC v2 for lit-connect-modal (#197)"

This reverts commit a3b83cd.

* [V2/V3] [Feat] Update lit modal to support wallet connect (#198)

* feat: support wc v2 for lit-connect-modal

* chore: remove old file

* - moved lit-connect-model dependency

* Update esbuilder/lit-connect-modal/esbuild.js

Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>
Signed-off-by: Anson <ansonox@gmail.com>

* fix: minor changes required

---------

Signed-off-by: Anson <ansonox@gmail.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* Published version 2.2.50

* chore: update pkgs

* docs: update lit-connect-modal demo readme

Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>

* fix webauth options generation url endpoint

* Published Version 2.2.53

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* [V2/V3] feat: add handshake body checks on 'successful' handhshakes (#207)

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* fix: build issues

* revery webauthn create options url change

* Published Version 2.2.54

* explicit any types

---------

Signed-off-by: Anson <ansonox@gmail.com>
Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Bean <josh@litprotocol.com>
Co-authored-by: Howard <hwrdtm@users.noreply.github.com>
Co-authored-by: Chris Cassano <1285652+glitch003@users.noreply.github.com>
Co-authored-by: yhl125 <54613623+yhl125@users.noreply.github.com>
Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* add connect call to claimKeyId

* remove access list contract

* update contract addresses

* remove allow list

* remove access control conditions contract

* add WithAuthMethodSigning type

* update contract manifest

* update deployment addresses

* remove twillio otp auth provider

* remove duplicated package

* feat: ability to npm link and unlink packages

* feat: add scripts to either bun/npm link

* getSignatures works

* fix: publish version

* feat: ES2021 to make "replaceAll" work

* fix: add chore back to be able to publish

* fix: had to add "DOM" to use global "crypto"

* feat: add script to generate config

* feat: add flatten object

* fix: when lit action is used as pure serverless function

* fix: general worker api

* chore: add success exit

* enable nx cache

* remove nx cache

* Feat/manual claim test (#213)

* add manual claim test

* got past last error

* fixing stuff as i go

* remove manual overrides for relay url.  use cayenne which seems to work fine now

* test working but wrong derived pubkey

* more debugging

* fix tests

* remove local overrides

* Added lit action fixes

* it works

* use cayenne

* added 2 signatures

* built

* add check for sig properties before conversion

* update config

* update config

* feat: add UNKNOWN_SIGNATURE_ERROR

* updates for claim key comments and abstractions

* fix typescript errors with nodejs app

* Feature/easier local node testing (#215)

* fix typescript errors with nodejs app

* config and docs for testing against a local node

* local testing works

* restore cayenne contracts

* add env var docs

* cleanup

* feat: script to enable/disable nx build cache

* chore: update text

* feat: add bun test script

* chore: make test exit

* chore: bun test lit node client

* Update executeJs for claim processing from execution response

* chage claim test

* add new error type

* ref loop to map stmt

* add lit actions comment

* add claim combiner test

* update comments

* disallow webauthn authentication

* add explicit return type

* make cayenne use 3 nodes by default (#217)

* update key claim combiner and types

* Feature/fixes to manual test for local chronicle node (#218)

* added a sleep to the manual test so there's time for the minted PKP to propagate to the local chronicle replica

* debug: false

* first pass

* add address conversion

* update api docs for v3

* format account addr to eip-55

* add casing normalize to eth sign message check

* bump version to 3.0.1

* bump version 3.0.2

* feat: add e2e-nodejs tests

* feat: add the ability to test by group

* update project id

* update api docs

* feat: add test to LitNodeClientNodejs

* docs: update

* fix: access controls conditions tests

* add auth method scopes and pkp helper method

* add pkp helper methods

* feat: add contracts-sdk tests

* fix: min nodes

* chore: update contracts

* fix: add allowJs: true

* feat: add more tests

* wip

* fix: pkp sign recover works

* wip

* fix: use sha256 to check dataSigned

* Hash the toSign parameter before signing in tests (#220)

* wip: all new e2e tests passed so far, continue..

* feat: pkp sui works

* 🚀 all unit tests passed, next e2e nodejs

* update: github CI

* chore: change to use html instead of react for testing

* ci update

* chore: indentation

* fix: error message

* Empty-Commit

* fix: to use pkpSign & passed all pkp-ethers tests

* fix: pkp client works too

* 🚀 OK. All Good

* docs: update

* resolve comments

---------

Signed-off-by: Anson <ansonox@gmail.com>
Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Josh Long <josh@litprotocol.com>
Co-authored-by: Howard Tam <howard.tam.95@gmail.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Howard <hwrdtm@users.noreply.github.com>
Co-authored-by: Chris Cassano <1285652+glitch003@users.noreply.github.com>
Co-authored-by: yhl125 <54613623+yhl125@users.noreply.github.com>
Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* This is an empty commit

* [Merge Branch] Feature/lit 1498 js sdk merge e2e nodejs branch into v3 (#221) (#222)

* update ecdsa sdk

* refactor combiination entry point for new method signature

* update ecdsa-sdk from ecdsa wasm

* updates for new cait sith ecdsa-sdk

* fixes to key remapping

* update to crypto tests for ecdsa sdk

* update tests for sign recombination

* remove unused import

* Add new ECDSA signature types

* remove enum from types

* add enum for ecdsa key type.

* update enums

* remove static v value from test

* update ecdsa-sdk with new recid calculation

* fix update to ecdsa-sdk for recid fixes

* Integrate new BLS WASM

* Update crypto wrappers around BLS WASM

* Add return types to utility functions

* Use generics in IEither

* Use generics in IEither

* Refactor param validation, add coverage, use IEither to return error instead of throwing

* Fix map

* Fix crypto package logic + tests

* Update encryption helpers and integrate new BLS encryption to lit-node-client-nodejs package

* Remove jalapeno support and make serrano the default

* Build fixes + bug fixes

* Make demo app use TS

* Use better names, fixes

* Fix bug, make errors more verbose

* Update encryption logic in demo app

* Couple of important bug fixes + tidy up

* Demo using human-readable strings

* Update comments and JSDocs

* Fix bugs, update all e2e & manual tests, simplify encryptString to just arrayify utf-16 strings

* Update bls-sdk,crypto with verify_signature, implement demo-locked-express-app

* Add getSignedToken + verification to e2e tests

* Update manual_tests for signed JWT tests

* Cleanup

* Fix types

* Use cayenne as default

* Update to cayenne contracts

* fix tsc error

* rebuilt wasm module

* bump major to 3 -> 3.0.0

* add sig type

* fix test and sig combination logic

* update logic for removing postifxed polarity on signature

* upgrade signature combination for cait sith changes

* update test

* upgrade crypto and ecdsa lib for hd key signature and public key derivation

* add support for public key derivation

* update claim and signing tests

* add auth callback statement

* updates for new enums on nodes

* add hd key support

* update claim impls

* add rootkeys to handshake

* add mint claim callback

* update claim types  per node updates

* remove key id from signing request

* chore: update pkgs in lit auth example

* Revert "chore: update pkgs in lit auth example"

This reverts commit 83263dd.

* Merge pull request #194 from LIT-Protocol/feat/update-mint-relay

feat: support new mint and fetch endpoints

* merge of pr #194 fixes

* implement relay fetch call

* add telem endpoint

* fix build issues from merge

* fix types

* migrate hd pubkey method from lit-node-client to lit-core

* update claim endpoint

* updates for key claiming

* wip update contracts

* update manifest urls and add  access token headers on fetch

* move sig reformatting to client

* read auth method acc token from cfg

* update contract-client

* updates for cayenne

* update lit config for auth method pass through

* update sig recomb for new key type value

* update tests

* update contract addresses for cayenne

* add contract ignore statement

* update contract sdk bindings

* update contracts lookup for cayenne

* update claim types for explicit claim processing types.

* add check for expiration on auth sig generation

* update type comment

* fix import

* change network for demo

* update relay endpoints

* update relay url

* update relayer endpoint

* update import

* get rp id from origin domain

* remove check for webauthn from claim

* add logging of request id on http request failure

* update function name

* revery webauthn create options url change

* Published Version 2.2.54

* fmt

* update baseProvider claimKey

* type update

* [Master <> V3 Merge] Feature/lit 1322 js sdk merge in v3 to revamp branch (#209)

* Feature/lit 856 add sych support (#186)

* start stych refactor

* add basic token validation for otp authentication

* updates from testing

* remove stale types

* remove test data from test source

* type fixes

* typo

* fmt

* type updates

* initigrate both otp auth methods

* version 2.2.42

* fix provider options union

* fix base provider relay body

* Published Version 2.2.43

* Use setup-node GH action with yarn caching (#180)

* Use setup-node GH action with yarn caching

* Add step name

* fix url route formatting

* Published Version 2.2.44 --alpha

* add public goods network (#190)

* Feature/pkp sui (#185)

* feat: add pkp-sui

* feat: add pkp-sui test

* fix typo

* change to use bs58

* fix pkp-sui test

fix typo
Devnet is reset weekly, Testnet was reset on May 11

---------



* Publish version 2.2.45

* feat: add optimismGoerli

* Published version 2.2.46

* feat: add manual tests on optimismGoerli

* docs: update pkp-sui readme (#191)



* added waev chain (#192)

* Pass in statement from authCallbackParams to signSessionKey (#193)

* wip: support new mint endpoint

* wip: update lit-auth-client demo app

* wip: expand provider options, export stytch

* wip: local testing

* chore: remove logs, local relay

* misc: update copy in demo app

* fix: different type to represent data for registering auth methods

* fix: handle parsing err

* fix: set routes

* Fix/humanize acc (#196)

* updates from contract abi import

* update test

* feat: option to not build into react app

* Published version 2.2.49

* chore: update pkgs in lit auth example

* feat: support WC v2 for lit-connect-modal (#197)

* Revert to 3118e29

* Revert "chore: update pkgs in lit auth example"

This reverts commit 3118e29.

* Revert "feat: support WC v2 for lit-connect-modal (#197)"

This reverts commit a3b83cd.

* [V2/V3] [Feat] Update lit modal to support wallet connect (#198)

* feat: support wc v2 for lit-connect-modal

* chore: remove old file

* - moved lit-connect-model dependency

* Update esbuilder/lit-connect-modal/esbuild.js




* fix: minor changes required

---------





* Published version 2.2.50

* chore: update pkgs

* docs: update lit-connect-modal demo readme



* fix webauth options generation url endpoint

* Published Version 2.2.53

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* [V2/V3] feat: add handshake body checks on 'successful' handhshakes (#207)

* feat: add handshake body checks on 'successful' handhshakes

* fix: remove throwing error

* fix: build issues

* revery webauthn create options url change

* Published Version 2.2.54

* explicit any types

---------












* add connect call to claimKeyId

* remove access list contract

* update contract addresses

* remove allow list

* remove access control conditions contract

* add WithAuthMethodSigning type

* update contract manifest

* update deployment addresses

* remove twillio otp auth provider

* remove duplicated package

* feat: ability to npm link and unlink packages

* feat: add scripts to either bun/npm link

* getSignatures works

* fix: publish version

* feat: ES2021 to make "replaceAll" work

* fix: add chore back to be able to publish

* fix: had to add "DOM" to use global "crypto"

* feat: add script to generate config

* feat: add flatten object

* fix: when lit action is used as pure serverless function

* fix: general worker api

* chore: add success exit

* enable nx cache

* remove nx cache

* Feat/manual claim test (#213)

* add manual claim test

* got past last error

* fixing stuff as i go

* remove manual overrides for relay url.  use cayenne which seems to work fine now

* test working but wrong derived pubkey

* more debugging

* fix tests

* remove local overrides

* Added lit action fixes

* it works

* use cayenne

* added 2 signatures

* built

* add check for sig properties before conversion

* update config

* update config

* feat: add UNKNOWN_SIGNATURE_ERROR

* updates for claim key comments and abstractions

* fix typescript errors with nodejs app

* Feature/easier local node testing (#215)

* fix typescript errors with nodejs app

* config and docs for testing against a local node

* local testing works

* restore cayenne contracts

* add env var docs

* cleanup

* feat: script to enable/disable nx build cache

* chore: update text

* feat: add bun test script

* chore: make test exit

* chore: bun test lit node client

* Update executeJs for claim processing from execution response

* chage claim test

* add new error type

* ref loop to map stmt

* add lit actions comment

* add claim combiner test

* update comments

* disallow webauthn authentication

* add explicit return type

* make cayenne use 3 nodes by default (#217)

* update key claim combiner and types

* Feature/fixes to manual test for local chronicle node (#218)

* added a sleep to the manual test so there's time for the minted PKP to propagate to the local chronicle replica

* debug: false

* first pass

* add address conversion

* update api docs for v3

* format account addr to eip-55

* add casing normalize to eth sign message check

* bump version to 3.0.1

* bump version 3.0.2

* feat: add e2e-nodejs tests

* feat: add the ability to test by group

* update project id

* update api docs

* feat: add test to LitNodeClientNodejs

* docs: update

* fix: access controls conditions tests

* add auth method scopes and pkp helper method

* add pkp helper methods

* feat: add contracts-sdk tests

* fix: min nodes

* chore: update contracts

* fix: add allowJs: true

* feat: add more tests

* wip

* fix: pkp sign recover works

* wip

* fix: use sha256 to check dataSigned

* Hash the toSign parameter before signing in tests (#220)

* wip: all new e2e tests passed so far, continue..

* feat: pkp sui works

* 🚀 all unit tests passed, next e2e nodejs

* update: github CI

* chore: change to use html instead of react for testing

* ci update

* chore: indentation

* fix: error message

* Empty-Commit

* fix: to use pkpSign & passed all pkp-ethers tests

* fix: pkp client works too

* 🚀 OK. All Good

* docs: update

* resolve comments

---------

Signed-off-by: Anson <ansonox@gmail.com>
Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Josh Long <josh@litprotocol.com>
Co-authored-by: Howard Tam <howard.tam.95@gmail.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Howard <hwrdtm@users.noreply.github.com>
Co-authored-by: Chris Cassano <1285652+glitch003@users.noreply.github.com>
Co-authored-by: yhl125 <54613623+yhl125@users.noreply.github.com>
Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>

* test: all good. ready go publish 3.0.3

* docs: update

* merge

* sessionSigs works❗️

---------

Signed-off-by: Anson <ansonox@gmail.com>
Signed-off-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: Josh Long <josh@litprotocol.com>
Co-authored-by: sarah z <15064710+sarahzdev@users.noreply.github.com>
Co-authored-by: sarahzdev <sarah.hg.zhang@gmail.com>
Co-authored-by: Adarsh-Kumar28 <115020815+Adarsh-Kumar28@users.noreply.github.com>
Co-authored-by: Howard <hwrdtm@users.noreply.github.com>
Co-authored-by: Chris Cassano <1285652+glitch003@users.noreply.github.com>
Co-authored-by: yhl125 <54613623+yhl125@users.noreply.github.com>
Co-authored-by: Yoonhyoung-Lee <54613623+Yoonhyoung-Lee@users.noreply.github.com>
Co-authored-by: Howard Tam <howard.tam.95@gmail.com>
  • Loading branch information
10 people authored Oct 9, 2023
1 parent 28e49f0 commit 8960a6c
Show file tree
Hide file tree
Showing 843 changed files with 207,037 additions and 37,298 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [3.0.0] - 2023-09-25

- [https://github.com/LIT-Protocol/js-sdk/pull/199](https://github.com/LIT-Protocol/js-sdk/pull/199)

# [2.2.39] - 2023-07-06

- [a0d88bc](https://github.com/LIT-Protocol/js-sdk/pull/167) Add [Backpack wallet 🎒](https://www.backpack.app/) support
Expand Down
104 changes: 77 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<h1>Lit Protocol Javascript/Typescript SDK V2</h1>
<h1>Lit Protocol Javascript/Typescript SDK V3</h1>
<img src="https://i.ibb.co/p2xfzK1/Screenshot-2022-11-15-at-09-56-57.png">
<br/>
<a href="https://twitter.com/LitProtocol"><img src="https://img.shields.io/twitter/follow/litprotocol?label=Follow&style=social"/></a>
Expand All @@ -16,7 +16,7 @@ https://developer.litprotocol.com/SDK/Explanation/installation
</a>

<br /><br />
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.

</div>

Expand Down Expand Up @@ -111,15 +111,6 @@ http://docs.lit-js-sdk-v2.litprotocol.com/ <br/>

</div>

## 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
Expand All @@ -132,7 +123,7 @@ http://docs.lit-js-sdk-v2.litprotocol.com/ <br/>

- NX Console: https://nx.dev/core-features/integrate-with-editors

# Quick Start
# Quick Start

The following commands will help you start developing with this repository.

Expand Down Expand Up @@ -162,7 +153,7 @@ The test apps are configured to automatically import all modules and expose all
yarn apps
```

or runniny individually
or running individually

```
// html
Expand All @@ -184,10 +175,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

Expand All @@ -214,7 +210,6 @@ yarn delete:app <app-name>
yarn delete:package <package-name>
```


## Building

```jsx
Expand All @@ -231,11 +226,29 @@ yarn nx run <project-name>: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 <package>` to build that specific package.
3. In the client application, run `npm link <package> --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/*/<package-name>
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 <package> --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 <package> --save
```

Having done this setup, this is what the development cycle looks like moving forward:

Expand All @@ -249,26 +262,26 @@ Run `yarn bump` to bump the version. You must have at least nodejs v18 to do thi

### to npm

```
```sh
yarn publish:packages
```

### clone & publish to npm

```jsx
```sh
yarn tools --clone <project-name> <clone-project-name> <(?) --publish> <(?) --remove-after>

// eg
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 *
Expand All @@ -282,8 +295,10 @@ git push

The following will serve the react testing app and launch the cypress e2e testing after

```
yarn test:e2e
```sh
yarn test:e2e:web
or
yarn test:e2e:node
```

### Environments
Expand All @@ -296,7 +311,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
Expand All @@ -320,6 +335,41 @@ yarn tools --test --e2e html
yarn tools --test --e2e react
```

## Testing with a Local Lit Node

First, deploy your Lit Node Contracts, since the correct addresses will be pulled from the `../lit-assets/blockchain/contracts/deployed-lit-node-contracts-temp.json` file.

Set these two env vars:

```sh
export LIT_JS_SDK_LOCAL_NODE_DEV="true"
export LIT_JS_SDK_FUNDED_WALLET_PRIVATE_KEY="putAFundedPrivateKeyOnChronicleHere"
```

Run:

```sh
yarn update:contracts-sdk --fetch
yarn update:contracts-sdk --gen
yarn build:packages
```

To run manual tests:

```sh
yarn nx run nodejs:serve
```

## ENV Vars

- LIT_JS_SDK_GITHUB_ACCESS_TOKEN - a github access token to get the contract ABIs from a private repo
- 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
Expand Down
3 changes: 3 additions & 0 deletions apps/demo-lit-connect-modal-next/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
35 changes: 35 additions & 0 deletions apps/demo-lit-connect-modal-next/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
29 changes: 29 additions & 0 deletions apps/demo-lit-connect-modal-next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# `checkAndSignAuthMessage` Example ✍️

This is an example web app that shows how you can easily obtain an `AuthSig` using the `checkAndSignAuthMessage` function.

When the function is called, it prompts a wallet selection pop-up in the user's browser. Once the user's wallet is connected, the user is asked to sign a message, thereby confirming the ownership of their crypto address. The `AuthSig` is then generated, which includes the signature of the user's signed message.

## 💻 Getting Started

1. Clone this repo, navigate to the project folder, and install the dependencies:

```bash
cd apps/demo-lit-connect-modal-next

npm install
```

2. Create a `.env.local` file and add your WalletConnect project ID. You can get one by visiting [WalletConnect](https://cloud.walletconnect.com/sign-in).

```bash
NEXT_PUBLIC_WC_PROJECT_ID="<Your WalletConnect Project ID>"
```

3. Start your development server:

```bash
npm run dev
```

4. Visit [http://localhost:3000](http://localhost:3000) to start playing with the app.
7 changes: 7 additions & 0 deletions apps/demo-lit-connect-modal-next/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
4 changes: 4 additions & 0 deletions apps/demo-lit-connect-modal-next/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}

module.exports = nextConfig
Loading

0 comments on commit 8960a6c

Please sign in to comment.