Models

The supported model types between Server and Client are given in the following tables.

  • The Code in the table is the type value of the model. (The number on the top left of the model)

  • ShortName is the model code (which we use this way) that can be used as a variable, class, or enum name.

  • Mixes of types (letter code at the top right of the model) and usage patterns are as follows:

    • P: general packages. Contains type. There is no need to subscribe or login to any channel to receive or send.

    • U: General packages that are accessed only by logged-in users. These packages also do not have a /channel and subscription connection.

    • A: Packages received only when subscribed to events on the channels. In the models of these packages, besides the type variable, there are string variables named channel and event.

100

Result

P

A message sent from the server to the client. These are model-free results returned from requests sent to the server. For example, UserLogin, Subscription, and so on.

Type

number

Model type

ID

number

Id value of the model being processed. It is used in some Result models. The value can be 0 when not in use.

Ok

boolean

Transaction success

message

string

transaction message. It usually contains short codes for the transaction. It should not be shown to the end user. For example, the value returned as subscription result: “join | trade: BTCTRY” is similar.

101

Request

P

Extra requests sent to the server. For example, the Request model is sent when the last operations list is requested again.

type

number

Model type

code

number

The request code. Designed in the same way as possible with package types. These request codes are listed at the end of the document. For example, the client must send this code value 421 (model type of final operations) to request that the last transactions be sent back to it.

channel

string

If the request is sent over a particular channel, this value must be written to the channel name. For non-channel requests, null can be sent.

event

string

If the request is sent over a particular event, this value must be written to the name of the event. For non-event requests, null can be sent.

111

UserLogin

P

A message sent from the client to the server. User input model.

type

number

Model type

ID

number

The id value of the user. Must be sent. The server checks for its equality with the value read from the Token. If you want to make a guest login notification, send 0 to this value. (Guest login notification is not mandatory in the system)

username

string

User name. E-mail address for BtcTurk. Giriş guest. Should be written in the guest entrance notifications.

token

string

The current token value of the user from SSO. Null must be sent in guest notifications.

app

string

Application name: “pro” or “easy”

platform

string

User's operating system or browser information: “android”, “ios”, “windows”, “linux”

112

UserLoginResult

P

A message sent from the server to the client. This is the answer to the user input model. It is exactly the same as the Result model. Only the model type is 112.

113

UserLogout

U

It is a message that is sent back from client to server and back from server to client. The user is the output model. After this model is taken, the server will terminate the socket connection.

type

number

Model type

ID

number

User Id

151

Subscription

P

A message sent from the client to the server. A model sent to subscribe to or unsubscribe from an event on a channel. Messages related to subscribed events are continuously sent to the user.

type

number

Model type

channel

string

The name of the channel. For example; trade, orderbook, ticker etc.

event

string

speak event name event name. Event names are often used as “all” or upper-case as pair name (eg BTCTRY, ETHTRY).

jon

boolean

If true, it means that you want to subscribe, if false, you can unsubscribe.

201

BalanceUpdated

U

The model sent by the server when the user's balance changes for any reason (confirmation, withdrawal request, deposit request, request confirmations, etc.). When this message is received, the user's balance must be updated from the API endpoint.

type

number

Model type

UserID

number

User Id

payload

string

Transaction description. For informational purposes.

401

TickerAll

C

A message sent from the server to the client. It is the model of all ticker data belonging to all Pairs.

type

number

Model type

items

TickerPair []

An array of type TickerPair. The only difference is that there is no type variable in every TickerPair model. The TickerPair model is described below.

402

TickerPair

C

A message sent from the server to the client. It is only a model of all ticker data for a particular Pair.

type

number

Model type

PS

string

Pair Symbol. For example; BTCTRY

H

string

High. Highest price in the last 24 hours.

L

string

Lower. The lowest price in the last 24 hours.

La

string

Last. The price of the last transaction.

SHE IS

string

Open. Price of the first transaction of the day

V

string

Volume. Volume.

AV

string

Average. Average price.

D

string

Daily. Daily change amount.

DS

string

Denominator Symbol. For example BTCTRY TRY.

NS

string

Numerator Symbol. For example BTCTRY for BTC.

