File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 11import { Service } from './service' ;
22import {
3+ AdaNetworkStats ,
34 AdaRewards ,
45 AdaSignedMessage ,
56 AdaSignedTx ,
@@ -300,4 +301,18 @@ export class AdaService extends Service {
300301 throw new Error ( err ) ;
301302 }
302303 }
304+
305+ /**
306+ * Retrieve ADA network stats
307+ */
308+ async getNetworkStats ( ) : Promise < AdaNetworkStats > {
309+ try {
310+ const { data } = await api . get < AdaNetworkStats > (
311+ `/v1/ada/network-stats` ,
312+ ) ;
313+ return data ;
314+ } catch ( err : any ) {
315+ throw new Error ( err ) ;
316+ }
317+ }
303318}
Original file line number Diff line number Diff line change @@ -68,4 +68,12 @@ export type AdaTx = {
6868 unsigned_tx_serialized : string ;
6969 inputs : TransactionInputsJSON ;
7070 } ;
71+ } ;
72+
73+ export type AdaNetworkStats = {
74+ data : {
75+ updated_at : string ;
76+ network_gross_apy : number ;
77+ supply_staked_percent : number ;
78+ } ;
7179} ;
You can’t perform that action at this time.
0 commit comments