Skip to content

feat(trezor): add account info, compose, and broadcast FFI exports#75

Open
coreyphillips wants to merge 3 commits intomasterfrom
feat/trezor-compose-integration
Open

feat(trezor): add account info, compose, and broadcast FFI exports#75
coreyphillips wants to merge 3 commits intomasterfrom
feat/trezor-compose-integration

Conversation

@coreyphillips
Copy link
Collaborator

This PR:

  • Adds account_info module with BDK/Electrum queries (no device required)
  • Adds compose module bridging bitkit-core account types to trezor-connect-rs offline coin selection
  • Adds fetch_prev_txs to retrieve previous transactions needed for non-SegWit signing
  • Adds broadcast_raw_tx to broadcast signed transactions via Electrum
  • Adds AccountInfoError error type for blockchain query operations
  • Adds reverse ScriptType conversion and compose FFI types
    (TrezorFeeLevel, TrezorSortingStrategy, TrezorPrecomposeOutput,
    TrezorPrecomposeParams, TrezorPrecomposedInput, TrezorPrecomposedOutput,
    TrezorPrecomposedResult)

New FFI exports

Function Description
trezor_get_account_info Queries account data from xpub via Electrum
trezor_get_address_info Queries balance/UTXOs for a single address
trezor_account_type_to_script_type Maps account type to script type
trezor_precompose_transaction Performs offline coin selection and fee calculation
trezor_precomposed_to_sign_params Converts compose results to signing parameters
trezor_fetch_prev_txs Fetches previous transactions from Electrum
trezor_broadcast_raw_tx Broadcasts signed transaction via Electrum

@coreyphillips coreyphillips self-assigned this Mar 5, 2026
@coreyphillips coreyphillips added the enhancement New feature or request label Mar 5, 2026
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	Package.swift
#	bindings/android/gradle.properties
#	bindings/android/lib/src/main/jniLibs/arm64-v8a/libbitkitcore.so
#	bindings/android/lib/src/main/jniLibs/armeabi-v7a/libbitkitcore.so
#	bindings/android/lib/src/main/jniLibs/x86/libbitkitcore.so
#	bindings/android/lib/src/main/jniLibs/x86_64/libbitkitcore.so
#	bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.android.kt
#	bindings/ios/BitkitCore.xcframework.zip
#	bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/libbitkitcore.a
#	bindings/ios/BitkitCore.xcframework/ios-arm64/libbitkitcore.a
#	bindings/python/bitkitcore/libbitkitcore.dylib
@coreyphillips
Copy link
Collaborator Author

Some of these methods in the trezor module could arguably be moved to the onchain module, but since it's only being used to wire up Trezor functionality I've decided to leave them here for now.

@coreyphillips coreyphillips requested a review from ovitrif March 5, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant