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(thirdweb): add support for ThirdWeb mint plugin #444

Merged
merged 21 commits into from
Jun 12, 2024
Merged

Conversation

mmackz
Copy link
Collaborator

@mmackz mmackz commented Jun 10, 2024

Integration of thirdweb mint action plugin for QuestDK

This PR introduces the integration of the thirdweb mint plugin for QuestDK.

About The Project

Thirdweb is a robust platform that streamlines the process of minting and managing NFTs. By providing easy-to-use tools and infrastructure, it empowers creators to mint, deploy, and manage their NFT collections efficiently.

Implementation Details

Thirdweb is available on most major L2 networks such as base and optimism

We have support for two types of contracts, DropERC1155 and OpenEditionERC721, both are quite similar, with the difference being the ERC1155 can utilize a tokenId parameter. Both use the claim functions on their respective contracts.

Sample Mints

Example Transactions

@mmackz mmackz requested a review from a team as a code owner June 10, 2024 20:46
Copy link

changeset-bot bot commented Jun 10, 2024

🦋 Changeset detected

Latest commit: a5e9c0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@rabbitholegg/questdk-plugin-registry Minor
@rabbitholegg/questdk-plugin-thirdweb Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@Quazia Quazia left a comment

Choose a reason for hiding this comment

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

LGTM
A few helper functions that could be moved into the utils and the types.ts file is a little confusing - it looks like mocked returns and you could cast them to the Viem type for that simulation but it doesn't really look like they're types.

@@ -0,0 +1,267 @@
import { mint } from './ThirdWeb'
// import { getFees, mint, simulateMint } from './ThirdWeb'
Copy link
Member

Choose a reason for hiding this comment

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

cleanup

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ive left the commented code so that I can easily run the non-mocked tests when needed. (the mocked tests are kind of useless 😅)

Wondering if maybe there is a better way to have non-mocked tests to be run locally.

throw new Error('Invalid contract type')
}

export function formatAmount(amount: FilterOperator | undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

This and the getMintAmount could both probably live in the utils package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Going to make a separate PR to add these functions to utils.

@mmackz mmackz merged commit 6b4e034 into main Jun 12, 2024
9 checks passed
@mmackz mmackz deleted the mmackz/thirdweb-mint branch July 2, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants