Opera WebSocket
curl --request GET \
--url wss://www.getavenir.co/ws/wsimport requests
url = "wss://www.getavenir.co/ws/ws"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('wss://www.getavenir.co/ws/ws', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "wss://www.getavenir.co/ws/ws",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "wss://www.getavenir.co/ws/ws"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("wss://www.getavenir.co/ws/ws")
.asString();require 'uri'
require 'net/http'
url = URI("wss://www.getavenir.co/ws/ws")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyConnection
Opera WebSocket
Upgrade to WebSocket. All Opera traffic is JSON text frames.
Client actions (set action):
operaConnect—{ token, requestId? }required for external bots (marks the socket as API; cannot call bot-mode / session record/reset)operaPlace— single order fields or{ orders: [...] }(max 40)operaCancel—{ orderId }operaCancelAlloperaGetState
Optional requestId is echoed on operaResult. The browser UI authenticates with userConnected (not operaConnect); UI-only ops are gated by that connection kind, not by a client source field.
Server messages (set type):
operaResult— reply to a client action (op,status, body fields)operaState— snapshot push after mutationsorderBook— live book / participants
GET
/
ws
Opera WebSocket
curl --request GET \
--url wss://www.getavenir.co/ws/wsimport requests
url = "wss://www.getavenir.co/ws/ws"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('wss://www.getavenir.co/ws/ws', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "wss://www.getavenir.co/ws/ws",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "wss://www.getavenir.co/ws/ws"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("wss://www.getavenir.co/ws/ws")
.asString();require 'uri'
require 'net/http'
url = URI("wss://www.getavenir.co/ws/ws")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyResponse
101
Switching Protocols