Package Exports
- origin
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (origin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme

origin-js
origin-js is a library of javascript code and Ethereum smart contracts which allow anyone to create decentralized marketplaces, including for fractional usage. It is an open source project created by Origin Protocol.
To learn more about Origin Protocol, please read our product brief and whitepaper for a high-level description of what we're building and why it matters. Our official website is https://www.originprotocol.com.
⚠️ This is an alpha version which is not suitable for production environments.
Documentation
Demo
origin-js is showcased in our Demo DApp currently running on the Rinkeby testnet.
Using origin-js in your project
As a node package
npm install origin --saveor
yarn add originPlain javascript
A browser-compatible plain javascript file origin.js is available in the Releases section. A hosted version can be directly included in your html as:
<script src="https://code.originprotocol.com/origin-js/origin-v0.5.10.js"></script>npm build will generate this file and save it to dist/origin.js.
Local development
1. Clone this repo.
git clone https://github.com/OriginProtocol/origin-js.git && cd origin-jsIf you would like to submit pull requests, you should instead fork this repo and then clone your fork. Note pull requests should always be made to the develop branch, which always has the latest commits.
2. Install dependencies and link
npm run install:devinstall:dev is shortcut for npm install && npm link. Linking means that changes to origin-js code are immediately available to local DApps without an npm install.
3. Start the local blockchain and build origin-js
npm startCode changes will trigger a live rebuild.
4. Use with local Demo DApp
To interact with your local origin-js and local blockahin, see the instructions in our Demo DApp.
Tests
Command Line (All Tests)
Our full test suite can be run with:
npm run testNote: you should not have the server running at this time, as these tests start their own local blockchain instance.
Command Line (Only Solidity Tests)
Our Solidity tests (which use Truffle) are located at contracts/test.
npm run test:contractsNote: you should not have the server running at this time, as these tests start their own local blockchain instance.
Browser Tests
A subset of our tests can be run from the browser. These tests are automatically served at http://localhost:8081 when you run npm start. These tests are automatically rerun when source or test code is changed.
Run a subset of these tests using the grep query string parameter, for example: http://localhost:8081/?grep=IpfsService
Troubleshooting
Python 3
If you have Python 3 installed, you may see this error when installing dependencies:
gyp ERR! stack Error: Python executable "/Users/aiham/.pyenv/shims/python" is v3.6.4, which is not supported by gyp.Resolve this by configuring npm to use Python 2 (where python2.7 is a binary accessible from your $PATH):
npm config set python python2.7Contributing
Origin is an 100% open-source and community-driven project and we welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community.
To get involved, please join our Discord channel and review our guide to contributing.