forked from qubic/qubic-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qxStruct.h
192 lines (169 loc) · 4.12 KB
/
qxStruct.h
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#pragma once
struct IssueAsset_input
{
uint64_t name;
int64_t numberOfUnits;
uint64_t unitOfMeasurement;
char numberOfDecimalPlaces;
};
struct AssetAskOrders_input
{
uint8_t issuer[32];
uint64_t assetName;
uint64_t offset;
};
struct AssetAskOrders_output
{
struct Order
{
uint8_t entity[32];
long long price;
long long numberOfShares;
};
Order orders[256];
};
struct AssetBidOrders_input
{
uint8_t issuer[32];
uint64_t assetName;
uint64_t offset;
};
struct AssetBidOrders_output
{
struct Order
{
uint8_t entity[32];
long long price;
long long numberOfShares;
};
Order orders[256];
};
struct EntityAskOrders_input
{
uint8_t entity[32];
uint64_t offset;
};
struct EntityAskOrders_output
{
struct Order
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
Order orders[256];
};
struct EntityBidOrders_input
{
uint8_t entity[32];
uint64_t offset;
};
struct EntityBidOrders_output
{
struct Order
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
Order orders[256];
};
struct qxGetAssetOrder_input{
uint8_t issuer[32];
uint64_t assetName;
uint64_t offset;
};
static_assert(sizeof(qxGetAssetOrder_input) == sizeof(AssetAskOrders_input), "wrong implementation");
static_assert(sizeof(qxGetAssetOrder_input) == sizeof(AssetBidOrders_input), "wrong implementation");
struct qxGetAssetOrder_output{
struct Order
{
uint8_t entity[32];
long long price;
long long numberOfShares;
};
Order orders[256];
};
static_assert(sizeof(qxGetAssetOrder_output) == sizeof(AssetAskOrders_output), "wrong implementation");
static_assert(sizeof(qxGetAssetOrder_output) == sizeof(AssetBidOrders_output), "wrong implementation");
struct qxGetEntityOrder_input{
uint8_t entity[32];
uint64_t offset;
};
static_assert(sizeof(qxGetEntityOrder_input) == sizeof(EntityAskOrders_input), "wrong implementation");
static_assert(sizeof(qxGetEntityOrder_input) == sizeof(EntityBidOrders_input), "wrong implementation");
struct qxGetEntityOrder_output{
struct Order
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
Order orders[256];
};
static_assert(sizeof(qxGetEntityOrder_output) == sizeof(EntityAskOrders_output), "wrong implementation");
static_assert(sizeof(qxGetEntityOrder_output) == sizeof(EntityBidOrders_output), "wrong implementation");
struct TransferAssetOwnershipAndPossession_input
{
uint8_t issuer[32];
uint8_t newOwnerAndPossessor[32];
unsigned long long assetName;
long long numberOfUnits;
};
struct AddToAskOrder_input
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
struct AddToAskOrder_output
{
long long addedNumberOfShares;
};
struct AddToBidOrder_input
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
struct AddToBidOrder_output
{
long long addedNumberOfShares;
};
struct RemoveFromAskOrder_input
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
struct RemoveFromAskOrder_output
{
long long removedNumberOfShares;
};
struct RemoveFromBidOrder_input
{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
struct RemoveFromBidOrder_output
{
long long removedNumberOfShares;
};
struct qxOrderAction_input{
uint8_t issuer[32];
uint64_t assetName;
long long price;
long long numberOfShares;
};
static_assert(sizeof(qxOrderAction_input) == sizeof(RemoveFromBidOrder_input), "wrong implementation");
static_assert(sizeof(qxOrderAction_input) == sizeof(RemoveFromAskOrder_input), "wrong implementation");
static_assert(sizeof(qxOrderAction_input) == sizeof(AddToBidOrder_input), "wrong implementation");
static_assert(sizeof(qxOrderAction_input) == sizeof(AddToAskOrder_input), "wrong implementation");