From 65cb44f2181a80bd87f936031f5b05378bc03b69 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Wed, 27 Nov 2024 19:49:30 +0900 Subject: [PATCH 1/8] Bump Lit package version --- encryption/encrypt-large-file/package.json | 8 +- yarn.lock | 630 +-------------------- 2 files changed, 23 insertions(+), 615 deletions(-) diff --git a/encryption/encrypt-large-file/package.json b/encryption/encrypt-large-file/package.json index 75bb6881..5e0d5de0 100644 --- a/encryption/encrypt-large-file/package.json +++ b/encryption/encrypt-large-file/package.json @@ -9,10 +9,10 @@ }, "dependencies": { "@dotenvx/dotenvx": "^0.44.1", - "@lit-protocol/auth-helpers": "^6.11.0", - "@lit-protocol/constants": "^6.11.0", - "@lit-protocol/lit-node-client": "^6.11.0", - "@lit-protocol/types": "^6.11.0", + "@lit-protocol/auth-helpers": "^7.0.0", + "@lit-protocol/constants": "^7.0.0", + "@lit-protocol/lit-node-client": "^7.0.0", + "@lit-protocol/types": "^7.0.0", "ethers": "v5" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 182e845a..7b1a9a68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2023,33 +2023,6 @@ yargs "17.7.2" yargs-parser "21.1.1" -"@lit-labs/ssr-dom-shim@^1.0.0", "@lit-labs/ssr-dom-shim@^1.1.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.1.tgz#2f3a8f1d688935c704dbc89132394a41029acbb8" - integrity sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ== - -"@lit-protocol/access-control-conditions@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/access-control-conditions/-/access-control-conditions-6.11.2.tgz#1f1ed04a86e40a2d50769a6b0284a8c13f6c3203" - integrity sha512-NqvlJQrm5fi/9b85Dk1ue9JbN91WEJpYOMjd1bmNI+WFzu/K5gdDokhduZWwj0m4KygOS0LQW0cLy/a0U8HxxQ== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ajv "^8.12.0" - ethers "^5.7.1" - jszip "^3.10.1" - siwe "^2.0.5" - tslib "1.14.1" - util "0.12.5" - "@lit-protocol/access-control-conditions@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/access-control-conditions/-/access-control-conditions-7.0.0.tgz#9e2c783f87aef3525ed012bab71c6eb1a9a29ee4" @@ -2087,30 +2060,6 @@ dependencies: ajv "^8.12.0" -"@lit-protocol/auth-browser@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/auth-browser/-/auth-browser-6.11.2.tgz#52b14a09ece70a11f2ceced4110f1b91548213d3" - integrity sha512-UBZrHYUBtzp1DUCurnm4yHy5R9n3KNr7GlfxNdKC1eutiXfxysX90gDUXkNRLdVtKplUHgqEJVlmZhBGNlyWiw== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/strings" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/misc-browser" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ajv "^8.12.0" - ethers "^5.7.1" - jszip "^3.10.1" - tslib "1.14.1" - "@lit-protocol/auth-browser@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/auth-browser/-/auth-browser-7.0.0.tgz#67fe2c9748f9199ef50dcae3cadf916af4d134bd" @@ -2136,30 +2085,6 @@ ethers "^5.7.1" tslib "1.14.1" -"@lit-protocol/auth-helpers@6.11.2", "@lit-protocol/auth-helpers@^6.11.0": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/auth-helpers/-/auth-helpers-6.11.2.tgz#0f3eadf3ae62d3a32ab0e060e407982b2d6debba" - integrity sha512-cneLYoFrovVWHxeedeqBsYKNoEkbaABx8woU74g3CxCl+NpuScS0ZRImCza2ci6zHM23y5pIQGeyvb4na1jH1g== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@lit-protocol/access-control-conditions" "6.11.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ajv "^8.12.0" - ethers "^5.7.1" - jszip "^3.10.1" - siwe "^2.0.5" - siwe-recap "0.0.2-alpha.0" - tslib "2.6.0" - util "0.12.5" - "@lit-protocol/auth-helpers@7.0.0", "@lit-protocol/auth-helpers@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/auth-helpers/-/auth-helpers-7.0.0.tgz#96081f573082f8d1113fa28e0c5eee549dd6b251" @@ -2185,15 +2110,7 @@ tslib "1.14.1" util "0.12.5" -"@lit-protocol/bls-sdk@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/bls-sdk/-/bls-sdk-6.11.2.tgz#474014fe722d7da830543886fa4e812b8fa1253c" - integrity sha512-E9YWeeoETrtwwaNiwVvnA4okMSp2PsM6Pp8UL0nRD328YBTuY5UtZaF85QsmuMSbc7SxWU52ABhWNofZAFOh+A== - dependencies: - tslib "1.14.1" - util "0.12.5" - -"@lit-protocol/constants@6.11.2", "@lit-protocol/constants@^6.11.0", "@lit-protocol/constants@^6.4.0": +"@lit-protocol/constants@6.11.2", "@lit-protocol/constants@^6.4.0": version "6.11.2" resolved "https://registry.yarnpkg.com/@lit-protocol/constants/-/constants-6.11.2.tgz#b888fcaddcc153f6b00a476500cd59a17d5f8f1c" integrity sha512-rcOrHikdJ/SdEL6dT/uRKWZNTYPPgQO4xbHweLMZocsIqofaU5Zpn/jLQ6xabVkx8YaW3quYMI2VT15r3u6CGw== @@ -2221,34 +2138,6 @@ siwe "^2.3.2" tslib "1.14.1" -"@lit-protocol/contracts-sdk@6.11.2", "@lit-protocol/contracts-sdk@^6.4.0": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/contracts-sdk/-/contracts-sdk-6.11.2.tgz#ed939fb3053bfc289ce8328c8be744a6a16658eb" - integrity sha512-vfM+AqjHXAzkwjpFPM2JBCgPQmMCHIGrk12upfb1klvvjHqU4BU7fLl7Q6l2SHC0rwQEj5xNGVFY6mDY0DK6VQ== - dependencies: - "@cosmjs/amino" "0.30.1" - "@cosmjs/crypto" "0.30.1" - "@cosmjs/encoding" "0.30.1" - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/types" "6.11.2" - ajv "^8.12.0" - bitcoinjs-lib "^6.1.0" - ethers "^5.7.1" - jose "^4.14.4" - jszip "^3.10.1" - process "0.11.10" - siwe "^2.0.5" - tslib "1.14.1" - util "0.12.5" - "@lit-protocol/contracts-sdk@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/contracts-sdk/-/contracts-sdk-7.0.0.tgz#7b8ecedb8b532cdf1e0f78e38180e712275cee8b" @@ -2274,15 +2163,10 @@ tslib "1.14.1" util "0.12.5" -"@lit-protocol/contracts@^0.0.63": - version "0.0.63" - resolved "https://registry.yarnpkg.com/@lit-protocol/contracts/-/contracts-0.0.63.tgz#8700c37df9d2422e9c97aa27871fb64de6186f6c" - integrity sha512-CAorNt72ybIY/g//dDeR837izNGuYQR99XwPSK2X2AJ6c+aZX1kdXCrOnxsbY40BzFrOk/dIFo+ymJ9E3qh48w== - -"@lit-protocol/core@6.11.2": +"@lit-protocol/contracts-sdk@^6.4.0": version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/core/-/core-6.11.2.tgz#3c68d8d4f7724bdaf16b369550f7024d1fb51108" - integrity sha512-76TKyLWztfwswR1AAKVwVVtm8C1iJzCqntgwjopF6JA8OulZTbmltKx+/WupmeXwQlLo4lzilZZDJLFhkgwMwg== + resolved "https://registry.yarnpkg.com/@lit-protocol/contracts-sdk/-/contracts-sdk-6.11.2.tgz#ed939fb3053bfc289ce8328c8be744a6a16658eb" + integrity sha512-vfM+AqjHXAzkwjpFPM2JBCgPQmMCHIGrk12upfb1klvvjHqU4BU7fLl7Q6l2SHC0rwQEj5xNGVFY6mDY0DK6VQ== dependencies: "@cosmjs/amino" "0.30.1" "@cosmjs/crypto" "0.30.1" @@ -2291,35 +2175,27 @@ "@ethersproject/abstract-provider" "5.7.0" "@ethersproject/contracts" "5.7.0" "@ethersproject/providers" "5.7.2" - "@lit-protocol/access-control-conditions" "6.11.2" "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/bls-sdk" "6.11.2" "@lit-protocol/constants" "6.11.2" "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/contracts-sdk" "6.11.2" - "@lit-protocol/crypto" "6.11.2" - "@lit-protocol/ecdsa-sdk" "6.11.2" "@lit-protocol/logger" "6.11.2" "@lit-protocol/misc" "6.11.2" - "@lit-protocol/nacl" "6.11.2" - "@lit-protocol/sev-snp-utils-sdk" "6.11.2" "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" ajv "^8.12.0" bitcoinjs-lib "^6.1.0" - bs58 "^5.0.0" - cross-fetch "3.1.4" - date-and-time "^2.4.1" ethers "^5.7.1" jose "^4.14.4" jszip "^3.10.1" - multiformats "^9.7.1" - pako "1.0.11" process "0.11.10" siwe "^2.0.5" tslib "1.14.1" util "0.12.5" +"@lit-protocol/contracts@^0.0.63": + version "0.0.63" + resolved "https://registry.yarnpkg.com/@lit-protocol/contracts/-/contracts-0.0.63.tgz#8700c37df9d2422e9c97aa27871fb64de6186f6c" + integrity sha512-CAorNt72ybIY/g//dDeR837izNGuYQR99XwPSK2X2AJ6c+aZX1kdXCrOnxsbY40BzFrOk/dIFo+ymJ9E3qh48w== + "@lit-protocol/core@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/core/-/core-7.0.0.tgz#50735e41df9e432f358380ea241e9acd80853cbb" @@ -2354,34 +2230,6 @@ tslib "1.14.1" util "0.12.5" -"@lit-protocol/crypto@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/crypto/-/crypto-6.11.2.tgz#dc32842d129a324b444e07e197bb399f130090ca" - integrity sha512-hpVrhhKI6o4SyX9NRriL6yXoNXDpvxVT3k50pg1F5+tHHlHL0bPuFc4hj9RWQ7TqwUtamMfPxEgRhYCTN5u5wg== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/bls-sdk" "6.11.2" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/ecdsa-sdk" "6.11.2" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/nacl" "6.11.2" - "@lit-protocol/sev-snp-utils-sdk" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ajv "^8.12.0" - cross-fetch "3.1.4" - ethers "^5.7.1" - jszip "^3.10.1" - pako "1.0.11" - siwe "^2.0.5" - tslib "1.14.1" - util "0.12.5" - "@lit-protocol/crypto@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/crypto/-/crypto-7.0.0.tgz#edba7706118b3ca348d6e87aaa640bc81ec55603" @@ -2408,90 +2256,6 @@ tslib "1.14.1" util "0.12.5" -"@lit-protocol/ecdsa-sdk@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/ecdsa-sdk/-/ecdsa-sdk-6.11.2.tgz#882ba01d996a193b09218f99294a090ea3b8e62f" - integrity sha512-slGmsK7GgIamJSdgUWl1soTrWe5qXwxNNwb0FSp7gFDW0X4nReDB8PSJIbu/cG5V6m+5QCHM79GLVJSilKnf5g== - dependencies: - tslib "1.14.1" - util "0.12.5" - -"@lit-protocol/encryption@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/encryption/-/encryption-6.11.2.tgz#f558f755924e6d78a6ed5804b3380c4cfd431188" - integrity sha512-PFbDmwUbTIq+PQPTDOQOGh8wTdgFXsM8KF+i4e+OLFOYqnTYdUcWt3r67z1rU1FVqudDIFj47IWzKe1sBmtTDQ== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/bls-sdk" "6.11.2" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/crypto" "6.11.2" - "@lit-protocol/ecdsa-sdk" "6.11.2" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/nacl" "6.11.2" - "@lit-protocol/sev-snp-utils-sdk" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ajv "^8.12.0" - cross-fetch "3.1.4" - ethers "^5.7.1" - jszip "^3.10.1" - pako "1.0.11" - siwe "^2.0.5" - tslib "1.14.1" - util "0.12.5" - -"@lit-protocol/lit-node-client-nodejs@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/lit-node-client-nodejs/-/lit-node-client-nodejs-6.11.2.tgz#b9e9ea33059bb793b18e7a1aee34db5b0cb1e030" - integrity sha512-1xMwkEk2LXJi2aOosolDEpVQmthLl6SQbshk0fvwJn57Q+xYBOLH9PjZ9JinGgLOZ6lQGJS6E7yYJ/b4FFo5tA== - dependencies: - "@cosmjs/amino" "0.30.1" - "@cosmjs/crypto" "0.30.1" - "@cosmjs/encoding" "0.30.1" - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/transactions" "5.7.0" - "@lit-protocol/access-control-conditions" "6.11.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/auth-helpers" "6.11.2" - "@lit-protocol/bls-sdk" "6.11.2" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/contracts-sdk" "6.11.2" - "@lit-protocol/core" "6.11.2" - "@lit-protocol/crypto" "6.11.2" - "@lit-protocol/ecdsa-sdk" "6.11.2" - "@lit-protocol/encryption" "6.11.2" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/misc-browser" "6.11.2" - "@lit-protocol/nacl" "6.11.2" - "@lit-protocol/sev-snp-utils-sdk" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ajv "^8.12.0" - bitcoinjs-lib "^6.1.0" - bs58 "^5.0.0" - cross-fetch "3.1.4" - date-and-time "^2.4.1" - ethers "^5.7.1" - jose "^4.14.4" - jszip "^3.10.1" - multiformats "^9.7.1" - pako "1.0.11" - process "0.11.10" - siwe "^2.0.5" - siwe-recap "0.0.2-alpha.0" - tslib "^2.3.0" - util "0.12.5" - "@lit-protocol/lit-node-client-nodejs@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/lit-node-client-nodejs/-/lit-node-client-nodejs-7.0.0.tgz#e23f4851981fcc32563e1ca1a6009fd97c1d2113" @@ -2532,61 +2296,6 @@ tslib "1.14.1" util "0.12.5" -"@lit-protocol/lit-node-client@^6.11.0": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/lit-node-client/-/lit-node-client-6.11.2.tgz#ddc0d9a42d62a80a89cbeba3604c100285b54858" - integrity sha512-mV+gc6rDjvECGvmso0LccoIK7mdXXqWYuTHNQOPJbYhN7wiDdNHBdLIu/TweBNzr5A1OYEyrhMd+4QINx/Ydcw== - dependencies: - "@cosmjs/amino" "0.30.1" - "@cosmjs/crypto" "0.30.1" - "@cosmjs/encoding" "0.30.1" - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@lit-protocol/access-control-conditions" "6.11.2" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/auth-browser" "6.11.2" - "@lit-protocol/auth-helpers" "6.11.2" - "@lit-protocol/bls-sdk" "6.11.2" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/contracts-sdk" "6.11.2" - "@lit-protocol/core" "6.11.2" - "@lit-protocol/crypto" "6.11.2" - "@lit-protocol/ecdsa-sdk" "6.11.2" - "@lit-protocol/encryption" "6.11.2" - "@lit-protocol/lit-node-client-nodejs" "6.11.2" - "@lit-protocol/logger" "6.11.2" - "@lit-protocol/misc" "6.11.2" - "@lit-protocol/misc-browser" "6.11.2" - "@lit-protocol/nacl" "6.11.2" - "@lit-protocol/sev-snp-utils-sdk" "6.11.2" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - "@walletconnect/ethereum-provider" "2.9.2" - "@walletconnect/modal" "2.6.1" - ajv "^8.12.0" - bitcoinjs-lib "^6.1.0" - bs58 "^5.0.0" - cross-fetch "3.1.4" - date-and-time "^2.4.1" - ethers "^5.7.1" - jose "^4.14.4" - jszip "^3.10.1" - multiformats "^9.7.1" - pako "1.0.11" - process "0.11.10" - siwe "^2.0.5" - siwe-recap "0.0.2-alpha.0" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.1" - util "0.12.5" - "@lit-protocol/lit-node-client@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/lit-node-client/-/lit-node-client-7.0.0.tgz#d5c705a93b2215991e87019fddb20a81687935db" @@ -2664,22 +2373,6 @@ siwe "^2.3.2" tslib "1.14.1" -"@lit-protocol/misc-browser@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/misc-browser/-/misc-browser-6.11.2.tgz#4be791ce46b10763e29390139b844ffd5e94ddc0" - integrity sha512-dAHutu+S7BKYfIGXKlWmdsj2T2dneGBTwY09D5GVrgf6iCmyZd5O4X3tCw+vrfVeRxbdLQQrIe2VQkJhP0yMXw== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/constants" "6.11.2" - "@lit-protocol/contracts" "^0.0.63" - "@lit-protocol/types" "6.11.2" - "@lit-protocol/uint8arrays" "6.11.2" - ethers "^5.7.1" - jszip "^3.10.1" - siwe "^2.0.5" - tslib "1.14.1" - "@lit-protocol/misc-browser@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/misc-browser/-/misc-browser-7.0.0.tgz#c5b1616a01b0761131cd145d961fbae7d02cd8ab" @@ -2737,13 +2430,6 @@ tslib "1.14.1" util "0.12.5" -"@lit-protocol/nacl@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/nacl/-/nacl-6.11.2.tgz#3fc53f54509120f20b5a6a9d613d4a87e68efe65" - integrity sha512-lMImHYQbtTqR7A+XfuAghLczpmj2ctAFXp0e8OwUFk8cTlBhhncvDihAxtddHFD+iqGKKFIXrtukhOt8d64qiA== - dependencies: - tslib "1.14.1" - "@lit-protocol/nacl@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/nacl/-/nacl-7.0.0.tgz#a85352050efa9a49d8bad6e08c45b1517ed1fcb6" @@ -2751,15 +2437,7 @@ dependencies: tslib "1.14.1" -"@lit-protocol/sev-snp-utils-sdk@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/sev-snp-utils-sdk/-/sev-snp-utils-sdk-6.11.2.tgz#97454838bdc16934c393924cd5097ef6f1955014" - integrity sha512-53Pk/8NsFVvfx6wxpoSQkJ3IjovXv8W66PcZyj5awNpR0RMmeXH3aYZtCD0OLl+Aa0PIoRDPUDBKUflKLlogtw== - dependencies: - cross-fetch "3.1.4" - tslib "1.14.1" - -"@lit-protocol/types@6.11.2", "@lit-protocol/types@^6.11.0": +"@lit-protocol/types@6.11.2": version "6.11.2" resolved "https://registry.yarnpkg.com/@lit-protocol/types/-/types-6.11.2.tgz#69d0cc86824bb0ca5187d0854b4c0298b5ba1c16" integrity sha512-CPsOcRaRrEkN2X1gV5yYdyaNmNjzWubWgpzElFtvxg0RqU52a+XBGyF2lwFj3rPMkXAqU7ebC9tffU8sSII7bg== @@ -2783,19 +2461,6 @@ siwe "^2.3.2" tslib "1.14.1" -"@lit-protocol/uint8arrays@6.11.2": - version "6.11.2" - resolved "https://registry.yarnpkg.com/@lit-protocol/uint8arrays/-/uint8arrays-6.11.2.tgz#1c0fa56ebf14b17bc1a8c54da4065de2354dea88" - integrity sha512-LJYNxrwK+pjT39akzPxjMrABedP6dHZqZ+P7/t2s6ueDSvAGT+koeivP14uvMqhjZwsSl0QpPjwhmGowYeKLXw== - dependencies: - "@ethersproject/abstract-provider" "5.7.0" - "@lit-protocol/accs-schemas" "^0.0.19" - "@lit-protocol/contracts" "^0.0.63" - ethers "^5.7.1" - jszip "^3.10.1" - siwe "^2.0.5" - tslib "1.14.1" - "@lit-protocol/uint8arrays@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@lit-protocol/uint8arrays/-/uint8arrays-7.0.0.tgz#26fe8b56409db7b63a7ac9bc6e1f62959b6be22a" @@ -2820,13 +2485,6 @@ pako "^2.1.0" tslib "1.14.1" -"@lit/reactive-element@^1.3.0", "@lit/reactive-element@^1.6.0": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.6.3.tgz#25b4eece2592132845d303e091bad9b04cdcfe03" - integrity sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ== - dependencies: - "@lit-labs/ssr-dom-shim" "^1.0.0" - "@mole-inc/bin-wrapper@^8.0.1": version "8.0.1" resolved "https://registry.yarnpkg.com/@mole-inc/bin-wrapper/-/bin-wrapper-8.0.1.tgz#d7fd0ceb1cfa8a855293a3ed9d7d135f4d442f0e" @@ -2841,75 +2499,6 @@ got "^11.8.5" os-filter-obj "^2.0.0" -"@motionone/animation@^10.15.1", "@motionone/animation@^10.18.0": - version "10.18.0" - resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.18.0.tgz#868d00b447191816d5d5cf24b1cafa144017922b" - integrity sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw== - dependencies: - "@motionone/easing" "^10.18.0" - "@motionone/types" "^10.17.1" - "@motionone/utils" "^10.18.0" - tslib "^2.3.1" - -"@motionone/dom@^10.16.2", "@motionone/dom@^10.16.4": - version "10.18.0" - resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.18.0.tgz#7fd25dac04cab72def6d2b92b8e0cdc091576527" - integrity sha512-bKLP7E0eyO4B2UaHBBN55tnppwRnaE3KFfh3Ps9HhnAkar3Cb69kUCJY9as8LrccVYKgHA+JY5dOQqJLOPhF5A== - dependencies: - "@motionone/animation" "^10.18.0" - "@motionone/generators" "^10.18.0" - "@motionone/types" "^10.17.1" - "@motionone/utils" "^10.18.0" - hey-listen "^1.0.8" - tslib "^2.3.1" - -"@motionone/easing@^10.18.0": - version "10.18.0" - resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.18.0.tgz#7b82f6010dfee3a1bb0ee83abfbaff6edae0c708" - integrity sha512-VcjByo7XpdLS4o9T8t99JtgxkdMcNWD3yHU/n6CLEz3bkmKDRZyYQ/wmSf6daum8ZXqfUAgFeCZSpJZIMxaCzg== - dependencies: - "@motionone/utils" "^10.18.0" - tslib "^2.3.1" - -"@motionone/generators@^10.18.0": - version "10.18.0" - resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.18.0.tgz#fe09ab5cfa0fb9a8884097feb7eb60abeb600762" - integrity sha512-+qfkC2DtkDj4tHPu+AFKVfR/C30O1vYdvsGYaR13W/1cczPrrcjdvYCj0VLFuRMN+lP1xvpNZHCRNM4fBzn1jg== - dependencies: - "@motionone/types" "^10.17.1" - "@motionone/utils" "^10.18.0" - tslib "^2.3.1" - -"@motionone/svelte@^10.16.2": - version "10.16.4" - resolved "https://registry.yarnpkg.com/@motionone/svelte/-/svelte-10.16.4.tgz#5daf117cf5b2576fc6dd487c5e0500938a742470" - integrity sha512-zRVqk20lD1xqe+yEDZhMYgftsuHc25+9JSo+r0a0OWUJFocjSV9D/+UGhX4xgJsuwB9acPzXLr20w40VnY2PQA== - dependencies: - "@motionone/dom" "^10.16.4" - tslib "^2.3.1" - -"@motionone/types@^10.15.1", "@motionone/types@^10.17.1": - version "10.17.1" - resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.17.1.tgz#cf487badbbdc9da0c2cb86ffc1e5d11147c6e6fb" - integrity sha512-KaC4kgiODDz8hswCrS0btrVrzyU2CSQKO7Ps90ibBVSQmjkrt2teqta6/sOG59v7+dPnKMAg13jyqtMKV2yJ7A== - -"@motionone/utils@^10.15.1", "@motionone/utils@^10.18.0": - version "10.18.0" - resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.18.0.tgz#a59ff8932ed9009624bca07c56b28ef2bb2f885e" - integrity sha512-3XVF7sgyTSI2KWvTf6uLlBJ5iAgRgmvp3bpuOiQJvInd4nZ19ET8lX5unn30SlmRH7hXbBbH+Gxd0m0klJ3Xtw== - dependencies: - "@motionone/types" "^10.17.1" - hey-listen "^1.0.8" - tslib "^2.3.1" - -"@motionone/vue@^10.16.2": - version "10.16.4" - resolved "https://registry.yarnpkg.com/@motionone/vue/-/vue-10.16.4.tgz#07d09e3aa5115ca0bcc0076cb9e5322775277c09" - integrity sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg== - dependencies: - "@motionone/dom" "^10.16.4" - tslib "^2.3.1" - "@napi-rs/nice-android-arm-eabi@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@napi-rs/nice-android-arm-eabi/-/nice-android-arm-eabi-1.0.1.tgz#9a0cba12706ff56500df127d6f4caf28ddb94936" @@ -4241,11 +3830,6 @@ resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c" integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw== -"@types/trusted-types@^2.0.2": - version "2.0.7" - resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11" - integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== - "@types/tv4@*": version "1.2.33" resolved "https://registry.yarnpkg.com/@types/tv4/-/tv4-1.2.33.tgz#f6ac0f85cabffde144a16bf7ef8c043e89d1854a" @@ -4491,31 +4075,6 @@ "@walletconnect/safe-json" "^1.0.2" pino "7.11.0" -"@walletconnect/modal-core@2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@walletconnect/modal-core/-/modal-core-2.6.1.tgz#bc76055d0b644a2d4b98024324825c108a700905" - integrity sha512-f2hYlJ5pwzGvjyaZ6BoGR5uiMgXzWXt6w6ktt1N8lmY6PiYp8whZgqx2hTxVWwVlsGnaIfh6UHp1hGnANx0eTQ== - dependencies: - valtio "1.11.0" - -"@walletconnect/modal-ui@2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@walletconnect/modal-ui/-/modal-ui-2.6.1.tgz#200c54c8dfe3c71321abb2724e18bb357dfd6371" - integrity sha512-RFUOwDAMijSK8B7W3+KoLKaa1l+KEUG0LCrtHqaB0H0cLnhEGdLR+kdTdygw+W8+yYZbkM5tXBm7MlFbcuyitA== - dependencies: - "@walletconnect/modal-core" "2.6.1" - lit "2.7.6" - motion "10.16.2" - qrcode "1.5.3" - -"@walletconnect/modal@2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@walletconnect/modal/-/modal-2.6.1.tgz#066fdbfcff83b58c8a9da66ab4af0eb93e3626de" - integrity sha512-G84tSzdPKAFk1zimgV7JzIUFT5olZUVtI3GcOk77OeLYjlMfnDT23RVRHm5EyCrjkptnvpD0wQScXePOFd2Xcw== - dependencies: - "@walletconnect/modal-core" "2.6.1" - "@walletconnect/modal-ui" "2.6.1" - "@walletconnect/relay-api@^1.0.9": version "1.0.11" resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.11.tgz#80ab7ef2e83c6c173be1a59756f95e515fb63224" @@ -5271,7 +4830,7 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -5424,15 +4983,6 @@ clipboardy@^4.0.0: is-wsl "^3.1.0" is64bit "^2.0.0" -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -5775,13 +5325,6 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-fetch@3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== - dependencies: - node-fetch "2.6.1" - cross-fetch@3.1.8, cross-fetch@^3.1.4: version "3.1.8" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" @@ -5887,7 +5430,7 @@ decamelize-keys@^1.1.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.2.0: +decamelize@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== @@ -6028,11 +5571,6 @@ diff@^5.2.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== -dijkstrajs@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz#4c8dbdea1f0f6478bff94d9c49c784d623e4fc23" - integrity sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -6161,11 +5699,6 @@ enabled@2.0.x: resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== -encode-utf8@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" - integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== - encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -6824,7 +6357,7 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -7158,11 +6691,6 @@ he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hey-listen@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" - integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== - hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -8472,31 +8000,6 @@ listhen@^1.9.0: untun "^0.1.3" uqr "^0.1.2" -lit-element@^3.3.0: - version "3.3.3" - resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.3.3.tgz#10bc19702b96ef5416cf7a70177255bfb17b3209" - integrity sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA== - dependencies: - "@lit-labs/ssr-dom-shim" "^1.1.0" - "@lit/reactive-element" "^1.3.0" - lit-html "^2.8.0" - -lit-html@^2.7.0, lit-html@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.8.0.tgz#96456a4bb4ee717b9a7d2f94562a16509d39bffa" - integrity sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q== - dependencies: - "@types/trusted-types" "^2.0.2" - -lit@2.7.6: - version "2.7.6" - resolved "https://registry.yarnpkg.com/lit/-/lit-2.7.6.tgz#810007b876ed43e0c70124de91831921598b1665" - integrity sha512-1amFHA7t4VaaDe+vdQejSVBklwtH9svGoG6/dZi9JhxtJBBlqY5D1RV7iLUYY0trCqQc4NfhYYZilZiVHt7Hxg== - dependencies: - "@lit/reactive-element" "^1.6.0" - lit-element "^3.3.0" - lit-html "^2.7.0" - load-json-file@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" @@ -8957,18 +8460,6 @@ modify-values@^1.0.1: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -motion@10.16.2: - version "10.16.2" - resolved "https://registry.yarnpkg.com/motion/-/motion-10.16.2.tgz#7dc173c6ad62210a7e9916caeeaf22c51e598d21" - integrity sha512-p+PurYqfUdcJZvtnmAqu5fJgV2kR0uLFQuBKtLeFVTrYEVllI99tiOTSefVNYuip9ELTEkepIIDftNdze76NAQ== - dependencies: - "@motionone/animation" "^10.15.1" - "@motionone/dom" "^10.16.2" - "@motionone/svelte" "^10.16.2" - "@motionone/types" "^10.15.1" - "@motionone/utils" "^10.15.1" - "@motionone/vue" "^10.16.2" - ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" @@ -9035,11 +8526,6 @@ node-fetch-native@^1.6.4: resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.4.tgz#679fc8fd8111266d47d7e72c379f1bed9acff06e" integrity sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ== -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -9546,16 +9032,16 @@ pacote@^18.0.0, pacote@^18.0.6: ssri "^10.0.0" tar "^6.1.11" -pako@1.0.11, pako@~1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - pako@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== +pako@~1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -9776,11 +9262,6 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -pngjs@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" - integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== - possible-typed-array-names@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" @@ -9886,11 +9367,6 @@ protocols@^2.0.0, protocols@^2.0.1: resolved "https://registry.yarnpkg.com/protocols/-/protocols-2.0.1.tgz#8f155da3fc0f32644e83c5782c8e8212ccf70a86" integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q== -proxy-compare@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/proxy-compare/-/proxy-compare-2.5.1.tgz#17818e33d1653fbac8c2ec31406bce8a2966f600" - integrity sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA== - proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -9926,16 +9402,6 @@ pure-rand@^6.0.0: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== -qrcode@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.3.tgz#03afa80912c0dccf12bc93f615a535aad1066170" - integrity sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg== - dependencies: - dijkstrajs "^1.0.1" - encode-utf8 "^1.0.3" - pngjs "^5.0.0" - yargs "^15.3.1" - query-string@7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" @@ -10156,11 +9622,6 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -10982,12 +10443,7 @@ tslib@1.14.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3" - integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA== - -tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.6.2, tslib@^2.6.3, tslib@^2.8.0: +tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@^2.6.2, tslib@^2.6.3, tslib@^2.8.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -11252,11 +10708,6 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -use-sync-external-store@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" - integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== - util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -11310,14 +10761,6 @@ validate-npm-package-name@5.0.1, validate-npm-package-name@^5.0.0: resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz#a316573e9b49f3ccd90dbb6eb52b3f06c6d604e8" integrity sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ== -valtio@1.11.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/valtio/-/valtio-1.11.0.tgz#c029dcd17a0f99d2fbec933721fe64cfd32a31ed" - integrity sha512-65Yd0yU5qs86b5lN1eu/nzcTgQ9/6YnD6iO+DDaDbQLn1Zv2w12Gwk43WkPlUBxk5wL/6cD5YMFf7kj6HZ1Kpg== - dependencies: - proxy-compare "2.5.1" - use-sync-external-store "1.2.0" - varuint-bitcoin@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz#e76c138249d06138b480d4c5b40ef53693e24e92" @@ -11389,11 +10832,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which-module@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" - integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== - which-typed-array@^1.1.14, which-typed-array@^1.1.2: version "1.1.15" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" @@ -11598,11 +11036,6 @@ xxhashjs@^0.2.2: dependencies: cuint "^0.2.2" -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -11633,14 +11066,6 @@ yargs-parser@21.1.1, yargs-parser@^21.1.1: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" @@ -11669,23 +11094,6 @@ yargs@17.7.2, yargs@^17.3.1, yargs@^17.6.2: y18n "^5.0.5" yargs-parser "^21.1.1" -yargs@^15.3.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" From 6ecb3ce5ecf86e2da7b293c306cafa2dee7612f6 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Wed, 27 Nov 2024 19:49:39 +0900 Subject: [PATCH 2/8] Add cmds to README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index d6a2a987..aab8640a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ # Lit Developer Code Guides This repository works in conjunction with the [Lit Build Docs](https://docs-olive-ten.vercel.app/build), and contains code examples for various Lit functionalities. + +## Creating a New Code Guide + +### Generating a New Code Directory + +```bash +npx nx g templates:nodejs +``` + +This will run the NX generator for the Node.js template, and create a new directory under a selected category + +### Running All the Tests + +```bash +yarn test:all +``` + +### Running the Tests for a Specific Code Guide + +```bash +yarn workspace name-of-code-guide test +``` From f49527c3c6d0a9bc41969961a1abe79ada143823 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Wed, 27 Nov 2024 22:28:53 +0900 Subject: [PATCH 3/8] WIP Add subcategory selection --- .../src/generators/nodejs/generator.ts | 31 +++++++++++++++++- .../src/generators/nodejs/schema.d.ts | 3 ++ .../src/generators/nodejs/schema.json | 32 ++++++++++++++++++- .../src/generators/nodejs/subcategoryItems.ts | 16 ++++++++++ 4 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tools/templates/src/generators/nodejs/subcategoryItems.ts diff --git a/tools/templates/src/generators/nodejs/generator.ts b/tools/templates/src/generators/nodejs/generator.ts index 8366a6b0..732a3479 100644 --- a/tools/templates/src/generators/nodejs/generator.ts +++ b/tools/templates/src/generators/nodejs/generator.ts @@ -7,6 +7,17 @@ import { } from '@nx/devkit'; import * as path from 'path'; import { NodejsExampleGeneratorSchema } from './schema'; +import { readdirSync } from 'fs'; + +export function getExistingSubcategories(category: string): string[] { + try { + return readdirSync(category, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => dirent.name); + } catch { + return []; + } +} export async function nodejsExampleGenerator( tree: Tree, @@ -17,7 +28,25 @@ export async function nodejsExampleGenerator( name: names(options.name).fileName, }; - const projectRoot = `${resolvedOptions.category}/${resolvedOptions.name}`; + let subcategory = ''; + if (options.subcategoryOption === 'existing') { + const existingSubcategories = getExistingSubcategories(options.category); + if (!existingSubcategories.includes(options.subcategory || '')) { + throw new Error( + `Subcategory "${options.subcategory}" does not exist in category "${ + options.category + }". Available subcategories: ${existingSubcategories.join(', ')}` + ); + } + subcategory = options.subcategory || ''; + } else if (options.subcategoryOption === 'new') { + subcategory = options.subcategory || ''; + } + + const projectRoot = subcategory + ? `${resolvedOptions.category}/${subcategory}/${resolvedOptions.name}` + : `${resolvedOptions.category}/${resolvedOptions.name}`; + addProjectConfiguration(tree, resolvedOptions.name, { root: projectRoot, projectType: 'library', diff --git a/tools/templates/src/generators/nodejs/schema.d.ts b/tools/templates/src/generators/nodejs/schema.d.ts index c03005dd..47a6eb70 100644 --- a/tools/templates/src/generators/nodejs/schema.d.ts +++ b/tools/templates/src/generators/nodejs/schema.d.ts @@ -1,4 +1,7 @@ export interface NodejsExampleGeneratorSchema { category: string; + subcategoryOption: 'none' | 'existing' | 'new'; + subcategory?: string; + newSubcategory?: string; name: string; } diff --git a/tools/templates/src/generators/nodejs/schema.json b/tools/templates/src/generators/nodejs/schema.json index 0ca5db0c..ab7d26a5 100644 --- a/tools/templates/src/generators/nodejs/schema.json +++ b/tools/templates/src/generators/nodejs/schema.json @@ -50,6 +50,36 @@ ] } }, + "subcategoryOption": { + "type": "string", + "description": "How would you like to handle subcategories?", + "x-prompt": { + "message": "Would you like to use a subcategory?", + "type": "list", + "items": [ + { + "value": "none", + "label": "No subcategory" + }, + { + "value": "existing", + "label": "Use existing subcategory" + }, + { + "value": "new", + "label": "Create new subcategory" + } + ] + } + }, + "subcategory": { + "type": "string", + "description": "Select or enter subcategory name", + "x-prompt": { + "message": "Enter subcategory name:", + "when": "subcategoryOption !== 'none'" + } + }, "name": { "type": "string", "description": "Name of the new example", @@ -60,5 +90,5 @@ "x-prompt": "What would you like to name this example?" } }, - "required": ["category", "name"] + "required": ["category", "subcategoryOption", "name"] } diff --git a/tools/templates/src/generators/nodejs/subcategoryItems.ts b/tools/templates/src/generators/nodejs/subcategoryItems.ts new file mode 100644 index 00000000..3f32e085 --- /dev/null +++ b/tools/templates/src/generators/nodejs/subcategoryItems.ts @@ -0,0 +1,16 @@ +import { getExistingSubcategories } from './generator'; + +export default function (schema, context) { + const category = context.category; + const subcategoryOption = context.subcategoryOption; + + if (subcategoryOption === 'existing') { + return getExistingSubcategories(category).map((name) => ({ + value: name, + label: name, + })); + } + + // For new subcategory, return empty to allow free text input + return []; +} From 065d6c32573d80a893eca4fe676ebaa06b4ca671 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Wed, 27 Nov 2024 23:20:33 +0900 Subject: [PATCH 4/8] Fix bug with file path being in package name for template generator --- .../templates/src/generators/nodejs/files/package.json.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/templates/src/generators/nodejs/files/package.json.template b/tools/templates/src/generators/nodejs/files/package.json.template index c283738f..3710cdc5 100644 --- a/tools/templates/src/generators/nodejs/files/package.json.template +++ b/tools/templates/src/generators/nodejs/files/package.json.template @@ -1,5 +1,5 @@ { - "name": "<%= name %>", + "name": "<%= name.replace(/\//g, '-') %>", "version": "0.1.0", "main": "index.js", "license": "MIT", From 2341b7822fd4baef5c3953d465088211f386f138 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Wed, 27 Nov 2024 23:21:56 +0900 Subject: [PATCH 5/8] Init generate session with pkp --- .../using-pkp/.env.example | 1 + .../generating-a-session/using-pkp/.gitignore | 25 ++++ .../using-pkp/.mocharc.json | 4 + .../generating-a-session/using-pkp/README.md | 0 .../using-pkp/package.json | 25 ++++ .../using-pkp/project.json | 8 ++ .../using-pkp/src/index.ts | 54 +++++++++ .../using-pkp/src/utils.ts | 35 ++++++ .../using-pkp/test/index.spec.ts | 51 ++++++++ .../using-pkp/test/testUtils.ts | 29 +++++ .../using-pkp/tsconfig.json | 114 ++++++++++++++++++ 11 files changed, 346 insertions(+) create mode 100644 session-signatures/generating-a-session/using-pkp/.env.example create mode 100644 session-signatures/generating-a-session/using-pkp/.gitignore create mode 100644 session-signatures/generating-a-session/using-pkp/.mocharc.json create mode 100644 session-signatures/generating-a-session/using-pkp/README.md create mode 100644 session-signatures/generating-a-session/using-pkp/package.json create mode 100644 session-signatures/generating-a-session/using-pkp/project.json create mode 100644 session-signatures/generating-a-session/using-pkp/src/index.ts create mode 100644 session-signatures/generating-a-session/using-pkp/src/utils.ts create mode 100644 session-signatures/generating-a-session/using-pkp/test/index.spec.ts create mode 100644 session-signatures/generating-a-session/using-pkp/test/testUtils.ts create mode 100644 session-signatures/generating-a-session/using-pkp/tsconfig.json diff --git a/session-signatures/generating-a-session/using-pkp/.env.example b/session-signatures/generating-a-session/using-pkp/.env.example new file mode 100644 index 00000000..9026e5e0 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/.env.example @@ -0,0 +1 @@ +ETHEREUM_PRIVATE_KEY= \ No newline at end of file diff --git a/session-signatures/generating-a-session/using-pkp/.gitignore b/session-signatures/generating-a-session/using-pkp/.gitignore new file mode 100644 index 00000000..57e09c48 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +.env +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? \ No newline at end of file diff --git a/session-signatures/generating-a-session/using-pkp/.mocharc.json b/session-signatures/generating-a-session/using-pkp/.mocharc.json new file mode 100644 index 00000000..e8ecf2c6 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/.mocharc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://json.schemastore.org/mocharc.json", + "require": "tsx" +} diff --git a/session-signatures/generating-a-session/using-pkp/README.md b/session-signatures/generating-a-session/using-pkp/README.md new file mode 100644 index 00000000..e69de29b diff --git a/session-signatures/generating-a-session/using-pkp/package.json b/session-signatures/generating-a-session/using-pkp/package.json new file mode 100644 index 00000000..c49731bf --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/package.json @@ -0,0 +1,25 @@ +{ + "name": "generating-a-session-using-pkp", + "version": "0.1.0", + "main": "index.js", + "license": "MIT", + "type": "module", + "scripts": { + "test": "dotenvx run -- mocha test/**/*.spec.ts" + }, + "dependencies": { + "@dotenvx/dotenvx": "^0.44.1", + "ethers": "v5" + }, + "devDependencies": { + "@types/chai": "^4.3.16", + "@types/chai-json-schema": "^1.4.10", + "@types/mocha": "^10.0.6", + "chai": "^5.1.1", + "chai-json-schema": "^1.5.1", + "mocha": "^10.4.0", + "tsc": "^2.0.4", + "tsx": "^4.12.0", + "typescript": "^5.4.5" + } +} diff --git a/session-signatures/generating-a-session/using-pkp/project.json b/session-signatures/generating-a-session/using-pkp/project.json new file mode 100644 index 00000000..0c89ccdc --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/project.json @@ -0,0 +1,8 @@ +{ + "name": "generating-a-session/using-pkp", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "projectType": "library", + "sourceRoot": "session-signatures/generating-a-session/using-pkp/src", + "// targets": "to see all targets run: nx show project generating-a-session/using-pkp --web", + "targets": {} +} diff --git a/session-signatures/generating-a-session/using-pkp/src/index.ts b/session-signatures/generating-a-session/using-pkp/src/index.ts new file mode 100644 index 00000000..67d2326b --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/src/index.ts @@ -0,0 +1,54 @@ +import { LitNodeClient } from '@lit-protocol/lit-node-client'; +import { LIT_ABILITY } from '@lit-protocol/constants'; +import { LitPKPResource } from '@lit-protocol/auth-helpers'; +import { EthWalletProvider } from '@lit-protocol/lit-auth-client'; + +import { + getEthersSigner, + getLitNodeClient, + type LIT_NETWORKS_KEYS, +} from './utils'; + +export const getpkpSessionSigs = async ( + litNetwork: LIT_NETWORKS_KEYS, + pkp: { + tokenId: any; + publicKey: string; + ethAddress: string; + } +) => { + let litNodeClient: LitNodeClient; + + try { + const ethersSigner = getEthersSigner(); + litNodeClient = await getLitNodeClient(litNetwork); + + console.log('🔄 Creating AuthMethod using the ethersSigner...'); + const authMethod = await EthWalletProvider.authenticate({ + signer: ethersSigner, + // @ts-expect-error There seems to be a bug with the types + litNodeClient, + }); + console.log('✅ Finished creating the AuthMethod'); + + console.log('🔄 Getting the Session Sigs for the PKP...'); + const sessionSignatures = await litNodeClient.getPkpSessionSigs({ + pkpPublicKey: pkp.publicKey!, + authMethods: [authMethod], + resourceAbilityRequests: [ + { + resource: new LitPKPResource('*'), + ability: LIT_ABILITY.PKPSigning, + }, + ], + expiration: new Date(Date.now() + 1000 * 60 * 10).toISOString(), // 10 minutes + }); + console.log('✅ Got PKP Session Sigs'); + + return sessionSignatures; + } catch (error) { + console.error(error); + } finally { + litNodeClient!.disconnect(); + } +}; diff --git a/session-signatures/generating-a-session/using-pkp/src/utils.ts b/session-signatures/generating-a-session/using-pkp/src/utils.ts new file mode 100644 index 00000000..af3b7ba5 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/src/utils.ts @@ -0,0 +1,35 @@ +import { LIT_NETWORK, LIT_RPC } from '@lit-protocol/constants'; +import { LitContracts } from '@lit-protocol/contracts-sdk'; +import { ethers } from 'ethers'; +import { LitNodeClient } from '@lit-protocol/lit-node-client'; + +export type LIT_NETWORKS_KEYS = (typeof LIT_NETWORK)[keyof typeof LIT_NETWORK]; + +export const getEnv = (name: string): string => { + const env = process.env[name]; + if (env === undefined || env === '') + throw new Error( + `${name} ENV is not defined, please define it in the .env file` + ); + return env; +}; + +export const getEthersSigner = () => { + const ETHEREUM_PRIVATE_KEY = getEnv('ETHEREUM_PRIVATE_KEY'); + return new ethers.Wallet( + ETHEREUM_PRIVATE_KEY, + new ethers.providers.JsonRpcProvider(LIT_RPC.CHRONICLE_YELLOWSTONE) + ); +}; + +export const getLitNodeClient = async (litNetwork: LIT_NETWORKS_KEYS) => { + console.log('🔄 Connecting LitNodeClient to Lit network...'); + const litNodeClient = new LitNodeClient({ + litNetwork, + debug: false, + }); + await litNodeClient.connect(); + console.log('✅ Connected LitNodeClient to Lit network'); + + return litNodeClient; +}; diff --git a/session-signatures/generating-a-session/using-pkp/test/index.spec.ts b/session-signatures/generating-a-session/using-pkp/test/index.spec.ts new file mode 100644 index 00000000..19513744 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/test/index.spec.ts @@ -0,0 +1,51 @@ +import { expect, use } from 'chai'; +import chaiJsonSchema from 'chai-json-schema'; +import { LIT_NETWORK } from '@lit-protocol/constants'; + +import { getpkpSessionSigs } from '../src'; +import { getEthersSigner } from '../src/utils'; +import { mintPkp, getLitContracts } from './testUtils'; + +use(chaiJsonSchema); + +describe('getSessionSigsPKP', () => { + let pkp: { + tokenId: any; + publicKey: string; + ethAddress: string; + }; + + before(async function () { + this.timeout(120_000); + + const ethersSigner = getEthersSigner(); + const litContracts = await getLitContracts(ethersSigner); + pkp = await mintPkp(litContracts); + }); + + it('Attempting to get session signatures...', async () => { + const sessionSigResponseSchema = { + type: 'object', + patternProperties: { + '^https://\\d+\\.\\d+\\.\\d+\\.\\d+:\\d+$': { + type: 'object', + properties: { + sig: { type: 'string' }, + derivedVia: { type: 'string' }, + signedMessage: { type: 'string' }, + address: { type: 'string' }, + algo: { type: 'string' }, + }, + required: ['sig', 'derivedVia', 'signedMessage', 'address', 'algo'], + }, + }, + additionalProperties: false, + }; + + const sessionSignatures = await getpkpSessionSigs( + LIT_NETWORK.DatilTest, + pkp + ); + expect(sessionSignatures).to.be.jsonSchema(sessionSigResponseSchema); + }).timeout(120_000); +}); diff --git a/session-signatures/generating-a-session/using-pkp/test/testUtils.ts b/session-signatures/generating-a-session/using-pkp/test/testUtils.ts new file mode 100644 index 00000000..f3d22a59 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/test/testUtils.ts @@ -0,0 +1,29 @@ +import { LitContracts } from '@lit-protocol/contracts-sdk'; +import { LIT_NETWORK } from '@lit-protocol/constants'; +import { ethers } from 'ethers'; + +export const getLitContracts = async ( + ethersSigner: ethers.Wallet, + litNetwork = LIT_NETWORK.DatilTest +) => { + console.log('🔄 Connecting LitContracts client to network...'); + const litContracts = new LitContracts({ + signer: ethersSigner, + network: litNetwork, + debug: false, + }); + await litContracts.connect(); + console.log('✅ Connected LitContracts client to network'); + + return litContracts; +}; + +export const mintPkp = async (litContracts: LitContracts) => { + console.log('🔄 Minting new PKP...'); + const pkp = (await litContracts.pkpNftContractUtils.write.mint()).pkp; + console.log( + `✅ Minted new PKP with public key: ${pkp.publicKey} and ETH address: ${pkp.ethAddress}` + ); + + return pkp; +}; diff --git a/session-signatures/generating-a-session/using-pkp/tsconfig.json b/session-signatures/generating-a-session/using-pkp/tsconfig.json new file mode 100644 index 00000000..1d521ed2 --- /dev/null +++ b/session-signatures/generating-a-session/using-pkp/tsconfig.json @@ -0,0 +1,114 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "lib": [ + "ES2020" + ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "es2022" /* Specify what module code is generated. */, + "rootDir": "." /* Specify the root folder within your source files. */, + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + "types": [ + "mocha" + ] /* Specify type package names to be included without being referenced in a source file. */, + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */, + "include": ["src/**/*", "test/**/*"] + } +} From 0e37399a0f55db95cc1fa6d21c134462e76f4a83 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Wed, 27 Nov 2024 23:29:15 +0900 Subject: [PATCH 6/8] Correct generate session using pkp package.json --- .../generating-a-session/using-pkp/package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/session-signatures/generating-a-session/using-pkp/package.json b/session-signatures/generating-a-session/using-pkp/package.json index c49731bf..af67bd2d 100644 --- a/session-signatures/generating-a-session/using-pkp/package.json +++ b/session-signatures/generating-a-session/using-pkp/package.json @@ -9,9 +9,14 @@ }, "dependencies": { "@dotenvx/dotenvx": "^0.44.1", + "@lit-protocol/auth-helpers": "^7.0.0", + "@lit-protocol/constants": "^7.0.0", + "@lit-protocol/lit-auth-client": "^7.0.0", + "@lit-protocol/lit-node-client": "^7.0.0", "ethers": "v5" }, "devDependencies": { + "@lit-protocol/contracts-sdk": "^7.0.0", "@types/chai": "^4.3.16", "@types/chai-json-schema": "^1.4.10", "@types/mocha": "^10.0.6", From 97c87c7a3114b8cd2cbafc63153a279425f8089c Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Thu, 28 Nov 2024 19:03:27 +0900 Subject: [PATCH 7/8] Rename generating-a-session-using-pkp-auth-with-eth-wallet --- .../using-pkp/{ => auth-with-eth-wallet}/.env.example | 0 .../using-pkp/{ => auth-with-eth-wallet}/.gitignore | 0 .../using-pkp/{ => auth-with-eth-wallet}/.mocharc.json | 0 .../using-pkp/{ => auth-with-eth-wallet}/README.md | 0 .../using-pkp/{ => auth-with-eth-wallet}/package.json | 2 +- .../using-pkp/{ => auth-with-eth-wallet}/project.json | 6 +++--- .../using-pkp/{ => auth-with-eth-wallet}/src/index.ts | 0 .../using-pkp/{ => auth-with-eth-wallet}/src/utils.ts | 0 .../using-pkp/{ => auth-with-eth-wallet}/test/index.spec.ts | 0 .../using-pkp/{ => auth-with-eth-wallet}/test/testUtils.ts | 0 .../using-pkp/{ => auth-with-eth-wallet}/tsconfig.json | 0 11 files changed, 4 insertions(+), 4 deletions(-) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/.env.example (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/.gitignore (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/.mocharc.json (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/README.md (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/package.json (91%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/project.json (62%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/src/index.ts (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/src/utils.ts (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/test/index.spec.ts (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/test/testUtils.ts (100%) rename session-signatures/generating-a-session/using-pkp/{ => auth-with-eth-wallet}/tsconfig.json (100%) diff --git a/session-signatures/generating-a-session/using-pkp/.env.example b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/.env.example similarity index 100% rename from session-signatures/generating-a-session/using-pkp/.env.example rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/.env.example diff --git a/session-signatures/generating-a-session/using-pkp/.gitignore b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/.gitignore similarity index 100% rename from session-signatures/generating-a-session/using-pkp/.gitignore rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/.gitignore diff --git a/session-signatures/generating-a-session/using-pkp/.mocharc.json b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/.mocharc.json similarity index 100% rename from session-signatures/generating-a-session/using-pkp/.mocharc.json rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/.mocharc.json diff --git a/session-signatures/generating-a-session/using-pkp/README.md b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/README.md similarity index 100% rename from session-signatures/generating-a-session/using-pkp/README.md rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/README.md diff --git a/session-signatures/generating-a-session/using-pkp/package.json b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/package.json similarity index 91% rename from session-signatures/generating-a-session/using-pkp/package.json rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/package.json index af67bd2d..255ebf80 100644 --- a/session-signatures/generating-a-session/using-pkp/package.json +++ b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/package.json @@ -1,5 +1,5 @@ { - "name": "generating-a-session-using-pkp", + "name": "generating-a-session-using-pkp-auth-with-eth-wallet", "version": "0.1.0", "main": "index.js", "license": "MIT", diff --git a/session-signatures/generating-a-session/using-pkp/project.json b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/project.json similarity index 62% rename from session-signatures/generating-a-session/using-pkp/project.json rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/project.json index 0c89ccdc..b993761a 100644 --- a/session-signatures/generating-a-session/using-pkp/project.json +++ b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/project.json @@ -1,8 +1,8 @@ { - "name": "generating-a-session/using-pkp", + "name": "generating-a-session-using-pkp-auth-with-eth-wallet", "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", - "sourceRoot": "session-signatures/generating-a-session/using-pkp/src", - "// targets": "to see all targets run: nx show project generating-a-session/using-pkp --web", + "sourceRoot": "session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/src", + "// targets": "to see all targets run: nx show project generating-a-session-using-pkp-auth-with-eth-wallet --web", "targets": {} } diff --git a/session-signatures/generating-a-session/using-pkp/src/index.ts b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/src/index.ts similarity index 100% rename from session-signatures/generating-a-session/using-pkp/src/index.ts rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/src/index.ts diff --git a/session-signatures/generating-a-session/using-pkp/src/utils.ts b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/src/utils.ts similarity index 100% rename from session-signatures/generating-a-session/using-pkp/src/utils.ts rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/src/utils.ts diff --git a/session-signatures/generating-a-session/using-pkp/test/index.spec.ts b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/test/index.spec.ts similarity index 100% rename from session-signatures/generating-a-session/using-pkp/test/index.spec.ts rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/test/index.spec.ts diff --git a/session-signatures/generating-a-session/using-pkp/test/testUtils.ts b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/test/testUtils.ts similarity index 100% rename from session-signatures/generating-a-session/using-pkp/test/testUtils.ts rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/test/testUtils.ts diff --git a/session-signatures/generating-a-session/using-pkp/tsconfig.json b/session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/tsconfig.json similarity index 100% rename from session-signatures/generating-a-session/using-pkp/tsconfig.json rename to session-signatures/generating-a-session/using-pkp/auth-with-eth-wallet/tsconfig.json From cd863418cb9425d6c0cc8ef5c0dde6ed7a169db9 Mon Sep 17 00:00:00 2001 From: Wyatt Barnes Date: Thu, 28 Nov 2024 19:22:45 +0900 Subject: [PATCH 8/8] Init browser generator --- tools/templates/generators.json | 5 + .../generators/browser/files/.eslintrc.cjs | 18 ++++ .../src/generators/browser/files/.gitignore | 25 +++++ .../generators/browser/files/.mocharc.json | 4 + .../src/generators/browser/files/README.md | 0 .../src/generators/browser/files/index.html | 27 ++++++ .../browser/files/package.json.template | 34 +++++++ .../generators/browser/files/public/vite.svg | 1 + .../src/generators/browser/files/src/App.css | 42 +++++++++ .../src/generators/browser/files/src/App.tsx | 17 ++++ .../browser/files/src/assets/react.svg | 1 + .../generators/browser/files/src/index.css | 68 ++++++++++++++ .../generators/browser/files/src/litCode.ts | 8 ++ .../src/generators/browser/files/src/main.tsx | 10 ++ .../browser/files/src/vite-env.d.ts | 1 + .../browser/files/tsconfig.app.json | 27 ++++++ .../generators/browser/files/tsconfig.json | 11 +++ .../browser/files/tsconfig.node.json | 13 +++ .../generators/browser/files/vite.config.ts | 43 +++++++++ .../src/generators/browser/generator.spec.ts | 20 ++++ .../src/generators/browser/generator.ts | 65 +++++++++++++ .../src/generators/browser/schema.d.ts | 7 ++ .../src/generators/browser/schema.json | 94 +++++++++++++++++++ .../generators/browser/subcategoryItems.ts | 16 ++++ 24 files changed, 557 insertions(+) create mode 100644 tools/templates/src/generators/browser/files/.eslintrc.cjs create mode 100644 tools/templates/src/generators/browser/files/.gitignore create mode 100644 tools/templates/src/generators/browser/files/.mocharc.json create mode 100644 tools/templates/src/generators/browser/files/README.md create mode 100644 tools/templates/src/generators/browser/files/index.html create mode 100644 tools/templates/src/generators/browser/files/package.json.template create mode 100644 tools/templates/src/generators/browser/files/public/vite.svg create mode 100644 tools/templates/src/generators/browser/files/src/App.css create mode 100644 tools/templates/src/generators/browser/files/src/App.tsx create mode 100644 tools/templates/src/generators/browser/files/src/assets/react.svg create mode 100644 tools/templates/src/generators/browser/files/src/index.css create mode 100644 tools/templates/src/generators/browser/files/src/litCode.ts create mode 100644 tools/templates/src/generators/browser/files/src/main.tsx create mode 100644 tools/templates/src/generators/browser/files/src/vite-env.d.ts create mode 100644 tools/templates/src/generators/browser/files/tsconfig.app.json create mode 100644 tools/templates/src/generators/browser/files/tsconfig.json create mode 100644 tools/templates/src/generators/browser/files/tsconfig.node.json create mode 100644 tools/templates/src/generators/browser/files/vite.config.ts create mode 100644 tools/templates/src/generators/browser/generator.spec.ts create mode 100644 tools/templates/src/generators/browser/generator.ts create mode 100644 tools/templates/src/generators/browser/schema.d.ts create mode 100644 tools/templates/src/generators/browser/schema.json create mode 100644 tools/templates/src/generators/browser/subcategoryItems.ts diff --git a/tools/templates/generators.json b/tools/templates/generators.json index 905242a3..4bdfaf71 100644 --- a/tools/templates/generators.json +++ b/tools/templates/generators.json @@ -1,5 +1,10 @@ { "generators": { + "browser": { + "factory": "./src/generators/browser/generator", + "schema": "./src/generators/browser/schema.json", + "description": "browser generator" + }, "nodejs": { "factory": "./src/generators/nodejs/generator", "schema": "./src/generators/nodejs/schema.json", diff --git a/tools/templates/src/generators/browser/files/.eslintrc.cjs b/tools/templates/src/generators/browser/files/.eslintrc.cjs new file mode 100644 index 00000000..4c99537a --- /dev/null +++ b/tools/templates/src/generators/browser/files/.eslintrc.cjs @@ -0,0 +1,18 @@ +module.exports = { + root: true, + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], + ignorePatterns: ['dist', '.eslintrc.cjs'], + parser: '@typescript-eslint/parser', + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, +}; diff --git a/tools/templates/src/generators/browser/files/.gitignore b/tools/templates/src/generators/browser/files/.gitignore new file mode 100644 index 00000000..57e09c48 --- /dev/null +++ b/tools/templates/src/generators/browser/files/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +.env +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? \ No newline at end of file diff --git a/tools/templates/src/generators/browser/files/.mocharc.json b/tools/templates/src/generators/browser/files/.mocharc.json new file mode 100644 index 00000000..e8ecf2c6 --- /dev/null +++ b/tools/templates/src/generators/browser/files/.mocharc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://json.schemastore.org/mocharc.json", + "require": "tsx" +} diff --git a/tools/templates/src/generators/browser/files/README.md b/tools/templates/src/generators/browser/files/README.md new file mode 100644 index 00000000..e69de29b diff --git a/tools/templates/src/generators/browser/files/index.html b/tools/templates/src/generators/browser/files/index.html new file mode 100644 index 00000000..67a83e60 --- /dev/null +++ b/tools/templates/src/generators/browser/files/index.html @@ -0,0 +1,27 @@ + + + + + + + Vite + React + TS + + + +
+ + + diff --git a/tools/templates/src/generators/browser/files/package.json.template b/tools/templates/src/generators/browser/files/package.json.template new file mode 100644 index 00000000..492efb8d --- /dev/null +++ b/tools/templates/src/generators/browser/files/package.json.template @@ -0,0 +1,34 @@ +{ + "name": "<%= name.replace(/\//g, '-') %>", + "version": "0.1.0", + "main": "index.js", + "license": "MIT", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "dependencies": { + "@esbuild-plugins/node-globals-polyfill": "^0.2.3", + "@esbuild-plugins/node-modules-polyfill": "^0.2.2", + "@vitejs/plugin-react-swc": "^3.7.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "rollup-plugin-polyfill-node": "^0.13.0", + "vite-plugin-node-polyfills": "^0.22.0" + }, + "devDependencies": { + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^7.13.1", + "@typescript-eslint/parser": "^7.13.1", + "@vitejs/plugin-react": "^4.3.1", + "eslint": "^8.57.0", + "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-react-refresh": "^0.4.7", + "typescript": "^5.5.3", + "vite": "^5.3.1" + } +} diff --git a/tools/templates/src/generators/browser/files/public/vite.svg b/tools/templates/src/generators/browser/files/public/vite.svg new file mode 100644 index 00000000..e7b8dfb1 --- /dev/null +++ b/tools/templates/src/generators/browser/files/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tools/templates/src/generators/browser/files/src/App.css b/tools/templates/src/generators/browser/files/src/App.css new file mode 100644 index 00000000..b9d355df --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/App.css @@ -0,0 +1,42 @@ +#root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.react:hover { + filter: drop-shadow(0 0 2em #61dafbaa); +} + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: no-preference) { + a:nth-of-type(2) .logo { + animation: logo-spin infinite 20s linear; + } +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} diff --git a/tools/templates/src/generators/browser/files/src/App.tsx b/tools/templates/src/generators/browser/files/src/App.tsx new file mode 100644 index 00000000..0dc89ce3 --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/App.tsx @@ -0,0 +1,17 @@ +import { runExample } from './litCode'; + +function App() { + return ( + <> +
+
+

Browser Example

+ +
+ + ); +} + +export default App; diff --git a/tools/templates/src/generators/browser/files/src/assets/react.svg b/tools/templates/src/generators/browser/files/src/assets/react.svg new file mode 100644 index 00000000..6c87de9b --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tools/templates/src/generators/browser/files/src/index.css b/tools/templates/src/generators/browser/files/src/index.css new file mode 100644 index 00000000..6119ad9a --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/index.css @@ -0,0 +1,68 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/tools/templates/src/generators/browser/files/src/litCode.ts b/tools/templates/src/generators/browser/files/src/litCode.ts new file mode 100644 index 00000000..e6e77d61 --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/litCode.ts @@ -0,0 +1,8 @@ +export const runExample = async () => { + try { + } catch (error) { + console.error(error); + } finally { + // Disconnect from LitNodeClient, etc. + } +}; diff --git a/tools/templates/src/generators/browser/files/src/main.tsx b/tools/templates/src/generators/browser/files/src/main.tsx new file mode 100644 index 00000000..93db3799 --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/main.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App.tsx'; +import './index.css'; + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + +); diff --git a/tools/templates/src/generators/browser/files/src/vite-env.d.ts b/tools/templates/src/generators/browser/files/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/tools/templates/src/generators/browser/files/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tools/templates/src/generators/browser/files/tsconfig.app.json b/tools/templates/src/generators/browser/files/tsconfig.app.json new file mode 100644 index 00000000..d739292a --- /dev/null +++ b/tools/templates/src/generators/browser/files/tsconfig.app.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/tools/templates/src/generators/browser/files/tsconfig.json b/tools/templates/src/generators/browser/files/tsconfig.json new file mode 100644 index 00000000..ea9d0cd8 --- /dev/null +++ b/tools/templates/src/generators/browser/files/tsconfig.json @@ -0,0 +1,11 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.node.json" + } + ] +} diff --git a/tools/templates/src/generators/browser/files/tsconfig.node.json b/tools/templates/src/generators/browser/files/tsconfig.node.json new file mode 100644 index 00000000..3afdd6e3 --- /dev/null +++ b/tools/templates/src/generators/browser/files/tsconfig.node.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true, + "noEmit": true + }, + "include": ["vite.config.ts"] +} diff --git a/tools/templates/src/generators/browser/files/vite.config.ts b/tools/templates/src/generators/browser/files/vite.config.ts new file mode 100644 index 00000000..a97f95c5 --- /dev/null +++ b/tools/templates/src/generators/browser/files/vite.config.ts @@ -0,0 +1,43 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'; +import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'; +import rollupNodePolyFill from 'rollup-plugin-polyfill-node'; +import { nodePolyfills } from 'vite-plugin-node-polyfills'; + +export default defineConfig({ + plugins: [ + react(), + nodePolyfills({ + include: ['buffer', 'process', 'util'], + }), + ], + define: { + 'process.env': {}, + global: 'globalThis', + }, + resolve: { + alias: { + // Remove the buffer alias + }, + }, + optimizeDeps: { + esbuildOptions: { + define: { + global: 'globalThis', + }, + plugins: [ + NodeGlobalsPolyfillPlugin({ + buffer: true, + process: true, + }), + NodeModulesPolyfillPlugin(), + ], + }, + }, + build: { + rollupOptions: { + plugins: [rollupNodePolyFill()], + }, + }, +}); diff --git a/tools/templates/src/generators/browser/generator.spec.ts b/tools/templates/src/generators/browser/generator.spec.ts new file mode 100644 index 00000000..926a86eb --- /dev/null +++ b/tools/templates/src/generators/browser/generator.spec.ts @@ -0,0 +1,20 @@ +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Tree, readProjectConfiguration } from '@nx/devkit'; + +import { browserGenerator } from './generator'; +import { BrowserGeneratorSchema } from './schema'; + +describe('nodejs generator', () => { + let tree: Tree; + const options: BrowserGeneratorSchema = { name: 'test' }; + + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + }); + + it('should run successfully', async () => { + await browserGenerator(tree, options); + const config = readProjectConfiguration(tree, 'test'); + expect(config).toBeDefined(); + }); +}); diff --git a/tools/templates/src/generators/browser/generator.ts b/tools/templates/src/generators/browser/generator.ts new file mode 100644 index 00000000..dad3fb16 --- /dev/null +++ b/tools/templates/src/generators/browser/generator.ts @@ -0,0 +1,65 @@ +import { + addProjectConfiguration, + formatFiles, + generateFiles, + names, + Tree, +} from '@nx/devkit'; +import * as path from 'path'; +import { BrowserExampleGeneratorSchema } from './schema'; +import { readdirSync } from 'fs'; + +export function getExistingSubcategories(category: string): string[] { + try { + return readdirSync(category, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => dirent.name); + } catch { + return []; + } +} + +export async function browserExampleGenerator( + tree: Tree, + options: BrowserExampleGeneratorSchema +) { + const resolvedOptions = { + ...options, + name: names(options.name).fileName, + }; + + let subcategory = ''; + if (options.subcategoryOption === 'existing') { + const existingSubcategories = getExistingSubcategories(options.category); + if (!existingSubcategories.includes(options.subcategory || '')) { + throw new Error( + `Subcategory "${options.subcategory}" does not exist in category "${ + options.category + }". Available subcategories: ${existingSubcategories.join(', ')}` + ); + } + subcategory = options.subcategory || ''; + } else if (options.subcategoryOption === 'new') { + subcategory = options.subcategory || ''; + } + + const projectRoot = subcategory + ? `${resolvedOptions.category}/${subcategory}/${resolvedOptions.name}` + : `${resolvedOptions.category}/${resolvedOptions.name}`; + + addProjectConfiguration(tree, resolvedOptions.name, { + root: projectRoot, + projectType: 'library', + sourceRoot: `${projectRoot}/src`, + targets: {}, + }); + generateFiles( + tree, + path.join(__dirname, 'files'), + projectRoot, + resolvedOptions + ); + await formatFiles(tree); +} + +export default browserExampleGenerator; diff --git a/tools/templates/src/generators/browser/schema.d.ts b/tools/templates/src/generators/browser/schema.d.ts new file mode 100644 index 00000000..5bf8ba0a --- /dev/null +++ b/tools/templates/src/generators/browser/schema.d.ts @@ -0,0 +1,7 @@ +export interface BrowserExampleGeneratorSchema { + category: string; + subcategoryOption: 'none' | 'existing' | 'new'; + subcategory?: string; + newSubcategory?: string; + name: string; +} diff --git a/tools/templates/src/generators/browser/schema.json b/tools/templates/src/generators/browser/schema.json new file mode 100644 index 00000000..67dc7e75 --- /dev/null +++ b/tools/templates/src/generators/browser/schema.json @@ -0,0 +1,94 @@ +{ + "$schema": "https://json-schema.org/schema", + "$id": "Browser", + "title": "", + "type": "object", + "properties": { + "category": { + "type": "string", + "description": "Select the category for this example", + "x-prompt": { + "message": "Which category would you like to use?", + "type": "list", + "items": [ + { + "value": "getting-started", + "label": "Getting Started" + }, + { + "value": "capacity-credits", + "label": "Capacity Credits" + }, + { + "value": "payment-delegation-db", + "label": "Payment Delegation Database" + }, + { + "value": "session-signatures", + "label": "Session Signatures" + }, + { + "value": "programmable-key-pairs", + "label": "Programmable Key Pairs (PKPs)" + }, + { + "value": "wrapped-keys", + "label": "Wrapped Keys" + }, + { + "value": "encryption", + "label": "Encryption" + }, + { + "value": "access-control", + "label": "Access Control" + }, + { + "value": "lit-actions", + "label": "Lit Actions" + } + ] + } + }, + "subcategoryOption": { + "type": "string", + "description": "How would you like to handle subcategories?", + "x-prompt": { + "message": "Would you like to use a subcategory?", + "type": "list", + "items": [ + { + "value": "none", + "label": "No subcategory" + }, + { + "value": "existing", + "label": "Use existing subcategory" + }, + { + "value": "new", + "label": "Create new subcategory" + } + ] + } + }, + "subcategory": { + "type": "string", + "description": "Select or enter subcategory name", + "x-prompt": { + "message": "Enter subcategory name:", + "when": "subcategoryOption !== 'none'" + } + }, + "name": { + "type": "string", + "description": "Name of the new example", + "$default": { + "$source": "argv", + "index": 0 + }, + "x-prompt": "What would you like to name this example?" + } + }, + "required": ["category", "subcategoryOption", "name"] +} diff --git a/tools/templates/src/generators/browser/subcategoryItems.ts b/tools/templates/src/generators/browser/subcategoryItems.ts new file mode 100644 index 00000000..3f32e085 --- /dev/null +++ b/tools/templates/src/generators/browser/subcategoryItems.ts @@ -0,0 +1,16 @@ +import { getExistingSubcategories } from './generator'; + +export default function (schema, context) { + const category = context.category; + const subcategoryOption = context.subcategoryOption; + + if (subcategoryOption === 'existing') { + return getExistingSubcategories(category).map((name) => ({ + value: name, + label: name, + })); + } + + // For new subcategory, return empty to allow free text input + return []; +}