Documentation ¶
Index ¶
- func AdrStringToOutscript(adr string) ([]byte, error)
- func CoinTypeFromAdr(adr string) uint32
- func CoinTypeFromBechAdr(adr string) (uint32, error)
- func RPCListen(rpcl *LitRPC, host string, port uint16)
- type AcceptContractArgs
- type AcceptContractReply
- type AddOracleArgs
- type AddOracleReply
- type AddressArgs
- type AddressReply
- type AssignNicknameArgs
- type BalanceReply
- type ChanArgs
- type ChannelGraphReply
- type ChannelInfo
- type ChannelListReply
- type CoinArgs
- type CoinBalReply
- type ConInfo
- type ConnectArgs
- type DeclineContractArgs
- type DeclineContractReply
- type DualFundAcceptArgs
- type DualFundArgs
- type DualFundDeclineArgs
- type DumpReply
- type FanArgs
- type FeeArgs
- type FeeReply
- type FundArgs
- type GetContractArgs
- type GetContractReply
- type ImportOracleArgs
- type ImportOracleReply
- type ListConnectionsReply
- type ListContractsArgs
- type ListContractsReply
- type ListOraclesArgs
- type ListOraclesReply
- type ListenArgs
- type ListeningPortsReply
- type LitRPC
- func (r *LitRPC) AcceptContract(args AcceptContractArgs, reply *AcceptContractReply) error
- func (r *LitRPC) AddOracle(args AddOracleArgs, reply *AddOracleReply) error
- func (r *LitRPC) Address(args *AddressArgs, reply *AddressReply) error
- func (r *LitRPC) AssignNickname(args AssignNicknameArgs, reply *StatusReply) error
- func (r *LitRPC) Balance(args *NoArgs, reply *BalanceReply) error
- func (r *LitRPC) BreakChannel(args ChanArgs, reply *StatusReply) error
- func (r *LitRPC) ChannelList(args ChanArgs, reply *ChannelListReply) error
- func (r *LitRPC) CloseChannel(args ChanArgs, reply *StatusReply) error
- func (r *LitRPC) Connect(args ConnectArgs, reply *StatusReply) error
- func (r *LitRPC) DeclineContract(args DeclineContractArgs, reply *DeclineContractReply) error
- func (r *LitRPC) DualFundAccept(args DualFundAcceptArgs, reply *StatusReply) error
- func (r *LitRPC) DualFundChannel(args DualFundArgs, reply *StatusReply) error
- func (r *LitRPC) DualFundDecline(args DualFundDeclineArgs, reply *StatusReply) error
- func (r *LitRPC) DumpPrivs(args NoArgs, reply *DumpReply) error
- func (r *LitRPC) Fanout(args FanArgs, reply *TxidsReply) error
- func (r *LitRPC) FundChannel(args FundArgs, reply *StatusReply) error
- func (r *LitRPC) GetChannelMap(args NoArgs, reply *ChannelGraphReply) error
- func (r *LitRPC) GetContract(args GetContractArgs, reply *GetContractReply) error
- func (r *LitRPC) GetFee(args *FeeArgs, reply *FeeReply) error
- func (r *LitRPC) GetListeningPorts(args NoArgs, reply *ListeningPortsReply) error
- func (r *LitRPC) GetMessages(args NoArgs, reply *StatusReply) error
- func (r *LitRPC) ImportOracle(args ImportOracleArgs, reply *ImportOracleReply) error
- func (r *LitRPC) ListConnections(args NoArgs, reply *ListConnectionsReply) error
- func (r *LitRPC) ListContracts(args ListContractsArgs, reply *ListContractsReply) error
- func (r *LitRPC) ListOracles(args ListOraclesArgs, reply *ListOraclesReply) error
- func (r *LitRPC) Listen(args ListenArgs, reply *ListeningPortsReply) error
- func (r *LitRPC) NewContract(args NewContractArgs, reply *NewContractReply) error
- func (r *LitRPC) OfferContract(args OfferContractArgs, reply *OfferContractReply) error
- func (r *LitRPC) PendingDualFund(args PendingDualFundRequestsArgs, reply *PendingDualFundReply) error
- func (r *LitRPC) Push(args PushArgs, reply *PushReply) error
- func (r *LitRPC) Say(args SayArgs, reply *StatusReply) error
- func (r *LitRPC) Send(args SendArgs, reply *TxidsReply) error
- func (r *LitRPC) SetContractCoinType(args SetContractCoinTypeArgs, reply *SetContractCoinTypeReply) error
- func (r *LitRPC) SetContractDatafeed(args SetContractDatafeedArgs, reply *SetContractDatafeedReply) error
- func (r *LitRPC) SetContractDivision(args SetContractDivisionArgs, reply *SetContractDivisionReply) error
- func (r *LitRPC) SetContractFunding(args SetContractFundingArgs, reply *SetContractFundingReply) error
- func (r *LitRPC) SetContractOracle(args SetContractOracleArgs, reply *SetContractOracleReply) error
- func (r *LitRPC) SetContractRPoint(args SetContractRPointArgs, reply *SetContractRPointReply) error
- func (r *LitRPC) SetContractSettlementTime(args SetContractSettlementTimeArgs, reply *SetContractSettlementTimeReply) error
- func (r *LitRPC) SetFee(args *SetFeeArgs, reply *FeeReply) error
- func (r *LitRPC) SettleContract(args SettleContractArgs, reply *SettleContractReply) error
- func (r *LitRPC) StateDump(args StateDumpArgs, reply *StateDumpReply) error
- func (r *LitRPC) Stop(args NoArgs, reply *StatusReply) error
- func (r *LitRPC) Sweep(args SweepArgs, reply *TxidsReply) error
- func (r *LitRPC) TxoList(args *NoArgs, reply *TxoListReply) error
- func (r *LitRPC) Watch(args WatchArgs, reply *WatchReply) error
- type NewContractArgs
- type NewContractReply
- type NoArgs
- type OfferContractArgs
- type OfferContractReply
- type PendingDualFundReply
- type PendingDualFundRequestsArgs
- type PrivInfo
- type PushArgs
- type PushReply
- type SayArgs
- type SendArgs
- type SetContractCoinTypeArgs
- type SetContractCoinTypeReply
- type SetContractDatafeedArgs
- type SetContractDatafeedReply
- type SetContractDivisionArgs
- type SetContractDivisionReply
- type SetContractFundingArgs
- type SetContractFundingReply
- type SetContractOracleArgs
- type SetContractOracleReply
- type SetContractRPointArgs
- type SetContractRPointReply
- type SetContractSettlementTimeArgs
- type SetContractSettlementTimeReply
- type SetFeeArgs
- type SettleContractArgs
- type SettleContractReply
- type StateDumpArgs
- type StateDumpReply
- type StatusReply
- type SweepArgs
- type TxidsReply
- type TxoInfo
- type TxoListReply
- type WatchArgs
- type WatchReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdrStringToOutscript ¶
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 ¶
Default to testnet for unknown / bad addrs.
func CoinTypeFromBechAdr ¶
Gives the cointype from an address string (if known)
Types ¶
type AcceptContractArgs ¶
type AcceptContractArgs struct {
CIdx uint64
}
type AcceptContractReply ¶
type AcceptContractReply struct {
Success bool
}
type AddOracleArgs ¶
type AddOracleReply ¶
type AddressArgs ¶
------------------------- address
type AddressReply ¶
type AssignNicknameArgs ¶
------------------------- name a connection
type BalanceReply ¶
type BalanceReply struct {
Balances []CoinBalReply
}
type ChannelGraphReply ¶
type ChannelGraphReply struct {
Graph string
}
------------ Dump channel map
type ChannelInfo ¶
type ChannelListReply ¶
type ChannelListReply struct {
Channels []ChannelInfo
}
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 DeclineContractArgs ¶
type DeclineContractArgs struct {
CIdx uint64
}
type DeclineContractReply ¶
type DeclineContractReply struct {
Success bool
}
type DualFundAcceptArgs ¶
type DualFundAcceptArgs struct { }
type DualFundArgs ¶
type DualFundArgs struct { Peer uint32 // who to make the channel with CoinType uint32 // what coin to use OurAmount int64 // what amount we will fund TheirAmount int64 // what amount we request them to fund }
------------------------- dual fund
type DualFundDeclineArgs ¶
type DualFundDeclineArgs struct { }
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" Data [32]byte }
------------------------- fund
type GetContractArgs ¶
type GetContractArgs struct {
Idx uint64
}
type GetContractReply ¶
type GetContractReply struct {
Contract *lnutil.DlcContract
}
type ImportOracleArgs ¶
type ImportOracleReply ¶
type ListConnectionsReply ¶
type ListContractsArgs ¶
type ListContractsArgs struct { }
type ListContractsReply ¶
type ListContractsReply struct {
Contracts []*lnutil.DlcContract
}
type ListOraclesArgs ¶
type ListOraclesArgs struct { }
type ListOraclesReply ¶
type ListenArgs ¶
type ListenArgs struct {
Port string
}
type ListeningPortsReply ¶
type LitRPC ¶
func (*LitRPC) AcceptContract ¶
func (r *LitRPC) AcceptContract(args AcceptContractArgs, reply *AcceptContractReply) error
AcceptContract accepts an offered contract and will initiate a signature-exchange for settlement and then for funding
func (*LitRPC) AddOracle ¶
func (r *LitRPC) AddOracle(args AddOracleArgs, reply *AddOracleReply) error
AddOracle manually adds an oracle from its PubKey A
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) 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) DeclineContract ¶
func (r *LitRPC) DeclineContract(args DeclineContractArgs, reply *DeclineContractReply) error
DeclineContract declines an offered contract
func (*LitRPC) DualFundAccept ¶
func (r *LitRPC) DualFundAccept(args DualFundAcceptArgs, reply *StatusReply) error
func (*LitRPC) DualFundChannel ¶
func (r *LitRPC) DualFundChannel(args DualFundArgs, reply *StatusReply) error
func (*LitRPC) DualFundDecline ¶
func (r *LitRPC) DualFundDecline(args DualFundDeclineArgs, reply *StatusReply) error
func (*LitRPC) FundChannel ¶
func (r *LitRPC) FundChannel(args FundArgs, reply *StatusReply) error
func (*LitRPC) GetChannelMap ¶
func (r *LitRPC) GetChannelMap(args NoArgs, reply *ChannelGraphReply) error
func (*LitRPC) GetContract ¶
func (r *LitRPC) GetContract(args GetContractArgs, reply *GetContractReply) error
GetContract returns a single contract based on its index
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) ImportOracle ¶
func (r *LitRPC) ImportOracle(args ImportOracleArgs, reply *ImportOracleReply) error
ImportOracle imports an oracle from a REST API
func (*LitRPC) ListConnections ¶
func (r *LitRPC) ListConnections(args NoArgs, reply *ListConnectionsReply) error
func (*LitRPC) ListContracts ¶
func (r *LitRPC) ListContracts(args ListContractsArgs, reply *ListContractsReply) error
ListContracts returns all contracts know to LIT
func (*LitRPC) ListOracles ¶
func (r *LitRPC) ListOracles(args ListOraclesArgs, reply *ListOraclesReply) error
ListOracles returns all oracles know to LIT
func (*LitRPC) Listen ¶
func (r *LitRPC) Listen(args ListenArgs, reply *ListeningPortsReply) error
func (*LitRPC) NewContract ¶
func (r *LitRPC) NewContract(args NewContractArgs, reply *NewContractReply) error
NewContract creates a new draft contract
func (*LitRPC) OfferContract ¶
func (r *LitRPC) OfferContract(args OfferContractArgs, reply *OfferContractReply) error
OfferContract offers a contract to a (connected) peer
func (*LitRPC) PendingDualFund ¶
func (r *LitRPC) PendingDualFund(args PendingDualFundRequestsArgs, reply *PendingDualFundReply) error
func (*LitRPC) SetContractCoinType ¶
func (r *LitRPC) SetContractCoinType(args SetContractCoinTypeArgs, reply *SetContractCoinTypeReply) error
SetContractCoinType sets the coin type the contract will be in. Note that a peer that doesn't have a wallet of that type will automatically decline the contract.
func (*LitRPC) SetContractDatafeed ¶
func (r *LitRPC) SetContractDatafeed(args SetContractDatafeedArgs, reply *SetContractDatafeedReply) error
SetContractDatafeed sets a data feed by index to a contract, which is then used to fetch the R-point from the oracle's REST API
func (*LitRPC) SetContractDivision ¶
func (r *LitRPC) SetContractDivision(args SetContractDivisionArgs, reply *SetContractDivisionReply) error
SetContractDivision sets how the contract is settled. The parameters indicate at what value the full contract funds are ours, and at what value they are full funds are for our peer. Between those values, the contract will divide the contract funds linearly
func (*LitRPC) SetContractFunding ¶
func (r *LitRPC) SetContractFunding(args SetContractFundingArgs, reply *SetContractFundingReply) error
SetContractFunding sets the division in funding the channel. The arguments decide how much we're funding and how much we expect the peer we offer the contract to to fund
func (*LitRPC) SetContractOracle ¶
func (r *LitRPC) SetContractOracle(args SetContractOracleArgs, reply *SetContractOracleReply) error
SetContractOracle assigns a known oracle to a (new) contract
func (*LitRPC) SetContractRPoint ¶
func (r *LitRPC) SetContractRPoint(args SetContractRPointArgs, reply *SetContractRPointReply) error
SetContractRPoint manually sets the R-point for the contract using a pubkey
func (*LitRPC) SetContractSettlementTime ¶
func (r *LitRPC) SetContractSettlementTime(args SetContractSettlementTimeArgs, reply *SetContractSettlementTimeReply) error
SetContractSettlementTime sets the time this contract will settle (the unix epoch)
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) SettleContract ¶
func (r *LitRPC) SettleContract(args SettleContractArgs, reply *SettleContractReply) error
SettleContract uses the value and signature from the oracle to settle the contract and send the equivalent settlement transaction to the blockchain. It will subsequently claim the contract output back to our wallet
func (*LitRPC) StateDump ¶
func (r *LitRPC) StateDump(args StateDumpArgs, reply *StateDumpReply) error
StateDump dumps all of the meta data for the state commitments of a channel
type NewContractArgs ¶
type NewContractArgs struct { }
type NewContractReply ¶
type NewContractReply struct {
Contract *lnutil.DlcContract
}
type OfferContractArgs ¶
type OfferContractReply ¶
type OfferContractReply struct {
Success bool
}
type PendingDualFundReply ¶
type PendingDualFundRequestsArgs ¶
type PendingDualFundRequestsArgs struct { }
type PrivInfo ¶
type PrivInfo struct { OutPoint string Amt int64 Height int32 Delay int32 CoinType string Witty bool PairKey string WIF string }
------------------------- dumpPriv
type SetContractCoinTypeArgs ¶
type SetContractCoinTypeReply ¶
type SetContractCoinTypeReply struct {
Success bool
}
type SetContractDatafeedArgs ¶
type SetContractDatafeedReply ¶
type SetContractDatafeedReply struct {
Success bool
}
type SetContractDivisionArgs ¶
type SetContractDivisionReply ¶
type SetContractDivisionReply struct {
Success bool
}
type SetContractFundingArgs ¶
type SetContractFundingReply ¶
type SetContractFundingReply struct {
Success bool
}
type SetContractOracleArgs ¶
type SetContractOracleReply ¶
type SetContractOracleReply struct {
Success bool
}
type SetContractRPointArgs ¶
type SetContractRPointReply ¶
type SetContractRPointReply struct {
Success bool
}
type SetContractSettlementTimeReply ¶
type SetContractSettlementTimeReply struct {
Success bool
}
type SettleContractArgs ¶
type SettleContractReply ¶
type StateDumpReply ¶
type StatusReply ¶
type StatusReply struct {
Status string
}
type TxidsReply ¶
type TxidsReply struct {
Txids []string
}
type TxoListReply ¶
type TxoListReply struct {
Txos []TxoInfo
}
type WatchReply ¶
type WatchReply struct {
Msg string
}