protocol

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// currency
	MsgTypeError uint8 = 0 // An error occurred

	// Channel routing sends data updates
	MsgTypePayRouteRequestServiceNodes      uint8 = 255 // Request node list
	MsgTypePayRouteResponseServiceNodes     uint8 = 254 // Response node list
	MsgTypePayRouteRequestNodeRelationship  uint8 = 253 // Request node connection relationship
	MsgTypePayRouteResponseNodeRelationship uint8 = 252 // Response node connection
	MsgTypePayRouteRequestUpdates           uint8 = 251 // Request update
	MsgTypePayRouteResponseUpdates          uint8 = 250 // Response update
	MsgTypePayRouteEndClose                 uint8 = 249 // Complete shutdown

	// Server send
	MsgTypeDisplacementOffline     uint8 = 1 // Remote login is offline
	MsgTypeLoginCheckLastestBill   uint8 = 2 // The server sends the latest statement
	MsgTypeResponsePrequeryPayment uint8 = 3 // Pre query payment information

	// Client send
	MsgTypeLogin                  uint8 = 4 // Customer login message
	MsgTypeLogout                 uint8 = 5 // Active client offline
	MsgTypeRequestPrequeryPayment uint8 = 6 // Pre query payment information
	MsgTypeInitiatePayment        uint8 = 7 // Initiate payment
	MsgTypeRelayInitiatePayment   uint8 = 8 // Relay node payment message

	// Payment related
	MsgTypeBroadcastChannelStatementProveBody uint8 = 9  // Broadcast statement
	MsgTypeBroadcastChannelStatementSignature uint8 = 10 // Broadcast channel payment signature
	MsgTypeBroadcastChannelStatementError     uint8 = 11 // Broadcast channel payment error
	MsgTypeBroadcastChannelStatementSuccessed uint8 = 12 // Broadcast channel payment completed successfully

	// Reconciliation related
	MsgTypeClientInitiateReconciliation  uint8 = 13 // Client initiated reconciliation
	MsgTypeServicerRespondReconciliation uint8 = 14 // Server response reconciliation

	// Client heartbeat package
	MsgTypeHeartbeat uint8 = 15
)
View Source
const (
	LatestProtocolVersion uint16 = 1 // Latest protocol version number
)

Variables

This section is empty.

Functions

func CheckParamBool

func CheckParamBool(r *http.Request, key string, defValue bool) bool

func CheckParamHex

func CheckParamHex(r *http.Request, key string, defv []byte) []byte

func CheckParamHexMustLen

func CheckParamHexMustLen(r *http.Request, key string, mustLen int) []byte

func CheckParamString

func CheckParamString(r *http.Request, key string, defValue string) string

func CheckParamUint64

func CheckParamUint64(r *http.Request, key string, defValue uint64) uint64

func CheckParamUint64Must

func CheckParamUint64Must(r *http.Request, w http.ResponseWriter, key string) (uint64, bool)

func IsHDNSaddress

func IsHDNSaddress(addrstr string) (string, bool)

Determine whether it is the hdns diamond domain name service address

func OpenConnect

func OpenConnect(wsurl string) (*websocket.Conn, error)

connect

func OpenConnectAndSendMsg

func OpenConnectAndSendMsg(wsurl string, msg Message) (*websocket.Conn, error)

connect

func RequestChannelAndSernodeInfoFromLoginResolutionApi

func RequestChannelAndSernodeInfoFromLoginResolutionApi(apiUrl string, cid fields.ChannelId, sername string) (*RpcDataChannelInfo, *RpcDataSernodeInfo, error)

Request data from all nodes

func RequestRpcReqDiamondNameServiceFromLoginResolutionApi

func RequestRpcReqDiamondNameServiceFromLoginResolutionApi(apiDomain string, diakind string) (string, error)

Request hdns resolution data from all nodes

func RequestRpcReqDiamondNameServiceInCommonUse

func RequestRpcReqDiamondNameServiceInCommonUse(apiUrl string) (string, error)

Request hdns resolution data from all nodes

func ResponseCreateData

func ResponseCreateData(key string, value interface{}) map[string]interface{}

func ResponseData

func ResponseData(w http.ResponseWriter, data map[string]interface{})

func ResponseError

func ResponseError(w http.ResponseWriter, err error)

func ResponseErrorString

func ResponseErrorString(w http.ResponseWriter, errstr string)

func ResponseErrorStringWithCode

func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)

func ResponseJSON

