clients

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelStatus

type ChannelStatus struct {
	ID            uint64          `json:"id,omitempty"`
	Node          string          `json:"node"`
	ChannelPoint  string          `json:"channel_point"`
	Status        string          `json:"status"`
	Capacity      decimal.Decimal `json:"capacity"`
	LocalBalance  decimal.Decimal `json:"local_balance"`
	RemoteBalance decimal.Decimal `json:"remote_balance"`
	ClosingTxid   string          `json:"closing_txid,omitempty"`
	LocalReserved decimal.Decimal `json:"-"`
}

ChannelStatus descriptor

type ClosedChannel added in v0.2.0

type ClosedChannel struct {
	ID                uint64          `json:"id,omitempty"`
	Node              string          `json:"node"`
	ChannelPoint      string          `json:"channel_point"`
	Capacity          decimal.Decimal `json:"capacity"`
	SettledBalance    decimal.Decimal `json:"settled_balance"`
	TimeLockedBalance decimal.Decimal `json:"time_locked_balance"`
	ClosingTxid       string          `json:"closing_txid,omitempty"`
	CloseHeight       uint32          `json:"close_height"`
	CloseType         string          `json:"close_type"`
}

ClosedChannel struct

type Invoice

type Invoice struct {
	NodeID         string `json:"nodeId"`
	PaymentRequest string `json:"paymentRequest"`
	ChanPoint      string `json:"chanPoint"`
}

Invoice message

type Limits

type Limits struct {
	MinChannelCapacity       decimal.Decimal `json:"minChannelCapacity"`
	MinPaymentAmount         decimal.Decimal `json:"minPaymentAmount"`
	ChannelReserveMultiplier decimal.Decimal `json:"channelReserveMultiplier"`
}

Limits message

type LndClient

type LndClient interface {
	// Unlock local node wallet to bring it online
	Unlock(password string) error
	// Status of the local LND node
	Status() (*lnrpc.GetInfoResponse, error)
	// NodePubKey for local node
	NodePubKey() (string, error)
	// Peers the local node connected to
	Peers() ([]string, error)
	// Connect local node to remote LND node
	Connect(address string) error
	// Disconnect local node from remote LND node
	Disconnect(address string) error
	// Balance in BTC available on the local LND wallet
	Balance() (decimal.Decimal, error)
	// FundingAddress for the local LND wallet
	FundingAddress() (string, error)
	// OpenChannel to specified node and commit specified amount to it
	OpenChannel(address string, amount decimal.Decimal, out chan *OpenChannelResult) error
	// Channels list
	Channels() ([]*ChannelStatus, error)
	// ActiveChannels list
	ActiveChannels() ([]*ChannelStatus, error)
	// ClosedChannels list
	ClosedChannels(offset, limit int) ([]*ClosedChannel, error)
	// CloseChannel with specified channel point
	CloseChannel(chanID uint64, chanPoint string) (*ChannelStatus, error)
	// SendPayment by specified payment request on specified amount
	SendPayment(paymentReq string, amount decimal.Decimal, chanID uint64) error
	// Payments list
	Payments(offset, limit int) ([]Payment, error)
	// Wallet transactions list
	Transactions(offset, limit int) ([]Transaction, error)
	// Close gRPC connection
	Close() error
}

LndClient interface

func NewLndClient

func NewLndClient(c *cli.Context, unlocked bool) (LndClient, error)

NewLndClient constructor

type Node

type Node struct {
	ID      string `json:"id"`
	Address string `json:"address"`
}

type OpenChannelResult

type OpenChannelResult struct {
	ChannelStatus
	Error error
}

OpenChannelResult description

type Payment

type Payment struct {
	Node      string          `json:"node"`
	Timestamp time.Time       `json:"timestamp"`
	Amount    decimal.Decimal `json:"amount"`
}

Payment description

type RestClient

type RestClient interface {
	// RegisterNode registers local lnd node in association with Xena user
	RegisterNode(pubKey string) error
	// RemoteAddresses list Xena lnd nodes to connect to
	RemoteNodes() ([]*Node, error)
	// RemoteAddresses of Xena lnd nodes to connect to
	RemoteAddresses() ([]string, error)
	// IssueInvoices to pay via available channels
	IssueInvoices(accountID int64, chanPoints []string) ([]*Invoice, error)
	// Limits returns daccs limits
	Limits() (*Limits, error)
}

RestClient interface for Xena dAccs API

func NewRestClient

func NewRestClient(c *cli.Context) (RestClient, error)

NewRestClient constructor

type Transaction added in v0.2.0

type Transaction struct {
	TxID             string          `json:"txid"`
	Amount           decimal.Decimal `json:"amount"`
	NumConfirmations int32           `json:"num_confirmations"`
	BlockHeight      int32           `json:"block_height"`
	Timestamp        time.Time       `json:"timestamp"`
	TotalFees        decimal.Decimal `json:"total_fees"`
	DestAddresses    []string        `json:"dest_addresses"`
}

Transaction struct

Jump to

Keyboard shortcuts

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