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
|
|
|
/** Account information of the initiator of the conversion. */
|
2021-05-12 08:40:21 +02:00
|
|
|
user: AccountDetails;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Conversion mining information. */
|
2021-05-12 08:40:21 +02:00
|
|
|
tx: Tx;
|
2020-11-04 13:34:37 +01:00
|
|
|
}
|
|
|
|
|
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. */
|
2020-11-04 13:34:37 +01:00
|
|
|
from: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Account information of the transaction sender. */
|
2021-04-29 19:10:39 +02:00
|
|
|
sender: AccountDetails;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Address of the transaction recipient. */
|
2020-11-04 13:34:37 +01:00
|
|
|
to: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Account information of the transaction recipient. */
|
2021-04-29 19:10:39 +02:00
|
|
|
recipient: AccountDetails;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Transaction token information. */
|
2021-04-29 19:10:39 +02:00
|
|
|
token: TxToken;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Transaction mining information. */
|
2020-11-04 13:34:37 +01:00
|
|
|
tx: Tx;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Amount of tokens transacted. */
|
2020-11-04 13:34:37 +01:00
|
|
|
value: number;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Type of transaction. */
|
2021-04-30 14:50:16 +02:00
|
|
|
type?: string;
|
2020-11-04 13:34:37 +01:00
|
|
|
}
|
|
|
|
|
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;
|
2020-11-04 13:34:37 +01:00
|
|
|
}
|
2021-04-29 19:10:39 +02:00
|
|
|
|
2021-05-12 08:40:21 +02:00
|
|
|
/** @exports */
|
2021-05-12 09:52:28 +02:00
|
|
|
export { Conversion, Transaction, Tx, TxToken };
|