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
private def issueSignedRequest(path: String, params: Map[String, String] = Map(), | |
post: Boolean = false): Future[JsonObject] = { | |
val sortedParams = params.map(p => p._1 + "=" + p._2).toList.sorted | |
val queryString = sortedParams.mkString("&") | |
val nonce = Instant.now().toEpochMilli.toString | |
val strForSign = path + "/" + nonce + "/" + queryString | |
val strForSign64 = Base64.getEncoder.encodeToString(strForSign.getBytes(charset)) |