Skip to content

docs: add documentation for buyer-initiated offers and createOfferAnd…#1017

Merged
levalleux-ludo merged 2 commits intomainfrom
documentation
Apr 29, 2026
Merged

docs: add documentation for buyer-initiated offers and createOfferAnd…#1017
levalleux-ludo merged 2 commits intomainfrom
documentation

Conversation

@levalleux-ludo
Copy link
Copy Markdown
Member

@levalleux-ludo levalleux-ludo commented Apr 2, 2026

This pull request adds detailed documentation for two important flows in the offer and commit process of the core SDK: buyer-initiated offers and the atomic createOfferAndCommit helper. These docs provide clear overviews, prerequisites, test scenarios, and key assertions for both flows, helping developers understand and test these mechanisms more effectively.

Buyer-Initiated Offers Documentation (docs/details/buyerInitiatedOffers.md):

  • Explains the reversed flow where the buyer creates the offer and the seller commits, with strict enforcement that quantityAvailable must be 1.
  • Details the commitToBuyerOffer method, its parameters, and error handling, including symmetric error guards for incorrect usage of commit methods.
  • Lists all prerequisites for tests, including dispute resolver setup, SDK initialization, offer creation, seller registration, and funding requirements.
  • Outlines happy path and error case test scenarios, including optional seller parameters at commit time and expected error messages for invalid operations.
  • Summarizes fund flow and provides a checklist of key assertions for successful commits, referencing relevant helper methods and test files.

Atomic Offer Creation and Commit Documentation (docs/details/createOfferAndCommit.md):

  • Describes the createOfferAndCommit helper, which allows atomic creation and commitment to an offer in a single transaction, with detailed signature and step-by-step breakdown.
  • Differentiates between seller-initiated and buyer-initiated use-cases, specifying roles, quantity rules, and expected behaviors after commit.
  • Lists all prerequisites, including wallet funding, seller registration, dispute resolver checks, ERC20 token setup, and correct offer argument construction, with a summary table for both flows.
  • Details covered test scenarios for both happy and error/void paths, including utility tests for transaction info retrieval.
  • Provides key assertions for successful operations and references to helper definitions and test file locations.…Commit method

Description

{{what was done}}

How to test

{{how can it be tested}}

Copilot AI review requested due to automatic review settings April 2, 2026 11:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new internal documentation pages describing two offer flows covered by the e2e test suite: (1) the createOfferAndCommit helper flow (seller-initiated vs buyer-initiated) and (2) buyer-initiated offers committed via commitToBuyerOffer.

Changes:

  • Documented the createOfferAndCommit helper’s purpose, prerequisites, and covered test scenarios.
  • Documented buyer-initiated offer flow in core-sdk-offers.test.ts, including prerequisites, fund movements, and error cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
docs/details/createOfferAndCommit.md New doc explaining how createOfferAndCommit is used in e2e tests for seller-initiated and buyer-initiated offers.
docs/details/buyerInitiatedOffers.md New doc explaining buyer-initiated offers and the seller-side commitToBuyerOffer test coverage and fund flows.

Comment thread docs/details/createOfferAndCommit.md Outdated
Comment thread docs/details/createOfferAndCommit.md Outdated
Comment thread docs/details/createOfferAndCommit.md
Comment thread docs/details/buyerInitiatedOffers.md Outdated
Comment thread docs/details/buyerInitiatedOffers.md Outdated
Comment thread docs/details/createOfferAndCommit.md
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.49%. Comparing base (95432e5) to head (1d584e3).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1017      +/-   ##
==========================================
+ Coverage   90.96%   91.49%   +0.52%     
==========================================
  Files         179      179              
  Lines        7297     7451     +154     
  Branches     1366     1433      +67     
==========================================
+ Hits         6638     6817     +179     
+ Misses        659      634      -25     
Flag Coverage Δ
common 92.59% <ø> (ø)
core-sdk 62.63% <ø> (+6.19%) ⬆️
e2e 85.24% <ø> (-0.56%) ⬇️
eth-connect-sdk 95.06% <ø> (ø)
ethers-sdk 74.45% <ø> (ø)
ipfs-storage 91.75% <ø> (ø)
metadata 94.70% <ø> (ø)
unittests 65.95% <ø> (+5.22%) ⬆️

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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@levalleux-ludo levalleux-ludo merged commit ae85cca into main Apr 29, 2026
12 of 14 checks passed
@levalleux-ludo levalleux-ludo deleted the documentation branch April 29, 2026 15:51
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.

2 participants