Peer Communication
Think of a peer as just another user. This page describes functions to use when directly interacting with another peer.
Establish Connection
Calls the underlying LibP2P#dialProtocol
method and converts the pintAddress
to the appropriate PeerId
instance. This method has the same return signature as LibP2P's dialProtocol().
Get Username
Uses the /pintswap/0.1.0/ns/query
protocol handler.
This function will either perform a lookup or a reverse lookup depending on the input it is provided.
In your code, take care to check that you pass in a string and check if it contains a .
character to determine if is a name or if it is a pint address.
The PintSwap protocol handles tlds other than .drip
via separate nameserver peers. It is possible to add your own tlds by hosting a pintswap-ns
process then in your PintSwap client mutate the NS_MULTIADDRS
object exported by @pintswap/sdk to include the tld you want to host a registry for and a list of the multiaddrs for your nameservers that can resolve those names.
Get Peer Data
Returns the peer's data including all their ERC20 and NFT offers, the user's biography, and their profile picture with the following structure:
Last updated