UNPKG

@alcorexchange/alcor-swap-sdk

Version:

## Installation ​​ **npm** ``` npm i @alcorexchange/alcor-swap-sdk ``` **yarn** ``` yarn add @alcorexchange/alcor-swap-sdk ``` ## Usage ### Import:

32 lines (29 loc) 855 B
import JSBI from "jsbi"; import { PositionLibrary } from "utils/positionLibrary"; import { ZERO } from "internalConstants"; describe("PositionLibrary", () => { describe("#getTokensOwed", () => { it("0", () => { const [tokensOwed0, tokensOwed1] = PositionLibrary.getTokensOwed( ZERO, ZERO, ZERO, ZERO, ZERO ); expect(tokensOwed0).toEqual(ZERO); expect(tokensOwed1).toEqual(ZERO); }); it("non-0", () => { const [tokensOwed0, tokensOwed1] = PositionLibrary.getTokensOwed( ZERO, ZERO, JSBI.BigInt(1), JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(64)), JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(64)) ); expect(tokensOwed0).toEqual(JSBI.BigInt(1)); expect(tokensOwed1).toEqual(JSBI.BigInt(1)); }); }); });