1
+ <?php
2
+
3
+
4
+ namespace GrapheneNodeClient \Commands ;
5
+
6
+
7
+ class WhalesharesApiMethods
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 ' ], //author
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_block_header ' => [
58
+ 'apiName ' => 'database_api ' ,
59
+ 'fields ' => [
60
+ '0 ' => ['integer ' ], //block_id
61
+ ]
62
+ ],
63
+ 'get_config ' => [
64
+ 'apiName ' => 'database_api ' ,
65
+ 'fields ' => [
66
+ ]
67
+ ],
68
+ 'get_content ' => [
69
+ 'apiName ' => 'database_api ' ,
70
+ 'fields ' => [
71
+ '0 ' => ['string ' ], //author
72
+ '1 ' => ['string ' ] //permlink
73
+ ]
74
+ ],
75
+ 'get_content_replies ' => [
76
+ 'apiName ' => 'database_api ' ,
77
+ 'fields ' => [
78
+ '0 ' => ['string ' ], //author
79
+ '1 ' => ['string ' ] //permlink
80
+ ]
81
+ ],
82
+ 'get_discussions_by_author_before_date ' => [
83
+ 'apiName ' => 'database_api ' ,
84
+ 'fields ' => [
85
+ '0 ' => ['string ' ], //'author',
86
+ '1 ' => ['string ' ], //'start_permlink' for pagination,
87
+ '2 ' => ['string ' ], //'before_date'
88
+ '3 ' => ['integer ' ] //'limit'
89
+ ]
90
+ ],
91
+ 'get_discussions_by_blog ' => [
92
+ 'apiName ' => 'database_api ' ,
93
+ 'fields ' => [
94
+ '*:tag ' => ['string ' ], //'author',
95
+ '*:limit ' => ['integer ' ], //'limit'
96
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
97
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
98
+ ]
99
+ ],
100
+ 'get_discussions_by_created ' => [
101
+ 'apiName ' => 'database_api ' ,
102
+ 'fields ' => [
103
+ '*:tag ' => ['nullOrString ' ], //'author',
104
+ '*:limit ' => ['integer ' ], //'limit'
105
+ '*:start_author ' => ['nullOrString ' ], //'start_author' for pagination,
106
+ '*:start_permlink ' => ['nullOrString ' ] //'start_permlink' for pagination,
107
+ ],
108
+ ],
109
+ 'get_discussions_by_feed ' => [
110
+ 'apiName ' => 'database_api ' ,
111
+ 'fields ' => [
112
+ '*:tag ' => ['string ' ], //'author',
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_trending ' => [
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_dynamic_global_properties ' => [
128
+ 'apiName ' => 'database_api ' ,
129
+ 'fields ' => [
130
+ ]
131
+ ],
132
+ 'get_ops_in_block ' => [
133
+ 'apiName ' => 'database_api ' ,
134
+ 'fields ' => [
135
+ '0 ' => ['integer ' ], //blockNum
136
+ '1 ' => ['bool ' ], //onlyVirtual
137
+ ]
138
+ ],
139
+ 'get_trending_categories ' => [
140
+ 'apiName ' => 'database_api ' ,
141
+ 'fields ' => [
142
+ '0 ' => ['nullOrString ' ], //after
143
+ '1 ' => ['integer ' ], //permlink
144
+ ]
145
+ ],
146
+ 'get_trending_tags ' => [
147
+ 'apiName ' => 'database_api ' ,
148
+ 'fields ' => [
149
+ '0 ' => ['nullOrString ' ], //after
150
+ '1 ' => ['integer ' ], //permlink
151
+ ]
152
+ ],
153
+ 'get_witnesses_by_vote ' => [
154
+ 'apiName ' => 'database_api ' ,
155
+ 'fields ' => [
156
+ '0 ' => ['string ' ], //from accountName, can be empty string ''
157
+ '1 ' => ['integer ' ] //limit
158
+ ]
159
+ ],
160
+ 'get_followers ' => [
161
+ 'apiName ' => 'follow_api ' ,
162
+ 'fields ' => [
163
+ '0 ' => ['string ' ], //author
164
+ '1 ' => ['nullOrString ' ], //startFollower
165
+ '2 ' => ['string ' ], //followType //blog, ignore
166
+ '3 ' => ['integer ' ], //limit
167
+ ]
168
+ ],
169
+ 'login ' => [
170
+ 'apiName ' => 'login_api ' ,
171
+ 'fields ' => [
172
+ 0 => ['string ' ],
173
+ 1 => ['string ' ]
174
+ ]
175
+ ],
176
+ 'get_version ' => [
177
+ 'apiName ' => 'login_api ' ,
178
+ 'fields ' => [
179
+ ]
180
+ ],
181
+ 'get_api_by_name ' => [
182
+ 'apiName ' => 'login_api ' ,
183
+ 'fields ' => [
184
+ '0 ' => ['string ' ], //'api_name',for example follow_api, database_api, login_api and ect.
185
+ ]
186
+ ],
187
+ 'broadcast_transaction ' => [
188
+ 'apiName ' => 'network_broadcast_api ' ,
189
+ 'fields ' => [
190
+ '0:ref_block_num ' => ['integer ' ],
191
+ '0:ref_block_prefix ' => ['integer ' ],
192
+ '0:expiration ' => ['string ' ],
193
+ '0:operations:*:0 ' => ['string ' ],
194
+ '0:operations:*:1 ' => ['array ' ],
195
+ '0:extensions ' => ['array ' ],
196
+ '0:signatures ' => ['array ' ]
197
+ ]
198
+ ],
199
+ 'broadcast_transaction_synchronous ' => [
200
+ 'apiName ' => 'network_broadcast_api ' ,
201
+ 'fields ' => [
202
+ '0:ref_block_num ' => ['integer ' ],
203
+ '0:ref_block_prefix ' => ['integer ' ],
204
+ '0:expiration ' => ['string ' ],
205
+ '0:operations:*:0 ' => ['string ' ],
206
+ '0:operations:*:1 ' => ['array ' ],
207
+ '0:extensions ' => ['array ' ],
208
+ '0:signatures ' => ['array ' ]
209
+ ]
210
+ ],
211
+ ];
212
+ }
0 commit comments