-
Notifications
You must be signed in to change notification settings - Fork 197
/
dtos.go
93 lines (80 loc) · 3.54 KB
/
dtos.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 common
import (
"github.com/multiversx/mx-chain-core-go/data/alteredAccount"
)
// GetProofResponse is a struct that stores the response of a GetProof API request
type GetProofResponse struct {
Proof [][]byte
Value []byte
RootHash string
}
// TransactionsPoolAPIResponse is a struct that holds the data to be returned when getting the transaction pool from an API call
type TransactionsPoolAPIResponse struct {
RegularTransactions []Transaction `json:"regularTransactions"`
SmartContractResults []Transaction `json:"smartContractResults"`
Rewards []Transaction `json:"rewards"`
}
// Transaction is a struct that holds transaction fields to be returned when getting the transactions from pool
type Transaction struct {
TxFields map[string]interface{} `json:"txFields"`
}
// TransactionsPoolForSenderApiResponse is a struct that holds the data to be returned when getting the transactions for a sender from an API call
type TransactionsPoolForSenderApiResponse struct {
Transactions []Transaction `json:"transactions"`
}
// NonceGapApiResponse is a struct that holds a nonce gap from transactions pool
// From - first unknown nonce
// To - last unknown nonce
type NonceGapApiResponse struct {
From uint64 `json:"from"`
To uint64 `json:"to"`
}
// TransactionsPoolNonceGapsForSenderApiResponse is a struct that holds the data to be returned when getting the nonce gaps from transactions pool for a sender from an API call
type TransactionsPoolNonceGapsForSenderApiResponse struct {
Sender string `json:"sender"`
Gaps []NonceGapApiResponse `json:"gaps"`
}
// DelegationDataAPI will be used when requesting the genesis balances from API
type DelegationDataAPI struct {
Address string `json:"address"`
Value string `json:"value"`
}
// InitialAccountAPI represents the structure to be returned when requesting the genesis balances from API
type InitialAccountAPI struct {
Address string `json:"address"`
Supply string `json:"supply"`
Balance string `json:"balance"`
StakingValue string `json:"stakingvalue"`
Delegation DelegationDataAPI `json:"delegation"`
}
// EpochStartDataAPI holds fields from the first block in a given epoch
type EpochStartDataAPI struct {
Nonce uint64 `json:"nonce"`
Round uint64 `json:"round"`
Timestamp int64 `json:"timestamp"`
Epoch uint32 `json:"epoch"`
Shard uint32 `json:"shard"`
PrevBlockHash string `json:"prevBlockHash"`
StateRootHash string `json:"stateRootHash"`
ScheduledRootHash string `json:"scheduledRootHash"`
AccumulatedFees string `json:"accumulatedFees,omitempty"`
DeveloperFees string `json:"developerFees,omitempty"`
}
// AlteredAccountsForBlockAPIResponse holds the altered accounts for a certain block
type AlteredAccountsForBlockAPIResponse struct {
Accounts []*alteredAccount.AlteredAccount `json:"accounts"`
}
// AuctionNode holds data needed for a node in auction to respond to API calls
type AuctionNode struct {
BlsKey string `json:"blsKey"`
Qualified bool `json:"qualified"`
}
// AuctionListValidatorAPIResponse holds the data needed for an auction node validator for responding to API calls
type AuctionListValidatorAPIResponse struct {
Owner string `json:"owner"`
NumStakedNodes int64 `json:"numStakedNodes"`
TotalTopUp string `json:"totalTopUp"`
TopUpPerNode string `json:"topUpPerNode"`
QualifiedTopUp string `json:"qualifiedTopUp"`
Nodes []*AuctionNode `json:"nodes"`
}