settlement

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPeerNoSettlements = errors.New("no settlements for peer")
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Pay initiates a payment to the given peer
	// It should return without error it is likely that the payment worked
	Pay(ctx context.Context, peer boson.Address, paymentThreshold *big.Int) error

	TransferTraffic(peer boson.Address) (traffic *big.Int, err error)

	RetrieveTraffic(peer boson.Address) (traffic *big.Int, err error)

	PutRetrieveTraffic(peer boson.Address, traffic *big.Int) error

	PutTransferTraffic(peer boson.Address, traffic *big.Int) error

	// AvailableBalance Get actual available balance
	AvailableBalance() (*big.Int, error)

	// SetNotifyPaymentFunc sets the NotifyPaymentFunc to notify
	SetNotifyPaymentFunc(notifyPaymentFunc NotifyPaymentFunc)

	GetPeerBalance(peer boson.Address) (*big.Int, error)

	GetUnPaidBalance(peer boson.Address) (*big.Int, error)
}

Interface is the interface used by Accounting to trigger settlement

type NotifyPaymentFunc

type NotifyPaymentFunc func(peer boson.Address, amount *big.Int) error

NotifyPaymentFunc is called when a payment from peer was successfully received

Directories

Path Synopsis
pb
trafficprotocol/pb
Package pb holds only Protocol Buffer definitions and generated code.
Package pb holds only Protocol Buffer definitions and generated code.

Jump to

Keyboard shortcuts

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