Skip to content

platform-wallet: expose an account-scoped Platform credit total for PlatformPayment accounts #6235

Backlog

Description

@QuantumExplorer

Problem

SwiftExampleApp (AccountListView.platformBalanceRow) and KotlinExampleApp (since #6225, plus the existing wallet detail Platform balance) show a PlatformPayment account's balance as the sum of its persisted Platform address rows. Rust owns the live total (ManagedPlatformAccount::total_credit_balance()), and PlatformAddressWallet::reconcile_address_infos updates it from a proof before the change is persisted. Kotlin's onPersistAddressBalance is update-only and skips an address that has no Room row yet. So the sum of rows can briefly be less than the account holds.

The only bridged total, platform_address_wallet_total_credits, reads the default account and is not account-scoped.

Proposal

Expose an account-scoped snapshot (account index + key class → total credits) through FFI and JNI, and have both apps show it on the account row, the account detail and the wallet Platform balance, so all three agree.

Found in review of #6225.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions