Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 12, 2025


PR-Codex overview

This PR focuses on enhancing the thirdweb library by allowing the passing of overrides to common extension functions, which improves flexibility in transaction options across various ERC standards.

Detailed summary

  • Updated url from HTTP to HTTPS in gateway.tsx.
  • Modified multiple LazyMintParams, MintAdditionalSupplyToParams, DepositParams, and other parameters to use WithOverrides.
  • Added overrides to function calls in various files, including lazyMint, setSharedMetadata, and resetClaimEligibility.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added support for per-transaction overrides across ERC1155, ERC721, and ERC20 write flows, including claim, set claim conditions, reset claim eligibility, update metadata/token URI, lazy mint, shared metadata, approve, deposit, and batch transfer.
  • Bug Fixes

    • Updated Playground web app to use HTTPS for API requests.
  • Chores

    • Added a changeset for a patch release noting override support in common extension functions.

@vercel
Copy link

vercel bot commented Sep 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Sep 12, 2025 1:42am
nebula Ready Ready Preview Comment Sep 12, 2025 1:42am
thirdweb_playground Ready Ready Preview Comment Sep 12, 2025 1:42am
thirdweb-www Ready Ready Preview Comment Sep 12, 2025 1:42am
wallet-ui Ready Ready Preview Comment Sep 12, 2025 1:42am

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2025

🦋 Changeset detected

Latest commit: 7e1c67c

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

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces transaction overrides support across multiple ERC1155, ERC20, and ERC721 write/drop helpers by wrapping params with WithOverrides and forwarding options.overrides to underlying calls. Adds a changeset documenting the patch. Updates a playground web component to use HTTPS for an API URL.

Changes

Cohort / File(s) Summary
Release notes
.changeset/two-steaks-melt.md
Adds a changeset for a patch release noting override support in common extension functions; no code changes.
Playground web HTTPS
apps/playground-web/src/components/account-abstraction/gateway.tsx
Switches API base URL from http to https.
ERC1155 drops/write overrides
packages/thirdweb/src/extensions/erc1155/drops/write/claimTo.ts, .../resetClaimEligibility.ts, .../setClaimConditions.ts, .../updateMetadata.ts
Imports WithOverrides, updates function option types to BaseTransactionOptions<WithOverrides<...>>, and forwards overrides to underlying calls/multicall.
ERC1155 write overrides
packages/thirdweb/src/extensions/erc1155/write/lazyMint.ts, .../mintAdditionalSupplyTo.ts, .../updateTokenURI.ts
Wraps public param types with WithOverrides and forwards options.overrides to contract calls.
ERC20 drops/write overrides
packages/thirdweb/src/extensions/erc20/drops/write/claimTo.ts, .../resetClaimEligibility.ts, .../setClaimConditions.ts
Adds WithOverrides to types, updates signatures to accept overrides, and passes overrides to claim/multicall/setClaimConditions.
ERC20 write overrides
packages/thirdweb/src/extensions/erc20/write/approve.ts, .../deposit.ts, .../transferBatch.ts
Wraps public param types with WithOverrides; forwards overrides into prepared calls/multicall. approve.ts merges overrides into erc20Value args.
ERC721 drops/write overrides
packages/thirdweb/src/extensions/erc721/drops/write/claimTo.ts, .../resetClaimEligibility.ts, .../setClaimConditions.ts, .../updateMetadata.ts
Introduces WithOverrides in option types and propagates overrides to claim/multicall/BatchBaseURI.
ERC721 write overrides
packages/thirdweb/src/extensions/erc721/write/lazyMint.ts, .../setSharedMetadata.ts, .../updateTokenURI.ts
Wraps public param types with WithOverrides and forwards options.overrides to underlying writers.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant E as Extension Helper (e.g., claimTo/lazyMint)
  participant G as Generated Writer/Multicall
  participant B as Blockchain

  Note over C,E: Options now may include "overrides"

  C->>E: call(options: { params..., overrides? })
  E->>G: invoke({ contract, args..., overrides: options.overrides })
  alt success
    G->>B: send tx (with overrides)
    B-->>G: receipt
    G-->>E: prepared/executed tx
    E-->>C: result/tx
  else error
    G-->>E: error
    E-->>C: error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0b45405 and 7e1c67c.

