Right now there is only one Frame class. This class checks the frame type with some nested if/else statements.
As we add new Frames this will become quite unhandy.
I suggest using a seperate class for each Frame type (similar to jacks) (e.g. EncryptedFrame, or GzipFrame) and let them register globally with their frame type “id”.
That's a rough sketch about my ideas:
Base class for Frames
Contains encrypted Frames
Contains gzipped frames
And that's how it could be used:
data = socket.recv() # new data from somewhere
frame = createFrame(data)
DONE / Accepting payments