line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Coincheck::Borrow; |
2
|
2
|
|
|
2
|
|
1807953
|
use strict; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
125
|
|
3
|
2
|
|
|
2
|
|
27
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
185
|
|
4
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
5
|
2
|
|
|
|
|
13
|
ro => [qw/ |
6
|
|
|
|
|
|
|
client |
7
|
|
|
|
|
|
|
/], |
8
|
2
|
|
|
2
|
|
663
|
); |
|
2
|
|
|
|
|
1221
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1
|
|
|
1
|
0
|
35
|
my $class = shift; |
12
|
1
|
|
|
|
|
2
|
my $client = shift; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
8
|
bless { |
15
|
|
|
|
|
|
|
client => $client, |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub create { |
20
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $req_params = { |
23
|
|
|
|
|
|
|
amount => $params{amount}, |
24
|
|
|
|
|
|
|
currency => $params{currency}, |
25
|
0
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my $res = $self->client->request( |
28
|
|
|
|
|
|
|
'POST' => 'api/lending/borrows', |
29
|
|
|
|
|
|
|
$req_params, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return $res; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub matches { |
36
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $req_params; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $res = $self->client->request( |
41
|
|
|
|
|
|
|
'GET' => 'api/lending/borrows/matches', |
42
|
|
|
|
|
|
|
$req_params, |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $res; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub repay { |
49
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $req_params = { |
52
|
|
|
|
|
|
|
id => $params{id}, |
53
|
0
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my $res = $self->client->request( |
56
|
|
|
|
|
|
|
'POST' => "api/lending/borrows/$req_params->{id}/repay", |
57
|
|
|
|
|
|
|
$req_params, |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return $res; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |