JustaName Core SDK
@justaname.id/sdk • Docs
JustaName 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.
Table of Contents
Motivation
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.
Features
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.
How It Works
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.
Installation
Install the package using npm or yarn:
Quickstart Guide
Initialization
First, import the JustaName SDK and initialize it with your configuration:
Issuing a Subname
To issue a subname off-chain, you can use the following code:
Updating a Subname
To update records associated with a subname, such as setting an avatar:
Signing In with ENS
Enable users to sign in to your application using their ENS domain:
Putting It All Together
You can combine these functions to manage subnames and authenticate users:
Available Methods
Subname Management
acceptSubname
reserveSubname
addSubname
updateSubname
revokeSubname
rejectSubname
getSubnamesByEnsDomainWithCount
getSubname
getSubnamesByAddress
getInvitationsByAddress
getSubnamesByEnsDomain
searchSubnames
isSubnameAvailable
getRecords
getPrimaryNameByAddress
SIWE
requestChallenge
verifyChallenge
Sign-In with ENS
requestSignIn
signIn
generateNonce
Offchain Resolvers
getAllOffchainResolvers
Benefits
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.
Contributing
Contributions are welcome! If you have suggestions or find issues, please open an issue or submit a pull request on the GitHub repository.
Last updated