Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade to v7 #2

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ We need to bundle the dependencies of the nodejs server before this is easy. To

Then, make sure you have installed:

- pytest `pip install pytest`
- run `pip install -e . ` in the root directory
- `pip install pytest`
- run `pip install -e .` in the root directory

Finally, run `pytest` to in the root directory to test it.
Finally:

1. Go to `lit_python_sdk/nodejs` and run `LIT_PYTHON_SDK_PRIVATE_KEY=XXX node server.js`
2. Then run `pytest` at the root directory
6 changes: 3 additions & 3 deletions lit_python_sdk/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"license": "ISC",
"description": "",
"dependencies": {
"@lit-protocol/constants": "^6.11.0",
"@lit-protocol/contracts-sdk": "^6.11.0",
"@lit-protocol/lit-node-client-nodejs": "^6.11.0",
"@lit-protocol/constants": "7.0.1-alpha-0",
"@lit-protocol/contracts-sdk": "7.0.1-alpha-0",
"@lit-protocol/lit-node-client-nodejs": "7.0.1-alpha-0",
"body-parser": "^1.20.2",
"concurrently": "^8.2.2",
"ethers": "^5.7.2",
Expand Down
5 changes: 3 additions & 2 deletions lit_python_sdk/nodejs/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
AuthMethodScope,
AuthMethodType,
ProviderType,
LIT_ABILITY,
} = require("@lit-protocol/constants");
const ethers = require("ethers");
const {
Expand Down Expand Up @@ -100,11 +101,11 @@ app.post("/createWallet", async (req, res) => {
resources: [
{
resource: new LitActionResource("*"),
ability: LitAbility.LitActionExecution,
ability: LIT_ABILITY.LitActionExecution,
},
{
resource: new LitPKPResource("*"),
ability: LitAbility.PKPSigning,
ability: LIT_ABILITY.PKPSigning,
},
],
walletAddress: app.locals.ethersWallet.address,
Expand Down
7 changes: 5 additions & 2 deletions lit_python_sdk/nodejs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const {
createSiweMessage,
generateAuthSig,
} = require("@lit-protocol/auth-helpers");
const {
LIT_ABILITY,
} = require("@lit-protocol/constants");

async function getSessionSigs(app) {
// get session sigs
Expand All @@ -14,11 +17,11 @@ async function getSessionSigs(app) {
resourceAbilityRequests: [
{
resource: new LitActionResource("*"),
ability: LitAbility.LitActionExecution,
ability: LIT_ABILITY.LitActionExecution,
},
{
resource: new LitPKPResource("*"),
ability: LitAbility.PKPSigning,
ability: LIT_ABILITY.PKPSigning,
},
],
authNeededCallback: async ({
Expand Down
Loading