CARV
CARVPlayPortalProtocol
  • Overview
    • Introducing CARV
  • SVM - AI AGENTIC CHAIN
    • Introduction
      • Architecture
      • AI Agent in TEE environment
      • CARV Verifier Nodes
    • Quick Start
      • Bridge Token
      • Explorer
      • Command line tool
      • Reading from CARV SVM Network
      • Writing to the Network
      • Network Info
  • D.A.T.A. - AI FRAMEWORK
    • Introduction
      • DeepSeek Integration
      • D.A.T.A's Core Features
      • How It Empowers AI Agents
      • Driving the Future of AI and Blockchain
      • Leveraging CARV SVM Chain for Privacy and Trustless Data Sharing
    • Quick Start Guide
    • Architecture
    • ERC-7231 (CARV ID)
    • Examples
      • On-Chain Insights
    • Getting Started
      • D.A.T.A Framework Plugin for Eliza
    • Use Cases and Implementation
      • Getting On-Chain Data for AI Agents
      • What's Coming with the D.A.T.A Framework
    • API Documentation
      • News
      • On-chain Data SQL Query
        • Ethereum Schema
        • Bitcoin Schema
        • Base Schema
        • Solana Schema
      • On-chain Data SQL Query by LLM
      • Token Info and Price
      • User Balance by Twitter ID
      • User Balance by Discord ID
  • CARV Ecosystem
    • CARV Play
      • Portal Access
      • Integration Guide
        • .Play Name Service Integration
        • API-Verified Quest (RESTFUL)
        • API-Verified Quest (GraphQL)
        • CARV ID OAuth 2.0
        • CARV ID Telegram SDK
      • Smart Contracts & Security
    • MOFF Bot & Customer Data Platform
    • CARV Account
      • ERC 7231
    • Verifier Nodes
      • How to Purchase Nodes
      • Buyback Program
      • Why Verifier Nodes
      • How do Verifier Nodes Work
        • CARV/veCARV Token
        • CARV Vault
        • CARV NFT License
        • CARV Protocol Service
        • Trusted Execution Environment (TEE)
        • Verifier Node
        • Attestation
        • Delegation
        • Rewards
        • SGX Attestation Verification
      • Verifier Node Sale Dynamics
      • Smart Contract Addresses
      • License Key (NFT)
      • Delegation
      • Node Rewards
      • Join Mainnet Verifier Nodes
        • Prerequisites
        • Delegation Tutorial
        • Operating a Verifier Node
          • Running in VPS
          • Running in CLI
            • Using Source Code
            • Using Docker
            • Gasless Server API
          • Running in Desktop App
      • Explorer
      • FAQ
        • Node Sale
        • Node Operation
  • CARV LABS
    • Introduction
    • Working with CARV Labs
  • Tokenomics
    • Utility
      • veCARV(s)
    • Distribution & Vesting
  • DECENTRALIZED GOVERNANCE
    • ⚔️Universal Guardian Program
    • 📔DAO Governance
    • 🌏Community Programs & Activities
  • Resources
    • 🗜️Writings
    • 🗞️CARV in the News
    • 🫶Social & Community Links
    • 🅰️Brand Guideline
    • 💰Job Openings
Powered by GitBook
On this page
  • Overview
  • Use Cases
  • Getting Started
  1. CARV Ecosystem
  2. CARV Play
  3. Integration Guide

.Play Name Service Integration

Overview

This guide provides instructions for integrating the .Play Name Service (PNS) into your application using our JavaScript SDK. It allows your app to resolve domain names to Ethereum Virtual Machine (EVM) wallet addresses and to retrieve domain names associated with a user's EVM wallet address.

Use Cases

In any scenario where a user would normally encounter an EVM wallet address, your application can now present a more user-friendly PNS name. This integration primarily enhances your app in two ways:

  1. Displaying PNS Names Instead of EVM Wallet Addresses: In the user interface of your application, replace the raw display of EVM wallet addresses with corresponding PNS names. This substitution can occur wherever an address typically appears, making the interface more intuitive and user-friendly.

  2. Enabling PNS Name Entry in Input Fields: Modify input fields that traditionally require an EVM wallet address, allowing users to input PNS names instead. This feature simplifies user interactions, particularly in situations where memorizing or copying lengthy EVM wallet addresses can be cumbersome.

Getting Started

Install

npm install @carv-protocol/pns-js

Set up

import { getNames, getAddress} from '@carv-protocol/pns-js'

Forward Resolution

You can get address from domain name using the following method.

  const testDomain = "carv-engineer.play"
  const address = await getAddress(testDomain);

Reverse Resolution

You can get a list of domain names associated with an address. Note that the 'Primary Domain' feature is not yet released where a user can choose one domain name (from multiple) an address resolves to. This method will simply return all the associated domain names in ascending order by length.

const testAddress = "0x25dC11C90349024C083e34f3f749ffAb7AEd0e48";
const names = await getNames(testAddress);
PreviousIntegration GuideNextAPI-Verified Quest (RESTFUL)

Last updated 1 year ago