Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
efeafe7
feat: migrate to yield api balances
petar-omni Mar 4, 2026
4ae72e9
fix: tests
petar-omni Mar 4, 2026
a412e92
fix: position size
petar-omni Mar 5, 2026
3be73d9
fix: misc
petar-omni Mar 5, 2026
f02120e
feat: migrate
petar-omni Mar 20, 2026
93df083
feat: campaign
petar-omni Mar 20, 2026
6b49e39
feat: useMaxAmount
petar-omni Mar 20, 2026
3476aa6
fix: format
petar-omni Mar 20, 2026
eb6656f
fix: misc
petar-omni Mar 23, 2026
bdfb8df
fix: actions filtering
petar-omni Mar 23, 2026
e96863e
fix: token fallback
petar-omni Mar 24, 2026
fecb25f
fix: remove nonce, type fallback
petar-omni Mar 24, 2026
083f142
feat: init
petar-omni Mar 24, 2026
3ca4c39
feat: move api calls to private-api, formatting
petar-omni Mar 24, 2026
d480ab3
fix: decode tx gas
petar-omni Mar 24, 2026
e5977ef
feat: filter activity actions by network
petar-omni Mar 24, 2026
c45e737
chore: dtos cleanup
petar-omni Mar 25, 2026
48ccf6e
chore: refactor validators to use api schema
petar-omni Mar 25, 2026
fb91415
fix: hide personalized APY without campaign component
petar-omni Mar 25, 2026
c5fa67e
fix: ts error
petar-omni Mar 25, 2026
201c25c
refactor(widget): simplify image fallback handling
petar-omni Mar 26, 2026
faa900a
refactor(widget): simplify base token handling across yield flows
petar-omni Mar 26, 2026
f5fc039
fix: solana autoconnect
petar-omni Mar 26, 2026
373c0de
fix(widget): show APY composition fallback on position details
petar-omni Apr 28, 2026
2fd2694
ci(widget): pin workflow actions and install pnpm via npm
petar-omni Apr 28, 2026
bf2f956
fix: package manager field
petar-omni Apr 28, 2026
2511e53
chore: update mise.toml
petar-omni Apr 28, 2026
fda10e5
ci: disable reportCompressedSize
petar-omni Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-drinks-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stakekit/widget": patch
---

feat: migrate to yield api balances
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=8192"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- uses: jdx/mise-action@v2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: "24"

- name: Install pnpm
run: npm install -g pnpm@10.33.2

- run: pnpm install --frozen-lockfile

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,7 @@ next-env.d.ts
*.p12
*.pfx
*.crt
*.cer
*.cer

# opensrc - source code for packages
opensrc/
69 changes: 69 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# StakeKit Widget — Agent Guide

## Project Overview
- Monorepo managed with `pnpm` workspaces + Turborepo.
- Main package is `@stakekit/widget` in `packages/widget` (React + TypeScript + Vite).
- Widget supports two entry modes:
- React component export (`src/index.package.ts`)
- Fully bundled renderer (`src/index.bundle.ts`)
- Runtime branches between classic widget and dashboard variant in `src/App.tsx`.

## Repo Layout (important paths)
- `packages/widget/src/App.tsx` — root app, router setup, bundle renderer.
- `packages/widget/src/Widget.tsx` — non-dashboard route flow (earn/review/steps/details).
- `packages/widget/src/Dashboard.tsx` + `pages-dashboard/*` — dashboard variant UI.
- `packages/widget/src/providers/*` — global provider composition (API, query, wallet, tracking, theme, stores).
- `packages/widget/src/hooks/*` — feature and API hooks.
- `packages/widget/src/domain/*` — shared domain types/helpers.
- `packages/widget/src/translation/*` — i18n resources (`English`, `French`).
- `packages/widget/tests/*` — Vitest browser tests (MSW-backed).
- `packages/examples/*` — integration examples (`with-vite`, `with-vite-bundled`, `with-nextjs`, `with-cdn-script`).

