bitcoinjs-lib/types/psbt.d.ts

32 lines
1.2 KiB
TypeScript
Raw Normal View History

/// <reference types="node" />
2019-06-24 12:20:15 +02:00
import { Psbt as PsbtBase } from 'bip174';
2019-07-04 06:33:08 +02:00
import { TransactionInput, TransactionOutput } from 'bip174/src/lib/interfaces';
2019-07-03 08:34:18 +02:00
import { Signer, SignerAsync } from './ecpair';
2019-07-01 12:57:35 +02:00
import { Network } from './networks';
2019-07-03 08:13:36 +02:00
import { Transaction } from './transaction';
2019-06-24 12:20:15 +02:00
export declare class Psbt extends PsbtBase {
static fromTransaction<T extends typeof PsbtBase>(this: T, txBuf: Buffer): InstanceType<T>;
static fromBuffer<T extends typeof PsbtBase>(this: T, buffer: Buffer): InstanceType<T>;
2019-07-04 06:33:08 +02:00
private __TX;
private __TX_BUF_CACHE?;
2019-07-04 04:26:23 +02:00
private opts;
constructor(opts?: PsbtOptsOptional);
2019-07-04 06:42:34 +02:00
setVersion(version: number): this;
setLocktime(locktime: number): this;
2019-07-04 10:35:39 +02:00
setSequence(inputIndex: number, sequence: number): this;
2019-07-04 06:33:08 +02:00
addInput(inputData: TransactionInput): this;
addOutput(outputData: TransactionOutput): this;
2019-07-03 08:13:36 +02:00
extractTransaction(): Transaction;
finalizeAllInputs(): {
result: boolean;
inputResults: boolean[];
};
finalizeInput(inputIndex: number): boolean;
signInput(inputIndex: number, keyPair: Signer): this;
2019-07-03 08:34:18 +02:00
signInputAsync(inputIndex: number, keyPair: SignerAsync): Promise<void>;
2019-06-24 12:20:15 +02:00
}
2019-07-04 04:26:23 +02:00
interface PsbtOptsOptional {
network?: Network;
}
export {};