func ResponseJSON(w http.ResponseWriter, resobj interface{}) error

func ResponseJSONbytes

func ResponseJSONbytes(w http.ResponseWriter, content []byte) error

func ResponseList

func ResponseList(w http.ResponseWriter, data interface{})

func ResponseLocation

func ResponseLocation(w http.ResponseWriter, url string)

func SendMsg

func SendMsg(wsconn *websocket.Conn, msg Message) error

send message

Types

type ChannelAccountAddress

type ChannelAccountAddress struct {
	Address      fields.Address      // address
	ChannelId    fields.ChannelId    // Channel Chain ID
	ServicerName fields.StringMax255 // Name of service provider

}

func ParseChannelAccountAddress

func ParseChannelAccountAddress(addrstr string) (*ChannelAccountAddress, error)

Resolve new address

func (*ChannelAccountAddress) CompareServiceName

func (c *ChannelAccountAddress) CompareServiceName(sname string) bool

Comparison operator name

func (*ChannelAccountAddress) Parse

func (c *ChannelAccountAddress) Parse(addrstr string) error

Resolve address

func (*ChannelAccountAddress) ToReadable

func (c *ChannelAccountAddress) ToReadable(isstrict bool) string

Readable address

type Message

type Message interface {
	Type() uint8 // type
	Size() uint32
	Parse(buf []byte, seek uint32) (uint32, error)
	Serialize() ([]byte, error)         // serialize
	SerializeWithType() ([]byte, error) // serialize
}

*

  • 消息接口

func OpenConnectAndSendMsgForResponseTimeout

func OpenConnectAndSendMsgForResponseTimeout(wsurl string, msg Message, timeoutsec int) (*websocket.Conn, Message, []byte, error)

Initiate connection Send a message and get a reply Timeoutsec timeout seconds

func ParseMessage

func ParseMessage(buf []byte, seek uint32) (Message, error)

*

  • 解析消息

func ReceiveMsg

func ReceiveMsg(wsconn *websocket.Conn) (Message, []byte, error)

Accept message

func ReceiveMsgOfTimeout

func ReceiveMsgOfTimeout(wsconn *websocket.Conn, timeoutsec int) (Message, []byte, error)

Accept message Timeoutsec timeout seconds

func SendMsgForResponseTimeout

func SendMsgForResponseTimeout(wsconn *websocket.Conn, msg Message, timeoutsec int) (Message, []byte, error)

Send a message and get a reply Timeoutsec timeout seconds

type MsgBroadcastChannelStatementError

type MsgBroadcastChannelStatementError struct {
	ErrCode fields.VarUint2
	ErrTip  fields.StringMax65535
}

Channel payment error

func (*MsgBroadcastChannelStatementError) Parse

func (m *MsgBroadcastChannelStatementError) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgBroadcastChannelStatementError) Serialize

func (m MsgBroadcastChannelStatementError) Serialize() ([]byte, error)

func (MsgBroadcastChannelStatementError) SerializeWithType

func (m MsgBroadcastChannelStatementError) SerializeWithType() ([]byte, error)

func (MsgBroadcastChannelStatementError) Size

func (MsgBroadcastChannelStatementError) Type

type MsgBroadcastChannelStatementProveBody

type MsgBroadcastChannelStatementProveBody struct {
	TransactionDistinguishId fields.VarUint8 // Transaction identification ID
	ProveBodyIndex           fields.VarUint1 // Statement position index starts from zero
	ProveBodyInfo            *channel.ChannelChainTransferProveBodyInfo
}

Broadcast statement

func (*MsgBroadcastChannelStatementProveBody) Parse

func (MsgBroadcastChannelStatementProveBody) Serialize

func (MsgBroadcastChannelStatementProveBody) SerializeWithType

func (m MsgBroadcastChannelStatementProveBody) SerializeWithType() ([]byte, error)

func (MsgBroadcastChannelStatementProveBody) Size

func (MsgBroadcastChannelStatementProveBody) Type

type MsgBroadcastChannelStatementSignature

type MsgBroadcastChannelStatementSignature struct {
	TransactionDistinguishId fields.VarUint8 // Transaction identification ID
	// autograph
	Signs fields.SignListMax255
}

Broadcast channel payment signature

func (*MsgBroadcastChannelStatementSignature) Parse

func (MsgBroadcastChannelStatementSignature) Serialize

func (MsgBroadcastChannelStatementSignature) SerializeWithType

