service backend
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful

This commit is contained in:
Stephan D
2025-11-07 18:35:26 +01:00
parent 20e8f9acc4
commit 62a6631b9a
537 changed files with 48453 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package fees
import (
oracleclient "github.com/tech/sendico/fx/oracle/client"
clockpkg "github.com/tech/sendico/pkg/clock"
)
// Option configures a Service instance.
type Option func(*Service)
// WithClock sets a custom clock implementation.
func WithClock(clock clockpkg.Clock) Option {
return func(s *Service) {
if clock != nil {
s.clock = clock
}
}
}
// WithCalculator sets a custom calculator implementation.
func WithCalculator(calculator Calculator) Option {
return func(s *Service) {
if calculator != nil {
s.calculator = calculator
}
}
}
// WithOracleClient wires an FX oracle client for FX trigger evaluations.
func WithOracleClient(oracle oracleclient.Client) Option {
return func(s *Service) {
s.oracle = oracle
if qc, ok := s.calculator.(*quoteCalculator); ok {
qc.oracle = oracle
}
}
}