UNPKG

@ledgerhq/live-common

Version:
42 lines 1.76 kB
import type { Transaction } from "@ledgerhq/coin-bitcoin/types"; import type { Account, AccountLike, FeeStrategy } from "@ledgerhq/types-live"; import { BigNumber } from "bignumber.js"; import type { Transaction as SendFlowTransaction, TransactionStatus } from "../../generated/types"; import { type BitcoinOutput } from "./types"; export declare const useFeesStrategy: (a: Account, t: Transaction) => FeeStrategy[]; export type PickingStrategyOption = Readonly<{ value: number; labelKey: string; }>; export type UtxoRowDisplayData = Readonly<{ utxo: BitcoinOutput; titleLabel: string; formattedValue: string; excluded: boolean; exclusionReason: "pickPendingUtxo" | "userExclusion" | undefined; isUsedInTx: boolean; unconfirmed: boolean; isLastSelected: boolean; disabled: boolean; confirmations: number; }>; export type UseBitcoinUtxoDisplayDataParams = Readonly<{ account: AccountLike; transaction: SendFlowTransaction; status: TransactionStatus; locale: string; }>; export type BitcoinUtxoDisplayData = Readonly<{ pickingStrategyOptions: readonly PickingStrategyOption[]; pickingStrategyValue: number; totalExcludedUTXOS: number; totalSpent: BigNumber; utxoRows: readonly UtxoRowDisplayData[]; }>; /** * Fetches all parameters needed to display Bitcoin UTXO rows and the picking strategy selector, * derived from account bitcoin resources, transaction utxoStrategy, and status. * Returns null when the account is not Bitcoin-based or the transaction has no utxoStrategy. */ export declare function useBitcoinUtxoDisplayData({ account, transaction, status, locale, }: UseBitcoinUtxoDisplayDataParams): BitcoinUtxoDisplayData | null; //# sourceMappingURL=react.d.ts.map