diff --git a/pkg/api/router.go b/pkg/api/router.go index 8cffd8ac32..d2f8fdb0c6 100644 --- a/pkg/api/router.go +++ b/pkg/api/router.go @@ -532,6 +532,7 @@ func (s *Service) mountBusinessDebug() { handle("/wallet", web.ChainHandlers( s.checkChequebookAvailability, + s.checkSwapAvailability, web.FinalHandler(jsonhttp.MethodHandler{ "GET": http.HandlerFunc(s.walletHandler), }), diff --git a/pkg/node/node.go b/pkg/node/node.go index 2cda81da54..a9cbcf1058 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -492,19 +492,19 @@ func NewBee( } } - chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress) - if err != nil { - return nil, err - } + if o.SwapEnable { + chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress) + if err != nil { + return nil, err + } - erc20Address, err := chequebookFactory.ERC20Address(ctx) - if err != nil { - return nil, fmt.Errorf("factory fail: %w", err) - } + erc20Address, err := chequebookFactory.ERC20Address(ctx) + if err != nil { + return nil, fmt.Errorf("factory fail: %w", err) + } - erc20Service = erc20.New(transactionService, erc20Address) + erc20Service = erc20.New(transactionService, erc20Address) - if o.SwapEnable { if o.ChequebookEnable && chainEnabled { chequebookService, err = InitChequebookService( ctx,