Poloniex-API

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension Poloniex::API.

0.04 12.11.2018
	- Fix Undefined subroutine &Poloniex::API::_croak called
	- keepalive=>1 allows faster successive queries #3

0.03  15.12.2017
	- add Dependency on Test::* in Makefile.PL

0.02  11.12.2017
	- add Dependency on JSON::XS in Makefile.PL

0.01  Wed Nov 15 18:11:29 2017
	- original version; created by h2xs 1.23 with options
		-b 5.8.8. -XAn Poloniex::API

META.json  view on Meta::CPAN

      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Digest::SHA" : "0",
            "HTTP::Request" : "0",
            "JSON::XS" : "0",
            "Test::MockObject" : "0",
            "Test::Perl::Critic" : "0",
            "Test::PerlTidy" : "0",
            "Test::Pod" : "0"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {

META.yml  view on Meta::CPAN

  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Poloniex-API
no_index:
  directory:
    - t
    - inc
requires:
  Digest::SHA: '0'
  HTTP::Request: '0'
  JSON::XS: '0'
  Test::MockObject: '0'
  Test::Perl::Critic: '0'
  Test::PerlTidy: '0'
  Test::Pod: '0'
resources:
  bugtracker: https://github.com/mirkos-vf/Poloniex-API/issues
  license: http://dev.perl.org/licenses/
  repository: https://github.com/mirkos-vf/Poloniex-API
version: '0.04'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

Makefile.PL  view on Meta::CPAN

    (
        $] >= 5.005
        ?    ## Add these new keywords supported since 5.005
          (
            AUTHOR => 'vlad mirkos <mirkos.vf@gmail.com>'
          )
        : ()
    ),
    PREREQ_PM => {
        map { $_ => 0 }
          qw(JSON::XS Test::MockObject HTTP::Request Digest::SHA Test::Perl::Critic Test::Pod Test::PerlTidy),
    },
    META_MERGE => {
        test_requires => {
            map { $_ => 0 }
              qw(Test::More Test::MockObject Test::Perl::Critic Test::Pod Test::PerlTidy),
        },
        resources => {
            license    => 'http://dev.perl.org/licenses/',
            repository => 'https://github.com/mirkos-vf/Poloniex-API',
            bugtracker => 'https://github.com/mirkos-vf/Poloniex-API/issues'

lib/Poloniex/API.pm  view on Meta::CPAN

use constant {
    URL_PUBLIC_API     => "https://poloniex.com/public?command=%s",
    URL_TRADING_API    => "https://poloniex.com/tradingApi",
    DEBUG_API_POLONIEX => $ENV{DEBUG_API_POLONIEX} || 0,
};

BEGIN {
    eval { require LWP::UserAgent, 1; }
      || die('LWP::UserAgent package not found');

    eval { require JSON::XS, 1; }
      || die('JSON::XS package not found');
}

our $VERSION = '0.04';

# singleton and accessor
{
    my $lwp = LWP::UserAgent->new( keep_alive => 1 );
    sub _lwp_agent { return $lwp }

    my $json = JSON::XS->new();
    sub _json { return $json }
}

sub new {
    my ( $class, %options ) = @ARG;
    my $object;

    $object->{APIKey} = $options{APIKey} || undef;
    $object->{Secret} = $options{Secret} || undef;
    $object->{_json}  = _json;

t/Poloniex-API.t  view on Meta::CPAN


use strict;
use warnings;
use Test::More qw(no_plan);
use Poloniex::API;

BEGIN {
    use_ok('Poloniex::API');
    eval { use Test::MockObject; 1 }
      || plan skip_all => 'Poloniex::API required for this test!';
    eval { use JSON::XS; 1 } 
      || plan skip_all => 'JSON::XS not installet!';
}

$ENV{DEBUG_API_POLONIEX} = 1;

my @test = (
    {
        agent => \&lwp_mock,
        resp  => {
            result =>
'{"BTC_LTC":{"last":"0.0251","lowestAsk":"0.02589999","highestBid":"0.0251","percentChange":"0.02390438", "baseVolume":"6.16485315","quoteVolume":"245.82513926"}}',

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.110 second using v1.00-cache-2.02-grep-82fe00e-cpan-81bb8482316b )