chain

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressBatchSize = 16 // maximum address count for RPC requests
)

Variables

View Source
var (
	ErrChainClientNotFound = errors.New("ChainClient Not Found")
)

Functions

func GetAddressInfo

func GetAddressInfo(ctx context.Context, chain, address string) (common.AddressInfo, error)

func GetNewAddress

func GetNewAddress(ctx context.Context, chain, account string) (string, error)

func GetTransaction

func GetTransaction(ctx context.Context, chain string, txID string) (common.TransactionInfo, error)

func ImportAddress added in v0.0.5

func ImportAddress(ctx context.Context, chain, account, address, pubkey, blindingkey string) error

func ListLockUnspent

func ListLockUnspent(ctx context.Context, chain string) ([]common.TransactionInfo, error)

func LockUnspent

func LockUnspent(ctx context.Context, chain string, unlock bool, utxos ...common.TransactionInfo) error

func SpendFunds added in v0.0.5

func SpendFunds(ctx context.Context, chain string, changeAddress string, spendInfos []common.SpendInfo) (common.SpendTx, error)

Types

type AddressInfo

type AddressInfo struct {
	Chain         string
	PublicAddress string
	Mined         uint64 // 0 unknown, 1 mempool, BlockHeight
	Transactions  []TransactionInfo
}

func FetchChainAddressesInfo

func FetchChainAddressesInfo(ctx context.Context, state ChainState, minConf, maxConf uint64, publicAddresses ...string) ([]AddressInfo, error)

type ChainState

type ChainState struct {
	Chain  string
	Height uint64
}

func FetchChainsState

func FetchChainsState(ctx context.Context, chains ...string) ([]ChainState, error)

type TransactionInfo

type TransactionInfo struct {
	TxID          string
	Vout          int64
	Asset         string
	Amount        float64
	Confirmations int64
}

Jump to

Keyboard shortcuts

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