request method

void request({
  1. required String op,
  2. List<String>? args,
})

Send a command (op) and optional arguments to Bybit over the websocket

Implementation

void request({required String op, List<String>? args}) {
  var cmd = '{"op":"$op"';
  if (args != null && args != []) {
    cmd = cmd + ',"args": ["' + args.join('.') + '"]';
  }
  cmd += '}';
  log.d('send command ' + cmd);
  websocket!.sink.add(cmd);
}