Hardware-wallet codec API (Ledger / Trezor / BitBox02 / airgap QR).
Device and coin ids are the connector constants BuHwDevice and
BuHwCoin (must match Rust DeviceKind::ALL / WELL_KNOWN_COINS order).
Paths cross the boundary as <u32 LE> bytes — see u32sToLeBytes.
Backends: DartHwApi (pure Dart — unimplemented, throws
UnimplementedError) and NativeHwApi (Rust hw core via BuHwApi).
Transport (USB/BLE/NFC) is never in this API — see BuHwTransport.
- Implementers
- Available extensions
Properties
- 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:
Request{btc_pub}bytes. -
bitboxDecrypt(
{required BuBytes ciphertext}) → BuBytes - BitBox02: decrypt one post-handshake message.
-
bitboxEncrypt(
{required BuBytes plaintext}) → BuBytes - BitBox02: encrypt one post-handshake message.
-
bitboxFree(
) → void - BitBox02: close + wipe session (idempotent).
-
bitboxHsHash(
) → BuBytes - BitBox02: handshake hash (pairing-code source).
-
bitboxHsM1(
) → BuBytes - BitBox02: handshake m1 (32 B).
-
bitboxHsM2(
{required BuBytes m2}) → void - BitBox02: ingest handshake m2 (96 B).
-
bitboxHsM3(
) → BuBytes - BitBox02: handshake m3 (64 B).
-
bitboxHsNew(
{required BuBytes staticPriv32, required BuBytes ephemeralPriv32}) → void - BitBox02: open initiator session (fails if one is already open).
-
bitboxHsSplit(
) → void - BitBox02: split into transport keys.
-
bitboxPubParse(
{required BuBytes response}) → String -
BitBox02:
Response→ xpub string. -
bitboxSignChange(
{required BuBytes pathU32, required int amountSat, required int scriptConfigIndex}) → BuBytes -
BitBox02:
Request{btc_sign_output}bytes (change). -
bitboxSignInit(
{required int coin, required BuBytes pathU32, required int simpleType, required int version, required int inputsCount, required int outputsCount, required int locktime}) → BuBytes -
BitBox02:
Request{btc_sign_init}bytes. -
bitboxSignInput(
{required BuBytes prevHash32, required int prevIndex, required int amountSat, required int sequence, required BuBytes pathU32, required int scriptConfigIndex}) → BuBytes -
BitBox02:
Request{btc_sign_input}bytes. -
bitboxSignNextParse(
{required BuBytes response}) → (int, int) -
BitBox02:
sign_next→(requestType, index)(-1 = absent). -
bitboxSignNextPrevIndex(
{required BuBytes response}) → int -
BitBox02:
prev_indexfor PREVTX_* (-1 = absent). -
bitboxSignNextSignature(
{required BuBytes response}) → BuBytes -
BitBox02:
DONEsignature (64 B R||S). -
bitboxSignOutput(
{required int outputType, required int amountSat, required BuBytes payload}) → BuBytes -
BitBox02:
Request{btc_sign_output}bytes (external address). -
bitboxSignPrevtxInit(
{required int version, required int inputsCount, required int outputsCount, required int locktime}) → BuBytes -
BitBox02:
Request{btc: BTCRequest{prevtx_init}}bytes. -
bitboxSignPrevtxInput(
{required BuBytes prevHash32, required int prevIndex, required BuBytes scriptSig, required int sequence}) → BuBytes -
BitBox02:
Request{btc: BTCRequest{prevtx_input}}bytes. -
bitboxSignPrevtxOutput(
{required int amountSat, required BuBytes script}) → BuBytes -
BitBox02:
Request{btc: BTCRequest{prevtx_output}}bytes. -
defaultHwPath(
CryptoCoins< BaseCoinConfig> coin) → String -
Available on HwApi, provided by the EasyHwApiX extension
Full default pathm/purpose'/coinIdx'/defPath(defPathalready contains the account level, e.g. BTC0'/0/0, Tezos0'/0'). -
executeGetAddress(
{required int device, required int coin, required BuBytes pathU32, required BuHwTransport transport}) → Future< BuBytes> -
Build request →
transport.exchange→ parse. USB devices only. -
executeSign(
{required int device, required int coin, required BuBytes pathU32, required BuBytes payload, required BuHwTransport transport}) → Future< BuBytes> -
Build request →
transport.exchange→ parse. USB devices only. -
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 ownaddressEncoder→ ready address string. (Monero intentionally throws — it has no coin-config address derivation.) -
getAddressRequest(
{required int device, required int coin, required BuBytes pathU32}) → BuBytes -
USB request bytes (Ledger APDU / Trezor
?##frame). Airgap → throws. -
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.pathdefaults to defaultHwPath. Needs a connectedtransport(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 -
Chunk
payloadinto concatenated 64-byte HID reports (real USB/WebHID). -
hidUnframe(
{required BuBytes reports, int channel = BuHwHid.channelDefault, int tag = BuHwHid.tagApdu}) → BuBytes -
Reassemble concatenated 64-byte
reports(length % 64 == 0). -
hwCoinIdFor(
CryptoCoins< BaseCoinConfig> coin) → int -
Available on HwApi, provided by the EasyHwApiX extension
Connector coin id forcoin, 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
IdentityTypebytes (protoselects ssh/gpg/…). -
isAirgap(
{required int device}) → bool - True for QR/SD-only devices (Passport / Keystone / Coldcard-QR / Jade-QR).
-
isCoinSupportedByHw(
CryptoCoins< BaseCoinConfig> coin, {required int device}) → bool -
Available on HwApi, provided by the EasyHwApiX extension
Offline check: doesdevicespeak this coin's curve? Pure backend table lookup (HwApi.supportsCoin) — no transport, no HW. -
ledgerFingerprint(
) → BuBytes -
Ledger v2
GET_MASTER_FINGERPRINTrequest (no input, no UI). -
ledgerFingerprintParse(
{required BuBytes response}) → BuBytes -
4-byte root fingerprint from
DATA || 0x9000. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseAddressResponse(
{required int device, required BuBytes response}) → BuBytes - USB response bytes → pubkey/address bytes.
-
parsePath(
String path) → BuBytes -
"m/44'/0'/0'/0/0"→<u32 LE>bytes for the calls below. -
parseSignResponse(
{required int device, required BuBytes response}) → BuBytes - Sign response bytes → signature bytes.
-
parseTxRequest(
{required int device, required BuBytes response}) → (int, int) -
One
TxRequest→(requestType, requestIndex)(-1 = absent). -
psbtCounts(
{required BuBytes psbt}) → (int, int) -
PSBT bytes →
(inputCount, outputCount). -
qrParse(
{required int device, required String qr}) → BuBytes -
Airgap: scanned single-part QR → payload bytes.
(Multipart: assemble with
BuUrAssemblerfirst.) -
qrRequest(
{required int device, required int coin, required BuBytes pathU32}) → String -
Airgap: string to show as QR (
ur:bytes/...). USB → throws. -
signedIdentityAddress(
{required BuBytes response}) → String -
SignedIdentity.addressstring. -
signedIdentityPubkey(
{required BuBytes response}) → BuBytes -
SignedIdentity.public_keybytes. -
signedIdentitySignature(
{required BuBytes response}) → BuBytes -
SignedIdentity.signaturebytes. -
signIdentityRequest(
{required BuBytes identity, String visual = '', int curve = 0}) → BuBytes -
Trezor framed
SignIdentity(curve: 0 omit, 1 secp256k1, 2 nist256p1). -
signRequest(
{required int device, required int coin, required BuBytes pathU32, required BuBytes payload}) → BuBytes -
Sign-request bytes (Trezor
SignMessageframe; Ledger errors — app-bitcoin v2 signs via the PSBT wallet flow). -
signTxStart(
{required int device, required int coin, required int inputsCount, required int outputsCount}) → BuBytes -
Open a Trezor
SignTxsession (inputs/outputs counts). -
supportsCoin(
{required int device, required int coin}) → bool - True when the device family can derive the coin's curve.
-
toString(
) → String -
A string representation of this object.
inherited
-
txAckBinOutput(
{required BuBytes scriptPubKey, required int amountSat}) → BuBytes -
TxAckansweringTXOUTPUTof a PREVIOUS transaction. -
txAckChange(
{required BuBytes pathU32, required int amountSat, required int scriptType}) → BuBytes -
TxAckansweringTXOUTPUT(change back to path). -
txAckInput(
{required BuBytes prevHash32, required int prevIndex, required BuBytes pathU32, required int amountSat, required BuBytes scriptSig, required int scriptType}) → BuBytes -
TxAckansweringTXINPUT. -
txAckMeta(
{required int version, required int lockTime, required int inputsCount, required int outputsCount}) → BuBytes -
TxAckansweringTXMETA. -
txAckOutput(
{required String address, required int amountSat, required int scriptType}) → BuBytes -
TxAckansweringTXOUTPUT(pay to address). -
txRequestSerialized(
{required int device, required BuBytes response}) → BuBytes -
TXFINISHEDconsensus-serialized transaction. -
txRequestSignature(
{required int device, required BuBytes response}) → BuBytes -
TXFINISHEDsignature bytes. -
txRequestTxHash(
{required int device, required BuBytes response}) → BuBytes -
TxRequestprev-tx hash (32 bytes). -
urDecodePayload(
String ur) → BuBytes - UR shard → payload bytes.
-
urDecodeType(
String ur) → String -
UR shard → type string (e.g.
bytes,crypto-psbt). -
urEncode(
{required String type, required BuBytes payload}) → String -
ur:<type>/<body>(single-part envelope). -
validatePath(
{required int device, required int coin, required BuBytes pathU32}) → void - Throws on bad shape (wrong purpose/coin, soft index on ed25519, …).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited