From b34cab46d62e297b63aa4adbf78502534638ab32 Mon Sep 17 00:00:00 2001 From: Maximilian Schneider Date: Thu, 1 Sep 2022 18:34:10 +0200 Subject: [PATCH] fix: add compute units to jsonrpc parser (#27466) add compute units to jsonrpc parser --- web3.js/src/connection.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 06d687785bc2ba..f1bd84e2ff54b6 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -913,6 +913,10 @@ export type ConfirmedTransactionMeta = { preTokenBalances?: Array | null; /** The token balances of the transaction accounts after processing */ postTokenBalances?: Array | null; + /** The addresses of the accounts loaded for the transaction */ + loadedAddresses?: LoadedAddresses | null; + /** The compute units consumed after processing the transaction */ + computeUnitsConsumed?: number | null; /** The error result of transaction processing */ err: TransactionError | null; /** The collection of addresses loaded using address lookup tables */ @@ -1993,6 +1997,7 @@ const ConfirmedTransactionMetaResult = pick({ preTokenBalances: optional(nullable(array(TokenBalanceResult))), postTokenBalances: optional(nullable(array(TokenBalanceResult))), loadedAddresses: optional(LoadedAddressesResult), + computeUnitsConsumed: optional(number()), }); /** @@ -2017,6 +2022,7 @@ const ParsedConfirmedTransactionMetaResult = pick({ preTokenBalances: optional(nullable(array(TokenBalanceResult))), postTokenBalances: optional(nullable(array(TokenBalanceResult))), loadedAddresses: optional(LoadedAddressesResult), + computeUnitsConsumed: optional(number()), }); const TransactionVersionStruct = union([literal(0), literal('legacy')]);