Skip to content

Commit 858d887

Browse files
committed
chore: remove balance history service
1 parent c8d89ff commit 858d887

File tree

15 files changed

+69
-2594
lines changed

15 files changed

+69
-2594
lines changed

services/wallet/api.go

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/status-im/status-go/services/wallet/collectibles"
3030
wcommon "github.com/status-im/status-go/services/wallet/common"
3131
"github.com/status-im/status-go/services/wallet/currency"
32-
"github.com/status-im/status-go/services/wallet/history"
3332
"github.com/status-im/status-go/services/wallet/leaderboard"
3433
"github.com/status-im/status-go/services/wallet/onramp"
3534
"github.com/status-im/status-go/services/wallet/requests"
@@ -116,49 +115,6 @@ func (api *API) FetchDecodedTxData(ctx context.Context, data string) (*thirdpart
116115
return api.s.decoder.Decode(data)
117116
}
118117

119-
// GetBalanceHistory retrieves token balance history for token identity on multiple chains
120-
func (api *API) GetBalanceHistory(ctx context.Context, chainIDs []uint64, addresses []common.Address, tokenSymbol string, currencySymbol string, timeInterval history.TimeInterval) ([]*history.ValuePoint, error) {
121-
logutils.ZapLogger().Debug("wallet.api.GetBalanceHistory",
122-
zap.Uint64s("chainIDs", chainIDs),
123-
zap.Stringers("address", addresses),
124-
zap.String("tokenSymbol", tokenSymbol),
125-
zap.String("currencySymbol", currencySymbol),
126-
zap.Int("timeInterval", int(timeInterval)),
127-
)
128-
129-
var fromTimestamp uint64
130-
now := uint64(time.Now().UTC().Unix())
131-
switch timeInterval {
132-
case history.BalanceHistoryAllTime:
133-
fromTimestamp = 0
134-
case history.BalanceHistory1Year:
135-
fallthrough
136-
case history.BalanceHistory6Months:
137-
fallthrough
138-
case history.BalanceHistory1Month:
139-
fallthrough
140-
case history.BalanceHistory7Days:
141-
fromTimestamp = now - history.TimeIntervalDurationSecs(timeInterval)
142-
default:
143-
return nil, fmt.Errorf("unknown time interval: %v", timeInterval)
144-
}
145-
146-
return api.GetBalanceHistoryRange(ctx, chainIDs, addresses, tokenSymbol, currencySymbol, fromTimestamp, now)
147-
}
148-
149-
// GetBalanceHistoryRange retrieves token balance history for token identity on multiple chains for a time range
150-
// 'toTimestamp' is ignored for now, but will be used in the future to limit the range of the history
151-
func (api *API) GetBalanceHistoryRange(ctx context.Context, chainIDs []uint64, addresses []common.Address, tokenSymbol string, currencySymbol string, fromTimestamp uint64, _ uint64) ([]*history.ValuePoint, error) {
152-
logutils.ZapLogger().Debug("wallet.api.GetBalanceHistoryRange",
153-
zap.Uint64s("chainIDs", chainIDs),
154-
zap.Stringers("address", addresses),
155-
zap.String("tokenSymbol", tokenSymbol),
156-
zap.String("currencySymbol", currencySymbol),
157-
zap.Uint64("fromTimestamp", fromTimestamp),
158-
)
159-
return api.s.history.GetBalanceHistory(ctx, chainIDs, addresses, tokenSymbol, currencySymbol, fromTimestamp)
160-
}
161-
162118
func (api *API) GetTokenList(ctx context.Context) (*token.ListWrapper, error) {
163119
logutils.ZapLogger().Debug("call to get token list")
164120
rst := api.s.tokenManager.GetList()

services/wallet/history/balance.go

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)