File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,20 @@ export interface TokenInfo {
53
53
visible : string ,
54
54
info : string
55
55
}
56
+
57
+ export interface GetPools {
58
+ [ key : string ] : PoolInfo ;
59
+ }
60
+
61
+ export interface PoolInfo {
62
+ id : string ,
63
+ ticker : string ,
64
+ name : string ,
65
+ enabled : string ,
66
+ logo : string ,
67
+ last_delegator_refresh : string ,
68
+ loading_addr : string ,
69
+ description : string ,
70
+ visible : string ,
71
+ delegator_count : string
72
+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
14
14
} from "../client/src/entities/koios.entities" ;
15
15
import {
16
16
ClaimableToken ,
17
+ GetPools ,
17
18
GetRewards ,
18
19
GetTokens ,
19
20
SanitizeAddress ,
@@ -120,10 +121,19 @@ async function postPoolInfo(pools: string[]) {
120
121
return postFromKoios < PoolInfo [ ] > ( "pool_info" , { _pool_bech32_ids : pools } ) ;
121
122
}
122
123
124
+ async function getPools ( ) {
125
+ return getFromVM < GetPools > ( "get_pools" ) ;
126
+ }
127
+
123
128
async function getTokens ( ) {
124
129
return getFromVM < GetTokens > ( "get_tokens" ) ;
125
130
}
126
131
132
+ app . get ( "/getpools" , async ( req , res ) => {
133
+ const pools = await getPools ( ) ;
134
+ return res . status ( 200 ) . send ( pools ) ;
135
+ } ) ;
136
+
127
137
app . get ( "/getsettings" , async ( req , res ) => {
128
138
const settings = await getFromVM ( "get_settings" ) ;
129
139
return res . status ( 200 ) . send ( settings ) ;
You can’t perform that action at this time.
0 commit comments