Replace truthiness guard with Number.isFinite() so NaN and Infinity are explicitly rejected rather than silently masked. Zero is now handled by toLocaleString, which returns '0' correctly. Add test cases for NaN and Infinity. |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| .lintstagedrc.json | ||
| .prettierignore | ||
| .prettierrc | ||
| AGENTS.md | ||
| codegen.yml | ||
| eslint.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
Test
yarn test
Import
yarn add kraiken-lib
then
import { bytesToUint256LittleEndian, uint256ToBytesLittleEndian } from "kraiken-lib/subgraph";
uint256ToBytesLittleEndian(3n);
get Snatch List
import { getSnatchList } from "kraiken-lib/snatch";
const positionIds = getSnatchList(positions, neededShares, maxTaxRateDecimal, stakeTotalSupply);