exchanges/account: add UpdatedAt field to Balance and ProtectedBalance (#1827)

* add updatedAt for account balance

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* add nil pointer test for load

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* account: set default updatedAt to balance for Update

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* engine: add UpdatedAt for account info

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* account: force updatedAt for load balance

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* minor change for test

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
This commit is contained in:
Jun
2025-03-13 11:57:14 +09:00
committed by GitHub
parent 138419e7a8
commit 4474278053
9 changed files with 6890 additions and 8648 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -181,6 +181,7 @@ message AccountCurrencyInfo {
double free = 4;
double free_without_borrow = 5;
double borrowed = 6;
google.protobuf.Timestamp updated_at = 7;
}
message GetAccountInfoResponse {

View File

@@ -4784,6 +4784,7 @@
"currencies": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcAccountCurrencyInfo"
}
}
@@ -4814,6 +4815,10 @@
"borrowed": {
"type": "number",
"format": "double"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
}
},
@@ -4915,6 +4920,7 @@
"orders": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrders"
}
},
@@ -4956,6 +4962,7 @@
"orders": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrders"
}
}
@@ -5279,6 +5286,7 @@
"currencyStates": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCurrencyState"
}
}
@@ -5357,6 +5365,7 @@
"jobResults": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcDataHistoryJobResult"
}
},
@@ -5394,6 +5403,7 @@
"results": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcDataHistoryJob"
}
}
@@ -5419,6 +5429,7 @@
"addresses": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcDepositAddress"
}
}
@@ -5540,6 +5551,7 @@
"rates": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcFundingRate"
}
},
@@ -5629,6 +5641,7 @@
"orders": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderDetails"
}
},
@@ -5788,6 +5801,7 @@
"scripts": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcGCTScript"
}
}
@@ -5853,6 +5867,7 @@
"accounts": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcAccount"
}
}
@@ -5864,6 +5879,7 @@
"events": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcAuditEvent"
}
}
@@ -5938,12 +5954,14 @@
"currencyBreakdown": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCollateralForCurrency"
}
},
"positionBreakdown": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCollateralByPosition"
}
}
@@ -6152,6 +6170,7 @@
"forexProviders": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcForexProvider"
}
}
@@ -6163,6 +6182,7 @@
"forexRates": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcForexRatesConversion"
}
}
@@ -6182,6 +6202,7 @@
"positions": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcFuturePosition"
}
}
@@ -6225,6 +6246,7 @@
"candle": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCandle"
}
}
@@ -6322,6 +6344,7 @@
"positions": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcFuturePosition"
}
}
@@ -6333,6 +6356,7 @@
"rates": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcMarginRate"
}
},
@@ -6369,6 +6393,7 @@
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOpenInterestDataResponse"
}
}
@@ -6554,6 +6579,7 @@
"orderbooks": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderbooks"
}
}
@@ -6585,6 +6611,7 @@
"orders": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderDetails"
}
}
@@ -6596,6 +6623,7 @@
"portfolio": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcPortfolioAddress"
}
}
@@ -6607,12 +6635,14 @@
"coinTotals": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCoin"
}
},
"coinsOffline": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCoin"
}
},
@@ -6625,6 +6655,7 @@
"coinsOnline": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCoin"
}
},
@@ -6689,6 +6720,7 @@
"tickers": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcTickers"
}
}
@@ -6776,6 +6808,7 @@
"addresses": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOfflineCoinSummary"
}
}
@@ -6893,6 +6926,7 @@
"trades": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcTradeHistory"
}
},
@@ -6931,12 +6965,14 @@
"bids": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderbookItem"
}
},
"asks": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderbookItem"
}
},
@@ -6961,6 +6997,7 @@
"orderbooks": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderbookResponse"
}
}
@@ -7080,6 +7117,7 @@
"trades": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcSavedTrades"
}
}
@@ -7140,6 +7178,7 @@
"pairs": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcCurrencyPair"
}
},
@@ -7276,6 +7315,7 @@
"orders": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcOrderbookItem"
}
},
@@ -7346,6 +7386,7 @@
"trades": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcTrades"
}
}
@@ -7403,6 +7444,7 @@
"tickers": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcTickerResponse"
}
}
@@ -7592,6 +7634,7 @@
"subscriptions": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcWebsocketSubscription"
}
}
@@ -7781,6 +7824,7 @@
"event": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/gctrpcWithdrawalEventResponse"
}
}
@@ -7847,6 +7891,7 @@
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}

File diff suppressed because it is too large Load Diff