Created
August 9, 2017 21:06
-
-
Save PsyDebug/e596f6e0a851b46f894042b0a5986b73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use Digest::SHA qw(hmac_sha512_hex); | |
use HTTP::Request; | |
use LWP::UserAgent; | |
my $apikey=''; | |
my $apisecret=''; | |
my $nonce=time(); | |
my $uri='https://bittrex.com/api/v1.1/market/getopenorders?apikey='.$apikey.'&nonce='.$nonce; | |
my $sign=hmac_sha512_hex($uri,$apisecret); | |
my $req = HTTP::Request->new(GET, $uri, ['apisign'=>$sign] ); | |
my $ua = LWP::UserAgent->new(); | |
my $response = $ua->request($req); | |
if ($response->is_success) { | |
print $response->decoded_content."\n"; | |
} | |
else { | |
die $response->status_line; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment