Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * @see https://developer.bitcoin.org/reference/transactions.html |
| 5 | * |
| 6 | * @package brianhenryie/bh-wp-bitcoin-gateway |
| 7 | */ |
| 8 | |
| 9 | namespace BrianHenryIE\WP_Bitcoin_Gateway\API\Model\Payments; |
| 10 | |
| 11 | use DateTimeInterface; |
| 12 | |
| 13 | interface Transaction_Interface { |
| 14 | |
| 15 | /** |
| 16 | * "Double SHA-256 hash of the serialized transaction data, byte-reversed (displayed in little-endian format)." |
| 17 | * |
| 18 | * AKA transaction hash. |
| 19 | */ |
| 20 | public function get_txid(): string; |
| 21 | |
| 22 | /** |
| 23 | * "A version number prefixed to transactions to allow upgrading. Programs creating transactions using newer |
| 24 | * consensus rules may use higher version numbers. Version 2 means that BIP 68 applies." |
| 25 | * |
| 26 | * "1" or "2". |
| 27 | */ |
| 28 | public function get_version(): int; |
| 29 | |
| 30 | /** |
| 31 | * "Each non-coinbase input spends an outpoint from a previous transaction." |
| 32 | * |
| 33 | * ?? Will all these generally come from the same master public key but one or more 0/x sub addresses? |
| 34 | * ?? But if multiple people send to the same address at the same time could they be in the same transaction because they're in the same block? |
| 35 | * |
| 36 | * @return Transaction_VIn[] |
| 37 | */ |
| 38 | public function get_v_in(): array; |
| 39 | |
| 40 | /** |
| 41 | * ?? Probably the address the btc is sent to and the address of the miner>?? |
| 42 | * |
| 43 | * ?? In reality, this should be |
| 44 | * |
| 45 | * @return Transaction_VOut[] |
| 46 | */ |
| 47 | public function get_v_out(): array; |
| 48 | |
| 49 | /** |
| 50 | * Returns null for mempool. |
| 51 | */ |
| 52 | public function get_block_height(): ?int; |
| 53 | |
| 54 | /** |
| 55 | * Used to filter transactions to only those between the time the order was placed, and paid. |
| 56 | */ |
| 57 | public function get_block_time(): DateTimeInterface; |
| 58 | } |