Class: TransportWalletAPI
Wallet API Transport implementation
Hierarchy
default
↳
TransportWalletAPI
Constructors
constructor
• new TransportWalletAPI(walletApi
, transportId
)
Parameters
Name | Type |
---|---|
walletApi | WalletAPIClient |
transportId | string |
Overrides
Transport.constructor
Defined in
packages/client/src/TransportWalletAPI.ts:16
Properties
_appAPIlock
• _appAPIlock: null
| string
Inherited from
Transport._appAPIlock
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:150
_events
• _events: EventEmitter
Inherited from
Transport._events
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:104
deviceModel
• deviceModel: undefined
| null
| DeviceModel
Inherited from
Transport.deviceModel
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:43
exchangeAtomicImpl
• exchangeAtomicImpl: (f
: () => Promise
<void
| Buffer
>) => Promise
<void
| Buffer
>
Type declaration
▸ (f
): Promise
<void
| Buffer
>
Parameters
Name | Type |
---|---|
f | () => Promise <void | Buffer > |
Returns
Promise
<void
| Buffer
>
Inherited from
Transport.exchangeAtomicImpl
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:148
exchangeBusyPromise
• exchangeBusyPromise: undefined
| null
| Promise
<void
>
Inherited from
Transport.exchangeBusyPromise
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:147
exchangeTimeout
• exchangeTimeout: number
Inherited from
Transport.exchangeTimeout
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:41
send
• send: (cla
: number
, ins
: number
, p1
: number
, p2
: number
, data?
: Buffer
, statusList?
: number
[]) => Promise
<Buffer
>
Type declaration
▸ (cla
, ins
, p1
, p2
, data?
, statusList?
): Promise
<Buffer
>
wrapper on top of exchange to simplify work of the implementation.
Parameters
Name | Type | Description |
---|---|---|
cla | number | |
ins | number | |
p1 | number | |
p2 | number | |
data? | Buffer | |
statusList? | number [] | is a list of accepted status code (shorts). [0x9000] by default |
Returns
Promise
<Buffer
>
a Promise of response buffer
Inherited from
Transport.send
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:138
transportId
• transportId: string
Defined in
packages/client/src/TransportWalletAPI.ts:14
unresponsiveTimeout
• unresponsiveTimeout: number
Inherited from
Transport.unresponsiveTimeout
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:42
walletApi
• walletApi: WalletAPIClient
Defined in
packages/client/src/TransportWalletAPI.ts:12
ErrorMessage_ListenTimeout
▪ Static
ErrorMessage_ListenTimeout: string
Inherited from
Transport.ErrorMessage_ListenTimeout
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:152
ErrorMessage_NoDeviceFound
▪ Static
ErrorMessage_NoDeviceFound: string
Inherited from
Transport.ErrorMessage_NoDeviceFound
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:153
Methods
close
▸ close(): Promise
<void
>
Close the current transport communication.
Throws
RpcError if an error occured on server side
Returns
Promise
<void
>
Overrides
Transport.close
Defined in
packages/client/src/TransportWalletAPI.ts:79
decorateAppAPIMethod
▸ decorateAppAPIMethod<R
, A
>(methodName
, f
, ctx
, scrambleKey
): (...args
: A
) => Promise
<R
>
Type parameters
Name | Type |
---|---|
R | R |
A | extends any [] |
Parameters
Name | Type |
---|---|
methodName | string |
f | (...args : A ) => Promise <R > |
ctx | any |
scrambleKey | string |
Returns
fn
▸ (...args
): Promise
<R
>
Parameters
Name | Type |
---|---|
...args | A |
Returns
Promise
<R
>
Inherited from
Transport.decorateAppAPIMethod
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:151
decorateAppAPIMethods
▸ decorateAppAPIMethods(self
, methods
, scrambleKey
): void
Parameters
Name | Type |
---|---|
self | Record <string , any > |
methods | string [] |
scrambleKey | string |
Returns
void
Inherited from
Transport.decorateAppAPIMethods
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:149
emit
▸ emit(event
, ...args
): void
Parameters
Name | Type |
---|---|
event | string |
...args | any |
Returns
void
Inherited from
Transport.emit
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:115
exchange
▸ exchange(apdu
): Promise
<Buffer
>
Exchange with the device using APDU protocol.
Throws
RpcError if an error occured on server side
Parameters
Name | Type |
---|---|
apdu | Buffer |
Returns
Promise
<Buffer
>
a promise of apdu response
Overrides
Transport.exchange
Defined in
packages/client/src/TransportWalletAPI.ts:55
off
▸ off(eventName
, cb
): void
Stop listening to an event on an instance of transport.
Parameters
Name | Type |
---|---|
eventName | string |
cb | (...args : any []) => any |
Returns
void
Inherited from
Transport.off
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:114
on
▸ on(eventName
, cb
): void
Listen to an event on an instance of transport. Transport implementation can have specific events. Here is the common events:
"disconnect"
: triggered if Transport is disconnected
Parameters
Name | Type |
---|---|
eventName | string |
cb | (...args : any []) => any |
Returns
void
Inherited from
Transport.on
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:110
setDebugMode
▸ setDebugMode(): void
Enable or not logs of the binary exchange
Returns
void
Inherited from
Transport.setDebugMode
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:119
setExchangeTimeout
▸ setExchangeTimeout(exchangeTimeout
): void
Set a timeout (in milliseconds) for the exchange call. Only some transport might implement it. (e.g. U2F)
Parameters
Name | Type |
---|---|
exchangeTimeout | number |
Returns
void
Inherited from
Transport.setExchangeTimeout
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:123
setExchangeUnresponsiveTimeout
▸ setExchangeUnresponsiveTimeout(unresponsiveTimeout
): void
Define the delay before emitting "unresponsive" on an exchange that does not respond
Parameters
Name | Type |
---|---|
unresponsiveTimeout | number |
Returns
void
Inherited from
Transport.setExchangeUnresponsiveTimeout
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:127
setScrambleKey
▸ setScrambleKey(): void
Returns
void
Overrides
Transport.setScrambleKey
Defined in
packages/client/src/TransportWalletAPI.ts:72
create
▸ Static
create(openTimeout?
, listenTimeout?
): Promise
<default
>
create() allows to open the first descriptor available or throw if there is none or if timeout is reached. This is a light helper, alternative to using listen() and open() (that you may need for any more advanced usecase)
Example
TransportFoo.create().then(transport => ...)
Parameters
Name | Type |
---|---|
openTimeout? | number |
listenTimeout? | number |
Returns
Promise
<default
>
Inherited from
Transport.create
Defined in
node_modules/.pnpm/@ledgerhq+hw-transport@6.27.10/node_modules/@ledgerhq/hw-transport/lib/Transport.d.ts:146
isSupported
▸ Static
isSupported(): Promise
<boolean
>
Check if Wallet API transport is supported.
Returns
Promise
<boolean
>
Overrides
Transport.isSupported
Defined in
packages/client/src/TransportWalletAPI.ts:25
list
▸ Static
list(): Promise
<never
[]>
This transport is not discoverable
Returns
Promise
<never
[]>
Overrides
Transport.list
Defined in
packages/client/src/TransportWalletAPI.ts:30
listen
▸ Static
listen(_observer
): Object
Parameters
Name | Type |
---|---|
_observer | unknown |
Returns
Object
Name | Type |
---|---|
unsubscribe | () => void |
Overrides
Transport.listen
Defined in
packages/client/src/TransportWalletAPI.ts:32
open
▸ Static
open(«destructured»
): Promise
<default
>
Create a Ledger transport with the Wallet API transport
Parameters
Name | Type |
---|---|
«destructured» | Object |
› transportId | string |
› walletApi | WalletAPIClient |
Returns
Promise
<default
>
Overrides
Transport.open
Defined in
packages/client/src/TransportWalletAPI.ts:39