I keep receiving: {“code”:-1022,“msg”:“Signature for this request is not valid.”}
var timestamp = Instant.now().toEpochMilli();
var signatureItem = "timestamp=" + timestamp;
var signature = BinanceAuthUtil.generateSignature(signatureItem);
var logonJson = """
{
"id": "%s",
"method": "session.logon",
"params": {
"apiKey": "%s",
"signature": "%s",
"timestamp": %d
}
}
""".formatted(id, API_KEY, timestamp, signature);
So, for session.logon, should signature be only timestamp? I tried with multiple versions, by signing entire request, specific parameters - but I still keep getting the error.
I use the Ed25519 key.
Any idea why this could happen?