lotus-sdk
Version:
Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem
58 lines • 2.13 kB
TypeScript
import { Script } from '../script.js';
import { Address } from '../address.js';
import { PublicKey } from '../publickey.js';
import { Unit } from '../unit.js';
import type { MuSigKeyAggContext } from '../crypto/musig2.js';
export interface UnspentOutputData {
txid?: string;
txId?: string;
vout?: number;
outputIndex?: number;
scriptPubKey?: Script | Buffer | string;
script?: Script | Buffer | string;
amount?: number;
satoshis?: number | bigint;
address?: Address | string;
internalPubKey?: PublicKey | Buffer | string;
merkleRoot?: Buffer;
keyAggContext?: MuSigKeyAggContext;
mySignerIndex?: number;
}
export interface UnspentOutputObject {
address?: string;
txid: string;
vout: number;
scriptPubKey: string;
amount: number;
}
export declare class UnspentOutput {
readonly address?: Address;
readonly txId: string;
readonly outputIndex: number;
readonly script: Script;
readonly satoshis: number;
readonly internalPubKey?: PublicKey;
readonly merkleRoot?: Buffer;
readonly keyAggContext?: MuSigKeyAggContext;
readonly mySignerIndex?: number;
constructor(data: UnspentOutputData);
getXPI(): number;
getUnit(): Unit;
isValid(): boolean;
isDust(dustThreshold?: number): boolean;
toObject(): UnspentOutputObject;
toJSON: () => UnspentOutputObject;
inspect(): string;
clone(): UnspentOutput;
toString(): string;
isPayToPublicKeyHash(): boolean;
isPayToScriptHash(): boolean;
getAddress(): string | null;
static fromObject(obj: UnspentOutputData): UnspentOutput;
static fromObjects(objects: UnspentOutputData[]): UnspentOutput[];
static filterByAddress(unspentOutputs: UnspentOutput[], address: string | Address): UnspentOutput[];
static filterByMinAmount(unspentOutputs: UnspentOutput[], minAmount: number | bigint): UnspentOutput[];
static calculateTotal(unspentOutputs: UnspentOutput[]): number;
static selectForAmount(unspentOutputs: UnspentOutput[], targetAmount: number | bigint): UnspentOutput[];
}
//# sourceMappingURL=unspentoutput.d.ts.map