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 🙏

© 2024 – Pkg Stats / Ryan Hefner

murray-js

v1.1.0

Published

Open APIs to easily integrate your projects with the Bitcoin ecosystem.

Downloads

26

Readme

npm version License: MIT

Murray JS

Murray JS is a comprehensive NPM package module designed for seamless integration with Murray Rothbot's suite of APIs, including Blockchain, Lightning, and Prices. This powerful library enables developers to quickly incorporate bitcoin data and interactions within their applications.

Installation

To get started, install the package using either npm or yarn:

# npm
npm install murray-js

# yarn
yarn add murray-js

Usage

After installation, import murray-js into your project to access the various APIs.

Blockchain API

import Murray from "murray-js";

const blockchainExample = async () => {
  const murray = new Murray();

  try {
    const fees = await murray.blockchain.getFees();
    console.log(fees);

    const block = await murray.blockchain.getBlock({ height: 500000 });
    console.log(block);

    const blockTime = await murray.blockchain.getBlock2time({ height: 500000 });
    console.log(blockTime);

    const addressDetails = await murray.blockchain.getAddressDetails({
      address: "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX",
    });
    console.log(addressDetails);
  } catch (error) {
    console.error(error);
  }
};

blockchainExample();

Lightning API

import Murray from "murray-js";

const lightningExample = async () => {
  const murray = new Murray();

  try {
    const nodeDetails = await murray.lightning.getNodeDetails({
      publicKey:
        "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f",
    });
    console.log(nodeDetails);

    const statistics = await murray.lightning.getStatistics();
    console.log(statistics);

    const topNodes = await murray.lightning.getTopNodes();
    console.log(topNodes);
  } catch (error) {
    console.error(error);
  }
};

lightningExample();

Prices API

import Murray from "murray-js";

const pricesExample = async () => {
  const murray = new Murray();

  try {
    const ticker = await murray.prices.getTicker({ symbol: "BTCUSD" });
    console.log(ticker);

    const tickers = await murray.prices.getTickers({ symbol: "BTCUSD" });
    console.log(tickers);

    const currencyConversion = await murray.prices.convertCurrency({
      currency: "USD",
      value: 100,
    });
    console.log(currencyConversion);
  } catch (error) {
    console.error(error);
  }
};

pricesExample();

Custom Endpoints

Customize endpoints for each API to suit your specific needs:

import Murray from "murray-js";

const murray = new Murray({
  blockchainEndpoint: "https://your-custom-domain.com/",
  pricesEndpoint: "https://your-custom-domain.com/",
  lightningEndpoint: "https://your-custom-domain.com/",
});

const response = await murray.blockchain.getFees();
console.log(response);

Examples

Find more examples in the repository to guide your implementation:

Self Hosted APIs

Leverage your self-hosted APIs for enhanced control and customization:

Contributing

We welcome contributions! For significant changes or enhancements, please open an issue first to discuss your ideas.

License

Murray JS is open-sourced software licensed under the MIT license.