litrpc

package
v0.0.0-...-793c700 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdrStringToOutscript

func AdrStringToOutscript(adr string) ([]byte, error)

AdrStringToOutscript converts an address string into an output script byte slice note that this ignores the prefix! Be careful not to mix networks. currently only works for testnet legacy addresses

func CoinTypeFromAdr

func CoinTypeFromAdr(adr string) uint32

Default to testnet for unknown / bad addrs.

func CoinTypeFromBechAdr

func CoinTypeFromBechAdr(adr string) (uint32, error)

Gives the cointype from an address string (if known)

func RPCListen

func RPCListen(rpcl *LitRPC, port uint16)

Types

type AddressArgs

type AddressArgs struct {
	NumToMake uint32
	CoinType  uint32
}

------------------------- address

type AddressReply

type AddressReply struct {
	WitAddresses    []string
	LegacyAddresses []string
}

type AssignNicknameArgs

type AssignNicknameArgs struct {
	Peer     uint32
	Nickname string
}

------------------------- name a connection

type BalanceReply

type BalanceReply struct {
	Balances []CoinBalReply
}

type ChanArgs

type ChanArgs struct {
	ChanIdx uint32
}

------------------------- cclose

type ChannelInfo

type ChannelInfo struct {
	OutPoint      string
	CoinType      uint32
	Closed        bool
	Capacity      int64
	MyBalance     int64
	Height        int32  // block height of channel fund confirmation
	StateNum      uint64 // Most recent commit number
	PeerIdx, CIdx uint32
	PeerID        string
}

type ChannelListReply

type ChannelListReply struct {
	Channels []ChannelInfo
}

type CoinArgs

type CoinArgs struct {
	CoinType uint32
}

type CoinBalReply

type CoinBalReply struct {
	CoinType    uint32
	SyncHeight  int32 // height this wallet is synced to
	ChanTotal   int64 // total balance in channels
	TxoTotal    int64 // all utxos
	MatureWitty int64 // confirmed, spendable and witness
	FeeRate     int64 // fee per byte
}

------------------------- balance BalReply is the reply when the user asks about their balance.

type ConInfo

type ConInfo struct {
	PeerNumber uint32
	RemoteHost string
}

type ConnectArgs

type ConnectArgs struct {
	LNAddr string
}

------------------------- connect

type DumpReply

type DumpReply struct {
	Privs []PrivInfo
}

type FanArgs

type FanArgs struct {
	DestAdr      string
	NumOutputs   uint32
	AmtPerOutput int64
}

------------------------- fanout

type FeeArgs

type FeeArgs struct {
	CoinType uint32
}

get fee

type FeeReply

type FeeReply struct {
	CurrentFee int64
}

type FundArgs

type FundArgs struct {
	Peer        uint32 // who to make the channel with
	CoinType    uint32 // what coin to use
	Capacity    int64  // later can be minimum capacity
	Roundup     int64  // ignore for now; can be used to round-up capacity
	InitialSend int64  // Initial send of -1 means "ALL"
}

------------------------- fund

type ListConnectionsReply

type ListConnectionsReply struct {
	Connections []qln.PeerInfo
	MyPKH       string
}

type ListenArgs

type ListenArgs struct {
	Port string
}

type ListeningPortsReply

type ListeningPortsReply struct {
	LisIpPorts []string
	Adr        string
}

type LitRPC

type LitRPC struct {
	Node      *qln.LitNode
	OffButton chan bool
}

func (*LitRPC) Address

func (r *LitRPC) Address(args *AddressArgs, reply *AddressReply) error

func (*LitRPC) AssignNickname

func (r *LitRPC) AssignNickname(args AssignNicknameArgs, reply *StatusReply) error

func (*LitRPC) Balance

func (r *LitRPC) Balance(args *NoArgs, reply *BalanceReply) error

func (*LitRPC) BreakChannel

func (r *LitRPC) BreakChannel(args ChanArgs, reply *StatusReply) error

------------------------- break

