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

@moonstake/moonstakejs

v1.4.0

Published

Library for staking to Moonstake

Downloads

28

Readme

Introduction

This SDK is implemented to support developers quickly integrate with Moonstake system. The Moonstake is a great staking pool which supports individual users, Moonstake partners and exchanges to stake and earn blockchain rewards.

In the this release, the SDK only supports the following platforms

  • Cardano ADA
  • Tezos

How to use SDK

  • First of all, you should register to Moonstake system to become a partner and get staking information such as staking memo and Infinito Blockchain Platform API token. Infinito Blockchain Platform (IBP) is a platform support integrate with multi Blockchain networks by one interface.

  • After getting enough necessary information from the Moonstake, you can follow example in this SDK to familiar with staking process.

Structure of SDK

  • The SDK contains two main modules:
    • Firstly, a wallet module manages blockchain key pairs, create transaction raw, sign transaction.
    • To collect data for transaction creation and broadcast transaction, you can use API module. At the first time, this SDK only uses IBP and will be integrated more different providers in future.

Staking flow

  • Get staking info
  • Make staking blockchain transaction
  • Make a tracking voting request to Moonstake in order to remark

Examples

  • Developer can see many examples how to use SDK on examples folder.

  • Configure API keys

const { wallet } = require('@moonstake/moonstakejs');

// https://platform.infinito.io/
const ipbConfig = {
  apiKey: '<-- YOUR INFINITO BLOCKCHAIN PLATFORM API KEY -->',
  secret: '<-- YOUR INFINITO BLOCKCHAIN PLATFORM SECRET KEY -->'
};

// https://moonstake.io/
const moonstakeConfig = {
  apiKey: '<-- YOUR MOONSTAKE API KEY -->',
  secret: '<-- YOUR MOONSTAKE SECRET KEY -->'
};
  • Example for ADA staking
async function main () {
    // Initialize wallet
    let adaWallet = new wallet.ADA({
        mnemonic: '<-- YOUR MNEMONIC -->'
    });

    // Initialize IBP api
    adaWallet.initIBPApi(ipbConfig);
    // Initialize Moonstake api
    adaWallet.initMoonstakeApi(moonstakeConfig);

    // Set memo
    adaWallet.setMemo('<-- YOUR PARTNER MEMO -->');

    // Create and send staking transaction
    await adaWallet.createAndSendStakingTx();

    // Create and send claiming reward transaction
    await adaWallet.createAndSendClaimRewardTx();
}

main().catch(console.error).finally(() => process.exit());
  • Example for TEZOS staking
async function main () {
  // Initialize wallet
  let xtzWallet = new wallet.XTZ({
    mnemonic: '<-- YOUR MNEMONIC -->'
  });
  await xtzWallet.createKeyStore();

  // Initialize Conseil api
  xtzWallet.initApi({
    conseilUrl: '<-- YOUR CONSEIL URL -->', // Default is https://conseil-prod.cryptonomic-infra.tech
    conseilApiKey: '<-- YOUR CONSEIL API KEY -->', // Get api key from https://nautilus.cloud/
    conseilNetwork: '<-- YOUR NETWORK -->', // Default is mainnet
    tezosNode: '<-- YOUR TEZOS NODE -->' // Default is https://tezos-prod.cryptonomic-infra.tech
  });
  // Initialize Moonstake api
  xtzWallet.initMoonstakeApi(moonstakeConfig);

  // Set memo
  xtzWallet.setMemo('<-- YOUR PARTNER MEMO -->');

  // Create and send staking transaction
  await xtzWallet.sendAndDelegateTx();
}

main().catch(console.error).finally(() => process.exit());

API References

  • Please run the following command in project folder to generate API references by jsdoc.
npm run jsdoc

Security overview

Within the usage context of the SDK, there are two sensitive assets that need to be secured: wallet private keys and API secret keys. Leaking the private keys could lead to clients’ assets being stolen. Meanwhile, leaking the API secret keys will not impact the clients’ assets, but the privacy of the exchange. For instance, unauthorized access to the API secret keys could leak the staking information details.

To secure the wallet private keys, the SDK performs transaction signing at the caller side (e.g., the exchange servers). There is no transmission of private keys to Moonstake’s server or elsewhere. Assuming that the exchanges’ servers are secure, it is almost impossible for private keys being stolen via the SDK usage..

To secure the API secret keys, the connection between the caller side and Moonstake system is secured by the SSL (using https protocol), which is assumed to be secure at the time of writing). Under that assumption, the API secret keys are secured.

An additional security layer could be applied at the Moonstake system to reinforce the security of the API secret keys. This is to whitelist IP addresses for particular API secret keys. In other words, API calls associated with particular secret keys should originate from pre-registered IP(s).