asekuro-js
TypeScript icon, indicating that this package has built-in type declarations

0.1.11 • Public • Published

Asekurojs

A TypeScript library for interacting with the Asekuro protocol

Installing

The latest version 0.1.7 is published to npm:

npm i asekuro-js

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import Asekuro from 'asekuro-js'

Usage

Create a Asekuro Config object containing addresses of deployed contracts. The easiest way to do this is by using a contract's Truffle artifact:

const networkId = await promisify(this.state.web3.version.getNetwork)();
 
const asekuroConfig = {
    policyRegistryAddress: PolicyRegistry.networks[networkId].address
}

Then instantiate the asekuro library by passing in a web3 provider and the Asekuro Config:

const asekuro = new Asekuro(this.web3.currentProvider, asekuroConfig);

Additionally, you can import the transpiled modules from dist/lib in case you have a modular library:

import something from 'mylib/dist/lib/something'

To reference a specific Type:

import { ApplicationOrder } from 'asekuro-js/dist/lib/types';

NPM scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)

Readme

Keywords

none

Package Sidebar

Install

npm i asekuro-js

Weekly Downloads

12

Version

0.1.11

License

MIT

Unpacked Size

3.06 MB

Total Files

80

Last publish

Collaborators

  • tyndallm