@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
33 lines • 1.43 kB
TypeScript
import { type Observable } from "rxjs";
import type { Account } from "@ledgerhq/types-live";
import type Transport from "@ledgerhq/hw-transport";
import type { AppRequest, AppState } from "../../../../hw/actions/app";
import type { Device } from "../../../../hw/actions/types";
import type { ConnectAppEvent, Input as ConnectAppInput } from "../../../../hw/connectApp";
export type ViewKeysByAccountId = Record<string, string | null> | null;
type BaseState = {
error: Error | null;
result: ViewKeysByAccountId;
sharePending: boolean;
shareProgress: {
completed: number;
total: number;
viewKeys: NonNullable<ViewKeysByAccountId>;
};
};
export type State = AppState & BaseState;
export type ViewKeyProgress = {
viewKeys: NonNullable<ViewKeysByAccountId>;
completed: number;
total: number;
};
export interface Request extends AppRequest {
selectedAccounts: Account[];
}
export declare const getViewKeyExec: (transport: Transport, request: Request) => Observable<ViewKeyProgress>;
export declare const createAction: (connectAppExec: (connectAppInput: ConnectAppInput) => Observable<ConnectAppEvent>, getViewKey: (transport: Transport, request: Request) => Observable<ViewKeyProgress>) => {
useHook: (reduxDevice: Device | null | undefined, request: Request) => State;
mapResult: (state: State) => ViewKeysByAccountId;
};
export {};
//# sourceMappingURL=index.d.ts.map