From 004671c395584eb57d3120caeecf24eba68efd4b Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Thu, 21 Sep 2023 20:35:17 +0200 Subject: [PATCH] Update API bindings --- .changelog/799.internal.md | 1 + internals/mocks/api.ts | 5 +++-- src/oasis-nexus/generated/api.ts | 16 ++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .changelog/799.internal.md diff --git a/.changelog/799.internal.md b/.changelog/799.internal.md new file mode 100644 index 000000000..882e70821 --- /dev/null +++ b/.changelog/799.internal.md @@ -0,0 +1 @@ +Update API bindings diff --git a/internals/mocks/api.ts b/internals/mocks/api.ts index b6e451f02..dfacea50e 100644 --- a/internals/mocks/api.ts +++ b/internals/mocks/api.ts @@ -4,11 +4,12 @@ export const runtimeStatusResponse: RuntimeStatus = { active_nodes: 0, latest_block: 719374, latest_block_time: '2023-08-03T09:13:34Z', - latest_update: '2023-08-03T09:13:50Z', + latest_update_age_ms: 749, } export const statusResponse: Status = { latest_block: 719374, latest_block_time: '2023-08-03T09:13:34Z', - latest_update: '2023-08-03T09:13:50Z', + latest_node_block: 719374, + latest_update_age_ms: 2000, } diff --git a/src/oasis-nexus/generated/api.ts b/src/oasis-nexus/generated/api.ts index 13fe85f7e..6445787e1 100644 --- a/src/oasis-nexus/generated/api.ts +++ b/src/oasis-nexus/generated/api.ts @@ -665,8 +665,8 @@ export interface RuntimeStatus { latest_block: number; /** The RFC 3339 formatted consensus time of when the latest indexed block for this runtime was produced. */ latest_block_time: string; - /** The RFC 3339 formatted time when Nexus processed the latest block for this runtime. Compare with current time for approximate indexing progress with the Oasis Network. */ - latest_update: string; + /** The number of milliseconds since Nexus processed the latest block. */ + latest_update_age_ms: number; } export interface RuntimeAccount { @@ -1569,12 +1569,16 @@ export type BlockListAllOf = { }; export interface Status { - /** The height of the most recent indexed block. Query a synced Oasis node for the latest block produced. */ + /** The height of the most recent indexed block. Compare with latest_node_block to measure +how far behind Nexus is from the chain. + */ latest_block: number; - /** The RFC 3339 formatted consensus time of when the most recent block was produced. */ + /** The height of the most recently produced block on-chain as seen by Nexus. */ + latest_node_block: number; + /** The RFC 3339 formatted consensus time of when the most recently indexed block was produced. */ latest_block_time: string; - /** The RFC 3339 formatted time when Nexus processed the latest block. Compare with current time for approximate indexing progress with the Oasis Network. */ - latest_update: string; + /** The number of milliseconds since Nexus processed the latest block. */ + latest_update_age_ms: number; } export interface List {