@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
24 lines • 1.1 kB
TypeScript
import type { Unit } from "@ledgerhq/types-cryptoassets";
import type { Transaction, TransactionStatus } from "../../../../generated/types";
export type UseCoinControlAmountInputParams = Readonly<{
transaction: Transaction;
status: TransactionStatus;
onUpdateTransaction: (patch: Partial<Transaction>) => void;
locale: string;
accountUnit: Unit;
}>;
export type UseCoinControlAmountInputResult = Readonly<{
amountValue: string | null;
onAmountChange: (rawValue: string) => void;
cancelPendingUpdates: () => void;
debounceTimeoutRef: {
current: NodeJS.Timeout | null;
};
}>;
/**
* Shared hook for CoinControl amount input state.
* Accepts accountUnit from the caller so apps can use useMaybeAccountUnit or similar.
* onAmountChange is string-based; desktop views should adapt from ChangeEvent (e.target.value).
*/
export declare function useCoinControlAmountInput({ transaction, status, onUpdateTransaction, locale, accountUnit, }: UseCoinControlAmountInputParams): UseCoinControlAmountInputResult;
//# sourceMappingURL=useCoinControlAmountInput.d.ts.map