diff --git a/src/types/api/sequencer.ts b/src/types/api/sequencer.ts index d27e1ed90..5e8f8dea6 100644 --- a/src/types/api/sequencer.ts +++ b/src/types/api/sequencer.ts @@ -190,6 +190,7 @@ export namespace Sequencer { status: Status; gas_price: string; sequencer_address: string; + starknet_version: string; }; export type CallContractTransaction = Omit< diff --git a/src/types/provider.ts b/src/types/provider.ts index 9722338f7..5a05aba9e 100644 --- a/src/types/provider.ts +++ b/src/types/provider.ts @@ -15,6 +15,10 @@ export interface GetBlockResponse { parent_hash: string; status: Status; transactions: Array; + gas_price?: string; + sequencer_address?: string; + starknet_version?: string; + transaction_receipts?: any; } export interface GetCodeResponse { diff --git a/src/utils/responseParser/sequencer.ts b/src/utils/responseParser/sequencer.ts index 25a3eee32..3f86ccf93 100644 --- a/src/utils/responseParser/sequencer.ts +++ b/src/utils/responseParser/sequencer.ts @@ -19,12 +19,9 @@ import { ResponseParser } from '.'; export class SequencerAPIResponseParser extends ResponseParser { public parseGetBlockResponse(res: Sequencer.GetBlockResponse): GetBlockResponse { return { - timestamp: res.timestamp, - block_hash: res.block_hash, - block_number: res.block_number, + ...res, new_root: res.state_root, parent_hash: res.parent_block_hash, - status: res.status, transactions: Object.values(res.transactions) .map((value) => 'transaction_hash' in value && value.transaction_hash) .filter(Boolean) as Array, @@ -71,7 +68,7 @@ export class SequencerAPIResponseParser extends ResponseParser { ...('transaction_index' in res && { transaction_index: res.transaction_index }), ...('execution_resources' in res && { execution_resources: res.execution_resources }), ...('l1_to_l2_consumed_message' in res && { - l1_to_l2_consumed_message: res['l1_to_l2_consumed_message'], + l1_to_l2_consumed_message: res.l1_to_l2_consumed_message, }), ...('transaction_failure_reason' in res && { transaction_failure_reason: res.transaction_failure_reason,