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

xpop

v1.1.2

Published

Generate xPOP based on source data (ledger, tx, validations)

Downloads

16

Readme

XPOP Fetching / Generation npm version

This lib. fetches a ready to use xPOP, fetches and encodes a JSON xPOP or even generates the entire xPOP based on sources running the xPOP source data service: "Validation Ledger & Transaction Store"

Methods to retrieve/generate, in order (unless params provided, see below):

  1. Fetch ready to use HEX XPOP
  2. Fetch JSON XPOP and encode to HEX
  3. Fetch source files & compile XPOP & encode to HEX

Samples

Sample to generate & submit a B2M transaction on Testnet, resulting in an xPOP:

  • https://gist.github.com/WietseWind/cd8a7a8c88f218fe7b768f59a665685d

Sample to use this script in the browser:

  • https://jsfiddle.net/WietseWind/42kpm0hr/

Output

null (failed) or HEX encoded XPOP ready to use for import in the Blob field.

NPM, CDN

  • NPM (backend): https://www.npmjs.com/package/xpop
  • CDN (browser): https://cdn.jsdelivr.net/npm/xpop/browser.min.js

Example browser implementation:

  • https://jsfiddle.net/WietseWind/42kpm0hr/

Methods

  • setVerbose(bool) » console.log verbose info if true
  • setEndpoints(string[]) » [ Mandatory ] - the URLs where the collector is running
  • xpop(tx hash [, ledger index, network id, force ])

JS/Browser

Note: a list of recent endpoints can be found here:

  • https://xrpl.ws-stats.com/xpop/list
  • https://xrpl.ws-stats.com/xpop/list?json=true (see auto-fill example below)
const {setVerbose, setEndpoints, xpop} = require('xpop')

// setVerbose(true)
// setEndpoints((await (await fetch('https://xrpl.ws-stats.com/xpop/list?json=true')).json()).bestguess)

setEndpoints([
  'https://xpop.xrplwin.com/',  // Twitter: @XRPLWin
  'http://xpop.katczynski.org', // Twitter: @realkatczynski
  'https://xpop.xrpl-labs.com', // Twitter: @XRPLLabs
])

xpop('20D193C6E615D86BCC13A5DAB781852A6672F3E627D33FBAE62053F1178740BB', 41815218, 1, true)
  .then(console.log)

Pre-generated XPOP only:

// tx hash
xpop('20D193C6E615D86BCC13A5DAB781852A6672F3E627D33FBAE62053F1178740BB')

Pre-generated XPOP with fallback to pre-generated JSON

// tx hash, ledger index, network id
xpop('20D193C6E615D86BCC13A5DAB781852A6672F3E627D33FBAE62053F1178740BB', 41815218, 1)

Forced pre-generated / client side generated (fallback) JSON

// tx hash, ledger index, network id, true (force)
xpop('20D193C6E615D86BCC13A5DAB781852A6672F3E627D33FBAE62053F1178740BB', 41815218, 1, true)