-
Notifications
You must be signed in to change notification settings - Fork 238
/
Copy pathrpc_notify_addresses_txs.go
87 lines (76 loc) · 2.89 KB
/
rpc_notify_addresses_txs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package appmessage
// NotifyAddressesTxsRequestMessage is an appmessage corresponding to
// its respective RPC message
type NotifyAddressesTxsRequestMessage struct {
baseMessage
Addresses []string
RequiredConfirmations uint32
IncludePending bool
IncludeSending bool
IncludeReceiving bool
}
// Command returns the protocol command string for the message
func (msg *NotifyAddressesTxsRequestMessage) Command() MessageCommand {
return CmdNotifyAddressesTxsRequestMessage
}
// NewNotifyAddressesTxsRequestMessage returns a instance of the message
func NewNotifyAddressesTxsRequestMessage(addresses []string, requiredConfirmations uint32,
includePending bool, includeSending bool, includeReceiving bool) *NotifyAddressesTxsRequestMessage {
return &NotifyAddressesTxsRequestMessage{
Addresses: addresses,
RequiredConfirmations: requiredConfirmations,
IncludePending: includePending,
IncludeSending: includeSending,
IncludeReceiving: includeReceiving,
}
}
// NotifyAddressesTxsResponseMessage is an appmessage corresponding to
// its respective RPC message
type NotifyAddressesTxsResponseMessage struct {
baseMessage
Error *RPCError
}
// Command returns the protocol command string for the message
func (msg *NotifyAddressesTxsResponseMessage) Command() MessageCommand {
return CmdNotifyAddressesTxsResponseMessage
}
// NewNotifyAddressesTxsResponseMessage returns a instance of the message
func NewNotifyAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage {
return &NotifyAddressesTxsResponseMessage{}
}
// AddressesTxsNotificationMessage is an appmessage corresponding to
// its respective RPC message
type AddressesTxsNotificationMessage struct {
baseMessage
RequiredConfirmations uint32
Pending *TxEntriesByAddresses
Confirmed *TxEntriesByAddresses
Unconfirmed *TxEntriesByAddresses
}
// Command returns the protocol command string for the message
func (msg *AddressesTxsNotificationMessage) Command() MessageCommand {
return CmdAddressesTxsNotificationMessage
}
// NewAddressesTxsNotificationMessage returns a instance of the message
func NewAddressesTxsNotificationMessage(requiredConfirmations uint32, pending *TxEntriesByAddresses,
confirmed *TxEntriesByAddresses, unconfirmed *TxEntriesByAddresses) *AddressesTxsNotificationMessage {
return &AddressesTxsNotificationMessage{
RequiredConfirmations: requiredConfirmations,
Pending: pending,
Confirmed: confirmed,
Unconfirmed: unconfirmed,
}
}
// TxEntriesByAddresses is an appmessage corresponding to
// its respective RPC message
type TxEntriesByAddresses struct {
Sent []*TxEntryByAddress
Received []*TxEntryByAddress
}
// TxEntryByAddress is an appmessage corresponding to
// its respective RPC message
type TxEntryByAddress struct {
Address string
TxID string
Confirmations uint32
}