Skip to content

Conversation

@zinderud
Copy link

@zinderud zinderud commented Sep 23, 2025

🚀 Improve DefaultOnchainKitProviders with Wallet Preference Support

📋 Summary

This PR adds comprehensive wallet preference support to DefaultOnchainKitProviders and significantly improves test coverage.

🔧 Changes Made

Core Functionality

  • Added wallet preference support: smartWalletOnly, eoaOnly, all
  • Improved connector selection logic: MiniKit → Preference → Default priority
  • Added coinbaseWallet connector for eoaOnly preference
  • Enhanced DefaultOnchainKitProviders.tsx with proper preference handling

Test Improvements

  • Expanded test coverage: From 7 to 19 test cases (+170% improvement)
  • Added comprehensive test scenarios:
    • Wallet preference tests (smartWalletOnly, eoaOnly, all)
    • API key edge cases (null, empty string)
    • Error handling (MiniKit context errors)
    • Edge cases (long strings, special characters)
    • Custom QueryClient configuration

🐛 Problem Solved

Previously, the wallet.preference configuration in OnchainKitProvider was completely ignored in DefaultOnchainKitProviders, causing inconsistent behavior.

🧪 Testing

  • ✅ All existing tests pass
  • ✅ 12 new comprehensive test cases added
  • ✅ Edge cases and error scenarios covered

📊 Test Results

- Add support for wallet.preference configuration (smartWalletOnly, eoaOnly, all)
- Implement proper connector selection based on preference
- Add coinbaseWallet connector for eoaOnly preference
- Add comprehensive test coverage with 12 new test cases
- Include edge cases and error handling tests
- Improve connector selection logic with MiniKit > Preference > Default priority

Fixes: Wallet preference configuration was ignored in DefaultOnchainKitProviders
Tests: Expanded from 7 to 19 test scenarios (+170% coverage)
@cb-heimdall
Copy link

cb-heimdall commented Sep 23, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@vercel
Copy link

vercel bot commented Sep 23, 2025

@zinderud is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
onchainkit-routes Ready Ready Preview Comment Sep 23, 2025 4:54pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants