diff --git a/src/types/provider/response.ts b/src/types/provider/response.ts index f29fa83bb..8bc5c516e 100644 --- a/src/types/provider/response.ts +++ b/src/types/provider/response.ts @@ -40,7 +40,18 @@ 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 RejectedTransactionResponse = { + status: `${TransactionStatus.REJECTED}`; + transaction_failure_reason: { + code: string; + error_message: string; + }; +}; + +export type GetTransactionResponse = + | InvokeTransactionResponse + | DeclareTransactionResponse + | RejectedTransactionResponse; export interface CommonTransactionResponse { transaction_hash?: string; @@ -67,9 +78,13 @@ export interface DeclareTransactionResponse extends CommonTransactionResponse { sender_address?: string; } +export type RejectedTransactionReceiptResponse = RejectedTransactionResponse & + (InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse); + export type GetTransactionReceiptResponse = | InvokeTransactionReceiptResponse - | DeclareTransactionReceiptResponse; + | DeclareTransactionReceiptResponse + | RejectedTransactionReceiptResponse; export interface CommonTransactionReceiptResponse { transaction_hash: string;