UNPKG

@ledgerhq/live-common

Version:
34 lines 1.45 kB
import { AccountLike } from "@ledgerhq/types-live"; import { AppManifest } from "./types"; import { TrackingAPI } from "./tracking"; import { CurrentAccountHistDB, UiHook } from "./react"; type MessageId = number | string | null; interface JsonRpcRequestMessage<TParams = any> { jsonrpc: "2.0"; id?: MessageId; method: string; params?: TParams; } export declare const currentAccountAtomFamily: import("jotai-family").AtomFamily<string, import("jotai").PrimitiveAtom<AccountLike | null> & { init: AccountLike | null; }>; export declare function useDappCurrentAccount(manifestId: string, currentAccountHistDb?: CurrentAccountHistDB): { currentAccount: AccountLike | null; setCurrentAccount: (args_0: AccountLike | ((prev: AccountLike | null) => AccountLike | null) | null) => void; setCurrentAccountHist: (manifestId: string, account: AccountLike) => void; }; export declare function useDappLogic({ manifest, accounts, postMessage, uiHook, tracking, currentAccountHistDb, initialAccountId, mevProtected, }: { manifest: AppManifest; postMessage: (message: string) => void; accounts: AccountLike[]; uiHook: UiHook; tracking: TrackingAPI; currentAccountHistDb?: CurrentAccountHistDB; initialAccountId?: string; mevProtected?: boolean; }): { onDappMessage: (data: JsonRpcRequestMessage) => Promise<void>; noAccounts: boolean; }; export {}; //# sourceMappingURL=useDappLogic.d.ts.map