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: add new pkphelperv2 features to a new endpoint on the relay #41

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jtary
Copy link
Contributor

@jtary jtary commented Apr 12, 2024

Add Endpoint for new PKPHelperV2

Description

Adds a new endpoint to expose the create PKP function of the PKPHelperV2 contract.

Endpoint

The endpoint is available at POST /mint-next-and-add-auth-methods-v2 and accepts a body with the following parameters:

keyType: string;
permittedAuthMethodTypes: string[];
permittedAuthMethodIds: string[];
permittedAuthMethodPubkeys: string[];
permittedAuthMethodScopes: string[][];
addPkpEthAddressAsPermittedAddress: boolean;
pkpEthAddressScopes: string[][];
sendPkpToItself: boolean;
burnPkp: boolean;

@jtary jtary marked this pull request as draft April 12, 2024 20:00
@joshLong145
Copy link
Contributor

@jtary I think some of the PR's which are being used on the relay server are not yet merged. Perhaps syncing with @Ansonhkg on the other PR's which are currently pending such that you have all the context on what is current.

Comment on lines +143 to +145
case "manzano":
return getContractFromWorker('manzano', 'PKPHelperV2');
case "habanero":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think much of the network resolving implementations are already implemented in the PR here: #37

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's where the getContractFromWorker function comes from. This implementation is a mirror of the exiting getPKPHelperContract function, which should include the changes in #37 . Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this does look to match, just wanted to call it out incase it wasnt known

lit.ts Outdated
burnPkp: boolean;
}): Promise<ethers.Transaction> {
console.log(
"In mintPKPV2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this log V2 or V3

Copy link
Contributor Author

@jtary jtary Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's wrong. Should be V3.

@joshLong145
Copy link
Contributor

@jtary what is the release plan for this feature? is there a corresponding contract implementation that can be referenced?

@jtary
Copy link
Contributor Author

jtary commented Apr 16, 2024

@jtary what is the release plan for this feature? is there a corresponding contract implementation that can be referenced?

Contract is here: https://github.com/LIT-Protocol/lit-assets/blob/develop/blockchain/contracts/contracts/lit-node/PKPHelperV2.sol

Don't think there is a release plan yet. @glitch003 any plans for this?

@jtary jtary marked this pull request as ready for review April 19, 2024 23:25

// first get mint cost
const mintCost = await pkpNft.mintCost();
const tx = await pkpHelper.mintNextAndAddAuthMethods(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting that this implementation is not using the queuing system which will guarantee ordering nonce any reason for this not to be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants