@@ -24,6 +24,7 @@ import (
2424 cryptotypes "github.com/status-im/status-go/crypto/types"
2525 "github.com/status-im/status-go/logutils"
2626 "github.com/status-im/status-go/multiaccounts/accounts"
27+ "github.com/status-im/status-go/multiaccounts/settings"
2728 "github.com/status-im/status-go/params"
2829 "github.com/status-im/status-go/pkg/pubsub"
2930 "github.com/status-im/status-go/protocol/communities/token"
@@ -83,6 +84,7 @@ type ManagerInterface interface {
8384type Manager struct {
8485 balancefetcher.BalanceFetcher
8586 db * sql.DB
87+ settings * settings.Database
8688 RPCClient rpc.ClientInterface
8789 ContractMaker * contracts.ContractMaker
8890 networkManager network.ManagerInterface
@@ -113,6 +115,8 @@ func NewTokenManager(
113115) * Manager {
114116 maker , _ := contracts .NewContractMaker (RPCClient )
115117
118+ settings , err := settings .MakeNewDB (appDB )
119+
116120 tokensLists , err := tokenlists .NewTokenLists (appDB , db )
117121 if err != nil {
118122 logutils .ZapLogger ().Error ("Failed to create token lists" , zap .Error (err ))
@@ -122,6 +126,7 @@ func NewTokenManager(
122126 return & Manager {
123127 BalanceFetcher : balancefetcher .NewDefaultBalanceFetcher (maker ),
124128 db : db ,
129+ settings : settings ,
125130 RPCClient : RPCClient ,
126131 ContractMaker : maker ,
127132 networkManager : networkManager ,
@@ -140,9 +145,15 @@ func (tm *Manager) Start(ctx context.Context, autoRefreshInterval time.Duration,
140145 tm .stopCh = make (chan struct {})
141146 tm .startAccountsWatcher ()
142147
148+ thirdpartyServicesEnabled , err := tm .settings .ThirdpartyServicesEnabled ()
149+ if err != nil {
150+ logutils .ZapLogger ().Error ("failed to get if thirdparty services are enabled" , zap .Error (err ))
151+ return
152+ }
153+
143154 // For now we don't have the list of tokens lists remotely set so we're uisng the harcoded default lists. Once we have it
144155 //we will just need to update the empty string with the correct URL.
145- tm .tokenLists .Start (ctx , fetcher .RemoteListOfTokenLists , autoRefreshInterval , autoRefreshCheckInterval )
156+ tm .tokenLists .Start (ctx , fetcher .RemoteListOfTokenLists , autoRefreshInterval , autoRefreshCheckInterval , thirdpartyServicesEnabled )
146157}
147158
148159func (tm * Manager ) startAccountsWatcher () {
0 commit comments