-
Notifications
You must be signed in to change notification settings - Fork 7
/
nanolletBlock.go
104 lines (81 loc) · 2.38 KB
/
nanolletBlock.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
94
95
96
97
98
99
100
101
102
103
104
package RPCClient
import (
"github.com/brokenbydefault/Nanollet/Numbers"
"github.com/brokenbydefault/Nanollet/Wallet"
"github.com/brokenbydefault/Nanollet/Block"
)
type DefaultRequest struct {
Action string `json:"action"`
App string `json:"app,omitempty"`
}
type DefaultResponse struct {
Error string `json:"error,omitempty"`
}
//--------------
type AccountsBalancesRequest struct {
Accounts []Wallet.Address `json:"accounts"`
DefaultRequest
}
type AccountBalance struct {
Balance *Numbers.RawAmount
Pending *Numbers.RawAmount
}
type AccountBalances struct {
Balances map[Wallet.Address]AccountBalance
DefaultResponse
}
type MultiplesAccountsBalance map[Wallet.Address]AccountBalance
//--------------
type AccountInformationRequest struct {
Account Wallet.Address `json:"account"`
Weight bool `json:"weight,omitempty"`
Pending bool `json:"pending,omitempty"`
DefaultRequest
}
type AccountInformation struct {
Frontier Block.BlockHash `json:"frontier"`
OpenBlock Block.BlockHash `json:"open_block"`
RepresentativeBlock Block.BlockHash `json:"representative_block"`
Balance *Numbers.RawAmount `json:"balance"`
BlockCount uint64 `json:"block_count,string"`
Pending *Numbers.RawAmount `json:"pending,omitempty"`
DefaultResponse
}
//--------------
type AccountHistoryRequest struct {
Account Wallet.Address `json:"account"`
Count int `json:"count"`
DefaultRequest
}
type SingleHistory struct {
Hash Block.BlockHash `json:"hash"`
Type string `json:"type"`
Account Wallet.Address `json:"account"`
Amount *Numbers.RawAmount `json:"amount"`
}
type AccountHistory []SingleHistory
//--------------
type AccountsPendingRequest struct {
Accounts []Wallet.Address `json:"accounts"`
Count int `json:"count"`
Threshold *Numbers.RawAmount `json:"threshold"`
Source bool `json:"source"`
DefaultRequest
}
type SinglePending struct {
Hash Block.BlockHash
Amount *Numbers.RawAmount
Source Wallet.Address
DefaultResponse
}
type AccountPending []SinglePending
type AccountsPendingOriginal map[string]SinglePending
type MultiplesAccountsPending map[Wallet.Address]AccountPending
//--------------
type ProcessBlock struct {
Hash Block.BlockHash
}
//--------------
type RetrieveBlock struct {
Block Block.BlockTransaction
}