-
Notifications
You must be signed in to change notification settings - Fork 618
[SDK] Add wallet validation before executing transactions #8050
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] Add wallet validation before executing transactions #8050
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
WalkthroughAn early input validation was added to useStepExecutor’s execute function: when flattened transactions exist and no wallet is supplied, it throws an INVALID_INPUT ApiError before onramp handling. The rest of the onramp and transaction execution logic remains unchanged. No public API signatures were modified. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Hook as useStepExecutor.execute
participant Onramp as Onramp Handler
participant Tx as Tx Runner
Caller->>Hook: execute(steps, wallet)
rect rgba(200,230,255,0.4)
note over Hook: New early validation
Hook->>Hook: if flatTxs.length > 0 && !wallet
Hook-->>Caller: throw ApiError(INVALID_INPUT, 400)
end
Hook->>Onramp: Handle onramp (if applicable)
Onramp-->>Hook: Result / continue
Hook->>Tx: Execute transactions
Tx-->>Hook: Execution result
Hook-->>Caller: Return result or downstream error
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
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
packages/thirdweb/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (1)packages/thirdweb/src/react/core/hooks/useStepExecutor.ts (1)
⏰ 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)
🔇 Additional comments (1)
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. |
size-limit report 📦
|

PR-Codex overview
This PR introduces a validation check in the
useStepExecutorhook to ensure that a wallet is provided before executing transactions, enhancing error handling for transaction execution.Detailed summary
flatTxshas elements and ifwalletis not provided.ApiErroris thrown with code "INVALID_INPUT" and a message indicating the issue.Summary by CodeRabbit