bitcoin

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressTypeBech32 = "bech32"
)

Variables

View Source
var (
	ErrInternalError    = errors.New("Internal Error")
	ErrRPCError         = errors.New("RPC Error")
	ErrInvalidAccount   = errors.New("Invalid Account")
	ErrInvalidAddress   = errors.New("Invalid Address format")
	ErrInvalidPubKey    = errors.New("Invalid PubKey")
	ErrLockUnspentFails = errors.New("LockUnpent Failed")
)

Functions

func OptionArgs

func OptionArgs(args *BitcoinOptions)

Types

type BitcoinClient

type BitcoinClient struct {
	sync.Mutex // mutex to change params while RPC
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, options BitcoinOptions) *BitcoinClient

func (*BitcoinClient) GetAddressInfo

func (p *BitcoinClient) GetAddressInfo(ctx context.Context, address string) (common.AddressInfo, error)

func (*BitcoinClient) GetBlockCount

func (p *BitcoinClient) GetBlockCount(ctx context.Context) (int64, error)

func (*BitcoinClient) GetNewAddress

func (p *BitcoinClient) GetNewAddress(ctx context.Context, account string) (string, error)

func (*BitcoinClient) GetTransaction

func (p *BitcoinClient) GetTransaction(ctx context.Context, txID string) (common.TransactionInfo, error)

func (*BitcoinClient) ImportAddress added in v0.0.5

func (p *BitcoinClient) ImportAddress(ctx context.Context, account, address, pubkey, blindingkey string) error

func (*BitcoinClient) ListLockUnspent

func (p *BitcoinClient) ListLockUnspent(ctx context.Context) ([]common.TransactionInfo, error)

func (*BitcoinClient) ListUnspent

func (p *BitcoinClient) ListUnspent(ctx context.Context, minConf, maxConf int, addresses ...string) ([]common.TransactionInfo, error)

func (*BitcoinClient) ListUnspentByAsset added in v0.0.5

func (p *BitcoinClient) ListUnspentByAsset(ctx context.Context, minConf, maxConf int, asset string) ([]common.TransactionInfo, error)

func (*BitcoinClient) LockUnspent

func (p *BitcoinClient) LockUnspent(ctx context.Context, unlock bool, transactions ...common.TransactionInfo) error

func (*BitcoinClient) SpendFunds added in v0.0.5

func (p *BitcoinClient) SpendFunds(ctx context.Context, changeAddress string, inputs []common.UTXOInfo, outputs []common.SpendInfo, addressInfo common.GetAddressInfo, blindTransaction bool) (common.SpendTx, error)

type BitcoinOptions

type BitcoinOptions struct {
	bank.ServerOptions

	User string
	Pass string
}

Directories

Path Synopsis
cmd
cli

Jump to

Keyboard shortcuts

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