@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
59 lines • 2.55 kB
TypeScript
import type { Unit } from "@ledgerhq/types-cryptoassets";
import type { SendFlowTransactionActions, SendFlowUiConfig } from "../../types";
import type { Transaction, TransactionStatus } from "../../../../generated/types";
import type { Account, AccountLike } from "@ledgerhq/types-live";
import { type BitcoinUtxoDisplayData } from "../../../../families/bitcoin/react";
export type CoinControlScreenViewModelLabels = Readonly<{
reviewCta: string;
getCtaLabel: (currency: string) => string;
strategyLabel: string;
learnMoreLabel: string;
coinToSendLabel: string;
changeToReturnLabel: string;
enterAmountPlaceholder: string;
amountToSendLabel: string;
amountInputLabel: string;
getStrategyOptionLabel: (labelKey: string) => string;
}>;
export type UseCoinControlScreenViewModelCoreParams<TNetworkFees = unknown> = Readonly<{
account: AccountLike;
parentAccount: Account | null;
transaction: Transaction;
status: TransactionStatus;
bridgePending: boolean;
uiConfig: SendFlowUiConfig;
transactionActions: SendFlowTransactionActions;
locale: string;
accountUnit: Unit;
amountError: string | undefined;
networkFees: TNetworkFees;
labels: CoinControlScreenViewModelLabels;
onLearnMoreClick: () => void;
}>;
export type CoinControlScreenViewModelCoreResult<TNetworkFees = unknown> = Readonly<{
amountValue: string | null;
onAmountChange: (rawValue: string) => void;
amountError: string | undefined;
utxoDisplayData: BitcoinUtxoDisplayData | null;
strategyOptionsWithLabels: readonly {
value: number;
label: string;
}[];
changeToReturnFormatted: string;
onSelectStrategy: (value: string) => void;
reviewLabel: string;
reviewShowIcon: boolean;
reviewDisabled: boolean;
reviewLoading: boolean;
strategyLabel: string;
onLearnMoreClick: () => void;
learnMoreLabel: string;
coinToSendLabel: string;
changeToReturnLabel: string;
enterAmountPlaceholder: string;
amountToSendLabel: string;
amountInputLabel: string;
networkFees: TNetworkFees;
}>;
export declare function useCoinControlScreenViewModelCore<TNetworkFees = unknown>({ account, parentAccount, transaction, status, bridgePending, uiConfig: _uiConfig, transactionActions, locale, accountUnit, amountError, networkFees, labels, onLearnMoreClick, }: UseCoinControlScreenViewModelCoreParams<TNetworkFees>): CoinControlScreenViewModelCoreResult<TNetworkFees>;
//# sourceMappingURL=useCoinControlScreenViewModelCore.d.ts.map