With the Client imported and the Provider instantiated, we can start interacting with the handles. In this example, we will show how to fetch the handle of an address:
To query metadata, it is necessary to import the RegistryContract class:
This class has a create constructor method that allows you to connect to the contract through a Wallet or Provider. In this example, we recommend connecting via the Provider:
With the Provider connected, we can create the contract instance:
Now, simply call the getMetadata method, passing the Handle as a parameter:
This will output a Record<MetadataKeys, string>, which represents the metadata associated with the handle, with MetadataKeys being the keys for the metadata and the values being the corresponding strings: