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:
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 ; const asekuroConfig = policyRegistryAddress: PolicyRegistrynetworksnetworkIdaddress
Then instantiate the asekuro library by passing in a web3 provider and the Asekuro Config:
const asekuro = thisweb3currentProvider asekuroConfig;
Additionally, you can import the transpiled modules from dist/lib
in case you have a modular library:
To reference a specific Type:
;
NPM scripts
npm t
: Run test suitenpm start
: Runnpm run build
in watch modenpm run test:watch
: Run test suite in interactive watch modenpm run test:prod
: Run linting and generate coveragenpm run build
: Generate bundles and typings, create docsnpm run lint
: Lints codenpm run commit
: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)