Expand the output buffer from 4 bytes to 32 bytes and iterate all 32 positions, so values ≥ 2³² are encoded correctly instead of silently dropped. Update tests to assert 32-byte output and add coverage for 2³², 2¹²⁸, and max uint256 roundtrips. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 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 | ||
| yarn.lock | ||
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);