common

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainClientKey = "Key.ChainClientKey"
)
View Source
const (
	CryptoAddressNextDepositSubject = chanPrefix + "CryptoAddress.NextDeposit"
)

Variables

This section is empty.

Functions

func ChainClientContext

func ChainClientContext(ctx context.Context, chain string, client ChainClient) context.Context

Types

type AddressInfo

type AddressInfo struct {
	Chain          string
	PublicAddress  string
	Unconfidential string
}

type ChainClient

type ChainClient interface {
	GetNewAddress(ctx context.Context, account string) (string, error)
	GetAddressInfo(ctx context.Context, address string) (AddressInfo, error)
	GetBlockCount(ctx context.Context) (int64, error)
	ListUnspent(ctx context.Context, minConf, maxConf int, addresses ...string) ([]TransactionInfo, error)
	LockUnspent(ctx context.Context, unlock bool, transactions ...TransactionInfo) error
	ListLockUnspent(ctx context.Context) ([]TransactionInfo, error)
	GetTransaction(ctx context.Context, txID string) (TransactionInfo, error)
}

func ChainClientFromContext

func ChainClientFromContext(ctx context.Context, chain string) ChainClient

type CryptoAddress

type CryptoAddress struct {
	Chain          string
	AccountID      uint64
	PublicAddress  string
	Unconfidential string
}

func (*CryptoAddress) Decode

func (p *CryptoAddress) Decode(data []byte) error

func (*CryptoAddress) Encode

func (p *CryptoAddress) Encode() ([]byte, error)

type TransactionInfo

type TransactionInfo struct {
	Chain         string
	Account       string
	Address       string
	Asset         string
	TxID          string
	Vout          int64
	Amount        float64
	Confirmations int64
	Spendable     bool
}

Jump to

Keyboard shortcuts

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