Skip to main content

Class: LedgerTransportImpl

A link to a Ledger device implemented in the host language, for the links the SDK does not provide: Bluetooth through Ledger's mobile SDKs, or WebHID and WebUSB in the browser.

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

readonly [uniffiTypeNameSymbol]: "LedgerTransportImpl" = "LedgerTransportImpl";

Methods​

exchange()​

exchange(apdu, asyncOpts_?): Promise<ArrayBuffer>;

Send an APDU command (cla ins p1 p2 len data) to the device and return its answer: the response payload followed by the two-byte status word.

Opening or closing an app closes the link on some transports. Ledger then calls this at intervals until the app answers, so re-establish a closed link here.

Parameters​

apdu​

ArrayBuffer

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<ArrayBuffer>

Implementation of​

LedgerTransport.exchange


uniffiDestroy()​

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns​

void

Overrides​

UniffiAbstractObject.uniffiDestroy


uniffiUse()​

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters​

T​

T

Parameters​

block​

(obj) => T

Returns​

T

Inherited from​

UniffiAbstractObject.uniffiUse


instanceOf()​

static instanceOf(obj_): obj_ is LedgerTransportImpl;

Parameters​

obj_​

any

Returns​

obj_ is LedgerTransportImpl