import type { ICrypto } from "@ledgerhq/wallet-btc/crypto/types"; import { DerivationModes } from "@ledgerhq/wallet-btc/types"; import { maxTxSizeCeil } from "@ledgerhq/wallet-btc/utils"; import type { ExplorerUtxo } from "../network/types"; export { OP_RETURN_DATA_SIZE_LIMIT } from "@ledgerhq/wallet-btc/crypto/base"; export { DerivationModes, maxTxSizeCeil }; export type { ICrypto }; /** * wallet-btc's address check for a currency id. Throws when wallet-btc does not describe the * currency. */ export declare function isValidAddress(address: string, currencyId: string): boolean; /** wallet-btc's network description of a currency (address formats, dust policy, …). */ export declare function cryptoFor(currencyId: string): ICrypto; export type UtxoSelection = { /** Outputs spent, in spending order. */ inputs: ExplorerUtxo[]; /** Fee actually paid: inputs − amount − change. */ fee: bigint; /** Change sent back to the sender; 0n when the transaction has no change output. */ change: bigint; /** Amount sent to the recipient. */ amount: bigint; /** False when the outputs cannot cover the amount plus the fee. */ sufficient: boolean; }; /** * Derivation mode (input and change type) of a single-address account, read from the sender's * output script. Nested SegWit is the only P2SH form an account address takes. */ export declare function derivationModeOf(script: Buffer): DerivationModes; /** * Dust threshold of a payment from `sender` to `recipient` (a one-input transaction, without the * relay fee, which needs the network), or `undefined` when either address is not valid for the * currency. */ export declare function paymentDustThreshold(currencyId: string, sender: string, recipient: string): bigint | undefined; /** * Size, in vbytes, of a single-address transaction with `inputCount` inputs (at least one), paying * the recipient plus `extraOutputScripts` (an OP_RETURN output), with or without change. * `formatBytes` adds what the currency's format carries beyond wallet-btc's size maths (see * `planTransaction`). */ export declare function transactionSize(inputCount: number, recipientScript: Buffer, withChange: boolean, crypto: ICrypto, derivationMode: DerivationModes, extraOutputScripts?: Buffer[], formatBytes?: number): number; /** * Picks the outputs a single-address transaction spends, and its fee. * * - `useAllAmount`: every output worth more than the fee to spend it is spent, with no change; the * amount is what remains after the fee. Outputs worth less are left out, as the bridge's maximum * spendable leaves them (wallet-btc `estimateAccountMaxSpendable`). * - Otherwise outputs are added deepest first until they cover the amount and the fee. Change below * the dust threshold is not created: it is left to the fee. * * Sizes and the dust threshold come from wallet-btc's pure size maths, as for the bridge. */ export declare function selectUtxos(params: { utxos: ExplorerUtxo[]; amount: bigint; useAllAmount: boolean; recipientScript: Buffer; crypto: ICrypto; derivationMode: DerivationModes; feePerByte: bigint; relayFeePerByte: bigint; /** Absolute fee imposed by the caller, instead of size × `feePerByte`. */ fixedFee?: bigint; /** Outputs paid besides the recipient and the change (an OP_RETURN output), for sizes. */ extraOutputScripts?: Buffer[]; /** Bytes the currency's format adds to a transaction of so many inputs (see `transactionSize`). */ formatBytes?: (inputCount: number) => number; }): UtxoSelection; //# sourceMappingURL=selectUtxos.d.ts.map