| 1 | <?php |
||
| 8 | class P2shScriptFactory |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var OutputScriptFactory |
||
| 12 | */ |
||
| 13 | private $scriptPubKey; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * P2shScriptFactory constructor. |
||
| 17 | * @param OutputScriptFactory $scriptPubKey |
||
| 18 | */ |
||
| 19 | 6 | public function __construct(OutputScriptFactory $scriptPubKey) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Create a multisig redeemScript and outputScript |
||
| 26 | * |
||
| 27 | * @param $m |
||
| 28 | * @param array $keys |
||
| 29 | * @param bool|true $sort |
||
| 30 | * @return P2shScript |
||
| 31 | */ |
||
| 32 | 6 | public function multisig($m, array $keys, $sort = true) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Create a Pay to pubkey redeemScript and outputScript |
||
| 39 | * @param PublicKeyInterface $publicKey |
||
| 40 | * @return P2shScript |
||
| 41 | */ |
||
| 42 | public function payToPubKey(PublicKeyInterface $publicKey) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Create a Pay to pubkey-hash redeemScript and outputScript |
||
| 49 | * @param PublicKeyInterface $publicKey |
||
| 50 | * @return P2shScript |
||
| 51 | */ |
||
| 52 | public function payToPubKeyHash(PublicKeyInterface $publicKey) |
||
| 56 | } |
||
| 57 |