@@ -48,12 +48,7 @@ class ApiClient {
4848
4949 async addRef ( transaction ) {
5050
51- let { blocks : latestBlock } = await this . getBlocks ( {
52- sort : '-timestamp' ,
53- limit : 1
54- } ) ;
55-
56- latestBlock = latestBlock [ 0 ] ;
51+ let latestBlock = await this . getLatestBlock ( ) ;
5752
5853 let latestBlockHash = latestBlock . hash ;
5954 let latestBlockNum = latestBlock . number ;
@@ -177,6 +172,7 @@ class ApiClient {
177172 params : Object . assign ( {
178173 sort : '-number' ,
179174 limit : 50 ,
175+ count : true ,
180176 } , options ) ,
181177 } ) ;
182178
@@ -186,12 +182,8 @@ class ApiClient {
186182 } ;
187183 }
188184 async getLatestBlock ( ) {
189- let { blocks} = await this . getBlocks ( {
190- sort : '-number' ,
191- limit : 1 ,
192- } ) ;
193-
194- return blocks [ 0 ] ;
185+ let { data} = await xhr . get ( `${ this . apiUrl } /api/block/latest` ) ;
186+ return data ;
195187 }
196188
197189 async getTransactions ( options = { } ) {
@@ -299,11 +291,21 @@ class ApiClient {
299291 return data ;
300292 }
301293
294+ async getRichList ( ) {
295+ let { data} = await xhr . get ( `${ this . apiUrl } /api/account/richlist` ) ;
296+ return data ;
297+ }
298+
302299 async getVotesForCurrentCycle ( ) {
303300 let { data} = await xhr . get ( `${ this . apiUrl } /api/vote/current-cycle` ) ;
304301 return data ;
305302 }
306303
304+ async getLiveVotes ( ) {
305+ let { data} = await xhr . get ( `${ this . apiUrl } /api/vote/live` ) ;
306+ return data . data ;
307+ }
308+
307309 async getTransferStats ( options = { } ) {
308310 let { data} = await xhr . get ( `${ this . apiUrl } /api/transfer/stats` , {
309311 params : Object . assign ( {
@@ -413,8 +415,8 @@ class ApiClient {
413415 return data ;
414416 }
415417
416- async getSyncStatus ( ) {
417- let { data} = await xhr . get ( `${ this . apiUrl } /api/system/sync ` ) ;
418+ async getSystemStatus ( ) {
419+ let { data} = await xhr . get ( `${ this . apiUrl } /api/system/status ` ) ;
418420 return data ;
419421 }
420422
0 commit comments