From a232725099893b45fd6feda0a4cac7d05f903435 Mon Sep 17 00:00:00 2001 From: Janek Rahrt Date: Thu, 16 Jun 2022 20:09:55 +0200 Subject: [PATCH] fix: response type for get-transaction --- src/types/api.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/types/api.ts b/src/types/api.ts index e355ce305..758bf6d26 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -125,6 +125,10 @@ export type InvokeFunctionTransaction = { version?: BigNumberish; }; +export interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction { + transaction_hash: string; +} + export type InvokeFunctionTrace = { caller_address: string; contract_address: string; @@ -157,6 +161,10 @@ export type CallContractTransaction = Omit< >; export type Transaction = DeclareTransaction | DeployTransaction | InvokeFunctionTransaction; +export type TransactionResponse = + | DeclareTransaction + | DeployTransaction + | InvokeFunctionTransactionResponse; export type CallContractResponse = { result: string[]; @@ -167,7 +175,7 @@ export type GetBlockResponse = { state_root: string; block_hash: string; transactions: { - [txHash: string]: Transaction; + [txHash: string]: TransactionResponse; }; timestamp: number; transaction_receipts: { @@ -221,7 +229,7 @@ export type GetTransactionTraceResponse = { export type SuccessfulTransactionResponse = { status: Status; - transaction: Transaction; + transaction: TransactionResponse; block_hash: string; block_number: BlockNumber; transaction_index: number; @@ -233,7 +241,7 @@ export type FailedTransactionResponse = { code: string; error_message: string; }; - transaction: Transaction; + transaction: TransactionResponse; }; export type GetTransactionResponse = SuccessfulTransactionResponse | FailedTransactionResponse;