mirror of https://github.com/status-im/go-waku.git
30 lines
557 B
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),
|
||
|
}
|
||
|
}
|