paths

package
v0.0.0-...-3597e88 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package paths provides utilities and facilities for payment paths as needed by horizon. Most importantly, it provides the Finder interface, allowing for pluggable path finding back ends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyFinder

type DummyFinder struct {
}

func (*DummyFinder) Find

func (f *DummyFinder) Find(q Query) ([]Path, error)

type DummyPath

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

func (DummyPath) Cost

func (d DummyPath) Cost(amount xdr.Int64) (xdr.Int64, error)

func (DummyPath) Destination

func (d DummyPath) Destination() xdr.Asset

func (DummyPath) Path

func (d DummyPath) Path() []xdr.Asset

func (DummyPath) Source

func (d DummyPath) Source() xdr.Asset

type Finder

type Finder interface {
	Find(Query) ([]Path, error)
}

Finder finds paths.

type Path

type Path interface {
	Path() []xdr.Asset
	Source() xdr.Asset
	Destination() xdr.Asset
	// Cost returns an amount (which may be estimated), delimited in the Source assets
	// that is suitable for use as the `sendMax` field for a `PathPaymentOp` struct.
	Cost(amount xdr.Int64) (xdr.Int64, error)
}

Path is the interface that represents a single result returned by a path finder.

type Query

type Query struct {
	DestinationAddress string
	DestinationAsset   xdr.Asset
	DestinationAmount  xdr.Int64
	SourceAssets       []xdr.Asset
}

Query is a query for paths

Jump to

Keyboard shortcuts

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