# STXChannel

> A joined channel, and the messages it receives.

Source: https://docs.stxapp.io/sdks/csharp/reference/channel/

## STXChannel

| Member | Meaning |
|---|---|
| `Topic`, `Name` | The wire topic (`orders:<user_id>`) and its name (`orders`) |
| `Reply` | `JsonObject`: the latest join reply, e.g. `ping_timeout` on `orders` |
| `JoinPayload` | What the next join or rejoin sends; the `Select...Async` methods keep it current |
| `Joined`, `Closed`, `JoinRef` | State |
| `Watches` | The markets watched on `market_updates` |
| `ReadAllAsync(ct)` | `IAsyncEnumerable<STXChannelMessage>` until the channel closes |
| `NextAsync(timeout, ct)` | The next message; `TimeoutException` after `timeout` |
| `WaitSnapshotAsync(timeout, ct)` | The join snapshot, keyed by event name |
| `PushAsync(event, payload, timeout, ct)` | Sends a command and returns the reply's `response` |
| `PingAsync()` | Channel ping; the socket pings for you |
| `SelectMarketIdsAsync(marketIds)` | Changes `market_ids` without rejoining |
| `SelectFiltersAsync(filters)` | `ticker` and `trades` filters |
| `SelectRuleFiltersAsync(ruleFilters)`, `SelectMessageTypesAsync(messageTypes)` | `markets` filters |
| `WatchAsync(marketIds)` | `market_updates`: watch these markets; re-sent after a reconnect |
| `RequestSeriesAsync(marketIds, range)` | `market_stats`: history at a range |
| `RequestSnapshotAsync()` | `market:<id>`: send the market's state again |
| `LeaveAsync()` | Leaves the topic; reading ends |

## STXChannelMessage

| Member | Meaning |
|---|---|
| `Topic`, `Channel` | The topic, and its name without the user id |
| `Event` | e.g. `all_orders`, `new_open_order`, `book` |
| `Payload` | `JsonNode?`: the event's JSON, money as strings |
| `Data` | A typed model on the combo channels, else null |
| `IsSnapshot` | True for the state-on-join events |
| `Ref`, `JoinRef` | Wire refs |
| `As<T>()`, `As<T>(property)` | The payload, or one of its properties, read as `T` |
