Skip to content

Conversation

@drichar
Copy link
Contributor

@drichar drichar commented Mar 11, 2025

Description

This PR adds the new setPrimaryNfd method 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

  • Add new setPrimaryNfd method to the SDK for setting a primary NFD
  • Create example project showcasing the method's usage and implementation
  • Implement custom useApiSync hook for handling API sync delays
  • Demonstrate chain-style API usage with setSigner, manage, and setPrimaryNfd
  • Add optimistic UI updates for immediate user feedback
  • Include comprehensive error handling and loading states
  • Add the example to the main examples README

drichar added 5 commits March 11, 2025 02:27
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.
@drichar drichar merged commit df768e8 into main Mar 11, 2025
1 check passed
@drichar drichar deleted the feat/set-primary-nfd branch March 11, 2025 07:10
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