cic-staff-client/src/app/_models/transaction.ts

68 lines
1.8 KiB
TypeScript
Raw Normal View History

2021-05-12 08:40:21 +02:00
// Application imports
2021-05-10 18:15:25 +02:00
import { AccountDetails } from '@app/_models/account';
2020-11-25 08:17:37 +01:00
2021-05-12 08:40:21 +02:00
/** Conversion object interface */
interface Conversion {
2021-05-12 09:52:28 +02:00
/** Final transaction token information. */
2021-05-12 08:40:21 +02:00
destinationToken: TxToken;
2021-05-12 09:52:28 +02:00
/** Initial transaction token amount. */
2021-05-12 08:40:21 +02:00
fromValue: number;
2021-05-12 09:52:28 +02:00
/** Initial transaction token information. */
2021-05-12 08:40:21 +02:00
sourceToken: TxToken;
2021-05-12 09:52:28 +02:00
/** Final transaction token amount. */
2021-05-12 08:40:21 +02:00
toValue: number;
2021-05-12 09:52:28 +02:00
/** Address of the initiator of the conversion. */
2021-05-12 08:40:21 +02:00
trader: string;
2021-05-12 09:52:28 +02:00
/** Conversion mining information. */
2021-05-12 08:40:21 +02:00
tx: Tx;
/** Account information of the initiator of the conversion. */
user: AccountDetails;
}
2021-05-12 08:40:21 +02:00
/** Transaction object interface */
interface Transaction {
2021-05-12 09:52:28 +02:00
/** Address of the transaction sender. */
from: string;
/** Account information of the transaction recipient. */
recipient: AccountDetails;
2021-05-12 09:52:28 +02:00
/** Account information of the transaction sender. */
sender: AccountDetails;
2021-05-12 09:52:28 +02:00
/** Address of the transaction recipient. */
to: string;
2021-05-12 09:52:28 +02:00
/** Transaction token information. */
token: TxToken;
2021-05-12 09:52:28 +02:00
/** Transaction mining information. */
tx: Tx;
2021-05-12 09:52:28 +02:00
/** Type of transaction. */
2021-04-30 14:50:16 +02:00
type?: string;
/** Amount of tokens transacted. */
value: number;
}
2021-05-12 08:40:21 +02:00
/** Transaction data interface */
interface Tx {
2021-05-12 09:52:28 +02:00
/** Transaction block number. */
2021-05-12 08:40:21 +02:00
block: number;
2021-05-12 09:52:28 +02:00
/** Transaction mining status. */
2021-05-12 08:40:21 +02:00
success: boolean;
2021-05-12 09:52:28 +02:00
/** Time transaction was mined. */
2021-05-12 08:40:21 +02:00
timestamp: number;
2021-05-12 09:52:28 +02:00
/** Hash generated by transaction. */
2021-05-12 08:40:21 +02:00
txHash: string;
2021-05-12 09:52:28 +02:00
/** Index of transaction in block. */
2021-05-12 08:40:21 +02:00
txIndex: number;
}
/** Transaction token object interface */
interface TxToken {
2021-05-12 09:52:28 +02:00
/** Address of the deployed token contract. */
2021-05-12 08:40:21 +02:00
address: string;
2021-05-12 09:52:28 +02:00
/** Name of the token. */
2021-05-12 08:40:21 +02:00
name: string;
2021-05-12 09:52:28 +02:00
/** The unique token symbol. */
2021-05-12 08:40:21 +02:00
symbol: string;
}
2021-05-12 08:40:21 +02:00
/** @exports */
2021-05-12 09:52:28 +02:00
export { Conversion, Transaction, Tx, TxToken };