mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-29 21:55:33 +00:00
25 lines
1.0 KiB
TypeScript
25 lines
1.0 KiB
TypeScript
import { ConfirmedTransaction } from '@/data/proto/3_3/ConfirmedTransaction'
|
|
import { timestampSecondsToDate } from '@/utils/typeConverter'
|
|
|
|
import { AbstractLoggingView } from './AbstractLogging.view'
|
|
import { GradidoTransactionLoggingView } from './GradidoTransactionLogging.view'
|
|
|
|
export class ConfirmedTransactionLoggingView extends AbstractLoggingView {
|
|
public constructor(private self: ConfirmedTransaction) {
|
|
super()
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
public toJSON(): any {
|
|
return {
|
|
id: this.self.id.toString(),
|
|
transaction: new GradidoTransactionLoggingView(this.self.transaction).toJSON(),
|
|
confirmedAt: this.dateToString(timestampSecondsToDate(this.self.confirmedAt)),
|
|
versionNumber: this.self.versionNumber,
|
|
runningHash: Buffer.from(this.self.runningHash).toString(this.bufferStringFormat),
|
|
messageId: Buffer.from(this.self.messageId).toString(this.bufferStringFormat),
|
|
accountBalance: this.self.accountBalance,
|
|
}
|
|
}
|
|
}
|