Skip to content

Commit

Permalink
fix: transaction_failure_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Jul 10, 2023
1 parent 7bc96fa commit 77329b7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/types/provider/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 77329b7

Please sign in to comment.