@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | use Appino\Blockchain\Objects\ReceiveResponse; |
13 | 13 | use GuzzleHttp\Client; |
14 | 14 | |
15 | -class Receive{ |
|
15 | +class Receive { |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * @var array |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * @param Blockchain $blockchain |
33 | 33 | */ |
34 | 34 | |
35 | - public function __construct(Blockchain $blockchain){ |
|
35 | + public function __construct(Blockchain $blockchain) { |
|
36 | 36 | $this->blockchain = $blockchain; |
37 | 37 | } |
38 | 38 | |
39 | - private function Uri($uri){ |
|
39 | + private function Uri($uri) { |
|
40 | 40 | return self::URL.'/'.$uri; |
41 | 41 | } |
42 | 42 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return array |
48 | 48 | * @throws \Appino\Blockchain\Exception\HttpError |
49 | 49 | */ |
50 | - private function call($method, $uri, $params = array()){ |
|
50 | + private function call($method, $uri, $params = array()) { |
|
51 | 51 | return $this->blockchain->Request($method, $this->Uri($uri), $params); |
52 | 52 | } |
53 | 53 | |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | * @param int $gap_limit How many unused addresses are allowed. |
60 | 60 | * @return ReceiveResponse |
61 | 61 | */ |
62 | - public function Generate($xpub, $callback, $gap_limit = 20){ |
|
62 | + public function Generate($xpub, $callback, $gap_limit = 20) { |
|
63 | 63 | $params = [ |
64 | 64 | 'xpub' => $xpub, |
65 | 65 | 'callback' => $callback, |
66 | 66 | 'gap_limit' => $gap_limit |
67 | 67 | ]; |
68 | 68 | $params = array_merge($this->params, $params); |
69 | - $response = $this->call('GET','',$params); |
|
69 | + $response = $this->call('GET', '', $params); |
|
70 | 70 | return new ReceiveResponse($response); |
71 | 71 | } |
72 | 72 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | * @return integer |
78 | 78 | * @throws \GuzzleHttp\Exception\GuzzleException |
79 | 79 | */ |
80 | - public function AddressGap($xpub){ |
|
81 | - $params = array_merge(['xpub'=>$xpub],$this->params); |
|
82 | - $response = $this->call('GET','checkgap',$params); |
|
80 | + public function AddressGap($xpub) { |
|
81 | + $params = array_merge(['xpub'=>$xpub], $this->params); |
|
82 | + $response = $this->call('GET', 'checkgap', $params); |
|
83 | 83 | return $response['gap']; |
84 | 84 | } |
85 | 85 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return NotificationResponse |
97 | 97 | */ |
98 | 98 | |
99 | - public function BalanceNotification($address, $callback, $on = Notification::KEEP, $confs = 3, $op = Operation::ALL){ |
|
99 | + public function BalanceNotification($address, $callback, $on = Notification::KEEP, $confs = 3, $op = Operation::ALL) { |
|
100 | 100 | $params = [ |
101 | 101 | 'address' => $address, |
102 | 102 | 'callback' => $callback, |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'op' => $op |
106 | 106 | ]; |
107 | 107 | $params = array_merge($this->params, $params); |
108 | - $response = $this->call('POST','balance_update',$params); |
|
108 | + $response = $this->call('POST', 'balance_update', $params); |
|
109 | 109 | return new NotificationResponse($response); |
110 | 110 | } |
111 | 111 | |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | * @throws \GuzzleHttp\Exception\GuzzleException |
118 | 118 | */ |
119 | 119 | |
120 | - public function DeleteBalanceNotification($id){ |
|
121 | - $response = $this->call('DELETE','balance_update/'.$id, $this->params); |
|
120 | + public function DeleteBalanceNotification($id) { |
|
121 | + $response = $this->call('DELETE', 'balance_update/'.$id, $this->params); |
|
122 | 122 | return $response['deleted']; |
123 | 123 | } |
124 | 124 | |
@@ -133,16 +133,16 @@ discard block |
||
133 | 133 | * @throws \GuzzleHttp\Exception\GuzzleException |
134 | 134 | */ |
135 | 135 | |
136 | - public function BlockNotification($callback, $on = Notification::KEEP, $confs = 1, $height = null){ |
|
136 | + public function BlockNotification($callback, $on = Notification::KEEP, $confs = 1, $height = null) { |
|
137 | 137 | $params = [ |
138 | 138 | 'callback' => $callback, |
139 | 139 | 'onNotification' => $on, |
140 | 140 | 'confs' => $confs, |
141 | 141 | ]; |
142 | - if(!is_null($height)) |
|
142 | + if (!is_null($height)) |
|
143 | 143 | $params['height'] = $height; |
144 | 144 | $params = array_merge($this->params, $params); |
145 | - $response = $this->call('POST','block_notification',$params); |
|
145 | + $response = $this->call('POST', 'block_notification', $params); |
|
146 | 146 | return new NotificationResponse($response); |
147 | 147 | } |
148 | 148 | |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | * @throws \GuzzleHttp\Exception\GuzzleException |
155 | 155 | */ |
156 | 156 | |
157 | - public function DeleteBlockNotification($id){ |
|
158 | - $response = $this->call('DELETE','block_notification/'.$id,$this->params); |
|
157 | + public function DeleteBlockNotification($id) { |
|
158 | + $response = $this->call('DELETE', 'block_notification/'.$id, $this->params); |
|
159 | 159 | return $response['deleted']; |
160 | 160 | } |
161 | 161 | |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | * @throws \GuzzleHttp\Exception\GuzzleException |
168 | 168 | */ |
169 | 169 | |
170 | - public function CallbackLogs($callback){ |
|
171 | - $params = array_merge(['callback'=>$callback],$this->params); |
|
172 | - $logs = $this->call('GET','callback_log',['query'=>$params]); |
|
170 | + public function CallbackLogs($callback) { |
|
171 | + $params = array_merge(['callback'=>$callback], $this->params); |
|
172 | + $logs = $this->call('GET', 'callback_log', ['query'=>$params]); |
|
173 | 173 | $response = array(); |
174 | - foreach ($logs as $log){ |
|
174 | + foreach ($logs as $log) { |
|
175 | 175 | $response[] = new LogResponse($log); |
176 | 176 | } |
177 | 177 | return $response; |