NativeHwApi class

HwApi backed by the native (FFI/platform) implementation.

Thin wrapper over the connector BuHwApi (held Bu.hw, Rust hw core). Transport stays with the caller via BuHwTransport.

Implemented types
Available extensions

Constructors

NativeHwApi(BuHwApi api)
Creates a native hardware-wallet backend over api.
const

Properties

api → BuHwApi
Underlying connector backend (held Bu.hw, Rust hw core).
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bitboxBtcPubRequest({required int coin, required BuBytes pathU32, required int xpubType, required bool display}) → BuBytes
BitBox02: builds Request{btc_pub}; throws CryptoException on native failure.
override
bitboxDecrypt({required BuBytes ciphertext}) → BuBytes
BitBox02: decrypts one message; throws CryptoException on native failure.
override
bitboxEncrypt({required BuBytes plaintext}) → BuBytes
BitBox02: encrypts one message; throws CryptoException on native failure.
override
bitboxFree() → void
BitBox02: closes session; throws CryptoException on native failure.
override
bitboxHsHash() → BuBytes
BitBox02: handshake hash; throws CryptoException on native failure.
override
bitboxHsM1() → BuBytes
BitBox02: handshake m1; throws CryptoException on native failure.
override
bitboxHsM2({required BuBytes m2}) → void
BitBox02: ingests handshake m2; throws CryptoException on native failure.
override
bitboxHsM3() → BuBytes
BitBox02: handshake m3; throws CryptoException on native failure.
override
bitboxHsNew({required BuBytes staticPriv32, required BuBytes ephemeralPriv32}) → void
BitBox02: opens initiator session; throws CryptoException on native failure.
override
bitboxHsSplit() → void
BitBox02: splits into transport keys; throws CryptoException on native failure.
override
bitboxPubParse({required BuBytes response}) → String
BitBox02: parses Response to xpub string; throws CryptoException on native failure.
override
bitboxSignChange({required BuBytes pathU32, required int amountSat, required int scriptConfigIndex}) → BuBytes
BitBox02: builds change Request{btc_sign_output}; throws CryptoException on native failure.
override
bitboxSignInit({required int coin, required BuBytes pathU32, required int simpleType, required int version, required int inputsCount, required int outputsCount, required int locktime}) → BuBytes
BitBox02: builds Request{btc_sign_init}; throws CryptoException on native failure.
override
bitboxSignInput({required BuBytes prevHash32, required int prevIndex, required int amountSat, required int sequence, required BuBytes pathU32, required int scriptConfigIndex}) → BuBytes
BitBox02: builds Request{btc_sign_input}; throws CryptoException on native failure.
override
bitboxSignNextParse({required BuBytes response}) → (int, int)
BitBox02: parses sign_next; throws CryptoException on native failure.
override
bitboxSignNextPrevIndex({required BuBytes response}) → int
BitBox02: extracts prev_index; throws CryptoException on native failure.
override
bitboxSignNextSignature({required BuBytes response}) → BuBytes
BitBox02: extracts DONE signature; throws CryptoException on native failure.
override
bitboxSignOutput({required int outputType, required int amountSat, required BuBytes payload}) → BuBytes
BitBox02: builds external Request{btc_sign_output}; throws CryptoException on native failure.
override
bitboxSignPrevtxInit({required int version, required int inputsCount, required int outputsCount, required int locktime}) → BuBytes
BitBox02: builds prevtx_init; throws CryptoException on native failure.
override
bitboxSignPrevtxInput({required BuBytes prevHash32, required int prevIndex, required BuBytes scriptSig, required int sequence}) → BuBytes
BitBox02: builds prevtx_input; throws CryptoException on native failure.
override
bitboxSignPrevtxOutput({required int amountSat, required BuBytes script}) → BuBytes
BitBox02: builds prevtx_output; throws CryptoException on native failure.
override
defaultHwPath(CryptoCoins<BaseCoinConfig> coin) → String

Available on HwApi, provided by the EasyHwApiX extension

