WalletStateRequest::getBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Package: PHP Bitaps API
7
 *
8
 * (c) Eldar Gazaliev <[email protected]>
9
 *
10
 *  Link: <https://github.com/MyZik>
11
 *
12
 * For the full copyright and license information, please view the LICENSE file
13
 * that was distributed with this source code.
14
 */
15
16
namespace Bitaps\WalletAPI\Request;
17
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
76
    {
77
        return [];
78
    }
79
}
80