PID

number

Pair Id value.

NPr

number

Numerator precision value. For example BTC 8

Dpr

number

Denominator precision value. For example TRY 2

Ord

number

Pair's display sequence.

B

string

Bidar. Best purchase order price.

A

string

Love. Best selling order price.

DP

string

Daily percent. 24-hour exchange rate.

421

TradeList

C

A message sent from the server to the client. This is the list of all recent transactions of the specified Pair.

type

number

Model type

channel

string

Message channel

event

string

The name of the event to which the message was delivered.

symbol

string

Pair symbol. For example; BTCTRY

items

TradeSingle []

An array in the list that contains a transaction log. The TradeSingle model is described below. The TradeSingle models in the TradeList model do not contain the PS and type variables.

422

TradeSingle

C

A message sent from the server to the client. It is a single trade data of the specified Pair. This data is sent as it occurs.

type

number

Model type

PS

number

Pair Symbol. For example; BTCTRY.

A

string

Amount. The amount of the transaction.

D

number

Date. Transaction date. UnixTime is the value in milliseconds.

P

string

Price. The price at which the transaction was made.

I

string

The unique number of the transaction. (Uniqueness is valid only in its own pairi)

431

OrderBookFull

C

A message sent from the server to the client. It is the entire order book model of a particular Pair.

type

number

Model type

CS

number

ChangeSet. Change number. It comes in the form of sequential values. There is no control at this time.

PS

string

Pair Symbol value. For example; BTCTRY

AO

Order []

List of sales orders. The Order object contains two variables: A, amount, and transaction quantity. P is the price, the transaction price.

BO

Order []

List of purchase orders.

432

OrderBookDifference

C

A message sent from the server to the client. Sends order book data of only a particular Pair's changes. The user must have previous order book data to use this model. This data is sent automatically from the server when the event is subscribed.

changingord is

  • PS: Orders are transaction type. 0: Updated, 1: New added, 3: Deleted

  • P: Order price value.

  • A: Orders is the quantity.

type

number

Model type

CS

number

ChangeSet. Change number. It comes in the form of sequential values. There is no control at this time.

PS

string

Pair Symbol value. For example; BTCTRY

AO

ChangingOrder []

List of sales orders. The Order object contains two variables: A, amount, and transaction quantity. P is the price, the transaction price.

BO

ChangingOrder []

List of purchase orders.

441

UserOrderMatch

U

It is the model that contains the details of this process, which is sent from the server to the user when an order of the connected user is executed.

type

number

Model type

ID

number

Id value of the model being processed.

user

boolean

The id of the user being processed.

IsBid

string

True if the transaction is buying or false if the transaction is buying.

method

number

transaction method. 0: limit, 1: market, 2: stop limit

pair

number

pair id value of the transaction

symbol

string

The pair symbol value of the operation. For example; BTCTRY

numTotal

string

Total Numerator amount of the order

numleft

string

The quantity of the numerator remaining after the trade has been executed.

denomTotal

string

Total denominator amount of order

denomLeft

string

The denominator amount of the order remaining after the trade has taken place.

amount

string

The amount of the transaction.

price

string

The price at which the transaction occurred.

451

orderınsert

U

A message sent from the server to the client. When a user's order is added to the system, it is the model sent to the user. Newly added orders will be sent with the model. When this model is received from the server, the user's orders can be updated from the endpoint.

type

number

Model type

pairId

number

The pair id value of the order.

symbol

string

The pair symbol value of the order.

ID

number

Order Id value.

method

number

Type of order (0: limit, 1: market, 2: stop limit)

userId

number

The Id value of the user who issued the order.

price

string

Price of the order

amount

string

Amount of order

452

OrderDelete

U

A message sent from the server to the client. When a user's order is deleted from the system, it is the model that is sent to the user. Deleted orders with model will be sent. When this model is received from the server, the user's orders can be updated from the endpoint. The model is the same as the OrderInsert model.

453

OrderUpdate

U

A message sent from the server to the client. This is the model sent to the user when an order of the user is updated in the system. Orders updated with the model will be sent. When this model is received from the server, the user's orders can be updated from the endpoint. The model is the same as the OrderInsert model.