It is currently quite confusing to get this issued_at correct. Would propose to make it able to import the ISO8601Datetime that you defined in the siwe.py for the end user.
The example usage would be like this then:
from datetime import datetime
from siwe import SiweMessage
from siwe import ISO8601Datetime
issued_at = ISO8601Datetime.from_datetime(datetime.now())
message = SiweMessage(
issued_at=issued_at,
)
The current user experience as I understand is like this:
from datetime import datetime
from siwe import SiweMessage
from siwe import ISO8601Datetime
timespec: str = "milliseconds"
dt = datetime.now()
issued_at = (dt.astimezone(tz=timezone.utc)
.isoformat(timespec=timespec)
.replace("+00:00", "Z"))
message = SiweMessage(
issued_at=issued_at,
)
It is currently quite confusing to get this issued_at correct. Would propose to make it able to import the ISO8601Datetime that you defined in the siwe.py for the end user.
The example usage would be like this then:
The current user experience as I understand is like this: