npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

easters-crypto

v1.1.0

Published

Modular backend service for tokenization and smart contracts in real estate applications

Downloads

9

Readme

Easter's Crypto Integration Guide

Easter's Crypto

🚀 Overview

Easter's Crypto is a modular backend service that provides tokenization and smart contract functionality for real estate applications. It's designed to be easily integrated into existing Next.js applications while offering powerful blockchain capabilities with minimal setup.

🔑 Key Features

  • Property Tokenization: Mint NFTs representing real estate properties
  • Fractional Ownership: Create and manage fractional ownership tokens
  • Crypto Domain Resolution: Verify ownership through crypto domains (.eth, .crypto, etc.)
  • Smart Contract Deployment: Deploy and interact with property marketplace contracts
  • Modular Integration: Easily plug into existing Next.js applications
  • Optional UI Components: Ready-to-use React components for verification displays

📋 Prerequisites

  • Node.js (v14+)
  • A Next.js application (v12+)
  • Basic understanding of blockchain concepts
  • Infura API key (or alternative Ethereum provider)
  • Ethereum wallet with private key (for transactions)

🛠️ Installation

# Install the package from npm
npm install easters-crypto

# Or using yarn
yarn add easters-crypto

⚙️ Configuration

  1. Create a .env.local file in your Next.js project root with the following variables:
# Blockchain Configuration
INFURA_API_KEY=your_infura_api_key
PRIVATE_KEY=your_wallet_private_key
NETWORK=mainnet  # or rinkeby, goerli, etc.

# Optional configurations
RPC_URL=your_custom_rpc_url  # Alternative to Infura
IPFS_PROJECT_ID=your_ipfs_project_id
IPFS_PROJECT_SECRET=your_ipfs_project_secret
  1. Import and initialize Easter's Crypto in your Next.js application:
// In pages/_app.js or equivalent
import { initEastersCrypto } from 'easters-crypto';

// Initialize with configuration
const eastersCrypto = initEastersCrypto({
  blockchain: {
    network: process.env.NETWORK || 'mainnet',
    infuraApiKey: process.env.INFURA_API_KEY,
    privateKey: process.env.PRIVATE_KEY
  },
  enableUI: true // Enable UI components
});

// Make it available to your app
export default function MyApp({ Component, pageProps }) {
  return (
    <Component 
      {...pageProps} 
      eastersCrypto={eastersCrypto} 
    />
  );
}

🔍 Usage Examples

Setting up API Routes

Create a file at pages/api/easters-crypto/[...path].js:

// Import API routes from Easter's Crypto
import { initEastersCrypto } from 'easters-crypto';

const eastersCrypto = initEastersCrypto({
  blockchain: {
    network: process.env.NETWORK,
    infuraApiKey: process.env.INFURA_API_KEY,
    privateKey: process.env.PRIVATE_KEY
  }
});

// Forward requests to Easter's Crypto API handler
export default function handler(req, res) {
  return eastersCrypto.apiRoutes(req, res);
}

Tokenizing a Property

import { useState } from 'react';

export default function TokenizePage({ eastersCrypto }) {
  const [tokenId, setTokenId] = useState(null);
  const [loading, setLoading] = useState(false);
  
  const handleTokenize = async () => {
    setLoading(true);
    
    // Example contract address - you'd deploy this first
    const contractAddress = "0x1234...5678";
    
    // Property details
    const propertyData = {
      address: "123 Blockchain Ave, Crypto City",
      beds: 3,
      baths: 2,
      sqft: 2000,
      description: "Beautiful property with modern amenities"
    };
    
    // Metadata URI (could be IPFS)
    const tokenURI = "https://example.com/property/metadata.json";
    
    // Recipient address (could be the user's wallet)
    const recipientAddress = "0xabcd...1234";
    
    try {
      const result = await eastersCrypto.tokenManager.mintPropertyToken(
        contractAddress,
        tokenURI,
        recipientAddress,
        propertyData
      );
      
      if (result.success) {
        setTokenId(result.tokenId);
        console.log("Property tokenized successfully:", result);
      } else {
        console.error("Tokenization failed:", result.error);
      }
    } catch (error) {
      console.error("Exception during tokenization:", error);
    } finally {
      setLoading(false);
    }
  };
  
  return (
    <div>
      <h1>Tokenize Property</h1>
      <button 
        onClick={handleTokenize} 
        disabled={loading}
      >
        {loading ? "Processing..." : "Tokenize Property"}
      </button>
      
      {tokenId && (
        <div>
          <h2>Success!</h2>
          <p>Token ID: {tokenId}</p>
        </div>
      )}
    </div>
  );
}