func (m MsgBroadcastChannelStatementSignature) SerializeWithType() ([]byte, error)

func (MsgBroadcastChannelStatementSignature) Size

func (MsgBroadcastChannelStatementSignature) Type

type MsgBroadcastChannelStatementSuccessed

type MsgBroadcastChannelStatementSuccessed struct {
	SuccessTip fields.StringMax65535
}

Channel payment succeeded

func (*MsgBroadcastChannelStatementSuccessed) Parse

func (MsgBroadcastChannelStatementSuccessed) Serialize

func (MsgBroadcastChannelStatementSuccessed) SerializeWithType

func (m MsgBroadcastChannelStatementSuccessed) SerializeWithType() ([]byte, error)

func (MsgBroadcastChannelStatementSuccessed) Size

func (MsgBroadcastChannelStatementSuccessed) Type

type MsgClientInitiateReconciliation

type MsgClientInitiateReconciliation struct {
	SelfSign fields.Sign // Reconciliation our signature
}

Client initiated reconciliation

func (*MsgClientInitiateReconciliation) Parse

func (m *MsgClientInitiateReconciliation) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgClientInitiateReconciliation) Serialize

func (m MsgClientInitiateReconciliation) Serialize() ([]byte, error)

func (MsgClientInitiateReconciliation) SerializeWithType

func (m MsgClientInitiateReconciliation) SerializeWithType() ([]byte, error)

func (MsgClientInitiateReconciliation) Size

func (MsgClientInitiateReconciliation) Type

type MsgCustomerLogout

type MsgCustomerLogout struct {
	PostBack fields.StringMax255 // Return message
}

func (*MsgCustomerLogout) Parse

func (m *MsgCustomerLogout) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgCustomerLogout) Serialize

func (m MsgCustomerLogout) Serialize() ([]byte, error)

func (MsgCustomerLogout) SerializeWithType

func (m MsgCustomerLogout) SerializeWithType() ([]byte, error)

func (MsgCustomerLogout) Size

func (m MsgCustomerLogout) Size() uint32

func (MsgCustomerLogout) Type

func (m MsgCustomerLogout) Type() uint8

type MsgDisplacementOffline

type MsgDisplacementOffline struct {
}

func (*MsgDisplacementOffline) Parse

func (m *MsgDisplacementOffline) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgDisplacementOffline) Serialize

func (m MsgDisplacementOffline) Serialize() ([]byte, error)

func (MsgDisplacementOffline) SerializeWithType

func (m MsgDisplacementOffline) SerializeWithType() ([]byte, error)

func (MsgDisplacementOffline) Size

func (m MsgDisplacementOffline) Size() uint32

func (MsgDisplacementOffline) Type

func (m MsgDisplacementOffline) Type() uint8

type MsgError

type MsgError struct {
	ErrCode fields.VarUint2
	ErrTip  fields.StringMax65535
}

func (*MsgError) Parse

func (m *MsgError) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgError) Serialize

func (m MsgError) Serialize() ([]byte, error)

func (MsgError) SerializeWithType

func (m MsgError) SerializeWithType() ([]byte, error)

func (MsgError) Size

func (m MsgError) Size() uint32

func (MsgError) Type

func (m MsgError) Type() uint8

type MsgHeartbeat

type MsgHeartbeat struct {
}

func (*MsgHeartbeat) Parse

func (m *MsgHeartbeat) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgHeartbeat) Serialize

func (m MsgHeartbeat) Serialize() ([]byte, error)

func (MsgHeartbeat) SerializeWithType

func (m MsgHeartbeat) SerializeWithType() ([]byte, error)

func (MsgHeartbeat) Size

func (m MsgHeartbeat) Size() uint32

func (MsgHeartbeat) Type

func (m MsgHeartbeat) Type() uint8

type MsgLogin

type MsgLogin struct {
	ProtocolVersion fields.VarUint2     // Client protocol version number for upgrade and forward compatibility
	ChannelId       fields.ChannelId    // Channel ID
	CustomerAddress fields.Address      // Customer side address
	LanguageSet     fields.StringMax255 // Language settings
}

func (*MsgLogin) Parse

func (m *MsgLogin) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgLogin) Serialize

func (m MsgLogin) Serialize() ([]byte, error)

func (MsgLogin) SerializeWithType

func (m MsgLogin) SerializeWithType() ([]byte, error)

func (MsgLogin) Size

func (m MsgLogin) Size() uint32

func (MsgLogin) Type

func (m MsgLogin) Type() uint8

