@sovryn/perpetual-swap v5.0.4
Usage
Install the package Read the Whitepaper.
$ npm install --save @sovryn/perpetual-swapThen in your script:
import { perpQueries, perpUtils } from "@sovryn/perpetual-swap";
And to use the functions from, let's say, scripts/utils/perpQueries.ts:
const { queryTraderState, queryAMMState, queryPerpParameters } = perpQueries;
The same works for the rest of the files:
const { getMarkPrice } = perpUtils;
- See here the docs for the functions exported by perpUtils.
- See here the docs for the functions exported by perpQueries.
- See here the docs for the functions exported by perpMath.
- See here the docs for the functions exported by walletUtils.
Observation
In order to use walletUtils (only works on the backend. It doesn't work in UI because it needs to read the ABIs from disk) you'll have to import it like this:
import * as walletUtils from '@sovryn/perpetual-swap/dist/scripts/utils/walletUtils';
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago