Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default type-parameter to LedgerBridge #1

Open
wants to merge 1 commit into
base: feat/refactor-to-enable-addtional-bridge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ledger-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export type LedgerSignTypedDataResponse = Awaited<
ReturnType<LedgerHwAppEth['signEIP712HashedMessage']>
>;

export type LedgerBridgeOptions = Record<string, string | number | object>;
type LedgerBridgeOptions = Record<string, string | number | object>;

export type LedgerBridgeSerializeData = Record<
string,
string | number | object
>;

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export interface LedgerBridge<T extends LedgerBridgeOptions> {
export interface LedgerBridge<T extends LedgerBridgeOptions = LedgerBridgeOptions> {
isDeviceConnected: boolean;

init(): Promise<void>;
Expand Down
7 changes: 3 additions & 4 deletions src/ledger-keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import HDKey from 'hdkey';

import {
LedgerBridge,
LedgerBridgeOptions,
LedgerBridgeSerializeData,
} from './ledger-bridge';

Expand All @@ -35,7 +34,7 @@ enum NetworkApiUrls {
}

type SignTransactionPayload = Awaited<
ReturnType<LedgerBridge<LedgerBridgeOptions>['deviceSignTransaction']>
ReturnType<LedgerBridge['deviceSignTransaction']>
>;

export type AccountDetails = {
Expand Down Expand Up @@ -98,9 +97,9 @@ export class LedgerKeyring extends EventEmitter {

implementFullBIP44 = false;

bridge: LedgerBridge<LedgerBridgeOptions>;
bridge: LedgerBridge;

constructor({ bridge }: { bridge: LedgerBridge<LedgerBridgeOptions> }) {
constructor({ bridge }: { bridge: LedgerBridge }) {
super();

if (!bridge) {
Expand Down