Crypto::Exchange::API - API module for Crypto Exchanges
Use this class as parent for the exchanges API.
It defines the key, secret which evey crypto exchnages are requried.
The base_currencies is for the exchanges is useful to help to separate the coin and the base token
ie. Binance
XRPUSDT
OR XRPGBP
In the sub class define all the base tokens e.g. ['USDT', 'GBP', etc...]
And you can use the below example method to separate them in request and response
sub response_attr_pair { my ($self, $pair) = @_; my $bases = $self->base_currencies; foreach my $base(keys %$bases) { if ($pair =~ m/^$base(.+)/ || $pair =~ m/(.+)$base$/) { return { base => $base, coin => $1 }, } } die "Pair [$pair] couldnn't find base currency"; }
To install Crypto::Exchange::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypto::Exchange::API
CPAN shell
perl -MCPAN -e shell install Crypto::Exchange::API
For more information on module installation, please visit the detailed CPAN module installation guide.