1 | <?php |
||
10 | class Output extends Message |
||
11 | { |
||
12 | |||
13 | /** @var int */ |
||
14 | public $amount = 0; |
||
15 | |||
16 | /** @var string */ |
||
17 | public $script; |
||
18 | |||
19 | |||
20 | /** @var \Closure[] */ |
||
21 | protected static $__extensions = array(); |
||
22 | |||
23 | public static function descriptor() |
||
24 | { |
||
25 | $descriptor = new Descriptor(__CLASS__, 'payments.Output'); |
||
26 | |||
27 | // OPTIONAL UINT64 amount = 1 |
||
28 | $f = new Field(); |
||
29 | $f->number = 1; |
||
30 | $f->name = 'amount'; |
||
31 | $f->type = Protobuf::TYPE_UINT64; |
||
32 | $f->rule = Protobuf::RULE_OPTIONAL; |
||
33 | $f->default = 0; |
||
34 | $descriptor->addField($f); |
||
35 | |||
36 | // REQUIRED BYTES script = 2 |
||
37 | $f = new Field(); |
||
38 | $f->number = 2; |
||
39 | $f->name = 'script'; |
||
40 | $f->type = Protobuf::TYPE_BYTES; |
||
41 | $f->rule = Protobuf::RULE_REQUIRED; |
||
42 | $descriptor->addField($f); |
||
43 | |||
44 | foreach (self::$__extensions as $cb) { |
||
45 | $descriptor->addField($cb(), true); |
||
46 | } |
||
47 | |||
48 | return $descriptor; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Check if <amount> has a value |
||
53 | * |
||
54 | * @return boolean |
||
55 | */ |
||
56 | public function hasAmount() |
||
60 | |||
61 | /** |
||
62 | * Clear <amount> value |
||
63 | * |
||
64 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output |
||
65 | */ |
||
66 | public function clearAmount() |
||
70 | |||
71 | /** |
||
72 | * Get <amount> value |
||
73 | * |
||
74 | * @return int |
||
75 | */ |
||
76 | 36 | public function getAmount() |
|
80 | |||
81 | /** |
||
82 | * Set <amount> value |
||
83 | * |
||
84 | * @param int $value |
||
85 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output |
||
86 | */ |
||
87 | 12 | public function setAmount($value) |
|
91 | |||
92 | /** |
||
93 | * Check if <script> has a value |
||
94 | * |
||
95 | * @return boolean |
||
96 | */ |
||
97 | public function hasScript() |
||
101 | |||
102 | /** |
||
103 | * Clear <script> value |
||
104 | * |
||
105 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output |
||
106 | */ |
||
107 | public function clearScript() |
||
111 | |||
112 | /** |
||
113 | * Get <script> value |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | 32 | public function getScript() |
|
121 | |||
122 | /** |
||
123 | * Set <script> value |
||
124 | * |
||
125 | * @param string $value |
||
126 | * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Output |
||
127 | */ |
||
128 | 12 | public function setScript($value) |
|
132 | } |
||
133 |