Skip to content

Conversation

@drichar
Copy link
Contributor

@drichar drichar commented Mar 5, 2025

Description

This PR enhances the NFD SDK by exporting the NfdApiClient class directly and improving the reverseLookup method with address chunking and prioritization. It also adds two new example projects demonstrating API client usage.

Details

  • Export the NfdApiClient class to allow direct usage for API-only integrations
  • Standardize type definitions by replacing NfdRecord with Nfd type across the codebase
  • Enhance reverseLookup method with automatic chunking of addresses (max 20 per request)
  • Implement parallel processing of address chunks for better performance
  • Add prioritization of verified NFDs over unverified ones in results
  • Create new example project for API search functionality
  • Create new example project for reverse lookup functionality
  • Add concise code examples to all example project READMEs
  • Standardize README structure across all examples

drichar added 6 commits March 4, 2025 15:51
Export the `NfdApiClient` class from the SDK to allow direct usage for
API-only integrations. Standardize type definitions by:
- Replacing `NfdRecord` with `Nfd` type across the codebase
- Adding `SearchResponse` type for consistent search results
- Omitting `nocache` parameter from `getNfd` options
- Updating method return types for better type safety

This change enables integrators to use the API client directly when they
only need search and lookup functionality, while maintaining the recommended
approach of using `NfdClient` for full SDK capabilities.
Add a new example project demonstrating how to use the NFD SDK's API client
to search for NFDs using various criteria. This example showcases:

- Searching NFDs by substring, owner address, category, and state
- Pagination of search results
- Displaying NFD details with expandable JSON data
- Both recommended and alternative approaches to using the API client
Improve the `reverseLookup` method in the NFD SDK with:
- Automatic chunking of addresses (max 20 per request)
- Parallel processing of address chunks
- Prioritization of verified NFDs over unverified ones
- Robust error handling for 404 responses
- Filtering of empty addresses before processing
Add a new example demonstrating how to look up NFDs by wallet address:
- Support for multiple wallet addresses
- Option to allow unverified NFDs
- Configurable view options (tiny, thumbnail, brief, full)
- Display of lookup results with key NFD information
- Error handling and loading states
- Add concise code examples to each example project README
- Demonstrate core SDK functionality with simplified syntax
- Standardize README structure across all examples
- Update section headings for consistency
- Add "About the NFD SDK" section to all examples
@drichar drichar merged commit 8a06c64 into main Mar 5, 2025
1 check passed
@drichar drichar deleted the feat/api-client-enhancements branch March 5, 2025 06:28
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