Zap Curve
npm install @zapjs/curveThis package contains objects that can parse the custom Zap bonding curve encoding used by Zap oracles. This package also enables calculations of Dot prices on a given bonding curve.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes
What things you need to install the software and how to install them
```
- Node 12.20 <=14.15
- Lerna
``
npm i
- Bootstrap lerna
``
lerna bootstrap
- Running build for all packages
``
lerna run build
- Running mocha unit tests for all packages
``
lerna run test
- Develop in single package
``
cd packages/{package_name}
npm run build
npm run test
- Running build and test
``
npm run run_testPackages
npm install @zapjs/provider
`
`
import {ZapProvider, ProviderHandler} from '@zapjs/provider';class myHandler implements ProviderHander{
handleIncoming(res:any){
}
handleSubscription(res:any) {
}
handleUnsubscription (res:string){
}
}
`
`
let myZapProvider = new ZapProvider({owner:address,handler:new myHandler()})
await myZapProvider.initiateProvider({
public_key:111,
title: "testTitle",
endpoint: "testEndpoint",
endpoint_params : ["p1","p2"]
})
const thisConstants = []
const thisParts = []
const thisDividers = []
await myZapProvider.initiateProviderCurve({
endpoint :"testEndpoint",
constants : thisConstants,
parts : thisParts,
dividers : thisDividers
})
``Please read [CONTRIBUTING.md]() for details on our code of conduct, and the process for submitting pull requests to us.
See also the list of contributors
This project is licensed under the MIT License - see the LICENSE.md file for details