offerproto

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryOfferProtocol = "/fcr-calibr/paynet/offer/query"
	ProtocolVersion    = "/0.0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OfferProtocol

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

OfferProtocol manages offer protocol. It handles payment offer creation.

func NewOfferProtocol

func NewOfferProtocol(
	h host.Host,
	addrProto *addrproto.AddrProtocol,
	signer crypto.Signer,
	peerMgr peermgr.PeerManager,
	offerMgr offermgr.OfferManager,
	pservMgr pservmgr.PaychServingManager,
	rs routestore.RouteStore,
	payMgr paymgr.PaymentManager,
	opts Opts,
) *OfferProtocol

NewOfferProtocol creates a new offer protocol.

@input - host, addr protocol, signer, peer manager, offer manager, payment serving manager,

route store, payment manager, options.

@output - offer protocol.

func (*OfferProtocol) QueryOffer

func (proto *OfferProtocol) QueryOffer(ctx context.Context, currencyID byte, route []string, amt *big.Int) (fcroffer.PayOffer, error)

QueryOffer queries for a payment offer for a given route.

@input - context, currency id, route, amt required.

@output - payment offer, error.

func (*OfferProtocol) Shutdown

func (p *OfferProtocol) Shutdown()

Shutdown safely shuts down the component.

type Opts

type Opts struct {
	// The timeout for every network io operation.
	IOTimeout time.Duration

	// The timeout for every internal operation.
	OpTimeout time.Duration

	// The offer expiry time.
	OfferExpiry time.Duration

	// The renew window.
	OfferInactivity time.Duration
}

Opts is the options for offer protocol.

Jump to

Keyboard shortcuts

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