## Commands Agents Should Use

### From repo root (all workspaces via Turbo)
- `pnpm build` — build all packages.
- `pnpm lint` — lint/type-check all packages.
- `pnpm test` — run all workspace tests.
- `pnpm format` — run formatting checks/tasks.

### Focused widget commands (recommended for most tasks)
- `pnpm --filter @stakekit/widget {command}`

## Agent Working Guidelines (short)
- Keep public API compatibility in `src/index.package.ts` and `src/index.bundle.ts`.
- When changing user-facing copy, update both:
- `packages/widget/src/translation/English/translations.json`
- `packages/widget/src/translation/French/translations.json`
- After changes, confirm nothing is broken with lint command which checks lint/type errors

## Useful Context for Debugging
- API client is configured in `packages/widget/src/providers/api/api-client-provider.tsx`.
- React Query defaults are in `packages/widget/src/providers/query-client/index.tsx`.
- App-level config/env mapping is in `packages/widget/src/config/index.ts`.
- Test bootstrapping + MSW worker setup:
- `packages/widget/tests/utils/setup.ts`
- `packages/widget/tests/mocks/worker.ts`

<!-- opensrc:start -->

## Source Code Reference

Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details.

See `opensrc/sources.json` for the list of available packages and their versions.

Use this source code when you need to understand how a package works internally, not just its types/interface.

### Fetching Additional Source Code

To fetch source code for a package or repository you need to understand, run:

```bash
npx opensrc <package> # npm package (e.g., npx opensrc zod)
npx opensrc pypi:<package> # Python package (e.g., npx opensrc pypi:requests)
npx opensrc crates:<package> # Rust crate (e.g., npx opensrc crates:serde)
npx opensrc <owner>/<repo> # GitHub repo (e.g., npx opensrc vercel/ai)
```

<!-- opensrc:end -->
4 changes: 2 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[tools]
node = "22"
pnpm = "10"
node = "24"
pnpm = "10.33.2"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"version": "changeset version"
},
"devDependencies": {
"@biomejs/biome": "^2.3.8",
"@biomejs/biome": "^2.4.8",
"@changesets/cli": "^2.29.8",
"@commitlint/cli": "^20.2.0",
"@commitlint/config-conventional": "^20.2.0",
"husky": "^9.1.7",
"knip": "^5.73.4",
"turbo": "^2.6.3"
},
"packageManager": "pnpm@10.24.0",
"packageManager": "pnpm@10.33.2",
"pnpm": {
"overrides": {
"@types/react": "19.0.10",
Expand Down
4 changes: 4 additions & 0 deletions packages/widget/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VITE_API_URL=https://api.stakek.it/
VITE_YIELDS_API_URL=https://api.yield.xyz/
VITE_API_KEY=vitest-api-key
MODE=test
8 changes: 6 additions & 2 deletions packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"clean": "rm -rf dist",
"preview": "vite -c vite/vite.config.dev.ts preview --outDir dist/website",
"check-unused": "npx knip",
"check-circular-deps": "skott ./src/index.package.ts -m 'raw' && pnpm lint"
"check-circular-deps": "skott ./src/index.package.ts -m 'raw' && pnpm lint",
"gen:yield-api": "openapi-typescript https://api.stg.yield.xyz/docs.yaml -o src/types/yield-api-schema.d.ts && biome check --write --unsafe src/types/yield-api-schema.d.ts"
},
"peerDependencies": {
"react": ">=18",
Expand Down Expand Up @@ -130,6 +131,9 @@
"mixpanel-browser": "^2.72.0",
"motion": "12.23.26",
"msw": "^2.12.4",
"openapi-fetch": "^0.17.0",
"openapi-react-query": "^0.5.4",
"openapi-typescript": "^7.13.0",
"playwright": "^1.57.0",
"postcss": "^8.5.6",
"purify-ts": "2.1.0",
Expand Down Expand Up @@ -160,4 +164,4 @@
"public"
]
}
}
}
Loading
Loading