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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mantletestkit-sdk

v0.0.2

Published

A modern TypeScript SDK for interacting with the Mantle blockchain - transfer tokens, create contracts, and manage DeFi operations

Readme

mantletestkit-sdk

A modern TypeScript SDK for interacting with the Mantle blockchain - transfer tokens, create contracts, and manage DeFi operations. Works in both client-side (browser) and server-side environments.

🚀 Features

  • Client-Side Ready: Works in Next.js, React, and other browser environments
  • Server-Side Support: Traditional private key-based operations for backend services
  • Token Operations: Transfer MNT and ERC20 tokens
  • Token Creation: Deploy custom ERC20 tokens
  • Token Burning: Burn tokens with visible events
  • Balance Checking: Check MNT and token balances
  • LangChain Integration: AI-powered blockchain interactions
  • TypeScript Support: Full TypeScript support with types
  • Modern API: Clean, promise-based API

📦 Installation

npm install mantletestkit-sdk

🔧 Quick Start

Client-Side Usage (Next.js, React, Browser)

import { MantleSDK } from 'mantletestkit-sdk';

// Initialize the SDK (no private key needed!)
const mantleSDK = new MantleSDK();

// Connect to user's wallet (MetaMask, etc.)
const address = await mantleSDK.connect();
console.log('Connected wallet:', address);

// Check your MNT balance
const balance = await mantleSDK.getBalance();
console.log('MNT Balance:', balance);

// Transfer MNT (requires user approval)
const result = await mantleSDK.transfer({
  toAddress: '0x1234567890123456789012345678901234567890',
  amount: '0.001'
});
console.log('Transfer result:', result);

Server-Side Usage (Node.js, Backend)

import { MantleAgent } from 'mantletestkit-sdk';

// Initialize the SDK with private key (server-side only!)
const mantleAgent = new MantleAgent({
  rpcUrl: 'https://rpc.sepolia.mantle.xyz',
  privateKey: process.env.PRIVATE_KEY!
});

// Check balance
const balance = await mantleAgent.getBalance();
console.log('MNT Balance:', balance);

// Transfer MNT
const result = await mantleAgent.transfer({
  toAddress: '0x1234567890123456789012345678901234567890',
  amount: '0.001'
});
console.log('Transfer result:', result);

📚 API Reference

Client-Side SDK (MantleSDK)

const mantleSDK = new MantleSDK({
  rpcUrl?: string  // Optional, can use default
});

// Connect to wallet
await mantleSDK.connect();

// Check connection status
const isConnected = mantleSDK.getConnectionStatus();

// Get connected address
const address = await mantleSDK.getAddress();

// Check balance
const balance = await mantleSDK.getBalance();
const tokenBalance = await mantleSDK.getBalance('0xTokenAddress');

// Transfer (requires user approval)
await mantleSDK.transfer({
  toAddress: '0x...',
  amount: '0.001'
});

// Create token (requires user approval)
const tokenAddress = await mantleSDK.createToken({
  name: 'MyToken',
  symbol: 'MTK',
  initialSupply: 1000
});

Server-Side SDK (MantleAgent)

const mantleAgent = new MantleAgent({
  rpcUrl: string,      // Mantle RPC URL
  privateKey: string   // Your wallet private key
});

// All operations work the same way
const balance = await mantleAgent.getBalance();
const result = await mantleAgent.transfer({...});

🌐 Environment Setup

Client-Side (.env.local)

# Optional - can use default RPC
MANTLE_RPC_URL=https://rpc.mantle.xyz

Server-Side (.env)

# Required for server-side operations
MANTLE_RPC_URL=https://rpc.mantle.xyz
PRIVATE_KEY=your-private-key-here

🔒 Security

  • Client-Side: No private keys needed, uses user's wallet
  • Server-Side: Private keys managed securely through environment variables
  • User Approval: All client-side transactions require user approval
  • Environment Variables: Use environment variables for sensitive server-side data

📝 Examples

Next.js Component Example

'use client';
import { useState, useEffect } from 'react';
import { MantleSDK } from 'mantletestkit-sdk';

export default function TransferComponent() {
  const [sdk, setSdk] = useState<MantleSDK>();
  const [address, setAddress] = useState<string>();
  const [balance, setBalance] = useState<string>();

  useEffect(() => {
    const mantleSDK = new MantleSDK();
    setSdk(mantleSDK);
  }, []);

  const connectWallet = async () => {
    if (sdk) {
      const addr = await sdk.connect();
      setAddress(addr);
      
      const bal = await sdk.getBalance();
      setBalance(bal);
    }
  };

  const transfer = async () => {
    if (sdk) {
      try {
        const txHash = await sdk.transfer({
          toAddress: '0x...',
          amount: '0.001'
        });
        alert(`Transaction sent: ${txHash}`);
      } catch (error) {
        alert(`Error: ${error}`);
      }
    }
  };

  return (
    <div>
      {!address ? (
        <button onClick={connectWallet}>Connect Wallet</button>
      ) : (
        <div>
          <p>Connected: {address}</p>
          <p>Balance: {balance} MNT</p>
          <button onClick={transfer}>Transfer 0.001 MNT</button>
        </div>
      )}
    </div>
  );
}

🤖 LangChain Integration

The SDK includes full LangChain compatibility for AI-powered blockchain interactions:

import { MantleAI } from 'mantletestkit-sdk';

// Use with either client or server SDK
const mantleAI = new MantleAI({
  openaiApiKey: 'your-openai-key',
  mantleAgent: mantleSDK // or mantleAgent for server-side
});

await mantleAI.initialize();

// Natural language interactions
const balance = await mantleAI.invoke('What is my MNT balance?');
const transfer = await mantleAI.invoke('Transfer 0.001 MNT to 0x1234...');

🌐 Network Configuration

Mantle Testnet (Sepolia)

const mantleSDK = new MantleSDK({
  rpcUrl: 'https://rpc.sepolia.mantle.xyz'
});

Mantle Mainnet

const mantleSDK = new MantleSDK({
  rpcUrl: 'https://rpc.mantle.xyz'
});

🤝 Contributing

  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.

🔗 Links