first commit of refactor
This commit is contained in:
19
backend/domain/NormalizedTx.js
Normal file
19
backend/domain/NormalizedTx.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* NormalizedTx - Standardized transaction representation
|
||||
*
|
||||
* Defines the minimal, normalized transaction data relevant
|
||||
* for tracking blockchain activity.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} NormalizedTx
|
||||
* @property {string} hash - Transaction hash (0x prefixed)
|
||||
* @property {string} from - Sender address (lowercase, 0x prefixed)
|
||||
* @property {string|null} to - Recipient address (lowercase, 0x prefixed, null for contract creation)
|
||||
* @property {string} value - Value transferred in Wei (as string to preserve precision)
|
||||
* @property {number} blockNumber - Block number where transaction was included
|
||||
* @property {number} blockTimestamp - Unix timestamp of the block
|
||||
*/
|
||||
|
||||
export default {};
|
||||
|
||||
17
backend/domain/ObservedTx.js
Normal file
17
backend/domain/ObservedTx.js
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
/**
|
||||
* @typedef {import('./NormalizedTx.js').NormalizedTx} NormalizedTx
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ObservedTxMetadata
|
||||
* @property {number} addressId - ID of the tracked address (from addresses table)
|
||||
* @property {'incoming'|'outgoing'} direction - Direction relative to tracked address
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {NormalizedTx & ObservedTxMetadata} ObservedTx
|
||||
*/
|
||||
|
||||
export default {};
|
||||
|
||||
Reference in New Issue
Block a user