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

etherlink-agent-kit

v0.1.0

Published

Core SDK for interacting with the Etherlink blockchain (testnet and mainnet).

Readme

Etherlink Agent Kit

A comprehensive TypeScript SDK for interacting with the Etherlink blockchain. Built with Viem for robust Ethereum-compatible blockchain interactions.

🚀 Features

  • Account Management: Create wallets, get balances, sign messages
  • Token Operations: Transfer, mint, burn ERC-20 tokens
  • NFT Management: Create collections, mint, transfer, burn NFTs
  • Smart Contract Interaction: Read and execute any smart contract
  • TypeScript Support: Full type safety with comprehensive interfaces
  • Etherlink Testnet Ready: Pre-configured for Etherlink testnet

📦 Installation

npm install etherlink-agent-kit

🔧 Quick Start

Basic Setup

import { EtherlinkKit } from 'etherlink-agent-kit';

// Initialize the kit with your configuration
const kit = new EtherlinkKit({
  rpcUrl: 'https://node.ghostnet.etherlink.com',
  privateKey: '0x...' // Your private key with 0x prefix
});

Account Operations

// Get your wallet address
const address = kit.account.getAddress();
console.log('Wallet address:', address);

// Get native XTZ balance
const balance = await kit.account.getBalance();
console.log('XTZ balance:', balance);

// Create a new account (returns address and private key)
const newAccount = kit.account.create();
console.log('New account:', newAccount);

// Sign a message
const signature = await kit.account.signMessage('Hello Etherlink!');
console.log('Signature:', signature);

Token Operations (ERC-20)

// Transfer tokens
const txHash = await kit.token.transfer({
  tokenAddress: '0x...', // ERC-20 contract address
  to: '0x...',           // Recipient address
  amount: BigInt('1000000000000000000') // 1 token (18 decimals)
});
console.log('Transfer hash:', txHash);

// Mint tokens (if you have minting rights)
const mintHash = await kit.token.mint({
  tokenAddress: '0x...',
  to: '0x...',
  amount: BigInt('1000000000000000000')
});

// Burn tokens
const burnHash = await kit.token.burn({
  tokenAddress: '0x...',
  amount: BigInt('1000000000000000000')
});

// Get token balance
const tokenBalance = await kit.token.getBalance({
  tokenAddress: '0x...',
  ownerAddress: '0x...' // Optional, defaults to your address
});

NFT Operations (ERC-721)

// Create an NFT collection
const collectionAddress = await kit.nft.createCollection({
  name: 'My NFT Collection',
  symbol: 'MNFT'
});
console.log('Collection deployed at:', collectionAddress);

// Mint an NFT
const mintHash = await kit.nft.mint({
  collectionAddress: '0x...',
  to: '0x...',
  metadataUri: 'https://example.com/metadata.json'
});

// Transfer an NFT
const transferHash = await kit.nft.transfer({
  collectionAddress: '0x...',
  to: '0x...',
  tokenId: BigInt(1)
});

// Burn an NFT
const burnHash = await kit.nft.burn({
  collectionAddress: '0x...',
  tokenId: BigInt(1)
});

// Get NFT owner
const owner = await kit.nft.getOwner({
  collectionAddress: '0x...',
  tokenId: BigInt(1)
});

Smart Contract Interaction

// Read contract data
const result = await kit.chain.readContract({
  address: '0x...',
  abi: [...], // Contract ABI
  functionName: 'balanceOf',
  args: ['0x...']
});

// Execute contract function
const txHash = await kit.chain.executeContract({
  address: '0x...',
  abi: [...], // Contract ABI
  functionName: 'transfer',
  args: ['0x...', BigInt(1000)],
  value: BigInt(0) // Optional ETH value to send
});

🔗 Network Support

This SDK supports both Etherlink testnet and mainnet:

Etherlink Testnet

  • Chain ID: 128123
  • RPC URL: https://node.ghostnet.etherlink.com
  • Explorer: https://testnet-explorer.etherlink.com
  • Native Currency: XTZ (Tezos)

Etherlink Mainnet

  • Chain ID: 42793
  • RPC URL: https://node.mainnet.etherlink.com
  • Explorer: https://explorer.etherlink.com
  • Native Currency: XTZ (Tezos)

Configuration

You can specify which network to use in your configuration:

// For testnet (default)
const testnetConfig = {
  rpcUrl: 'https://node.ghostnet.etherlink.com',
  privateKey: '0x...',
  network: 'testnet' // Optional, defaults to 'testnet'
};

// For mainnet
const mainnetConfig = {
  rpcUrl: 'https://node.mainnet.etherlink.com',
  privateKey: '0x...',
  network: 'mainnet'
};

📋 API Reference

EtherlinkKit

The main class that provides access to all modules.

class EtherlinkKit {
  constructor(config: KitConfig)
  
  account: AccountModule
  token: TokenModule
  nft: NftModule
  chain: ChainModule
}

KitConfig

interface KitConfig {
  rpcUrl: string;      // Etherlink RPC endpoint
  privateKey: Hex;     // Your private key (0x-prefixed)
  network?: Network;   // Optional: 'mainnet' or 'testnet' (defaults to 'testnet')
}

AccountModule

class AccountModule {
  create(): { address: string; privateKey: string }
  getAddress(): string
  getBalance(): Promise<bigint>
  signMessage(message: string): Promise<string>
}

TokenModule

class TokenModule {
  transfer(params: TransferParams): Promise<string>
  mint(params: MintParams): Promise<string>
  burn(params: BurnParams): Promise<string>
  getBalance(params: BalanceParams): Promise<bigint>
}

NftModule

class NftModule {
  createCollection(params: CreateCollectionParams): Promise<string>
  mint(params: MintNftParams): Promise<string>
  transfer(params: TransferNftParams): Promise<string>
  burn(params: BurnNftParams): Promise<string>
  getOwner(params: GetOwnerParams): Promise<string>
}

ChainModule

class ChainModule {
  readContract(params: ContractInteractionParams): Promise<any>
  executeContract(params: ExecuteContractParams): Promise<string>
}

🛠️ Development

Building

npm run build

Testing

npm test

📄 License

MIT License - see LICENSE for details.

🤝 Contributing

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

📞 Support

For support, please open an issue on GitHub or contact the development team.


Note: This is an alpha release (v0.0.1). The API may change in future versions. Use with caution in production environments.