Skip to content

Commit 776b08b

Browse files
authored
Feat: chain indexing status (#201)
1 parent 70a9ec2 commit 776b08b

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,4 +696,10 @@ export function putAccountDataSettings(
696696
})
697697
}
698698

699+
export function getIndexingStatus(chainId: string) {
700+
return getEndpoint(baseUrl, '/v1/chains/{chainId}/about/indexing', {
701+
path: { chainId },
702+
})
703+
}
704+
699705
/* eslint-enable @typescript-eslint/explicit-module-boundary-types */

src/types/api.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {
1818
NoncesResponse,
1919
} from './transactions'
2020
import type { SafeInfo, SafeOverview } from './safe-info'
21-
import type { ChainListResponse, ChainInfo } from './chains'
21+
import type { ChainListResponse, ChainInfo, ChainIndexingStatus } from './chains'
2222
import type { SafeAppsResponse } from './safe-apps'
2323
import type { AnyConfirmationView, DecodedDataRequest, DecodedDataResponse } from './decoded-data'
2424
import type { MasterCopyReponse } from './master-copies'
@@ -429,6 +429,14 @@ export interface paths extends PathRegistry {
429429
}
430430
}
431431
}
432+
'/v1/chains/{chainId}/about/indexing': {
433+
get: operations['get_indexing']
434+
parameters: {
435+
path: {
436+
chainId: string
437+
}
438+
}
439+
}
432440
'/v1/subscriptions': {
433441
delete: operations['unsubscribe_single']
434442
parameters: {
@@ -1180,6 +1188,19 @@ export interface operations {
11801188
}
11811189
}
11821190
}
1191+
get_indexing: {
1192+
parameters: {
1193+
path: {
1194+
chainId: string
1195+
}
1196+
}
1197+
1198+
responses: {
1199+
200: {
1200+
schema: ChainIndexingStatus
1201+
}
1202+
}
1203+
}
11831204
unsubscribe_single: {
11841205
parameters: {
11851206
query: {

src/types/chains.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,8 @@ export type ChainInfo = {
109109
}
110110

111111
export type ChainListResponse = Page<ChainInfo>
112+
113+
export type ChainIndexingStatus = {
114+
lastSync: number
115+
synced: boolean
116+
}

0 commit comments

Comments
 (0)