Skip to content

Conversation

@0xApotheosis
Copy link
Member

fix: published packages
fix: clear change address (#11218)
feat: swapper add deposit address row at confirm time (#11216)
feat: track apple ad campaign attribution (#11031)
fix: sentry release naming (#11271)
chore: published package dependencies (#11251)
feat: improve swapper skill (#11259)
Merge branch 'main' into develop
fix: ledger select chains handle flags (#11269)

gomesalexandre and others added 9 commits December 3, 2025 00:01
* feat: display current nonce in WalletConnect transaction advanced parameters

Fetches and displays the current/next nonce for the account in the advanced parameters section instead of showing "Nonce..." placeholder text. Users can now see what nonce will be automatically used if they don't set a custom one.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: massively enhance swapper-integration skill with deep research and implementation guide

This update transforms the swapper-integration skill from basic guidance into a comprehensive, production-ready integration framework based on analysis of 3 major swapper PRs (Bebop, NEAR Intents, Cetus) and deep understanding of the swapper abstraction.

## Major Enhancements

### Phase 0: Proactive Research (NEW)
- Use WebFetch/WebSearch to research swapper APIs BEFORE asking user
- Automatically find documentation, chain support, existing integrations
- Only ask user for what can't be found online

### Expanded allowed-tools
- Added WebFetch, WebSearch for autonomous research
- Added AskUserQuestion for structured multi-question prompts
- Added gh pr:* for PR research

### Deep Swapper Categorization
- EVM Direct Transaction (Bebop, 0x, Portals)
- Deposit-to-Address (Chainflip, NEAR Intents, THORChain)
- Gasless Order-Based (CowSwap)
- Solana-Only (Jupiter)
- Chain-Specific (Cetus/Sui, Tron, etc.)

### Complete Implementation Guide
- Step-by-step file creation order (10 files)
- Full code templates for each file with actual TypeScript
- Detailed explanations of monadic error handling
- HTTP service factory with caching pattern
- Rate calculation strategies

### Swapper-Specific Metadata Deep Dive
- When to use vs when to skip
- THREE places to wire (types, quote, TWO extraction points)
- Critical: Both useTradeButtonProps AND tradeExecution.ts
- Example flows from NEAR Intents

### Registration Checklist (9 steps)
- SwapperConfig types
- Constants registration
- CSP headers with examples
- Feature flags (3 files)
- UI icon integration
- Environment variables (.env patterns)
- Test mocks

### Proactive Gotcha Prevention
- 10 critical bugs to check BEFORE testing
- Based on real issues from Bebop/NEAR Intents/Cetus PRs
- Slippage format, checksumming, hex conversion, response parsing

### Testing Framework
- Automated checks (type-check, lint, build)
- 11-point manual testing checklist
- 6-point edge case testing
- Rate vs quote delta verification

### Common Errors & Solutions
- 8 common error messages with exact fixes
- Direct mapping from error → solution
- Based on actual PR comments and fixes

## Key Insights from PR Analysis

### From Bebop PR (#11000)
- Dual routing with partial failure handling
- Affiliate fee delta issues (rate vs quote)
- Hex → decimal conversion patterns
- Address checksumming requirements

### From NEAR Intents PR (#11016)
- Deposit-to-address metadata flow
- Status polling with swap metadata
- Cross-chain EVM/UTXO/Solana handling
- OneClick SDK integration patterns

### From Cetus PR (#11240)
- Sui chain-specific adaptations
- Non-EVM transaction metadata
- Chain adapter fee estimation
- Token vs coin namespace handling

## Skill Quality Improvements

- 1500+ lines of comprehensive guidance (3x expansion)
- Code templates with actual imports and types
- File structure with exact locations
- Integration checklist (28 items)
- Three-phase workflow (Research → Implement → Test)

## Technical Depth

- Monadic Result<T, SwapErrorRight> pattern explained
- HTTP service with caching (createCache, makeSwapperAxiosServiceMonadic)
- Chain adapter usage for fee estimation
- Native token marker handling
- TradeQuote vs TradeRate differences
- accountNumber: undefined requirement for rates

## Documentation Template

- Complete INTEGRATION.md structure
- API details section
- Implementation notes with code
- Known gotchas documentation
- Testing strategies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: reverts

* fix: remove references to missing companion files

Remove references to @reference.md, @common-gotchas.md, @examples.md
that don't exist. The skill already contains all needed information inline.

Addresses CodeRabbit review feedback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: remove all companion file references

Remove all references to non-existent @reference.md, @common-gotchas.md,
and @examples.md files. The skill contains all needed information inline.

Addresses CodeRabbit critical feedback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: address CodeRabbit feedback on swapper skill

Updates swapper integration skill to address CodeRabbit review comments:

Feature flag pattern fixes:
- Replace placeholder [SwapperName]Swap with actual example (BebopSwap)
- Update getEnabledSwappers to show direct flag destructuring pattern
- Fix isCrossAccountTradeSupported to use enum values not placeholders
- Align all examples with actual codebase implementation

Markdown formatting improvements:
- Convert 8 bold emphasis sections to proper headings (#### and ###)
- Add language specifiers to 4 code blocks (text, markdown)
- Fix heading structure for better lint compliance

These changes improve accuracy and ensure the skill matches the actual
patterns used in the ShapeShift codebase.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
* include dependencies

* bump packages

* final tweaks

* merge conflicts

* merge fix

---------

Co-authored-by: NeOMakinG <14963751+NeOMakinG@users.noreply.github.com>
Co-authored-by: Apotheosis <0xapotheosis@gmail.com>
should be working after the next apple release gets in
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@0xApotheosis 0xApotheosis merged commit d0ce15f into main Dec 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants