feat: сеть (network) для крипто-холдингов

Свободное текстовое поле на холдинге — какой сети принадлежит конкретная
монета (Ethereum, Tron и т.д.), с редактированием прямо в таблице и
разбивкой % по сетям на отдельной вкладке. Помогает увидеть, что часть
стейблкоинов лежит на рискованных сетях и стоит перевести на безопасные.
This commit is contained in:
ZProger
2026-09-09 00:52:11 +03:00
parent 526bfe104d
commit c3047c6d6a
16 changed files with 421 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ import type {
CryptoHistoryResponse,
CryptoHolding,
CryptoHoldingCreateInput,
CryptoHoldingUpdateInput,
CryptoPerformanceResponse,
CryptoPortfolio,
CryptoPortfolioInput,
@@ -48,6 +49,13 @@ export function createCryptoHolding(input: CryptoHoldingCreateInput) {
return api.post<CryptoHolding>("/crypto/holdings", input);
}
// Holding-only metadata (currently just `network`) — quantity/price/date
// live on the transaction log, risk_level on the underlying Asset (see
// updateCryptoHoldingRisk above).
export function updateCryptoHolding(assetId: number, input: CryptoHoldingUpdateInput) {
return api.patch<CryptoHolding>(`/crypto/holdings/${assetId}`, input);
}
// Buy more of, or sell some of, a coin already being tracked.
export function addCryptoTransaction(assetId: number, input: CryptoTransactionInput) {
return api.post<CryptoHolding>(`/crypto/holdings/${assetId}/transactions`, input);