Skip to content

Instantly share code, notes, and snippets.

@PsyDebug
Created August 9, 2017 21:06
Show Gist options
  • Save PsyDebug/e596f6e0a851b46f894042b0a5986b73 to your computer and use it in GitHub Desktop.
Save PsyDebug/e596f6e0a851b46f894042b0a5986b73 to your computer and use it in GitHub Desktop.
#!/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