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

evm-sdk

v1.0.9

Published

A comprehensive Ethereum Virtual Machine SDK for blockchain interactions, specifically designed for stake, unstake, and withdraw operations from NEAR to BSC.

Readme

EVM SDK

A comprehensive Ethereum Virtual Machine SDK for blockchain interactions, specifically designed for stake, unstake, and withdraw operations from NEAR to BSC.

Features

  • 🚀 Easy to Use: Simple and intuitive API design
  • 🔒 Type Safe: Full TypeScript support with comprehensive type definitions
  • 📦 Lightweight: Minimal dependencies, optimized bundle size
  • 🔧 Flexible: Support for multiple networks and configurations
  • 📚 Well Documented: Comprehensive documentation and examples
  • 🌉 Cross-Chain: Built-in support for NEAR to BSC bridge operations

Installation

npm install evm-sdk

or

yarn add evm-sdk

Project Structure

evm-sdk/
├── src/                          # Source code directory
│   ├── config/                   # Configuration files
│   │   ├── bridge.ts            # Bridge configuration
│   │   ├── config.ts            # Main configuration
│   │   └── rpc.ts               # RPC configuration
│   ├── handlers/                 # Business logic handlers
│   │   ├── stake.ts             # Stake operation handler
│   │   ├── withdraw.ts          # Withdraw operation handler
│   │   └── unstake.ts           # Unstake operation handler
│   ├── interfaces/               # TypeScript interfaces
│   │   ├── stakeInter.ts        # Stake related interfaces
│   │   ├── withdrawInter.ts     # Withdraw related interfaces
│   │   └── unstakeInter.ts      # Unstake related interfaces
│   ├── services/                 # Core services
│   │   └── wormhole.ts          # Wormhole bridge service
│   ├── utils/                    # Utility functions
│   │   ├── bridgeUtils.ts       # Bridge utility functions
│   │   ├── helpers.ts           # General helper functions
│   │   └── numbers.ts           # Number manipulation utilities
│   ├── types/                    # Type definitions
│   │   ├── common.ts            # Common type definitions
│   │   └── global.d.ts          # Global type declarations
│   └── index.ts                  # Main entry point
├── dist/                         # Build output directory
├── .eslintrc.js                  # ESLint configuration
├── .prettierrc                   # Prettier configuration
├── .gitignore                    # git ignore file
├── package.json                  # Package configuration
├── tsconfig.json                 # TypeScript configuration
└── README.md                     # Project documentation

Key Components

  • src/config/ - Configuration files for different environments and chains
  • src/handlers/ - Business logic handlers for stake/unstake operations
  • src/interfaces/ - TypeScript interface definitions for type safety
  • src/services/ - Core services including Wormhole bridge integration
  • src/utils/ - Utility functions for common operations
  • src/types/ - Type definitions and global type declarations

Quick Start

import EVMSDK, {
  TokenMeta, 
  StakeInfo, 
  StakeParams, 
  StakeResult, 
  CreateTxMessage, 
  StakeMessage, 
  UnstakeParams,
  UnstakeResult, 
  UnstakeMessage, 
  WithdrawParams,
  WithdrawResult
} from 'evm-sdk' ;

// Initialize the SDK
const BscStake = new EVMSDK();

Methods

  • stake(params: StakeParams): Promise<StakeResult | Error>
  • unstake(params:UnstakeParams): Promise<UnstakeResult | Error>
  • withdraw(params:WithdrawParams): Promise<WithdrawResult | Error>
  • queryNearAccountByEvmAccount(evmAccount:string): nearAccountId
  • getCreateFee(nearAccount:string)
  • getTokenBridgeFee(nearAccount:string)

new account tips

If you are a new account on NEAR, you need to use getCreateFee() and getTokenBridgeFee() to get your required fees, and ensure you meet the minimum stake amount.

