JustaName Core SDK
Last updated
Was this helpful?
Last updated
Was this helpful?
@justaname.id/sdk •
JustaName SDK is a toolkit for managing Ethereum Name Service (ENS) domains and subnames. It simplifies the integration of ENS functionalities into any application, including resolving ENS names, issuing off-chain subnames, and enabling Sign-In with ENS (SIWENS). The SDK supports both Ethereum Mainnet and Testnet environments.
Managing ENS domains and integrating them into applications can be complex and time-consuming. JustaName SDK aims to streamline this process by providing an easy-to-use interface for off-chain ENS management, subname issuance, and authentication using ENS domains. By abstracting the underlying complexities, developers can focus on building feature-rich applications without worrying about ENS integration details.
ENS Management: Manage ENS domains and subnames off-chain effortlessly.
Subname Issuance: Issue and update subnames without interacting directly with smart contracts.
ENS Resolution: Resolve on-chain and off-chain ENS easily within your application.
Sign-In with ENS (SIWENS): Authenticate users using their ENS domains for a decentralized and secure sign-in experience.
Mainnet and Testnet Support: Compatible with Ethereum Mainnet and Testnet environments.
Easy Integration: Simplifies the incorporation of ENS functionalities into any application.
JustaName SDK interacts with the JustaName API to perform off-chain operations related to ENS domains and subnames. It handles the necessary cryptographic operations, such as signing messages and verifying signatures, to ensure secure interactions. By using the SDK, developers can perform tasks like issuing subnames, updating records, and authenticating users without dealing with the complexities of the Ethereum blockchain directly.
Install the package using npm or yarn:
First, import the JustaName SDK and initialize it with your configuration:
To issue a subname off-chain, you can use the following code:
To update records associated with a subname, such as setting an avatar:
Enable users to sign in to your application using their ENS domain:
You can combine these functions to manage subnames and authenticate users:
acceptSubname
reserveSubname
addSubname
updateSubname
revokeSubname
rejectSubname
getSubnamesByEnsDomainWithCount
getSubname
getSubnamesByAddress
getInvitationsByAddress
getSubnamesByEnsDomain
searchSubnames
isSubnameAvailable
getRecords
getPrimaryNameByAddress
requestChallenge
verifyChallenge
requestSignIn
signIn
generateNonce
getAllOffchainResolvers
Simplified ENS Integration: Abstracts the complexities of interacting with the Ethereum blockchain and ENS smart contracts.
Off-Chain Management: Perform ENS domain and subname operations off-chain, reducing gas costs and improving performance.
Enhanced Security: Utilizes cryptographic signatures to ensure secure operations.
User-Friendly Authentication: Allows users to sign in with their ENS domains, enhancing user experience and security.
Flexible Environment Support: Works seamlessly with both Ethereum Mainnet and Testnet networks.
Contributions are welcome! If you have suggestions or find issues, please open an issue or submit a pull request on the GitHub repository.