import { Observable } from "rxjs"; import { GetAddressFn } from "./getAddressWrapper"; import type { GetAddressResult } from "../derivation"; import type { CryptoCurrency } from "../types"; import type { Account, AccountBridge, AccountRaw, CurrencyBridge, DerivationMode, Operation, ProtoNFT, SyncConfig, TransactionCommon, TransactionStatusCommon } from "@ledgerhq/types-live"; type IterateResult = ({ index, derivationsCache, derivationScheme, derivationMode, currency, deviceId, }: { index: number; derivationsCache: Record; derivationScheme: string; derivationMode: DerivationMode; currency: CryptoCurrency; deviceId: string; }) => Promise; export type IterateResultBuilder = ({ result, // derivation on the "root" of the derivation derivationMode, // identify the current derivation scheme derivationScheme, }: { result: GetAddressResult; derivationMode: DerivationMode; derivationScheme: string; }) => Promise; export type AccountShapeInfo = { currency: CryptoCurrency; address: string; index: number; initialAccount?: A | undefined; derivationPath: string; derivationMode: DerivationMode; rest?: any; deviceId?: string; }; export type GetAccountShape = (accountShape: AccountShapeInfo, config: SyncConfig) => Promise>; export type GetAccountShapeStream = (accountShape: AccountShapeInfo, config: SyncConfig) => Observable>; export declare const sameOp: (a: Operation, b: Operation) => boolean; export declare function mergeOps(existing: Operation[], // existing operations. sorted (newer to older). deduped. newFetched: Operation[]): Operation[]; export declare const mergeNfts: (oldNfts: ProtoNFT[], newNfts: ProtoNFT[]) => ProtoNFT[]; export declare const makeSync: ({ getAccountShape, postSync, shouldMergeOps, }: { getAccountShape: GetAccountShape | GetAccountShapeStream; postSync?: (initial: A, synced: A) => A; shouldMergeOps?: boolean; }) => AccountBridge["sync"]; export declare const makeScanAccounts: ({ getAccountShape, buildIterateResult, getAddressFn, postSync, }: { getAccountShape: GetAccountShape | GetAccountShapeStream; buildIterateResult?: IterateResultBuilder; getAddressFn: GetAddressFn; postSync?: (initial: A, synced: A) => A; }) => CurrencyBridge["scanAccounts"]; export declare function makeAccountBridgeReceive(getAddressFn: GetAddressFn, { injectGetAddressParams, }?: { injectGetAddressParams?: (account: A) => any; }): (account: A, { verify, deviceId, path, }: { verify?: boolean; deviceId: string; subAccountId?: string; path?: string; }) => Observable; /** * Default trivial implem for updateTransaction, that keeps reference stability (for React) */ export declare function updateTransaction(t: T, patch: Partial): T; /** * Default trivial implem for getSerializedAddressParameters */ export declare function getSerializedAddressParameters(account: Account): Buffer; /** * Parses a BIP32 path string (e.g. "m/84'/0'/0'") into an array of path indices. * Uses the bip32-path library for consistent parsing across the codebase. */ export declare function pathStringToArray(path: string): number[]; export declare function bip32asBuffer(path: string): Buffer; export {}; //# sourceMappingURL=jsHelpers.d.ts.map