func (*LitRPC) ChannelList

func (r *LitRPC) ChannelList(args ChanArgs, reply *ChannelListReply) error

ChannelList sends back a list of every (open?) channel with some info for each.

func (*LitRPC) CloseChannel

func (r *LitRPC) CloseChannel(args ChanArgs, reply *StatusReply) error

reply with status string CloseChannel is a cooperative closing of a channel to a specified address.

func (*LitRPC) Connect

func (r *LitRPC) Connect(args ConnectArgs, reply *StatusReply) error

func (*LitRPC) DumpPrivs

func (r *LitRPC) DumpPrivs(args NoArgs, reply *DumpReply) error

DumpPrivs returns WIF private keys for every utxo and channel

func (*LitRPC) Fanout

func (r *LitRPC) Fanout(args FanArgs, reply *TxidsReply) error

func (*LitRPC) FundChannel

func (r *LitRPC) FundChannel(args FundArgs, reply *StatusReply) error

func (*LitRPC) GetFee

func (r *LitRPC) GetFee(args *FeeArgs, reply *FeeReply) error

Fee gets the fee rate for a wallet.

func (*LitRPC) GetListeningPorts

func (r *LitRPC) GetListeningPorts(args NoArgs, reply *ListeningPortsReply) error

func (*LitRPC) GetMessages

func (r *LitRPC) GetMessages(args NoArgs, reply *StatusReply) error

------- receive chat

func (*LitRPC) ListConnections

func (r *LitRPC) ListConnections(args NoArgs, reply *ListConnectionsReply) error

func (*LitRPC) Listen

func (r *LitRPC) Listen(args ListenArgs, reply *ListeningPortsReply) error

func (*LitRPC) Push

func (r *LitRPC) Push(args PushArgs, reply *PushReply) error

func (*LitRPC) Say

func (r *LitRPC) Say(args SayArgs, reply *StatusReply) error

func (*LitRPC) Send

func (r *LitRPC) Send(args SendArgs, reply *TxidsReply) error

func (*LitRPC) SetFee

func (r *LitRPC) SetFee(args *SetFeeArgs, reply *FeeReply) error

SetFee allows you to set a fee rate for a wallet.

func (*LitRPC) Stop

func (r *LitRPC) Stop(args NoArgs, reply *StatusReply) error

func (*LitRPC) Sweep

func (r *LitRPC) Sweep(args SweepArgs, reply *TxidsReply) error

func (*LitRPC) TxoList

func (r *LitRPC) TxoList(args *NoArgs, reply *TxoListReply) error

TxoList sends back a list of all non-channel utxos

type NoArgs

type NoArgs struct {
}

type PrivInfo

type PrivInfo struct {
	OutPoint string
	Amt      int64
	Height   int32
	Delay    int32
	CoinType string
	Witty    bool
	PairKey  string

	WIF string
}

------------------------- dumpPriv

type PushArgs

type PushArgs struct {
	ChanIdx uint32
	Amt     int64
}

------------------------- push

type PushReply

type PushReply struct {
	StateIndex uint64
}

type SayArgs

type SayArgs struct {
	Peer    uint32
	Message string
}

type SendArgs

type SendArgs struct {
	DestAddrs []string
	Amts      []int64
}

------------------------- send

type SetFeeArgs

type SetFeeArgs struct {
	Fee      int64
	CoinType uint32
}

set fee

type StatusReply

type StatusReply struct {
	Status string
}

type SweepArgs

type SweepArgs struct {
	DestAdr string
	NumTx   uint32
	Drop    bool
}

------------------------- sweep

type TxidsReply

type TxidsReply struct {
	Txids []string
}

type TxoInfo

type TxoInfo struct {
	OutPoint string
	Amt      int64
	Height   int32
	Delay    int32
	CoinType string
	Witty    bool

	KeyPath string
}

type TxoListReply

type TxoListReply struct {
	Txos []TxoInfo
}

Jump to

Keyboard shortcuts

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