-
Notifications
You must be signed in to change notification settings - Fork 1
/
tx-verifier.d.ts
60 lines (60 loc) · 2.34 KB
/
tx-verifier.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { Interp } from './interp';
import { Struct } from './struct';
import { Tx } from './tx';
import { TxOutMap } from './tx-out-map';
export declare class TxVerifier extends Struct {
tx: Tx;
txOutMap: TxOutMap;
errStr: string;
interp: Interp;
constructor(tx?: Tx, txOutMap?: TxOutMap, errStr?: string, interp?: Interp);
/**
* Verifies that the transaction is valid both by performing basic checks, such
* as ensuring that no two inputs are the same, as well as by verifying every
* script. The two checks are checkStr, which is analagous to bitcoind's
* CheckTransaction, and verifyStr, which runs the script interpreter.
*
* This does NOT check that any possible claimed fees are accurate; checking
* that the fees are accurate requires checking that the input transactions are
* valid, which is not performed by this test. That check is done with the
* normal verify function.
*/
verify(flags?: number): boolean;
asyncVerify(flags: number): Promise<boolean>;
/**
* Convenience method to verify a transaction.
*/
static verify(tx: Tx, txOutMap: TxOutMap, flags?: number): boolean;
static asyncVerify(tx: Tx, txOutMap: TxOutMap, flags: number): Promise<boolean>;
/**
* Check that a transaction passes basic sanity tests. If not, return a string
* describing the error. This function contains the same logic as
* CheckTransaction in bitcoin core.
*/
checkStr(): boolean | string;
/**
* verify the transaction inputs by running the script interpreter. Returns a
* string of the script interpreter is invalid, otherwise returns false.
*/
verifyStr(flags: number): boolean | string;
asyncVerifyStr(flags: number): Promise<boolean | string>;
/**
* Verify a particular input by running the script interpreter. Returns true if
* the input is valid, false otherwise.
*/
verifyNIn(nIn: number, flags: number): boolean;
asyncVerifyNIn(nIn: number, flags: number): Promise<boolean>;
getDebugObject(): {
errStr: string;
interpFailure: {
errStr: string;
scriptStr: string;
pc: number;
stack: string[];
altStack: string[];
opCodeStr: string;
};
};
getDebugString(): string;
}
//# sourceMappingURL=tx-verifier.d.ts.map