Add useFund hook for funding sessions#2737
Open
jribbink wants to merge 18 commits intofeature/fundfrom
Open
Conversation
Adds useFund hook that wraps @onflow/payments client for creating funding sessions. Follows existing React Query mutation patterns. - Add @onflow/payments as dependency - Create useFund hook with full TypeScript support - Export from hooks index - Add unit tests
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
useFund hook for funding sessions
- Change providers type from FundingProvider[] to FundingProviderFactory[] - Update test mocks to use factory functions - Fix payments package tsconfig.json to correctly generate types - Fix error assertion in tests to match wrapped error message
… jribbink/fund-react-hook
Resolved conflicts by: - Moving funding hooks (useFund, useFundingCapabilities, usePaymentsClient) to packages/react-core - Added PaymentsClientContext to react-core/src/core/context.ts - Updated hooks to use TestProvider instead of FlowProvider in tests - Added @onflow/payments dependency to react-core package - Updated react-sdk to depend on both @onflow/react-core and @onflow/payments
This method aggregates capabilities from all configured funding providers, enabling the useFundingCapabilities hook to work correctly.
Remove try/catch error handling to let errors propagate naturally.
Contributor
📦 Changeset RequiredThis PR appears to modify package code but doesn't include a changeset. A changeset helps track version changes and generate release notes. To add a changeset:npm run changesetTo skip this check (if no version bump is needed):Add the |
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.
Closes #2715
Adds useFund hook that wraps @onflow/payments client for creating funding sessions. Follows existing React Query mutation patterns.