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

omp-lib

v0.1.153

Published

Particl OMP-library

Downloads

405

Readme

OPEN MARKET PROTOCOL

The reference implementation for the Open Market Protocol

Note: the documentation is very outdated for the private message format.

MPA FUNCTIONS

* build(..MPA_*):  rebuilds the transaction for a given and spits outs the rawtx.
* validate(MPA_*): validate that a marketplace action conforms to the protocol.
* verify(..MPA_*): verifies a _chain_ of MarketPlaceActions.
* strip(MPA_*):  strip any fields that do not belong in the protocol (simple: delete all that start with "_").

* create(MPA_LISTING_ADD): returns MPA_BID.
* accept(MPA_LISTING_ADD, MPA_BID): returns MPA_ACCEPT (partially signed destruction tx, partially signed release tx).
* lock(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT): make this also create the release tx. returns MPA_LOCK. (signed destruction tx, partially signed bix txn)
* complete(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT, MPA_LOCK): returns a fully signed bid rawtx for the seller.
* release(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT, MPA_LOCK): returns a fully signed release rawtx for the buyer.
* refund(MPA_LISTING_ADD, MPA_BID, MPA_ACCEPT, MPA_LOCK): returns a fully signed refund rawtx for the seller.

Format validators

The format validators can be found in the src/format-validators directory. These purely validate:

  • required fields
  • the right types (string, number, ..)
  • non-negative fields

Sequence verifiers

The sequence verifiers can be found in the src/sequence-verifiers directory. These purely verify that the provide sequence of actions is correct:

  • validate format of action first
  • check the sequence to verify that the order is correct (e.g. no bids before listing)
  • verify that the sequence linked by the hashes is correct
  • verify that the cryptocurrency in the bid is allowed in the listing
  • verify that the escrow type over the sequence doesn't change

Deterministic transaction generation

Given a sequence of MPA's (marketplace actions), the resulting transaction generated by this library should be identical, byte-for-byte. The library rebuilds the transactions and stores a state of (potentially incomplete) transactions in the private fields of a message.

Private fields

Additional fields can be supplied by the database with an "_", these should be stripped out using strip(). We only use these when building transactions.

Testing

Run the test environment by running: python3 particl-test-env.py

Then run the test with: yarn test