mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
Add SV2 DATUM payout hardening
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import { Column, Entity, Index, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
import { PayoutSnapshotEntryEntity } from './payout-snapshot-entry.entity';
|
||||
|
||||
@Entity({ name: 'payout_snapshot' })
|
||||
@Index('IDX_payout_snapshot_latest', ['status', 'createdAt'])
|
||||
@Index('IDX_payout_snapshot_window', ['windowEndShareIndex'])
|
||||
export class PayoutSnapshotEntity {
|
||||
@PrimaryGeneratedColumn({ type: 'bigint' })
|
||||
id: string;
|
||||
|
||||
@Column({ length: 32, type: 'varchar' })
|
||||
method: string;
|
||||
|
||||
@Column({ length: 16, type: 'varchar', default: 'finalized' })
|
||||
status: 'finalized';
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
blockHeight: number;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
coinbaseValueSats: string;
|
||||
|
||||
@Column({ type: 'decimal' })
|
||||
networkDifficulty: number;
|
||||
|
||||
@Column({ type: 'decimal', default: 0 })
|
||||
windowTargetDifficulty: number;
|
||||
|
||||
@Column({ type: 'decimal', default: 4 })
|
||||
windowFactor: number;
|
||||
|
||||
@Column({ length: 62, type: 'varchar', nullable: true })
|
||||
feeAddress?: string | null;
|
||||
|
||||
@Column({ type: 'bigint', default: 0 })
|
||||
feeSats: string;
|
||||
|
||||
@Column({ type: 'integer', default: 546 })
|
||||
minPayoutSats: number;
|
||||
|
||||
@Column({ type: 'integer', default: 50000 })
|
||||
coinbaseWeightBudget: number;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
startBatchId: string;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
endBatchId: string;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
windowStartShareIndex: string;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
windowEndShareIndex: string;
|
||||
|
||||
@Column({ type: 'decimal' })
|
||||
totalCreditedDifficulty: number;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
totalAcceptedShareCount: string;
|
||||
|
||||
@Column({ type: 'integer' })
|
||||
eligibleAddressCount: number;
|
||||
|
||||
@Column({ type: 'integer' })
|
||||
includedOutputCount: number;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
distributedSats: string;
|
||||
|
||||
@Column({ type: 'bigint' })
|
||||
unallocatedRemainderSats: string;
|
||||
|
||||
@Column({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
|
||||
createdAt: Date;
|
||||
|
||||
@OneToMany(() => PayoutSnapshotEntryEntity, entry => entry.snapshot)
|
||||
entries: PayoutSnapshotEntryEntity[];
|
||||
}
|
||||
Reference in New Issue
Block a user