feat: integrate WalletConnectPay SDK into WalletKit#252
Merged
jakubuid merged 5 commits intofeat/wc_payfrom Jan 20, 2026
Merged
feat: integrate WalletConnectPay SDK into WalletKit#252jakubuid merged 5 commits intofeat/wc_payfrom
jakubuid merged 5 commits intofeat/wc_payfrom
Conversation
- Add Pay module dependency to WalletKit build.gradle.kts - Add payment models to Wallet.kt (PaymentStatus, PaymentInfo, PaymentOption, etc.) - Create PayMapper.kt for Pay <-> Wallet.Model type conversions - Add onPaymentRequest callback to WalletDelegate interface - Update WalletKit.initialize() to init WalletConnectPay silently - Add WalletKit.Pay object with getRequiredPaymentActions() and confirmPayment() - Update pair() to try Pay first when accounts provided, fallback to WC pairing - Update sample wallet to use WalletKit.Pay instead of direct WalletConnectPay calls - Add event-based payment flow via paymentOptionsEvent SharedFlow with replay Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
WalletKit.Pay.isPaymentLink()utility to detect payment linksWalletKit.Pay.getPaymentOptions()for explicit payment flow initiationisPaymentLink()Architecture
sequenceDiagram participant App as Sample Wallet participant VM as Web3WalletViewModel participant WK as WalletKit participant Pay as WalletConnectPay participant PVM as PaymentViewModel App->>VM: pair(uri) VM->>WK: Pay.isPaymentLink(uri) alt Payment Link WK-->>VM: true VM->>WK: Pay.getPaymentOptions(uri, accounts) WK->>Pay: getPaymentOptions() Pay-->>WK: PaymentOptionsResponse WK-->>VM: Result<PaymentOptionsResponse> VM->>VM: emit to paymentOptionsEvent VM-->>App: Navigate to PaymentRoute PVM->>PVM: collect paymentOptionsEvent PVM-->>App: UI State updated else WC Pairing WK-->>VM: false VM->>WK: pair(uri) WK-->>VM: Standard WC pairing flow endKey Changes from Previous Approach
pair()auto-detects payment linkspair()only does WC pairingaccountsparam inWallet.Params.Pairpair()onPaymentRequestcallback in delegategetPaymentOptions()isPaymentLink()to decide flowAPI Usage
Changes
WalletKit SDK (
product/walletkit/)Params.Pair(removedaccountsparam), added payment modelsWalletKit.Pay.isPaymentLink()utility functionWalletKit.Pay.getPaymentOptions()for explicit callspair()- now only does standard WC pairingonPaymentRequestcallback fromWalletDelegateSample Wallet (
sample/wallet/)pair()to useisPaymentLink()for routinghandlePaymentLink()that explicitly callsgetPaymentOptions()onPaymentRequestcallback overrideTest plan
isPaymentLink()returns truegetPaymentOptions()is called explicitlyisPaymentLink()returns false🤖 Generated with Claude Code