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

near-ca

v0.12.1

Published

An SDK for controlling Ethereum Accounts from a Near Account.

Readme

NEAR Chain Abstraction Layer (NEAR-CA)

NEAR-CA is a TypeScript library designed to provide an abstraction layer for interacting with the NEAR blockchain, simplifying the process of performing transactions and managing accounts on both NEAR and Ethereum chains. This library is intended for use in server-side applications only.

Features

  • EVM Account Derivation from NEAR blockchain.
  • Transaction signing and sending on the Ethereum blockchain.
  • Key derivation functions for cryptographic operations.
  • Support for EIP-1559 transactions on Ethereum.
  • Wallet Connect intergration tools.

Usage

CLI

For Ethereum, you can derive addresses, create payloads for transactions, and send signed transactions.

For more detailed usage examples, see the Examples README.

Integrations

near-safe extends this tool kit by using the EOA as an owner of an ERC-4337 Safe account.

Frontend/UI

Install near-ca, run the following command:

yarn add near-ca

Example: Setup NearEthAdapter and Send ETH

Here's an example of how to set up the NearEthAdapter and send ETH:

import dotenv from "dotenv";
import {
  broadcastSignedTransaction,
  convertToAction,
  isRlpHex,
  setupAdapter,
  signatureFromOutcome,
} from "near-ca";

dotenv.config();
const { NEAR_ACCOUNT_ID, NEAR_ACCOUNT_PRIVATE_KEY } = process.env;

const adapter = await setupAdapter({
  accountId: NEAR_ACCOUNT_ID!,
  mpcContractId: MPC_CONTRACT_ID!,
  // privateKey: NEAR_ACCOUNT_PRIVATE_KEY!, // Optional depending on setup
});

const {
  evmMessage,
  nearPayload: { receiverId, actions },
} = await evm.encodeSignRequest({
  method: "eth_sendTransaction",
  chainId: 11_155_111, // Sepolia
  params: [
    {
      from: evm.address,
      to: "0xdeADBeeF0000000000000000000000000b00B1e5",
      value: "0x01", // 1 WEI
      // data: "0x", // Optional
    },
  ],
});
console.log(`Requesting Signature for ${evmMessage}`);
// Using your near Account, send the nearPaylod as signature request:
const nearAccount = adapter.nearAccount();
//
const outtcome = await nearAccount.signAndSendTransaction({
  receiverId,
  actions: actions.map((a) => convertToAction(a)),
});
const signature = signatureFromOutcome(outtcome);
console.log("Signature aquired!");
if (isRlpHex(evmMessage)) {
  // This will be true for what we built above.
  broadcastSignedTransaction({ transaction: evmMessage, signature });
} else {
  // Use Signature for whatever else.
}

Other Examples (CLI)

These examples require Private Key to be supplied:

Each of the following scripts can be run with

npx tsx examples/*.ts
  1. (Basic) Send ETH
  2. WETH
  3. Transfer ERC721
  4. (Advanced) Buy NFT On Opensea

Configuration

Before using NEAR-CA, ensure you have the following environment variables set in your .env file:

  • NEAR_ACCOUNT_ID: Your NEAR account identifier.
  • NEAR_ACCOUNT_PRIVATE_KEY: Your NEAR account private key.
  • MPC_CONTRACT_ID: The NEAR contract that handles multichain operations.
  • NETWORK: Either near or testnet.

Copy the .env.example file and add these values to the .env file.

Steps to get your NEAR_ACCOUNT_ID and NEAR_ACCOUNT_PRIVATE_KEY:

  1. Create a Near wallet address, super easy, here: https://wallet.bitte.ai/
  2. Your XYZ.near is your NEAR_ACCOUNT_ID.
  3. Visit Settings Page
  4. Go to "Security & Recovery" -> "Export Account".
  5. After the exporting is complete click on "Private Key" and copy it.
  6. Paste it to NEAR_ACCOUNT_PRIVATE_KEY in your .env file.