1.1.2 • Published 1 year ago

xpop v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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:

Sample to use this script in the browser:

Output

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

NPM, CDN

Example browser implementation:

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:

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)
1.1.1

1 year ago

1.1.0

1 year ago

1.1.2

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago