| 1 | package Finance::GDAX::API::UserAccount; | ||
| 2 | our $VERSION = '0.02'; | ||
| 3 | use 5.20.0; | ||
| 4 | use warnings; | ||
| 5 | use Moose; | ||
| 6 | use Finance::GDAX::API; | ||
| 7 | use namespace::autoclean; | ||
| 8 | |||
| 9 | extends 'Finance::GDAX::API'; | ||
| 10 | |||
| 11 | sub trailing_volume { | ||
| 12 | my $self = shift; | ||
| 13 | $self->method('GET'); | ||
| 14 | $self->path('/users/self/trailing-volume'); | ||
| 15 | return $self->send; | ||
| 16 | } | ||
| 17 | |||
| 18 | __PACKAGE__->meta->make_immutable; | ||
| 19 | 1; | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Finance::GDAX::API::UserAccount - Account Info | ||
| 24 | |||
| 25 | =head1 SYNOPSIS | ||
| 26 | |||
| 27 | use Finance::GDAX::API::UserAccount; | ||
| 28 | |||
| 29 | $account = Finance::GDAX::API::UserAccount->new; | ||
| 30 | |||
| 31 | # List of trailing volume | ||
| 32 | $trailing = $account->trailing_volume; | ||
| 33 | |||
| 34 | =head2 DESCRIPTION | ||
| 35 | |||
| 36 | Returns a list of hashes, representing the Trailing Volume on the account. | ||
| 37 | |||
| 38 | =head1 METHODS | ||
| 39 | |||
| 40 | =head2 C<trailing_volume> | ||
| 41 | |||
| 42 | From the GDAX API: | ||
| 43 | |||
| 44 | This request will return your 30-day trailing volume for all | ||
| 45 | products. This is a cached value that's calculated every day at | ||
| 46 | midnight UTC. | ||
| 47 | |||
| 48 | [ | ||
| 49 | { | ||
| 50 | "product_id": "BTC-USD", | ||
| 51 | "exchange_volume": "11800.00000000", | ||
| 52 | "volume": "100.00000000", | ||
| 53 | "recorded_at": "1973-11-29T00:05:01.123456Z" | ||
| 54 | }, | ||
| 55 | { | ||
| 56 | "product_id": "LTC-USD", | ||
| 57 | "exchange_volume": "51010.04100000", | ||
| 58 | "volume": "2010.04100000", | ||
| 59 | "recorded_at": "1973-11-29T00:05:02.123456Z" | ||
| 60 | } | ||
| 61 | ] | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | |||
| 66 | =head1 AUTHOR | ||
| 67 | |||
| 68 | Mark Rushing <mark@orbislumen.net> | ||
| 69 | |||
| 70 | =head1 COPYRIGHT AND LICENSE | ||
| 71 | |||
| 72 | This software is copyright (c) 2017 by Home Grown Systems, SPC. | ||
| 73 | |||
| 74 | This is free software; you can redistribute it and/or modify it under | ||
| 75 | the same terms as the Perl 5 programming language system itself. | ||
| 76 | |||
| 77 | =cut | ||
| 78 |