paths

package
v0.0.0-...-c9303cd Latest Latest
Warning

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

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

Documentation

Overview

Package paths provides utilities and facilities for payment paths as needed by aurora. 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 Finder

type Finder interface {
	// Returns path for a Query of a maximum length `maxLength`
	Find(q Query, maxLength uint) ([]Path, error)
	// FindFixedPaths return a list of payment paths each of which
	// start by spending `amountToSpend` of `sourceAsset` and end
	// with delivering a postive amount of `destinationAsset`
	FindFixedPaths(
		sourceAccount *xdr.AccountId,
		sourceAsset xdr.Asset,
		amountToSpend xdr.Int64,
		destinationAsset xdr.Asset,
		maxLength uint,
	) ([]Path, error)
}

Finder finds paths.

type Path

type Path struct {
	Path              []xdr.Asset
	Source            xdr.Asset
	SourceAmount      xdr.Int64
	Destination       xdr.Asset
	DestinationAmount xdr.Int64
}

Path is the result returned by a path finder and is tied to the DestinationAmount used in the input query

type Query

type Query struct {
	DestinationAsset    xdr.Asset
	DestinationAmount   xdr.Int64
	SourceAssets        []xdr.Asset
	SourceAssetBalances []xdr.Int64
	SourceAccount       xdr.AccountId
}

Query is a query for paths

Jump to

Keyboard shortcuts

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