Skip to content

Conversation

@ZocoLini
Copy link
Collaborator

@ZocoLini ZocoLini commented Feb 11, 2026

Balances where not being shown correctly and the main issue was the enormous amount of logic, the underlying Rust lib contains the logic and the sdk only needs to wrap it, dropped all logic that was unnecessary and added one method to CoreWalletManager wrapper:

    public func getBalance(for wallet: HDWallet, accountIndex: UInt32 = 0) -> Balance {
        let managedAccount = try! sdkWalletManager.getManagedAccount(
            walletId: wallet.walletId,
            accountIndex: accountIndex,
            accountType: .standardBIP44
        )
        
        return try! managedAccount.getBalance()
    }

This follows the same pattern the transactions follow, asking directly the ffi for the balance.

Note that this PR is a cleanup, I drop unused stuff and logic layers that are not useful, the PR fixes the mentioned issue, and a couple more found while cleaning, like wallets being persisted twice, SPVclient reference being hold somewhere preventing it from de-initializing, wallet crashes after delete and maybe more

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/core-swift-sdk-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ZocoLini ZocoLini marked this pull request as draft February 11, 2026 01:12
@github-actions
Copy link

github-actions bot commented Feb 11, 2026

✅ DashSDKFFI.xcframework built for this PR.

SwiftPM (host the zip at a stable URL, then use):

.binaryTarget(
  name: "DashSDKFFI",
  url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
  checksum: "e8fdb3cd8dce4b9d023b88df47525db1dc7c8434913c870abef7f080f5801d7d"
)

Xcode manual integration:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

@ZocoLini ZocoLini changed the title chore(swift-sdk): core transactions, wallet, balance, acccounts, etc in swift sdk cleanup chore(swift-sdk): clean up core transactions, wallet, balance, acccounts, etc in swift sdk Feb 11, 2026
@ZocoLini ZocoLini marked this pull request as ready for review February 11, 2026 17:19
@ZocoLini ZocoLini force-pushed the chore/core-swift-sdk-cleanup branch from 2aaca9d to d37de8f Compare February 11, 2026 18:50
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.

1 participant