package transfer

import (
	"context"
	"time"

	"github.com/tech/sendico/gateway/chain/internal/service/gateway/drivers"
	"github.com/tech/sendico/gateway/chain/internal/service/gateway/rpcclient"
	"github.com/tech/sendico/gateway/chain/internal/service/gateway/shared"
	"github.com/tech/sendico/gateway/chain/storage"
	clockpkg "github.com/tech/sendico/pkg/clock"
	"github.com/tech/sendico/pkg/mlogger"
)

type Deps struct {
	Logger           mlogger.Logger
	Drivers          *drivers.Registry
	Networks         *rpcclient.Registry
	Storage          storage.Repository
	Clock            clockpkg.Clock
	RPCTimeout       time.Duration
	EnsureRepository func(context.Context) error
	LaunchExecution  func(transferRef, sourceWalletRef string, network shared.Network)
}

func (d Deps) WithLogger(name string) Deps {
	if d.Logger != nil {
		d.Logger = d.Logger.Named(name)
	}
	return d
}
