sensible-sdk
Version:
Sensible-SDK
59 lines (58 loc) • 2.05 kB
TypeScript
/// <reference types="node" />
import * as bsv from "../bsv";
import { CONTRACT_TYPE, SigHashInfo } from "../common/utils";
export declare const sighashType: number;
export declare class TxComposer {
tx: bsv.Transaction;
sigHashList: SigHashInfo[];
changeOutputIndex: number;
constructor(tx?: bsv.Transaction);
toObject(): {
tx: any;
sigHashList: SigHashInfo[];
changeOutputIndex: number;
};
static fromObject(composerObj: any): TxComposer;
getRawHex(): string;
getTx(): bsv.Transaction;
getTxId(): string;
getInput(inputIndex: number): bsv.Transaction.Input;
getOutput(outputIndex: number): bsv.Transaction.Output;
appendP2PKHInput(utxo: {
address: bsv.Address;
satoshis: number;
txId: string;
outputIndex: number;
}): number;
appendInput(input: {
txId: string;
outputIndex: number;
lockingScript?: bsv.Script;
satoshis?: number;
}): number;
appendP2PKHOutput(output: {
address: bsv.Address;
satoshis: number;
}): number;
appendOutput(output: {
lockingScript: bsv.Script;
satoshis: number;
}): number;
appendOpReturnOutput(opreturnData: any): number;
clearChangeOutput(): void;
appendChangeOutput(changeAddress: bsv.Address, feeb?: number, extraSize?: number): number;
unlockP2PKHInput(privateKey: bsv.PrivateKey, inputIndex: number, sigtype?: number): void;
getTxFormatSig(privateKey: bsv.PrivateKey, inputIndex: number, sigtype?: number): Buffer;
getInputPreimage(inputIndex: number, sigtype?: number): import("scryptlib/dist/scryptTypes").SigHashPreimage;
getUnspentValue(): number;
getFeeRate(): number;
getSigHashLit(): SigHashInfo[];
addSigHashInfo({ inputIndex, address, sighashType, contractType, }: {
inputIndex: number;
address: string;
sighashType: number;
contractType: CONTRACT_TYPE;
}): void;
getPrevoutsHash(): string;
dumpTx(network?: string): void;
}