1
+ <?php
2
+
3
+
4
+ namespace GrapheneNodeClient \Commands ;
5
+
6
+
7
+ class HiveApiMethods
8
+ {
9
+ /**
10
+ * [ 'method_name' => [ 'apiName' => 'api_name', 'fields'=>['массив с полями из команды']]];
11
+ *
12
+ * @var array
13
+ */
14
+ public static $ map = [
15
+ 'get_block ' => [
16
+ 'apiName ' => 'database_api ' ,
17
+ 'fields ' => [
18
+ '0 ' => ['integer ' ], //block_id
19
+ ]
20
+ ],
21
+ 'get_accounts ' => [
22
+ 'apiName ' => 'database_api ' ,
23
+ 'fields ' => [
24
+ '0 ' => ['array ' ], //authors
25
+ ]
26
+ ],
27
+ 'get_account_count ' => [
28
+ 'apiName ' => 'database_api ' ,
29
+ 'fields ' => []
30
+ ],
31
+ 'get_account_history ' => [
32
+ 'apiName ' => 'database_api ' ,
33
+ 'fields ' => [
34
+ '0 ' => ['string ' ], //authors
35
+ '1 ' => ['integer ' ], //from
36
+ '2 ' => ['integer ' ], //limit max 2000
37
+ ]
38
+ ],
39
+ 'get_account_votes ' => [
40
+ 'apiName ' => 'database_api ' ,
41
+ 'fields ' => [
42
+ '0 ' => ['string ' ], //account name
43
+ ]
44
+ ],
45
+ 'get_active_votes ' => [
46
+ 'apiName ' => 'database_api ' ,
47
+ 'fields ' => [
48
+ '0 ' => ['string ' ], //author
49
+ '1 ' => ['string ' ], //permlink
50
+ ]
51
+ ],
52
+ 'get_active_witnesses ' => [
53
+ 'apiName ' => 'database_api ' ,
54
+ 'fields ' => [
55
+ ]
56
+ ],
57
+ 'get_content ' => [
58
+ 'apiName ' => 'database_api ' ,
59
+ 'fields ' => [
60
+ '0 ' => ['string ' ], //author
61
+ '1 ' => ['string ' ], //permlink
62
+ ]
63
+ ],
64
+ 'get_block_header ' => [
65
+ 'apiName ' => 'database_api ' ,
66
+ 'fields ' => [
67
+ '0 ' => ['integer ' ], //block_id
68
+ ]
69
+ ],
70
+ 'get_chain_properties ' => [
71
+ 'apiName ' => 'database_api ' ,
72
+ 'fields ' => [
73
+ ]
74
+ ],
75
+ 'get_config ' => [
76
+ 'apiName ' => 'database_api ' ,
77
+ 'fields ' => [
78
+ ]
79
+ ],
80
+ 'get_content_replies ' => [
81
+ 'apiName ' => 'database_api ' ,
82
+ 'fields ' => [
83
+ '0 ' => ['string ' ], //author
84
+ '1 ' => ['string ' ], //permlink
85
+ ]
86
+ ],
87
+ 'get_current_median_history_price ' => [
88
+ 'apiName ' => 'database_api ' ,
89
+ 'fields ' => [
90
+ ]
91
+ ],
92
+ 'get_discussions_by_author_before_date ' => [
93
+ 'apiName ' => 'database_api ' ,
94
+ 'fields ' => [
95
+ '0 ' => ['string ' ], //'author',
96
+ '1 ' => ['string ' ], //'start_permlink' for pagination,
97
+ '2 ' => ['string ' ], //'before_date'
98
+ '3 ' => ['integer ' ], //'limit'
99
+ ]
100
+ ],
101
+ 'get_discussions_by_blog ' => [
102
+ 'apiName ' => 'database_api ' ,
103
+ 'fields ' => [
104
+ '*:tag ' => ['string ' ], //'author',
105
+ '*:limit ' => ['integer ' ], //'limit'
106
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
107
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
108
+ ]
109
+ ],
110
+ 'get_discussions_by_comments ' => [
111
+ 'apiName ' => 'database_api ' ,
112
+ 'fields ' => [
113
+ '*:limit ' => ['integer ' ], //'limit'
114
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
115
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
116
+ ]
117
+ ],
118
+ 'get_discussions_by_created ' => [
119
+ 'apiName ' => 'database_api ' ,
120
+ 'fields ' => [
121
+ '*:tag ' => ['nullOrString ' ], //'author',
122
+ '*:limit ' => ['integer ' ], //'limit'
123
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
124
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
125
+ ]
126
+ ],
127
+ 'get_discussions_by_feed ' => [
128
+ 'apiName ' => 'database_api ' ,
129
+ 'fields ' => [
130
+ '*:tag ' => ['string ' ], //'author',
131
+ '*:limit ' => ['integer ' ], //'limit'
132
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
133
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
134
+ ]
135
+ ],
136
+ 'get_discussions_by_trending ' => [
137
+ 'apiName ' => 'database_api ' ,
138
+ 'fields ' => [
139
+ '*:tag ' => ['nullOrString ' ], //'author',
140
+ '*:limit ' => ['integer ' ], //'limit'
141
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
142
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
143
+ ]
144
+ ],
145
+ 'get_dynamic_global_properties ' => [
146
+ 'apiName ' => 'database_api ' ,
147
+ 'fields ' => [
148
+ ]
149
+ ],
150
+ 'get_feed_history ' => [
151
+ 'apiName ' => 'witness_api ' ,
152
+ 'fields ' => [
153
+ ]
154
+ ],
155
+ 'get_follow_count ' => [
156
+ 'apiName ' => 'follow_api ' ,
157
+ 'fields ' => [
158
+ '0 ' => ['string ' ], //author
159
+ ]
160
+ ],
161
+ 'get_ops_in_block ' => [
162
+ 'apiName ' => 'database_api ' ,
163
+ 'fields ' => [
164
+ '0 ' => ['integer ' ], //blockNum
165
+ '1 ' => ['bool ' ], //onlyVirtual
166
+ ]
167
+ ],
168
+ 'get_transaction ' => [
169
+ 'apiName ' => 'database_api ' ,
170
+ 'fields ' => [
171
+ '0 ' => ['string ' ], //trxId
172
+ ]
173
+ ],
174
+ 'get_reward_fund ' => [
175
+ 'apiName ' => 'database_api ' ,
176
+ 'fields ' => [
177
+ '0 ' => ['string ' ], //post or comments
178
+ ]
179
+ ],
180
+ 'get_trending_categories ' => [
181
+ 'apiName ' => 'database_api ' ,
182
+ 'fields ' => [
183
+ '0 ' => ['nullOrString ' ], //after
184
+ '1 ' => ['integer ' ], //permlink
185
+ ]
186
+ ],
187
+ 'get_trending_tags ' => [
188
+ 'apiName ' => 'database_api ' ,
189
+ 'fields ' => [
190
+ '0 ' => ['nullOrString ' ], //after
191
+ '1 ' => ['integer ' ], //permlink
192
+ ]
193
+ ],
194
+ 'get_witnesses_by_vote ' => [
195
+ 'apiName ' => 'database_api ' ,
196
+ 'fields ' => [
197
+ '0 ' => ['string ' ], //from accountName, can be empty string ''
198
+ '1 ' => ['integer ' ] //limit
199
+ ]
200
+ ],
201
+ 'get_witness_by_account ' => [
202
+ 'apiName ' => 'witness_api ' ,
203
+ 'fields ' => [
204
+ '0 ' => ['string ' ] //account
205
+ ]
206
+ ],
207
+ 'get_followers ' => [
208
+ 'apiName ' => 'follow_api ' ,
209
+ 'fields ' => [
210
+ '0 ' => ['string ' ], //author
211
+ '1 ' => ['nullOrString ' ], //startFollower
212
+ '2 ' => ['string ' ], //followType //blog, ignore
213
+ '3 ' => ['integer ' ], //limit
214
+ ]
215
+ ],
216
+ 'login ' => [
217
+ 'apiName ' => 'login_api ' ,
218
+ 'fields ' => [
219
+ 0 => ['string ' ],
220
+ 1 => ['string ' ]
221
+ ]
222
+ ],
223
+ 'get_version ' => [
224
+ 'apiName ' => 'login_api ' ,
225
+ 'fields ' => [
226
+ ]
227
+ ],
228
+ 'get_api_by_name ' => [
229
+ 'apiName ' => 'login_api ' ,
230
+ 'fields ' => [
231
+ '0 ' => ['string ' ], //'api_name',for example follow_api, database_api, login_api and ect.
232
+ ]
233
+ ],
234
+ 'get_ticker ' => [
235
+ 'apiName ' => 'market_history ' ,
236
+ 'fields ' => [
237
+ ]
238
+ ],
239
+ 'broadcast_transaction ' => [
240
+ 'apiName ' => 'network_broadcast_api ' ,
241
+ 'fields ' => [
242
+ '0:ref_block_num ' => ['integer ' ],
243
+ '0:ref_block_prefix ' => ['integer ' ],
244
+ '0:expiration ' => ['string ' ],
245
+ '0:operations:*:0 ' => ['string ' ],
246
+ '0:operations:*:1 ' => ['array ' ],
247
+ '0:extensions ' => ['array ' ],
248
+ '0:signatures ' => ['array ' ]
249
+ ]
250
+ ],
251
+ 'broadcast_transaction_synchronous ' => [
252
+ 'apiName ' => 'network_broadcast_api ' ,
253
+ 'fields ' => [
254
+ '0:ref_block_num ' => ['integer ' ],
255
+ '0:ref_block_prefix ' => ['integer ' ],
256
+ '0:expiration ' => ['string ' ],
257
+ '0:operations:*:0 ' => ['string ' ],
258
+ '0:operations:*:1 ' => ['array ' ],
259
+ '0:extensions ' => ['array ' ],
260
+ '0:signatures ' => ['array ' ]
261
+ ]
262
+ ],
263
+ 'get_transaction_hex ' => [
264
+ 'apiName ' => 'database_api ' ,
265
+ 'fields ' => [
266
+ '0:ref_block_num ' => ['integer ' ],
267
+ '0:ref_block_prefix ' => ['integer ' ],
268
+ '0:expiration ' => ['string ' ],
269
+ '0:operations:*:0 ' => ['string ' ],
270
+ '0:operations:*:1 ' => ['array ' ],
271
+ '0:extensions ' => ['array ' ],
272
+ '0:signatures ' => ['array ' ]
273
+ ]
274
+ ],
275
+ ];
276
+ }
0 commit comments