App-indodax
view release on metacpan or search on metacpan
lib/App/indodax.pm view on Meta::CPAN
package App::indodax;
our $DATE = '2018-06-12'; # DATE
our $VERSION = '0.024'; # VERSION
use 5.010001;
use strict;
use warnings;
use Log::ger;
our %SPEC;
use App::cryp::Exchange::indodax;
our %Canonical_Currencies = (map {lc} %{ App::cryp::Exchange::indodax->data_canonical_currencies });
our %Rev_Canonical_Currencies = (map {lc} %{ App::cryp::Exchange::indodax->data_reverse_canonical_currencies });
our @Markets = qw(idr btc);
our @Market_Pairs = (map {
my $canon = $_->{name};
my ($basecur, $quotecur) = split m!/!, $canon;
lc($basecur) . '_' . lc($quotecur);
} @{ App::cryp::Exchange::indodax->data_pairs });
our @Currencies = do {
my %res;
for (@Market_Pairs) { /\A(\w+)_(\w+)\z/ or die; $res{$1}++; $res{$2}++ }
sort keys %res;
};
our @Idr_Market_Currencies = do {
my %res;
for (@Market_Pairs) { /\A(\w+)_idr\z/ and $res{$1}++ }
sort keys %res;
};
our @Btc_Market_Currencies = do {
my %res;
for (@Market_Pairs) { /\A(\w+)_btc\z/ and $res{$1}++ }
sort keys %res;
};
my $sch_type = ['str*', in=>['buy','sell']];
my $sch_txtype = ['str*', in=>['deposit','withdraw']];
my $sch_currency = ['str*', in=>\@Currencies];
my $sch_pair = ['str*', {
match=>qr/\A\w{3,4}_\w{3,4}\z/,
in=>\@Market_Pairs,
}];
my $sch_market = ['str*', {
in=>\@Markets,
}];
my %args_tapi = (
key => {
schema => ['str*', match=>qr/\A\w{8}-\w{8}-\w{8}-\w{8}-\w{8}\z/],
req => 1,
},
secret => {
schema => ['str*', match=>qr/\A[0-9a-z]{80}\z/],
req => 1,
},
);
my %arg_filter_type = (
type => {
summary => 'Filter by type (buy/sell)',
schema => $sch_type,
tags => ['category:filtering'],
},
);
my %arg_filter_txtype = (
txtype => {
summary => 'Filter by transaction type (deposit/withdraw)',
schema => $sch_txtype,
tags => ['category:filtering'],
},
);
my %arg_filter_pair = (
pair => {
summary => 'Filter by pair',
( run in 0.928 second using v1.01-cache-2.11-cpan-7fcb06a456a )