Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,15 @@
async function getClaimToBatchParams(
options: BaseTransactionOptions<ClaimToBatchParams>,
) {
const errorIndexTo = options.content.findIndex((o) => !o.to);
if (errorIndexTo !== -1) {
throw new Error(
`Error: Item at index ${errorIndexTo} is missing recipient address ("to")`,
);
}
const errorIndexQuantity = options.content.findIndex((o) => !o.quantity);
if (errorIndexQuantity !== -1) {
throw new Error(
`Error: Item at index ${errorIndexQuantity} is missing claim quantity`,
);
for (let i = 0; i < options.content.length; i++) {
if (!options.content[i]?.quantity) {
throw new Error(`Error: Item at index ${i} is missing claim quantity`);
}

Check warning on line 65 in packages/thirdweb/src/extensions/erc721/drops/write/claimToBatch.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/extensions/erc721/drops/write/claimToBatch.ts#L64-L65

Added lines #L64 - L65 were not covered by tests
if (!options.content[i]?.to) {
throw new Error(
`Error: Item at index ${i} is missing recipient address ("to")`,
);
}

Check warning on line 70 in packages/thirdweb/src/extensions/erc721/drops/write/claimToBatch.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/extensions/erc721/drops/write/claimToBatch.ts#L67-L70

Added lines #L67 - L70 were not covered by tests
}
const content = optimizeClaimContent(options.content);
const data = await Promise.all(
Expand All @@ -89,6 +87,7 @@
pricePerToken: claimParams.pricePerToken,
allowlistProof: claimParams.allowlistProof,
data: claimParams.data,
overrides: claimParams.overrides,
});
}),
);
Expand Down
Loading