-
Notifications
You must be signed in to change notification settings - Fork 589
[SDK] Show policy error for 7702 transactions #8077
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
[SDK] Show policy error for 7702 transactions #8077
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7bcd42e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
WalkthroughAdds a changeset declaring a patch for the "thirdweb" package and updates executeWithSignature in the bundler to throw an error when a 7702 transaction response lacks a queueId, otherwise returning transactionId from res.queueId. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant E as executeWithSignature
participant B as Bundler API
C->>E: executeWithSignature(request, signature)
E->>B: POST 7702 tx payload
B-->>E: res (may contain queueId)
alt queueId present
E-->>C: { transactionId: res.queueId }
else queueId missing
Note over E: Throw error<br/>"Error executing 7702 transaction: {res}"
E-->>C: Error
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/thirdweb/src/wallets/smart/lib/bundler.ts (1)
365-365
: Optional: cap serialized response in errorLong responses can bloat error surfaces/logs. Consider truncating the stringified payload (e.g., first 2k chars) or logging to debug only.
📜 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.
📒 Files selected for processing (2)
.changeset/smart-mugs-doubt.md
(1 hunks)packages/thirdweb/src/wallets/smart/lib/bundler.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
.changeset/*.md
: Each change inpackages/*
must include a changeset for the appropriate package
Version bump rules: patch for non‑API changes; minor for new/modified public API
Files:
.changeset/smart-mugs-doubt.md
**/*.{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 localtypes.ts
barrels
Prefer type aliases over interface except for nominal shapes
Avoidany
andunknown
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
**/*.{ts,tsx}
: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/types
where applicable
Prefertype
aliases overinterface
except for nominal shapes
Avoidany
andunknown
unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
packages/thirdweb/src/wallets/smart/lib/bundler.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/wallets/smart/lib/bundler.ts
packages/thirdweb/src/wallets/**
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/wallets/**
: UnifiedWallet
andAccount
interfaces in wallet architecture
Support for in-app wallets (social/email login)
Smart wallets with account abstraction
EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Files:
packages/thirdweb/src/wallets/smart/lib/bundler.ts
packages/thirdweb/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/thirdweb/**/*.{ts,tsx}
: Every public symbol must have comprehensive TSDoc with at least one compiling@example
and a custom tag (@beta
,@internal
,@experimental
, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g.,const { jsPDF } = await import("jspdf")
)
Files:
packages/thirdweb/src/wallets/smart/lib/bundler.ts
🧠 Learnings (1)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to .changeset/*.md : Version bump rules: patch for non‑API changes; minor for new/modified public API
Applied to files:
.changeset/smart-mugs-doubt.md
🧬 Code graph analysis (1)
packages/thirdweb/src/wallets/smart/lib/bundler.ts (1)
packages/thirdweb/src/exports/utils.ts (1)
stringify
(189-189)
⏰ 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: Unit Tests
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Build Packages
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
.changeset/smart-mugs-doubt.md (1)
2-5
: Correct bumps: patch for non‑API behavior changeChangeset looks good and follows the versioning rule for non‑API changes.
packages/thirdweb/src/wallets/smart/lib/bundler.ts (1)
364-366
: Null‑safe guard before accessing res.queueId (packages/thirdweb/src/wallets/smart/lib/bundler.ts:364–366)Change the check to validate res exists and queueId is a non-empty string:
- if (!res.queueId) { - throw new Error(`Error executing 7702 transaction: ${stringify(res)}`); - } + if (!res || typeof res.queueId !== "string" || !res.queueId) { + throw new Error(`Error executing 7702 transaction: ${stringify(res)}`); + }
- Repo scan shows many other queueId consumers (engine provider, UI); normalize sendBundlerRequest response shape or add equivalent guards where queueId is consumed.
size-limit report 📦
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8077 +/- ##
==========================================
- Coverage 56.34% 56.34% -0.01%
==========================================
Files 906 906
Lines 59168 59171 +3
Branches 4176 4173 -3
==========================================
+ Hits 33341 33342 +1
- Misses 25721 25723 +2
Partials 106 106
🚀 New features to boost your workflow:
|
PR-Codex overview
This PR focuses on improving error handling for 7702 transactions in the
thirdweb
package by throwing a specific error when thequeueId
is not present in the response.Detailed summary
packages/thirdweb/src/wallets/smart/lib/bundler.ts
.Error executing 7702 transaction: ${stringify(res)}
whenres.queueId
is not found.Summary by CodeRabbit