Skip to content

Commit

Permalink
add ts docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanutIlie committed Jan 27, 2025
1 parent a558afa commit 2254f60
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export interface TrackedTransactionsSliceType {
transactions: SignedTransactionType[];
status?: TransactionBatchStatusesEnum | TransactionServerStatusesEnum;
errorMessage?: string;
/**
* Optional custom information to be displayed in the toast notification.
*/
transactionsDisplayInfo?: ITransactionsDisplayInfo;
};
}
35 changes: 35 additions & 0 deletions src/types/transactions.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,48 @@ export enum TransactionDirectionEnum {
OUT = 'Out'
}

/**
* Interface representing the display information for transactions.
* Each message corresponds to the title of the notification and the information it will display in the toast notification based on the transaction status.
*/
export interface ITransactionsDisplayInfo {
/**
* Optional error message to be displayed in notification title in notification title if the transaction fails.
*/
errorMessage?: string;

/**
* Optional success message to be displayed in notification title if the transaction succeeds.
*/
successMessage?: string;

/**
* Optional message to be displayed in notification title while the transaction is processing.
*/
processingMessage?: string;

/**
* Optional message to be displayed in notification title when the transaction is submitted.
*/
submittedMessage?: string;

/**
* Optional duration of the transaction in milliseconds.
*/
transactionDuration?: number;

/**
* Optional message to be displayed in notification title if the transaction times out.
*/
timedOutMessage?: string;

/**
* Optional message to be displayed in notification title if the transaction is invalid.
*/
invalidMessage?: string;

/**
* Optional message to be displayed in notification title when the transaction is received.
*/
receivedMessage?: string;
}

0 comments on commit 2254f60

Please sign in to comment.