Create new client that connects to the backend service
config containing information about backend service
Common function to transition to finished state and reject the promise. Also handles closing the connection if it's not already closed/closing.
The WebSocket connection to close.
The current protocol state.
The error to reject with.
Where the error originated (for logging/clarity).
The promise reject function to use.
The Websocket client to the Wallet Provider backend service. All requests are relayed by this entity to the MPC network.