Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Tatum |
||
11 | { |
||
12 | protected $apiKey; |
||
13 | protected $accountID; |
||
14 | protected $baseUrl; |
||
15 | |||
16 | /** |
||
17 | * Construct |
||
18 | */ |
||
19 | function __construct() |
||
20 | { |
||
21 | |||
22 | $this->apiKey = config('tatum.apiKey'); |
||
|
|||
23 | $this->accountID = config('tatum.accountID'); |
||
24 | $this->baseUrl = 'https://api.tatum.io/v3'; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Generates a unique reference |
||
29 | * @param $transactionPrefix |
||
30 | * @return string |
||
31 | */ |
||
32 | |||
33 | public function generateReference(String $transactionPrefix = NULL) |
||
34 | { |
||
35 | if ($transactionPrefix) { |
||
36 | return $transactionPrefix . '_' . uniqid(time()); |
||
37 | } |
||
38 | return 'ttm_' . uniqid(time()); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Access available blockchains |
||
43 | * @return Blockchain |
||
44 | */ |
||
45 | public function blockchain() |
||
46 | { |
||
47 | $blockchain = new Blockchain($this->apiKey, $this->accountID, $this->baseUrl); |
||
48 | return $blockchain; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Access Tatum Utils |
||
53 | * @return Utils |
||
54 | */ |
||
55 | public function utils() |
||
59 | } |
||
60 | |||
61 | public function virtualAccount() |
||
65 | } |
||
66 | } |
||
67 |