Documentation
¶
Index ¶
- Constants
- func CheckParamBool(r *http.Request, key string, defValue bool) bool
- func CheckParamHex(r *http.Request, key string, defv []byte) []byte
- func CheckParamHexMustLen(r *http.Request, key string, mustLen int) []byte
- func CheckParamString(r *http.Request, key string, defValue string) string
- func CheckParamUint64(r *http.Request, key string, defValue uint64) uint64
- func CheckParamUint64Must(r *http.Request, w http.ResponseWriter, key string) (uint64, bool)
- func IsHDNSaddress(addrstr string) (string, bool)
- func OpenConnect(wsurl string) (*websocket.Conn, error)
- func OpenConnectAndSendMsg(wsurl string, msg Message) (*websocket.Conn, error)
- func RequestChannelAndSernodeInfoFromLoginResolutionApi(apiUrl string, cid fields.ChannelId, sername string) (*RpcDataChannelInfo, *RpcDataSernodeInfo, error)
- func RequestRpcReqDiamondNameServiceFromLoginResolutionApi(apiDomain string, diakind string) (string, error)
- func RequestRpcReqDiamondNameServiceInCommonUse(apiUrl string) (string, error)
- func ResponseCreateData(key string, value interface{}) map[string]interface{}
- func ResponseData(w http.ResponseWriter, data map[string]interface{})
- func ResponseError(w http.ResponseWriter, err error)
- func ResponseErrorString(w http.ResponseWriter, errstr string)
- func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)
- func ResponseJSON(w http.ResponseWriter, resobj interface{}) error
- func ResponseJSONbytes(w http.ResponseWriter, content []byte) error
- func ResponseList(w http.ResponseWriter, data interface{})
- func ResponseLocation(w http.ResponseWriter, url string)
- func SendMsg(wsconn *websocket.Conn, msg Message) error
- type ChannelAccountAddress
- type Message
- func OpenConnectAndSendMsgForResponseTimeout(wsurl string, msg Message, timeoutsec int) (*websocket.Conn, Message, []byte, error)
- func ParseMessage(buf []byte, seek uint32) (Message, error)
- func ReceiveMsg(wsconn *websocket.Conn) (Message, []byte, error)
- func ReceiveMsgOfTimeout(wsconn *websocket.Conn, timeoutsec int) (Message, []byte, error)
- func SendMsgForResponseTimeout(wsconn *websocket.Conn, msg Message, timeoutsec int) (Message, []byte, error)
- type MsgBroadcastChannelStatementError
- func (m *MsgBroadcastChannelStatementError) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgBroadcastChannelStatementError) Serialize() ([]byte, error)
- func (m MsgBroadcastChannelStatementError) SerializeWithType() ([]byte, error)
- func (m MsgBroadcastChannelStatementError) Size() uint32
- func (m MsgBroadcastChannelStatementError) Type() uint8
- type MsgBroadcastChannelStatementProveBody
- func (m *MsgBroadcastChannelStatementProveBody) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgBroadcastChannelStatementProveBody) Serialize() ([]byte, error)
- func (m MsgBroadcastChannelStatementProveBody) SerializeWithType() ([]byte, error)
- func (m MsgBroadcastChannelStatementProveBody) Size() uint32
- func (m MsgBroadcastChannelStatementProveBody) Type() uint8
- type MsgBroadcastChannelStatementSignature
- func (m *MsgBroadcastChannelStatementSignature) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgBroadcastChannelStatementSignature) Serialize() ([]byte, error)
- func (m MsgBroadcastChannelStatementSignature) SerializeWithType() ([]byte, error)
- func (m MsgBroadcastChannelStatementSignature) Size() uint32
- func (MsgBroadcastChannelStatementSignature) Type() uint8
- type MsgBroadcastChannelStatementSuccessed
- func (m *MsgBroadcastChannelStatementSuccessed) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgBroadcastChannelStatementSuccessed) Serialize() ([]byte, error)
- func (m MsgBroadcastChannelStatementSuccessed) SerializeWithType() ([]byte, error)
- func (m MsgBroadcastChannelStatementSuccessed) Size() uint32
- func (m MsgBroadcastChannelStatementSuccessed) Type() uint8
- type MsgClientInitiateReconciliation
- func (m *MsgClientInitiateReconciliation) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgClientInitiateReconciliation) Serialize() ([]byte, error)
- func (m MsgClientInitiateReconciliation) SerializeWithType() ([]byte, error)
- func (m MsgClientInitiateReconciliation) Size() uint32
- func (m MsgClientInitiateReconciliation) Type() uint8
- type MsgCustomerLogout
- type MsgDisplacementOffline
- type MsgError
- type MsgHeartbeat
- type MsgLogin
- type MsgLoginCheckLastestBill
- func (m *MsgLoginCheckLastestBill) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgLoginCheckLastestBill) Serialize() ([]byte, error)
- func (m MsgLoginCheckLastestBill) SerializeWithType() ([]byte, error)
- func (m MsgLoginCheckLastestBill) Size() uint32
- func (m MsgLoginCheckLastestBill) Type() uint8
- type MsgPayRouteEndClose
- type MsgPayRouteRequestNodeRelationship
- func (m *MsgPayRouteRequestNodeRelationship) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgPayRouteRequestNodeRelationship) Serialize() ([]byte, error)
- func (m MsgPayRouteRequestNodeRelationship) SerializeWithType() ([]byte, error)
- func (m MsgPayRouteRequestNodeRelationship) Size() uint32
- func (m MsgPayRouteRequestNodeRelationship) Type() uint8
- type MsgPayRouteRequestServiceNodes
- func (m *MsgPayRouteRequestServiceNodes) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgPayRouteRequestServiceNodes) Serialize() ([]byte, error)
- func (m MsgPayRouteRequestServiceNodes) SerializeWithType() ([]byte, error)
- func (m MsgPayRouteRequestServiceNodes) Size() uint32
- func (m MsgPayRouteRequestServiceNodes) Type() uint8
- type MsgPayRouteRequestUpdates
- func (m *MsgPayRouteRequestUpdates) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgPayRouteRequestUpdates) Serialize() ([]byte, error)
- func (m MsgPayRouteRequestUpdates) SerializeWithType() ([]byte, error)
- func (m MsgPayRouteRequestUpdates) Size() uint32
- func (m MsgPayRouteRequestUpdates) Type() uint8
- type MsgPayRouteResponseNodeRelationship
- func (m *MsgPayRouteResponseNodeRelationship) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgPayRouteResponseNodeRelationship) Serialize() ([]byte, error)
- func (m MsgPayRouteResponseNodeRelationship) SerializeWithType() ([]byte, error)
- func (m MsgPayRouteResponseNodeRelationship) Size() uint32
- func (m MsgPayRouteResponseNodeRelationship) Type() uint8
- type MsgPayRouteResponseServiceNodes
- func (m *MsgPayRouteResponseServiceNodes) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgPayRouteResponseServiceNodes) Serialize() ([]byte, error)
- func (m MsgPayRouteResponseServiceNodes) SerializeWithType() ([]byte, error)
- func (m MsgPayRouteResponseServiceNodes) Size() uint32
- func (m MsgPayRouteResponseServiceNodes) Type() uint8
- type MsgPayRouteResponseUpdates
- func (m *MsgPayRouteResponseUpdates) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgPayRouteResponseUpdates) Serialize() ([]byte, error)
- func (m MsgPayRouteResponseUpdates) SerializeWithType() ([]byte, error)
- func (m MsgPayRouteResponseUpdates) Size() uint32
- func (m MsgPayRouteResponseUpdates) Type() uint8
- type MsgRequestInitiatePayment
- func (m *MsgRequestInitiatePayment) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgRequestInitiatePayment) Serialize() ([]byte, error)
- func (m MsgRequestInitiatePayment) SerializeWithType() ([]byte, error)
- func (m MsgRequestInitiatePayment) Size() uint32
- func (m MsgRequestInitiatePayment) Type() uint8
- type MsgRequestPrequeryPayment
- func (m *MsgRequestPrequeryPayment) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgRequestPrequeryPayment) Serialize() ([]byte, error)
- func (m MsgRequestPrequeryPayment) SerializeWithType() ([]byte, error)
- func (m MsgRequestPrequeryPayment) Size() uint32
- func (m MsgRequestPrequeryPayment) Type() uint8
- type MsgRequestRelayInitiatePayment
- func (m *MsgRequestRelayInitiatePayment) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgRequestRelayInitiatePayment) Serialize() ([]byte, error)
- func (m MsgRequestRelayInitiatePayment) SerializeWithType() ([]byte, error)
- func (m MsgRequestRelayInitiatePayment) Size() uint32
- func (m MsgRequestRelayInitiatePayment) Type() uint8
- type MsgResponsePrequeryPayment
- func (m *MsgResponsePrequeryPayment) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgResponsePrequeryPayment) Serialize() ([]byte, error)
- func (m MsgResponsePrequeryPayment) SerializeWithType() ([]byte, error)
- func (m MsgResponsePrequeryPayment) Size() uint32
- func (m MsgResponsePrequeryPayment) Type() uint8
- type MsgServicerRespondReconciliation
- func (m *MsgServicerRespondReconciliation) Parse(buf []byte, seek uint32) (uint32, error)
- func (m MsgServicerRespondReconciliation) Serialize() ([]byte, error)
- func (m MsgServicerRespondReconciliation) SerializeWithType() ([]byte, error)
- func (m MsgServicerRespondReconciliation) Size() uint32
- func (m MsgServicerRespondReconciliation) Type() uint8
- type NodeIdPath
- type PayPathDescribe
- type PayPathForms
- type RpcDataChannelInfo
- type RpcDataSernodeInfo
Constants ¶
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 )
const (
LatestProtocolVersion uint16 = 1 // Latest protocol version number
)
Variables ¶
This section is empty.
Functions ¶
func CheckParamHexMustLen ¶
func CheckParamUint64Must ¶
func IsHDNSaddress ¶
Determine whether it is the hdns diamond domain name service address
func OpenConnectAndSendMsg ¶
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 ¶
Request hdns resolution data from all nodes
func ResponseCreateData ¶
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)
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 ReceiveMsgOfTimeout ¶
Accept message 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 (m MsgBroadcastChannelStatementError) Size() uint32
func (MsgBroadcastChannelStatementError) Type ¶
func (m MsgBroadcastChannelStatementError) Type() uint8
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 (m *MsgBroadcastChannelStatementProveBody) Parse(buf []byte, seek uint32) (uint32, error)
func (MsgBroadcastChannelStatementProveBody) Serialize ¶
func (m MsgBroadcastChannelStatementProveBody) Serialize() ([]byte, error)
func (MsgBroadcastChannelStatementProveBody) SerializeWithType ¶
func (m MsgBroadcastChannelStatementProveBody) SerializeWithType() ([]byte, error)
func (MsgBroadcastChannelStatementProveBody) Size ¶
func (m MsgBroadcastChannelStatementProveBody) Size() uint32
func (MsgBroadcastChannelStatementProveBody) Type ¶
func (m MsgBroadcastChannelStatementProveBody) Type() uint8
type MsgBroadcastChannelStatementSignature ¶
type MsgBroadcastChannelStatementSignature struct { TransactionDistinguishId fields.VarUint8 // Transaction identification ID // autograph Signs fields.SignListMax255 }
Broadcast channel payment signature
func (*MsgBroadcastChannelStatementSignature) Parse ¶
func (m *MsgBroadcastChannelStatementSignature) Parse(buf []byte, seek uint32) (uint32, error)
func (MsgBroadcastChannelStatementSignature) Serialize ¶
func (m MsgBroadcastChannelStatementSignature) Serialize() ([]byte, error)
func (MsgBroadcastChannelStatementSignature) SerializeWithType ¶
func (m MsgBroadcastChannelStatementSignature) SerializeWithType() ([]byte, error)
func (MsgBroadcastChannelStatementSignature) Size ¶
func (m MsgBroadcastChannelStatementSignature) Size() uint32
func (MsgBroadcastChannelStatementSignature) Type ¶
func (MsgBroadcastChannelStatementSignature) Type() uint8
type MsgBroadcastChannelStatementSuccessed ¶
type MsgBroadcastChannelStatementSuccessed struct {
SuccessTip fields.StringMax65535
}
Channel payment succeeded
func (*MsgBroadcastChannelStatementSuccessed) Parse ¶
func (m *MsgBroadcastChannelStatementSuccessed) Parse(buf []byte, seek uint32) (uint32, error)
func (MsgBroadcastChannelStatementSuccessed) Serialize ¶
func (m MsgBroadcastChannelStatementSuccessed) Serialize() ([]byte, error)
func (MsgBroadcastChannelStatementSuccessed) SerializeWithType ¶
func (m MsgBroadcastChannelStatementSuccessed) SerializeWithType() ([]byte, error)
func (MsgBroadcastChannelStatementSuccessed) Size ¶
func (m MsgBroadcastChannelStatementSuccessed) Size() uint32
func (MsgBroadcastChannelStatementSuccessed) Type ¶
func (m MsgBroadcastChannelStatementSuccessed) Type() uint8
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 (m MsgClientInitiateReconciliation) Size() uint32
func (MsgClientInitiateReconciliation) Type ¶
func (m MsgClientInitiateReconciliation) Type() uint8
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) SerializeWithType ¶
type MsgHeartbeat ¶
type MsgHeartbeat struct { }
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) SerializeWithType ¶
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 (m MsgLoginCheckLastestBill) Size() uint32
func (MsgLoginCheckLastestBill) Type ¶
func (m MsgLoginCheckLastestBill) Type() uint8
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 (m MsgPayRouteRequestNodeRelationship) Size() uint32
func (MsgPayRouteRequestNodeRelationship) Type ¶
func (m MsgPayRouteRequestNodeRelationship) Type() uint8
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 (m MsgPayRouteRequestServiceNodes) Size() uint32
func (MsgPayRouteRequestServiceNodes) Type ¶
func (m MsgPayRouteRequestServiceNodes) Type() uint8
type MsgPayRouteRequestUpdates ¶
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 (m MsgPayRouteRequestUpdates) Size() uint32
func (MsgPayRouteRequestUpdates) Type ¶
func (m MsgPayRouteRequestUpdates) Type() uint8
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 (m MsgPayRouteResponseNodeRelationship) Size() uint32
func (MsgPayRouteResponseNodeRelationship) Type ¶
func (m MsgPayRouteResponseNodeRelationship) Type() uint8
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 (m MsgPayRouteResponseServiceNodes) Size() uint32
func (MsgPayRouteResponseServiceNodes) Type ¶
func (m MsgPayRouteResponseServiceNodes) Type() uint8
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 (m MsgPayRouteResponseUpdates) Size() uint32
func (MsgPayRouteResponseUpdates) Type ¶
func (m MsgPayRouteResponseUpdates) Type() uint8
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 (m MsgRequestInitiatePayment) Size() uint32
func (MsgRequestInitiatePayment) Type ¶
func (m MsgRequestInitiatePayment) Type() uint8
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 (m MsgRequestPrequeryPayment) Size() uint32
func (MsgRequestPrequeryPayment) Type ¶
func (m MsgRequestPrequeryPayment) Type() uint8
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 (m MsgRequestRelayInitiatePayment) Size() uint32
func (MsgRequestRelayInitiatePayment) Type ¶
func (m MsgRequestRelayInitiatePayment) Type() uint8
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 (m MsgResponsePrequeryPayment) Size() uint32
func (MsgResponsePrequeryPayment) Type ¶
func (m MsgResponsePrequeryPayment) Type() uint8
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 (m MsgServicerRespondReconciliation) Size() uint32
func (MsgServicerRespondReconciliation) Type ¶
func (m MsgServicerRespondReconciliation) Type() uint8
type NodeIdPath ¶
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) 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
}
Source Files
¶
- address.go
- bill.go
- connect.go
- hdns.go
- http.go
- message.go
- msg_Initiatepayment.go
- msg_chanpay.go
- msg_chanpaysign.go
- msg_checklastbill.go
- msg_error.go
- msg_heartbeat.go
- msg_login.go
- msg_logout.go
- msg_offline.go
- msg_payrouteupdate.go
- msg_prequerypayment.go
- msg_reconciliation.go
- msg_remotepay.go
- msg_routesload.go
- read.go
- response.go
- rpcdata.go
- send.go