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

@xchainjs/xchain-near

v0.3.0

Published

NEAR Protocol client for XChainJS

Readme

@xchainjs/xchain-near

Custom client for communicating with the NEAR Protocol blockchain using near-api-js.

Installation

yarn add @xchainjs/xchain-near

Peer / workspace dependencies:

yarn add @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-util

Features (v0.3)

  • Implicit account addresses from a BIP39 phrase (SLIP-0010 ed25519, path m/44'/397'/{index}')
  • Native NEAR balance, fees, transfer, prepare/broadcast
  • NEP-141 fungible token balances and transfers (with NEP-145 storage_deposit when needed)
  • Transaction history and hash lookup via NearBlocks
  • JSON-RPC failover across public providers (FastNear, etc.)

Not included yet: Ledger signing, named-account creation, automatic FT discovery (pass assets to getBalance).

Address model

getAddressAsync() returns an implicit account id (64-char lowercase hex of the ed25519 public key). Recipients may be implicit or named (alice.near); validateAddress accepts both.

Sync getAddress() throws — use getAddressAsync.

Memos are not supported on native transfers and throw if provided. NEP-141 transfers may pass memo through to ft_transfer.

Usage

import { Network } from '@xchainjs/xchain-client'
import { assetToBase, assetAmount, assetFromStringEx, TokenAsset } from '@xchainjs/xchain-util'
import { Client, defaultNearParams, NEARAsset } from '@xchainjs/xchain-near'

const client = new Client({
  ...defaultNearParams,
  network: Network.Mainnet,
  phrase: 'your twelve or twenty four word mnemonic …',
})

const address = await client.getAddressAsync()
const usdc = assetFromStringEx(
  'NEAR.USDC-17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1',
) as TokenAsset

// Native only when assets omitted; pass TokenAssets for NEP-141 balances.
const balances = await client.getBalance(address, [usdc])

const txHash = await client.transfer({
  recipient: 'alice.near',
  amount: assetToBase(assetAmount(0.1, 24)),
  asset: NEARAsset,
})

// NEP-141 transfer (auto storage_deposit if receiver is unregistered)
await client.transfer({
  recipient: 'bob.near',
  amount: assetToBase(assetAmount(1, 6)),
  asset: usdc,
})

Network / RPC

Default public RPCs (override with clientUrls):

| Network | Defaults | | ------- | -------- | | Mainnet | https://free.rpc.fastnear.com, https://near.drpc.org, https://1rpc.io/near | | Testnet | https://test.rpc.fastnear.com, https://near-testnet.drpc.org |

History uses NearBlocks (nearblocksUrls / optional nearblocksApiKey).

Public endpoints are rate-limited — production apps should use dedicated providers.

Documentation