type MsgLoginCheckLastestBill

type MsgLoginCheckLastestBill struct {
	ProtocolVersion fields.VarUint2 // The latest protocol version number of the server, which is used to remind the client to update the software version
	BillIsExistent  fields.Bool     // Whether there is a statement
	LastBill        channel.ReconciliationBalanceBill
}

func (*MsgLoginCheckLastestBill) Parse

func (m *MsgLoginCheckLastestBill) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgLoginCheckLastestBill) Serialize

func (m MsgLoginCheckLastestBill) Serialize() ([]byte, error)

func (MsgLoginCheckLastestBill) SerializeWithType

func (m MsgLoginCheckLastestBill) SerializeWithType() ([]byte, error)

func (MsgLoginCheckLastestBill) Size

func (MsgLoginCheckLastestBill) Type

type MsgPayRouteEndClose

type MsgPayRouteEndClose struct {
}

Complete and close

func (*MsgPayRouteEndClose) Parse

func (m *MsgPayRouteEndClose) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteEndClose) Serialize

func (m MsgPayRouteEndClose) Serialize() ([]byte, error)

func (MsgPayRouteEndClose) SerializeWithType

func (m MsgPayRouteEndClose) SerializeWithType() ([]byte, error)

func (MsgPayRouteEndClose) Size

func (m MsgPayRouteEndClose) Size() uint32

func (MsgPayRouteEndClose) Type

func (m MsgPayRouteEndClose) Type() uint8

type MsgPayRouteRequestNodeRelationship

type MsgPayRouteRequestNodeRelationship struct {
}

Request all relationships

func (*MsgPayRouteRequestNodeRelationship) Parse

func (m *MsgPayRouteRequestNodeRelationship) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteRequestNodeRelationship) Serialize

func (m MsgPayRouteRequestNodeRelationship) Serialize() ([]byte, error)

func (MsgPayRouteRequestNodeRelationship) SerializeWithType

func (m MsgPayRouteRequestNodeRelationship) SerializeWithType() ([]byte, error)

func (MsgPayRouteRequestNodeRelationship) Size

func (MsgPayRouteRequestNodeRelationship) Type

type MsgPayRouteRequestServiceNodes

type MsgPayRouteRequestServiceNodes struct {
}

Request list of all nodes

func (*MsgPayRouteRequestServiceNodes) Parse

func (m *MsgPayRouteRequestServiceNodes) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteRequestServiceNodes) Serialize

func (m MsgPayRouteRequestServiceNodes) Serialize() ([]byte, error)

func (MsgPayRouteRequestServiceNodes) SerializeWithType

func (m MsgPayRouteRequestServiceNodes) SerializeWithType() ([]byte, error)

func (MsgPayRouteRequestServiceNodes) Size

func (MsgPayRouteRequestServiceNodes) Type

type MsgPayRouteRequestUpdates

type MsgPayRouteRequestUpdates struct {
	QueryPageNum fields.VarUint4 // Requested pages
}

Request route modification

func (*MsgPayRouteRequestUpdates) Parse

func (m *MsgPayRouteRequestUpdates) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteRequestUpdates) Serialize

func (m MsgPayRouteRequestUpdates) Serialize() ([]byte, error)

func (MsgPayRouteRequestUpdates) SerializeWithType

func (m MsgPayRouteRequestUpdates) SerializeWithType() ([]byte, error)

func (MsgPayRouteRequestUpdates) Size

func (MsgPayRouteRequestUpdates) Type

type MsgPayRouteResponseNodeRelationship

type MsgPayRouteResponseNodeRelationship struct {
	AllRelationships fields.StringMax16777215
}

Respond to all relationships

func (*MsgPayRouteResponseNodeRelationship) Parse

func (m *MsgPayRouteResponseNodeRelationship) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteResponseNodeRelationship) Serialize

func (m MsgPayRouteResponseNodeRelationship) Serialize() ([]byte, error)

func (MsgPayRouteResponseNodeRelationship) SerializeWithType

func (m MsgPayRouteResponseNodeRelationship) SerializeWithType() ([]byte, error)

func (MsgPayRouteResponseNodeRelationship) Size

func (MsgPayRouteResponseNodeRelationship) Type

type MsgPayRouteResponseServiceNodes

type MsgPayRouteResponseServiceNodes struct {
	LastestUpdatePageNum fields.VarUint4
	AllNodesBytes        fields.StringMax16777215
}

Respond to all nodes

