Skip to content

[SDK] Feature: Adds optional transactionId parameter to Bridge.status #7681

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

Merged

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Jul 22, 2025


PR-Codex overview

This PR introduces an optional transactionId parameter to the status function in the Bridge module of the thirdweb package, enhancing the ability to retrieve bridge status by allowing users to specify the transaction ID received from the prepare request.

Detailed summary

  • Added transactionId parameter to the status function in packages/thirdweb/src/bridge/Status.ts.
  • Updated JSDoc comments to include transactionId in the parameter descriptions.
  • Modified the status function to append transactionId to the request URL if provided.
  • Updated the status.Options and status.Result types to include transactionId as an optional field.

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

Summary by CodeRabbit

  • New Features
    • Added support for an optional transaction ID when checking bridge status, allowing users to provide an additional identifier for their transaction status queries.

@gregfromstl gregfromstl requested review from a team as code owners July 22, 2025 21:58
Copy link

linear bot commented Jul 22, 2025

Copy link

changeset-bot bot commented Jul 22, 2025

🦋 Changeset detected

Latest commit: a15ef48

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

Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 10:14pm
nebula ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 10:14pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 10:14pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 10:14pm
wallet-ui 🛑 Canceled (Inspect) Jul 22, 2025 10:14pm

Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Walkthrough

An optional parameter, transactionId, was added to the Bridge.status function and its associated types in the "thirdweb" package. The function now conditionally includes transactionId as a query parameter in the status request if provided. No other logic or error handling was changed.

Changes

File(s) Change Summary
.changeset/four-trams-fetch.md Documents the addition of an optional transactionId parameter to Bridge.status.
packages/thirdweb/src/bridge/Status.ts Updates the status function and types to accept an optional transactionId and use it in queries.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant BridgeStatus

    Caller->>BridgeStatus: status(options: {transactionHash, chainId/chain, [transactionId], client})
    alt transactionId provided
        BridgeStatus->>BridgeStatus: Append transactionId to status request URL
    else transactionId not provided
        BridgeStatus->>BridgeStatus: Send status request without transactionId
    end
    BridgeStatus-->>Caller: Return status result
Loading

Estimated code review effort

2 (~12 minutes)

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a491de4 and a15ef48.

📒 Files selected for processing (2)
  • .changeset/four-trams-fetch.md (1 hunks)
  • packages/thirdweb/src/bridge/Status.ts (4 hunks)
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • packages/thirdweb/src/bridge/Status.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/bridge/Status.ts
🧠 Learnings (2)
.changeset/four-trams-fetch.md (1)

Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions

packages/thirdweb/src/bridge/Status.ts (3)

Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.

Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">, they inherit the client prop without needing to add it explicitly.

Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.

🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • packages/thirdweb/src/bridge/Status.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/bridge/Status.ts
🧠 Learnings (2)
.changeset/four-trams-fetch.md (1)

Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions

packages/thirdweb/src/bridge/Status.ts (3)

Learnt from: MananTank
PR: #7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.

Learnt from: MananTank
PR: #7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use Omit<ModuleCardUIProps, "children" | "updateButton">, they inherit the client prop without needing to add it explicitly.

Learnt from: MananTank
PR: #7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb contract object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
packages/thirdweb/src/bridge/Status.ts (4)

99-99: LGTM! Clear and consistent documentation.

The JSDoc documentation for the new transactionId parameter follows the existing style and clearly explains its purpose.


109-109: Proper destructuring of optional parameter.

The transactionId parameter is correctly extracted from options alongside existing parameters, with TypeScript handling the optional nature through the type system.


116-118: Correct conditional parameter handling.

The implementation properly checks for the existence of transactionId before adding it to the URL search parameters, following the appropriate pattern for optional parameters.


202-203: Well-structured TypeScript type definitions.

The transactionId parameter is properly added to both union type variants with:

  • Correct optional parameter syntax (transactionId?: string)
  • Appropriate string typing for transaction IDs
  • Consistent implementation across both variants
  • Clear JSDoc documentation

This follows the coding guidelines for explicit TypeScript typing and maintains type safety.

Also applies to: 212-213

.changeset/four-trams-fetch.md (1)

1-5: Appropriate changeset documentation.

The changeset correctly categorizes this as a "patch" level change, which is appropriate for adding an optional parameter (non-breaking change). The description accurately reflects the enhancement made to Bridge.status.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

graphite-app bot commented Jul 22, 2025

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.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Jul 22, 2025
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.33 KB (+0.15% 🔺) 1.3 s (+0.15% 🔺) 669 ms (+64.68% 🔺) 2 s
thirdweb (cjs) 353.19 KB (-0.08% 🔽) 7.1 s (-0.08% 🔽) 2.8 s (+2.1% 🔺) 9.9 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 158 ms (+587.19% 🔺) 272 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 49 ms (+561.89% 🔺) 59 ms
thirdweb/react (minimal + tree-shaking) 19.59 KB (0%) 392 ms (0%) 64 ms (+32.61% 🔺) 456 ms

Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 56.38%. Comparing base (a491de4) to head (a15ef48).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/bridge/Status.ts 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7681      +/-   ##
==========================================
- Coverage   56.39%   56.38%   -0.01%     
==========================================
  Files         908      908              
  Lines       58244    58247       +3     
  Branches     4227     4224       -3     
==========================================
  Hits        32844    32844              
- Misses      25290    25293       +3     
  Partials      110      110              
Flag Coverage Δ
packages 56.38% <25.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
packages/thirdweb/src/bridge/Status.ts 38.88% <25.00%> (-1.70%) ⬇️
🚀 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.

@gregfromstl gregfromstl merged commit 7562952 into main Jul 22, 2025
22 of 24 checks passed
@gregfromstl gregfromstl deleted the greg/tool-5076-add-transaction-id-to-status-getter branch July 22, 2025 22:11
@joaquim-verges joaquim-verges mentioned this pull request Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant