in reply to Re^8: Invalid nonce
in thread Invalid nonce
the problem still persists
Error: {"status": "error", "reason": "Invalid signature", "code": "API0005"}
my $apiKey = 'BITSTAMP p25F7aWa'; my $apiSecret = 'gisWNuYX4Q'; my $urlcb = "https://www.bitstamp.net"; my $url = URI->new($urlcb); my $urlpath = $url->path('/api/v2/usdt_withdrawal/'); my @Char = ('a'..'z'); my $Leng = 36; my $RandomChar = ''; for (1..$Leng) { $RandomChar .= $Char[int rand @Char]; } my $timestamp = int (gettimeofday * 1000); my $nonce = $RandomChar; my $Query = URI->new(); $Query->query_form( 'currency' => "USDT", 'network' => "ethereum", 'address' => "Ef4cAwayizMH", 'amount' => "4" ); my $API_Version = 'v2'; my $ContentType = "application/x-www-form-urlencoded"; my $msg = $apiKey.'POST'.$urlcb.$urlpath.$ContentType.$nonce.$timestam +p.$API_Version.$Query, $apiSecret; my $signature = hmac_sha256_hex($msg, $apiSecret); my %payload = ( "X-Auth" => $apiKey, "X-Auth-Signature" => $signature, "X-Auth-Nonce" => $nonce, "X-Auth-Timestamp" => $timestamp, "X-Auth-Version" => $API_Version, "Content-Type" => $ContentType ); my $req = HTTP::Request->new(POST=>$url); $req->header(%payload); $req->content($Query); my $resp = $ua->request($req); if($resp->is_success){ print $resp->content ."\n"; } else{ print "Error: " . $resp->content; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Invalid nonce
by Corion (Patriarch) on Jul 21, 2024 at 05:00 UTC | |
by frank1 (Monk) on Aug 20, 2024 at 19:23 UTC | |
by hippo (Archbishop) on Aug 21, 2024 at 10:28 UTC | |
by Corion (Patriarch) on Aug 21, 2024 at 16:12 UTC | |
by cavac (Prior) on Aug 21, 2024 at 06:19 UTC | |
by frank1 (Monk) on Aug 21, 2024 at 12:45 UTC |