Heyo. Trying to figure out the best way to use websockex to stream Kraken trades. Their API requires a payload to define the subscription, possibly including an auth token for private data. I’m able to connect and get a basic status event back but am not sure how to send the payload from the start_link function.
for future ref :
call WebSockex.cast\2 in the connect\ callback as such :
def handle_connect(_conn, state) do
WebSockex.cast(self(), :subscribe)
{:ok, state}
end
def handle_cast(:subscribe, state) do
{:reply, {:text, subscription_frame()}, state}
end