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

@varan-wallet/varan-connect

v1.1.0

Published

A lightweight TypeScript library for Telegram Web App wallet integration with support for both CommonJS and ES modules.

Downloads

944

Readme

@varan-wallet/varan-connect

A lightweight TypeScript library for Telegram Web App wallet integration with support for both CommonJS and ES modules.

Installation

npm install @varan-wallet/varan-connect
# or
pnpm add @varan-wallet/varan-connect
# or
yarn add @varan-wallet/varan-connect

Usage

ES Modules (Recommended)

import { injectVaranWallet } from '@varan-wallet/varan-connect';
import WebApp from '@twa-dev/sdk';

// Inject the Varan wallet into the window object
injectVaranWallet(WebApp);

// The wallet is now available at window.injectedWeb3.varan
const varanWallet = window.injectedWeb3?.varan;
if (varanWallet) {
  // Connect to wallet
  const connection = await varanWallet.connect();
  
  // Get accounts
  const accounts = await connection.accounts.get();
  
  // Sign transactions
  const signer = connection.signer;
  const signature = await signer.signRaw({
    address: '0x123...',
    data: '0x456...'
  });
}

CommonJS

const { injectVaranWallet } = require('@varan-wallet/varan-connect');
const WebApp = require('@twa-dev/sdk').default;

// Inject the Varan wallet
injectVaranWallet(WebApp);

// Use the injected wallet
const varanWallet = window.injectedWeb3?.varan;

Module Support

This library supports both module systems:

  • ES Modules (ESM): Modern JavaScript modules using import/export
  • CommonJS (CJS): Node.js traditional modules using require/module.exports

The library automatically detects which module system you're using and provides the appropriate format.

API

injectVaranWallet(webApp: WebApp): void

Injects the Varan wallet into the window object for Telegram Web App integration.

Parameters:

  • webApp: The Telegram Web App instance from @twa-dev/sdk

Returns: void

Types

The library exports comprehensive TypeScript types:

  • WebApp - Telegram Web App interface from @twa-dev/sdk
  • InjectedWindow - Extended window interface with injected wallet from @polkadot/extension-inject
  • ConnectRequest, SignTransactionRequest - Request interfaces
  • ConnectResult, SignTransactionResult - Result interfaces
  • InjectionConfig - Configuration options for wallet injection

Dependencies

Runtime Dependencies:

  • @twa-dev/sdk - Telegram Web App SDK

Development Dependencies:

  • @polkadot/extension-inject - Polkadot extension injection types
  • @polkadot/types - Polkadot types
  • TypeScript for compilation
  • ESLint for code quality
  • Prettier for code formatting
  • Jest for testing

Build Outputs

The library provides multiple build outputs:

  • dist/esm/ - ES Modules build (.mjs compatible)
  • dist/cjs/ - CommonJS build (Node.js compatible)
  • dist/types/ - TypeScript type definitions

Development

Setup

pnpm install

Build

pnpm run build        # Build all formats
pnpm run build:esm    # Build ES modules only
pnpm run build:cjs    # Build CommonJS only
pnpm run build:types  # Build types only

Development mode

pnpm run dev

Testing

pnpm test

Linting

pnpm run lint

Formatting

pnpm run format

Publishing

# Publish with automatic version bumping
pnpm run publish:patch    # 1.0.0 -> 1.0.1
pnpm run publish:minor    # 1.0.0 -> 1.1.0
pnpm run publish:major    # 1.0.0 -> 2.0.0

# Manual publish (after building)
pnpm publish

License

MIT