Skip to content

Conversation

@levalleux-ludo
Copy link
Member

@levalleux-ludo levalleux-ludo commented Nov 7, 2025

Description

Added useOffers hook to simplify querying offers in React applications using the Boson Protocol SDK.

Implementation:

  • Created useOffers hook that wraps useCoreSdk and react-query for declarative offer fetching
  • Accepts CoreSdkConfig, query variables, and react-query options
  • Returns standard react-query result with loading states and data

Documentation:

  • Added usage example in use-with-react.md showing how to fetch and display offers in a table component
  • Example demonstrates integration with withQueryClientProvider HOC
const offers = hooks.useOffers(
  { envName: "testing", configId: "testing-80002-0" },
  { offersFirst: 10 }
);

How to test

  1. Import the hook in a React component: import { hooks } from "@bosonprotocol/react-kit"
  2. Use it with a valid config and query variables as shown in the documentation example
  3. Verify offers are fetched and rendered correctly

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.98%. Comparing base (f89efd4) to head (ab7f32d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #987   +/-   ##
=======================================
  Coverage   90.98%   90.98%           
=======================================
  Files         176      176           
  Lines        7190     7190           
  Branches     1322     1322           
=======================================
  Hits         6542     6542           
  Misses        648      648           
Flag Coverage Δ
common 92.59% <ø> (ø)
core-sdk 56.41% <ø> (ø)
e2e 86.08% <ø> (ø)
eth-connect-sdk 95.06% <ø> (ø)
ethers-sdk 74.45% <ø> (ø)
ipfs-storage 91.75% <ø> (ø)
metadata 94.70% <ø> (ø)
unittests 60.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@levalleux-ludo levalleux-ludo marked this pull request as ready for review November 10, 2025 16:23
@levalleux-ludo
Copy link
Member Author

@copilot

Copy link
Contributor

Copilot AI commented Nov 10, 2025

@levalleux-ludo I've opened a new pull request, #990, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ levalleux-ludo
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@levalleux-ludo levalleux-ludo merged commit 3a92c2d into main Nov 10, 2025
6 of 7 checks passed
@levalleux-ludo levalleux-ludo deleted the add-useOffers-hook branch November 10, 2025 16:59
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.

3 participants