Skip to content

Fix: URL Implementation to handle endpoints and base url. #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

panugothrakesh
Copy link
Contributor

@panugothrakesh panugothrakesh commented Mar 13, 2025

Summary by CodeRabbit

  • Refactor

    • Streamlined the processing of order endpoints for a more consistent and reliable order management experience.
    • Simplified URL construction for block number fetching and EVM relay functionalities.
    • Updated endpoint paths in the Quote class for improved API request handling.
  • Chores

    • Updated version number for the @gardenfi/core package from 2.0.22 to 2.0.23.
    • Updated version number for the @gardenfi/orderbook package from 2.0.6 to 2.0.7.
    • Updated version number for the @gardenfi/react-hooks package from 2.0.26 to 2.0.27.

Copy link

coderabbitai bot commented Mar 13, 2025

Walkthrough

The changes involve modifications to the constructors of several classes, specifically OrdersProvider, BlockNumberFetcher, and EvmRelay, to accept only a string type for the url parameter instead of a union type with Url. Additionally, the endpoint construction logic has been updated across these classes to streamline URL creation. The Quote class also saw changes in the endpoint paths used in its methods, removing leading slashes from the strings used in API requests.

Changes

File(s) Change Summary
packages/orderbook/.../ordersProvider.ts - Updated OrdersProvider constructor parameter from `string
packages/core/.../blockNumberFetcher/blockNumber.ts - Updated BlockNumberFetcher constructor to create a Url object from url parameter and chain calls to endpoint for 'blocknumber' and network.
packages/core/.../evm/relay/evmRelay.ts - Updated EvmRelay constructor parameter from `string
packages/core/.../quote/quote.ts - Modified endpoint paths in getAttestedQuote and getStrategies methods by removing leading slashes from the strings.
packages/core/package.json - Version updated from 2.0.22 to 2.0.23.
packages/orderbook/package.json - Version updated from 2.0.6 to 2.0.7.
packages/react-hooks/package.json - Version updated from 2.0.26 to 2.0.27.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant O as OrdersProvider
    participant U as Url
    C->>O: new OrdersProvider(urlString)
    O->>U: new Url(urlString)
    O->>U: call endpoint("orders")
Loading
sequenceDiagram
    participant C as Client
    participant B as BlockNumberFetcher
    participant U as Url
    C->>B: new BlockNumberFetcher(url, network)
    B->>U: new Url(url)
    B->>U: call endpoint("blocknumber")
    B->>U: call endpoint(network)
Loading
sequenceDiagram
    participant C as Client
    participant E as EvmRelay
    participant U as Url
    C->>E: new EvmRelay(url, auth)
    E->>U: new Url(url)
    E->>U: call endpoint("relayer")
Loading

Suggested reviewers

  • Revantark
  • ManiReddyt

Poem

I'm a little rabbit with a clever hop,
Simplifying code to make it top!
No more choices, just one clear string,
Building URLs like it's a zing!
Hopping through changes, lively and bright,
Celebrating clear code in sheer delight!
🥕🐇 Always on track, day or night!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 7c3941b and 7c07889.

📒 Files selected for processing (3)
  • packages/core/package.json (1 hunks)
  • packages/orderbook/package.json (1 hunks)
  • packages/react-hooks/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/orderbook/package.json
  • packages/react-hooks/package.json
  • packages/core/package.json

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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