Extract shared Uniswap ABIs (WETH_ABI, SWAP_ROUTER_ABI, UNISWAP_FACTORY_ABI,
UNISWAP_POOL_ABI), utility functions (isRecord, coerceString, getErrorMessage,
ensureAddress), and the wrap→approve→exactInputSingle flow into a new composable
useSwapKrk(). Both LocalSwapWidget and CheatsView now delegate to this single
source of truth, so swap logic changes only need to be made in one place.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- LocalSwapWidget: move useWallet() to top-level <script setup> (was
incorrectly called inside async buyKrk() event handler)
- LocalSwapWidget + CheatsView: fix misleading toast — all transactions
are fully confirmed at that point, so say 'Swap complete' not 'Swap
submitted'
- LocalSwapWidget: add $KRK sigil to warning/hint text for consistency
with GetKrkView
- LocalSwapWidget: add comment on amountOutMinimum: 0n explaining it is
intentional for a no-MEV local anvil environment
- CheatsView: apply same useWallet() fix (pre-existing anti-pattern)
- docs/ENVIRONMENT.md: document VITE_ENABLE_LOCAL_SWAP and related
VITE_ variables in a new webapp env-var table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `VITE_ENABLE_LOCAL_SWAP` env var to config.ts (defaults false)
- Create LocalSwapWidget.vue: inline ETH→KRK swap (wrap→approve→exactInputSingle)
- GetKrkView.vue: show LocalSwapWidget when VITE_ENABLE_LOCAL_SWAP=true, Uniswap link otherwise
- docker-compose.yml: set VITE_ENABLE_LOCAL_SWAP=true for webapp service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove redundant `node_modules/` entries from sub-directory .gitignore
files. The root `.gitignore` already has `**/node_modules/` which covers
all nested directories, making these per-package entries unnecessary.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- landing/eslint.config.js: ban imports from web-app paths (rule 1),
direct RPC clients from viem/@wagmi/vue (rule 2), and axios (rule 4)
- web-app/eslint.config.js: ban string interpolation inside GraphQL
query/mutation property values (rule 3); fixes 4 pre-existing violations
in usePositionDashboard, usePositions, useSnatchNotifications,
useWalletDashboard by migrating to variables: {} pattern
- services/ponder/eslint.config.js: ban findMany() calls that lack a
limit parameter to prevent unbounded indexed-data growth (rule 5)
All error messages follow the [what is wrong][rule][how to fix][where to
read more] template so agents and humans fix on the first try.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add trailing slash to node_modules entries in sub-package .gitignore
files so they match only directories, not files named node_modules.
The root .gitignore already uses **/node_modules/ (fixed in #203);
these per-package entries were also missing the slash.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ambiguous .collapsed-body.history CSS selector with a
component-specific .history-body class in CollapseHistory.vue.
The old compound class shared a name with collapse.sass rules
(.collapsed-body.history { flex-direction: row }) and reviewers
could not confirm the selector matched. The new class is unique
to CollapseHistory, making the flex-column layout and purple
router-link colour unambiguous.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract relativeTime and formatTokenAmount to helper.ts, eliminating
duplicated logic between CollapseHistory and NotificationBell
- Use formatUnits (via formatTokenAmount) instead of Number(BigInt)/1e18
to avoid precision loss on large token amounts
- Fix allRecentSnatches emptying after mark-seen: now runs two parallel
queries — one filtered by lastSeen timestamp (unseen badge count) and
one unfiltered (panel history), so history is preserved after opening
- Remove dead no-op watch block from useSnatchNotifications
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements window.__testHelpers.fillStakeForm() to enable stable E2E testing
of the staking form without fragile UI selectors.
## Changes
- Add window.__testHelpers interface (dev mode only)
- Implement fillStakeForm() in StakeHolder.vue with input validation
- Add TypeScript declarations in env.d.ts
- Update E2E test to use helper and verify full user journey
- Create INTEGRATION_TEST_STATUS.md documenting test coverage
- Document helper in web-app/README.md
## Test Coverage
Playwright E2E now validates complete flow:
- Mint ETH via cheats page UI
- Swap KRK via cheats page UI
- Stake KRK via stake page UI (helper + click)
- Verify position via GraphQL
Both Playwright and verify-swap.sh tests now work independently.
resolves#62
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/66
## Summary
- add a useSnatchSelection composable that centralises snatch shortfall calculations, position filtering, and RPC memoisation
- refactor StakeHolder.vue to consume the composable instead of reimplementing the flow inline
- introduce Vitest config and first composable tests (useSnatchSelection.spec.ts) to cover empty/partial fills and ownership edge cases
- wire up project tooling updates so the new tests run (jsdom dep, updated package metadata)
## Testing
- cd web-app && npm install
- npm test
resolves#24
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/30
- Fixed service dependencies (removed bootstrap dependency for runtime services)
- Added landing service for documentation site at root path
- Moved web-app to /app path, landing to / path
- Fixed permission issues with lowercase 'z' SELinux context
- Added kraiken-lib compilation in txn-bot container
- Fixed TypeScript build for kraiken-lib with proper volumes
- Updated entrypoint scripts to handle npm installs properly
- Added locale fixes to Containerfiles
- Changed Caddy port from 80 to 8081 for external access
- Updated Docs link to point to local landing page
All services now working:
- Landing page at /
- Web app at /app/
- GraphQL at /graphql
- Transaction bot at /txn
- Anvil RPC at /rpc/anvil
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>