Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/ledgerhq__hw-transport

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/ledgerhq__hw-transport

TypeScript definitions for @ledgerhq/hw-transport

  • 4.21.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by12.99%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/ledgerhq__hw-transport

Summary

This package contains type definitions for @ledgerhq/hw-transport (https://github.com/LedgerHQ/ledgerjs/tree/master/packages/hw-transport).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ledgerhq__hw-transport.

index.d.ts

/// <reference types="node" />

declare class Transport<TDescriptor extends Descriptor = string> {
    constructor();
    static isSupported(): Promise<boolean>;
    static list(): Promise<ReadonlyArray<Descriptor>>;
    static listen(observer: Observer<DescriptorEvent<Descriptor>>): Subscription;
    static open(descriptor: Descriptor, timeout?: number): Promise<Transport<typeof descriptor>>;
    static create(openTimeout?: number, listenTimeout?: number): Promise<Transport<Descriptor>>;
    exchange(apdu: Buffer): Promise<Buffer>;
    setScrambleKey(key: string): void;
    close(): Promise<void>;
    on(eventName: string, cb: any): void;
    off(eventName: string, cb: any): void;
    setDebugMode(debug: boolean | ((log: string) => void)): void;
    setExchangeTimeout(exchangeTimeout: number): void;
    /**
     * A wrapper around exchange to simplify work of the implementation.
     * @param data The data to be sent. Defaults to a zero-length Buffer.
     * @param statusList A list of accepted status code (shorts). [0x9000] by default.
     * @return A Promise of the response Buffer
     */
    send(
        cla: number,
        ins: number,
        p1: number,
        p2: number,
        data?: Buffer,
        statusList?: ReadonlyArray<number>,
    ): Promise<Buffer>;
    decorateAppAPIMethods(self: any, methods: string[], scrambleKey: string): void;
}

export type Device = any;
export type Descriptor = string; // ?
export interface DescriptorEvent<Descriptor> {
    type: "add" | "remove";
    descriptor: Descriptor;
    device?: Device | undefined;
}
export interface Observer<Ev> {
    readonly next: (event: Ev) => any;
    readonly error: (e: any) => any;
    readonly complete: () => any;
}
export interface Subscription {
    readonly unsubscribe: () => void;
}
export function getAltStatusMessage(code: number): string;
export const StatusCodes: { [k in string]: number };

export default Transport;

Additional Details

  • Last updated: Wed, 18 Oct 2023 05:47:07 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Daniel Byrne.

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc