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 🙏

© 2024 – Pkg Stats / Ryan Hefner

momoai-sdk

v0.1.1

Published

MomoAI tg mini SDK

Downloads

79

Readme

MomoAI SDK

npm version License: MIT Follow @Metaoasis_ Telegram Channel

A powerful SDK for integrating MomoAI ecosystem features into your dApp, supporting Telegram Mini Apps and multiple blockchains.

Architecture Overview

MomoAI SDK is built on a modular architecture with three core layers:

  1. Interface Layer

    • Authentication Management
    • State Synchronization
    • Error Handling System
  2. Service Layer

    • Telegram Mini App Integration
    • Blockchain Connectors
    • NFT Management Services
  3. Protocol Layer

    • Multi-chain Support
    • Security Protocol Implementation
    • Data Encryption

Features

  • 🔐 Advanced authentication & authorization system
  • 📱 Complete Telegram Mini App lifecycle management
  • ⛓️ Multi-chain support with dedicated connectors
  • 🎮 Comprehensive game publishing infrastructure
  • 💫 NFT management utilities
  • 🔌 Extensible plugin architecture

Installation

npm install momoai-sdk
# or
yarn add momoai-sdk
# or
pnpm add momoai-sdk

Technical Integration

SDK Initialization

import { Momoai, utils } from 'momoai-sdk'

const momoai = Momoai.init({
  appId: 'YOUR_APP_ID',
  api: 'API_ENDPOINT',
  tonConnect: {
    tonManifestUrl: 'YOUR_MANIFEST_URL',
    twaReturnUrl: 'YOUR_TWA_RETURN_URL'  // Optional
  }
})

Core Components

Authentication System

interface AuthResult {
    expiryTime: number
    tempAccessToken: string  
    loginStatus: string
}

// Login with optional invitation code
const authResult = await momoai.login()

Telegram Mini App Integration

interface TginitData {
    auth_date: number
    can_send_after: number
    chat?: {
        id: number
        type: string
        title: string
        username: string
        photo_url?: string
    }
    chat_type: string
    chat_instance: string
    hash: string
    query_id: string
    receiver: number
    start_param: string
    user: {
        id: number
        first_name: string
        last_name: string
        username: string
        language_code: string
        is_premium: boolean
        is_bot: boolean
        allows_write_to_pm: boolean
        added_to_attachment_menu: boolean
    }
}

// Initialize TMA data
const initData = await utils.getTgInitData()

TON Blockchain Operations

interface TonNFtApiInfo {
    authNo: string
    payeeAddress: string
    receiveNftAddress: string
    fee: string
    status: 'AUTH_NO_NOT_EXIST' | 'AUTH_NO_USED' | 'UNKNOWN'
}

// NFT Operations
const nftInfo = await utils.ton.nft.getNftInfo('auth_number')
const claimTx = await utils.ton.nft.claimNFT('auth_number', true)

Configuration Options

TON Connect Configuration

interface TonConnectConfig {
    tonManifestUrl: string
    twaReturnUrl?: `${string}://${string}`
}

interface TonManifestJson {
    url: string
    name: string
    iconUrl: string
    termsOfUseUrl?: string
    privacyPolicyUrl?: string
}

Performance Optimization

The SDK implements several optimization strategies:

  1. Connection Pooling

    • Efficient resource management
    • Automatic connection recovery
    • Connection limit controls
  2. Data Caching

    • Local state management
    • Configurable cache policies
    • Automatic cache invalidation
  3. Request Batching

    • Automatic request combining
    • Priority queue implementation
    • Batch size optimization

Development Roadmap

| Phase | Features | |-------|----------| | Q4 2024 | • Multi-chain Integration Framework• Enhanced Performance Monitoring | | Q1 2025 | • Advanced Social Features• Cross-chain Asset Management | | Q2 2025 | • Extended Protocol Support• Enhanced Security Features |

Security Framework

Security Architecture

  • End-to-end encryption implementation
  • Real-time threat monitoring
  • Advanced rate limiting system
  • Compliance with Web3 security standards

Security Reporting

For security issues, contact: [email protected]

Enterprise Solutions

Enterprise features include:

  • Custom deployment options
  • Advanced monitoring tools
  • Enhanced security features
  • Priority support channel

Contact: [email protected]

Error Handling

try {
  await momoai.login()
} catch (error) {
  if (error instanceof MomoaiError) {
    console.error('MomoAI specific error:', error.message)
  } else {
    console.error('Unexpected error:', error)
  }
}

Support Channels

License

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


Built with ❤️ by MomoAI Team