-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c8ace1
commit 215b642
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { ErrorBase } from './base'; | ||
import { type DefaultErrorData } from '../types'; | ||
|
||
/** | ||
* Invalid Transaction to sign. It is already signed. | ||
* | ||
* @param code - The error code from the error types enum. | ||
* @param message - The error message. | ||
* @param data - The error data. | ||
* @returns The error object. | ||
*/ | ||
class TransactionAlreadySignedError extends ErrorBase< | ||
TRANSACTION.ALREADY_SIGNED, | ||
DefaultErrorData | ||
> {} | ||
|
||
/** | ||
* Transaction not signed. | ||
* | ||
* @param code - The error code from the error types enum. | ||
* @param message - The error message. | ||
* @param data - The error data. | ||
* @returns The error object. | ||
*/ | ||
class TransactionNotSignedError extends ErrorBase< | ||
TRANSACTION.NOT_SIGNED, | ||
DefaultErrorData | ||
> {} | ||
|
||
/** | ||
* Invalid Transaction body. | ||
* | ||
* @param code - The error code from the error types enum. | ||
* @param message - The error message. | ||
* @param data - The error data. | ||
* @returns The error object. | ||
*/ | ||
class TransactionBodyError extends ErrorBase< | ||
TRANSACTION.INVALID_TRANSACTION_BODY, | ||
DefaultErrorData | ||
> {} | ||
|
||
/** | ||
* Invalid Delegation feature. | ||
* | ||
* @param code - The error code from the error types enum. | ||
* @param message - The error message. | ||
* @param data - The error data. | ||
* @returns The error object. | ||
*/ | ||
class TransactionDelegationError extends ErrorBase< | ||
TRANSACTION.INVALID_DELEGATION, | ||
DefaultErrorData | ||
> {} | ||
|
||
/** | ||
* Errors enum. | ||
* | ||
* @public | ||
*/ | ||
enum TRANSACTION { | ||
ALREADY_SIGNED = 'ALREADY_SIGNED', | ||
NOT_SIGNED = 'NOT_SIGNED', | ||
INVALID_TRANSACTION_BODY = 'INVALID_TRANSACTION_BODY', | ||
INVALID_DELEGATION = 'INVALID_DELEGATION' | ||
} | ||
|
||
export { | ||
TransactionAlreadySignedError, | ||
TransactionNotSignedError, | ||
TransactionBodyError, | ||
TransactionDelegationError, | ||
TRANSACTION | ||
}; |