func (*MsgPayRouteResponseServiceNodes) Parse

func (m *MsgPayRouteResponseServiceNodes) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteResponseServiceNodes) Serialize

func (m MsgPayRouteResponseServiceNodes) Serialize() ([]byte, error)

func (MsgPayRouteResponseServiceNodes) SerializeWithType

func (m MsgPayRouteResponseServiceNodes) SerializeWithType() ([]byte, error)

func (MsgPayRouteResponseServiceNodes) Size

func (MsgPayRouteResponseServiceNodes) Type

type MsgPayRouteResponseUpdates

type MsgPayRouteResponseUpdates struct {
	DataStatus            fields.VarUint1 // 数据状态  0.错误 1.正常 2.已超出最新 4.没找到
	AllUpdatesOfJsonBytes fields.StringMax16777215
}

Response route update

func (*MsgPayRouteResponseUpdates) Parse

func (m *MsgPayRouteResponseUpdates) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgPayRouteResponseUpdates) Serialize

func (m MsgPayRouteResponseUpdates) Serialize() ([]byte, error)

func (MsgPayRouteResponseUpdates) SerializeWithType

func (m MsgPayRouteResponseUpdates) SerializeWithType() ([]byte, error)

func (MsgPayRouteResponseUpdates) Size

func (MsgPayRouteResponseUpdates) Type

type MsgRequestInitiatePayment

type MsgRequestInitiatePayment struct {
	TransactionDistinguishId fields.VarUint8 // Transaction identification ID

	Timestamp                fields.BlockTxTimestamp // Transaction timestamp
	OrderNoteHashHalfChecker fields.HashHalfChecker  // Order detail data hash

	HighestAcceptanceFee fields.Amount           // Maximum acceptable total handling fee amount
	PayAmount            fields.Amount           // Payment amount must be a positive integer
	PaySatoshi           fields.SatoshiVariation // Payment amount satoshi
	PayeeChannelAddr     fields.StringMax255     // Receiver channel address, for example: 1ke39sgbnrsdzkthanztafjmdhcc8qvm2z__ HACorg

	// Specified routing node ID list
	TargetPath NodeIdPath
}

*

  • 发起支付

func (*MsgRequestInitiatePayment) Parse

func (m *MsgRequestInitiatePayment) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgRequestInitiatePayment) Serialize

func (m MsgRequestInitiatePayment) Serialize() ([]byte, error)

func (MsgRequestInitiatePayment) SerializeWithType

func (m MsgRequestInitiatePayment) SerializeWithType() ([]byte, error)

func (MsgRequestInitiatePayment) Size

func (MsgRequestInitiatePayment) Type

type MsgRequestPrequeryPayment

type MsgRequestPrequeryPayment struct {
	PayAmount        fields.Amount           // Payment amount must be a positive integer
	PaySatoshi       fields.SatoshiVariation // bitcoin if
	PayeeChannelAddr fields.StringMax255     // Receiver channel address, for example: 1ke39sgbnrsdzkthanztafjmdhcc8qvm2z__ HACorg
}

func (*MsgRequestPrequeryPayment) Parse

func (m *MsgRequestPrequeryPayment) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgRequestPrequeryPayment) Serialize

func (m MsgRequestPrequeryPayment) Serialize() ([]byte, error)

func (MsgRequestPrequeryPayment) SerializeWithType

func (m MsgRequestPrequeryPayment) SerializeWithType() ([]byte, error)

func (MsgRequestPrequeryPayment) Size

func (MsgRequestPrequeryPayment) Type

type MsgRequestRelayInitiatePayment

type MsgRequestRelayInitiatePayment struct {
	InitPayMsg         MsgRequestInitiatePayment
	IdentificationName fields.StringMax255
	ChannelId          fields.ChannelId
}

*

  • 中继节点发起支付

func (*MsgRequestRelayInitiatePayment) Parse

func (m *MsgRequestRelayInitiatePayment) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgRequestRelayInitiatePayment) Serialize

func (m MsgRequestRelayInitiatePayment) Serialize() ([]byte, error)

func (MsgRequestRelayInitiatePayment) SerializeWithType

func (m MsgRequestRelayInitiatePayment) SerializeWithType() ([]byte, error)

func (MsgRequestRelayInitiatePayment) Size

func (MsgRequestRelayInitiatePayment) Type

type MsgResponsePrequeryPayment

