-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathtransfer.model.ts
More file actions
32 lines (24 loc) · 988 Bytes
/
transfer.model.ts
File metadata and controls
32 lines (24 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, IntColumn as IntColumn_, DateTimeColumn as DateTimeColumn_, StringColumn as StringColumn_, ManyToOne as ManyToOne_, Index as Index_, BigIntColumn as BigIntColumn_} from "@subsquid/typeorm-store"
import {Account} from "./account.model"
@Entity_()
export class Transfer {
constructor(props?: Partial<Transfer>) {
Object.assign(this, props)
}
@PrimaryColumn_()
id!: string
@IntColumn_({nullable: false})
blockNumber!: number
@DateTimeColumn_({nullable: false})
timestamp!: Date
@StringColumn_({nullable: false})
tx!: string
@Index_()
@ManyToOne_(() => Account, {nullable: true, createForeignKeyConstraints: false})
from!: Account | undefined | null
@Index_()
@ManyToOne_(() => Account, {nullable: true, createForeignKeyConstraints: false})
to!: Account | undefined | null
@BigIntColumn_({nullable: false})
amount!: bigint
}