GithubHelp home page GithubHelp logo

Comments (6)

Ansonhkg avatar Ansonhkg commented on July 20, 2024 1

Sure. Let me know if the following works for you:

yarn add @lit-protocol/[email protected]
const pkpWallet = new PKPWallet({
  pkpPubKey: PKP_PUBKEY,
  controllerAuthSig: CONTROLLER_AUTHSIG,
  provider: "https://rpc-mumbai.maticvigil.com",
  debug: true,
  // if both code and ipfsId are not provided then it will use the default lit action code
  // litActionIPFS: "QmRwN9GKHvCn4Vk7biqtr6adjXMs7PzzYPCzNCRjPFiDjm",
  litActionCode: `
  (async () => {
    const sigShare = await LitActions.signEcdsa({ toSign, publicKey, sigName });
    console.log("extraParams:", extraParams);
  })();
  `,
  litActionJsParams: {
    // this will override the default toSign param
    // toSign: [1, 2, 3, 4, 5],

    // extraParams
    extraParams: [1, 23],
  },
});

from js-sdk.

Ansonhkg avatar Ansonhkg commented on July 20, 2024

Hey @joshLong145, you can extend our PKPWallet class to add more custom configurations like this repo:
https://github.com/LIT-Protocol/lit-pkp-sdk/blob/main/src/index.js

Would it help?

from js-sdk.

joshLong145 avatar joshLong145 commented on July 20, 2024

Hey @joshLong145, you can extend our PKPWallet class to add more custom configurations like this repo: https://github.com/LIT-Protocol/lit-pkp-sdk/blob/main/src/index.js

Would it help?

this is essentially what we have done to create custom implementations the pkp's signing mechanism. but it would be nice if configuration options where added to the props

from js-sdk.

Ansonhkg avatar Ansonhkg commented on July 20, 2024

great! i'll add that to my to-do

from js-sdk.

Ansonhkg avatar Ansonhkg commented on July 20, 2024

Hey @joshLong145 we've added pkp-ethers to this repo now you can install it via:

yarn add @lit-protocol/pkp-ethers

You can now edit your lit action code via the constructor eg:

  const pkpWallet = new PKPWallet({
    pkpPubKey: PKP_PUBKEY,
    controllerAuthSig: CONTROLLER_AUTHSIG,
    provider: "https://rpc-mumbai.maticvigil.com",
    debug: true,
    litActionCode: `
    (async () => {
      console.log("Testing");
    })();
    `,
  });

Let me know if this work for you?

from js-sdk.

joshLong145 avatar joshLong145 commented on July 20, 2024

Hey @joshLong145 we've added pkp-ethers to this repo now you can install it via:

yarn add @lit-protocol/pkp-ethers

You can now edit your lit action code via the constructor eg:

  const pkpWallet = new PKPWallet({
    pkpPubKey: PKP_PUBKEY,
    controllerAuthSig: CONTROLLER_AUTHSIG,
    provider: "https://rpc-mumbai.maticvigil.com",
    debug: true,
    litActionCode: `
    (async () => {
      console.log("Testing");
    })();
    `,
  });

Let me know if this work for you?

Would it also be possible to add ipfsId and jsParams to the PKPWallet props? this would allow for usage of registered cids and to pass arbitrary parameters to action implementations. This would then mean you can define either litActionCode or ipfsId making both optional props. If none are provided then perhaps defaulting to the implementation you have outlined above.

from js-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.