-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
63 lines (55 loc) · 2.22 KB
/
types.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
package rosetta
type NetworkIdentifier struct {
Blockchain string `json:"blockchain,omitempty"`
Network string `json:"network,omitempty"`
}
type RosettaRequest struct {
NetworkIdentifier NetworkIdentifier `json:"network_identifier,omitempty"`
BlockIdentifier BlockIdentifier `json:"block_identifier,omitempty"`
TransactionIdentifier TransactionIdentifier `json:"transaction_identifier,omitempty"`
}
type BlockIdentifier struct {
Index int64 `bson:"index" json:"index,omitempty"`
Hash string `bson:"hash" json:"hash,omitempty"`
}
type Peer struct {
Metadata map[string]interface{} `json:"metadata,omitempty"`
ID string `json:"peer_id,omitempty"`
}
type NetworkStatus struct {
CurrentBlockIdentifier BlockIdentifier `json:"current_block_identifier,omitempty"`
CurrentBlockTimestamp int64 `json:"current_block_timestamp,omitempty"`
GenesisBlockIdentifier BlockIdentifier `json:"genesis_block_identifier,omitempty"`
Peers []Peer `json:"peers,omitempty"`
}
type Block struct {
BlockIdentifier BlockIdentifier `json:"block_identifier,omitempty"`
ParentBlockIdentifier BlockIdentifier `json:"parent_block_identifier,omitempty"`
}
type AccountIdentifier struct {
Address string `json:"address,omitempty"`
}
type OperationIdentifier struct {
Index int64 `json:"index,omitempty"`
NetworkIndex int64 `json:"network_index,omitempty"`
}
type Operation struct {
OperationIdentifier OperationIdentifier `json:"operation_identifier,omitempty"`
Account *AccountIdentifier `json:"account,omitempty"`
}
type Metadata map[string]interface{}
type Transaction struct {
TransactionIdentifier TransactionIdentifier `json:"transaction_identifier,omitempty"`
Operations []Operation `json:"operations,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
}
type TransactionIdentifier struct {
Hash string `json:"hash,omitempty"`
}
type BlockResponse struct {
Block Block `json:"block,omitempty"`
OtherTransactions []TransactionIdentifier `json:"other_transactions,omitempty"`
}
type BlockTransactionResponse struct {
Transaction Transaction `json:"transaction,omitempty"`
}