-
Notifications
You must be signed in to change notification settings - Fork 1
/
messages.go
93 lines (88 loc) · 3.19 KB
/
messages.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
88
89
90
91
92
93
package config
// MsgHub contains channels used by the components to send messages to each others
type MsgHub struct {
Notification chan AppMsg
AgentWalletIn chan AppMsg
TokenWalletIn chan AppMsg
}
func NewMsgHub() *MsgHub {
return &MsgHub{
Notification: make(chan AppMsg, 4096),
AgentWalletIn: make(chan AppMsg, 4096),
TokenWalletIn: make(chan AppMsg, 4096),
}
}
const (
// MsgBalances from chain to ui with a list of update balances
MsgBalances = iota
// MsgDidDoc from chain to ui with a did document (at startup)
MsgDidDoc
// MsgChainOfTrust returns the list of verifiable credentials for a DENOM
MsgChainOfTrust
// MsgPublicVCs returns the list of verifiable credentials
MsgPublicVCs
// MsgPublicVCData returns the details of a verifiable credential
MsgPublicVCData
// MsgMarketplaces used for marketplace listing
MsgMarketplaces
// MsgMarketplaceData used for details of a marketplace
MsgMarketplaceData
// MsgVCs returns the list of verifiable credentials
MsgVCs
// MsgVCData returns the details of a verifiable credential
MsgVCData
// MsgIssueVC add private verifiable credential to the wallet
MsgIssueVC
//MsgContactAdded used when a new contact si added
MsgContactAdded
// MsgUpdateContacts is used when updating all contacts in the list called every 30 seconds
// is updated by the aries connection data store
MsgUpdateContacts
// MsgUpdateContact used when updating a connection by connection ID
MsgUpdateContact
// MsgTextReceived used when receiving messages
MsgTextReceived
// MsgSendText used to send text messages
MsgSendText
// MsgSaveState persist state to the disk
MsgSaveState
// MsgCreateInvitation creates an invitation to be used in another aries client
MsgCreateInvitation
// MsgHandleInvitation handles a DIDExchange invitation
MsgHandleInvitation
// MsgApproveInvitation approves an invitation needed for edge to edge mediator/routing connections
MsgApproveInvitation
// MsgApproveRequest approves a request for edge to edge mediator/routing connections
MsgApproveRequest
// MsgAddMediator adds a contact as a mediator this enables message routing between edge clients
MsgAddMediator
// MsgGetConnectionStatus gets the connection status of a contact
MsgGetConnectionStatus
// MsgDIDAddVerificationMethod add a verification method to a DID
MsgDIDAddVerificationMethod
// MsgChainAddAddress generate a new address and expose it as a verifiable credential
MsgChainAddAddress
// MsgChainGetAddresses retrieve the blockchain addresses from the ssi wallet
MsgChainGetAddresses
// MsgSSIAddVC add a vc to the ssi wallet
MsgSSIAddVC
// MsgClipboard save stuff into the use clipboard
MsgClipboard
// MsgDeleteConnection deletes a connections from the aries agent
MsgDeleteConnection
// MsgPaymentRequest receive a payment request
MsgPaymentRequest
// MsgClearCredentials clear credentials from the local wallet
MsgClearCredentials
)
// AppMsg are messages that are exchanged within the app
type AppMsg struct {
Typ int // message type (see list above)
Payload interface{} // content of the message, the recipient must know how to process it
}
func NewAppMsg(typ int, payload interface{}) AppMsg {
return AppMsg{
Typ: typ,
Payload: payload,
}
}