Full default path m/purpose'/coinIdx'/defPath (defPath already contains the account level, e.g. BTC 0'/0/0, Tezos 0'/0').
executeGetAddress({required int device, required int coin, required BuBytes pathU32, required BuHwTransport transport}) → Future<BuBytes>
Builds request then exchanges via transport and parses address bytes; throws CryptoException on native failure.
override
executeSign({required int device, required int coin, required BuBytes pathU32, required BuBytes payload, required BuHwTransport transport}) → Future<BuBytes>
Builds request then exchanges via transport and parses signature; throws CryptoException on native failure.
override
getAddress({required CryptoCoins<BaseCoinConfig> coin, required int device, String? path, required BuHwTransport transport}) → Future<String>

Available on HwApi, provided by the EasyHwApiX extension

getPublicKey + the coin's own addressEncoder → ready address string. (Monero intentionally throws — it has no coin-config address derivation.)
getAddressRequest({required int device, required int coin, required BuBytes pathU32}) → BuBytes
Builds USB request bytes for device, coin and pathU32; throws CryptoException on native failure.
override
getPublicKey({required CryptoCoins<BaseCoinConfig> coin, required int device, String? path, required BuHwTransport transport}) → Future<BuBytes>

Available on HwApi, provided by the EasyHwApiX extension

Parse + validate + fetch pubkey in one call. path defaults to defaultHwPath. Needs a connected transport (USB) except the validation part — throws before touching transport on bad input.
hidFrame({required BuBytes payload, int channel = BuHwHid.channelDefault, int tag = BuHwHid.tagApdu}) → BuBytes
Chunks payload into concatenated 64-byte HID reports; throws CryptoException on native failure.
override
hidUnframe({required BuBytes reports, int channel = BuHwHid.channelDefault, int tag = BuHwHid.tagApdu}) → BuBytes
Reassembles concatenated 64-byte HID reports; throws CryptoException on native failure.
override
hwCoinIdFor(CryptoCoins<BaseCoinConfig> coin) → int

Available on HwApi, provided by the EasyHwApiX extension

Connector coin id for coin, or throws BuError when the coin has no HW flow (unknown SLIP44 / unsupported curve variant).
identityEncode({required String proto, String user = '', String host = '', String port = '', String path = '', int index = 0}) → BuBytes
Trezor: encodes IdentityType; throws CryptoException on native failure.
override
isAirgap({required int device}) → bool
Returns whether device is QR/SD-only; throws CryptoException on native failure.
override
isCoinSupportedByHw(CryptoCoins<BaseCoinConfig> coin, {required int device}) → bool

Available on HwApi, provided by the EasyHwApiX extension

Offline check: does device speak this coin's curve? Pure backend table lookup (HwApi.supportsCoin) — no transport, no HW.
ledgerFingerprint() → BuBytes
Builds Ledger v2 GET_MASTER_FINGERPRINT request; throws CryptoException on native failure.
override
ledgerFingerprintParse({required BuBytes response}) → BuBytes
Parses 4-byte fingerprint; throws CryptoException on native failure.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseAddressResponse({required int device, required BuBytes response}) → BuBytes
Parses USB response bytes for device to pubkey/address bytes; throws CryptoException on native failure.
override
parsePath(String path) → BuBytes
Parses BIP path string path to <u32 LE> bytes; throws CryptoException on native failure.
override
parseSignResponse({required int device, required BuBytes response}) → BuBytes
Parses sign response to signature bytes; throws CryptoException on native failure.
override
parseTxRequest({required int device, required BuBytes response}) → (int, int)
Parses one TxRequest; throws CryptoException on native failure.
override
psbtCounts({required BuBytes psbt}) → (int, int)
Returns (inputCount, outputCount) for PSBT psbt; throws CryptoException on native failure.
override
qrParse({required int device, required String qr}) → BuBytes
Parses single-part airgap QR qr for device to payload bytes; throws CryptoException on native failure.
override
qrRequest({required int device, required int coin, required BuBytes pathU32}) → String
Builds airgap QR string for device, coin and pathU32; throws CryptoException on native failure.
override
signedIdentityAddress({required BuBytes response}) → String
Trezor: parses SignedIdentity.address; throws CryptoException on native failure.
override
signedIdentityPubkey({required BuBytes response}) → BuBytes
Trezor: parses SignedIdentity.public_key; throws CryptoException on native failure.
override
signedIdentitySignature({required BuBytes response}) → BuBytes
Trezor: parses SignedIdentity.signature; throws CryptoException on native failure.
override
signIdentityRequest({required BuBytes identity, required BuBytes hidden, String visual = '', int curve = 0}) → BuBytes
Trezor: builds framed SignIdentity; throws CryptoException on native failure.
override
signRequest({required int device, required int coin, required BuBytes pathU32, required BuBytes payload}) → BuBytes
Builds sign-request bytes; throws CryptoException on native failure.
override
signTxStart({required int device, required int coin, required int inputsCount, required int outputsCount}) → BuBytes
Opens a Trezor SignTx session; throws CryptoException on native failure.
override
supportsCoin({required int device, required int coin}) → bool
Offline curve-table check whether device supports coin; throws CryptoException on native failure.
override
toString() → String
A string representation of this object.
inherited
txAckBinOutput({required BuBytes scriptPubKey, required int amountSat}) → BuBytes
TxAck for previous-transaction TXOUTPUT; throws CryptoException on native failure.
override
txAckChange({required BuBytes pathU32, required int amountSat, required int scriptType}) → BuBytes
TxAck for TXOUTPUT (change); throws CryptoException on native failure.
override
txAckInput({required BuBytes prevHash32, required int prevIndex, required BuBytes pathU32, required int amountSat, required BuBytes scriptSig, required int scriptType}) → BuBytes
TxAck for TXINPUT; throws CryptoException on native failure.
override
txAckMeta({required int version, required int lockTime, required int inputsCount, required int outputsCount}) → BuBytes
TxAck for TXMETA; throws CryptoException on native failure.
override
txAckOutput({required String address, required int amountSat, required int scriptType}) → BuBytes
TxAck for TXOUTPUT (address); throws CryptoException on native failure.
override
txRequestSerialized({required int device, required BuBytes response}) → BuBytes
TXFINISHED serialized transaction; throws CryptoException on native failure.
override
txRequestSignature({required int device, required BuBytes response}) → BuBytes
TXFINISHED signature bytes; throws CryptoException on native failure.
override
txRequestTxHash({required int device, required BuBytes response}) → BuBytes
TxRequest prev-tx hash; throws CryptoException on native failure.
override
urDecodePayload(String ur) → BuBytes
Decodes UR ur to payload bytes; throws CryptoException on native failure.
override
urDecodeType(String ur) → String
Decodes UR ur to its type string; throws CryptoException on native failure.
override
urEncode({required String type, required BuBytes payload}) → String
Encodes payload as single-part ur:<type>/... string; throws CryptoException on native failure.
override
validatePath({required int device, required int coin, required BuBytes pathU32}) → void
Validates pathU32 shape for device and coin; throws CryptoException on native failure.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited