-
Notifications
You must be signed in to change notification settings - Fork 655
/
common_args_responses.go
69 lines (56 loc) · 1.57 KB
/
common_args_responses.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
package api
import "github.com/ava-labs/avalanchego/ids"
// This file contains structs used in arguments and responses in services
// SuccessResponse indicates success of an API call
type SuccessResponse struct {
Success bool `json:"success"`
}
// JSONTxID contains the ID of a transaction
type JSONTxID struct {
TxID ids.ID `json:"txID"`
}
// UserPass contains a username and a password
type UserPass struct {
Username string `json:"username"`
Password string `json:"password"`
}
// JSONAddress contains an address
type JSONAddress struct {
Address string `json:"address"`
}
// JSONAddresses contains a list of address
type JSONAddresses struct {
Addresses []string `json:"addresses"`
}
// JSONChangeAddr is the address change is sent to, if any
type JSONChangeAddr struct {
ChangeAddr string `json:"changeAddr"`
}
// JSONTxIDChangeAddr is a tx ID and change address
type JSONTxIDChangeAddr struct {
JSONTxID
JSONChangeAddr
}
// JSONFromAddrs is a list of addresses to send funds from
type JSONFromAddrs struct {
From []string `json:"from"`
}
// JSONSpendHeader is 3 arguments to a method that spends (including those with tx fees)
// 1) The username/password
// 2) The addresses used in the method
// 3) The address to send change to
type JSONSpendHeader struct {
UserPass
JSONFromAddrs
JSONChangeAddr
}
// GetTxArgs ...
type GetTxArgs struct {
TxID ids.ID `json:"txID"`
Encoding string `json:"encoding"`
}
// FormattedTx defines a JSON formatted struct containing a Tx in CB58 format
type FormattedTx struct {
Tx string `json:"tx"`
Encoding string `json:"encoding"`
}