Skip to content

Commit

Permalink
Feat: chain indexing status
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Sep 26, 2024
1 parent f29aa46 commit d55b923
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@safe-global/safe-gateway-typescript-sdk",
"version": "3.22.2",
"version": "3.22.3-beta.13",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
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 d55b923

Please sign in to comment.