Skip to content
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

Feat/updated api #254

Merged
merged 2 commits into from
Mar 3, 2025
Merged

Feat/updated api #254

merged 2 commits into from
Mar 3, 2025

Conversation

Polybius93
Copy link
Collaborator

API Configuration Reorganization for Better Maintainability

Overview

Refactored our API URL construction system to improve maintainability, type safety, and flexibility. This enhancement provides a more structured approach to building API endpoints with various query parameters while ensuring proper URL formatting.

New Features

Centralized API Configuration

  • Created dedicated constants for base URLs by environment and API paths
  • Implemented strongly-typed option interfaces for each endpoint
  • Consolidated URL construction logic into helper functions
  • Provided proper URL encoding for all parameters

API Helper Functions

  • getProofOfReserveURL: Builds URLs with optional address and chain parameters
  • getPointsURL: Constructs points endpoint with address parameter
  • getMintBurnEventsURL: Handles path parameters for mint/burn events
  • getTotalSupplyURL: Builds total supply endpoint with optional chain parameter

Implementation Details

  • Used TypeScript interfaces to define endpoint-specific parameter requirements
  • Implemented the URL class for proper parameter encoding and URL construction
  • Maintained backward compatibility with existing API call patterns
  • Separated environment-specific base URLs from endpoint paths
  • Created a consistent pattern for all endpoint URL construction

Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for test-mint-dlc-link ready!

Name Link
🔨 Latest commit 0376410
🔍 Latest deploy log https://app.netlify.com/sites/test-mint-dlc-link/deploys/67c5d4357c662b00083866bb
😎 Deploy Preview https://deploy-preview-254--test-mint-dlc-link.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for mint-dlc-link ready!

Name Link
🔨 Latest commit 0376410
🔍 Latest deploy log https://app.netlify.com/sites/mint-dlc-link/deploys/67c5d4357c662b00083866bf
😎 Deploy Preview https://deploy-preview-254--mint-dlc-link.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for dev-mint-dlc-link ready!

Name Link
🔨 Latest commit 0376410
🔍 Latest deploy log https://app.netlify.com/sites/dev-mint-dlc-link/deploys/67c5d435f8e7c1000894214c
😎 Deploy Preview https://deploy-preview-254--dev-mint-dlc-link.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Polybius93 Polybius93 merged commit 217e635 into dev Mar 3, 2025
15 checks passed
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