Skip to content

Add total withdrawn counter and expose reconciliation view - #234

Open
Properprogress1 wants to merge 182 commits into
leojay-net:mainfrom
Properprogress1:main
Open

Add total withdrawn counter and expose reconciliation view#234
Properprogress1 wants to merge 182 commits into
leojay-net:mainfrom
Properprogress1:main

Conversation

@Properprogress1

Copy link
Copy Markdown

closes #114 Feature: add get_total_withdrawn view function and running withdrawal counter

Summary

  • Introduces TotalWithdrawn storage key and initializes it in init.
  • Adds get_total_withdrawn(env) -> Result<i128, Error>.
  • Increments TotalWithdrawn with checked arithmetic on successful outflows:
    • withdraw
    • execute_withdrawal
    • refund_deposit
    • emergency_drain
  • Extends withdrawal-related event payloads to include running withdrawn total.
  • Fixes execute_withdrawal transfer flow to avoid double-transfer behavior.

Tests

  • Verifies get_total_withdrawn == 0 after initialization.
  • Verifies single 100-token withdrawal updates counter to 100.
  • Verifies multiple withdrawals accumulate correctly.
  • Adds sequence coverage for deposits + withdrawals and outflow paths.
  • Full suite passing (cargo test)

leojay-net and others added 30 commits March 20, 2026 01:25
…undary

feat: add chat error boundary fallback
Playwright end-to-end suite for core journey
 OpenTelemetry traces for payout lifecycle
…-Dex-Chat

payout provider abstraction layer
On viewports narrower than 768px the sidebar is replaced with a
bottom-sheet that slides up from the bottom of the screen.

- Mount/unmount driven by `isSheetMounted` so the exit animation
  completes before the element is removed from the DOM
- Slide-in triggered via requestAnimationFrame after mount using
  a CSS cubic-bezier ease identical to iOS sheet behaviour
- Swipe-to-close: tracks touchstart/move/end directly on the sheet
  element; dismisses when drag delta exceeds 120 px, otherwise
  snaps back
- Overlay click and Escape key both trigger the animated close path
- Focus is moved to the sheet on open for keyboard/screen-reader
  accessibility (role="dialog", aria-modal, tabIndex=-1)
- Viewport resize resets panel state to avoid stale open state
  across breakpoints
- Desktop sidebar behaviour is completely unchanged

ChatHistorySidebar receives an optional `onClose` prop; when
provided a close button is rendered beside the trash icon (visible
in the bottom-sheet only).

Closes leojay-net#67
…om-sheet-chat-history

feat(chat): mobile bottom-sheet pattern for chat history
- Add .github/workflows/frontend.yml: builds Next.js on PR/push to main
- Add .github/workflows/contracts.yml: runs cargo test and wasm build on PR/push to main
- Fix verify-account/route.ts: broken try/catch structure from bad merge
- Fix Skeleton.tsx: restore commented-out cn import
- Add src/lib/utils.ts: cn helper using clsx + tailwind-merge
- Install @playwright/test, clsx, tailwind-merge dev dependencies
feat: add CI workflow for contract tests
…e/99-time-locked-withdrawals

feat: implement time-locked withdrawals for FiatBridge
- Introduced new test snapshot for canceling withdrawals (`test_cancel_withdrawal.1.json`).
- Updated `test_deposit_and_withdraw.1.json` to change withdrawal function to `request_withdrawal`.
- Enhanced `test_insufficient_funds_withdraw.1.json` to include a request withdrawal scenario and added a withdrawal queue entry.
- Added new test snapshot for time-locked withdrawals (`test_time_locked_withdrawal.1.json`) to validate lock period functionality.
DIFoundation and others added 20 commits March 26, 2026 15:31
…ain-admin-recover

 add emergency drain function for admin to recover all held funds in one call
Consolidate stroop ↔ XLM conversion logic into a single shared file
(src/lib/stroops.ts) to eliminate duplication and reduce the risk of
rounding inconsistencies across the codebase.

- Create src/lib/stroops.ts with xlmToStroops and stroopsToXlm exports
- Move stroopsToDisplay from stellarContract.ts into stroops.ts,
  re-exporting it as a deprecated alias for backward compatibility
- Replace the local parseAmountToStroops in StellarFiatModal.tsx with
  the shared xlmToStroops import

Closes leojay-net#21

Made-with: Cursor
feat:add deposit_for function allowing a third-party payer to fund on behalf of another address
Docs: add .env.example file for the frontend
…bmit-protection-35

fixed  Duplicate Submit Protection and Safe Retry
Add network mismatch detection so users are clearly warned before
attempting deposits or withdrawals on the wrong Stellar network.

- Add EXPECTED_NETWORK constant and isNetworkMismatch derived boolean
  to StellarWalletContext, exposed via the hook
- Update the network badge in StellarChatInterface to show a red
  indicator, the detected vs expected network, and a guidance message
  for switching in Freighter (Settings → Network → TESTNET)
- Hide Deposit/Withdraw buttons when a mismatch is detected
- Block the modal from opening via AI chat flow or confirm_fiat action
  when the wallet is on the wrong network

Closes leojay-net#29

Made-with: Cursor
feat(chat): implement slash commands and local FAQ retrieval
…t-stroop-utils

chore: extract XLM stroop conversion utilities into shared helper module
…network-mismatch

feat: show wallet network mismatch warning and disable write actions
@drips-wave

drips-wave Bot commented Mar 26, 2026

Copy link
Copy Markdown

@Properprogress1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@leojay-net

Copy link
Copy Markdown
Owner

resolve conflicts @Properprogress1

@leojay-net

Copy link
Copy Markdown
Owner

please fix conflicts again
@Properprogress1

@leojay-net

Copy link
Copy Markdown
Owner

fix conflicts

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.

Feature: add get_total_withdrawn view function and running withdrawal counter