Skip to content

feat: add pendle#10061

Merged
zhaono1 merged 93 commits intoxfrom
feat/pendle
Mar 2, 2026
Merged

feat: add pendle#10061
zhaono1 merged 93 commits intoxfrom
feat/pendle

Conversation

@zhaono1
Copy link
Copy Markdown
Contributor

@zhaono1 zhaono1 commented Feb 9, 2026

@revan-zhang
Copy link
Copy Markdown
Contributor

revan-zhang commented Feb 9, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

zhaono1 and others added 4 commits February 28, 2026 09:47
useEthenaCooldown was incorrectly triggered for all Pendle tokens on
ETH mainnet. Add withdrawPathConfirmBoxes.length > 1 guard so the
two-step Ethena cooldown flow and StakeProgress UI only activate when
the backend returns multiple withdraw paths (Ethena tokens).
@zhaono1 zhaono1 changed the title chore: add pendle feat: add pendle Feb 28, 2026
Comment thread packages/kit-bg/src/services/ServiceStaking.ts Outdated
devin-ai-integration[bot]

This comment was marked as resolved.

zhaono1 and others added 13 commits March 1, 2026 10:34
…refresh cooldown

- Add secondaryPrice to LightweightChart onHover for dual-line tooltip
- Show Fixed APY / Base APY labels in chart hover tooltip
- Display maturity date in protocol detail header
- Replace token selector popover with full-screen modal (EarnTokenSelect)
- Add RefreshCooldownButton with 5s cooldown after quote refresh
- Remove re-quote logic during approve phase
- Remove dead code: PENDLE_SUPPORTED_SYMBOLS, isPendleSupportedSymbol
- Make IStakeTransactionConfirmation fields (title, rewards, receive) optional
…tatic config

All Pendle tokens share identical IStakingFlowConfig. Replace per-token
definitions with a single exported pendleFlowConfig constant and simplify
Pendle provider entries to empty supportedSymbols/configs.
- Add showBodyTitle prop to EarnPageContainer for rendering pageTitle in page body
- Only EarnProtocols (list page) enables showBodyTitle; detail pages unaffected
- Align left padding with $pagePadding (20px) to match Figma spec
- Merge duplicate imports from @onekeyhq/shared/src/routes
- Extract confirmOnPress useMemo to eliminate nested ternary
- Extract summaryContent useMemo to eliminate nested ternary
…icates)

- useQuoteRefresh: replace prefix increment with += 1
- StakeProgress: extract nested ternary to useMemo
- PendleSharedComponents: extract nested ternary to IIFE, merge duplicate react imports
- LightweightChart: extract nested ternary to let+if in event callback
- ApyChart: replace != null with !== undefined (type is number | undefined)
- UniversalWithdraw: split summary nested ternary into two && conditions,
  extract footer props (confirmText/OnPress/Loading/Disabled) to useMemo
@zhaono1 zhaono1 requested a review from originalix March 2, 2026 09:18
@zhaono1 zhaono1 merged commit faf8cea into x Mar 2, 2026
10 checks passed
@zhaono1 zhaono1 deleted the feat/pendle branch March 2, 2026 09:22
PatrickChoo pushed a commit to PatrickChoo/app-monorepo that referenced this pull request Mar 10, 2026
* chore: add pendle

* feat: Add Pendle category and update i18n

* chore: pendle token config

* chore: pendle details / manage page

* chore: Add Selector

* fix: cc review

* chore: Edit the comment.

* fix: lint

* fix: resolve React best practice review issues

* fix: lint error

* feat: add Pendle swap-based manage page support with receive input

- Add receive input section with arrow overlay to UniversalStake and UniversalWithdraw
- Support forceSubduedBackground for disabled StakingAmountInput
- Handle swap manage page (buy/sell) actions in useManagePage and NormalManageContent
- Use API receiveButton token logoURI directly for receive input icon

* feat: improve Pendle manage flow and action typing

* feat: fix Pendle protocol list compatibility, redeem button, and field naming

* feat: enhance Pendle UI with withdraw path selector, pixel alignment, and portfolio improvements

* feat: add Pendle Ethena unstake two-step transaction flow

* feat: add ethenaPath param for Pendle Ethena two-step unstake flow

* fix: correct StakeProgress labels to match Figma design (Approve → Swap → Unstake)

* feat: add ETH network guard for Ethena two-step unstake and render claim button in portfolio assetsStatus

* fix: harden stake/unstake flows from pre-merge review

- Await fresh fee estimate after approve before submitting (legacy + permit2)
- Add AbortSignal guard for Ethena two-step unstake navigation safety
- Add null-checks for optional fields (history title, approve target)
- Add revalidateOnFocus to Pendle asset list hooks

* fix: lint

* feat: add useQuoteCountdown hook for Pendle quote lifecycle

15-second countdown timer with reset/refresh/expire semantics
for managing Pendle quote freshness.

* feat: integrate quote countdown and refresh into Pendle stake/withdraw

- UniversalStake: show Refresh button when quote expires, re-quote
  after approve if expired, reset countdown on fresh quote
- UniversalWithdraw: same countdown integration for sell early flow
- HeaderRight: add countdown seconds display and refresh icon for Pendle

* feat: add slippage settings for Pendle and wire to build transaction API

- NormalManageContent: manage pendleSlippage state with SlippageSettingDialog,
  create per-tab countdowns, wire to HeaderRight/StakeSection/WithdrawSection
- StakeSection/WithdrawSection: pass slippage and countdown props through
- useUniversalHooks: pass slippage to buildStakeTransaction and
  all buildUnstakeTransaction calls

* fix: lint

* refactor: extract shared Pendle layout hook, unify validation, and fix inconsistencies

- Extract `usePendleLayoutState` hook to deduplicate ~300 lines of Pendle layout logic between UniversalStake and UniversalWithdraw
- Add `useIsPendleProvider` hook to replace inline `useMemo(() => earnUtils.isPendleProvider(...))` pattern across 5 files
- Add `isInvalidAmount` util to unify inconsistent `isNaN` implementations (lodash vs local)
- Add try/catch to `debouncedFetchTransactionConfirmation` in both Stake and Withdraw
- Fix `useQuoteCountdown.refresh` to reset timer immediately instead of staying stuck at 0
- Fix `buildUnstakeTransaction` vault param: use `undefined` instead of empty string when not vault-based
- Remove ~71 lines of commented-out dead code in UniversalStake
- Extract hardcoded `' vs Best'` string as `VS_BEST_LABEL` constant

* fix: remove hardcoded 'vs Best' label, let backend provide full text

* feat: support redeemable button in protocol list driven by server aprInfo.button

- Add button field to IEarnAvailableAssetAprInfo type to align with server DTO
- Navigate to ManagePosition redeem tab when aprInfo.button.type is 'redeem'
- Simplify getMaturityDisplay to trust server description instead of local calculation
- Render redeemable text from server button data with i18n fallback

* refactor: extract useQuoteRefresh hook with stale-request guard and per-tab loading

- Extract quote refresh logic into generic useQuoteRefresh hook
- Add requestId-based stale response discard to prevent race conditions
- Split quoteRefreshing state per tab to avoid cross-tab loading leaks
- Fix icon to RotateClockwiseOutline and gap to $3.5 per Figma spec
- Remove optimistic countdown reset; let onQuoteReset handle it on success

* fix: pendle sell flow button text, approve skip, and transaction detail params

- Button text follows step: show "Swap" instead of "Withdraw" during Pendle sell
- StakeProgress skips step 1 (Approve) when allowance is sufficient
- Transaction detail shows "Sell"/"Buy" labels with token icon for Pendle
- Add Sell/Buy to EEarnLabels enum and txActionUtils label mapping
- Fix useRef missing initial value in UniversalWithdraw
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.

4 participants