How To Use

 const stakeRes = await stake({
    waitStakeTokenID: RHEA_TOKEN_ID_NEAR,
    stakedXTokenID: XRHEA_TOKEN_ID_NEAR,
    nearAccountId: '',
    signer: await window.ethWeb3Provider?.getSigner(),
    env: 'production',
    rpcUrl: 'https://free.rpc.fastnear.com',
    stakeInfo: {
        from: 'BSC',
        to: 'NEAR',
        amountIn: '1',
        sender: BSC_ACOOUNT_ID,
        fromTokenMeta: {
            address: RHEA_TOKEN_ID_BSC,
            symbol: 'RHEA',
            decimals: 18,
            icon: 'https://xxx.com/token/rhea.svg'
        },
        toTokenMeta: {
            address: RHEA_TOKEN_ID_NEAR;
            symbol: 'RHEA';
            decimals: 18;
            icon: 'https://xxx.com/token/rhea.svg';
        }
    }
 })

 const UnStakeRes = await unstake({
    waitUnstakeXTokenID: XRHEA_TOKEN_ID_NEAR,
    unstakedTokenID: RHEA_TOKEN_ID_NEAR,
    nearAccountId: '',
    signer: await window.ethWeb3Provider?.getSigner(),
    env: 'production',
    rpcUrl: 'https://free.rpc.fastnear.com',
    stakeInfo: {
        from: 'BSC',
        to: 'NEAR',
        amountIn: '1',
        sender: BSC_ACOOUNT_ID,
        fromTokenMeta: {
            address: XRHEA_TOKEN_ID_BSC,
            symbol: 'xRHEA',
            decimals: 18,
            icon: 'https://xxx.com/token/rhea.svg'
        },
        toTokenMeta: {
            address: XRHEA_TOKEN_ID_NEAR;
            symbol: 'xRHEA';
            decimals: 18;
            icon: 'https://xxx.com/token/rhea.svg';
        }
    }
 })


 const withdrawRes = await withdraw({
    withdrawTokenIDOnNear: RHEA_TOKEN_ID_NEAR || XRHEA_TOKEN_ID_NEAR,
    withdrawTokenIDOnBsc: RHEA_TOKEN_ID_BSC || XRHEA_TOKEN_ID_BSC,
    receiver: 'xxx.near',
    withdrawBalance: '1111',
    evmRpcUrl: 'https://bsc.drpc.org',
    stakeInfo: {
        from: 'BSC',
        to: 'NEAR',
        amountIn: '1',
        sender: BSC_ACOOUNT_ID,
        fromTokenMeta: {
            address: RHEA_TOKEN_ID_NEAR || XRHEA_TOKEN_ID_NEAR,
            symbol: 'RHEA' || 'xRHEA',
            decimals: 18,
            icon: 'https://xxx.com/token/rhea.svg'
        },
        toTokenMeta: {
            address: RHEA_TOKEN_ID_BSC || XRHEA_TOKEN_ID_BSC,
            symbol: 'RHEA' || 'xRHEA',
            decimals: 18;
            icon: 'https://xxx.com/token/rhea.svg';
        }
    }
 })

Types

interface StakeParams {
    stakeInfo: StakeInfo | {
        from: BridgeModel.BridgeSupportChain;
        to: BridgeModel.BridgeSupportChain;
        fromTokenMeta: TokenMeta | {
            address: string; //  such as RHEA id on BSC
            symbol: string; //such as RHEA、PublicAI
            decimals: number;
            icon: string;
        };
        toTokenMeta: TokenMeta | {
            address: string; // such as RHEA id on NEAR
            symbol: string;
            decimals: number;
            icon: string;
        };
        amountIn: string;
        sender: string;
    };
    waitStakeTokenID: string; // such as RHEA id on NEAR
    stakedXTokenID: string; // such as xRHEA id on NEAR
    nearAccountId: string | ''; // your near accountId 
    signer: Signer; // await window.ethWeb3Provider?.getSigner();
    env?: string; // production 
    rpcUrl?: string; // ex: https://free.rpc.fastnear.com
}



interface UnstakeParams {
    stakeInfo: StakeInfo | {
        from: BridgeModel.BridgeSupportChain;
        to: BridgeModel.BridgeSupportChain;
        fromTokenMeta: TokenMeta | {
            address: string; // such as xRHEA id on BSC
            symbol: string; //such as xRHEA、xPublicAI
            decimals: number;
            icon: string;
        };
        toTokenMeta: TokenMeta | {
            address: string; // such as xRHEA id on NEAR
            symbol: string;
            decimals: number;
            icon: string;
        };
        amountIn: string;
        sender: string;
    };
    waitUnstakeXTokenID: string; // such as xRHEA id on NEAR
    unstakedTokenID: string; // such as RHEA id on NEAR
    nearAccountId: string | ''; // your near accountId
    signer: Signer; // await window.ethWeb3Provider?.getSigner();
    env?: string; // production 
    rpcUrl?: string; // ex: https://free.rpc.fastnear.com
}


interface WithdrawParams {
    stakeInfo: StakeInfo | {
        from: BridgeModel.BridgeSupportChain;
        to: BridgeModel.BridgeSupportChain;
        fromTokenMeta: TokenMeta | {
            address: string; // withdrawTokenIDOnBsc
            symbol: string; 
            decimals: number;
            icon: string;
        };
        toTokenMeta: TokenMeta | {
            address: string; // withdrawTokenIDOnNear
            symbol: string;
            decimals: number;
            icon: string;
        };
        amountIn: string;
        sender: string;
    };
    withdrawTokenIDOnNear: string; // you token id on near
    withdrawTokenIDOnBsc: string; // you token id on bsc
    receiver: string; // your near wallet address
    withdrawBalance: string; // your near account token balance
    evmRpcUrl?: string; // source chain rpc  such as : "https://bsc.drpc.org"  and you can find on chainlist
}