Skip to content

Commit

Permalink
fix: missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolfopietro97 committed Oct 27, 2023
1 parent 6c8ace1 commit 215b642
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions packages/errors/src/model/transaction.ts
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
};

0 comments on commit 215b642

Please sign in to comment.