Skip to content

Commit 09a17cf

Browse files
committed
Update API bindings
1 parent f1f1247 commit 09a17cf

File tree

3 files changed

+217
-0
lines changed

3 files changed

+217
-0
lines changed

.changelog/2344.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update API bindings

src/oasis-nexus/api.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,31 @@ export const useGetRuntimeBlocks: typeof generated.useGetRuntimeBlocks = (
811811
})
812812
}
813813

814+
export const useGetRecentBlocks: typeof generated.useGetRecentBlocks = (network, options) => {
815+
return generated.useGetRecentBlocks(network, {
816+
...options,
817+
request: {
818+
...options?.request,
819+
transformResponse: [
820+
...arrayify(axios.defaults.transformResponse),
821+
(data: generated.RecentBlockList, headers, status) => {
822+
if (status !== 200) return data
823+
return {
824+
...data,
825+
blocks: data.blocks.map(block => {
826+
return {
827+
...block,
828+
network,
829+
}
830+
}),
831+
}
832+
},
833+
...arrayify(options?.request?.transformResponse),
834+
],
835+
},
836+
})
837+
}
838+
814839
export const useGetRuntimeEvmTokens: typeof generated.useGetRuntimeEvmTokens = (
815840
network,
816841
runtime,

src/oasis-nexus/generated/api.ts

Lines changed: 191 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)