Total Complexity | 4 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class WalletStateRequest implements RequestInterface |
||
19 | { |
||
20 | /** |
||
21 | * Wallet ID |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | public string $walletId; |
||
26 | |||
27 | /** |
||
28 | * Nonce used for HMAC signature |
||
29 | * |
||
30 | * @var float|null |
||
31 | */ |
||
32 | public ?float $nonce; |
||
33 | |||
34 | /** |
||
35 | * HMAC signature |
||
36 | * |
||
37 | * @var string|null |
||
38 | */ |
||
39 | public ?string $signature; |
||
40 | |||
41 | /** |
||
42 | * @param string $walletId |
||
43 | * @param float|null $nonce |
||
44 | * @param string|null $signature |
||
45 | */ |
||
46 | public function __construct(string $walletId, float $nonce = null, string $signature = null) |
||
47 | { |
||
48 | $this->walletId = $walletId; |
||
49 | $this->nonce = $nonce; |
||
50 | $this->signature = $signature; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return array |
||
55 | */ |
||
56 | public function getHeaders(): array |
||
57 | { |
||
58 | return [ |
||
59 | 'Access-Nonce' => $this->nonce, |
||
60 | 'Access-Signature' => $this->signature |
||
61 | ]; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getPathParams(): string |
||
68 | { |
||
69 | return sprintf('/wallet/state/%s', $this->walletId); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return array |
||
74 | */ |
||
75 | public function getBody(): array |
||
78 | } |
||
79 | } |
||
80 |