diff --git a/cashu/lightning/lnmarkets.py b/cashu/lightning/lnmarkets.py index c6dd471d..cd99ca6c 100644 --- a/cashu/lightning/lnmarkets.py +++ b/cashu/lightning/lnmarkets.py @@ -112,14 +112,14 @@ async def get_request_headers(self, method: Method, path: str, data: dict) -> di signature = base64.b64encode( hmac.new( - self.secret.encode(), - f"{timestamp}{str(method)}{path}{params}".encode(), # bytes from utf-8 string + self.secret.encode("utf-8"), + f"{timestamp}{str(method)}{path}{params}".encode("utf-8"), # bytes from utf-8 string hashlib.sha256, ).digest() ) headers = self.headers.copy() headers["LNM-ACCESS-TIMESTAMP"] = str(timestamp) - headers["LNM-ACCESS-SIGNATURE"] = signature.decode() + headers["LNM-ACCESS-SIGNATURE"] = signature.decode("utf-8") if method == Method.POST: headers["Content-Type"] = "application/json" return headers