Using the Verification Badge Component

import { useState, useEffect } from 'react';

export default function PropertyListing({ eastersCrypto, propertyDomain }) {
  const [verified, setVerified] = useState(false);
  const [loading, setLoading] = useState(true);
  
  useEffect(() => {
    async function verifyDomain() {
      if (propertyDomain) {
        const result = await eastersCrypto.domainResolver.resolveDomain(propertyDomain);
        setVerified(result.success);
        setLoading(false);
      }
    }
    
    verifyDomain();
  }, [propertyDomain, eastersCrypto]);
  
  // Early return for loading state
  if (loading) return <p>Verifying domain...</p>;
  
  // Get the VerificationBadge component if UI is enabled
  const VerificationBadge = eastersCrypto.UI?.VerificationBadge;
  
  return (
    <div className="property-card">
      <h2>Luxury Downtown Condo</h2>
      
      {/* Display verification badge if UI is enabled */}
      {VerificationBadge && (
        <VerificationBadge 
          isVerified={verified}
          domain={propertyDomain}
          size="medium"
          onClick={() => window.open(`https://app.ens.domains/name/${propertyDomain}`)}
        />
      )}
      
      {/* Alternative if UI is disabled */}
      {!VerificationBadge && verified && (
        <span>✓ Verified</span>
      )}
      
      <p>3 bed, 2 bath luxury condo in prime downtown location</p>
      <p>Price: 250 ETH</p>
    </div>
  );
}

Resolving Crypto Domains

export default function DomainInfo({ eastersCrypto }) {
  const [domain, setDomain] = useState('');
  const [domainData, setDomainData] = useState(null);
  
  const handleResolveDomain = async () => {
    if (!domain) return;
    
    const result = await eastersCrypto.domainResolver.resolveDomain(domain);
    
    if (result.success) {
      setDomainData(result);
    } else {
      alert(`Failed to resolve domain: ${result.error}`);
    }
  };
  
  return (
    <div>
      <h1>Domain Resolver</h1>
      
      <input 
        type="text" 
        value={domain} 
        onChange={(e) => setDomain(e.target.value)}
        placeholder="Enter domain (e.g., myestate.eth)"
      />
      
      <button onClick={handleResolveDomain}>Resolve Domain</button>
      
      {domainData && (
        <div>
          <h2>Domain Information</h2>
          <p>Address: {domainData.address}</p>
          
          {domainData.metadata && (
            <div>
              <h3>Property Details</h3>
              <ul>
                {Object.entries(domainData.metadata).map(([key, value]) => (
                  <li key={key}>
                    <strong>{key}:</strong> {value}
                  </li>
                ))}
              </ul>
            </div>
          )}
        </div>
      )}
    </div>
  );
}

📚 API Documentation

Core Services

Token Manager

  • loadContract(contractAddress, tokenType): Load a token contract
  • mintPropertyToken(contractAddress, tokenURI, recipient, propertyData): Mint a new property token
  • createFractionalTokens(contractAddress, tokenId, fractions): Create fractional ownership tokens
  • getTokenMetadata(contractAddress, tokenId): Get token metadata
  • transferToken(contractAddress, tokenId, from, to): Transfer token ownership

Smart Contract Service

  • loadContract(address, abi): Load an existing smart contract
  • deployTokenizationContract(name, symbol): Deploy a new property tokenization contract
  • deployFractionalContract(propertyTokenAddress): Deploy a fractional ownership contract
  • listPropertyForSale(marketplaceAddress, tokenId, price): List a property for sale
  • buyProperty(marketplaceAddress, tokenId, shares): Buy property or fractional shares

Domain Resolver

  • resolveDomain(domain): Resolve any crypto domain (.eth, .crypto, etc.)
  • verifyDomainOwnership(domain, address): Verify domain ownership
  • getPropertyMetadata(domain): Extract property metadata from domain

UI Components

  • VerificationBadge: Display verification status with configurable styling
  • TokenDisplay: Visualize property tokens with metadata
  • DomainInfoPanel: Display domain resolution information

🔄 Blockchain Networks

Easter's Crypto supports the following networks:

  • Ethereum Mainnet
  • Rinkeby (testnet)
  • Goerli (testnet)
  • Sepolia (testnet)
  • Custom networks (via RPC URL)

🛣️ Roadmap

  • Support for additional blockchain networks (Polygon, Arbitrum)
  • Extended support for Unstoppable Domains
  • Enhanced fractional ownership management
  • Interactive property marketplace components
  • IPFS metadata storage integration

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📞 Support

For support, email [email protected] or open an issue on our GitHub repository.


Built with ❤️ by Easter's Crypto Team