omp-lib
Particl OMP-library
Last updated 22 days ago by ludx .
MIT · Original npm · Tarball · package.json
$ cnpm install omp-lib 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.139                                ...           latest (22 days ago)

148 Versions

  • 0.1.139                                ...           22 days ago
  • 0.1.138                                ...           a month ago
  • 0.1.137                                ...           a month ago
  • 0.1.135                                ...           2 months ago
  • 0.1.134                                ...           2 months ago
  • 0.1.133                                ...           2 months ago
  • 0.1.132                                ...           3 months ago
  • 0.1.131                                ...           4 months ago
  • 0.1.130                                ...           4 months ago
  • 0.1.129                                ...           4 months ago
  • 0.1.128                                ...           7 months ago
  • 0.1.127                                ...           7 months ago
  • 0.1.126                                ...           7 months ago
  • 0.1.125                                ...           8 months ago
  • 0.1.124                                ...           8 months ago
  • 0.1.123                                ...           9 months ago
  • 0.1.122                                ...           10 months ago
  • 0.1.121                                ...           10 months ago
  • 0.1.120                                ...           10 months ago
  • 0.1.119                                ...           10 months ago
  • 0.1.118                                ...           10 months ago
  • 0.1.117                                ...           10 months ago
  • 0.1.116                                ...           10 months ago
  • 0.1.115                                ...           10 months ago
  • 0.1.114                                ...           a year ago
  • 0.1.113                                ...           a year ago
  • 0.1.112                                ...           a year ago
  • 0.1.111                                ...           a year ago
  • 0.1.110                                ...           a year ago
  • 0.1.109                                ...           a year ago
  • 0.1.108                                ...           a year ago
  • 0.1.107                                ...           a year ago
  • 0.1.106                                ...           a year ago
  • 0.1.105                                ...           a year ago
  • 0.1.104                                ...           a year ago
  • 0.1.103                                ...           a year ago
  • 0.1.102                                ...           a year ago
  • 0.1.101                                ...           a year ago
  • 0.1.100                                ...           a year ago
  • 0.1.99                                ...           a year ago
  • 0.1.98                                ...           a year ago
  • 0.0.97                                ...           a year ago
  • 0.1.96                                ...           a year ago
  • 0.1.95                                ...           a year ago
  • 0.1.94                                ...           a year ago
  • 0.1.93                                ...           a year ago
  • 0.1.92                                ...           a year ago
  • 0.1.91                                ...           a year ago
  • 0.1.90                                ...           a year ago
  • 0.1.89                                ...           a year ago
  • 0.1.88                                ...           a year ago
  • 0.1.87                                ...           a year ago
  • 0.1.86                                ...           a year ago
  • 0.1.85                                ...           a year ago
  • 0.1.84                                ...           a year ago
  • 0.1.83                                ...           a year ago
  • 0.1.82                                ...           a year ago
  • 0.1.81                                ...           a year ago
  • 0.1.80                                ...           a year ago
  • 0.1.79                                ...           a year ago
  • 0.1.78                                ...           a year ago
  • 0.1.77                                ...           a year ago
  • 0.1.76                                ...           a year ago
  • 0.1.75                                ...           a year ago
  • 0.1.74                                ...           a year ago
  • 0.1.73                                ...           a year ago
  • 0.1.72                                ...           a year ago
  • 0.1.71                                ...           a year ago
  • 0.1.70                                ...           a year ago
  • 0.1.69                                ...           a year ago
  • 0.1.68                                ...           a year ago
  • 0.1.67                                ...           a year ago
  • 0.1.66                                ...           a year ago
  • 0.1.65                                ...           a year ago
  • 0.1.64                                ...           a year ago
  • 0.1.63                                ...           a year ago
  • 0.1.62                                ...           a year ago
  • 0.1.61                                ...           a year ago
  • 0.1.60                                ...           a year ago
  • 0.1.59                                ...           a year ago
  • 0.1.58                                ...           a year ago
  • 0.1.57                                ...           a year ago
  • 0.1.56                                ...           a year ago
  • 0.1.55                                ...           a year ago
  • 0.1.54                                ...           a year ago
  • 0.1.53                                ...           a year ago
  • 0.1.52                                ...           a year ago
  • 0.1.51                                ...           a year ago
  • 0.1.50                                ...           a year ago
  • 0.1.49                                ...           a year ago
  • 0.1.48                                ...           a year ago
  • 0.1.47                                ...           a year ago
  • 0.1.46                                ...           a year ago
  • 0.1.45                                ...           a year ago
  • 0.1.44                                ...           a year ago
  • 0.1.43                                ...           a year ago
  • 0.1.42                                ...           a year ago
  • 0.1.41                                ...           a year ago
  • 0.1.40                                ...           a year ago
  • 0.1.39                                ...           a year ago
  • 0.1.38                                ...           a year ago
  • 0.1.37                                ...           a year ago
  • 0.1.36                                ...           a year ago
  • 0.1.35                                ...           a year ago
  • 0.1.34                                ...           a year ago
  • 0.1.33                                ...           a year ago
  • 0.1.32                                ...           a year ago
  • 0.1.31                                ...           a year ago
  • 0.1.30                                ...           a year ago
  • 0.1.29                                ...           a year ago
  • 0.1.28                                ...           a year ago
  • 0.1.27                                ...           a year ago
  • 0.1.26                                ...           2 years ago
  • 0.1.25                                ...           2 years ago
  • 0.1.24                                ...           2 years ago
  • 0.1.23                                ...           2 years ago
  • 0.1.22                                ...           2 years ago
  • 0.1.21                                ...           2 years ago
  • 0.1.20                                ...           2 years ago
  • 0.1.19                                ...           2 years ago
  • 0.1.18                                ...           2 years ago
  • 0.1.17                                ...           2 years ago
  • 0.1.16                                ...           2 years ago
  • 0.1.15                                ...           2 years ago
  • 0.1.14                                ...           2 years ago
  • 0.1.13                                ...           2 years ago
  • 0.1.12                                ...           2 years ago
  • 0.1.11                                ...           2 years ago
  • 0.1.10                                ...           2 years ago
  • 0.1.9                                ...           2 years ago
  • 0.1.8                                ...           2 years ago
  • 0.1.7                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.10.1                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 344
Dependencies (9)
Dev Dependencies (16)

Copyright 2014 - 2016 © taobao.org |