Skip to content

Feat/desktop staking#592

Merged
serfesh merged 27 commits into
mainfrom
feat/desktop-staking
Apr 21, 2026
Merged

Feat/desktop staking#592
serfesh merged 27 commits into
mainfrom
feat/desktop-staking

Conversation

@serfesh

@serfesh serfesh commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

- Encoder: add encodeWhalesWithdraw (op 0xDA803EFD) and encodeTfWithdraw,
  export fee constants (STAKE_GAS_RESERVE_TON, UNSTAKE_*_GAS_TON)
- Hook: branch useEncodeStakingUnstake by pool.implementation
  (Whales/Tf/LiquidTf), add isSendAll for Whales amount=0 optimization
- UnstakeForm: TF auto-fills full balance + disables input,
  pool-aware fee check, Whales isSendAll when amount matches balance
- Pool detail: Claim button for non-liquid pools when readyWithdraw > 0,
  error state fallback, date locale via useDateFormat hook
- usePoolInfo: gate on STAKING feature flag, fix cache key (drop amounts)
- StakingAmountInput: import STAKE_GAS_RESERVE_TON from encoder
- usePortfolioBalances: console.warn for dropped staking positions
- Extract usePoolStakedBalance hook to centralize liquid/non-liquid balance fetching
- UnstakeForm always operates in TON (matching iOS), converts TON→tsTON on confirm
- Encoder encodeUnstake supports isSendAll for liquid pools (fresh on-chain balance)
- Add convertTonToPoolTokenNano with ROUND_DOWN to prevent over-balance burns
- Fix StakingEarningsInfo: works for non-liquid pools, correct units for liquid
- Simplify PoolDetailPage by replacing ~60 lines of manual resolution with hook
- Align getStakingPoolTonAmount priority: liquid balance checked before position
…akingForm

Extract shared AmountField visual primitive, UnstakeAmountInput and
UnstakeButton — mirroring StakingAmountInput/StakingButton pattern.
Eliminates 130 lines of duplicated styled-components.
Return null instead of '' when timer expires. Separate liquid/non-liquid
cycle info in UnstakeForm into independent blocks.
Move the visual sign prefixes ("+" and "—") out of staking_action_stake
and staking_action_unstake locale strings into a separate <ActionSign>
element in the component, matching the pattern used by home action
buttons (BuyIcon, SellIcon). Rebuild locales with latest Tolgee data.
@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown

Successful WEB deployment 🚀🚀🚀

Well done!
Link to test environment:
https://02541959.tonkeeper-web.pages.dev

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown

Successful iPad build 🚀🚀🚀

Well done!
The app with build version: 4.4.0(19)
Uploaded to TestFlight

@serfesh serfesh force-pushed the feat/desktop-staking branch from 590c842 to db92879 Compare April 15, 2026 11:56
Comment thread yarn.lock
languageName: node
linkType: hard

"@esbuild/android-arm@npm:0.27.7":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а что в yarn.lock? оно должно меняться?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Должно. Без актуального лока просто не соберется

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ты с той нодой собрал? он по идее не должен меняться сам

Comment thread turbo.json
"dev": {
"dependsOn": ["^dev"],
"outputs": [".next/**", "dist/**"]
"cache": false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это надо релизить?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это чисто для дев режима. Сейчас yarn turbo dev просто не работает, с этими изменениями работает

Comment thread package.json
"url": "https://github.com/tonkeeper/tonkeeper-web.git"
},
"scripts": {
"dev:web": "npx turbo dev --filter=@tonkeeper/web --filter=@tonkeeper/uikit --filter=@tonkeeper/locales --parallel",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а тут какой смысл?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Смысл чтоб сразу запустить сборку трех проектов в дев режиме, чтоб хотрелоад работал. Иначе надо будет в трех терминалах держать сборку проекта, кита и текста

"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"build": "rm -fr dist && tsc",
"build": "rm -fr dist && tsc && mkdir -p dist/components/staking && cp -R src/components/staking/assets dist/components/staking/",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

клинап?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

М? Это сделано чтоб ассеты между проектами не копировать. Сейчас там была проблема что ассеты лежали только для веба и в остальных просто не работали. Просто их отдельно копировать не хотелось, вынес в кит, а учитывая что сборка там обычный tsc, то копирую руками

Comment thread apps/web/package.json
},
"scripts": {
"locales": "ts-node ./task/locales",
"dev": "yarn locales && vite dev",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не то же самое, что yarn start?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже самое, но turbo при запуске дергает именно команду dev. В целом наверное можно сделать тут yarn start

@serfesh serfesh merged commit ad1f1c9 into main Apr 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants