-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
api.go
45 lines (36 loc) · 1.03 KB
/
api.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
package functions
import "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api"
const (
MethodSecretsSet = "secrets_set"
MethodSecretsList = "secrets_list"
MethodHeartbeat = "heartbeat"
)
type SecretsSetRequest struct {
SlotID uint `json:"slot_id"`
Version uint64 `json:"version"`
Expiration int64 `json:"expiration"`
Payload []byte `json:"payload"`
Signature []byte `json:"signature"`
}
// SecretsListRequest has empty payload
type ResponseBase struct {
Success bool `json:"success"`
ErrorMessage string `json:"error_message,omitempty"`
}
type SecretsSetResponse struct {
ResponseBase
}
type SecretsListResponse struct {
ResponseBase
Rows []SecretsListRow `json:"rows,omitempty"`
}
type SecretsListRow struct {
SlotID uint `json:"slot_id"`
Version uint64 `json:"version"`
Expiration int64 `json:"expiration"`
}
// Gateway -> User response, which combines responses from several nodes
type CombinedResponse struct {
ResponseBase
NodeResponses []*api.Message `json:"node_responses"`
}