Conversation
…r Maya swaps Add exchange address sources to the Maya Enter Address screen so users can retrieve deposit addresses from their Uphold and Coinbase accounts. - Add AddressSourceView, MayaExchangeAddressProvider, and address source state management to EnterAddressViewModel - Uphold: fetch cards, create network-specific crypto addresses via API, with session caching and proper network key lookup - Coinbase: direct account lookup by currency code with account-list fallback, address creation via POST, session caching - Add login flows for both exchanges from the Enter Address screen - Re-check authorization after failed fetches to show "Log In" instead of "Not available" when sessions expire Fix Coinbase OAuth which migrated to new endpoints: - Auth URL: login.coinbase.com/oauth2/auth (was coinbase.com/oauth/authorize) - Token URL: login.coinbase.com/oauth2/token (was api.coinbase.com/oauth/token) - Redirect URI: dashwallet://brokers/coinbase/connect (was authhub://oauth-callback) - Token exchange encoding: application/x-www-form-urlencoded (was JSON) - Remove deprecated account and meta[send_limit_*] OAuth parameters Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThis PR introduces complete Maya Protocol integration to DashWallet, adding new Swift models (MayaCryptoCurrency, MayaPool, MayaEndpoint), API services, and comprehensive SwiftUI UI components for coin selection and address entry. Coinbase OAuth endpoints are updated to use login.coinbase.com, and the project version is bumped to 8.6.0. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BuySellPortal as BuySellPortalView
participant MayaPortal as MayaPortalViewController
participant CoinSelect as SelectCoinViewModel
participant API as MayaAPIService
participant AddressEntry as EnterAddressViewModel
participant ExchangeProvider as MayaExchangeAddressProvider
participant Uphold as Uphold API
participant Coinbase as Coinbase API
User->>BuySellPortal: Tap Maya
BuySellPortal->>MayaPortal: Navigate to portal
User->>MayaPortal: Tap Convert Dash
MayaPortal->>CoinSelect: Show coin selection
CoinSelect->>API: fetchPools()
API-->>CoinSelect: Pool data + prices
User->>CoinSelect: Select coin
CoinSelect->>AddressEntry: Pass selected coin
AddressEntry->>ExchangeProvider: loadAddressSources()
par Load Uphold
ExchangeProvider->>Uphold: Check auth & fetch addresses
Uphold-->>ExchangeProvider: Address list or login needed
and Load Coinbase
ExchangeProvider->>Coinbase: Check auth & fetch accounts
Coinbase-->>ExchangeProvider: Address or login needed
end
AddressEntry-->>User: Display sources + manual entry
User->>AddressEntry: Enter/scan address or login
AddressEntry->>MayaPortal: Confirm address
MayaPortal-->>User: Complete (navigate to next step)
sequenceDiagram
participant User
participant EnterAddr as EnterAddressView
participant ViewModel as EnterAddressViewModel
participant Scanner as GenericQRScannerView
participant QRCapture as QRCaptureView
participant AuthSession as ASWebAuthenticationSession
participant Uphold as Uphold
User->>EnterAddr: Tap Scan QR
EnterAddr->>Scanner: Show scanner
Scanner->>QRCapture: Initialize camera
QRCapture-->>User: Live preview
User->>QRCapture: Position QR code
QRCapture-->>Scanner: QR detected
Scanner->>ViewModel: onQRCodeScanned(address)
ViewModel->>EnterAddr: Update address field
EnterAddr-->>User: Address populated
alt User taps Login Uphold
User->>EnterAddr: Tap Uphold login
EnterAddr->>AuthSession: Open Uphold auth
AuthSession-->>User: Web authentication
User->>AuthSession: Authorize
AuthSession-->>ViewModel: Callback URL
ViewModel->>EnterAddr: Update uphold state (available)
EnterAddr-->>User: Address source ready
end
User->>EnterAddr: Tap Continue
EnterAddr->>ViewModel: isAddressValid?
ViewModel-->>EnterAddr: true
EnterAddr->>User: Trigger onContinue callback
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
Summary
login.coinbase.com/oauth2/auth)application/x-www-form-urlencodedChanges
Maya Address Sources
Coinbase OAuth Fix (affects entire app)
login.coinbase.com/oauth2/auth(wascoinbase.com/oauth/authorize)login.coinbase.com/oauth2/token(wasapi.coinbase.com/oauth/token)dashwallet://brokers/coinbase/connect(wasauthhub://oauth-callback)application/x-www-form-urlencoded(was JSON)accountandmeta[send_limit_*]OAuth parametersTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Updates