Skip to content

Commit

Permalink
Feat: chain indexing status (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Sep 26, 2024
1 parent 70a9ec2 commit 776b08b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,4 +696,10 @@ export function putAccountDataSettings(
})
}

export function getIndexingStatus(chainId: string) {
return getEndpoint(baseUrl, '/v1/chains/{chainId}/about/indexing', {
path: { chainId },
})
}

/* eslint-enable @typescript-eslint/explicit-module-boundary-types */
23 changes: 22 additions & 1 deletion src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
NoncesResponse,
} from './transactions'
import type { SafeInfo, SafeOverview } from './safe-info'
import type { ChainListResponse, ChainInfo } from './chains'
import type { ChainListResponse, ChainInfo, ChainIndexingStatus } from './chains'
import type { SafeAppsResponse } from './safe-apps'
import type { AnyConfirmationView, DecodedDataRequest, DecodedDataResponse } from './decoded-data'
import type { MasterCopyReponse } from './master-copies'
Expand Down Expand Up @@ -429,6 +429,14 @@ export interface paths extends PathRegistry {
}
}
}
'/v1/chains/{chainId}/about/indexing': {
get: operations['get_indexing']
parameters: {
path: {
chainId: string
}
}
}
'/v1/subscriptions': {
delete: operations['unsubscribe_single']
parameters: {
Expand Down Expand Up @@ -1180,6 +1188,19 @@ export interface operations {
}
}
}
get_indexing: {
parameters: {
path: {
chainId: string
}
}

responses: {
200: {
schema: ChainIndexingStatus
}
}
}
unsubscribe_single: {
parameters: {
query: {
Expand Down
5 changes: 5 additions & 0 deletions src/types/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,8 @@ export type ChainInfo = {
}

export type ChainListResponse = Page<ChainInfo>

export type ChainIndexingStatus = {
lastSync: number
synced: boolean
}

0 comments on commit 776b08b

Please sign in to comment.