abstract

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrategySmallestFirst = "smallest-first"
	StrategyBiggestFirst  = "biggest-first"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	*UTXOClient
}

func NewAPIClient

func NewAPIClient(hostAndPort string, strategy string, useHTTPS bool, sigFunc SignatureFunc) (c *APIClient, err error)

type SignatureFunc

type SignatureFunc func(address string) (pubKey, signature string, err error)

type UTXOClient

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

func NewAbstractUTXOClient

func NewAbstractUTXOClient(hostAndPort string, baseURL string, strategy string, sigFunc SignatureFunc) (c *UTXOClient, err error)

func (*UTXOClient) GetForAmount

func (c *UTXOClient) GetForAmount(amount int64, shardID uint32, addresses ...string) (utxos *txmodels.UTXO, err error)

GetForAmount returns at most one UTXO for required `amount`, `shardID` and list of addresses. The list of UTXOs returned is sorted from the smallest one to the biggest one.

func (*UTXOClient) NonSpentUTXOsCnt

func (c *UTXOClient) NonSpentUTXOsCnt(address string) (count uint64, err error)

func (*UTXOClient) SelectForAmount

func (c *UTXOClient) SelectForAmount(amount int64, shardID uint32, addresses ...string) (utxos txmodels.UTXORows, err error)

SelectForAmount returns all found UTXOs for required `amount`, `shardID` and list of addresses.

func (*UTXOClient) SelectForAmountWithoutLock

func (c *UTXOClient) SelectForAmountWithoutLock(amount int64, shardID uint32, addresses ...string) (utxos txmodels.UTXORows, err error)

SelectForAmount returns all found UTXOs for required `amount`, `shardID` and list of addresses.

Jump to

Keyboard shortcuts

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