Skip to content

Commit

Permalink
feat: rename Failed to Rejected for transaction type
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Jul 11, 2023
1 parent 994925e commit 65b1ef4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/types/provider/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -51,7 +51,7 @@ export type FailedTransactionResponse = {
export type GetTransactionResponse =
| InvokeTransactionResponse
| DeclareTransactionResponse
| FailedTransactionResponse;
| RejectedTransactionResponse;

export interface CommonTransactionResponse {
transaction_hash?: string;
Expand All @@ -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;
Expand Down

0 comments on commit 65b1ef4

Please sign in to comment.