fix_: hide mercuryo provider
This commit is contained in:
parent
11cf42bedd
commit
4305609493
|
@ -558,19 +558,22 @@ type WalletConfig struct {
|
||||||
StatusProxyEnabled bool `json:"StatusProxyEnabled"`
|
StatusProxyEnabled bool `json:"StatusProxyEnabled"`
|
||||||
StatusProxyStageName string `json:"StatusProxyStageName"`
|
StatusProxyStageName string `json:"StatusProxyStageName"`
|
||||||
EnableCelerBridge bool `json:"EnableCelerBridge"`
|
EnableCelerBridge bool `json:"EnableCelerBridge"`
|
||||||
|
EnableMercuryoProvider bool `json:"EnableMercuryoProvider"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON custom marshalling to avoid exposing sensitive data in log,
|
// MarshalJSON custom marshalling to avoid exposing sensitive data in log,
|
||||||
// there's a function called `startNode` will log NodeConfig which include WalletConfig
|
// there's a function called `startNode` will log NodeConfig which include WalletConfig
|
||||||
func (wc WalletConfig) MarshalJSON() ([]byte, error) {
|
func (wc WalletConfig) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(struct {
|
return json.Marshal(struct {
|
||||||
Enabled bool `json:"Enabled"`
|
Enabled bool `json:"Enabled"`
|
||||||
StatusProxyEnabled bool `json:"StatusProxyEnabled"`
|
StatusProxyEnabled bool `json:"StatusProxyEnabled"`
|
||||||
EnableCelerBridge bool `json:"EnableCelerBridge"`
|
EnableCelerBridge bool `json:"EnableCelerBridge"`
|
||||||
|
EnableMercuryoProvider bool `json:"EnableMercuryoProvider"`
|
||||||
}{
|
}{
|
||||||
Enabled: wc.Enabled,
|
Enabled: wc.Enabled,
|
||||||
StatusProxyEnabled: wc.StatusProxyEnabled,
|
StatusProxyEnabled: wc.StatusProxyEnabled,
|
||||||
EnableCelerBridge: wc.EnableCelerBridge,
|
EnableCelerBridge: wc.EnableCelerBridge,
|
||||||
|
EnableMercuryoProvider: wc.EnableMercuryoProvider,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,4 +29,7 @@ type FeatureFlags struct {
|
||||||
|
|
||||||
// EnableCelerBridge indicates whether we should enable the Celer bridge in the Router
|
// EnableCelerBridge indicates whether we should enable the Celer bridge in the Router
|
||||||
EnableCelerBridge bool
|
EnableCelerBridge bool
|
||||||
|
|
||||||
|
// EnableMercuryoProvider indicates whether we should enable the Mercuryo provider in the Wallet
|
||||||
|
EnableMercuryoProvider bool
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,10 +106,23 @@ func NewService(
|
||||||
tokenManager.Start()
|
tokenManager.Start()
|
||||||
|
|
||||||
cryptoOnRampProviders := []onramp.Provider{
|
cryptoOnRampProviders := []onramp.Provider{
|
||||||
onramp.NewMercuryoProvider(tokenManager),
|
|
||||||
onramp.NewRampProvider(),
|
onramp.NewRampProvider(),
|
||||||
onramp.NewMoonPayProvider(),
|
onramp.NewMoonPayProvider(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
featureFlags := &protocolCommon.FeatureFlags{}
|
||||||
|
if config.WalletConfig.EnableCelerBridge {
|
||||||
|
featureFlags.EnableCelerBridge = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if config.WalletConfig.EnableMercuryoProvider {
|
||||||
|
featureFlags.EnableMercuryoProvider = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if featureFlags.EnableMercuryoProvider {
|
||||||
|
cryptoOnRampProviders = append(cryptoOnRampProviders, onramp.NewMercuryoProvider(tokenManager))
|
||||||
|
}
|
||||||
|
|
||||||
cryptoOnRampManager := onramp.NewManager(cryptoOnRampProviders)
|
cryptoOnRampManager := onramp.NewManager(cryptoOnRampProviders)
|
||||||
|
|
||||||
savedAddressesManager := &SavedAddressesManager{db: db}
|
savedAddressesManager := &SavedAddressesManager{db: db}
|
||||||
|
@ -184,11 +197,6 @@ func NewService(
|
||||||
|
|
||||||
activity := activity.NewService(db, accountsDB, tokenManager, collectiblesManager, feed, pendingTxManager)
|
activity := activity.NewService(db, accountsDB, tokenManager, collectiblesManager, feed, pendingTxManager)
|
||||||
|
|
||||||
featureFlags := &protocolCommon.FeatureFlags{}
|
|
||||||
if config.WalletConfig.EnableCelerBridge {
|
|
||||||
featureFlags.EnableCelerBridge = true
|
|
||||||
}
|
|
||||||
|
|
||||||
router := router.NewRouter(rpcClient, transactor, tokenManager, marketManager, collectibles,
|
router := router.NewRouter(rpcClient, transactor, tokenManager, marketManager, collectibles,
|
||||||
collectiblesManager, ens)
|
collectiblesManager, ens)
|
||||||
pathProcessors := buildPathProcessors(rpcClient, transactor, tokenManager, ens, featureFlags)
|
pathProcessors := buildPathProcessors(rpcClient, transactor, tokenManager, ens, featureFlags)
|
||||||
|
|
Loading…
Reference in New Issue