0.3.0 • Published 6 years ago
@kosu/contract-helpers v0.3.0
Kosu.js
A TypeScript/JavaScript library for interacting with the Kosu contract system and order relay network.
Installation
Kosu.js can be installed into your project through yarn or npm, and can be passed through webpack or browserify for usage in the browser.
Install
Yarn:
yarn add @kosu/kosu.jsNPM:
npm install --save @kosu/kosu.jsImport
Kosu and its exported classes can be imported directly into TypeScript or JavaScript projects.
TypeScript (and ES6+):
// top-level Kosu class
import { Kosu } from "@kosu/kosu.js";
// directly access exported classes/utilities
import {
// contract wrapper classes
KosuToken,
OrderGateway,
PosterRegistry,
Treasury,
ValidatorRegistry,
Voting,
// utils/classes and constants
OrderSerializer,
OrderHelper,
Signature,
toBytes32
NULL_ADDRESS,
} from "@kosu/kosu.js";JavaScript (CommonJS):
const { Kosu } = require("@kosu/kosu.js");
const {
KosuToken,
OrderGateway,
PosterRegistry,
Treasury,
ValidatorRegistry,
Voting,
OrderSerializer,
OrderHelper,
Signature,
toBytes32
NULL_ADDRESS,
} = require("@kosu/kosu.js");Development
@todo: add contribution guidelines summary and linkLinting
The TypeScript source can be linted with:
yarn lintBuilding
Build the TypeScript source to distributable JavaScript (CommonJS) as well as source mappings and typing files with:
yarn buildLicense
Open-source software, MIT licensed.
Copyright (c) 2019 Paradigm Labs, corp.
0.3.0
6 years ago