go-waku/waku/v2/protocol/swap/waku_swap_option.go

30 lines
557 B
Go

package swap
type SwapParameters struct {
mode int
paymentThreshold int
disconnectThreshold int
}
type SwapOption func(*SwapParameters)
func WithMode(mode int) SwapOption {
return func(params *SwapParameters) {
params.mode = mode
}
}
func WithThreshold(payment, disconnect int) SwapOption {
return func(params *SwapParameters) {
params.disconnectThreshold = disconnect
params.paymentThreshold = payment
}
}
func DefaultOptions() []SwapOption {
return []SwapOption{
WithMode(SoftMode),
WithThreshold(100, -100),
}
}