long unixTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds;
string na_zakod = "recvWindow=60000×tamp=" + unixTime;
var input = na_zakod;
var secretKey = project.Variables["sec"].Value;
byte[] secretkeyBytes = Encoding.UTF8.GetBytes(secretKey);
byte[] inputBytes = Encoding.UTF8.GetBytes(input);
var hmac = new HMACSHA256(secretkeyBytes);
byte[] hashValue = hmac.ComputeHash(inputBytes);
string signature = BitConverter.ToString(hashValue).Replace("-", "").ToLower();
var result = ZennoPoster.HttpGet(
url: "https://api.binance.com/api/v3/account?signature="+ signature+"&"+na_zakod,
//content: na_zakod,
// contentPostingType: "application/x-www-form-urlencoded",
proxy: project.GetProxy(),
Encoding: "UTF8",
respType: InterfacesLibrary.Enums.Http.ResponceType.BodyOnly,
Timeout: 30000,
Cookies: "",
UserAgent: "curl/7.38.0",
UseRedirect: false,
MaxRedirectCount: 0,
AdditionalHeaders: new String[] {
"User-Agent:Mozilla/4.0 (compatible; PHP",
"X-MBX-APIKEY:"+project.Variables["key"].Value+"",
"Content-Type:application/x-www-form-urlencoded"
}
);
work ok in spot,but i change the url to futures it not work,
long unixTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds;
string na_zakod = "recvWindow=60000×tamp=" + unixTime;
var input = na_zakod;
var secretKey = project.Variables["sec"].Value;
byte[] secretkeyBytes = Encoding.UTF8.GetBytes(secretKey);
byte[] inputBytes = Encoding.UTF8.GetBytes(input);
var hmac = new HMACSHA256(secretkeyBytes);
byte[] hashValue = hmac.ComputeHash(inputBytes);
string signature = BitConverter.ToString(hashValue).Replace("-", "").ToLower();
var result = ZennoPoster.HttpGet(
url: "https://fapi.binance.com/fapi/v2/account?signature="+ signature+"&"+na_zakod,
//content: na_zakod,
// contentPostingType: "application/x-www-form-urlencoded",
proxy: "",
Encoding: "UTF8",
respType: InterfacesLibrary.Enums.Http.ResponceType.BodyOnly,
Timeout: 30000,
Cookies: "",
UserAgent: "curl/7.38.0",
UseRedirect: false,
MaxRedirectCount: 0,
AdditionalHeaders: new String[] {
"User-Agent:Mozilla/4.0 (compatible; PHP",
"X-MBX-APIKEY:"+project.Variables["key"].Value+"",
"Content-Type:application/x-www-form-urlencoded"
}
);
Can someone help me see what’s wrong?