1 | <?php |
||
16 | class ScriptFactory |
||
17 | { |
||
18 | /** |
||
19 | * @var OutputScriptFactory |
||
20 | */ |
||
21 | private static $outputScriptFactory = null; |
||
22 | |||
23 | /** |
||
24 | * @param BufferInterface|string $string |
||
25 | * @return ScriptInterface |
||
26 | */ |
||
27 | 46 | public static function fromHex($string) |
|
31 | |||
32 | /** |
||
33 | * @param BufferInterface|null $buffer |
||
34 | * @param Opcodes|null $opcodes |
||
35 | * @param Math|null $math |
||
36 | * @return ScriptCreator |
||
37 | */ |
||
38 | 2776 | public static function create(BufferInterface $buffer = null, Opcodes $opcodes = null, Math $math = null) |
|
42 | |||
43 | /** |
||
44 | * Create a script consisting only of push-data operations. |
||
45 | * Suitable for a scriptSig. |
||
46 | * |
||
47 | 2712 | * @param BufferInterface[] $buffers |
|
48 | * @return ScriptInterface |
||
49 | 2712 | */ |
|
50 | public static function pushAll(array $buffers) |
||
70 | |||
71 | /** |
||
72 | * @param int[]|\BitWasp\Bitcoin\Script\Interpreter\Number[]|BufferInterface[] $sequence |
||
73 | 188 | * @return ScriptInterface |
|
74 | */ |
||
75 | 188 | public static function sequence(array $sequence) |
|
79 | 188 | ||
80 | /** |
||
81 | * @param Operation[] $operations |
||
82 | * @return ScriptInterface |
||
83 | */ |
||
84 | public static function fromOperations(array $operations) |
||
97 | |||
98 | /** |
||
99 | * @return OutputScriptFactory |
||
100 | */ |
||
101 | public static function scriptPubKey() |
||
109 | |||
110 | /** |
||
111 | * @param EcAdapterInterface|null $ecAdapter |
||
112 | * @return NativeConsensus |
||
113 | */ |
||
114 | public static function getNativeConsensus(EcAdapterInterface $ecAdapter = null) |
||
118 | |||
119 | /** |
||
120 | * @return BitcoinConsensus |
||
121 | */ |
||
122 | public static function getBitcoinConsensus() |
||
126 | |||
127 | /** |
||
128 | * @param EcAdapterInterface|null $ecAdapter |
||
129 | * @return \BitWasp\Bitcoin\Script\Consensus\ConsensusInterface |
||
130 | */ |
||
131 | public static function consensus(EcAdapterInterface $ecAdapter = null) |
||
139 | } |
||
140 |