From 65b1ef432e2eda9f37574771d60b409a3f7ab049 Mon Sep 17 00:00:00 2001 From: Toni Tabak Date: Tue, 11 Jul 2023 13:34:24 +0200 Subject: [PATCH] feat: rename Failed to Rejected for transaction type --- src/types/provider/response.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/types/provider/response.ts b/src/types/provider/response.ts index bf5a371cf..8bc5c516e 100644 --- a/src/types/provider/response.ts +++ b/src/types/provider/response.ts @@ -40,8 +40,8 @@ export interface GetCodeResponse { // abi: string; // is not consistent between rpc and sequencer (is it?), therefore not included in the provider interface } -export type FailedTransactionResponse = { - status: TransactionStatus.REJECTED; +export type RejectedTransactionResponse = { + status: `${TransactionStatus.REJECTED}`; transaction_failure_reason: { code: string; error_message: string; @@ -51,7 +51,7 @@ export type FailedTransactionResponse = { export type GetTransactionResponse = | InvokeTransactionResponse | DeclareTransactionResponse - | FailedTransactionResponse; + | RejectedTransactionResponse; export interface CommonTransactionResponse { transaction_hash?: string; @@ -78,10 +78,13 @@ export interface DeclareTransactionResponse extends CommonTransactionResponse { sender_address?: string; } +export type RejectedTransactionReceiptResponse = RejectedTransactionResponse & + (InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse); + export type GetTransactionReceiptResponse = | InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse - | FailedTransactionResponse; + | RejectedTransactionReceiptResponse; export interface CommonTransactionReceiptResponse { transaction_hash: string;