feat(sdk): add setPrimaryNfd method with example implementation#11
Merged
feat(sdk): add setPrimaryNfd method with example implementation#11
Conversation
Add the ability to set an NFD as the primary NFD for an Algorand address. This allows users to choose which of their linked NFDs should be the one that resolves when someone looks up their address.
Add the ability to bypass caching when making API requests by adding a `nocache` parameter to `ResolveOptions`, `ReverseLookupOptions`, and `SearchOptions`. - Add the `nocache` property to type definitions - Implement a `_getCacheParam` helper method in `NfdApiClient` - Apply the cache parameter to `resolve`, `reverseLookup`, and `search` methods - Improve type safety and documentation for API methods
Add a new method to resolve multiple addresses to their associated NFDs in a single operation. This complements the existing `resolveAddress` method by providing a more efficient way to look up NFDs for multiple addresses.
Add a new example project demonstrating how to set a primary NFD for an Algorand address. This example showcases the new `setPrimaryNfd` method and provides a practical implementation for users. The example includes: - A React application that connects to an Algorand wallet - Functionality to fetch NFDs linked to the connected address - UI to display the current primary NFD and other linked NFDs - The ability to set any linked NFD as the primary NFD - Handling of API sync delays with a custom `useApiSync` hook
Add a script to completely remove all node_modules directories in the monorepo (root, packages, and examples) and perform a fresh pnpm install. This helps ensure a clean dependency state when troubleshooting or after switching branches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the new
setPrimaryNfdmethod to the NFD SDK, allowing users to designate a primary NFD for an Algorand address. It includes a comprehensive example project demonstrating the implementation and best practices for handling API sync.Details
setPrimaryNfdmethod to the SDK for setting a primary NFDuseApiSynchook for handling API sync delayssetSigner,manage, andsetPrimaryNfd