-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add quantity support for Rodeo & regular Zora mints #46
Conversation
PR Reviewer Guide 🔍
|
@@ -88,9 +88,11 @@ export class RodeoIngestor implements MintIngestor { | |||
chainId, | |||
contractAddress: mintAddress, | |||
contractMethod: 'mintFromFixedPriceSale', | |||
contractParams: `[${sale_terms_id}, 1, address, "${user.address}"]`, | |||
contractParams: `[${sale_terms_id}, quantity, address, "${user.address}"]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically the whole ingestion changeset to enable quantity (if supported cleanly by a contract!)
PR Code Suggestions ✨
|
@@ -79,12 +80,15 @@ export const simulateEVMTransactionWithTenderly = async ( | |||
blockNumber?: string, | |||
): Promise<{ message: string; success: boolean; rawSimulationResult: any }> => { | |||
const tenderly = new Tenderly(); | |||
const amount = mintInstructions.supportsQuantity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently it will simulate both 1, and 2 items.
Failure to simulate 2 will fail pack ingestion in Ecomm. We should change that to faillure to simulate 2 falls back to disabling quantity in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the desired logic is if supports quantity, sim 2? else sim 1? 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually runs both 1 and 2 for quantity here →
https://github.com/floornfts/mobile-minting/blob/main/test/shared/basic-ingestor-tests.ts#L62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually runs both 1 and 2 for quantity here →
https://github.com/floornfts/mobile-minting/blob/main/test/shared/basic-ingestor-tests.ts#L62
@@ -20,6 +20,9 @@ export const simulateEVMTransactionWithAlchemy = async ( | |||
quantity: number, | |||
blockNumber?: string, | |||
): Promise<{ message: string; success: boolean; rawSimulationResult: any }> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all code that is duplicated from Ecommerce. Ecomm has even more logic around this in constructWeb3Payload
User description
Note — whether they show up in-app as quantity will depending on pricing & availability of IAPs for the particular item.
PR Type
enhancement, tests
Description
EVMMintInstructionsInput
to includemintFeePerTokenWei
.Changes walkthrough 📝
index.ts
Add quantity support to Rodeo mint instructions
src/ingestors/rodeo/index.ts
contractParams
to support quantity.supportsQuantity
andmintFeePerTokenWei
to mint instructions.zora-metadata.ts
Enable quantity support in Zora mint parameters
src/ingestors/zora-internal/zora-metadata.ts
supportsQuantity
to Zora mint parameters.simulation.ts
Calculate transaction amount based on quantity in simulations
src/lib/simulation/simulation.ts
amount
based on quantity for transaction simulation.value
to use calculatedamount
.mint-template.ts
Extend EVMMintInstructionsInput with mint fee per token
src/lib/types/mint-template.ts
mintFeePerTokenWei
toEVMMintInstructionsInput
.rodeo.test.ts
Update Rodeo tests for quantity support and formatting
test/ingestors/rodeo.test.ts
contractParams
.