🥷
Namespace
AppDev Portal
  • [ Introduction ]
    • ENS
    • Namespace
  • Official Links
  • Apps
    • Overview
    • Onchain Subnames (App)
      • Search & Register
      • Wizard
        • Listing an ENS Name
        • Features List
      • ENS Widget
      • Farcaster Frames
        • Default Frame
        • Custom Frame
    • Offchain Subnames (DevApp)
      • Subnames
      • Resolver set
      • API keys
  • How-to Guides and Demos
  • Dev Docs
    • SDK
      • Offchain Manager
        • Installation
        • Generate API key
        • Create or Update Subname
        • DeleteSubname
        • IsSubnameAvailable
        • GetFilteredSubnames
        • AddressRecords
          • ChainName
        • TextRecords
        • DataRecords
      • Indexer Manager
        • Installation
        • Fetch L2 Subnames
        • Fetch L2 Registries
      • Mint Manager
        • Installation
        • GetMintDetails
        • GetMintTransactionParameters
        • IsSubnameAvailable
        • How To Mint L1 & L2 subname via mint-manager
      • Namespace Client (deprecated)
        • Installation
        • GetListedName
        • GetMintDetails
        • GetMintTransactionParameters
        • IsSubnameAvailable
        • GenerateAuthToken
    • APIs
      • Offchain Manager
      • Mint Manager
    • Infrastructure
      • Namespace L2 Subnames
    • Subpages
  • Ecosystem
    • Use Cases
  • Jobs
    • 📌We’re Hiring 👇
    • 🧑‍💻 Full-Stack Dev
    • 🥷 DevRel Lead
    • 💼 BD Lead
    • 🐣 Intern (dev role)
Powered by GitBook
On this page
  1. Dev Docs
  2. SDK

Namespace Client (deprecated)

A function to create a NamespaceClient

namespace-sdk library is deprecated. Please use @namespacesdk/mint-manager

A Namespace Client is an interface for interacting with Namespace Backend API And Smart contracts on different chains.

The createNamespaceClientfunction sets up a Namespace Client with a given ChainId. The ChainId specifies an id of a blockchain where the subnames are being minted from.

index.ts
import { createNamespaceClient } from "namespace-sdk";
import { base } from "viem/chains";

const NamespaceClient = createNamespaceClient({
    chainId: base.id,
    mintSource: "my-app",
    rpcUrl: "https://alchemy-url"
});

Parameters

1. chainId ( required ) - Specifies chain id where subnames are minted from, supported chains include

  • Mainnet ( chainId: 1 )

  • Base ( chainId: 8453 )

  • Sepolia ( chainId: 11155111 )

  • BaseSepolia ( chainId: 84532)

  1. mintSource ( optional ) - Used to track the source of minted subnames on a blockchain, defaults to "namespace-sdk".

  2. rpcUrl ( optional ) - Http RPC URL which will be used by SDK when it performs blockchain operations, defaults to a public RPC for a given chain

PreviousHow To Mint L1 & L2 subname via mint-managerNextInstallation

Last updated 1 month ago