While reviewing the watch-only hardware-wallet layer on this branch, a few things stood out that would be better owned by core than reimplemented per-platform.
Note: I diffed against the local bitkit-core checkout, which is at 0.1.40 and predates the watcher / wallet-scoped-activity surface this PR consumes from 0.3.2 — so these are against the consumed 0.3.2 binary, not the source. Flagging in case the source needs a bump too.
Subtasks
Originally posted by @jvsena42 in synonymdev/bitkit-ios#605 (comment)
Subtasks
wallet_idderivationThe per-device id is improvised on the Swift side (
HwWalletId.derive="trezor:" + SHA256(sorted xpubs)) and the PR already flags it as interim pending agreement with Android. If iOS and Android derive it independently, the same physical device yields different ids and activity won't reconcile cross-platform. Suggest a corederiveWalletId(xpubs:)so both platforms are guaranteed identical by construction.Activityinstead ofHistoryTransactionHwWalletManager.onchainActivity()hand-reconstructs anActivityfromHistoryTransaction— guessing direction fromreceived > sent, netting the fee, and hardcodingfeeRate: 1/address: "". That's core's job, and the placeholder fee-rate will render wrong. EmittingActivity(or exposing awatchOnlyActivityFromHistory(walletId:txs:)mapper) removes a per-platform mapping that iOS and Android will otherwise drift on.gapLimit: 20should be a core defaultinstead of being duplicated in
HwWalletManagerand the watcher params on each platform.Android currently carries supported-device display metadata in app code while Trezor is only one concrete implementation of the generic hardware-wallet layer. Expose the supported vendors/models/capabilities from core so Android and iOS can render supported devices generically instead of duplicating Trezor-specific supported-HW info per platform. Follow-up from feat: transfer to spending from hw wallet bitkit-android#1039.
Originally posted by @jvsena42 in synonymdev/bitkit-ios#605 (comment)