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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nerdscomputing/rx-elrond

v0.0.7

Published

Rxjs wrapper over the erdjs npm package

Readme

@nerdscomputing/rx-elrond

Rxjs wrapper over the erdjs npm package.

Installation

npm i @nerdscomputing/rx-elrond

Dependencies

Usage

The package exposes an initialization function (called init) which returns an object of type RxElrond that contains all the implemented functionalities.

These functionalities are:

account.get: (input: GetAccountInput) => Observable<Account>

Returns a synchronised Account object based on an account address or mnemonic

account.generateMnemonic: () => Observable<Mnemonic>

Generates a new account mnemonic

transaction.build: (input: TransactionInput) => Observable<Transaction>

Builds and signs a new Transaction based on the given input

transaction.send: (transaction: Transaction) => Observable<SendResponse>

Sends an already signed transaction

transaction.status: (txHash: string) => Observable<TransactionStatus>

Gets the network status of an already sent transaction

The signature of the init function is the following:

init: (network: Network<Gateway>): RxElrond

Exposed types

TransactionInput

Input type used by the transaction.build function. Its declaration is the following:

type TransactionInput = {
    mnemonic: string,
    receiver: string,
    value: number,
    nonce: number,
    data?: any
}

SendResponse

Result type returned by the transaction.send function. Its declaration is the following:

type SendResponse = {
    hash: string,
    transaction: Transaction
}

GetAccountInput

Input type used by the account.get function. Its declaration is the following:

type Input = {
    type: 'address' | 'mnemonic',
    value: string
}

Gateway

Enum type representing the gateway url. Its declaration is the following:

enum Gateway {
    TestNet = 'https://testnet-gateway.elrond.com',
    DevNet = 'https://devnet-gateway.elrond.com',
    MainNet = 'https://gateway.elrond.com'
}

Network

Input type used by the init function to set network parameters. Its declaration is the following:

type Network<GatewayType extends Gateway> = {
    gateway: GatewayType
}

Example

import {mergeMap, tap} from 'rxjs/operators'
import {init, Gateway, TransactionInput} from '@nerdscomputing/rx-elrond'

const {account, transaction} = init({gateway: Gateway.TestNet})

// Get an account object and print it
account.get({type: 'address', value: 'exampleAddress'})
    .pipe(tap(account => console.log(account)))
    .subscribe()

account.get({type: 'mnemonic', value: 'exampleMnemonic'})
    .pipe(tap(account => console.log(account)))
    .subscribe()

// Generate an account mnemonic and print it
account.generateMnemonic()
    .pipe(tap(mnemonic => console.log(mnemonic)))
    .subscribe()

// Build and send a transaction
const input: TransactionInput = {
    mnemonic: 'exampleMnemonic',
    receiver: 'exampleAddress2',
    value: 0,
    nonce: 16,
    data: 'exampleData'
}

transaction.build(input)
    .pipe(mergeMap(transaction.send))
    .pipe(tap(response => console.log('Tx hash is ', response.hash)))
    .subscribe()

// Get a transaction's status

const txHash = 'exampleTransactionHash'

transaction.status(txHash)
    .pipe(tap(status => console.log(status)))
    .subscribe()