kucoin: record kucoin json as files

This commit is contained in:
c9s 2021-12-23 12:19:21 +08:00
parent 838bc69f65
commit 74b09551b5
17 changed files with 287 additions and 7 deletions

View File

@ -61,15 +61,15 @@ func NewStream(client *kucoinapi.RestClient) *Stream {
return stream
}
func (s *Stream) handleCandleEvent(e *kucoinapi.WebSocketCandle) { }
func (s *Stream) handleCandleEvent(e *kucoinapi.WebSocketCandle) {}
func (s *Stream) handleOrderBookL2Event(e *kucoinapi.WebSocketOrderBookL2) { }
func (s *Stream) handleOrderBookL2Event(e *kucoinapi.WebSocketOrderBookL2) {}
func (s *Stream) handleTickerEvent(e *kucoinapi.WebSocketTicker) { }
func (s *Stream) handleTickerEvent(e *kucoinapi.WebSocketTicker) {}
func (s *Stream) handleAccountBalanceEvent(e *kucoinapi.WebSocketAccountBalance) { }
func (s *Stream) handleAccountBalanceEvent(e *kucoinapi.WebSocketAccountBalance) {}
func (s *Stream) handlePrivateOrderEvent(e *kucoinapi.WebSocketPrivateOrder) { }
func (s *Stream) handlePrivateOrderEvent(e *kucoinapi.WebSocketPrivateOrder) {}
func (s *Stream) handleConnect() {
if s.publicOnly {
@ -157,7 +157,6 @@ func (s *Stream) sendSubscriptions() error {
return nil
}
// getEndpoint use the publicOnly flag to check whether we should allocate a public bullet or private bullet
func (s *Stream) getEndpoint() (string, error) {
var bullet *kucoinapi.Bullet
@ -364,4 +363,3 @@ func ping(ctx context.Context, w WebSocketConnector, interval time.Duration) {
}
}
}

View File

@ -0,0 +1,24 @@
{
"id": "61c3f702e5edc90001b0b581",
"type": "message",
"topic": "/account/balance",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "account.balance",
"data": {
"accountId": "61b48b6d94ab8d000103ea77",
"available": "0.000036536828",
"availableChange": "-56.3116335782",
"currency": "USDT",
"hold": "56.3116335782",
"holdChange": "56.3116335782",
"relationContext": {
"symbol": "CRO-USDT",
"orderId": "61c3f702e5edc90001b0b575"
},
"relationEvent": "trade.hold",
"relationEventId": "61c3f702e5edc90001b0b581",
"time": "1640232706413",
"total": "56.311670115028"
}
}

View File

@ -0,0 +1,21 @@
{
"type": "message",
"topic": "/spotMarket/tradeOrders",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "orderChange",
"data": {
"symbol": "CRO-USDT",
"orderType": "limit",
"side": "buy",
"orderId": "61c3f702e5edc90001b0b575",
"type": "open",
"orderTime": 1640232706419104233,
"size": "104.5639",
"filledSize": "0",
"price": "0.538",
"remainSize": "104.5639",
"status": "open",
"ts": 1640232706419104233
}
}

View File

@ -0,0 +1,25 @@
{
"type": "message",
"topic": "/spotMarket/tradeOrders",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "orderChange",
"data": {
"symbol": "CRO-USDT",
"orderType": "limit",
"side": "buy",
"orderId": "61c3f702e5edc90001b0b575",
"liquidity": "maker",
"type": "match",
"orderTime": 1640232706419104233,
"size": "104.5639",
"filledSize": "104.5639",
"price": "0.538",
"matchPrice": "0.538",
"matchSize": "104.5639",
"tradeId": "61c3f7107857782458a39b06",
"remainSize": "0",
"status": "open",
"ts": 1640232720266477485
}
}

View File

@ -0,0 +1,21 @@
{
"type": "message",
"topic": "/spotMarket/tradeOrders",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "orderChange",
"data": {
"symbol": "CRO-USDT",
"orderType": "limit",
"side": "buy",
"orderId": "61c3f702e5edc90001b0b575",
"type": "filled",
"orderTime": 1640232706419104233,
"size": "104.5639",
"filledSize": "104.5639",
"price": "0.538",
"remainSize": "0",
"status": "done",
"ts": 1640232720266477485
}
}

View File

@ -0,0 +1,25 @@
{
"id": "61c3f710506791000143eeef",
"type": "message",
"topic": "/account/balance",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "account.balance",
"data": {
"accountId": "61b48b6d94ab8d000103ea77",
"available": "0.000036536828",
"availableChange": "0",
"currency": "USDT",
"hold": "0",
"holdChange": "-56.3116335782",
"relationContext": {
"symbol": "CRO-USDT",
"orderId": "61c3f702e5edc90001b0b575",
"tradeId": "61c3f7107857782458a39b06"
},
"relationEvent": "trade.setted",
"relationEventId": "61c3f710506791000143eeef",
"time": "1640232720319",
"total": "0.000036536828"
}
}

View File

@ -0,0 +1,25 @@
{
"id": "61c3f710506791000143eeee",
"type": "message",
"topic": "/account/balance",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "account.balance",
"data": {
"accountId": "61c3f710e5756100011faf58",
"available": "104.5639",
"availableChange": "104.5639",
"currency": "CRO",
"hold": "0",
"holdChange": "0",
"relationContext": {
"symbol": "CRO-USDT",
"orderId": "61c3f702e5edc90001b0b575",
"tradeId": "61c3f7107857782458a39b06"
},
"relationEvent": "trade.setted",
"relationEventId": "61c3f710506791000143eeee",
"time": "1640232720329",
"total": "104.5639"
}
}

View File

@ -0,0 +1,24 @@
{
"id": "61c3f71ce5edc90001b10686",
"type": "message",
"topic": "/account/balance",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "account.balance",
"data": {
"accountId": "61c3f710e5756100011faf58",
"available": "0",
"availableChange": "-104.5639",
"currency": "CRO",
"hold": "104.5639",
"holdChange": "104.5639",
"relationContext": {
"symbol": "CRO-USDT",
"orderId": "61c3f71ce5edc90001b10685"
},
"relationEvent": "trade.hold",
"relationEventId": "61c3f71ce5edc90001b10686",
"time": "1640232732749",
"total": "104.5639"
}
}

View File

@ -0,0 +1,21 @@
{
"type": "message",
"topic": "/spotMarket/tradeOrders",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "orderChange",
"data": {
"symbol": "CRO-USDT",
"orderType": "limit",
"side": "sell",
"orderId": "61c3f71ce5edc90001b10685",
"type": "open",
"orderTime": 1640232732749540684,
"size": "104.5639",
"filledSize": "0",
"price": "0.5382",
"remainSize": "104.5639",
"status": "open",
"ts": 1640232732749540684
}
}

View File

@ -0,0 +1,25 @@
{
"type": "message",
"topic": "/spotMarket/tradeOrders",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "orderChange",
"data": {
"symbol": "CRO-USDT",
"orderType": "limit",
"side": "sell",
"orderId": "61c3f71ce5edc90001b10685",
"liquidity": "maker",
"type": "match",
"orderTime": 1640232732749540684,
"size": "104.5639",
"filledSize": "104.5639",
"price": "0.5382",
"matchPrice": "0.5382",
"matchSize": "104.5639",
"tradeId": "61c3f71f7857782458a39b54",
"remainSize": "0",
"status": "open",
"ts": 1640232735930840841
}
}

View File

@ -0,0 +1,21 @@
{
"type": "message",
"topic": "/spotMarket/tradeOrders",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "orderChange",
"data": {
"symbol": "CRO-USDT",
"orderType": "limit",
"side": "sell",
"orderId": "61c3f71ce5edc90001b10685",
"type": "filled",
"orderTime": 1640232732749540684,
"size": "104.5639",
"filledSize": "104.5639",
"price": "0.5382",
"remainSize": "0",
"status": "done",
"ts": 1640232735930840841
}
}

View File

@ -0,0 +1,25 @@
{
"id": "61c3f71fd5ad710001b5c2a1",
"type": "message",
"topic": "/account/balance",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "account.balance",
"data": {
"accountId": "61b48b6d94ab8d000103ea77",
"available": "56.220051225848",
"availableChange": "56.22001468902",
"currency": "USDT",
"hold": "0",
"holdChange": "0",
"relationContext": {
"symbol": "CRO-USDT",
"orderId": "61c3f71ce5edc90001b10685",
"tradeId": "61c3f71f7857782458a39b54"
},
"relationEvent": "trade.setted",
"relationEventId": "61c3f71fd5ad710001b5c2a1",
"time": "1640232735979",
"total": "56.220051225848"
}
}

View File

@ -0,0 +1,25 @@
{
"id": "61c3f71fd5ad710001b5c2a0",
"type": "message",
"topic": "/account/balance",
"userId": "61af6413efeab1000113f08b",
"channelType": "private",
"subject": "account.balance",
"data": {
"accountId": "61c3f710e5756100011faf58",
"available": "0",
"availableChange": "0",
"currency": "CRO",
"hold": "0",
"holdChange": "-104.5639",
"relationContext": {
"symbol": "CRO-USDT",
"orderId": "61c3f71ce5edc90001b10685",
"tradeId": "61c3f71f7857782458a39b54"
},
"relationEvent": "trade.setted",
"relationEventId": "61c3f71fd5ad710001b5c2a0",
"time": "1640232735982",
"total": "0"
}
}