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, Rusthwcore).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}; throwsCryptoExceptionon native failure.override -
bitboxDecrypt(
{required BuBytes ciphertext}) → BuBytes -
BitBox02: decrypts one message; throws
CryptoExceptionon native failure.override -
bitboxEncrypt(
{required BuBytes plaintext}) → BuBytes -
BitBox02: encrypts one message; throws
CryptoExceptionon native failure.override -
bitboxFree(
) → void -
BitBox02: closes session; throws
CryptoExceptionon native failure.override -
bitboxHsHash(
) → BuBytes -
BitBox02: handshake hash; throws
CryptoExceptionon native failure.override -
bitboxHsM1(
) → BuBytes -
BitBox02: handshake m1; throws
CryptoExceptionon native failure.override -
bitboxHsM2(
{required BuBytes m2}) → void -
BitBox02: ingests handshake m2; throws
CryptoExceptionon native failure.override -
bitboxHsM3(
) → BuBytes -
BitBox02: handshake m3; throws
CryptoExceptionon native failure.override -
bitboxHsNew(
{required BuBytes staticPriv32, required BuBytes ephemeralPriv32}) → void -
BitBox02: opens initiator session; throws
CryptoExceptionon native failure.override -
bitboxHsSplit(
) → void -
BitBox02: splits into transport keys; throws
CryptoExceptionon native failure.override -
bitboxPubParse(
{required BuBytes response}) → String -
BitBox02: parses
Responseto xpub string; throwsCryptoExceptionon native failure.override -
bitboxSignChange(
{required BuBytes pathU32, required int amountSat, required int scriptConfigIndex}) → BuBytes -
BitBox02: builds change
Request{btc_sign_output}; throwsCryptoExceptionon 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}; throwsCryptoExceptionon 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}; throwsCryptoExceptionon native failure.override -
bitboxSignNextParse(
{required BuBytes response}) → (int, int) -
BitBox02: parses
sign_next; throwsCryptoExceptionon native failure.override -
bitboxSignNextPrevIndex(
{required BuBytes response}) → int -
BitBox02: extracts
prev_index; throwsCryptoExceptionon native failure.override -
bitboxSignNextSignature(
{required BuBytes response}) → BuBytes -
BitBox02: extracts
DONEsignature; throwsCryptoExceptionon native failure.override -
bitboxSignOutput(
{required int outputType, required int amountSat, required BuBytes payload}) → BuBytes -
BitBox02: builds external
Request{btc_sign_output}; throwsCryptoExceptionon native failure.override -
bitboxSignPrevtxInit(
{required int version, required int inputsCount, required int outputsCount, required int locktime}) → BuBytes -
BitBox02: builds
prevtx_init; throwsCryptoExceptionon native failure.override -
bitboxSignPrevtxInput(
{required BuBytes prevHash32, required int prevIndex, required BuBytes scriptSig, required int sequence}) → BuBytes -
BitBox02: builds
prevtx_input; throwsCryptoExceptionon native failure.override -
bitboxSignPrevtxOutput(
{required int amountSat, required BuBytes script}) → BuBytes -
BitBox02: builds
prevtx_output; throwsCryptoExceptionon native failure.override -
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> -
Builds request then exchanges via
transportand parses address bytes; throwsCryptoExceptionon 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
transportand parses signature; throwsCryptoExceptionon 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 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 -
Builds USB request bytes for
device,coinandpathU32; throwsCryptoExceptionon 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.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 -
Chunks
payloadinto concatenated 64-byte HID reports; throwsCryptoExceptionon native failure.override -
hidUnframe(
{required BuBytes reports, int channel = BuHwHid.channelDefault, int tag = BuHwHid.tagApdu}) → BuBytes -
Reassembles concatenated 64-byte HID
reports; throwsCryptoExceptionon native failure.override -
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: encodes
IdentityType; throwsCryptoExceptionon native failure.override -
isAirgap(
{required int device}) → bool -
Returns whether
deviceis QR/SD-only; throwsCryptoExceptionon native failure.override -
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 -
Builds Ledger v2
GET_MASTER_FINGERPRINTrequest; throwsCryptoExceptionon native failure.override -
ledgerFingerprintParse(
{required BuBytes response}) → BuBytes -
Parses 4-byte fingerprint; throws
CryptoExceptionon 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
responsebytes fordeviceto pubkey/address bytes; throwsCryptoExceptionon native failure.override -
parsePath(
String path) → BuBytes -
Parses BIP path string
pathto<u32 LE>bytes; throwsCryptoExceptionon native failure.override -
parseSignResponse(
{required int device, required BuBytes response}) → BuBytes -
Parses sign response to signature bytes; throws
CryptoExceptionon native failure.override -
parseTxRequest(
{required int device, required BuBytes response}) → (int, int) -
Parses one
TxRequest; throwsCryptoExceptionon native failure.override -
psbtCounts(
{required BuBytes psbt}) → (int, int) -
Returns
(inputCount, outputCount)for PSBTpsbt; throwsCryptoExceptionon native failure.override -
qrParse(
{required int device, required String qr}) → BuBytes -
Parses single-part airgap QR
qrfordeviceto payload bytes; throwsCryptoExceptionon native failure.override -
qrRequest(
{required int device, required int coin, required BuBytes pathU32}) → String -
Builds airgap QR string for
device,coinandpathU32; throwsCryptoExceptionon native failure.override -
signedIdentityAddress(
{required BuBytes response}) → String -
Trezor: parses
SignedIdentity.address; throwsCryptoExceptionon native failure.override -
signedIdentityPubkey(
{required BuBytes response}) → BuBytes -
Trezor: parses
SignedIdentity.public_key; throwsCryptoExceptionon native failure.override -
signedIdentitySignature(
{required BuBytes response}) → BuBytes -
Trezor: parses
SignedIdentity.signature; throwsCryptoExceptionon native failure.override -
signIdentityRequest(
{required BuBytes identity, String visual = '', int curve = 0}) → BuBytes -
Trezor: builds framed
SignIdentity; throwsCryptoExceptionon native failure.override -
signRequest(
{required int device, required int coin, required BuBytes pathU32, required BuBytes payload}) → BuBytes -
Builds sign-request bytes; throws
CryptoExceptionon native failure.override -
signTxStart(
{required int device, required int coin, required int inputsCount, required int outputsCount}) → BuBytes -
Opens a Trezor
SignTxsession; throwsCryptoExceptionon native failure.override -
supportsCoin(
{required int device, required int coin}) → bool -
Offline curve-table check whether
devicesupportscoin; throwsCryptoExceptionon native failure.override -
toString(
) → String -
A string representation of this object.
inherited
-
txAckBinOutput(
{required BuBytes scriptPubKey, required int amountSat}) → BuBytes -
TxAckfor previous-transactionTXOUTPUT; throwsCryptoExceptionon native failure.override -
txAckChange(
{required BuBytes pathU32, required int amountSat, required int scriptType}) → BuBytes -
TxAckforTXOUTPUT(change); throwsCryptoExceptionon native failure.override -
txAckInput(
{required BuBytes prevHash32, required int prevIndex, required BuBytes pathU32, required int amountSat, required BuBytes scriptSig, required int scriptType}) → BuBytes -
TxAckforTXINPUT; throwsCryptoExceptionon native failure.override -
txAckMeta(
{required int version, required int lockTime, required int inputsCount, required int outputsCount}) → BuBytes -
TxAckforTXMETA; throwsCryptoExceptionon native failure.override -
txAckOutput(
{required String address, required int amountSat, required int scriptType}) → BuBytes -
TxAckforTXOUTPUT(address); throwsCryptoExceptionon native failure.override -
txRequestSerialized(
{required int device, required BuBytes response}) → BuBytes -
TXFINISHEDserialized transaction; throwsCryptoExceptionon native failure.override -
txRequestSignature(
{required int device, required BuBytes response}) → BuBytes -
TXFINISHEDsignature bytes; throwsCryptoExceptionon native failure.override -
txRequestTxHash(
{required int device, required BuBytes response}) → BuBytes -
TxRequestprev-tx hash; throwsCryptoExceptionon native failure.override -
urDecodePayload(
String ur) → BuBytes -
Decodes UR
urto payload bytes; throwsCryptoExceptionon native failure.override -
urDecodeType(
String ur) → String -
Decodes UR
urto its type string; throwsCryptoExceptionon native failure.override -
urEncode(
{required String type, required BuBytes payload}) → String -
Encodes
payloadas single-partur:<type>/...string; throwsCryptoExceptionon native failure.override -
validatePath(
{required int device, required int coin, required BuBytes pathU32}) → void -
Validates
pathU32shape fordeviceandcoin; throwsCryptoExceptionon native failure.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited