From 77329b7ddfc63d708685f0dcbffbe1b9094f7824 Mon Sep 17 00:00:00 2001 From: Toni Tabak Date: Mon, 10 Jul 2023 14:36:47 +0200 Subject: [PATCH] fix: transaction_failure_reason --- src/types/provider/response.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/types/provider/response.ts b/src/types/provider/response.ts index f29fa83bb..5dbb73e21 100644 --- a/src/types/provider/response.ts +++ b/src/types/provider/response.ts @@ -40,7 +40,12 @@ export interface GetCodeResponse { // abi: string; // is not consistent between rpc and sequencer (is it?), therefore not included in the provider interface } -export type GetTransactionResponse = InvokeTransactionResponse & DeclareTransactionResponse; +export type GetTransactionResponse = (InvokeTransactionResponse | DeclareTransactionResponse) & { + transaction_failure_reason?: { + code: string; + error_message: string; + }; +}; export interface CommonTransactionResponse { transaction_hash?: string; @@ -67,9 +72,15 @@ export interface DeclareTransactionResponse extends CommonTransactionResponse { sender_address?: string; } -export type GetTransactionReceiptResponse = +export type GetTransactionReceiptResponse = ( | InvokeTransactionReceiptResponse - | DeclareTransactionReceiptResponse; + | DeclareTransactionReceiptResponse +) & { + transaction_failure_reason?: { + code: string; + error_message: string; + }; +}; export interface CommonTransactionReceiptResponse { transaction_hash: string;