/**
 * Transaction-related types
 */
export var TransactionType;
(function (TransactionType) {
    TransactionType["shield"] = "shield";
    TransactionType["unshield"] = "unshield";
    TransactionType["transfer"] = "transfer";
})(TransactionType || (TransactionType = {}));
export var TransactionStatus;
(function (TransactionStatus) {
    TransactionStatus["pending"] = "pending";
    TransactionStatus["preconfirmed"] = "preconfirmed";
    TransactionStatus["completed"] = "completed";
    TransactionStatus["failed"] = "failed";
    TransactionStatus["blocked"] = "blocked";
})(TransactionStatus || (TransactionStatus = {}));
/**
 * Direction of a transaction from the user's perspective.
 * - incoming: User is receiving funds (shields, received transfers)
 * - outgoing: User is sending funds (unshields, sent transfers)
 */
export var TransactionDirection;
(function (TransactionDirection) {
    TransactionDirection["incoming"] = "incoming";
    TransactionDirection["outgoing"] = "outgoing";
})(TransactionDirection || (TransactionDirection = {}));
/**
 * Generate a pending transaction hash placeholder
 * Format: 0x followed by 64 hex chars (starts with zeros to indicate pending)
 */
export function generatePendingTxHash(type) {
    const timestamp = Date.now().toString(16).padStart(12, '0');
    const random = Math.random().toString(16).slice(2, 14).padStart(12, '0');
    // Prefix with zeros to indicate pending, then type indicator, timestamp, and random
    const typeCode = type === TransactionType.shield ? '01' : type === TransactionType.unshield ? '02' : '03';
    return `0x${'0'.repeat(38)}${typeCode}${timestamp}${random}`;
}
/**
 * Check if a txHash is a pending placeholder
 */
export function isPendingTxHash(txHash) {
    return txHash.startsWith('0x' + '0'.repeat(38));
}
//# sourceMappingURL=transaction.js.map