forked from Bit-Wasp/bitcoin-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransactionInputInterface.php
108 lines (90 loc) · 2.68 KB
/
TransactionInputInterface.php
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
declare(strict_types=1);
namespace BitWasp\Bitcoin\Transaction;
use BitWasp\Bitcoin\Script\ScriptInterface;
use BitWasp\Bitcoin\SerializableInterface;
interface TransactionInputInterface extends SerializableInterface
{
/**
* The default sequence.
*/
const SEQUENCE_FINAL = 0xffffffff;
/* If this flag set, CTxIn::nSequence is NOT interpreted as a
* relative lock-time. */
const SEQUENCE_LOCKTIME_DISABLE_FLAG = 1 << 31; // 1 << 31
/* If CTxIn::nSequence encodes a relative lock-time and this flag
* is set, the relative lock-time has units of 512 seconds,
* otherwise it specifies blocks with a granularity of 1. */
const SEQUENCE_LOCKTIME_TYPE_FLAG = 1 << 22; // 1 << 22;
/* If CTxIn::nSequence encodes a relative lock-time, this mask is
* applied to extract that lock-time from the sequence field. */
const SEQUENCE_LOCKTIME_MASK = 0x0000ffff;
/**
* Get the outpoint
*
* @return OutPointInterface
*/
public function getOutPoint(): OutPointInterface;
/**
* Get the scriptSig for this input
*
* @return ScriptInterface
*/
public function getScript(): ScriptInterface;
/**
* Get the sequence number for this input
*
* @return int
*/
public function getSequence(): int;
/**
* Equality check with $this and $other
*
* @param TransactionInputInterface $other
* @return bool
*/
public function equals(TransactionInputInterface $other): bool;
/**
* Check whether the transaction is the Coinbase, ie, it has
* one input which spends the `null` outpoint
*
* @return bool
*/
public function isCoinBase(): bool;
/**
* @return bool
*/
public function isFinal(): bool;
/**
* Checks whether the SEQUENCE_LOCKTIME_DISABLE_FLAG is set
* Always returns true if txin is coinbase.
*
* @return bool
*/
public function isSequenceLockDisabled(): bool;
/**
* Indicates whether the input is locked with a time based lock (as opposed to block)
*
* @return bool
*/
public function isLockedToTime(): bool;
/**
* Returns whether the input is locked with a block based lock (as opposed to time)
*
* @return bool
*/
public function isLockedToBlock(): bool;
/**
* Returns the relative block time for the input.
* Range limited to 0 - 33553920 (approx 1 yr)
* @return int
*/
public function getRelativeBlockLock(): int;
/**
* Returns the relative locktime for the input in seconds.
* Range limited to 0 - 65535
*
* @return int
*/
public function getRelativeTimeLock(): int;
}