type MsgResponsePrequeryPayment struct {
	ErrCode   fields.VarUint2       // Error code when there is an error > 0
	ErrTip    fields.StringMax65535 // Error message
	Notes     fields.StringMax65535 // Descriptive information
	PathForms *PayPathForms         // List of selectable payment channels
}

Payment pre query response

func NewMsgResponsePrequeryPayment

func NewMsgResponsePrequeryPayment(ecode uint16) *MsgResponsePrequeryPayment

func (*MsgResponsePrequeryPayment) Parse

func (m *MsgResponsePrequeryPayment) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgResponsePrequeryPayment) Serialize

func (m MsgResponsePrequeryPayment) Serialize() ([]byte, error)

func (MsgResponsePrequeryPayment) SerializeWithType

func (m MsgResponsePrequeryPayment) SerializeWithType() ([]byte, error)

func (MsgResponsePrequeryPayment) Size

func (MsgResponsePrequeryPayment) Type

type MsgServicerRespondReconciliation

type MsgServicerRespondReconciliation struct {
	SelfSign fields.Sign // Reconciliation our signature
}

Server response reconciliation

func (*MsgServicerRespondReconciliation) Parse

func (m *MsgServicerRespondReconciliation) Parse(buf []byte, seek uint32) (uint32, error)

func (MsgServicerRespondReconciliation) Serialize

func (m MsgServicerRespondReconciliation) Serialize() ([]byte, error)

func (MsgServicerRespondReconciliation) SerializeWithType

func (m MsgServicerRespondReconciliation) SerializeWithType() ([]byte, error)

func (MsgServicerRespondReconciliation) Size

func (MsgServicerRespondReconciliation) Type

type NodeIdPath

type NodeIdPath struct {
	NodeIdCount fields.VarUint1
	NodeIdPath  []fields.VarUint4
}

func (*NodeIdPath) Parse

func (m *NodeIdPath) Parse(buf []byte, seek uint32) (uint32, error)

func (NodeIdPath) Serialize

func (m NodeIdPath) Serialize() ([]byte, error)

func (NodeIdPath) Size

func (m NodeIdPath) Size() uint32

type PayPathDescribe

type PayPathDescribe struct {
	NodeIdPath        *NodeIdPath
	PredictPathFeeAmt fields.Amount // Estimated service charge for route
	PredictPathFeeSat fields.SatoshiVariation
	Describe          fields.StringMax65535 // Channel payment description
}

func (*PayPathDescribe) Parse

func (m *PayPathDescribe) Parse(buf []byte, seek uint32) (uint32, error)

func (PayPathDescribe) Serialize

func (m PayPathDescribe) Serialize() ([]byte, error)

func (PayPathDescribe) Size

func (m PayPathDescribe) Size() uint32

type PayPathForms

type PayPathForms struct {
	PayPathCount fields.VarUint1    // Number of payment paths
	PayPaths     []*PayPathDescribe // Payment path list
}

func (*PayPathForms) Parse

func (m *PayPathForms) Parse(buf []byte, seek uint32) (uint32, error)

func (PayPathForms) Serialize

func (m PayPathForms) Serialize() ([]byte, error)

func (PayPathForms) Size

func (m PayPathForms) Size() uint32

type RpcDataChannelInfo

type RpcDataChannelInfo struct {
	//LockBlock    fields.VarUint2 // 单方面结束通道要锁定的区块数量
	ChannelId    fields.ChannelId
	LeftAddress  fields.Address
	LeftAmount   fields.Amount // Mortgage amount 1
	LeftSatoshi  fields.Satoshi
	RightAddress fields.Address
	RightAmount  fields.Amount // Mortgage amount 2
	RightSatoshi fields.Satoshi
	ReuseVersion fields.VarUint4 // Reuse version number from 1
	Status       fields.VarUint1 // Closed and settled
}

func ParseRpcDataChannelInfoByJSON

func ParseRpcDataChannelInfoByJSON(cid fields.ChannelId, bytes []byte) (*RpcDataChannelInfo, error)

func RequestRpcReqChannelInfo

func RequestRpcReqChannelInfo(fullNodeRpcUrl string, cid fields.ChannelId) (*RpcDataChannelInfo, error)

Request data from all nodes

func (*RpcDataChannelInfo) GetLeftAndRightTotalAmount

func (r *RpcDataChannelInfo) GetLeftAndRightTotalAmount() *fields.Amount

type RpcDataSernodeInfo

type RpcDataSernodeInfo struct {
	Gateway fields.StringMax255
}

Jump to

Keyboard shortcuts

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