Skip to content

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Nov 10, 2025

Description

This PR implements the saving of transactions metadata. It is used to update the activities with info that is not provided by LDK payment class, like if a payments is a transfer

  1. Save transaction metadata locally
  2. Backup and restore
  3. Update transfer timestamp

Linked Issues/Tasks

Roadmap - Activity overview

Screenshot / Video

  1. Transfer to spending
  2. Should display unconfirmed transfer activity
  3. Mine 1 block
  4. Activity should be updated to confirmed
transfer.mp4
  1. Existing transfer
  2. Wipe and restore wallet
  3. Should display transfer
restore.mp4

@jvsena42 jvsena42 requested a review from Copilot November 10, 2025 12:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements transaction metadata storage for tracking transfer-related information that isn't provided by LDK's payment APIs. The main purpose is to temporarily store metadata (like whether a payment is a transfer) until it can be applied to activities during sync operations.

Key changes:

  • Added TransactionMetadataStorage service using UserDefaults for persistence
  • Enhanced transaction sending and channel operations to capture and store metadata
  • Implemented force channel close functionality with UI sheet

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Bitkit/Models/TransactionMetadata.swift New model for storing temporary transaction metadata including transfer flags and channel info
Bitkit/Services/TransactionMetadataStorage.swift Storage service for persisting transaction metadata with CRUD operations
Bitkit/Services/LightningService.swift Updated send and closeChannel methods to capture metadata and support force closes
Bitkit/Services/CoreService.swift Added updateActivitiesMetadata to sync stored metadata with activities
Bitkit/ViewModels/WalletViewModel.swift Added isTransfer parameter to send method
Bitkit/ViewModels/TransferViewModel.swift Added force close functionality and SheetViewModel dependency
Bitkit/ViewModels/SheetViewModel.swift Added forceTransfer sheet item
Bitkit/Views/Sheets/ForceTransferSheet.swift New sheet for force channel close confirmation
Bitkit/MainNavView.swift Registered ForceTransferSheet
Bitkit/AppScene.swift Updated TransferViewModel initialization with SheetViewModel

@jvsena42 jvsena42 changed the title Feat/transfer activities feat: Transfer activities Nov 10, 2025
@jvsena42 jvsena42 marked this pull request as ready for review November 12, 2025 17:41
@jvsena42 jvsena42 self-assigned this Nov 12, 2025
@jvsena42
Copy link
Member Author

It will be replaced by #219

@jvsena42 jvsena42 closed this Nov 13, 2025
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.

2 participants