Skip to content

Commit fef8481

Browse files
authored
Merge pull request #25 from denis-skripnik/master
New nodes urls and new commend
2 parents de8cd01 + 0d5b61e commit fef8481

17 files changed

+466
-10
lines changed

Commands/Commands.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ public function __call($name, $params)
154154
$api = GolosApiMethods::$map;
155155
} elseif ($platform === ConnectorInterface::PLATFORM_STEEMIT) {
156156
$api = SteemitApiMethods::$map;
157+
} elseif ($platform === ConnectorInterface::PLATFORM_HIVE) {
158+
$api = HiveApiMethods::$map;
157159
} elseif ($platform === ConnectorInterface::PLATFORM_VIZ) {
158160
$api = VizApiMethods::$map;
159161
} elseif ($platform === ConnectorInterface::PLATFORM_WHALESHARES) {

Commands/GolosApiMethods.php

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ class GolosApiMethods
3333
'fields' => [
3434
'0' => ['string'], //authors
3535
'1' => ['integer'], //from
36-
'2' => ['integer'], //limit max 2000
37-
]
36+
'2' => ['integer'], //limit max 10000
37+
'3' => ['array'], //query
38+
]
3839
],
3940
'get_account_votes' => [
4041
'apiName' => 'social_network',
@@ -62,6 +63,11 @@ class GolosApiMethods
6263
'0' => ['integer'], //block_id
6364
]
6465
],
66+
'get_chain_properties' => [
67+
'apiName' => 'database_api',
68+
'fields' => [
69+
]
70+
],
6571
'get_config' => [
6672
'apiName' => 'database_api',
6773
'fields' => [
@@ -177,6 +183,12 @@ class GolosApiMethods
177183
'1' => ['bool'], //onlyVirtual
178184
]
179185
],
186+
'get_transaction' => [
187+
'apiName' => 'operation_history',
188+
'fields' => [
189+
'0' => ['string'], //trxId
190+
]
191+
],
180192
'get_trending_tags' => [
181193
'apiName' => 'tags',
182194
'fields' => [
@@ -191,6 +203,12 @@ class GolosApiMethods
191203
'1' => ['integer'] //limit
192204
]
193205
],
206+
'get_witness_by_account' => [
207+
'apiName' => 'witness_api',
208+
'fields' => [
209+
'0' => ['string'] //account
210+
]
211+
],
194212
'get_followers' => [
195213
'apiName' => 'follow',
196214
'fields' => [
@@ -200,6 +218,15 @@ class GolosApiMethods
200218
'3' => ['integer'], //limit
201219
]
202220
],
221+
'get_following' => [
222+
'apiName' => 'follow',
223+
'fields' => [
224+
'0' => ['string'], //author
225+
'1' => ['nullOrString'], //startFollower
226+
'2' => ['string'], //followType //blog, ignore
227+
'3' => ['integer'], //limit
228+
]
229+
],
203230
'get_follow_count' => [
204231
'apiName' => 'follow',
205232
'fields' => [
@@ -252,5 +279,14 @@ class GolosApiMethods
252279
'0:signatures' => ['array']
253280
]
254281
],
282+
'get_vesting_delegations' => [
283+
'apiName' => 'database_api',
284+
'fields' => [
285+
'0' => ['string'], //account
286+
'1' => ['string'], //from
287+
'2' => ['integer'], //limit <= 100
288+
'3' => ['string'], //type //receive, delegated
289+
]
290+
],
255291
];
256292
}

Commands/HiveApiMethods.php

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
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+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
4+
namespace GrapheneNodeClient\Commands\Single;
5+
6+
7+
class GetChainPropertiesCommand extends CommandAbstract
8+
{
9+
/** @var string */
10+
protected $method = 'get_chain_properties';
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
4+
namespace GrapheneNodeClient\Commands\Single;
5+
6+
7+
class GetFollowingCommand extends CommandAbstract
8+
{
9+
/** @var string */
10+
protected $method = 'get_following';
11+
}

0 commit comments

Comments
 (0)