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

Commit

Permalink
feat: According to Gustova's feedback, and modify the LedgerMobileBri…
Browse files Browse the repository at this point in the history
…dge interface to `MobileBridge` extends `LedgerBridge`
  • Loading branch information
dawnseeker8 committed Jul 10, 2024
1 parent 5966762 commit 5d45eb4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/ledger-mobile-bridge.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
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,
LedgerBridge,
LedgerBridgeOptions,
LedgerSignMessageParams,
LedgerSignMessageResponse,
LedgerSignTransactionParams,
Expand All @@ -21,7 +19,8 @@ import {
LedgerMobileBridgeOptions,
} from './type';

export type MobileBridge<T extends LedgerBridgeOptions> = LedgerBridge<T> & {
// MobileBridge Type will always use LedgerBridge with LedgerMobileBridgeOptions
export type MobileBridge = LedgerBridge<LedgerMobileBridgeOptions> & {
getAppNameAndVersion(): Promise<GetAppNameAndVersionResponse>;
openEthApp(): Promise<void>;
closeApps(): Promise<void>;
Expand All @@ -30,9 +29,7 @@ export type MobileBridge<T extends LedgerBridgeOptions> = LedgerBridge<T> & {
/**
* LedgerMobileBridge is a bridge between the LedgerKeyring and the LedgerTransportMiddleware.
*/
export class LedgerMobileBridge
implements MobileBridge<LedgerMobileBridgeOptions>
{
export class LedgerMobileBridge implements MobileBridge {
#transportMiddleware?: TransportMiddleware;

#opts: LedgerMobileBridgeOptions;
Expand Down

0 comments on commit 5d45eb4

Please sign in to comment.