fix(deposit): pre-flight validation, gas reserve, session guard, actionable errors#99
Merged
JamesLawton merged 4 commits intomainfrom Apr 27, 2026
Merged
fix(deposit): pre-flight validation, gas reserve, session guard, actionable errors#99JamesLawton merged 4 commits intomainfrom
JamesLawton merged 4 commits intomainfrom
Conversation
…and actionable errors
Addresses seven friction points surfaced in a real first-run test session:
- deposit restricted to Polygon mainnet (chainId 137); clear error for other chains
- pre-flight balance check before transaction encoding; fails fast with an
actionable message instead of waiting for a relay rejection
- auto-reserve 0.05 USDC for gas when wallet has no native POL balance
(USDC paymaster path); prints a note and reduces the deposit amount
- remap opaque relay errors ("Identity signers not found", "Request aborted",
code 1005) to messages that name the fix command
- "no pools found" error now suggests polygon-agent balances as a diagnostic step
- wallet create guards against silently replacing an existing session; requires
--force to proceed and warns that the old balance is not accessible
- dapp-client fee cap raised from 0.0001 to 0.1 token units (0.1 USDC for
6-decimal tokens); "Unable to determine fee option" now names the fix
- connector-ui use-case prompt removes Katana and $100M TVL filter (unsupported
by the earn pool API provider)
- SKILL.md: documents --usdc-limit and --force on wallet create, removes Katana
vault table, expands troubleshooting table with actionable error rows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
depositnow rejects non-Polygon chains immediately with a clear message instead of silently returning empty resultswallet createnow blocks if a session already exists, with a message explaining the orphaning risk;--forcebypasses it--usdc-limit 5or--contract)--usdc-limitand--forceonwallet create; removes Katana vault table; adds actionable troubleshooting rowsTest plan
polygon-agent deposit --chain 1 --amount 1→ error: deposit only supports Polygon mainnetpolygon-agent deposit --amount 999 --asset USDC(dry-run, wallet has less than 999 USDC) → error: Insufficient USDCpolygon-agent deposit --amount <full-balance> --broadcaston a wallet with 0 POL → amount auto-reduced by 0.05 USDC, note printedpolygon-agent wallet createwhen session already exists → error with--forcehintpolygon-agent wallet create --forcewhen session already exists → proceeds normally