Skip to content

fix: remove oa v3 function#244

Open
RishabhS7 wants to merge 3 commits into
masterfrom
fix/remove-oa-v3
Open

fix: remove oa v3 function#244
RishabhS7 wants to merge 3 commits into
masterfrom
fix/remove-oa-v3

Conversation

@RishabhS7
Copy link
Copy Markdown
Contributor

@RishabhS7 RishabhS7 commented May 20, 2026

fix: remove OA v3

Removes OpenAttestation v3 references from documentation while retaining OA v3 verification support.

Changes

  • getting-started.md — Updated signOA description to reflect v2 only
  • attachments.md — Removed OA v3 legacy format section and v3 field references
  • implementing-qr-codes.md — Removed OA v3 QR code example and credentialSubject.links.self.href reference
  • decentralized-renderer.md — Removed V3 from supported formats; commented out BillOfLadingSchemaV3 type, v3 import, and TemplateASampleV3 sample usage

OA v3 documents can still be verified via verifyDocument — only wrapping and creation guidance has been removed.

Summary by CodeRabbit

  • Documentation
    • Removed legacy OpenAttestation v3 guidance across docs and examples.
    • Standardized examples and guidance to reference OpenAttestation v2 structures and links.
    • Updated QR-code guidance and verification docs to rely on v2 locations.
    • Clarified configuration and library references to show v2 as the current default schema.
  • Chores
    • Updated XDC gas-price endpoint used for fetching network gas prices.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

This PR removes OpenAttestation v3 legacy/experimental references and examples, standardizing documentation and examples to OpenAttestation v2 across how-tos and reference pages, and updates an XDC gas API endpoint used by a frontend hook.

Changes

OpenAttestation v3 documentation cleanup

Layer / File(s) Summary
Attachments how-to: remove OA v3 and adjust OA v2 examples
docs/how-tos/attachments.md
Removes the "OpenAttestation v3" legacy list and details section; updates attachment structure notes, renderer compatibility wording, extraction snippet comments, and fallback-order bullets to reflect OA v2 field names and variations only.
QR codes and verify docs adjusted to OA v2
docs/how-tos/implementing-qr-codes.md, docs/how-tos/verifydocument.md
Replaces OA v3 QR link locations (credentialSubject.links.self.href) with OA v2 locations (data.links.self.href / links.self.href) in QR-code examples and rendering checks; clarifies that OpenAttestation verifiers apply to OpenAttestation (V2).
OA library docs: remove v3 extras and clarify v2 default
versioned_docs/version-4.x/reference/libraries/oa.md, versioned_docs/version-4.x/reference/document-creator/config-file.md
Updates wrapDocuments docs to state current default is Open Attestation schema 2.0 and mention an eventual optional schema parameter; removes experimental v3 "additional information" content and deletes the "V3 document defaults" subsection from the config-file reference.
Update XDC gas API endpoint in gas-price hook
src/components/ContractCost/hooks/useFetchGasPrice.tsx
Change gasApi mapping for Chain.XDC so fetchXDCGasPriceInGwei sends JSON-RPC eth_gasPrice POST requests to the new base URL https://xdctraderpc.xinfin.network/.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • isaackps
  • rongquan1
  • nghaninn

Poem

🐰 V3 leaves fall, the docs rebloom,
V2 now guides each example's room.
I hopped through lines to tidy rhyme,
Cleared paths for links and docs in time.
A carrot-nudge for cleaner docs — hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: remove oa v3 function' is vague and misleading—it does not accurately describe the changeset, which primarily removes OA v3 documentation references across multiple files, not a specific function. Revise the title to clearly reflect the main change, such as 'docs: remove OpenAttestation v3 references from documentation' or 'docs: retire OA v3 guidance across docs and references'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-oa-v3

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/ContractCost/hooks/useFetchGasPrice.tsx (1)

46-48: 💤 Low value

Consider validating the response structure before parsing.

If the endpoint returns an unexpected response format, parseInt(respData.result, 16) will throw. Adding validation would make the error handling more explicit and prevent silent failures.

🛡️ Optional defensive validation
  const respData = await resp.json();
+ if (!respData?.result) {
+   throw new Error("Invalid response: missing result field");
+ }
  const gasPriceInWei = parseInt(respData.result, 16);
  return gasPriceInWei / 1e9;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ContractCost/hooks/useFetchGasPrice.tsx` around lines 46 - 48,
The code currently calls parseInt(respData.result, 16) without validating
respData or respData.result, which can throw on unexpected responses; update the
fetch logic in useFetchGasPrice (the resp, respData, gasPriceInWei handling) to
first check resp.ok and that respData is an object with a string-typed result
(e.g., typeof respData?.result === 'string'), and if validation fails either
throw a clear Error or return a sensible fallback; also surround the parseInt
conversion with a try/catch to surface a descriptive error (including the actual
respData) so failures are explicit rather than silent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/components/ContractCost/hooks/useFetchGasPrice.tsx`:
- Around line 46-48: The code currently calls parseInt(respData.result, 16)
without validating respData or respData.result, which can throw on unexpected
responses; update the fetch logic in useFetchGasPrice (the resp, respData,
gasPriceInWei handling) to first check resp.ok and that respData is an object
with a string-typed result (e.g., typeof respData?.result === 'string'), and if
validation fails either throw a clear Error or return a sensible fallback; also
surround the parseInt conversion with a try/catch to surface a descriptive error
(including the actual respData) so failures are explicit rather than silent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e0b8064b-f9ee-413e-9fe1-f87bbd9d10ca

📥 Commits

Reviewing files that changed from the base of the PR and between 3283c3c and 5a2b1fd.

📒 Files selected for processing (1)
  • src/components/ContractCost/hooks/useFetchGasPrice.tsx

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.

1 participant