📒 Files selected for processing (22)
  • .changeset/two-steaks-melt.md (1 hunks)
  • apps/playground-web/src/components/account-abstraction/gateway.tsx (1 hunks)
  • packages/thirdweb/src/extensions/erc1155/drops/write/claimTo.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc1155/drops/write/resetClaimEligibility.ts (4 hunks)
  • packages/thirdweb/src/extensions/erc1155/drops/write/setClaimConditions.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc1155/drops/write/updateMetadata.ts (2 hunks)
  • packages/thirdweb/src/extensions/erc1155/write/lazyMint.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc1155/write/mintAdditionalSupplyTo.ts (2 hunks)
  • packages/thirdweb/src/extensions/erc1155/write/updateTokenURI.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc20/drops/write/claimTo.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc20/drops/write/resetClaimEligibility.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc20/drops/write/setClaimConditions.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc20/write/approve.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc20/write/deposit.ts (2 hunks)
  • packages/thirdweb/src/extensions/erc20/write/transferBatch.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc721/drops/write/claimTo.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc721/drops/write/resetClaimEligibility.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc721/drops/write/setClaimConditions.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc721/drops/write/updateMetadata.ts (2 hunks)
  • packages/thirdweb/src/extensions/erc721/write/lazyMint.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc721/write/setSharedMetadata.ts (3 hunks)
  • packages/thirdweb/src/extensions/erc721/write/updateTokenURI.ts (3 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Allow_passing_overrides_to_common_extension_functions

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Playground Changes involving the Playground codebase. packages SDK Involves changes to the thirdweb SDK labels Sep 12, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.96 KB (0%) 1.3 s (0%) 261 ms (+142.71% 🔺) 1.6 s
thirdweb (cjs) 356.86 KB (0%) 7.2 s (0%) 1.1 s (+12.33% 🔺) 8.3 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 118 ms (+2716.03% 🔺) 232 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 75 ms (+2262.72% 🔺) 85 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 114 ms (+1790.89% 🔺) 497 ms

@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.64%. Comparing base (0b45405) to head (7e1c67c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ges/thirdweb/src/extensions/erc20/write/deposit.ts 0.00% 1 Missing ⚠️
...b/src/extensions/erc721/write/setSharedMetadata.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8041      +/-   ##
==========================================
+ Coverage   56.63%   56.64%   +0.01%     
==========================================
  Files         904      904              
  Lines       58707    58738      +31     
  Branches     4166     4165       -1     
==========================================
+ Hits        33246    33274      +28     
- Misses      25355    25358       +3     
  Partials      106      106              
Flag Coverage Δ
packages 56.64% <95.23%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
...dweb/src/extensions/erc1155/drops/write/claimTo.ts 80.55% <100.00%> (+1.76%) ⬆️
...sions/erc1155/drops/write/resetClaimEligibility.ts 90.16% <100.00%> (+0.33%) ⬆️
...tensions/erc1155/drops/write/setClaimConditions.ts 79.41% <100.00%> (+0.62%) ⬆️
...c/extensions/erc1155/drops/write/updateMetadata.ts 72.15% <100.00%> (+0.35%) ⬆️
.../thirdweb/src/extensions/erc1155/write/lazyMint.ts 96.66% <100.00%> (+0.11%) ⬆️
...extensions/erc1155/write/mintAdditionalSupplyTo.ts 100.00% <100.00%> (ø)
...web/src/extensions/erc1155/write/updateTokenURI.ts 60.71% <100.00%> (+0.71%) ⬆️
...irdweb/src/extensions/erc20/drops/write/claimTo.ts 83.33% <100.00%> (+1.28%) ⬆️
...ensions/erc20/drops/write/resetClaimEligibility.ts 81.81% <100.00%> (+2.87%) ⬆️
...extensions/erc20/drops/write/setClaimConditions.ts 78.78% <100.00%> (+0.66%) ⬆️
... and 10 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joaquim-verges joaquim-verges changed the title Allow passing overrides to common extension functions [SDK] Allow passing overrides to common extension functions Sep 12, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review September 12, 2025 01:57
@joaquim-verges joaquim-verges requested review from a team as code owners September 12, 2025 01:57
@joaquim-verges joaquim-verges merged commit 3ad9f7d into main Sep 12, 2025
25 of 26 checks passed
@joaquim-verges joaquim-verges deleted the Allow_passing_overrides_to_common_extension_functions branch September 12, 2025 01:58
amountWei: amount,
tokenAddress: options.contract.address,
},
...options.overrides,
Copy link
Contributor

Choose a reason for hiding this comment

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

Object spread syntax error will cause runtime failure. The line ...options.overrides, is spreading options.overrides directly into the asyncParams object, but overrides should be spread at the transaction level, not inside the async parameters. This will either cause a TypeError if overrides is undefined, or incorrectly merge override properties into the async params object instead of the transaction options. The fix is to move this spread outside the asyncParams object to the same level as contract and spender.

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@joaquim-verges joaquim-verges mentioned this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages Playground Changes involving the Playground codebase. SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants