Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
refactor: extend LedgerMobileBridge interface from LedgerBridge (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnseeker8 authored Jul 11, 2024
1 parent 3a82a2b commit 9496660
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/ledger-mobile-bridge.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ledgerService from '@ledgerhq/hw-app-eth/lib/services/ledger';
import type Transport from '@ledgerhq/hw-transport';

// eslint-disable-next-line import/no-nodejs-modules
import {
GetPublicKeyParams,
GetPublicKeyResponse,
Expand All @@ -20,19 +19,17 @@ import {
LedgerMobileBridgeOptions,
} from './type';

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface LedgerMobileBridge {
// MobileBridge Type will always use LedgerBridge with LedgerMobileBridgeOptions
export type MobileBridge = LedgerBridge<LedgerMobileBridgeOptions> & {
getAppNameAndVersion(): Promise<GetAppNameAndVersionResponse>;
openEthApp(): Promise<void>;
closeApps(): Promise<void>;
}
};

/**
* LedgerMobileBridge is a bridge between the LedgerKeyring and the LedgerTransportMiddleware.
*/
export class LedgerMobileBridge
implements LedgerBridge<LedgerMobileBridgeOptions>
{
export class LedgerMobileBridge implements MobileBridge {
#transportMiddleware?: TransportMiddleware;

#opts: LedgerMobileBridgeOptions;
Expand Down

0 comments on commit 9496660

Please sign in to comment.