Skip to content

Feature/sdk history fixes batch - #681

Merged
Mimah97 merged 5 commits into
Vatix-Protocol:mainfrom
valoryyaa-byte:feature/sdk-history-fixes-batch
Jul 27, 2026
Merged

Feature/sdk history fixes batch#681
Mimah97 merged 5 commits into
Vatix-Protocol:mainfrom
valoryyaa-byte:feature/sdk-history-fixes-batch

Conversation

@valoryyaa-byte

Copy link
Copy Markdown
Contributor

Summary

Related issues

Type of change

  • Bug fix
  • New feature
  • Docs update
  • Chore / refactor

Checklist

  • CI passes (lint + tests + build)
  • Self-reviewed the diff
  • Added or updated tests where relevant
  • Docs updated if needed

valoryyaa-byte and others added 5 commits July 27, 2026 11:33
Stale swap execution risk: built swaps had no expiry, so a signed
tx could sit around and execute far later at a bad price. buildSwapTx
now accepts an optional deadline (unix seconds, defaults to now + 10min),
forwards it as a contract call arg, and sets it as the tx's maxTime
precondition so Stellar Core rejects a submission past the deadline
(txTOO_LATE) independent of any contract-side check.

Also fixes pre-existing malformed StrKey fixtures in swap.spec.ts
(wrong length / invalid base32 chars) that were silently making most
of the success-path tests fail before they even reached the new
deadline assertions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Prev/Next controls already existed but had two gaps: paging past the
end of a shrinking data set could strand the user on a page that would
always be empty, and an empty page (over-paging, stale total) rendered
the same "no history yet" copy as a wallet with zero activity, which is
misleading.

- Wire an explicit shared PAGE_SIZE into the useSwaps/useLpActivity
  calls and the totalPages calculation, instead of relying on the
  hooks' default limit matching a separately hardcoded /20.
- Clamp `page` back to the last valid page when totalPages shrinks
  below it.
- Show a distinct "No results on this page" notice with a way back to
  page 1 when the current (non-first) page has no items, instead of
  reusing the zero-history empty state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ng them

usePoolTicks already fell back to synthetic placeholder ticks on a
failed fetch (so the range-selector chart never went blank), but the
catch block always reset error to null, so failures were invisible —
callers had no way to know the chart was showing fake liquidity, and
there was no way to retry the real fetch short of remounting.

- Preserve the fetch error instead of discarding it, and expose retry()
  to re-trigger the load.
- Document the partial-data policy: on failure, ticks stay populated
  with synthetic data (so the chart still renders) while error signals
  it's not live, letting the UI distinguish "no data" from "fake data".
- Wire ticksError/onRetryTicks through AddLiquidity -> RangeSelector,
  which now shows a small warning banner with a retry action instead of
  presenting synthetic bars as real liquidity.
- Extend usePoolTicks.test.ts (previously only covered usePools) with
  real coverage of the ticks hook: success, HTTP failure, network
  failure, retry-then-success, and unmount cancellation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ositionPreview

Est. APR was shown as a bare percentage with no indication of how it
was derived, and a pool with no volume24h/feeApr data would render a
misleading NaN%/0% figure instead of flagging that the estimate isn't
available.

- useAddLiquidity's preview now returns "N/A" for estimatedApr when
  volume24h or feeApr is missing/NaN, distinct from a pool with a
  confirmed zero volume (which the backend already prices as a real 0%
  per docs/FEE_APR_CALCULATION.md).
- PositionPreview renders "N/A" with muted styling instead of "N/A%",
  and adds an info link next to "Est. APR" pointing to
  docs/FEE_APR_CALCULATION.md so the calculation assumptions are
  reachable from the UI.
- Add coverage for both: useAddLiquidity.test.ts for the N/A branching,
  PositionPreview.test.tsx for the rendered percentage/N/A/doc-link
  states.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Mimah97
Mimah97 merged commit 39bfc7c into Vatix-Protocol:main Jul 27, 2026
0 of 4 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

2 participants