swap

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SoftMode int = 0
	MockMode int = 1
	HardMode int = 2
)
View Source
const WakuSwapID_v200 = protocol.ID("/vac/waku/swap/2.0.0-beta1")

Variables

This section is empty.

Functions

This section is empty.

Types

type SwapOption

type SwapOption func(*SwapParameters)

func DefaultOptions

func DefaultOptions() []SwapOption

func WithMode

func WithMode(mode int) SwapOption

func WithThreshold

func WithThreshold(payment, disconnect int) SwapOption

type SwapParameters

type SwapParameters struct {
	// contains filtered or unexported fields
}

type WakuSwap

type WakuSwap struct {
	Accounting map[string]int
	// contains filtered or unexported fields
}

func NewWakuSwap

func NewWakuSwap(log *zap.Logger, opts ...SwapOption) *WakuSwap

func (*WakuSwap) Credit

func (s *WakuSwap) Credit(peerId string, n int)

func (*WakuSwap) Debit

func (s *WakuSwap) Debit(peerId string, n int)

func (*WakuSwap) IsStarted added in v0.4.0

func (s *WakuSwap) IsStarted() bool

func (*WakuSwap) Start added in v0.4.0

func (s *WakuSwap) Start(ctx context.Context) error

func (*WakuSwap) Stop added in v0.4.0

func (s *WakuSwap) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL