Versions in this module Expand all Collapse all v0 v0.4.1 Jul 25, 2024 v0.4.0 Jul 23, 2024 Changes in this version + const MaxMessageType + const MaxNumOutputs + const MsgTypeAccept + const MsgTypeReject + const MsgTypeRequest + const TapMessageTypeBaseOffset + const TypeRejectErrCode + const TypeRejectErrMsg + const TypeRejectID + const TypeRejectVersion + var ErrListInvalid = errors.New("encoded list is invalid") + var ErrNoSuitableBuyOffer = RejectErr + var ErrNoSuitableSellOffer = RejectErr + var ErrPriceOracleUnavailable = RejectErr + var ErrUnknownMessageType = errors.New("unknown message type") + var ErrUnknownReject = RejectErr + func AssetIdDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error + func AssetIdEncoder(w io.Writer, val any, buf *[8]byte) error + func IdDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error + func IdEncoder(w io.Writer, val any, buf *[8]byte) error + func SomeRfqIDRecord(id ID) tlv.OptionalRecordT[HtlcRfqIDType, ID] + func Sum(balances []*AssetBalance) uint64 + func TypeRecordRejectErrCode(errCode *uint8) tlv.Record + func TypeRecordRejectErrMsg(errMsg *string) tlv.Record + func TypeRecordRejectID(id *ID) tlv.Record + func TypeRecordRejectVersion(version *WireMsgDataVersion) tlv.Record + func WireMsgDataVersionDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error + func WireMsgDataVersionEncoder(w io.Writer, val any, buf *[8]byte) error + type AssetBalance struct + Amount tlv.RecordT[tlv.TlvType1, uint64] + AssetID tlv.RecordT[tlv.TlvType0, asset.ID] + func DecodeAssetBalance(blob tlv.Blob) (*AssetBalance, error) + func NewAssetBalance(assetID asset.ID, amount uint64) *AssetBalance + func (a *AssetBalance) Bytes() []byte + func (a *AssetBalance) Decode(r io.Reader) error + func (a *AssetBalance) Encode(w io.Writer) error + type AssetBalanceListRecord struct + Balances []*AssetBalance + func (l *AssetBalanceListRecord) Decode(r io.Reader) error + func (l *AssetBalanceListRecord) Encode(w io.Writer) error + func (l *AssetBalanceListRecord) Record() tlv.Record + func (l *AssetBalanceListRecord) Sum() uint64 + type BuyAccept struct + AskPrice lnwire.MilliSatoshi + Expiry uint64 + ID ID + Peer route.Vertex + Request BuyRequest + Version WireMsgDataVersion + func NewBuyAcceptFromRequest(request BuyRequest, askPrice lnwire.MilliSatoshi, expiry uint64) *BuyAccept + func (q *BuyAccept) MsgID() ID + func (q *BuyAccept) MsgPeer() route.Vertex + func (q *BuyAccept) ShortChannelId() SerialisedScid + func (q *BuyAccept) String() string + func (q *BuyAccept) ToWire() (WireMessage, error) + type BuyRequest struct + AssetAmount uint64 + AssetGroupKey *btcec.PublicKey + AssetID *asset.ID + BidPrice lnwire.MilliSatoshi + ID ID + Peer route.Vertex + Version WireMsgDataVersion + func NewBuyRequest(peer route.Vertex, assetID *asset.ID, assetGroupKey *btcec.PublicKey, ...) (*BuyRequest, error) + func NewBuyRequestMsgFromWire(wireMsg WireMessage, msgData requestWireMsgData) (*BuyRequest, error) + func (q *BuyRequest) String() string + func (q *BuyRequest) ToWire() (WireMessage, error) + func (q *BuyRequest) Validate() error + type Htlc struct + Amounts tlv.RecordT[HtlcAmountRecordType, AssetBalanceListRecord] + RfqID tlv.OptionalRecordT[HtlcRfqIDType, ID] + func DecodeHtlc(blob tlv.Blob) (*Htlc, error) + func HtlcFromCustomRecords(records lnwire.CustomRecords) (*Htlc, error) + func NewHtlc(amounts []*AssetBalance, rfqID fn.Option[ID]) *Htlc + func (h *Htlc) Balances() []*AssetBalance + func (h *Htlc) Bytes() []byte + func (h *Htlc) Decode(r io.Reader) error + func (h *Htlc) Encode(w io.Writer) error + func (h *Htlc) Records() []tlv.Record + type HtlcAmountRecordType = tlv.TlvType65536 + type HtlcRfqIDType = tlv.TlvType65538 + type ID [32]byte + func (id *ID) Record() tlv.Record + func (id ID) Scid() SerialisedScid + func (id ID) String() string + type IncomingMsg interface + String func() string + func NewIncomingAcceptFromWire(wireMsg WireMessage) (IncomingMsg, error) + func NewIncomingMsgFromWire(wireMsg WireMessage) (IncomingMsg, error) + func NewIncomingRequestFromWire(wireMsg WireMessage) (IncomingMsg, error) + type JsonAssetBalance struct + AssetID string + LocalBalance uint64 + Name string + RemoteBalance uint64 + type JsonAssetChanInfo struct + AssetInfo JsonAssetUtxo + Capacity uint64 + LocalBalance uint64 + RemoteBalance uint64 + type JsonAssetChannel struct + Assets []JsonAssetChanInfo + type JsonAssetChannelBalances struct + OpenChannels map[string]*JsonAssetBalance + PendingChannels map[string]*JsonAssetBalance + type JsonAssetGenesis struct + AssetID string + GenesisPoint string + MetaHash string + Name string + type JsonAssetUtxo struct + Amount uint64 + AssetGenesis JsonAssetGenesis + ScriptKey string + Version int64 + type JsonCloseOutput struct + AssetInternalKey string + BtcInternalKey string + ScriptKeys map[string]string + type OutgoingMsg interface + String func() string + ToWire func() (WireMessage, error) + type QuoteResponse interface + MsgID func() ID + MsgPeer func() route.Vertex + String func() string + type Reject struct + Peer route.Vertex + func NewQuoteRejectFromWireMsg(wireMsg WireMessage) (*Reject, error) + func NewReject(peer route.Vertex, requestId ID, rejectErr RejectErr) *Reject + func (q *Reject) Bytes() ([]byte, error) + func (q *Reject) Decode(r io.Reader) error + func (q *Reject) Encode(writer io.Writer) error + func (q *Reject) String() string + func (q *Reject) ToWire() (WireMessage, error) + type RejectErr struct + Code uint8 + Msg string + type SellAccept struct + BidPrice lnwire.MilliSatoshi + Expiry uint64 + ID ID + Peer route.Vertex + Request SellRequest + Version WireMsgDataVersion + func NewSellAcceptFromRequest(request SellRequest, bidPrice lnwire.MilliSatoshi, expiry uint64) *SellAccept + func (q *SellAccept) MsgID() ID + func (q *SellAccept) MsgPeer() route.Vertex + func (q *SellAccept) ShortChannelId() SerialisedScid + func (q *SellAccept) String() string + func (q *SellAccept) ToWire() (WireMessage, error) + type SellRequest struct + AskPrice lnwire.MilliSatoshi + AssetAmount uint64 + AssetGroupKey *btcec.PublicKey + AssetID *asset.ID + ID ID + Peer route.Vertex + Version WireMsgDataVersion + func NewSellRequest(peer route.Vertex, assetID *asset.ID, assetGroupKey *btcec.PublicKey, ...) (*SellRequest, error) + func NewSellRequestMsgFromWire(wireMsg WireMessage, msgData requestWireMsgData) (*SellRequest, error) + func (q *SellRequest) String() string + func (q *SellRequest) ToWire() (WireMessage, error) + func (q *SellRequest) Validate() error + type SerialisedScid uint64 + type WireMessage struct + Data []byte + MsgType lnwire.MessageType + Peer route.Vertex + type WireMsgDataVersion uint8 + const V0 + func (v *WireMsgDataVersion) Record() tlv.Record v0.4.0-rc4 Jul 12, 2024 v0.4.0-rc1 Jun 27, 2024 v0.4.0-alpha.rc3 Jul 10, 2024 v0.4.0-alpha.rc2 Jul 3, 2024 v0.4.0-alpha.rc1 Jun 27, 2024