For each WS connection, gateway will send following message as initial message
Name | Type | Description |
---|---|---|
hello |
object |
|
sid |
string |
Session id |
isNew |
boolean |
Whether or not session is a new one |
{
"hello":{
"sid":"12345",
"isNew":false
}
}
Name | Type | Description |
---|---|---|
m |
string |
Method name |
p |
object |
Parameters dictionary |
i |
integer |
Request id (use to match reply) |
Note
|
If i property is not set, no reply or error will be returned by gateway |
{
"m":"subscribeToOrderBooks",
"p":{
"exchange":"bittrex",
"pairs":["USDT-BTC","USDT-NEO"]
},
"i":1
}
Name | Type | Description |
---|---|---|
i |
integer |
Request id (ie: as provided when calling method) |
r |
object,array,scalar |
Result (type depends on method) |
{
"i":1,
"r":true
}
Name | Type | Description |
---|---|---|
i |
integer |
Request id (ie: as provided when calling method) |
e |
object |
Error object |
t |
string |
Error type (internal_error,invalid_request,invalid_params,invalid_method) |
d |
object,array,scalar |
Extra error data (optional) (type depends on method) |
{
"e":{
"t":"invalid_params",
"m":"'dummy' exchange is not supported"
},
"i":2
}
Name | Type | Description |
---|---|---|
n |
string |
Notification type |
d |
object |
Notification data |
Note
|
See Notifications documentation for a list of possible notifications |
{
"n":"trades",
"d":{
"pair":"USDT-BTC",
"data":[
{
"quantity":0.04692557,
"rate":8274.8261,
"price":388.300931393377,
"orderType":"sell",
"timestamp":1511392363.357
}
],
"exchange":"bittrex"
}
}
Name | Type | Default | Description |
---|---|---|---|
filter |
object |
Used to list pairs matching a given currency or base currency |
|
currency |
string |
Used to list only pairs matching a given currency |
|
baseCurrency |
string |
Used to list only pairs matching a given base currency (will be ignored if filter.currency is set) |
Result will be a dictionary using pairs as keys
Name | Type | Description |
---|---|---|
pair |
string |
Pair name X-Y |
pair |
string |
Pair name X-Y (same as pair key) |
baseCurrency |
string |
Base currency (part X in pair X-Y) |
currency |
string |
Currency (part Y in pair X-Y) |
Request
{
"i":1,
"m":"getPairs",
"p":{
"exchange":"bittrex"
}
}
Reply
{
"i":1,
"r":{
"BTC-1ST":{
"pair":"BTC-1ST",
"baseCurrency":"BTC",
"currency":"1ST"
},
"BTC-2GIVE":{
"pair":"BTC-2GIVE",
"baseCurrency":"BTC",
"currency":"2GIVE"
},
...
"USDT-BTG":{
"pair":"USDT-BTG",
"baseCurrency":"USDT",
"currency":"BTG"
}
}
}
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to subscribe to (X-Y) |
Name | Type | Default | Description |
---|---|---|---|
reset |
boolean |
false |
If true, previous subscriptions will be discarded |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to unsubscribe from (X-Y) |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to subscribe to (X-Y) |
Name | Type | Default | Description |
---|---|---|---|
reset |
boolean |
false |
If true, previous subscriptions will be discarded |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to unsubscribe from (X-Y) |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to resync order books for (X-Y) |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to subscribe to (X-Y) |
Name | Type | Default | Description |
---|---|---|---|
reset |
boolean |
false |
If true, previous subscriptions will be discarded |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to unsubscribe from (X-Y) |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to subscribe to (X-Y) |
Name | Type | Default | Description |
---|---|---|---|
interval |
string |
Depends on exchange |
Klines interval (ex: 5m) |
reset |
boolean |
false |
If true, previous subscriptions will be discarded |
Name | Type | Description |
---|---|---|
exchange |
string |
Exchange identifier |
pairs |
string[] |
Array of pairs to unsubscribe from (X-Y) |
Name | Type | Default | Description |
---|---|---|---|
interval |
string |
None |
Klines interval (ex: 5m). If not set, will unsubscribe for all intervals |
Used to cancel all subscriptions for a given exchange or all exchanges
Name | Type | Default | Description |
---|---|---|---|
exchange |
string |
Exchange identifier (if not defined, subscriptions will be cancelled for all exchanges) |